summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathias Bauer <mba@openoffice.org>2009-09-09 11:45:13 +0200
committerMathias Bauer <mba@openoffice.org>2009-09-09 11:45:13 +0200
commitf1dd4efb7b36bd7d26ed92c7ecbbabefe67d8fb0 (patch)
treeeca2eebab12da5554e210a57e5e83353cd2f6454
parentdcb7e74c448f29b648d9462366b53904eb745836 (diff)
parent6738efb940d042acdeea59738b3610903ebe9a38 (diff)
merge commit to DEV300_m57
-rw-r--r--basic/inc/basic/sbstar.hxx1
-rw-r--r--basic/source/classes/sb.cxx6
-rw-r--r--basic/source/classes/sb.src2
-rw-r--r--basic/source/classes/sbunoobj.cxx315
-rw-r--r--basic/source/classes/sbxmod.cxx1
-rw-r--r--basic/source/comp/exprtree.cxx6
-rw-r--r--basic/source/comp/scanner.cxx12
-rw-r--r--basic/source/inc/runtime.hxx37
-rw-r--r--basic/source/inc/sbunoobj.hxx53
-rw-r--r--basic/source/runtime/runtime.cxx42
-rw-r--r--basic/source/runtime/step2.cxx10
-rw-r--r--basic/source/sbx/sbxvalue.cxx16
-rw-r--r--configmgr/source/inc/bootstrap.hxx1
-rw-r--r--configmgr/source/misc/bootstrap.cxx23
-rw-r--r--connectivity/inc/connectivity/DriversConfig.hxx88
-rw-r--r--connectivity/inc/connectivity/dbexception.hxx6
-rw-r--r--connectivity/inc/connectivity/dbmetadata.hxx7
-rw-r--r--connectivity/inc/connectivity/sqlnode.hxx13
-rw-r--r--connectivity/inc/connectivity/sqlparse.hxx3
-rw-r--r--connectivity/makefile.pmk66
-rw-r--r--connectivity/prj/build.lst14
-rw-r--r--connectivity/prj/d.lst4
-rw-r--r--connectivity/qa/connectivity/tools/AbstractDatabase.java230
-rw-r--r--connectivity/qa/connectivity/tools/DataSource.java81
-rw-r--r--connectivity/qa/connectivity/tools/DatabaseAccess.java66
-rw-r--r--connectivity/qa/connectivity/tools/DbaseDatabase.java100
-rw-r--r--connectivity/qa/connectivity/tools/HsqlDatabase.java338
-rw-r--r--connectivity/qa/drivers/dbase/DBaseDateFunctions.java375
-rw-r--r--connectivity/qa/drivers/dbase/DBaseDriverTest.java75
-rw-r--r--connectivity/qa/drivers/dbase/DBaseNumericFunctions.java456
-rw-r--r--connectivity/qa/drivers/dbase/DBaseSqlTests.java99
-rw-r--r--connectivity/qa/drivers/dbase/DBaseStringFunctions.java408
-rw-r--r--connectivity/qa/drivers/dbase/makefile.mk15
-rw-r--r--connectivity/source/commontools/DateConversion.cxx5
-rw-r--r--connectivity/source/commontools/DriversConfig.cxx241
-rw-r--r--connectivity/source/commontools/FValue.cxx34
-rw-r--r--connectivity/source/commontools/dbconversion.cxx14
-rw-r--r--connectivity/source/commontools/dbmetadata.cxx10
-rw-r--r--connectivity/source/commontools/dbtools.cxx1
-rw-r--r--connectivity/source/commontools/dbtools2.cxx86
-rw-r--r--connectivity/source/commontools/makefile.mk1
-rw-r--r--connectivity/source/commontools/parameters.cxx18
-rw-r--r--connectivity/source/dbtools/makefile.mk1
-rw-r--r--connectivity/source/drivers/adabas/adabas.xcu128
-rw-r--r--connectivity/source/drivers/adabas/makefile.mk8
-rw-r--r--connectivity/source/drivers/ado/ado.xcu242
-rw-r--r--connectivity/source/drivers/ado/makefile.mk13
-rw-r--r--connectivity/source/drivers/calc/calc.xcu66
-rw-r--r--connectivity/source/drivers/calc/makefile.mk4
-rw-r--r--connectivity/source/drivers/dbase/DTable.cxx13
-rw-r--r--connectivity/source/drivers/dbase/dbase.xcu98
-rw-r--r--connectivity/source/drivers/dbase/makefile.mk4
-rw-r--r--connectivity/source/drivers/evoab/LCatalog.cxx75
-rw-r--r--connectivity/source/drivers/evoab/LCatalog.hxx (renamed from svx/source/sdr/overlay/overlaylinestriped.cxx)31
-rw-r--r--connectivity/source/drivers/evoab/LColumnAlias.cxx235
-rw-r--r--connectivity/source/drivers/evoab/LColumnAlias.hxx116
-rw-r--r--connectivity/source/drivers/evoab/LColumns.cxx60
-rw-r--r--connectivity/source/drivers/evoab/LColumns.hxx (renamed from svx/inc/svdtouch.hxx)50
-rw-r--r--connectivity/source/drivers/evoab/LConfigAccess.cxx164
-rw-r--r--connectivity/source/drivers/evoab/LConfigAccess.hxx49
-rw-r--r--connectivity/source/drivers/evoab/LConnection.cxx270
-rw-r--r--connectivity/source/drivers/evoab/LConnection.hxx81
-rw-r--r--connectivity/source/drivers/evoab/LDatabaseMetaData.cxx394
-rw-r--r--connectivity/source/drivers/evoab/LDatabaseMetaData.hxx59
-rw-r--r--connectivity/source/drivers/evoab/LDebug.cxx45
-rw-r--r--connectivity/source/drivers/evoab/LDebug.hxx (renamed from svx/inc/svx/sdr/overlay/overlaylinestriped.hxx)28
-rw-r--r--connectivity/source/drivers/evoab/LDriver.cxx508
-rw-r--r--connectivity/source/drivers/evoab/LDriver.hxx118
-rw-r--r--connectivity/source/drivers/evoab/LFolderList.cxx566
-rw-r--r--connectivity/source/drivers/evoab/LFolderList.hxx95
-rw-r--r--connectivity/source/drivers/evoab/LNoException.cxx327
-rw-r--r--connectivity/source/drivers/evoab/LPreparedStatement.cxx46
-rw-r--r--connectivity/source/drivers/evoab/LPreparedStatement.hxx53
-rw-r--r--connectivity/source/drivers/evoab/LResultSet.cxx193
-rw-r--r--connectivity/source/drivers/evoab/LResultSet.hxx84
-rw-r--r--connectivity/source/drivers/evoab/LServices.cxx178
-rw-r--r--connectivity/source/drivers/evoab/LStatement.cxx46
-rw-r--r--connectivity/source/drivers/evoab/LStatement.hxx52
-rw-r--r--connectivity/source/drivers/evoab/LTable.cxx873
-rw-r--r--connectivity/source/drivers/evoab/LTable.hxx103
-rw-r--r--connectivity/source/drivers/evoab/LTables.cxx65
-rw-r--r--connectivity/source/drivers/evoab/LTables.hxx55
-rw-r--r--connectivity/source/drivers/evoab/evoab.map8
-rw-r--r--connectivity/source/drivers/evoab/evoab.xcu64
-rw-r--r--connectivity/source/drivers/evoab/evoab.xml33
-rw-r--r--connectivity/source/drivers/evoab/exports.dxp3
-rw-r--r--connectivity/source/drivers/evoab/makefile.mk108
-rw-r--r--connectivity/source/drivers/evoab2/evoab2.xcu79
-rw-r--r--connectivity/source/drivers/evoab2/makefile.mk4
-rw-r--r--connectivity/source/drivers/file/FResultSet.cxx4
-rw-r--r--connectivity/source/drivers/file/FStatement.cxx49
-rw-r--r--connectivity/source/drivers/file/FStringFunctions.cxx13
-rw-r--r--connectivity/source/drivers/file/fcode.cxx25
-rw-r--r--connectivity/source/drivers/file/fcomp.cxx7
-rw-r--r--connectivity/source/drivers/file/quotedstring.cxx4
-rw-r--r--connectivity/source/drivers/flat/ETable.cxx26
-rw-r--r--connectivity/source/drivers/flat/flat.xcu113
-rw-r--r--connectivity/source/drivers/flat/makefile.mk4
-rw-r--r--connectivity/source/drivers/hsqldb/hsqldb.xcu76
-rw-r--r--connectivity/source/drivers/hsqldb/makefile.mk4
-rw-r--r--connectivity/source/drivers/jdbc/DatabaseMetaData.cxx3
-rw-r--r--connectivity/source/drivers/jdbc/ResultSet.cxx2
-rw-r--r--connectivity/source/drivers/jdbc/jdbc.xcu207
-rw-r--r--connectivity/source/drivers/jdbc/makefile.mk4
-rw-r--r--connectivity/source/drivers/jdbc/tools.cxx3
-rw-r--r--connectivity/source/drivers/kab/kab.xcu49
-rw-r--r--connectivity/source/drivers/kab/makefile.mk4
-rw-r--r--connectivity/source/drivers/macab/macab.xcu49
-rwxr-xr-xconnectivity/source/drivers/macab/makefile.mk4
-rw-r--r--connectivity/source/drivers/mozab/MColumnAlias.cxx152
-rw-r--r--connectivity/source/drivers/mozab/MColumnAlias.hxx77
-rw-r--r--connectivity/source/drivers/mozab/MConnection.cxx3
-rw-r--r--connectivity/source/drivers/mozab/MConnection.hxx1
-rw-r--r--connectivity/source/drivers/mozab/MDatabaseMetaData.cxx2
-rw-r--r--connectivity/source/drivers/mozab/MPreparedStatement.cxx137
-rw-r--r--connectivity/source/drivers/mozab/MPreparedStatement.hxx28
-rw-r--r--connectivity/source/drivers/mozab/MResultSet.cxx7
-rw-r--r--connectivity/source/drivers/mozab/MResultSet.hxx4
-rw-r--r--connectivity/source/drivers/mozab/MResultSetMetaData.cxx7
-rw-r--r--connectivity/source/drivers/mozab/MStatement.cxx224
-rw-r--r--connectivity/source/drivers/mozab/MStatement.hxx80
-rw-r--r--connectivity/source/drivers/mozab/bootstrap/MMozillaBootstrap.cxx1
-rw-r--r--connectivity/source/drivers/mozab/bootstrap/MNSInit.cxx13
-rw-r--r--connectivity/source/drivers/mozab/bootstrap/MNSProfile.cxx9
-rw-r--r--connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx27
-rw-r--r--connectivity/source/drivers/mozab/bootstrap/MNSProfileManager.cxx6
-rw-r--r--connectivity/source/drivers/mozab/bootstrap/makefile.mk4
-rw-r--r--connectivity/source/drivers/mozab/makefile.mk22
-rw-r--r--connectivity/source/drivers/mozab/mozab.xcu157
-rw-r--r--connectivity/source/drivers/mozab/mozab2.xcu121
-rw-r--r--connectivity/source/drivers/mozab/mozillasrc/MDatabaseMetaDataHelper.cxx2
-rw-r--r--connectivity/source/drivers/mozab/mozillasrc/MLdapAttributeMap.cxx453
-rw-r--r--connectivity/source/drivers/mozab/mozillasrc/MLdapAttributeMap.hxx78
-rw-r--r--connectivity/source/drivers/mozab/mozillasrc/MNSInclude.hxx6
-rw-r--r--connectivity/source/drivers/mozab/mozillasrc/MNSMozabProxy.cxx6
-rw-r--r--connectivity/source/drivers/mozab/mozillasrc/MQuery.cxx52
-rw-r--r--connectivity/source/drivers/mozab/mozillasrc/MQuery.hxx4
-rw-r--r--connectivity/source/drivers/mozab/mozillasrc/MQueryHelper.cxx407
-rw-r--r--connectivity/source/drivers/mozab/mozillasrc/MQueryHelper.hxx20
-rw-r--r--connectivity/source/drivers/mozab/mozillasrc/MTypeConverter.cxx32
-rw-r--r--connectivity/source/drivers/mozab/mozillasrc/MTypeConverter.hxx5
-rw-r--r--connectivity/source/drivers/mozab/mozillasrc/makefile.mk9
-rw-r--r--connectivity/source/drivers/mozab/post_include_mozilla.h12
-rw-r--r--connectivity/source/drivers/mozab/pre_include_mozilla.h14
-rw-r--r--connectivity/source/drivers/mysql/makefile.mk4
-rw-r--r--connectivity/source/drivers/mysql/mysql.xcu177
-rw-r--r--connectivity/source/drivers/odbc/makefile.mk4
-rw-r--r--connectivity/source/drivers/odbc/odbc.xcu173
-rw-r--r--connectivity/source/drivers/odbcbase/OTools.cxx10
-rw-r--r--connectivity/source/inc/file/fcode.hxx10
-rw-r--r--connectivity/source/inc/flat/ETable.hxx1
-rw-r--r--connectivity/source/manager/makefile.mk3
-rw-r--r--connectivity/source/manager/mdrivermanager.cxx49
-rw-r--r--connectivity/source/manager/mdrivermanager.hxx8
-rw-r--r--connectivity/source/manager/mregistration.cxx6
-rw-r--r--connectivity/source/parse/sqlbison.y169
-rw-r--r--connectivity/source/parse/sqlflex.l3
-rw-r--r--connectivity/source/parse/sqliterator.cxx16
-rw-r--r--connectivity/source/parse/sqlnode.cxx238
-rw-r--r--connectivity/source/resource/conn_shared_res.src12
-rw-r--r--connectivity/target.pmk40
-rw-r--r--connectivity/util/delzip0
-rw-r--r--connectivity/util/langfilter.xsl37
-rw-r--r--connectivity/util/makefile.mk80
-rw-r--r--desktop/inc/app.hxx1
-rw-r--r--desktop/prj/build.lst3
-rw-r--r--desktop/prj/d.lst2
-rw-r--r--desktop/source/app/app.cxx4
-rw-r--r--desktop/source/app/check_ext_deps.cxx256
-rw-r--r--desktop/source/app/makefile.mk1
-rw-r--r--desktop/source/deployment/gui/dp_gui.h1
-rw-r--r--desktop/source/deployment/gui/dp_gui.hrc82
-rw-r--r--desktop/source/deployment/gui/dp_gui_dialog.src227
-rw-r--r--desktop/source/deployment/gui/dp_gui_dialog2.cxx2054
-rw-r--r--desktop/source/deployment/gui/dp_gui_dialog2.hxx167
-rw-r--r--desktop/source/deployment/gui/dp_gui_dialog2.src60
-rw-r--r--desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx161
-rw-r--r--desktop/source/deployment/gui/dp_gui_extensioncmdqueue.hxx21
-rw-r--r--desktop/source/deployment/gui/dp_gui_extlistbox.cxx1175
-rw-r--r--desktop/source/deployment/gui/dp_gui_extlistbox.hxx271
-rw-r--r--desktop/source/deployment/gui/dp_gui_service.cxx26
-rw-r--r--desktop/source/deployment/gui/dp_gui_theextmgr.cxx147
-rw-r--r--desktop/source/deployment/gui/dp_gui_theextmgr.hxx19
-rw-r--r--desktop/source/deployment/gui/dp_gui_updatedata.hxx15
-rw-r--r--desktop/source/deployment/gui/dp_gui_updatedialog.cxx77
-rw-r--r--desktop/source/deployment/gui/dp_gui_updatedialog.hxx15
-rw-r--r--desktop/source/deployment/gui/makefile.mk1
-rw-r--r--desktop/source/deployment/registry/dp_backend.cxx11
-rw-r--r--desktop/source/deployment/registry/help/dp_help.src2
-rw-r--r--desktop/source/deployment/registry/inc/dp_backend.h6
-rw-r--r--desktop/source/deployment/registry/package/dp_package.cxx22
-rw-r--r--desktop/source/inc/helpid.hrc6
-rw-r--r--desktop/util/hidother.src4
-rw-r--r--desktop/win32/source/extendloaderenvironment.cxx9
-rw-r--r--desktop/win32/source/guistdio/guistdio.inc75
-rw-r--r--desktop/win32/source/rebase/Resource.h41
-rw-r--r--desktop/win32/source/rebase/makefile.mk93
-rw-r--r--desktop/win32/source/rebase/rcfooter.txt2
-rw-r--r--desktop/win32/source/rebase/rcheader.txt39
-rw-r--r--desktop/win32/source/rebase/rctmpl.txt9
-rw-r--r--desktop/win32/source/rebase/rebase.cxx190
-rw-r--r--desktop/win32/source/rebase/rebasegui.cxx200
-rw-r--r--desktop/win32/source/rebase/rebasegui.ulf11
-rw-r--r--drawinglayer/inc/drawinglayer/attribute/sdrallattribute3d.hxx10
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/chartprimitive2d.hxx2
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx1
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/invertprimitive2d.hxx63
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/primitivetools2d.hxx114
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/sceneprimitive2d.hxx2
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/textlayoutdevice.hxx12
-rw-r--r--drawinglayer/inc/drawinglayer/processor2d/hittestprocessor2d.hxx113
-rw-r--r--drawinglayer/inc/drawinglayer/processor2d/linegeometryextractor2d.hxx8
-rw-r--r--drawinglayer/inc/drawinglayer/processor2d/textaspolygonextractor2d.hxx108
-rw-r--r--drawinglayer/prj/d.lst4
-rw-r--r--drawinglayer/source/attribute/sdrallattribute3d.cxx48
-rw-r--r--drawinglayer/source/primitive2d/chartprimitive2d.cxx7
-rw-r--r--drawinglayer/source/primitive2d/invertprimitive2d.cxx65
-rw-r--r--drawinglayer/source/primitive2d/makefile.mk2
-rw-r--r--drawinglayer/source/primitive2d/polygonprimitive2d.cxx13
-rw-r--r--drawinglayer/source/primitive2d/primitivetools2d.cxx106
-rw-r--r--drawinglayer/source/primitive2d/sceneprimitive2d.cxx8
-rw-r--r--drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx4
-rw-r--r--drawinglayer/source/primitive2d/textlayoutdevice.cxx47
-rw-r--r--drawinglayer/source/primitive2d/textprimitive2d.cxx53
-rw-r--r--drawinglayer/source/processor2d/canvasprocessor.cxx5
-rw-r--r--drawinglayer/source/processor2d/helperchartrenderer.cxx70
-rw-r--r--drawinglayer/source/processor2d/helperchartrenderer.hxx13
-rw-r--r--drawinglayer/source/processor2d/hittestprocessor2d.cxx451
-rw-r--r--drawinglayer/source/processor2d/linegeometryextractor2d.cxx4
-rw-r--r--drawinglayer/source/processor2d/makefile.mk4
-rw-r--r--drawinglayer/source/processor2d/textaspolygonextractor2d.cxx255
-rw-r--r--drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx103
-rw-r--r--drawinglayer/source/processor2d/vclpixelprocessor2d.cxx28
-rw-r--r--drawinglayer/source/processor2d/vclprocessor2d.cxx269
-rw-r--r--drawinglayer/source/processor3d/zbufferprocessor3d.cxx20
-rw-r--r--drawinglayer/util/makefile.mk1
-rw-r--r--formula/inc/formula/IFunctionDescription.hxx5
-rw-r--r--formula/source/ui/dlg/formula.cxx59
-rw-r--r--fpicker/prj/build.lst1
-rw-r--r--fpicker/prj/d.lst1
-rw-r--r--fpicker/source/aqua/AquaFilePickerDelegate.hxx2
-rw-r--r--fpicker/source/aqua/AquaFilePickerDelegate.mm22
-rw-r--r--fpicker/source/aqua/ControlHelper.cxx53
-rw-r--r--fpicker/source/aqua/ControlHelper.hxx12
-rw-r--r--fpicker/source/aqua/SalAquaFilePicker.cxx43
-rw-r--r--fpicker/source/aqua/SalAquaPicker.cxx31
-rw-r--r--fpicker/source/generic/fpicker.cxx2
-rw-r--r--fpicker/source/unx/kde4/FPServiceInfo.hxx74
-rw-r--r--fpicker/source/unx/kde4/KDE4FPEntry.cxx136
-rw-r--r--fpicker/source/unx/kde4/KDE4FilePicker.cxx717
-rw-r--r--fpicker/source/unx/kde4/KDE4FilePicker.hxx205
-rw-r--r--fpicker/source/unx/kde4/fps-kde4-ucd.txt6
-rw-r--r--fpicker/source/unx/kde4/fps_kde4.xml51
-rw-r--r--fpicker/source/unx/kde4/makefile.mk117
-rw-r--r--fpicker/source/win32/filepicker/FPentry.cxx4
-rw-r--r--fpicker/source/win32/filepicker/SolarMutex.cxx58
-rw-r--r--fpicker/source/win32/filepicker/SolarMutex.hxx33
-rw-r--r--fpicker/source/win32/filepicker/VistaFilePicker.cxx36
-rw-r--r--fpicker/source/win32/filepicker/VistaFilePicker.hxx2
-rw-r--r--fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx129
-rw-r--r--fpicker/source/win32/filepicker/VistaFilePickerImpl.hxx5
-rw-r--r--fpicker/source/win32/filepicker/asynceventnotifier.cxx5
-rw-r--r--fpicker/source/win32/filepicker/asyncrequests.cxx4
-rw-r--r--fpicker/source/win32/filepicker/filepickerstate.cxx23
-rw-r--r--fpicker/source/win32/filepicker/makefile.mk3
-rw-r--r--fpicker/source/win32/folderpicker/MtaFop.cxx36
-rw-r--r--fpicker/source/win32/misc/WinImplHelper.cxx46
-rw-r--r--fpicker/source/win32/misc/WinImplHelper.hxx2
-rw-r--r--framework/inc/helper/mischelper.hxx61
-rw-r--r--framework/inc/uielement/langselectionmenucontroller.hxx4
-rw-r--r--framework/inc/uielement/langselectionstatusbarcontroller.hxx4
-rw-r--r--framework/source/classes/fwktabwindow.cxx15
-rw-r--r--framework/source/helper/makefile.mk3
-rw-r--r--framework/source/helper/mischelper.cxx71
-rw-r--r--framework/source/services/backingwindow.cxx8
-rw-r--r--framework/source/services/frame.cxx9
-rw-r--r--framework/source/uielement/langselectionmenucontroller.cxx36
-rw-r--r--framework/source/uielement/langselectionstatusbarcontroller.cxx36
-rw-r--r--framework/source/uielement/togglebuttontoolbarcontroller.cxx2
-rw-r--r--framework/source/uielement/toolbarmanager.cxx16
-rw-r--r--framework/util/makefile.mk1
-rw-r--r--linguistic/source/gciterator.cxx38
-rw-r--r--officecfg/prj/build.lst33
-rw-r--r--officecfg/prj/d.lst4
-rw-r--r--officecfg/registry/data/org/openoffice/Office/Accelerators.xcu10
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu14
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu5
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/Common.xcs55
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/DataAccess/Drivers.xcs100
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/DataAccess/makefile.mk46
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/ExtendedColorScheme.xcs4
-rw-r--r--officecfg/registry/schema/org/openoffice/Setup.xcs7
-rwxr-xr-xreadlicense_oo/docs/readme/readme.xrm39
-rw-r--r--sfx2/inc/sfx2/DocumentMetadataAccess.hxx218
-rw-r--r--sfx2/inc/sfx2/Metadatable.hxx190
-rw-r--r--sfx2/inc/sfx2/XmlIdRegistry.hxx101
-rw-r--r--sfx2/inc/sfx2/app.hxx1
-rw-r--r--sfx2/inc/sfx2/dinfdlg.hxx75
-rw-r--r--sfx2/inc/sfx2/docfile.hxx3
-rw-r--r--sfx2/inc/sfx2/filedlghelper.hxx10
-rw-r--r--sfx2/inc/sfx2/msg.hxx12
-rw-r--r--sfx2/inc/sfx2/objsh.hxx8
-rw-r--r--sfx2/inc/sfx2/passwd.hxx1
-rw-r--r--sfx2/inc/sfx2/sfx.hrc8
-rw-r--r--sfx2/inc/sfx2/sfxbasemodel.hxx170
-rw-r--r--sfx2/inc/sfx2/sfxsids.hrc1
-rw-r--r--sfx2/prj/build.lst2
-rw-r--r--sfx2/prj/d.lst3
-rw-r--r--sfx2/qa/complex/DocumentMetadataAccessTest.java1270
-rw-r--r--sfx2/qa/complex/makefile.mk4
-rw-r--r--sfx2/qa/complex/testdocuments/TESTRDFA.odtbin0 -> 7540 bytes
-rw-r--r--sfx2/qa/complex/tests.sce1
-rw-r--r--sfx2/sdi/sfx.sdi26
-rw-r--r--sfx2/sdi/sfxslots.sdi8
-rw-r--r--sfx2/source/appl/app.cxx8
-rw-r--r--sfx2/source/appl/childwin.cxx3
-rw-r--r--sfx2/source/appl/sfxhelp.cxx9
-rw-r--r--sfx2/source/appl/shutdownicon.cxx6
-rw-r--r--sfx2/source/bastyp/progress.cxx2
-rw-r--r--sfx2/source/control/unoctitm.cxx11
-rw-r--r--sfx2/source/dialog/dinfdlg.cxx331
-rw-r--r--sfx2/source/dialog/dockwin.cxx1
-rw-r--r--sfx2/source/dialog/filedlghelper.cxx112
-rw-r--r--sfx2/source/dialog/passwd.cxx9
-rw-r--r--sfx2/source/dialog/templdlg.cxx17
-rw-r--r--sfx2/source/doc/DocumentMetadataAccess.cxx1414
-rw-r--r--sfx2/source/doc/Metadatable.cxx1860
-rw-r--r--sfx2/source/doc/docfile.cxx68
-rw-r--r--sfx2/source/doc/docinsert.cxx26
-rw-r--r--sfx2/source/doc/doctemplates.cxx2
-rw-r--r--sfx2/source/doc/makefile.mk7
-rw-r--r--sfx2/source/doc/objmisc.cxx28
-rw-r--r--sfx2/source/doc/objserv.cxx4
-rw-r--r--sfx2/source/doc/objstor.cxx50
-rw-r--r--sfx2/source/doc/objxtor.cxx20
-rw-r--r--sfx2/source/doc/sfxbasemodel.cxx434
-rw-r--r--sfx2/source/inc/objshimp.hxx2
-rw-r--r--sfx2/source/toolbox/tbxitem.cxx19
-rw-r--r--sfx2/util/makefile.mk4
-rw-r--r--shell/inc/internal/basereader.hxx2
-rw-r--r--shell/inc/internal/contentreader.hxx3
-rw-r--r--shell/inc/internal/metainforeader.hxx3
-rw-r--r--shell/inc/internal/propsheets.hxx1
-rw-r--r--shell/inc/internal/types.hxx3
-rw-r--r--shell/inc/internal/zipfile.hxx13
-rw-r--r--shell/prj/build.lst1
-rwxr-xr-xshell/source/all/makefile.mk2
-rw-r--r--shell/source/all/ooofilereader/basereader.cxx9
-rw-r--r--shell/source/all/ooofilereader/contentreader.cxx23
-rw-r--r--shell/source/all/ooofilereader/makefile.mk3
-rw-r--r--shell/source/all/ooofilereader/metainforeader.cxx42
-rw-r--r--shell/source/all/zipfile/makefile.mk7
-rw-r--r--shell/source/all/zipfile/zipfile.cxx22
-rw-r--r--shell/source/backends/kde4be/exports.map10
-rw-r--r--shell/source/backends/kde4be/kde4backend.cxx158
-rw-r--r--shell/source/backends/kde4be/kde4backend.hxx123
-rw-r--r--shell/source/backends/kde4be/kde4be.xml35
-rw-r--r--shell/source/backends/kde4be/kde4be1-ucd.txt6
-rw-r--r--shell/source/backends/kde4be/kde4becdef.cxx143
-rw-r--r--shell/source/backends/kde4be/kde4commonlayer.cxx157
-rw-r--r--shell/source/backends/kde4be/kde4commonlayer.hxx51
-rw-r--r--shell/source/backends/kde4be/kde4inetlayer.cxx255
-rw-r--r--shell/source/backends/kde4be/kde4inetlayer.hxx59
-rw-r--r--shell/source/backends/kde4be/kde4pathslayer.cxx124
-rw-r--r--shell/source/backends/kde4be/kde4pathslayer.hxx82
-rw-r--r--shell/source/backends/kde4be/kde4vcllayer.cxx115
-rw-r--r--shell/source/backends/kde4be/kde4vcllayer.hxx53
-rw-r--r--shell/source/backends/kde4be/makefile.mk94
-rw-r--r--shell/source/unix/misc/makefile.mk2
-rw-r--r--shell/source/win32/shlxthandler/ooofilt/makefile.mk16
-rw-r--r--shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx212
-rw-r--r--shell/source/win32/shlxthandler/ooofilt/ooofilt.hxx33
-rw-r--r--shell/source/win32/shlxthandler/ooofilt/proxy/ooofiltproxy.cxx1
-rw-r--r--shell/source/win32/shlxthandler/propsheets/propsheets.cxx36
-rw-r--r--shell/source/win32/shlxthandler/util/makefile.mk1
-rw-r--r--shell/source/win32/shlxthandler/util/utilities.cxx1
-rw-r--r--shell/source/win32/simplemail/smplmailclient.cxx12
-rw-r--r--svx/inc/AccessibleSelectionBase.hxx80
-rw-r--r--svx/inc/AccessibleStaticTextBase.hxx4
-rw-r--r--svx/inc/ActionDescriptionProvider.hxx68
-rwxr-xr-xsvx/inc/EnhancedCustomShapeFunctionParser.hxx8
-rw-r--r--svx/inc/accessibility.hrc96
-rw-r--r--svx/inc/acorrcfg.hxx198
-rw-r--r--svx/inc/anchorid.hxx57
-rw-r--r--svx/inc/asiancfg.hxx92
-rw-r--r--svx/inc/bolnitem.hxx110
-rw-r--r--svx/inc/bulitem.hxx297
-rw-r--r--svx/inc/charhiddenitem.hxx68
-rw-r--r--svx/inc/edtspell.hxx3
-rw-r--r--svx/inc/fontitem.hxx2
-rw-r--r--svx/inc/gallery1.hxx4
-rw-r--r--svx/inc/galobj.hxx4
-rw-r--r--svx/inc/galtheme.hxx20
-rw-r--r--svx/inc/mscodec.hxx51
-rw-r--r--svx/inc/optgenrl.hrc2
-rw-r--r--svx/inc/svdglob.hxx6
-rw-r--r--svx/inc/svdstr.hrc10
-rw-r--r--svx/inc/svx/AccessibleContextBase.hxx33
-rw-r--r--svx/inc/svx/AccessibleControlShape.hxx4
-rwxr-xr-xsvx/inc/svx/AccessibleShape.hxx33
-rw-r--r--svx/inc/svx/dialogs.hrc4
-rw-r--r--svx/inc/svx/editeng.hxx2
-rw-r--r--svx/inc/svx/editobj.hxx3
-rw-r--r--svx/inc/svx/emphitem.hxx2
-rw-r--r--svx/inc/svx/escherex.hxx81
-rw-r--r--svx/inc/svx/fntctrl.hxx1
-rw-r--r--svx/inc/svx/framelink.hxx10
-rw-r--r--svx/inc/svx/msdffimp.hxx4
-rw-r--r--svx/inc/svx/msocximex.hxx6
-rw-r--r--svx/inc/svx/obj3d.hxx7
-rw-r--r--svx/inc/svx/outlobj.hxx3
-rw-r--r--svx/inc/svx/sdasaitm.hxx8
-rw-r--r--svx/inc/svx/sdgcpitm.hxx2
-rw-r--r--svx/inc/svx/sdr/animation/objectanimator.hxx2
-rw-r--r--svx/inc/svx/sdr/animation/scheduler.hxx9
-rw-r--r--svx/inc/svx/sdr/attribute/sdrallattribute.hxx27
-rw-r--r--svx/inc/svx/sdr/attribute/sdrformtextattribute.hxx108
-rw-r--r--svx/inc/svx/sdr/attribute/sdrformtextoutlineattribute.hxx74
-rw-r--r--svx/inc/svx/sdr/attribute/sdrtextattribute.hxx39
-rw-r--r--svx/inc/svx/sdr/contact/viewcontactofgraphic.hxx19
-rw-r--r--svx/inc/svx/sdr/contact/viewcontactofsdrole2obj.hxx12
-rw-r--r--svx/inc/svx/sdr/contact/viewobjectcontactofunocontrol.hxx14
-rw-r--r--svx/inc/svx/sdr/overlay/overlayanimatedbitmapex.hxx12
-rw-r--r--svx/inc/svx/sdr/overlay/overlaybitmap.hxx94
-rw-r--r--svx/inc/svx/sdr/overlay/overlaybitmapex.hxx11
-rw-r--r--svx/inc/svx/sdr/overlay/overlaycrosshair.hxx32
-rw-r--r--svx/inc/svx/sdr/overlay/overlayhatchrect.hxx24
-rw-r--r--svx/inc/svx/sdr/overlay/overlayhelpline.hxx34
-rw-r--r--svx/inc/svx/sdr/overlay/overlayline.hxx36
-rw-r--r--svx/inc/svx/sdr/overlay/overlaymanager.hxx39
-rw-r--r--svx/inc/svx/sdr/overlay/overlaymanagerbuffered.hxx14
-rw-r--r--svx/inc/svx/sdr/overlay/overlayobject.hxx100
-rw-r--r--svx/inc/svx/sdr/overlay/overlayobjectcell.hxx8
-rw-r--r--svx/inc/svx/sdr/overlay/overlayobjectlist.hxx7
-rw-r--r--svx/inc/svx/sdr/overlay/overlaypolypolygon.hxx36
-rw-r--r--svx/inc/svx/sdr/overlay/overlayprimitive2dsequenceobject.hxx12
-rw-r--r--svx/inc/svx/sdr/overlay/overlayrollingrectangle.hxx50
-rw-r--r--svx/inc/svx/sdr/overlay/overlayselection.hxx98
-rw-r--r--svx/inc/svx/sdr/overlay/overlaytools.hxx281
-rw-r--r--svx/inc/svx/sdr/overlay/overlaytriangle.hxx46
-rw-r--r--svx/inc/svx/sdr/primitive2d/primitiveFactory2d.hxx8
-rw-r--r--svx/inc/svx/sdr/primitive2d/sdrattributecreator.hxx21
-rw-r--r--svx/inc/svx/sdr/primitive2d/sdrcaptionprimitive2d.hxx2
-rw-r--r--svx/inc/svx/sdr/primitive2d/sdrdecompositiontools.hxx4
-rw-r--r--svx/inc/svx/sdr/primitive2d/sdrmeasureprimitive2d.hxx17
-rw-r--r--svx/inc/svx/sdr/primitive2d/sdrolecontentprimitive2d.hxx89
-rw-r--r--svx/inc/svx/sdr/primitive2d/sdrpathprimitive2d.hxx12
-rw-r--r--svx/inc/svx/sdr/primitive2d/sdrrectangleprimitive2d.hxx19
-rw-r--r--svx/inc/svx/sdr/primitive2d/sdrtextprimitive2d.hxx85
-rw-r--r--svx/inc/svx/sdr/primitive2d/svx_primitivetypes2d.hxx7
-rw-r--r--svx/inc/svx/sdr/properties/properties.hxx5
-rw-r--r--svx/inc/svx/sdr/properties/textproperties.hxx7
-rw-r--r--svx/inc/svx/sdrhittesthelper.hxx81
-rw-r--r--svx/inc/svx/sdtfchim.hxx20
-rw-r--r--svx/inc/svx/svdedxv.hxx3
-rw-r--r--svx/inc/svx/svdetc.hxx12
-rw-r--r--svx/inc/svx/svdhdl.hxx3
-rw-r--r--svx/inc/svx/svdmodel.hxx2
-rw-r--r--svx/inc/svx/svdmrkv.hxx11
-rw-r--r--svx/inc/svx/svdoashp.hxx6
-rw-r--r--svx/inc/svx/svdoattr.hxx3
-rw-r--r--svx/inc/svx/svdobj.hxx14
-rw-r--r--svx/inc/svx/svdocapt.hxx1
-rw-r--r--svx/inc/svx/svdocirc.hxx1
-rw-r--r--svx/inc/svx/svdoedge.hxx3
-rw-r--r--svx/inc/svx/svdograf.hxx4
-rw-r--r--svx/inc/svx/svdogrp.hxx1
-rw-r--r--svx/inc/svx/svdomeas.hxx2
-rw-r--r--svx/inc/svx/svdoole2.hxx9
-rw-r--r--svx/inc/svx/svdopath.hxx1
-rw-r--r--svx/inc/svx/svdorect.hxx2
-rw-r--r--svx/inc/svx/svdotable.hxx1
-rw-r--r--svx/inc/svx/svdotext.hxx8
-rw-r--r--svx/inc/svx/svdouno.hxx1
-rw-r--r--svx/inc/svx/svdovirt.hxx1
-rw-r--r--svx/inc/svx/svdpage.hxx31
-rw-r--r--svx/inc/svx/svdpntv.hxx35
-rw-r--r--svx/inc/svx/svdtext.hxx3
-rw-r--r--svx/inc/svx/svdundo.hxx40
-rw-r--r--svx/inc/svx/svx3ditems.hxx88
-rw-r--r--svx/inc/svx/svxdlg.hxx9
-rw-r--r--svx/inc/svx/svxfont.hxx3
-rw-r--r--svx/inc/svx/svxids.hrc6
-rw-r--r--svx/inc/svx/sxfiitm.hxx2
-rw-r--r--svx/inc/svx/unoedsrc.hxx32
-rw-r--r--svx/inc/svx/unofored.hxx2
-rw-r--r--svx/inc/svx/unoforou.hxx2
-rw-r--r--svx/inc/svx/unoprov.hxx2
-rw-r--r--svx/inc/svx/unoshtxt.hxx13
-rw-r--r--svx/inc/svx/unotext.hxx10
-rw-r--r--svx/inc/svx/xcolit.hxx2
-rw-r--r--svx/inc/svx/xflbckit.hxx8
-rw-r--r--svx/inc/svx/xflbmpit.hxx12
-rw-r--r--svx/inc/svx/xflbmsli.hxx8
-rw-r--r--svx/inc/svx/xflbmsxy.hxx20
-rw-r--r--svx/inc/svx/xflboxy.hxx16
-rw-r--r--svx/inc/svx/xflbtoxy.hxx16
-rw-r--r--svx/inc/svx/xflclit.hxx2
-rw-r--r--svx/inc/svx/xflftrit.hxx2
-rw-r--r--svx/inc/svx/xflgrit.hxx2
-rw-r--r--svx/inc/svx/xflhtit.hxx2
-rw-r--r--svx/inc/svx/xftshcit.hxx2
-rw-r--r--svx/inc/svx/xit.hxx8
-rw-r--r--svx/inc/svx/xlnclit.hxx2
-rw-r--r--svx/inc/svx/xlndsit.hxx2
-rw-r--r--svx/inc/svx/xlnedit.hxx2
-rw-r--r--svx/inc/svx/xlnstit.hxx2
-rw-r--r--svx/inc/svx/xsflclit.hxx16
-rw-r--r--svx/inc/unoapi.hxx8
-rw-r--r--svx/inc/unoedhlp.hxx2
-rw-r--r--svx/inc/unolingu.hxx2
-rw-r--r--svx/inc/xexch.hxx2
-rw-r--r--svx/inc/xmlgrhlp.hxx14
-rw-r--r--svx/inc/xoutbmp.hxx2
-rw-r--r--svx/prj/d.lst10
-rw-r--r--svx/sdi/svx.sdi51
-rw-r--r--svx/source/accessibility/AccessibleEditableTextPara.cxx150
-rw-r--r--svx/source/accessibility/AccessibleEditableTextPara.hxx19
-rw-r--r--svx/source/accessibility/AccessibleEmptyEditSource.cxx2
-rw-r--r--svx/source/accessibility/AccessibleImageBullet.cxx20
-rw-r--r--svx/source/accessibility/AccessibleStaticTextBase.cxx51
-rw-r--r--svx/source/accessibility/GraphCtlAccessibleContext.cxx11
-rw-r--r--svx/source/accessibility/accessibility.src12
-rwxr-xr-xsvx/source/accessibility/makefile.mk11
-rw-r--r--svx/source/cui/autocdlg.cxx10
-rw-r--r--svx/source/cui/autocdlg.hrc2
-rw-r--r--svx/source/cui/autocdlg.hxx2
-rw-r--r--svx/source/cui/autocdlg.src4
-rw-r--r--svx/source/cui/commonlingui.src20
-rw-r--r--svx/source/cui/cuicharmap.cxx8
-rw-r--r--svx/source/cui/dlgfact.cxx6
-rw-r--r--svx/source/cui/dlgfact.hxx2
-rw-r--r--svx/source/cui/hangulhanjadlg.src38
-rw-r--r--svx/source/cui/insrc.cxx88
-rw-r--r--svx/source/cui/insrc.hrc43
-rw-r--r--svx/source/cui/insrc.hxx (renamed from svx/source/svdraw/svdtxhdl.hxx)65
-rw-r--r--svx/source/cui/insrc.src118
-rw-r--r--svx/source/cui/macropg.src4
-rwxr-xr-xsvx/source/cui/makefile.mk6
-rw-r--r--svx/source/cui/optgdlg.cxx113
-rw-r--r--svx/source/cui/optgdlg.hrc9
-rw-r--r--svx/source/cui/optgdlg.hxx8
-rw-r--r--svx/source/cui/optgdlg.src32
-rw-r--r--svx/source/cui/optpath.cxx24
-rw-r--r--svx/source/cui/page.cxx46
-rw-r--r--svx/source/cui/page.h4
-rw-r--r--svx/source/cui/showcols.cxx8
-rw-r--r--svx/source/cui/svuidlg.src24
-rw-r--r--svx/source/cui/treeopt.cxx15
-rw-r--r--svx/source/cui/zoom.src44
-rw-r--r--svx/source/customshapes/EnhancedCustomShape2d.cxx25
-rw-r--r--svx/source/customshapes/EnhancedCustomShape2d.hxx34
-rw-r--r--svx/source/customshapes/EnhancedCustomShape3d.hxx7
-rw-r--r--svx/source/customshapes/EnhancedCustomShapeGeometry.cxx478
-rw-r--r--svx/source/customshapes/EnhancedCustomShapeGeometry.hxx8
-rw-r--r--svx/source/customshapes/EnhancedCustomShapeTypeNames.hxx10
-rw-r--r--svx/source/customshapes/makefile.mk12
-rw-r--r--svx/source/dialog/dlgctrl.cxx38
-rw-r--r--svx/source/dialog/fntctrl.cxx29
-rw-r--r--svx/source/dialog/imapwnd.cxx2
-rw-r--r--svx/source/dialog/makefile.mk45
-rw-r--r--svx/source/dialog/srchdlg.cxx2
-rw-r--r--svx/source/editeng/editdoc.cxx2
-rw-r--r--svx/source/editeng/editdoc.hxx13
-rw-r--r--svx/source/editeng/editdoc2.cxx72
-rw-r--r--svx/source/editeng/editeng.cxx31
-rw-r--r--svx/source/editeng/editobj.cxx76
-rw-r--r--svx/source/editeng/editobj2.hxx13
-rw-r--r--svx/source/editeng/edtspell.cxx25
-rw-r--r--svx/source/editeng/eertfpar.cxx13
-rw-r--r--svx/source/editeng/impedit.cxx2
-rw-r--r--svx/source/editeng/impedit.hxx4
-rw-r--r--svx/source/editeng/impedit2.cxx59
-rw-r--r--svx/source/engine3d/helperhittest3d.cxx32
-rw-r--r--svx/source/engine3d/makefile.mk15
-rw-r--r--svx/source/engine3d/obj3d.cxx16
-rw-r--r--svx/source/engine3d/scene3d.cxx13
-rw-r--r--svx/source/fmcomp/dbaexchange.cxx1
-rw-r--r--svx/source/fmcomp/dbaobjectex.cxx1
-rw-r--r--svx/source/fmcomp/fmgridif.cxx46
-rw-r--r--svx/source/fmcomp/gridcell.cxx53
-rw-r--r--svx/source/fmcomp/gridcols.cxx19
-rw-r--r--svx/source/fmcomp/makefile.mk20
-rw-r--r--svx/source/form/fmprop.cxx194
-rw-r--r--svx/source/form/fmservs.cxx69
-rw-r--r--svx/source/form/fmtextcontrolshell.cxx1
-rw-r--r--svx/source/form/fmtools.cxx9
-rw-r--r--svx/source/form/fmundo.cxx4
-rw-r--r--svx/source/form/fmurl.cxx74
-rw-r--r--svx/source/form/formcontrolling.cxx1
-rw-r--r--svx/source/form/makefile.mk31
-rw-r--r--svx/source/gallery2/galobj.cxx3
-rw-r--r--svx/source/gengal/makefile.mk2
-rw-r--r--svx/source/inc/AccessibleStringWrap.hxx8
-rw-r--r--svx/source/inc/datanavi.hxx4
-rw-r--r--svx/source/inc/dbtoolsclient.hxx33
-rw-r--r--svx/source/inc/filtnav.hxx5
-rw-r--r--svx/source/inc/fmctrler.hxx4
-rw-r--r--svx/source/inc/fmexch.hxx12
-rw-r--r--svx/source/inc/fmexpl.hxx4
-rw-r--r--svx/source/inc/fmobj.hxx4
-rw-r--r--svx/source/inc/fmpgeimp.hxx3
-rw-r--r--svx/source/inc/fmprop.hrc288
-rw-r--r--svx/source/inc/fmservs.hxx122
-rw-r--r--svx/source/inc/fmshimp.hxx10
-rw-r--r--svx/source/inc/fmstatic.hxx81
-rw-r--r--svx/source/inc/fmtools.hxx20
-rw-r--r--svx/source/inc/fmurl.hxx69
-rw-r--r--svx/source/inc/formtoolbars.hxx13
-rw-r--r--svx/source/inc/gridcols.hxx29
-rw-r--r--svx/source/inc/sqlparserclient.hxx2
-rw-r--r--svx/source/inc/stringlistresource.hxx9
-rw-r--r--svx/source/inc/unoedprx.hxx8
-rw-r--r--svx/source/inc/unogalthemeprovider.hxx6
-rw-r--r--svx/source/inc/unopolyhelper.hxx4
-rw-r--r--svx/source/items/makefile.mk37
-rw-r--r--svx/source/items/textitem.cxx7
-rw-r--r--svx/source/msfilter/escherex.cxx213
-rw-r--r--svx/source/msfilter/eschesdo.cxx21
-rw-r--r--svx/source/msfilter/makefile.mk10
-rw-r--r--svx/source/msfilter/mscodec.cxx170
-rw-r--r--svx/source/msfilter/msdffimp.cxx12
-rw-r--r--svx/source/msfilter/msocximex.cxx14
-rw-r--r--svx/source/msfilter/svxmsbas.cxx49
-rw-r--r--svx/source/msfilter/svxmsbas2.cxx88
-rw-r--r--svx/source/options/makefile.mk35
-rw-r--r--svx/source/options/optimprove.src2
-rw-r--r--svx/source/outliner/outliner.cxx4
-rw-r--r--svx/source/outliner/outlobj.cxx17
-rw-r--r--svx/source/sdr/attribute/makefile.mk5
-rw-r--r--svx/source/sdr/attribute/sdrallattribute.cxx126
-rw-r--r--svx/source/sdr/attribute/sdrformtextattribute.cxx304
-rw-r--r--svx/source/sdr/attribute/sdrformtextoutlineattribute.cxx (renamed from svx/inc/svx/sdr/overlay/overlaysdrobject.hxx)58
-rw-r--r--svx/source/sdr/attribute/sdrtextattribute.cxx96
-rw-r--r--svx/source/sdr/contact/viewcontactofe3dpolygon.cxx17
-rw-r--r--svx/source/sdr/contact/viewcontactofgraphic.cxx335
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrole2obj.cxx97
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrpathobj.cxx119
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrrectobj.cxx10
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofgraphic.cxx46
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofpageobj.cxx3
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx242
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx593
-rw-r--r--svx/source/sdr/overlay/makefile.mk17
-rw-r--r--svx/source/sdr/overlay/overlayanimatedbitmapex.cxx76
-rw-r--r--svx/source/sdr/overlay/overlaybitmap.cxx162
-rw-r--r--svx/source/sdr/overlay/overlaybitmapex.cxx50
-rw-r--r--svx/source/sdr/overlay/overlaycrosshair.cxx100
-rw-r--r--svx/source/sdr/overlay/overlayhatchrect.cxx88
-rw-r--r--svx/source/sdr/overlay/overlayhelpline.cxx189
-rw-r--r--svx/source/sdr/overlay/overlayline.cxx94
-rw-r--r--svx/source/sdr/overlay/overlaymanager.cxx304
-rw-r--r--svx/source/sdr/overlay/overlaymanagerbuffered.cxx55
-rw-r--r--svx/source/sdr/overlay/overlayobject.cxx223
-rw-r--r--svx/source/sdr/overlay/overlayobjectcell.cxx98
-rw-r--r--svx/source/sdr/overlay/overlayobjectlist.cxx95
-rw-r--r--svx/source/sdr/overlay/overlaypolypolygon.cxx93
-rw-r--r--svx/source/sdr/overlay/overlayprimitive2dsequenceobject.cxx50
-rw-r--r--svx/source/sdr/overlay/overlayrollingrectangle.cxx231
-rw-r--r--svx/source/sdr/overlay/overlaysdrobject.cxx87
-rw-r--r--svx/source/sdr/overlay/overlayselection.cxx233
-rw-r--r--svx/source/sdr/overlay/overlaytools.cxx498
-rw-r--r--svx/source/sdr/overlay/overlaytriangle.cxx124
-rw-r--r--svx/source/sdr/primitive2d/makefile.mk1
-rw-r--r--svx/source/sdr/primitive2d/sdrattributecreator.cxx50
-rw-r--r--svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx83
-rw-r--r--svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx10
-rw-r--r--svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx13
-rw-r--r--svx/source/sdr/primitive2d/sdrdecompositiontools.cxx339
-rw-r--r--svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx22
-rw-r--r--svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx11
-rw-r--r--svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx140
-rw-r--r--svx/source/sdr/primitive2d/sdrole2primitive2d.cxx11
-rw-r--r--svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx200
-rw-r--r--svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx47
-rw-r--r--svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx76
-rw-r--r--svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx229
-rw-r--r--svx/source/sdr/properties/properties.cxx5
-rw-r--r--svx/source/sdr/properties/textproperties.cxx23
-rw-r--r--svx/source/svdraw/makefile.mk27
-rw-r--r--svx/source/svdraw/sdrhittesthelper.cxx176
-rw-r--r--svx/source/svdraw/sdrpaintwindow.cxx44
-rw-r--r--svx/source/svdraw/svdcrtv.cxx55
-rw-r--r--svx/source/svdraw/svddrgmt.cxx6
-rw-r--r--svx/source/svdraw/svddrgv.cxx4
-rw-r--r--svx/source/svdraw/svdedxv.cxx46
-rw-r--r--svx/source/svdraw/svdetc.cxx261
-rw-r--r--svx/source/svdraw/svdfmtf.cxx12
-rw-r--r--svx/source/svdraw/svdhdl.cxx167
-rw-r--r--svx/source/svdraw/svdmodel.cxx5
-rw-r--r--svx/source/svdraw/svdmrkv.cxx50
-rw-r--r--svx/source/svdraw/svdoashp.cxx79
-rw-r--r--svx/source/svdraw/svdoattr.cxx21
-rw-r--r--svx/source/svdraw/svdobj.cxx249
-rw-r--r--svx/source/svdraw/svdocapt.cxx31
-rw-r--r--svx/source/svdraw/svdocirc.cxx122
-rw-r--r--svx/source/svdraw/svdoedge.cxx33
-rw-r--r--svx/source/svdraw/svdograf.cxx32
-rw-r--r--svx/source/svdraw/svdogrp.cxx26
-rw-r--r--svx/source/svdraw/svdomeas.cxx38
-rw-r--r--svx/source/svdraw/svdoole2.cxx94
-rw-r--r--svx/source/svdraw/svdopath.cxx81
-rw-r--r--svx/source/svdraw/svdorect.cxx76
-rw-r--r--svx/source/svdraw/svdotext.cxx96
-rw-r--r--svx/source/svdraw/svdotextdecomposition.cxx56
-rw-r--r--svx/source/svdraw/svdotextpathdecomposition.cxx248
-rw-r--r--svx/source/svdraw/svdotxed.cxx5
-rw-r--r--svx/source/svdraw/svdotxtr.cxx215
-rw-r--r--svx/source/svdraw/svdouno.cxx5
-rw-r--r--svx/source/svdraw/svdovirt.cxx7
-rw-r--r--svx/source/svdraw/svdpage.cxx113
-rw-r--r--svx/source/svdraw/svdpntv.cxx126
-rw-r--r--svx/source/svdraw/svdsnpv.cxx31
-rw-r--r--svx/source/svdraw/svdstr.src16
-rw-r--r--svx/source/svdraw/svdtext.cxx12
-rw-r--r--svx/source/svdraw/svdtouch.cxx299
-rw-r--r--svx/source/svdraw/svdtxhdl.cxx400
-rw-r--r--svx/source/svdraw/svdundo.cxx114
-rw-r--r--svx/source/svdraw/svdview.cxx13
-rw-r--r--svx/source/svdraw/svdxcgv.cxx27
-rw-r--r--svx/source/svrtf/makefile.mk11
-rw-r--r--svx/source/svrtf/rtfgrf.cxx13
-rw-r--r--svx/source/svrtf/rtfitem.cxx12
-rw-r--r--svx/source/table/accessiblecell.cxx11
-rw-r--r--svx/source/table/accessiblecell.hxx1
-rw-r--r--svx/source/table/accessibletableshape.cxx11
-rw-r--r--svx/source/table/cell.cxx66
-rw-r--r--svx/source/table/cell.hxx180
-rw-r--r--svx/source/table/celleditsource.hxx2
-rw-r--r--svx/source/table/makefile.mk17
-rw-r--r--svx/source/table/svdotable.cxx15
-rw-r--r--svx/source/table/tablecontroller.cxx47
-rw-r--r--svx/source/table/tablecontroller.hxx113
-rw-r--r--svx/source/table/tablehandles.cxx281
-rw-r--r--svx/source/table/tablehandles.hxx5
-rw-r--r--svx/source/table/tablelayouter.cxx2
-rw-r--r--svx/source/table/viewcontactoftableobj.cxx37
-rw-r--r--svx/source/tbxctrls/makefile.mk17
-rw-r--r--svx/source/tbxctrls/tbcontrl.cxx12
-rw-r--r--svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.src2
-rw-r--r--svx/source/unodraw/UnoGraphicExporter.cxx39
-rw-r--r--svx/source/unodraw/UnoGraphicExporter.hxx6
-rw-r--r--svx/source/unodraw/gluepts.cxx94
-rw-r--r--svx/source/unodraw/makefile.mk19
-rw-r--r--svx/source/unodraw/unomod.cxx11
-rw-r--r--svx/source/unodraw/unoshap2.cxx3
-rw-r--r--svx/source/unodraw/unoshap3.cxx34
-rw-r--r--svx/source/unodraw/unoshtxt.cxx14
-rw-r--r--svx/source/unoedit/makefile.mk17
-rw-r--r--svx/source/unoedit/unoedprx.cxx12
-rw-r--r--svx/source/unoedit/unofored.cxx11
-rw-r--r--svx/source/unoedit/unoforou.cxx10
-rw-r--r--svx/source/unoedit/unotext.cxx10
-rw-r--r--svx/source/unoedit/unoviwou.cxx1
-rwxr-xr-xsvx/source/unogallery/makefile.mk6
-rw-r--r--svx/source/unogallery/unogalthemeprovider.cxx4
-rw-r--r--svx/source/xml/xmlgrhlp.cxx99
-rw-r--r--svx/source/xoutdev/xattr.cxx50
-rw-r--r--svx/util/makefile.mk173
-rw-r--r--svx/util/makefile.pmk8
-rw-r--r--sysui/util/checksize.pl4
-rw-r--r--ucb/source/ucp/webdav/NeonSession.cxx46
-rw-r--r--uui/source/iahndl.cxx93
-rw-r--r--uui/source/iahndl.hxx16
-rw-r--r--uui/source/passcrtdlg.cxx12
-rw-r--r--uui/source/passcrtdlg.hrc27
-rw-r--r--uui/source/passcrtdlg.hxx2
-rw-r--r--uui/source/passcrtdlg.src67
-rw-r--r--xmloff/inc/RDFaExportHelper.hxx83
-rw-r--r--xmloff/inc/RDFaImportHelper.hxx91
-rw-r--r--xmloff/inc/SchXMLImport.hxx1
-rw-r--r--xmloff/inc/txtflde.hxx18
-rw-r--r--xmloff/inc/xmlkywd.hxx7
-rw-r--r--xmloff/inc/xmlnmspe.hxx5
-rw-r--r--xmloff/inc/xmloff/SchXMLExportHelper.hxx7
-rw-r--r--xmloff/inc/xmloff/SchXMLImportHelper.hxx7
-rw-r--r--xmloff/inc/xmloff/table/XMLTableExport.hxx2
-rw-r--r--xmloff/inc/xmloff/txtimp.hxx4
-rw-r--r--xmloff/inc/xmloff/txtparae.hxx37
-rw-r--r--xmloff/inc/xmloff/txtprmap.hxx2
-rw-r--r--xmloff/inc/xmloff/xmlexp.hxx28
-rw-r--r--xmloff/inc/xmloff/xmlimp.hxx20
-rw-r--r--xmloff/inc/xmloff/xmlimppr.hxx1
-rw-r--r--xmloff/inc/xmloff/xmlmetai.hxx5
-rw-r--r--xmloff/inc/xmloff/xmltoken.hxx17
-rw-r--r--xmloff/source/chart/SchXMLChartContext.cxx245
-rw-r--r--xmloff/source/chart/SchXMLChartContext.hxx10
-rw-r--r--xmloff/source/chart/SchXMLExport.cxx160
-rw-r--r--xmloff/source/chart/SchXMLImport.cxx42
-rw-r--r--xmloff/source/chart/SchXMLPlotAreaContext.cxx60
-rw-r--r--xmloff/source/chart/SchXMLPlotAreaContext.hxx22
-rw-r--r--xmloff/source/chart/SchXMLSeries2Context.cxx259
-rw-r--r--xmloff/source/chart/SchXMLSeries2Context.hxx20
-rw-r--r--xmloff/source/chart/SchXMLTableContext.cxx71
-rw-r--r--xmloff/source/chart/SchXMLTableContext.hxx6
-rw-r--r--xmloff/source/chart/SchXMLTools.cxx181
-rw-r--r--xmloff/source/chart/SchXMLTools.hxx17
-rw-r--r--xmloff/source/chart/transporttypes.hxx22
-rw-r--r--xmloff/source/core/RDFaExportHelper.cxx218
-rw-r--r--xmloff/source/core/RDFaImportHelper.cxx458
-rw-r--r--xmloff/source/core/makefile.mk5
-rw-r--r--xmloff/source/core/xmlexp.cxx225
-rw-r--r--xmloff/source/core/xmlimp.cxx79
-rw-r--r--xmloff/source/core/xmltoken.cxx17
-rw-r--r--xmloff/source/draw/sdpropls.cxx29
-rw-r--r--xmloff/source/draw/sdpropls.hxx2
-rw-r--r--xmloff/source/draw/shapeexport.cxx3
-rw-r--r--xmloff/source/draw/shapeexport2.cxx25
-rw-r--r--xmloff/source/draw/shapeexport4.cxx26
-rw-r--r--xmloff/source/draw/ximpshap.cxx19
-rw-r--r--xmloff/source/forms/elementexport.cxx6
-rw-r--r--xmloff/source/forms/formattributes.cxx1
-rw-r--r--xmloff/source/forms/formattributes.hxx1
-rw-r--r--xmloff/source/forms/strings.hxx1
-rw-r--r--xmloff/source/meta/xmlmetai.cxx15
-rw-r--r--xmloff/source/table/XMLTableExport.cxx4
-rw-r--r--xmloff/source/text/XMLTextFrameContext.cxx145
-rw-r--r--xmloff/source/text/XMLTextFrameContext.hxx5
-rw-r--r--xmloff/source/text/XMLTextMarkImportContext.cxx60
-rw-r--r--xmloff/source/text/txtflde.cxx76
-rw-r--r--xmloff/source/text/txtimp.cxx296
-rw-r--r--xmloff/source/text/txtimppr.cxx13
-rw-r--r--xmloff/source/text/txtparae.cxx144
-rw-r--r--xmloff/source/text/txtparai.cxx372
-rw-r--r--xmloff/source/text/txtparai.hxx7
-rw-r--r--xmloff/source/text/txtprmap.cxx2
-rw-r--r--xmloff/source/text/txtstyli.cxx24
-rw-r--r--xmlscript/source/xmldlg_imexp/xmldlg_export.cxx19
-rw-r--r--xmlscript/source/xmldlg_imexp/xmldlg_import.cxx18
829 files changed, 39436 insertions, 15069 deletions
diff --git a/basic/inc/basic/sbstar.hxx b/basic/inc/basic/sbstar.hxx
index 9bc79b7b08..f71d1ff2fd 100644
--- a/basic/inc/basic/sbstar.hxx
+++ b/basic/inc/basic/sbstar.hxx
@@ -121,6 +121,7 @@ public:
static void Error( SbError );
static void Error( SbError, const String& rMsg );
static void FatalError( SbError );
+ static void FatalError( SbError, const String& rMsg );
static BOOL IsRunning();
static SbError GetErrBasic();
// #66536 make additional message accessible by RTL function Error
diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx
index 6dedae6bdc..4f123c2e23 100644
--- a/basic/source/classes/sb.cxx
+++ b/basic/source/classes/sb.cxx
@@ -1357,6 +1357,12 @@ void StarBASIC::FatalError( SbError n )
pINST->FatalError( n );
}
+void StarBASIC::FatalError( SbError _errCode, const String& _details )
+{
+ if( pINST )
+ pINST->FatalError( _errCode, _details );
+}
+
SbError StarBASIC::GetErrBasic()
{
if( pINST )
diff --git a/basic/source/classes/sb.src b/basic/source/classes/sb.src
index 4daa8e0eac..5b1454d654 100644
--- a/basic/source/classes/sb.src
+++ b/basic/source/classes/sb.src
@@ -341,7 +341,7 @@ Resource RID_BASIC_START
};
String SbERR_NO_METHOD & ERRCODE_RES_MASK
{
- Text [ en-US ] = "Property or method not found." ;
+ Text [ en-US ] = "Property or method not found: $(ARG1)." ;
};
String SbERR_NEEDS_OBJECT & ERRCODE_RES_MASK
{
diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx
index dcd51ceb28..96794c067f 100644
--- a/basic/source/classes/sbunoobj.cxx
+++ b/basic/source/classes/sbunoobj.cxx
@@ -68,7 +68,7 @@
#include <com/sun/star/reflection/XIdlArray.hpp>
#include <com/sun/star/reflection/XIdlReflection.hpp>
#include <com/sun/star/reflection/XIdlClassProvider.hpp>
-#include <com/sun/star/reflection/XTypeDescription.hpp>
+#include <com/sun/star/reflection/XServiceConstructorDescription.hpp>
#include <com/sun/star/bridge/oleautomation/NamedArgument.hpp>
#include <com/sun/star/bridge/oleautomation/Date.hpp>
#include <com/sun/star/bridge/oleautomation/Decimal.hpp>
@@ -104,6 +104,8 @@ TYPEINIT1(SbUnoMethod,SbxMethod)
TYPEINIT1(SbUnoProperty,SbxProperty)
TYPEINIT1(SbUnoObject,SbxObject)
TYPEINIT1(SbUnoClass,SbxObject)
+TYPEINIT1(SbUnoService,SbxObject)
+TYPEINIT1(SbUnoServiceCtor,SbxMethod)
typedef WeakImplHelper1< XAllListener > BasicAllListenerHelper;
@@ -2496,35 +2498,7 @@ SbUnoProperty::~SbUnoProperty()
{}
-// #72732 Spezielle SbxVariable, die beim put/get prueft,
-// ob der Kontext fuer eine UnoClass sinnvoll ist. Sonst
-// liegt eventuell ein Schreibfehler im Basic-Source vor.
-BOOL UnoClassMemberVariable::Get( SbxValues& rRes ) const
-{
- // Zugriff auf den Member einer UnoClass mit Parametern ist unsinnig
- if( GetParameters() )
- {
- if( mpRuntime )
- mpRuntime->Error( SbERR_NO_METHOD );
- }
- return SbxVariable::Get( rRes );
-}
-
-BOOL UnoClassMemberVariable::Put( const SbxValues& rRes )
-{
- if( bInternalUse )
- {
- return SbxVariable::Put( rRes );
- }
- // Schreibzugriff auf den Member einer UnoClass ist immer falsch
- mpRuntime->Error( SbERR_NO_METHOD );
- return FALSE;
-}
-
-TYPEINIT1(UnoClassMemberVariable,SbxVariable)
-
-
-SbxVariable* SbUnoObject::Find( const XubString& rName, SbxClassType t )
+SbxVariable* SbUnoObject::Find( const String& rName, SbxClassType t )
{
static Reference< XIdlMethod > xDummyMethod;
static Property aDummyProp;
@@ -3201,16 +3175,16 @@ SbxVariable* getVBAConstant( const String& rName )
// Funktion, um einen globalen Bezeichner im
// UnoScope zu suchen und fuer Sbx zu wrappen
-SbxVariable* findUnoClass( const String& rName )
+SbUnoClass* findUnoClass( const String& rName )
{
// #105550 Check if module exists
SbUnoClass* pUnoClass = NULL;
Reference< XHierarchicalNameAccess > xTypeAccess = getTypeProvider_Impl();
- Reference< XTypeDescription > xTypeDesc;
if( xTypeAccess->hasByHierarchicalName( rName ) )
{
Any aRet = xTypeAccess->getByHierarchicalName( rName );
+ Reference< XTypeDescription > xTypeDesc;
aRet >>= xTypeDesc;
if( xTypeDesc.is() )
@@ -3287,7 +3261,6 @@ SbxVariable* SbUnoClass::Find( const XubString& rName, SbxClassType t )
pRes = new SbxVariable( SbxVARIANT );
SbxObjectRef xWrapper = (SbxObject*)new SbUnoClass( aNewName, xClass );
pRes->PutObject( xWrapper );
-
}
}
else
@@ -3305,15 +3278,26 @@ SbxVariable* SbUnoClass::Find( const XubString& rName, SbxClassType t )
// Sonst wieder als Klasse annehmen
if( !pRes )
{
- SbxVariable* pNewClass = findUnoClass( aNewName );
+ SbUnoClass* pNewClass = findUnoClass( aNewName );
if( pNewClass )
{
- Reference< XIdlClass > xClass;
pRes = new SbxVariable( SbxVARIANT );
SbxObjectRef xWrapper = (SbxObject*)pNewClass;
pRes->PutObject( xWrapper );
}
}
+
+ // An UNO service?
+ if( !pRes )
+ {
+ SbUnoService* pUnoService = findUnoService( aNewName );
+ if( pUnoService )
+ {
+ pRes = new SbxVariable( SbxVARIANT );
+ SbxObjectRef xWrapper = (SbxObject*)pUnoService;
+ pRes->PutObject( xWrapper );
+ }
+ }
}
}
@@ -3334,6 +3318,266 @@ SbxVariable* SbUnoClass::Find( const XubString& rName, SbxClassType t )
}
+SbUnoService* findUnoService( const String& rName )
+{
+ SbUnoService* pSbUnoService = NULL;
+
+ Reference< XHierarchicalNameAccess > xTypeAccess = getTypeProvider_Impl();
+ if( xTypeAccess->hasByHierarchicalName( rName ) )
+ {
+ Any aRet = xTypeAccess->getByHierarchicalName( rName );
+ Reference< XTypeDescription > xTypeDesc;
+ aRet >>= xTypeDesc;
+
+ if( xTypeDesc.is() )
+ {
+ TypeClass eTypeClass = xTypeDesc->getTypeClass();
+ if( eTypeClass == TypeClass_SERVICE )
+ {
+ Reference< XServiceTypeDescription2 > xServiceTypeDesc( xTypeDesc, UNO_QUERY );
+ if( xServiceTypeDesc.is() )
+ pSbUnoService = new SbUnoService( rName, xServiceTypeDesc );
+ }
+ }
+ }
+ return pSbUnoService;
+}
+
+SbxVariable* SbUnoService::Find( const String& rName, SbxClassType )
+{
+ SbxVariable* pRes = SbxObject::Find( rName, SbxCLASS_METHOD );
+
+ if( !pRes )
+ {
+ // Wenn es schon eine Klasse ist, nach einen Feld fragen
+ if( m_bNeedsInit && m_xServiceTypeDesc.is() )
+ {
+ m_bNeedsInit = false;
+
+ Sequence< Reference< XServiceConstructorDescription > > aSCDSeq = m_xServiceTypeDesc->getConstructors();
+ const Reference< XServiceConstructorDescription >* pCtorSeq = aSCDSeq.getConstArray();
+ int nCtorCount = aSCDSeq.getLength();
+ for( int i = 0 ; i < nCtorCount ; ++i )
+ {
+ Reference< XServiceConstructorDescription > xCtor = pCtorSeq[i];
+
+ String aName( xCtor->getName() );
+ if( !aName.Len() )
+ {
+ if( xCtor->isDefaultConstructor() )
+ aName = String::CreateFromAscii( "create" );
+ }
+
+ if( aName.Len() )
+ {
+ // Create and insert SbUnoServiceCtor
+ SbxVariableRef xSbCtorRef = new SbUnoServiceCtor( aName, xCtor );
+ QuickInsert( (SbxVariable*)xSbCtorRef );
+ pRes = xSbCtorRef;
+ }
+ }
+ }
+ }
+
+ return pRes;
+}
+
+void SbUnoService::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
+ const SfxHint& rHint, const TypeId& rHintType )
+{
+ const SbxHint* pHint = PTR_CAST(SbxHint,&rHint);
+ if( pHint )
+ {
+ SbxVariable* pVar = pHint->GetVar();
+ SbxArray* pParams = pVar->GetParameters();
+ SbUnoServiceCtor* pUnoCtor = PTR_CAST(SbUnoServiceCtor,pVar);
+ if( pUnoCtor && pHint->GetId() == SBX_HINT_DATAWANTED )
+ {
+ // Parameter count -1 because of Param0 == this
+ UINT32 nParamCount = pParams ? ((UINT32)pParams->Count() - 1) : 0;
+ Sequence<Any> args;
+ BOOL bOutParams = FALSE;
+
+ Reference< XServiceConstructorDescription > xCtor = pUnoCtor->getServiceCtorDesc();
+ Sequence< Reference< XParameter > > aParameterSeq = xCtor->getParameters();
+ const Reference< XParameter >* pParameterSeq = aParameterSeq.getConstArray();
+ UINT32 nUnoParamCount = aParameterSeq.getLength();
+
+ // Default: Ignore not needed parameters
+ bool bParameterError = false;
+
+ // Is the last parameter a rest parameter?
+ bool bRestParameterMode = false;
+ if( nUnoParamCount > 0 )
+ {
+ Reference< XParameter > xLastParam = pParameterSeq[ nUnoParamCount - 1 ];
+ if( xLastParam.is() )
+ {
+ if( xLastParam->isRestParameter() )
+ bRestParameterMode = true;
+ }
+ }
+
+ // Too many parameters with context as first parameter?
+ USHORT nSbxParameterOffset = 1;
+ USHORT nParameterOffsetByContext = 0;
+ Reference < XComponentContext > xFirstParamContext;
+ if( nParamCount > nUnoParamCount )
+ {
+ // Check if first parameter is a context and use it
+ // then in createInstanceWithArgumentsAndContext
+ Any aArg0 = sbxToUnoValue( pParams->Get( nSbxParameterOffset ) );
+ if( (aArg0 >>= xFirstParamContext) && xFirstParamContext.is() )
+ nParameterOffsetByContext = 1;
+ }
+
+ UINT32 nEffectiveParamCount = nParamCount - nParameterOffsetByContext;
+ UINT32 nAllocParamCount = nEffectiveParamCount;
+ if( nEffectiveParamCount > nUnoParamCount )
+ {
+ if( !bRestParameterMode )
+ {
+ nEffectiveParamCount = nUnoParamCount;
+ nAllocParamCount = nUnoParamCount;
+ }
+ }
+ // Not enough parameters?
+ else if( nUnoParamCount > nEffectiveParamCount )
+ {
+ // RestParameterMode only helps if one (the last) parameter is missing
+ int nDiff = nUnoParamCount - nEffectiveParamCount;
+ if( !bRestParameterMode || nDiff > 1 )
+ {
+ bParameterError = true;
+ StarBASIC::Error( SbERR_NOT_OPTIONAL );
+ }
+ }
+
+ if( !bParameterError )
+ {
+ if( nAllocParamCount > 0 )
+ {
+ args.realloc( nAllocParamCount );
+ Any* pAnyArgs = args.getArray();
+ for( UINT32 i = 0 ; i < nEffectiveParamCount ; i++ )
+ {
+ USHORT iSbx = (USHORT)(i + nSbxParameterOffset + nParameterOffsetByContext);
+
+ // bRestParameterMode allows nEffectiveParamCount > nUnoParamCount
+ Reference< XParameter > xParam;
+ if( i < nUnoParamCount )
+ {
+ xParam = pParameterSeq[i];
+ if( !xParam.is() )
+ continue;
+
+ Reference< XTypeDescription > xParamTypeDesc = xParam->getType();
+ if( !xParamTypeDesc.is() )
+ continue;
+ com::sun::star::uno::Type aType( xParamTypeDesc->getTypeClass(), xParamTypeDesc->getName() );
+
+ // sbx paramter needs offset 1
+ pAnyArgs[i] = sbxToUnoValue( pParams->Get( iSbx ), aType );
+
+ // Check for out parameter if not already done
+ if( !bOutParams )
+ {
+ if( xParam->isOut() )
+ bOutParams = TRUE;
+ }
+ }
+ else
+ {
+ pAnyArgs[i] = sbxToUnoValue( pParams->Get( iSbx ) );
+ }
+ }
+ }
+
+ // "Call" ctor using createInstanceWithArgumentsAndContext
+ Reference < XComponentContext > xContext;
+ if( xFirstParamContext.is() )
+ {
+ xContext = xFirstParamContext;
+ }
+ else
+ {
+ Reference < XPropertySet > xProps( ::comphelper::getProcessServiceFactory(), UNO_QUERY_THROW );
+ xContext.set( xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" )) ), UNO_QUERY_THROW );
+ }
+ Reference< XMultiComponentFactory > xServiceMgr( xContext->getServiceManager() );
+
+ Any aRetAny;
+ if( xServiceMgr.is() )
+ {
+ String aServiceName = GetName();
+ Reference < XInterface > xRet;
+ try
+ {
+ xRet = xServiceMgr->createInstanceWithArgumentsAndContext( aServiceName, args, xContext );
+ }
+ catch( const Exception& )
+ {
+ implHandleAnyException( ::cppu::getCaughtException() );
+ }
+ aRetAny <<= xRet;
+ }
+ unoToSbxValue( pVar, aRetAny );
+
+ // Copy back out parameters?
+ if( bOutParams )
+ {
+ const Any* pAnyArgs = args.getConstArray();
+
+ for( UINT32 j = 0 ; j < nUnoParamCount ; j++ )
+ {
+ Reference< XParameter > xParam = pParameterSeq[j];
+ if( !xParam.is() )
+ continue;
+
+ if( xParam->isOut() )
+ unoToSbxValue( (SbxVariable*)pParams->Get( (USHORT)(j+1) ), pAnyArgs[ j ] );
+ }
+ }
+ }
+ }
+ else
+ SbxObject::SFX_NOTIFY( rBC, rBCType, rHint, rHintType );
+ }
+}
+
+
+
+static SbUnoServiceCtor* pFirstCtor = NULL;
+
+void clearUnoServiceCtors( void )
+{
+ SbUnoServiceCtor* pCtor = pFirstCtor;
+ while( pCtor )
+ {
+ pCtor->SbxValue::Clear();
+ pCtor = pCtor->pNext;
+ }
+}
+
+SbUnoServiceCtor::SbUnoServiceCtor( const String& aName_, Reference< XServiceConstructorDescription > xServiceCtorDesc )
+ : SbxMethod( aName_, SbxOBJECT )
+ , m_xServiceCtorDesc( xServiceCtorDesc )
+{
+}
+
+SbUnoServiceCtor::~SbUnoServiceCtor()
+{
+}
+
+SbxInfo* SbUnoServiceCtor::GetInfo()
+{
+ SbxInfo* pRet = NULL;
+
+ return pRet;
+}
+
+
+
//========================================================================
//========================================================================
//========================================================================
@@ -3703,7 +3947,6 @@ void RTL_Impl_GetDefaultContext( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite
//========================================================================
// Creates a Basic wrapper object for a strongly typed Uno value
// 1. parameter: Uno type as full qualified type name, e.g. "byte[]"
-// void RTL_Impl_GetDefaultContext( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite )
void RTL_Impl_CreateUnoValue( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite )
{
(void)pBasic;
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index 0d16dedf1f..21b31020f9 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -531,6 +531,7 @@ void ClearUnoObjectsInRTL_Impl( StarBASIC* pBasic )
{
// #67781 Rueckgabewerte der Uno-Methoden loeschen
clearUnoMethods();
+ clearUnoServiceCtors();
ClearUnoObjectsInRTL_Impl_Rek( pBasic );
diff --git a/basic/source/comp/exprtree.cxx b/basic/source/comp/exprtree.cxx
index f22ef6cede..b40ae4d1df 100644
--- a/basic/source/comp/exprtree.cxx
+++ b/basic/source/comp/exprtree.cxx
@@ -701,12 +701,6 @@ SbiExprNode* SbiExpression::Comp()
pNd = new SbiExprNode( pParser, pNd, eTok, Cat() );
nCount++;
}
- // Mehrere Operatoren hintereinander gehen nicht
- if( nCount > 1 )
- {
- pParser->Error( SbERR_SYNTAX );
- bError = TRUE;
- }
}
return pNd;
}
diff --git a/basic/source/comp/scanner.cxx b/basic/source/comp/scanner.cxx
index ee487baaa9..07033cd7ea 100644
--- a/basic/source/comp/scanner.cxx
+++ b/basic/source/comp/scanner.cxx
@@ -479,7 +479,17 @@ PrevLineCommentLbl:
eoln:
if( nCol && *--pLine == '_' )
{
- pLine = NULL; return NextSym();
+ pLine = NULL;
+ bool bRes = NextSym();
+ if( bVBASupportOn && aSym.GetBuffer()[0] == '.' )
+ {
+ // object _
+ // .Method
+ // ^^^ <- spaces is legal in MSO VBA
+ OSL_TRACE("*** resetting bSpaces***");
+ bSpaces = FALSE;
+ }
+ return bRes;
}
else
{
diff --git a/basic/source/inc/runtime.hxx b/basic/source/inc/runtime.hxx
index 2564f83d6b..409f0d76d6 100644
--- a/basic/source/inc/runtime.hxx
+++ b/basic/source/inc/runtime.hxx
@@ -220,10 +220,11 @@ public:
SbiInstance( StarBASIC* );
~SbiInstance();
- void Error( SbError ); // trappable Error
+ void Error( SbError ); // trappable Error
void Error( SbError, const String& rMsg ); // trappable Error mit Message
- void FatalError( SbError ); // non-trappable Error
- void Abort(); // Abbruch mit aktuellem Fehlercode
+ void FatalError( SbError ); // non-trappable Error
+ void FatalError( SbError, const String& ); // non-trappable Error
+ void Abort(); // Abbruch mit aktuellem Fehlercode
void Stop();
SbError GetErr() { return nErr; }
@@ -270,30 +271,6 @@ struct RefSaveItem
};
-// #72732 Spezielle SbxVariable, die beim put/get prueft,
-// ob der Kontext fuer eine UnoClass sinnvoll ist. Sonst
-// liegt eventuell ein Schreibfehler im Basic-Source vor.
-class UnoClassMemberVariable : public SbxVariable
-{
- SbiRuntime* mpRuntime;
- BOOL bInternalUse;
-
-public:
- UnoClassMemberVariable( SbiRuntime* pRuntime_, const SbxObjectRef& xWrapper )
- : SbxVariable( SbxVARIANT ), mpRuntime( pRuntime_ )
- {
- bInternalUse = TRUE;
- PutObject( xWrapper );
- bInternalUse = FALSE;
- }
-
- virtual BOOL Get( SbxValues& ) const;
- virtual BOOL Put( const SbxValues& );
-
- TYPEINFO();
-};
-
-
// Eine Instanz dieser Klasse wird fuer jedes ausgefuehrte Unterprogramm
// aufgesetzt. Diese Instanz ist das Herz der BASIC-Maschine und enthaelt
// nur lokale Daten.
@@ -467,8 +444,10 @@ public:
SbiRuntime( SbModule*, SbMethod*, UINT32 );
~SbiRuntime();
- void Error( SbError ); // Fehler setzen, falls != 0
- void FatalError( SbError ); // Fehlerbehandlung=Standard, Fehler setzen
+ void Error( SbError ); // Fehler setzen, falls != 0
+ void Error( SbError, const String& ); // Fehler setzen, falls != 0
+ void FatalError( SbError ); // Fehlerbehandlung=Standard, Fehler setzen
+ void FatalError( SbError, const String& ); // Fehlerbehandlung=Standard, Fehler setzen
void DumpPCode();
BOOL Step(); // Einzelschritt (ein Opcode)
void Stop() { bRun = FALSE; }
diff --git a/basic/source/inc/sbunoobj.hxx b/basic/source/inc/sbunoobj.hxx
index dc2cfefbee..5780113482 100644
--- a/basic/source/inc/sbunoobj.hxx
+++ b/basic/source/inc/sbunoobj.hxx
@@ -43,6 +43,7 @@
#include <com/sun/star/beans/XIntrospection.hpp>
#include <com/sun/star/script/XInvocation.hpp>
#include <com/sun/star/reflection/XIdlClass.hpp>
+#include <com/sun/star/reflection/XServiceTypeDescription2.hpp>
#include <rtl/ustring.hxx>
class SbUnoObject: public SbxObject
@@ -149,7 +150,7 @@ public:
};
// Wrapper fuer eine Uno-Klasse
-class SbUnoClass: public SbxObject
+class SbUnoClass : public SbxObject
{
const ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XIdlClass > m_xClass;
@@ -177,9 +178,57 @@ SV_DECL_IMPL_REF(SbUnoClass);
// Funktion, um einen globalen Bezeichner im
// UnoScope zu suchen und fuer Sbx zu wrappen
-SbxVariable* findUnoClass( const String& rName );
+SbUnoClass* findUnoClass( const String& rName );
+// Wrapper for UNO Service
+class SbUnoService : public SbxObject
+{
+ const ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XServiceTypeDescription2 > m_xServiceTypeDesc;
+ bool m_bNeedsInit;
+
+public:
+ TYPEINFO();
+ SbUnoService( const String& aName_,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XServiceTypeDescription2 >& xServiceTypeDesc )
+ : SbxObject( aName_ )
+ , m_xServiceTypeDesc( xServiceTypeDesc )
+ , m_bNeedsInit( true )
+ {}
+
+ virtual SbxVariable* Find( const String&, SbxClassType );
+
+ void SFX_NOTIFY( SfxBroadcaster&, const TypeId&, const SfxHint& rHint, const TypeId& );
+};
+SV_DECL_IMPL_REF(SbUnoService);
+
+SbUnoService* findUnoService( const String& rName );
+
+
+void clearUnoServiceCtors( void );
+
+class SbUnoServiceCtor : public SbxMethod
+{
+ friend class SbUnoService;
+ friend void clearUnoServiceCtors( void );
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XServiceConstructorDescription > m_xServiceCtorDesc;
+
+ SbUnoServiceCtor* pPrev;
+ SbUnoServiceCtor* pNext;
+
+public:
+ TYPEINFO();
+
+ SbUnoServiceCtor( const String& aName_, ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XServiceConstructorDescription > xServiceCtorDesc );
+ virtual ~SbUnoServiceCtor();
+ virtual SbxInfo* GetInfo();
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XServiceConstructorDescription > getServiceCtorDesc( void )
+ { return m_xServiceCtorDesc; }
+};
+
+
// #105565 Special Object to wrap a strongly typed Uno Any
class SbUnoAnyObject: public SbxObject
{
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
index 6c0e4ea60d..361255af24 100644
--- a/basic/source/runtime/runtime.cxx
+++ b/basic/source/runtime/runtime.cxx
@@ -430,6 +430,11 @@ void SbiInstance::FatalError( SbError n )
pRun->FatalError( n );
}
+void SbiInstance::FatalError( SbError _errCode, const String& _details )
+{
+ pRun->FatalError( _errCode, _details );
+}
+
void SbiInstance::Abort()
{
// Basic suchen, in dem der Fehler auftrat
@@ -721,7 +726,7 @@ BOOL SbiRuntime::Step()
pCode = pError;
else
bLetParentHandleThis = true;
- }
+ }
else
{
bLetParentHandleThis = true;
@@ -795,12 +800,35 @@ void SbiRuntime::Error( SbError n )
nError = n;
}
+void SbiRuntime::Error( SbError _errCode, const String& _details )
+{
+ if ( _errCode )
+ {
+ OSL_ENSURE( pInst->pRun == this, "SbiRuntime::Error: can't propagate the error message details!" );
+ if ( pInst->pRun == this )
+ {
+ pInst->Error( _errCode, _details );
+ OSL_POSTCOND( nError == _errCode, "SbiRuntime::Error: the instance is expecte to propagate the error code back to me!" );
+ }
+ else
+ {
+ nError = _errCode;
+ }
+ }
+}
+
void SbiRuntime::FatalError( SbError n )
{
StepSTDERROR();
Error( n );
}
+void SbiRuntime::FatalError( SbError _errCode, const String& _details )
+{
+ StepSTDERROR();
+ Error( _errCode, _details );
+}
+
//////////////////////////////////////////////////////////////////////////
//
// Parameter, Locals, Caller
@@ -859,21 +887,13 @@ SbxVariableRef SbiRuntime::PopVar()
BOOL SbiRuntime::ClearExprStack()
{
- // #74732 Hier kann ein Fehler gesetzt werden
- BOOL bErrorSet = FALSE;
-
// Achtung: Clear() reicht nicht, da Methods geloescht werden muessen
while ( nExprLvl )
{
- SbxVariableRef xVar = PopVar();
- if( !nError && xVar->ISA( UnoClassMemberVariable ) )
- {
- Error( SbERR_NO_METHOD );
- bErrorSet = TRUE;
- }
+ PopVar();
}
refExprStk->Clear();
- return bErrorSet;
+ return FALSE;
}
// Variable auf dem Expression-Stack holen, ohne sie zu entfernen
diff --git a/basic/source/runtime/step2.cxx b/basic/source/runtime/step2.cxx
index 097712a576..2589207ac9 100644
--- a/basic/source/runtime/step2.cxx
+++ b/basic/source/runtime/step2.cxx
@@ -199,7 +199,7 @@ SbxVariable* SbiRuntime::FindElement
}
// #72382 VORSICHT! Liefert jetzt wegen unbekannten
// Modulen IMMER ein Ergebnis!
- SbxVariable* pUnoClass = findUnoClass( aName );
+ SbUnoClass* pUnoClass = findUnoClass( aName );
if( pUnoClass )
{
pElem = new SbxVariable( t );
@@ -255,7 +255,7 @@ SbxVariable* SbiRuntime::FindElement
ClearArgvStack();
// Normalen Error setzen
- Error( nNotFound );
+ Error( nNotFound, aName );
}
else
{
@@ -832,6 +832,7 @@ void SbiRuntime::StepSTMNT( UINT32 nOp1, UINT32 nOp2 )
// Wenn der Expr-Stack am Anfang einen Statements eine Variable enthaelt,
// hat ein Trottel X als Funktion aufgerufen, obwohl es eine Variable ist!
BOOL bFatalExpr = FALSE;
+ String sUnknownMethodName;
if( nExprLvl > 1 )
bFatalExpr = TRUE;
else if( nExprLvl )
@@ -839,7 +840,10 @@ void SbiRuntime::StepSTMNT( UINT32 nOp1, UINT32 nOp2 )
SbxVariable* p = refExprStk->Get( 0 );
if( p->GetRefCount() > 1
&& refLocals.Is() && refLocals->Find( p->GetName(), p->GetClass() ) )
+ {
+ sUnknownMethodName = p->GetName();
bFatalExpr = TRUE;
+ }
}
// Der Expr-Stack ist nun nicht mehr notwendig
ClearExprStack();
@@ -854,7 +858,7 @@ void SbiRuntime::StepSTMNT( UINT32 nOp1, UINT32 nOp2 )
// stimmen!
if( bFatalExpr)
{
- StarBASIC::FatalError( SbERR_NO_METHOD );
+ StarBASIC::FatalError( SbERR_NO_METHOD, sUnknownMethodName );
return;
}
pStmnt = pCode - 9;
diff --git a/basic/source/sbx/sbxvalue.cxx b/basic/source/sbx/sbxvalue.cxx
index 5c2105d89d..e746f3d115 100644
--- a/basic/source/sbx/sbxvalue.cxx
+++ b/basic/source/sbx/sbxvalue.cxx
@@ -1572,7 +1572,10 @@ BOOL SbxValue::Compare( SbxOperator eOp, const SbxValue& rOp ) const
else
{
aL.eType = aR.eType = SbxDOUBLE;
- if( Get( aL ) && rOp.Get( aR ) )
+ //if( Get( aL ) && rOp.Get( aR ) )
+ bool bGetL = Get( aL );
+ bool bGetR = rOp.Get( aR );
+ if( bGetL && bGetR )
switch( eOp )
{
case SbxEQ:
@@ -1590,6 +1593,17 @@ BOOL SbxValue::Compare( SbxOperator eOp, const SbxValue& rOp ) const
default:
SetError( SbxERR_NOTIMP );
}
+ // at least one value was got
+ // if this is VBA then a conversion error for one
+ // side will yield a false result of an equality test
+ else if ( bGetR || bGetL )
+ {
+ if ( bVBAInterop && eOp == SbxEQ && GetError() == SbxERR_CONVERSION )
+ {
+ ResetError();
+ bRes = FALSE;
+ }
+ }
}
}
if( eOld != SbxERR_OK )
diff --git a/configmgr/source/inc/bootstrap.hxx b/configmgr/source/inc/bootstrap.hxx
index 2dceb7ab3f..8443003852 100644
--- a/configmgr/source/inc/bootstrap.hxx
+++ b/configmgr/source/inc/bootstrap.hxx
@@ -34,7 +34,6 @@
#include "bootstrapcontext.hxx"
// ---------------------------------------------------------------------------------------
-#define CONFIGMGR_INIFILE SAL_CONFIGFILE("configmgr")
#define BOOTSTRAP_ITEM_INIFILE "CFG_INIFILE"
// ---------------------------------------------------------------------------------------
// standard settings
diff --git a/configmgr/source/misc/bootstrap.cxx b/configmgr/source/misc/bootstrap.cxx
index bf927ed12c..714ed61ac2 100644
--- a/configmgr/source/misc/bootstrap.cxx
+++ b/configmgr/source/misc/bootstrap.cxx
@@ -47,7 +47,6 @@
#include <rtl/ustrbuf.hxx>
#include <osl/file.hxx>
#include <osl/process.h>
-#include <osl/module.hxx>
#include <osl/diagnose.h>
#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/configuration/MissingBootstrapFileException.hpp>
@@ -238,27 +237,15 @@ void BootstrapContext::initialize()
ComponentContext::initialize(sURL);
}
-// ---------------------------------------------------------------------------
-
-static rtl::OUString getCurrentModuleDirectory() // URL including terminating slash
-{
- rtl::OUString aFileURL;
- if ( !osl::Module::getUrlFromAddress(reinterpret_cast< oslGenericFunction >( &getCurrentModuleDirectory ),aFileURL) )
- {
- OSL_TRACE(false, "Cannot locate current module - using executable instead");
-
- OSL_VERIFY(osl_Process_E_None == osl_getExecutableFile(&aFileURL.pData));
- }
-
- OSL_ENSURE(0 < aFileURL.lastIndexOf('/'), "Cannot find directory for module URL");
-
- return aFileURL.copy(0, aFileURL.lastIndexOf('/') + 1);
-}
// ---------------------------------------------------------------------------------------
rtl::OUString BootstrapContext::getDefaultConfigurationBootstrapURL()
{
- return getCurrentModuleDirectory() + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(CONFIGMGR_INIFILE));
+ rtl::OUString url(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "$OOO_BASE_DIR/program/" SAL_CONFIGFILE("configmgr")));
+ rtl::Bootstrap::expandMacros(url); //TODO: detect failure
+ return url;
}
// ---------------------------------------------------------------------------------------
diff --git a/connectivity/inc/connectivity/DriversConfig.hxx b/connectivity/inc/connectivity/DriversConfig.hxx
new file mode 100644
index 0000000000..8a33019d57
--- /dev/null
+++ b/connectivity/inc/connectivity/DriversConfig.hxx
@@ -0,0 +1,88 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: makefile,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: st $ $Date: 2000/11/22 02:32:00 $
+ *
+ * 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 CONNECTIVITY_DRIVERSCONFIG_HXX_INCLUDED
+#define CONNECTIVITY_DRIVERSCONFIG_HXX_INCLUDED
+
+#include <comphelper/stl_types.hxx>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/beans/NamedValue.hpp>
+#include <com/sun/star/uno/Sequence.h>
+#include "connectivity/dbtoolsdllapi.hxx"
+#include <salhelper/singletonref.hxx>
+#include <comphelper/namedvaluecollection.hxx>
+#include <unotools/confignode.hxx>
+
+namespace connectivity
+{
+ typedef struct
+ {
+ ::comphelper::NamedValueCollection aProperties;
+ ::comphelper::NamedValueCollection aFeatures;
+ ::comphelper::NamedValueCollection aMetaData;
+ ::rtl::OUString sDriverFactory;
+ ::rtl::OUString sDriverTypeDisplayName;
+ } TInstalledDriver;
+ DECLARE_STL_USTRINGACCESS_MAP( TInstalledDriver, TInstalledDrivers);
+
+ class DriversConfigImpl
+ {
+ ::utl::OConfigurationTreeRoot m_aInstalled;
+ public:
+ DriversConfigImpl();
+ void Load(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB,TInstalledDrivers& _rDrivers);
+ };
+ //
+ // Allows to access all driver which are located in the configuration
+ //
+ class OOO_DLLPUBLIC_DBTOOLS DriversConfig
+ {
+ typedef salhelper::SingletonRef<DriversConfigImpl> OSharedConfigNode;
+
+ const ::comphelper::NamedValueCollection& impl_get(const ::rtl::OUString& _sURL,sal_Int32 _nProps) const;
+ public:
+ DriversConfig(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB);
+
+ ::rtl::OUString getDriverFactoryName(const ::rtl::OUString& _sUrl) const;
+ ::rtl::OUString getDriverTypeDisplayName(const ::rtl::OUString& _sUrl) const;
+ const ::comphelper::NamedValueCollection& getProperties(const ::rtl::OUString& _sURL) const;
+ const ::comphelper::NamedValueCollection& getFeatures(const ::rtl::OUString& _sURL) const;
+ const ::comphelper::NamedValueCollection& getMetaData(const ::rtl::OUString& _sURL) const;
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > getURLs() const;
+ private:
+ TInstalledDrivers m_aDrivers;
+ OSharedConfigNode m_aNode;
+ };
+}
+#endif // CONNECTIVITY_DRIVERSCONFIG_HXX_INCLUDED
diff --git a/connectivity/inc/connectivity/dbexception.hxx b/connectivity/inc/connectivity/dbexception.hxx
index ca5286176d..682a6d9976 100644
--- a/connectivity/inc/connectivity/dbexception.hxx
+++ b/connectivity/inc/connectivity/dbexception.hxx
@@ -150,6 +150,12 @@ public:
const ::com::sun::star::uno::Any& get() const { return m_aContent; }
+ void clear()
+ {
+ m_aContent.clear();
+ m_eType = UNDEFINED;
+ }
+
protected:
void implDetermineType();
};
diff --git a/connectivity/inc/connectivity/dbmetadata.hxx b/connectivity/inc/connectivity/dbmetadata.hxx
index 67eb467118..17583b240e 100644
--- a/connectivity/inc/connectivity/dbmetadata.hxx
+++ b/connectivity/inc/connectivity/dbmetadata.hxx
@@ -135,8 +135,15 @@ namespace dbtools
<code>SELECT * FROM table correlation_name</code> is generated.
*/
bool generateASBeforeCorrelationName() const;
+
+ /** should date time be escaped like '2001-01-01' => #2001-01-01#
+ */
bool shouldEscapeDateTime() const;
+ /** auto increment columns should be automaticly used as primary key.
+ */
+ bool isAutoIncrementPrimaryKey() const;
+
/** determines the syntax to use for boolean comparison predicates
@see ::com::sun::star::sdb::BooleanComparisonMode
diff --git a/connectivity/inc/connectivity/sqlnode.hxx b/connectivity/inc/connectivity/sqlnode.hxx
index 6c51041bc8..6a919172c7 100644
--- a/connectivity/inc/connectivity/sqlnode.hxx
+++ b/connectivity/inc/connectivity/sqlnode.hxx
@@ -39,6 +39,7 @@
#include <functional>
#include <set>
#include <boost/shared_ptr.hpp>
+#include <rtl/ustrbuf.hxx>
// forward declarations
namespace com
@@ -428,22 +429,22 @@ namespace connectivity
bool _bSubstitute) const;
private:
- void impl_parseNodeToString_throw( ::rtl::OUString& rString, const SQLParseNodeParameter& rParam) const;
- void impl_parseLikeNodeToString_throw( ::rtl::OUString& rString, const SQLParseNodeParameter& rParam ) const;
- void impl_parseTableRangeNodeToString_throw( ::rtl::OUString& rString, const SQLParseNodeParameter& rParam ) const;
+ void impl_parseNodeToString_throw( ::rtl::OUStringBuffer& rString, const SQLParseNodeParameter& rParam) const;
+ void impl_parseLikeNodeToString_throw( ::rtl::OUStringBuffer& rString, const SQLParseNodeParameter& rParam ) const;
+ void impl_parseTableRangeNodeToString_throw( ::rtl::OUStringBuffer& rString, const SQLParseNodeParameter& rParam ) const;
/** parses a table_name node into a SQL statement particle.
@return
<TRUE/> if and only if parsing was successful, <FALSE/> if default handling should
be applied.
*/
- bool impl_parseTableNameNodeToString_throw( ::rtl::OUString& rString, const SQLParseNodeParameter& rParam ) const;
+ bool impl_parseTableNameNodeToString_throw( ::rtl::OUStringBuffer& rString, const SQLParseNodeParameter& rParam ) const;
- sal_Bool addDateValue(::rtl::OUString& rString, const SQLParseNodeParameter& rParam) const;
+ sal_Bool addDateValue(::rtl::OUStringBuffer& rString, const SQLParseNodeParameter& rParam) const;
::rtl::OUString convertDateTimeString(const SQLParseNodeParameter& rParam, const ::rtl::OUString& rString) const;
::rtl::OUString convertDateString(const SQLParseNodeParameter& rParam, const ::rtl::OUString& rString) const;
::rtl::OUString convertTimeString(const SQLParseNodeParameter& rParam, const ::rtl::OUString& rString) const;
- void parseLeaf(::rtl::OUString & rString, const SQLParseNodeParameter& rParam) const;
+ void parseLeaf(::rtl::OUStringBuffer& rString, const SQLParseNodeParameter& rParam) const;
};
//-----------------------------------------------------------------------------
diff --git a/connectivity/inc/connectivity/sqlparse.hxx b/connectivity/inc/connectivity/sqlparse.hxx
index 808f37e3a1..6518a81933 100644
--- a/connectivity/inc/connectivity/sqlparse.hxx
+++ b/connectivity/inc/connectivity/sqlparse.hxx
@@ -232,7 +232,8 @@ namespace connectivity
// compares the _sFunctionName with all known function names and return the DataType of the return value
static sal_Int32 getFunctionReturnType(const ::rtl::OUString& _sFunctionName, const IParseContext* pContext = NULL);
-
+ // returns the type for a parameter in a given function name
+ static sal_Int32 getFunctionParameterType(sal_uInt32 _nTokenId,sal_uInt32 _nPos);
void error(sal_Char *fmt);
int SQLlex();
diff --git a/connectivity/makefile.pmk b/connectivity/makefile.pmk
new file mode 100644
index 0000000000..ede06e49d3
--- /dev/null
+++ b/connectivity/makefile.pmk
@@ -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: makefile.pmk,v $
+#
+# $Revision: 1.6 $
+#
+# 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.
+#
+#*************************************************************************
+
+XSLDIR=$(SOLARXMLDIR)$/processing
+ABSXCSROOT=$(PWD)$/$(MISC)
+# ABSXCSROOT=$(MISC)
+XCSROOT=..
+# XCSROOT=$(SOLARXMLDIR)
+# ABSXCSROOT=$(SOLARXMLDIR)
+DTDDIR=$(SOLARXMLDIR)
+PROCESSOUT=$(MISC)
+PROCESSORDIR=$(SOLARBINDIR)
+
+
+# no validation by inspector class
+NO_INSPECTION=TRUE
+
+JAVAPREPRO=
+.IF "$(JDK_VERSION)" == "110"
+JAVAPREPRO=-jdk11
+.ENDIF
+.IF "$(PRODUCT)" != ""
+JAVAPREPRO=$(JAVAPREPRO) + " -product"
+.ENDIF
+
+# --- Settings -----------------------------------------------------
+PACKAGE=org.openoffice.Office.DataAccess
+.INCLUDE : settings.mk
+
+COMPONENT_CONFIG_DATA*=$(TARGET).xcu
+
+LOCALIZEDFILES= \
+ $(COMPONENT_CONFIG_DATA)
+
+XCUFILES= \
+ $(LOCALIZEDFILES) \
+
+
diff --git a/connectivity/prj/build.lst b/connectivity/prj/build.lst
index 077c241b9f..20cb27644e 100644
--- a/connectivity/prj/build.lst
+++ b/connectivity/prj/build.lst
@@ -1,19 +1,19 @@
-cn connectivity : l10n comphelper MOZ:moz SO:moz_prebuilt svtools UNIXODBC:unixODBC unoil javaunohelper HSQLDB:hsqldb QADEVOOO:qadevOOo NULL
+cn connectivity : l10n comphelper MOZ:moz SO:moz_prebuilt svtools UNIXODBC:unixODBC unoil javaunohelper HSQLDB:hsqldb QADEVOOO:qadevOOo officecfg NSS:nss NULL
cn connectivity usr1 - all cn_mkout NULL
cn connectivity\inc nmake - all cn_inc NULL
cn connectivity\com\sun\star\sdbcx\comp\hsqldb nmake - all cn_jhsqldbdb cn_hsqldb cn_inc NULL
cn connectivity\source\commontools nmake - all cn_cmtools cn_parse cn_inc NULL
-cn connectivity\source\manager nmake - all cn_manager cn_inc NULL
+cn connectivity\source\manager nmake - all cn_manager cn_dbtools cn_inc NULL
cn connectivity\source\cpool nmake - all cn_cpool cn_dbtools cn_inc NULL
cn connectivity\source\resource nmake - all cn_res cn_inc NULL
cn connectivity\source\sdbcx nmake - all cn_sdbcx cn_inc NULL
-cn connectivity\source\drivers\ado nmake - w cn_ado cn_dbtools cn_inc NULL
+cn connectivity\source\drivers\ado nmake - all cn_ado cn_dbtools cn_inc NULL
cn connectivity\source\drivers\mozab\mozillasrc nmake - all cn_mozab_mozillasrc cn_file cn_inc NULL
cn connectivity\source\drivers\mozab\bootstrap nmake - all cn_mozab_bootstrap cn_mozab_mozillasrc cn_inc NULL
cn connectivity\source\drivers\mozab nmake - all cn_mozab cn_mozab_bootstrap cn_dbtools cn_inc NULL
-cn connectivity\source\drivers\kab nmake - u cn_kab cn_dbtools cn_inc NULL
-cn connectivity\source\drivers\macab nmake - u cn_macab cn_dbtools cn_inc NULL
-cn connectivity\source\drivers\evoab2 nmake - u cn_evoab2 cn_dbtools cn_file cn_inc NULL
+cn connectivity\source\drivers\kab nmake - all cn_kab cn_dbtools cn_inc NULL
+cn connectivity\source\drivers\macab nmake - all cn_macab cn_dbtools cn_inc NULL
+cn connectivity\source\drivers\evoab2 nmake - all cn_evoab2 cn_dbtools cn_file cn_inc NULL
cn connectivity\source\drivers\calc nmake - all cn_calc cn_file cn_inc NULL
cn connectivity\source\drivers\odbcbase nmake - all cn_odbcbase cn_dbtools cn_inc NULL
cn connectivity\source\drivers\odbc nmake - all cn_odbc cn_odbcbase cn_inc NULL
@@ -28,3 +28,5 @@ cn connectivity\source\parse nmake - all cn_parse cn_
cn connectivity\source\simpledbt nmake - all cn_simpledbt cn_cmtools cn_inc NULL
cn connectivity\source\dbtools nmake - all cn_dbtools cn_simpledbt cn_cmtools cn_parse cn_res cn_sdbcx cn_inc cn_res NULL
cn connectivity\qa\connectivity\tools nmake - all cn_qa_tools cn_inc NULL
+cn connectivity\util nmake - all cn_util cn_ado cn_mozab cn_kab cn_evoab2 cn_calc cn_odbc cn_mysql cn_jdbc cn_adabas cn_flat cn_dbase cn_hsqldb NULL
+
diff --git a/connectivity/prj/d.lst b/connectivity/prj/d.lst
index 36d93ca2c3..728c8fef03 100644
--- a/connectivity/prj/d.lst
+++ b/connectivity/prj/d.lst
@@ -22,8 +22,12 @@
mkdir: %_DEST%\inc%_EXT%\connectivity
mkdir: %_DEST%\inc%_EXT%\connectivity\sdbcx
+mkdir: %_DEST%\xml%_EXT%\registry\spool\DataAccess
..\inc\connectivity\*.hxx %_DEST%\inc%_EXT%\connectivity\*.hxx
..\%__SRC%\inc\sqlbison.hxx %_DEST%\inc%_EXT%\connectivity\sqlbison.hxx
..\inc\connectivity\sdbcx\*.hxx %_DEST%\inc%_EXT%\connectivity\sdbcx\*.hxx
#..\version.mk %_DEST%\inc%_EXT%\connectivity\version.mk
+..\%__SRC%\misc\registry\data\org\openoffice\Office\DataAccess\*.xcu %_DEST%\xml%_EXT%\registry\spool\DataAccess\*.xcu
+..\%COMMON_OUTDIR%\bin\fcfg_drivers_*.zip %_DEST%\pck%_EXT%\fcfg_drivers_*.zip
+..\%__SRC%\bin\fcfg_drivers_*.zip %_DEST%\pck%_EXT%\fcfg_drivers_*.zip \ No newline at end of file
diff --git a/connectivity/qa/connectivity/tools/AbstractDatabase.java b/connectivity/qa/connectivity/tools/AbstractDatabase.java
new file mode 100644
index 0000000000..60a35c1d3d
--- /dev/null
+++ b/connectivity/qa/connectivity/tools/AbstractDatabase.java
@@ -0,0 +1,230 @@
+/*************************************************************************
+ *
+ * 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: RowSetEventListener.java,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.
+ *
+ ************************************************************************/
+package connectivity.tools;
+
+import com.sun.star.container.XNameAccess;
+import com.sun.star.frame.XModel;
+import com.sun.star.frame.XStorable;
+import com.sun.star.io.IOException;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sdb.XDocumentDataSource;
+import com.sun.star.sdb.XOfficeDatabaseDocument;
+import com.sun.star.sdbc.SQLException;
+import com.sun.star.sdbc.XCloseable;
+import com.sun.star.sdbc.XConnection;
+import com.sun.star.sdbc.XStatement;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.util.CloseVetoException;
+import java.io.File;
+
+/**
+ *
+ * @author oj93728
+ */
+public abstract class AbstractDatabase implements DatabaseAccess
+{
+ // the service factory
+
+ protected final XMultiServiceFactory m_orb;
+ // the URL of the temporary file used for the database document
+ protected String m_databaseDocumentFile;
+ // the database document
+ protected XOfficeDatabaseDocument m_databaseDocument;
+ // the data source belonging to the database document
+ protected DataSource m_dataSource;
+ // the default connection
+ protected XConnection m_connection;
+
+ public AbstractDatabase(final XMultiServiceFactory orb) throws Exception
+ {
+ m_orb = orb;
+ }
+
+ // --------------------------------------------------------------------------------------------------------
+ public AbstractDatabase(final XMultiServiceFactory orb, final String _existingDocumentURL ) throws Exception
+ {
+ m_orb = orb;
+ createDBDocument( _existingDocumentURL );
+ }
+
+ /** returns a connection to the database
+ *
+ * Multiple calls to this method return the same connection. The DbaseDatabase object keeps
+ * the ownership of the connection, so you don't need to (and should not) dispose/close it.
+ *
+ */
+ public XConnection defaultConnection() throws SQLException
+ {
+ if (m_connection == null)
+ {
+ m_connection = m_databaseDocument.getDataSource().getConnection("", "");
+ }
+
+ return m_connection;
+ }
+
+ /** executes the given SQL statement via the defaultConnection
+ */
+ public void executeSQL(final String statementString) throws SQLException
+ {
+ final XStatement statement = defaultConnection().createStatement();
+ statement.execute(statementString);
+ }
+
+ /** stores the database document
+ */
+ public void store() throws IOException
+ {
+ if (m_databaseDocument != null)
+ {
+ final XStorable storeDoc = (XStorable) UnoRuntime.queryInterface(XStorable.class,
+ m_databaseDocument);
+ storeDoc.store();
+ }
+ }
+
+ /** closes the database document
+ *
+ * Any CloseVetoExceptions fired by third parties are ignored, and any reference to the
+ * database document is released.
+ */
+ public void close()
+ {
+ // close connection
+ final XCloseable closeConn = (XCloseable) UnoRuntime.queryInterface(XCloseable.class,
+ m_connection);
+ if (closeConn != null)
+ {
+ try
+ {
+ closeConn.close();
+ }
+ catch (SQLException e)
+ {
+ }
+ }
+ m_connection = null;
+
+ // close document
+ final com.sun.star.util.XCloseable closeDoc = (com.sun.star.util.XCloseable) UnoRuntime.queryInterface(
+ com.sun.star.util.XCloseable.class, m_databaseDocument);
+ if (closeDoc != null)
+ {
+ try
+ {
+ closeDoc.close(true);
+ }
+ catch (CloseVetoException e)
+ {
+ }
+ }
+ m_databaseDocument = null;
+ }
+
+ /** closes the document, and deletes the underlying file
+ */
+ public void closeAndDelete()
+ {
+ close();
+
+ if (m_databaseDocumentFile != null)
+ {
+ try
+ {
+ final File file = new File(m_databaseDocumentFile);
+ file.delete();
+ }
+ catch (Exception e)
+ {
+ }
+ }
+ }
+
+ /** returns the underlying database document
+ */
+ public XOfficeDatabaseDocument getDatabaseDocument()
+ {
+ return m_databaseDocument;
+ }
+
+ /** returns the model interface of the underlying database document
+ */
+ public XModel getModel()
+ {
+ return (XModel) UnoRuntime.queryInterface(XModel.class, m_databaseDocument);
+ }
+
+ public XMultiServiceFactory getORB()
+ {
+ return m_orb;
+ }
+
+ // --------------------------------------------------------------------------------------------------------
+ final protected void createDBDocument(final String _docURL) throws Exception
+ {
+ m_databaseDocumentFile = _docURL;
+
+ final XNameAccess dbContext = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class,
+ m_orb.createInstance("com.sun.star.sdb.DatabaseContext"));
+ final XDocumentDataSource dataSource = (XDocumentDataSource) UnoRuntime.queryInterface(XDocumentDataSource.class,
+ dbContext.getByName(_docURL));
+
+ m_databaseDocument = dataSource.getDatabaseDocument();
+ m_dataSource = new DataSource(m_orb, m_databaseDocument.getDataSource());
+ }
+
+ /** returns the URL of the ODB document represented by this instance
+ */
+ public String getDocumentURL()
+ {
+ return m_databaseDocumentFile;
+ }
+
+ /** returns the data source belonging to this database
+ */
+ public DataSource getDataSource()
+ {
+ return m_dataSource;
+ }
+
+ /** creates a row set operating the database, with a given command/type
+ */
+ public RowSet createRowSet(final int _commandType, final String _command)
+ {
+ return new RowSet(m_orb, getDocumentURL(), _commandType, _command);
+ }
+
+ @Override
+ protected void finalize() throws Throwable
+ {
+ closeAndDelete();
+ super.finalize();
+ }
+}
diff --git a/connectivity/qa/connectivity/tools/DataSource.java b/connectivity/qa/connectivity/tools/DataSource.java
index c28f4983f0..578d906fb2 100644
--- a/connectivity/qa/connectivity/tools/DataSource.java
+++ b/connectivity/qa/connectivity/tools/DataSource.java
@@ -27,10 +27,8 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-
package connectivity.tools;
-import com.sun.star.beans.UnknownPropertyException;
import com.sun.star.container.ElementExistException;
import com.sun.star.container.NoSuchElementException;
import com.sun.star.container.XNameAccess;
@@ -51,21 +49,22 @@ import java.util.logging.Logger;
public class DataSource
{
// the service factory
- XMultiServiceFactory m_orb;
- XDataSource m_dataSource;
- public DataSource( XMultiServiceFactory _orb, String _registeredName ) throws Exception
+ private final XMultiServiceFactory m_orb;
+ private XDataSource m_dataSource;
+
+ public DataSource(final XMultiServiceFactory _orb, final String _registeredName) throws Exception
{
m_orb = _orb;
- XNameAccess dbContext = (XNameAccess)UnoRuntime.queryInterface(XNameAccess.class,
- _orb.createInstance("com.sun.star.sdb.DatabaseContext"));
+ final XNameAccess dbContext = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class,
+ _orb.createInstance("com.sun.star.sdb.DatabaseContext"));
- m_dataSource = (XDataSource)UnoRuntime.queryInterface(XDataSource.class,
- dbContext.getByName( _registeredName ) );
+ m_dataSource = (XDataSource) UnoRuntime.queryInterface(XDataSource.class,
+ dbContext.getByName(_registeredName));
}
- public DataSource( XMultiServiceFactory _orb, XDataSource _dataSource )
+ public DataSource(final XMultiServiceFactory _orb,final XDataSource _dataSource)
{
m_orb = _orb;
m_dataSource = _dataSource;
@@ -75,49 +74,49 @@ public class DataSource
{
return m_dataSource;
}
-
+
/** creates a query with a given name and SQL command
- */
- public void createQuery( String _name, String _sqlCommand ) throws ElementExistException, WrappedTargetException, com.sun.star.lang.IllegalArgumentException
+ */
+ public void createQuery(final String _name, final String _sqlCommand) throws ElementExistException, WrappedTargetException, com.sun.star.lang.IllegalArgumentException
{
- createQuery( _name, _sqlCommand, true );
+ createQuery(_name, _sqlCommand, true);
}
/** creates a query with a given name, SQL command, and EscapeProcessing flag
- */
- public void createQuery( String _name, String _sqlCommand, boolean _escapeProcessing ) throws ElementExistException, WrappedTargetException, com.sun.star.lang.IllegalArgumentException
+ */
+ public void createQuery(final String _name, final String _sqlCommand, final boolean _escapeProcessing) throws ElementExistException, WrappedTargetException, com.sun.star.lang.IllegalArgumentException
{
- XSingleServiceFactory queryDefsFac = (XSingleServiceFactory)UnoRuntime.queryInterface(
- XSingleServiceFactory.class, getQueryDefinitions() );
+ final XSingleServiceFactory queryDefsFac = (XSingleServiceFactory) UnoRuntime.queryInterface(
+ XSingleServiceFactory.class, getQueryDefinitions());
XPropertySet queryDef = null;
try
{
- queryDef = (XPropertySet)UnoRuntime.queryInterface(
- XPropertySet.class, queryDefsFac.createInstance() );
- queryDef.setPropertyValue( "Command", _sqlCommand );
- queryDef.setPropertyValue( "EscapeProcessing", new Boolean( _escapeProcessing ) );
+ queryDef = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet.class, queryDefsFac.createInstance());
+ queryDef.setPropertyValue("Command", _sqlCommand);
+ queryDef.setPropertyValue("EscapeProcessing", Boolean.valueOf(_escapeProcessing));
}
- catch( com.sun.star.uno.Exception e )
+ catch (com.sun.star.uno.Exception e)
{
- e.printStackTrace( System.err );
+ e.printStackTrace(System.err);
}
- XNameContainer queryDefsContainer = (XNameContainer)UnoRuntime.queryInterface(
- XNameContainer.class, getQueryDefinitions() );
- queryDefsContainer.insertByName( _name, queryDef );
+ final XNameContainer queryDefsContainer = (XNameContainer) UnoRuntime.queryInterface(
+ XNameContainer.class, getQueryDefinitions());
+ queryDefsContainer.insertByName(_name, queryDef);
}
/** provides the query definition with the given name
*/
- public QueryDefinition getQueryDefinition( String _name ) throws NoSuchElementException
+ public QueryDefinition getQueryDefinition(final String _name) throws NoSuchElementException
{
- XNameAccess allDefs = getQueryDefinitions();
+ final XNameAccess allDefs = getQueryDefinitions();
try
{
return new QueryDefinition(
- (XPropertySet)UnoRuntime.queryInterface( XPropertySet.class, allDefs.getByName( _name ) ) );
+ (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, allDefs.getByName(_name)));
}
- catch ( WrappedTargetException e )
+ catch (WrappedTargetException e)
{
}
throw new NoSuchElementException();
@@ -127,8 +126,8 @@ public class DataSource
*/
public XNameAccess getQueryDefinitions()
{
- XQueryDefinitionsSupplier suppQueries = (XQueryDefinitionsSupplier)UnoRuntime.queryInterface(
- XQueryDefinitionsSupplier.class, m_dataSource );
+ final XQueryDefinitionsSupplier suppQueries = (XQueryDefinitionsSupplier) UnoRuntime.queryInterface(
+ XQueryDefinitionsSupplier.class, m_dataSource);
return suppQueries.getQueryDefinitions();
}
@@ -137,12 +136,12 @@ public class DataSource
* This is usually necessary if you created tables by directly executing SQL statements,
* bypassing the SDBCX layer.
*/
- public void refreshTables( com.sun.star.sdbc.XConnection _connection )
+ public void refreshTables(final com.sun.star.sdbc.XConnection _connection)
{
- XTablesSupplier suppTables = (XTablesSupplier)UnoRuntime.queryInterface(
- XTablesSupplier.class, _connection );
- XRefreshable refreshTables = (XRefreshable)UnoRuntime.queryInterface(
- XRefreshable.class, suppTables.getTables() );
+ final XTablesSupplier suppTables = (XTablesSupplier) UnoRuntime.queryInterface(
+ XTablesSupplier.class, _connection);
+ final XRefreshable refreshTables = (XRefreshable) UnoRuntime.queryInterface(
+ XRefreshable.class, suppTables.getTables());
refreshTables.refresh();
}
@@ -158,9 +157,9 @@ public class DataSource
String name = null;
try
{
- XPropertySet dataSourceProps = (XPropertySet) UnoRuntime.queryInterface(
- XPropertySet.class, m_dataSource );
- name = (String)dataSourceProps.getPropertyValue("Name");
+ final XPropertySet dataSourceProps = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet.class, m_dataSource);
+ name = (String) dataSourceProps.getPropertyValue("Name");
}
catch (Exception ex)
{
diff --git a/connectivity/qa/connectivity/tools/DatabaseAccess.java b/connectivity/qa/connectivity/tools/DatabaseAccess.java
new file mode 100644
index 0000000000..bc39bb0990
--- /dev/null
+++ b/connectivity/qa/connectivity/tools/DatabaseAccess.java
@@ -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: RowSetEventListener.java,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.
+ *
+ ************************************************************************/
+package connectivity.tools;
+
+import com.sun.star.frame.XModel;
+import com.sun.star.io.IOException;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sdb.XOfficeDatabaseDocument;
+import com.sun.star.sdbc.SQLException;
+import com.sun.star.sdbc.XConnection;
+
+/**
+ *
+ * @author oj93728
+ */
+public interface DatabaseAccess
+{
+ XConnection defaultConnection() throws SQLException;
+
+ void executeSQL(final String statementString) throws SQLException;
+
+ void store() throws IOException;
+
+ void close();
+
+ void closeAndDelete();
+
+ XOfficeDatabaseDocument getDatabaseDocument();
+
+ XModel getModel();
+
+ String getDocumentURL();
+
+ DataSource getDataSource();
+
+ RowSet createRowSet(final int _commandType, final String _command);
+
+ XMultiServiceFactory getORB();
+}
diff --git a/connectivity/qa/connectivity/tools/DbaseDatabase.java b/connectivity/qa/connectivity/tools/DbaseDatabase.java
new file mode 100644
index 0000000000..be41dfae39
--- /dev/null
+++ b/connectivity/qa/connectivity/tools/DbaseDatabase.java
@@ -0,0 +1,100 @@
+/*************************************************************************
+ *
+ * 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: DbaseDatabase.java,v $
+ * $Revision: 1.4.50.2 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+package connectivity.tools;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.frame.XStorable;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sdb.XOfficeDatabaseDocument;
+import com.sun.star.sdbc.SQLException;
+import com.sun.star.uno.UnoRuntime;
+
+import helper.URLHelper;
+import java.io.File;
+
+/**
+ *
+ * @author Ocke
+ */
+public class DbaseDatabase extends AbstractDatabase
+{
+ // --------------------------------------------------------------------------------------------------------
+
+ public DbaseDatabase(final XMultiServiceFactory orb) throws Exception
+ {
+ super(orb);
+ createDBDocument();
+ }
+
+ // --------------------------------------------------------------------------------------------------------
+ public DbaseDatabase(final XMultiServiceFactory orb, final String _existingDocumentURL) throws Exception
+ {
+ super(orb, _existingDocumentURL);
+ }
+
+ /** creates an empty database document in a temporary location
+ */
+ private void createDBDocument() throws Exception
+ {
+ final File documentFile = File.createTempFile("dbase", ".odb");
+ documentFile.deleteOnExit();
+ final File subPath = new File(documentFile.getParent() + File.separator + documentFile.getName().replaceAll(".odb", "") + File.separator );
+ subPath.mkdir();
+ //subPath.deleteOnExit();
+ m_databaseDocumentFile = URLHelper.getFileURLFromSystemPath(documentFile);
+ final String path = URLHelper.getFileURLFromSystemPath(subPath.getPath());
+
+ m_databaseDocument = (XOfficeDatabaseDocument) UnoRuntime.queryInterface(
+ XOfficeDatabaseDocument.class, m_orb.createInstance("com.sun.star.sdb.OfficeDatabaseDocument"));
+ m_dataSource = new DataSource(m_orb, m_databaseDocument.getDataSource());
+
+ final XPropertySet dsProperties = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, m_databaseDocument.getDataSource());
+ dsProperties.setPropertyValue("URL", "sdbc:dbase:" + path);
+
+ final XStorable storable = (XStorable) UnoRuntime.queryInterface(XStorable.class, m_databaseDocument);
+ storable.storeAsURL(m_databaseDocumentFile, new PropertyValue[]
+ {
+ });
+ }
+
+ /** drops the table with a given name
+
+ @param _name
+ the name of the table to drop
+ @param _ifExists
+ TRUE if it should be dropped only when it exists.
+ */
+ public void dropTable(final String _name,final boolean _ifExists) throws SQLException
+ {
+ String dropStatement = "DROP TABLE \"" + _name;
+ executeSQL(dropStatement);
+ }
+}
diff --git a/connectivity/qa/connectivity/tools/HsqlDatabase.java b/connectivity/qa/connectivity/tools/HsqlDatabase.java
index 36e507c0ff..b1af0c118e 100644
--- a/connectivity/qa/connectivity/tools/HsqlDatabase.java
+++ b/connectivity/qa/connectivity/tools/HsqlDatabase.java
@@ -27,29 +27,19 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-
package connectivity.tools;
import com.sun.star.beans.PropertyValue;
import com.sun.star.beans.XPropertySet;
import com.sun.star.container.ElementExistException;
-import com.sun.star.container.XNameAccess;
import com.sun.star.frame.XStorable;
-import com.sun.star.frame.XModel;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.sdb.XOfficeDatabaseDocument;
import com.sun.star.sdbc.SQLException;
-import com.sun.star.sdbc.XCloseable;
-import com.sun.star.sdbc.XConnection;
-import com.sun.star.sdbc.XStatement;
import com.sun.star.sdbcx.XAppend;
import com.sun.star.sdbcx.XTablesSupplier;
import com.sun.star.uno.UnoRuntime;
-import com.sun.star.io.IOException;
-import com.sun.star.sdb.XDocumentDataSource;
-import java.io.File;
-import com.sun.star.util.CloseVetoException;
import helper.URLHelper;
import java.util.HashMap;
import java.util.Iterator;
@@ -60,309 +50,167 @@ import java.io.File;
*
* @author fs93730
*/
-public class HsqlDatabase
+public class HsqlDatabase extends AbstractDatabase
{
- // the service factory
- XMultiServiceFactory m_orb;
- // the URL of the temporary file used for the database document
- String m_databaseDocumentFile;
- // the database document
- XOfficeDatabaseDocument m_databaseDocument;
- // the data source belonging to the database document
- DataSource m_dataSource;
- // the default connection
- XConnection m_connection;
// --------------------------------------------------------------------------------------------------------
- public HsqlDatabase( XMultiServiceFactory orb ) throws Exception
+ public HsqlDatabase(final XMultiServiceFactory orb) throws Exception
{
- m_orb = orb;
+ super(orb);
createDBDocument();
}
// --------------------------------------------------------------------------------------------------------
- public HsqlDatabase( XMultiServiceFactory orb, String _existingDocumentURL ) throws Exception
- {
- m_orb = orb;
- createDBDocument( _existingDocumentURL );
- }
-
- // --------------------------------------------------------------------------------------------------------
- private void createDBDocument( String _docURL ) throws Exception
+ public HsqlDatabase(final XMultiServiceFactory orb, final String _existingDocumentURL) throws Exception
{
- m_databaseDocumentFile = _docURL;
-
- XNameAccess dbContext = (XNameAccess)UnoRuntime.queryInterface( XNameAccess.class,
- m_orb.createInstance( "com.sun.star.sdb.DatabaseContext" ) );
- XDocumentDataSource dataSource = (XDocumentDataSource)UnoRuntime.queryInterface( XDocumentDataSource.class,
- dbContext.getByName( _docURL ) );
-
- m_databaseDocument = dataSource.getDatabaseDocument();
- m_dataSource = new DataSource( m_orb, m_databaseDocument.getDataSource() );
+ super(orb, _existingDocumentURL);
}
/** creates an empty database document in a temporary location
*/
private void createDBDocument() throws Exception
{
- File documentFile = File.createTempFile("testdb",".odb");
+ final File documentFile = File.createTempFile("testdb", ".odb");
documentFile.deleteOnExit();
- m_databaseDocumentFile = URLHelper.getFileURLFromSystemPath( documentFile );
+ m_databaseDocumentFile = URLHelper.getFileURLFromSystemPath(documentFile);
- m_databaseDocument = (XOfficeDatabaseDocument)UnoRuntime.queryInterface(
- XOfficeDatabaseDocument.class, m_orb.createInstance( "com.sun.star.sdb.OfficeDatabaseDocument" ) );
- m_dataSource = new DataSource( m_orb, m_databaseDocument.getDataSource() );
+ m_databaseDocument = (XOfficeDatabaseDocument) UnoRuntime.queryInterface(
+ XOfficeDatabaseDocument.class, m_orb.createInstance("com.sun.star.sdb.OfficeDatabaseDocument"));
+ m_dataSource = new DataSource(m_orb, m_databaseDocument.getDataSource());
- XPropertySet dsProperties = (XPropertySet)UnoRuntime.queryInterface( XPropertySet.class, m_databaseDocument.getDataSource() );
+ final XPropertySet dsProperties = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, m_databaseDocument.getDataSource());
dsProperties.setPropertyValue("URL", "sdbc:embedded:hsqldb");
- XStorable storable = (XStorable)UnoRuntime.queryInterface( XStorable.class, m_databaseDocument );
- storable.storeAsURL( m_databaseDocumentFile, new PropertyValue[]{} );
+ final XStorable storable = (XStorable) UnoRuntime.queryInterface(XStorable.class, m_databaseDocument);
+ storable.storeAsURL(m_databaseDocumentFile, new PropertyValue[]
+ {
+ });
}
- /** returns a connection to the database
- *
- * Multiple calls to this method return the same connection. The HsqlDatabase object keeps
- * the ownership of the connection, so you don't need to (and should not) dispose/close it.
- *
- */
- public XConnection defaultConnection() throws SQLException
- {
- if ( m_connection != null )
- return m_connection;
- m_connection = m_databaseDocument.getDataSource().getConnection(new String(),new String());
- return m_connection;
- }
+ /** drops the table with a given name
- /** executes the given SQL statement via the defaultConnection
+ @param _name
+ the name of the table to drop
+ @param _ifExists
+ TRUE if it should be dropped only when it exists.
*/
- public void executeSQL( String statementString ) throws SQLException
- {
- XStatement statement = defaultConnection().createStatement();
- statement.execute( statementString );
- }
-
- /** stores the database document
- */
- public void store() throws IOException
+ public void dropTable(final String _name, final boolean _ifExists) throws SQLException
{
- if ( m_databaseDocument != null )
+ final StringBuffer dropStatement = new StringBuffer("DROP TABLE \"");
+ dropStatement.append(_name);
+ if (_ifExists)
{
- XStorable storeDoc = (XStorable)UnoRuntime.queryInterface( XStorable.class,
- m_databaseDocument );
- storeDoc.store();
+ dropStatement.append("\" IF EXISTS");
}
+ executeSQL(dropStatement.toString());
}
- /** closes the database document
- *
- * Any CloseVetoExceptions fired by third parties are ignored, and any reference to the
- * database document is released.
- */
- public void close()
+ public void createTable(final HsqlTableDescriptor _tableDesc, final boolean _dropIfExists) throws SQLException
{
- // close connection
- XCloseable closeConn = (XCloseable)UnoRuntime.queryInterface( XCloseable.class,
- m_connection );
- if ( closeConn != null )
+ if (_dropIfExists)
{
- try
- {
- closeConn.close();
- }
- catch( SQLException e )
- {
- }
+ dropTable(_tableDesc.getName(), true);
}
- m_connection = null;
-
- // close document
- com.sun.star.util.XCloseable closeDoc = (com.sun.star.util.XCloseable)UnoRuntime.queryInterface(
- com.sun.star.util.XCloseable.class, m_databaseDocument );
- if ( closeDoc != null )
- {
- try
- {
- closeDoc.close( true );
- }
- catch( CloseVetoException e )
- {
- }
- }
- m_databaseDocument = null;
- }
-
- /** closes the document, and deletes the underlying file
- */
- public void closeAndDelete()
- {
- close();
-
- if ( m_databaseDocumentFile != null )
- {
- try
- {
- File file = new File(m_databaseDocumentFile);
- file.delete();
- }
- catch(Exception e)
- {
- }
- m_databaseDocumentFile = null;
- }
- }
-
- /** returns the underlying database document
- */
- public XOfficeDatabaseDocument getDatabaseDocument()
- {
- return m_databaseDocument;
- }
-
- /** returns the model interface of the underlying database document
- */
- XModel getModel()
- {
- return (XModel)UnoRuntime.queryInterface( XModel.class, m_databaseDocument );
- }
-
- /** drops the table with a given name
-
- @param _name
- the name of the table to drop
- @param _ifExists
- TRUE if it should be dropped only when it exists.
- */
- public void dropTable( String _name, boolean _ifExists ) throws SQLException
- {
- String dropStatement = "DROP TABLE \"" + _name;
- if ( _ifExists )
- dropStatement += "\" IF EXISTS";
- executeSQL( dropStatement );
- }
-
- public void createTable( HsqlTableDescriptor _tableDesc, boolean _dropIfExists ) throws SQLException
- {
- if ( _dropIfExists )
- dropTable( _tableDesc.getName(), true );
- createTable( _tableDesc );
+ createTable(_tableDesc);
}
/** creates a table
*/
- public void createTable( HsqlTableDescriptor _tableDesc ) throws SQLException
+ public void createTable(final HsqlTableDescriptor _tableDesc) throws SQLException
{
- String createStatement = "CREATE CACHED TABLE \"";
- createStatement += _tableDesc.getName();
- createStatement += "\" ( ";
+ StringBuffer createStatement = new StringBuffer("CREATE CACHED TABLE \"");
+ createStatement.append(_tableDesc.getName());
+ createStatement.append("\" ( ");
String primaryKeyList = "";
- HashMap foreignKeys = new HashMap();
- HashMap foreignKeyRefs = new HashMap();
+ final HashMap foreignKeys = new HashMap();
+ final HashMap foreignKeyRefs = new HashMap();
- HsqlColumnDescriptor[] columns = _tableDesc.getColumns();
- for ( int i=0; i<columns.length; ++i )
+ final HsqlColumnDescriptor[] columns = _tableDesc.getColumns();
+ for (int i = 0; i < columns.length; ++i)
{
- if ( i > 0 )
- createStatement += ", ";
+ if (i > 0)
+ {
+ createStatement.append(", ");
+ }
- createStatement += "\"" + columns[i].getName();
- createStatement += "\" " + columns[i].getTypeName();
+ createStatement.append("\"" + columns[i].getName());
+ createStatement.append("\" " + columns[i].getTypeName());
- if ( columns[i].isRequired() )
- createStatement += " NOT NULL";
+ if (columns[i].isRequired())
+ {
+ createStatement.append(" NOT NULL");
+ }
- if ( columns[i].isPrimaryKey() )
+ if (columns[i].isPrimaryKey())
{
- if ( primaryKeyList.length() > 0 )
+ if (primaryKeyList.length() > 0)
+ {
primaryKeyList += ", ";
+ }
primaryKeyList += "\"" + columns[i].getName() + "\"";
}
- if ( columns[i].isForeignKey() )
+ if (columns[i].isForeignKey())
{
- String foreignTable = columns[i].getForeignTable();
+ final String foreignTable = columns[i].getForeignTable();
- String foreignKeysForTable = foreignKeys.containsKey( foreignTable ) ? (String)foreignKeys.get( foreignTable ) : "";
- if ( foreignKeysForTable.length() > 0 )
+ String foreignKeysForTable = foreignKeys.containsKey(foreignTable) ? (String) foreignKeys.get(foreignTable) : "";
+ if (foreignKeysForTable.length() > 0)
+ {
foreignKeysForTable += ", ";
+ }
foreignKeysForTable += "\"" + columns[i].getName() + "\"";
- foreignKeys.put( foreignTable, foreignKeysForTable );
-
- String foreignKeyRefsForTable = foreignKeyRefs.containsKey( foreignTable ) ? (String)foreignKeyRefs.get( foreignTable ) : "";
- if ( foreignKeyRefsForTable.length() > 0 )
- foreignKeyRefsForTable += ", ";
- foreignKeyRefsForTable += "\"" + columns[i].getForeignColumn() + "\"";
- foreignKeyRefs.put( foreignTable, foreignKeyRefsForTable );
+ foreignKeys.put(foreignTable, foreignKeysForTable);
+
+ final StringBuffer foreignKeyRefsForTable = new StringBuffer(foreignKeyRefs.containsKey(foreignTable) ? (String) foreignKeyRefs.get(foreignTable) : "");
+ if (foreignKeyRefsForTable.length() > 0)
+ {
+ foreignKeyRefsForTable.append(", ");
+ }
+ foreignKeyRefsForTable.append("\"" + columns[i].getForeignColumn() + "\"");
+ foreignKeyRefs.put(foreignTable, foreignKeyRefsForTable.toString());
}
}
- if ( primaryKeyList.length() > 0 )
+ if (primaryKeyList.length() > 0)
{
- createStatement += ", PRIMARY KEY (";
- createStatement += primaryKeyList;
- createStatement += ")";
+ createStatement.append(", PRIMARY KEY (");
+ createStatement.append(primaryKeyList);
+ createStatement.append(')');
}
- Set foreignKeyTables = foreignKeys.keySet();
- for ( Iterator foreignKey = foreignKeyTables.iterator();
- foreignKey.hasNext();
- )
+ final Set foreignKeyTables = foreignKeys.keySet();
+ for (final Iterator foreignKey = foreignKeyTables.iterator();
+ foreignKey.hasNext();)
{
- String foreignTable = (String)foreignKey.next();
-
- createStatement += ", FOREIGN KEY (";
- createStatement += (String)foreignKeys.get(foreignTable);
- createStatement += ") REFERENCES \"";
- createStatement += foreignTable;
- createStatement += "\"(";
- createStatement += (String)foreignKeyRefs.get(foreignTable);
- createStatement += ")";
+ final String foreignTable = (String) foreignKey.next();
+
+ createStatement.append(", FOREIGN KEY (");
+ createStatement.append((String) foreignKeys.get(foreignTable));
+ createStatement.append(") REFERENCES \"");
+ createStatement.append(foreignTable);
+ createStatement.append("\"(");
+ createStatement.append((String) foreignKeyRefs.get(foreignTable));
+ createStatement.append(')');
}
- createStatement += ")";
+ createStatement.append(')');
//System.err.println( createStatement );
- executeSQL( createStatement );
+ executeSQL(createStatement.toString());
}
/** creates a table in the database. using the SDBCX-API
*/
- public void createTableInSDBCX( HsqlTableDescriptor _tableDesc ) throws SQLException, ElementExistException
- {
- XPropertySet sdbcxDescriptor = _tableDesc.createSdbcxDescriptor( defaultConnection() );
- XTablesSupplier suppTables = (XTablesSupplier)UnoRuntime.queryInterface(
- XTablesSupplier.class, defaultConnection() );
- XAppend appendTable = (XAppend)UnoRuntime.queryInterface(
- XAppend.class, suppTables.getTables() );
- appendTable.appendByDescriptor( sdbcxDescriptor );
- }
-
- /** returns the URL of the ODB document represented by this instance
- */
- public String getDocumentURL()
- {
- return m_databaseDocumentFile;
- }
-
- /** returns the data source belonging to this database
- */
- public DataSource getDataSource()
- {
- return m_dataSource;
- }
-
- /** creates a row set operating the database, with a given command/type
- */
- public RowSet createRowSet( int _commandType, String _command )
- {
- return new RowSet(m_orb, getDocumentURL(), _commandType, _command);
- }
-
- protected void finalize() throws Throwable
- {
- closeAndDelete();
- super.finalize();
+ public void createTableInSDBCX(final HsqlTableDescriptor _tableDesc) throws SQLException, ElementExistException
+ {
+ final XPropertySet sdbcxDescriptor = _tableDesc.createSdbcxDescriptor(defaultConnection());
+ final XTablesSupplier suppTables = (XTablesSupplier) UnoRuntime.queryInterface(
+ XTablesSupplier.class, defaultConnection());
+ final XAppend appendTable = (XAppend) UnoRuntime.queryInterface(
+ XAppend.class, suppTables.getTables());
+ appendTable.appendByDescriptor(sdbcxDescriptor);
}
}
diff --git a/connectivity/qa/drivers/dbase/DBaseDateFunctions.java b/connectivity/qa/drivers/dbase/DBaseDateFunctions.java
index 67197f4c06..1c0ff72b34 100644
--- a/connectivity/qa/drivers/dbase/DBaseDateFunctions.java
+++ b/connectivity/qa/drivers/dbase/DBaseDateFunctions.java
@@ -27,219 +27,286 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-package complex.connectivity;
+package qa.drivers.dbase;
-import complex.connectivity.DBaseDriverTest;
import com.sun.star.uno.UnoRuntime;
-import com.sun.star.util.XCloseable;
import com.sun.star.sdbc.*;
-import com.sun.star.sdb.*;
-import com.sun.star.beans.PropertyValue;
import com.sun.star.beans.XPropertySet;
import com.sun.star.lang.XMultiServiceFactory;
-import complexlib.ComplexTestCase;
+public class DBaseDateFunctions
+{
-import java.io.PrintWriter;
-
-import util.utils;
-import java.util.*;
-import java.io.*;
+ private final String where = "FROM \"biblio\" \"biblio\" where \"Identifier\" = 'BOR00'";
+ private final XMultiServiceFactory m_xORB;
+ private final DBaseDriverTest testcase;
+ public DBaseDateFunctions(final XMultiServiceFactory _xORB, final DBaseDriverTest _testcase)
+ {
+ m_xORB = _xORB;
+ testcase = _testcase;
+ }
-public class DBaseDateFunctions {
+ private void assure(final String s, final boolean b)
+ {
+ testcase.assure2(s, b);
+ }
- private String where = "FROM \"biblio\" \"biblio\" where \"Identifier\" = 'BOR00'";
- private XMultiServiceFactory m_xORB;
- private DBaseDriverTest testcase;
- public DBaseDateFunctions(XMultiServiceFactory _xORB,DBaseDriverTest _testcase){
- m_xORB = _xORB;
- testcase = _testcase;
- }
-
- private void assure(String s,boolean b){
- testcase.assure2(s,b);
- }
-
- public void testFunctions() throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRowSet xRowRes = (XRowSet)UnoRuntime.queryInterface(XRowSet.class,
- m_xORB.createInstance("com.sun.star.sdb.RowSet"));
+ public void testFunctions() throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRowSet xRowRes = (XRowSet) UnoRuntime.queryInterface(XRowSet.class,
+ m_xORB.createInstance("com.sun.star.sdb.RowSet"));
- System.out.println("starting DateTime function test!");
+ testcase.getLog().println("starting DateTime function test!");
// set the properties needed to connect to a database
- XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class,xRowRes);
- xProp.setPropertyValue("DataSourceName","Bibliography");
-
- xProp.setPropertyValue("CommandType",new Integer(com.sun.star.sdb.CommandType.COMMAND));
-
- try {
+ final XPropertySet xProp = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xRowRes);
+ xProp.setPropertyValue("DataSourceName", "Bibliography");
+
+ xProp.setPropertyValue("CommandType", Integer.valueOf(com.sun.star.sdb.CommandType.COMMAND));
+
+ try
+ {
curdate(xRowRes);
- } catch( SQLException ex){
- assure("upper " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("upper " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
curtime(xRowRes);
- } catch( SQLException ex){
- assure("lower " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("lower " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
dayname(xRowRes);
- } catch( SQLException ex){
- assure("ascii " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("ascii " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
dayofmonth(xRowRes);
- } catch( SQLException ex){
- assure("char_len " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("char_len " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
dayofweek(xRowRes);
- } catch( SQLException ex){
- assure("concat " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("concat " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
dayofyear(xRowRes);
- } catch( SQLException ex){
- assure("locate " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("locate " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
hour(xRowRes);
- } catch( SQLException ex){
- assure("substr " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("substr " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
minute(xRowRes);
- } catch( SQLException ex){
- assure("ltrim " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("ltrim " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
month(xRowRes);
- } catch( SQLException ex){
- assure("rtrim " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("rtrim " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
monthname(xRowRes);
- } catch( SQLException ex){
- assure("space " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("space " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
now(xRowRes);
- } catch( SQLException ex){
- assure("replace " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("replace " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
quarter(xRowRes);
- } catch( SQLException ex){
- assure("repeat " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("repeat " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
second(xRowRes);
- } catch( SQLException ex){
- assure("insert " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("insert " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
week(xRowRes);
- } catch( SQLException ex){
- assure("left " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("left " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
year(xRowRes);
- } catch( SQLException ex){
- assure("right " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("right " + ex.getMessage(), false);
throw ex;
}
}
-
- private XRow execute(XRowSet xRowRes,String sql) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class,xRowRes);
- xProp.setPropertyValue("Command","SELECT " + sql + where);
+
+ private XRow execute(final XRowSet xRowRes, final String sql) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XPropertySet xProp = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xRowRes);
+ xProp.setPropertyValue("Command", "SELECT " + sql + where);
xRowRes.execute();
- XResultSet xRes = (XResultSet)UnoRuntime.queryInterface(XResultSet.class,xRowRes);
- assure("No valid row! ",xRes.next());
-
- return (XRow)UnoRuntime.queryInterface(XRow.class, xRes);
- }
-
- private void dayofweek(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"DAYOFWEEK('1998-02-03') ");
- assure("DAYOFWEEK('1998-02-03') failed!",row.getInt(1) == 3);
- }
- private void dayofmonth(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"DAYOFMONTH('1998-02-03') ");
- assure("DAYOFMONTH('1998-02-03') failed!",row.getInt(1) == 3);
- }
- private void dayofyear(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"DAYOFYEAR('1998-02-03') ");
- assure("DAYOFYEAR('1998-02-03') failed!",row.getInt(1) == 34);
- }
- private void month(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"month('1998-02-03') ");
- assure("month('1998-02-03') failed!",row.getInt(1) == 2);
- }
- private void dayname(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"DAYNAME('1998-02-05') ");
- assure("DAYNAME('1998-02-05') failed!",row.getString(1).equals("Thursday"));
- }
- private void monthname(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"MONTHNAME('1998-02-05') ");
- assure("MONTHNAME('1998-02-05') failed!",row.getString(1).equals("February"));
- }
- private void quarter(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"QUARTER('98-01-01'),QUARTER('98-04-01'),QUARTER('98-07-01'),QUARTER('98-10-01') ");
- assure("QUARTER('98-01-01') failed!",row.getInt(1) == 1);
- assure("QUARTER('98-04-01') failed!",row.getInt(2) == 2);
- assure("QUARTER('98-07-01') failed!",row.getInt(3) == 3);
- assure("QUARTER('98-10-01') failed!",row.getInt(4) == 4);
- }
- private void week(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"WEEK('1998-02-20') ");
- assure("WEEK('1998-02-20') failed!",row.getInt(1) == 7);
- }
- private void year(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"YEAR('98-02-03') ");
- assure("YEAR('98-02-03') failed!",row.getInt(1) == 98);
- }
- private void hour(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"HOUR('10:05:03') ");
- assure("HOUR('10:05:03') failed!",row.getInt(1) == 10);
- }
- private void minute(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"MINUTE('98-02-03 10:05:03') ");
- assure("MINUTE('98-02-03 10:05:03') failed!",row.getInt(1) == 5);
- }
- private void second(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"SECOND('10:05:03') ");
- assure("SECOND('10:05:03') failed!",row.getInt(1) == 3);
- }
- private void curdate(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"CURDATE() ");
- com.sun.star.util.Date aDate = row.getDate(1);
- System.out.println("CURDATE() is '" + aDate.Year + "-" + aDate.Month + "-" + aDate.Day +"'");
- }
- private void curtime(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"CURTIME() ");
- com.sun.star.util.Time aTime = row.getTime(1);
- System.out.println("CURTIME() is '" + aTime.Hours + ":" + aTime.Minutes + ":" + aTime.Seconds + "'");
- }
- private void now(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"NOW() ");
- com.sun.star.util.DateTime aTime = row.getTimestamp(1);
- System.out.println("NOW() is '" + aTime.Year + "-" + aTime.Month + "-" + aTime.Day + "'");
- System.out.println("'" + aTime.Hours + ":" + aTime.Minutes + ":" + aTime.Seconds + "'");
+ final XResultSet xRes = (XResultSet) UnoRuntime.queryInterface(XResultSet.class, xRowRes);
+ assure("No valid row! ", xRes.next());
+
+ return (XRow) UnoRuntime.queryInterface(XRow.class, xRes);
+ }
+
+ private void dayofweek(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "DAYOFWEEK('1998-02-03') ");
+ assure("DAYOFWEEK('1998-02-03') failed!", row.getInt(1) == 3);
+ }
+
+ private void dayofmonth(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "DAYOFMONTH('1998-02-03') ");
+ assure("DAYOFMONTH('1998-02-03') failed!", row.getInt(1) == 3);
+ }
+
+ private void dayofyear(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "DAYOFYEAR('1998-02-03') ");
+ assure("DAYOFYEAR('1998-02-03') failed!", row.getInt(1) == 34);
+ }
+
+ private void month(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "month('1998-02-03') ");
+ assure("month('1998-02-03') failed!", row.getInt(1) == 2);
+ }
+
+ private void dayname(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "DAYNAME('1998-02-05') ");
+ assure("DAYNAME('1998-02-05') failed!", row.getString(1).equals("Thursday"));
+ }
+
+ private void monthname(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "MONTHNAME('1998-02-05') ");
+ assure("MONTHNAME('1998-02-05') failed!", row.getString(1).equals("February"));
+ }
+
+ private void quarter(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "QUARTER('98-01-01'),QUARTER('98-04-01'),QUARTER('98-07-01'),QUARTER('98-10-01') ");
+ assure("QUARTER('98-01-01') failed!", row.getInt(1) == 1);
+ assure("QUARTER('98-04-01') failed!", row.getInt(2) == 2);
+ assure("QUARTER('98-07-01') failed!", row.getInt(3) == 3);
+ assure("QUARTER('98-10-01') failed!", row.getInt(4) == 4);
+ }
+
+ private void week(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "WEEK('1998-02-20') ");
+ assure("WEEK('1998-02-20') failed!", row.getInt(1) == 7);
+ }
+
+ private void year(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "YEAR('98-02-03') ");
+ assure("YEAR('98-02-03') failed!", row.getInt(1) == 98);
+ }
+
+ private void hour(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "HOUR('10:05:03') ");
+ assure("HOUR('10:05:03') failed!", row.getInt(1) == 10);
+ }
+
+ private void minute(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "MINUTE('98-02-03 10:05:03') ");
+ assure("MINUTE('98-02-03 10:05:03') failed!", row.getInt(1) == 5);
+ }
+
+ private void second(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "SECOND('10:05:03') ");
+ assure("SECOND('10:05:03') failed!", row.getInt(1) == 3);
+ }
+
+ private void curdate(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "CURDATE() ");
+ final com.sun.star.util.Date aDate = row.getDate(1);
+ testcase.getLog().println("CURDATE() is '" + aDate.Year + "-" + aDate.Month + "-" + aDate.Day + "'");
+ }
+
+ private void curtime(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "CURTIME() ");
+ final com.sun.star.util.Time aTime = row.getTime(1);
+ testcase.getLog().println("CURTIME() is '" + aTime.Hours + ":" + aTime.Minutes + ":" + aTime.Seconds + "'");
+ }
+
+ private void now(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "NOW() ");
+ final com.sun.star.util.DateTime aTime = row.getTimestamp(1);
+ testcase.getLog().println("NOW() is '" + aTime.Year + "-" + aTime.Month + "-" + aTime.Day + "'");
+ testcase.getLog().println("'" + aTime.Hours + ":" + aTime.Minutes + ":" + aTime.Seconds + "'");
}
}
diff --git a/connectivity/qa/drivers/dbase/DBaseDriverTest.java b/connectivity/qa/drivers/dbase/DBaseDriverTest.java
index fc2777794e..f25d02f122 100644
--- a/connectivity/qa/drivers/dbase/DBaseDriverTest.java
+++ b/connectivity/qa/drivers/dbase/DBaseDriverTest.java
@@ -27,60 +27,71 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-package complex.connectivity;
+package qa.drivers.dbase;
-import com.sun.star.uno.UnoRuntime;
-import com.sun.star.util.XCloseable;
import com.sun.star.sdbc.*;
-import com.sun.star.sdb.*;
-import com.sun.star.beans.PropertyValue;
-import com.sun.star.beans.XPropertySet;
-
import com.sun.star.lang.XMultiServiceFactory;
-
import complexlib.ComplexTestCase;
-
-import java.io.PrintWriter;
-
-import util.utils;
import java.util.*;
import java.io.*;
+import share.LogWriter;
//import complex.connectivity.DBaseStringFunctions;
-public class DBaseDriverTest extends ComplexTestCase {
+public class DBaseDriverTest extends ComplexTestCase
+{
private static Properties props = new Properties();
private XDriver m_xDiver;
- private String where = "FROM \"biblio\" \"biblio\" where \"Identifier\" = 'BOR00'";
-
- static {
- try {
+ private String where = "FROM \"biblio\" \"biblio\" where \"Identifier\" = 'BOR00'";
+
+ static
+ {
+ try
+ {
String propsFile = "test.properties";
- props.load( new FileInputStream(propsFile) );
- } catch(Exception ex) {
+ props.load(new FileInputStream(propsFile));
+ }
+ catch (Exception ex)
+ {
throw new RuntimeException(ex);
}
}
-
- public String[] getTestMethodNames() {
- return new String[] { "Functions" };
+
+ public String[] getTestMethodNames()
+ {
+ return new String[]
+ {
+ "Functions"
+ };
}
- public String getTestObjectName() {
+ public String getTestObjectName()
+ {
return "DBaseDriverTest";
}
- public void assure2(String s,boolean b){
- assure(s,b);
+
+ public void assure2(String s, boolean b)
+ {
+ assure(s, b);
}
-
- public void Functions() throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- DBaseStringFunctions aStringTest = new DBaseStringFunctions(((XMultiServiceFactory)param.getMSF()),this);
+
+ public LogWriter getLog()
+ {
+ return log;
+ }
+
+ public void Functions() throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ DBaseStringFunctions aStringTest = new DBaseStringFunctions(((XMultiServiceFactory) param.getMSF()), this);
aStringTest.testFunctions();
-
- DBaseNumericFunctions aNumericTest = new DBaseNumericFunctions(((XMultiServiceFactory)param.getMSF()),this);
+
+ DBaseNumericFunctions aNumericTest = new DBaseNumericFunctions(((XMultiServiceFactory) param.getMSF()), this);
aNumericTest.testFunctions();
-
- DBaseDateFunctions aDateTest = new DBaseDateFunctions(((XMultiServiceFactory)param.getMSF()),this);
+
+ DBaseDateFunctions aDateTest = new DBaseDateFunctions(((XMultiServiceFactory) param.getMSF()), this);
aDateTest.testFunctions();
+
+ DBaseSqlTests aSqlTest = new DBaseSqlTests(((XMultiServiceFactory) param.getMSF()), this);
+ aSqlTest.testFunctions();
}
}
diff --git a/connectivity/qa/drivers/dbase/DBaseNumericFunctions.java b/connectivity/qa/drivers/dbase/DBaseNumericFunctions.java
index fdca0f1245..d76456536a 100644
--- a/connectivity/qa/drivers/dbase/DBaseNumericFunctions.java
+++ b/connectivity/qa/drivers/dbase/DBaseNumericFunctions.java
@@ -27,285 +27,379 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-package complex.connectivity;
+package qa.drivers.dbase;
-import complex.connectivity.DBaseDriverTest;
import com.sun.star.uno.UnoRuntime;
-import com.sun.star.util.XCloseable;
import com.sun.star.sdbc.*;
-import com.sun.star.sdb.*;
-import com.sun.star.beans.PropertyValue;
import com.sun.star.beans.XPropertySet;
-
import com.sun.star.lang.XMultiServiceFactory;
-import complexlib.ComplexTestCase;
-import java.io.PrintWriter;
-
-import util.utils;
-import java.util.*;
-import java.io.*;
+public class DBaseNumericFunctions
+{
+ private final String where = "FROM \"biblio\" \"biblio\" where \"Identifier\" = 'BOR00'";
+ private final XMultiServiceFactory m_xORB;
+ private final DBaseDriverTest testcase;
-public class DBaseNumericFunctions {
+ public DBaseNumericFunctions(final XMultiServiceFactory _xORB, final DBaseDriverTest _testcase)
+ {
+ m_xORB = _xORB;
+ testcase = _testcase;
+ }
- private String where = "FROM \"biblio\" \"biblio\" where \"Identifier\" = 'BOR00'";
- private XMultiServiceFactory m_xORB;
- private DBaseDriverTest testcase;
- public DBaseNumericFunctions(XMultiServiceFactory _xORB,DBaseDriverTest _testcase){
- m_xORB = _xORB;
- testcase = _testcase;
- }
-
- private void assure(String s,boolean b){
- testcase.assure2(s,b);
- }
-
- public void testFunctions() throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRowSet xRowRes = (XRowSet)UnoRuntime.queryInterface(XRowSet.class,
- m_xORB.createInstance("com.sun.star.sdb.RowSet"));
+ private void assure(final String s, final boolean b)
+ {
+ testcase.assure2(s, b);
+ }
+
+ public void testFunctions() throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRowSet xRowRes = (XRowSet) UnoRuntime.queryInterface(XRowSet.class,
+ m_xORB.createInstance("com.sun.star.sdb.RowSet"));
- System.out.println("starting Numeric function test");
+ testcase.getLog().println("starting Numeric function test");
// set the properties needed to connect to a database
- XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class,xRowRes);
- xProp.setPropertyValue("DataSourceName","Bibliography");
-
- xProp.setPropertyValue("CommandType",new Integer(com.sun.star.sdb.CommandType.COMMAND));
-
- try {
+ final XPropertySet xProp = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xRowRes);
+ xProp.setPropertyValue("DataSourceName", "Bibliography");
+
+ xProp.setPropertyValue("CommandType", Integer.valueOf(com.sun.star.sdb.CommandType.COMMAND));
+
+ try
+ {
abs(xRowRes);
- } catch( SQLException ex){
- assure("abs " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("abs " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
acos(xRowRes);
- } catch( SQLException ex){
- assure("acos " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("acos " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
asin(xRowRes);
- } catch( SQLException ex){
- assure("asin " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("asin " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
atan(xRowRes);
- } catch( SQLException ex){
- assure("atan " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("atan " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
atan2(xRowRes);
- } catch( SQLException ex){
- assure("atan2 " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("atan2 " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
ceiling(xRowRes);
- } catch( SQLException ex){
- assure("ceiling " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("ceiling " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
cos(xRowRes);
- } catch( SQLException ex){
- assure("cos " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("cos " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
degrees(xRowRes);
- } catch( SQLException ex){
- assure("degrees " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("degrees " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
exp(xRowRes);
- } catch( SQLException ex){
- assure("exp " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("exp " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
floor(xRowRes);
- } catch( SQLException ex){
- assure("floor " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("floor " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
log(xRowRes);
- } catch( SQLException ex){
- assure("log " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("log " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
log10(xRowRes);
- } catch( SQLException ex){
- assure("log10 " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("log10 " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
mod(xRowRes);
- } catch( SQLException ex){
- assure("mod " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("mod " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
pi(xRowRes);
- } catch( SQLException ex){
- assure("pi " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("pi " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
pow(xRowRes);
- } catch( SQLException ex){
- assure("pow " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("pow " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
radians(xRowRes);
- } catch( SQLException ex){
- assure("radians " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("radians " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
round(xRowRes);
- } catch( SQLException ex){
- assure("round " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("round " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
sign(xRowRes);
- } catch( SQLException ex){
- assure("sign " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("sign " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
sin(xRowRes);
- } catch( SQLException ex){
- assure("sin " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("sin " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
sqrt(xRowRes);
- } catch( SQLException ex){
- assure("sqrt " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("sqrt " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
tan(xRowRes);
- } catch( SQLException ex){
- assure("tan " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("tan " + ex.getMessage(), false);
throw ex;
}
-
+
}
-
- private XRow execute(XRowSet xRowRes,String sql) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class,xRowRes);
- xProp.setPropertyValue("Command","SELECT " + sql + where);
+
+ private XRow execute(final XRowSet xRowRes,final String sql) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XPropertySet xProp = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xRowRes);
+ xProp.setPropertyValue("Command", "SELECT " + sql + where);
xRowRes.execute();
- XResultSet xRes = (XResultSet)UnoRuntime.queryInterface(XResultSet.class,xRowRes);
- assure("No valid row! ",xRes.next());
-
- return (XRow)UnoRuntime.queryInterface(XRow.class, xRes);
+ final XResultSet xRes = (XResultSet) UnoRuntime.queryInterface(XResultSet.class, xRowRes);
+ assure("No valid row! ", xRes.next());
+
+ return (XRow) UnoRuntime.queryInterface(XRow.class, xRes);
}
-
- private void abs(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"ABS(2),ABS(-32) ");
- assure("ABS(2) failed!",row.getInt(1) == 2);
- assure("ABS(-32) failed!",row.getInt(2) == 32);
+
+ private void abs(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "ABS(2),ABS(-32) ");
+ assure("ABS(2) failed!", row.getInt(1) == 2);
+ assure("ABS(-32) failed!", row.getInt(2) == 32);
}
-
- private void sign(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"SIGN(-32),SIGN(0),SIGN(234) ");
- assure("SIGN(-32)failed!",row.getInt(1) == -1);
- assure("SIGN(0) failed!",row.getInt(2) == 0);
- assure("SIGN(234) failed!",row.getInt(3) == 1);
+
+ private void sign(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "SIGN(-32),SIGN(0),SIGN(234) ");
+ assure("SIGN(-32)failed!", row.getInt(1) == -1);
+ assure("SIGN(0) failed!", row.getInt(2) == 0);
+ assure("SIGN(234) failed!", row.getInt(3) == 1);
}
-
- private void mod(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"MOD(234, 10) ");
- assure("MOD(234, 10) failed!",row.getInt(1) == 4);
+
+ private void mod(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "MOD(234, 10) ");
+ assure("MOD(234, 10) failed!", row.getInt(1) == 4);
}
-
- private void floor(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"FLOOR(1.23),FLOOR(-1.23) ");
- assure("FLOOR(1.23) failed!",row.getInt(1) == 1);
- assure("FLOOR(-1.23) failed!",row.getInt(2) == -2);
+
+ private void floor(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "FLOOR(1.23),FLOOR(-1.23) ");
+ assure("FLOOR(1.23) failed!", row.getInt(1) == 1);
+ assure("FLOOR(-1.23) failed!", row.getInt(2) == -2);
}
- private void ceiling(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"CEILING(1.23),CEILING(-1.23) ");
- assure("CEILING(1.23) failed!",row.getInt(1) == 2);
- assure("CEILING(-1.23) failed!",row.getInt(2) == -1);
+
+ private void ceiling(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "CEILING(1.23),CEILING(-1.23) ");
+ assure("CEILING(1.23) failed!", row.getInt(1) == 2);
+ assure("CEILING(-1.23) failed!", row.getInt(2) == -1);
}
- private void round(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"ROUND(-1.23),ROUND(1.298, 1) ");
- assure("ROUND(-1.23) failed!",row.getInt(1) == -1);
- assure("ROUND(1.298, 1) failed!",row.getDouble(2) == 1.3);
+
+ private void round(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "ROUND(-1.23),ROUND(1.298, 1) ");
+ assure("ROUND(-1.23) failed!", row.getInt(1) == -1);
+ assure("ROUND(1.298, 1) failed!", row.getDouble(2) == 1.3);
}
- private void exp(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"EXP(2),EXP(-2) ");
- assure("EXP(2) failed!",(float)row.getDouble(1) == (float)java.lang.Math.exp(2) );
- assure("EXP(-2) failed!",(float)row.getDouble(2) == (float)java.lang.Math.exp(-2));
+
+ private void exp(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "EXP(2),EXP(-2) ");
+ assure("EXP(2) failed!", (float) row.getDouble(1) == (float) java.lang.Math.exp(2));
+ assure("EXP(-2) failed!", (float) row.getDouble(2) == (float) java.lang.Math.exp(-2));
}
- private void log(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"LOG(2),LOG(-2) ");
- assure("LOG(2) failed!",(float)row.getDouble(1) == (float)java.lang.Math.log(2) );
+
+ private void log(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "LOG(2),LOG(-2) ");
+ assure("LOG(2) failed!", (float) row.getDouble(1) == (float) java.lang.Math.log(2));
row.getDouble(2);
- assure("LOG(-2) failed!",row.wasNull());
+ assure("LOG(-2) failed!", row.wasNull());
}
- private void log10(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"LOG10(100) ");
- assure("LOG10(100) failed!",row.getDouble(1) == 2.0 );
+
+ private void log10(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "LOG10(100) ");
+ assure("LOG10(100) failed!", row.getDouble(1) == 2.0);
}
- private void pow(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"POWER(2,2) ");
- assure("POWER(2,2) failed!",row.getDouble(1) == 4.0 );
+
+ private void pow(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "POWER(2,2) ");
+ assure("POWER(2,2) failed!", row.getDouble(1) == 4.0);
}
- private void sqrt(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"SQRT(4) ");
- assure("SQRT(4) failed!",row.getDouble(1) == 2.0 );
+
+ private void sqrt(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "SQRT(4) ");
+ assure("SQRT(4) failed!", row.getDouble(1) == 2.0);
}
- private void pi(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"PI() ");
- assure("PI() failed!",(float)row.getDouble(1) == (float)java.lang.Math.PI );
+
+ private void pi(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "PI() ");
+ assure("PI() failed!", (float) row.getDouble(1) == (float) java.lang.Math.PI);
}
- private void cos(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"COS(PI()) ");
- assure("COS(PI()) failed!",row.getDouble(1) == -1.0 );
+
+ private void cos(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "COS(PI()) ");
+ assure("COS(PI()) failed!", row.getDouble(1) == -1.0);
}
- private void sin(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"SIN(2) ");
- assure("SIN(PI()) failed!",(float)row.getDouble(1) == (float)java.lang.Math.sin( 2 ) );
+
+ private void sin(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "SIN(2) ");
+ assure("SIN(PI()) failed!", (float) row.getDouble(1) == (float) java.lang.Math.sin(2));
}
- private void tan(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"TAN(PI()+1) ");
- assure("TAN(PI()+1) failed!",(float)row.getDouble(1) == (float)java.lang.Math.tan(java.lang.Math.PI+1.0) );
+
+ private void tan(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "TAN(PI()+1) ");
+ assure("TAN(PI()+1) failed!", (float) row.getDouble(1) == (float) java.lang.Math.tan(java.lang.Math.PI + 1.0));
}
- private void acos(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"ACOS(1) ");
- assure("ACOS(1) failed!",(float)row.getDouble(1) == 0.0 );
+
+ private void acos(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "ACOS(1) ");
+ assure("ACOS(1) failed!", (float) row.getDouble(1) == 0.0);
}
- private void asin(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"ASIN(0) ");
- assure("ASIN(0) failed!",(float)row.getDouble(1) == (float)java.lang.Math.asin(0.0) );
+
+ private void asin(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "ASIN(0) ");
+ assure("ASIN(0) failed!", (float) row.getDouble(1) == (float) java.lang.Math.asin(0.0));
}
- private void atan(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"ATAN(0) ");
- assure("ATAN(0) failed!",row.getDouble(1) == 0.0 );
+
+ private void atan(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "ATAN(0) ");
+ assure("ATAN(0) failed!", row.getDouble(1) == 0.0);
}
- private void atan2(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"ATAN2(0,2) ");
- assure("ATAN2(0,2) failed!",(float)row.getDouble(1) == 0.0 );
+
+ private void atan2(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "ATAN2(0,2) ");
+ assure("ATAN2(0,2) failed!", (float) row.getDouble(1) == 0.0);
}
- private void degrees(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"DEGREES(PI()) ");
- assure("DEGREES(PI()) failed!",row.getDouble(1) == 180.0 );
+
+ private void degrees(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "DEGREES(PI()) ");
+ assure("DEGREES(PI()) failed!", row.getDouble(1) == 180.0);
}
- private void radians(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"RADIANS(90) ");
- assure("RADIANS(90) failed!",(float)row.getDouble(1) == (float)(java.lang.Math.PI / 2.0) );
+
+ private void radians(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "RADIANS(90) ");
+ assure("RADIANS(90) failed!", (float) row.getDouble(1) == (float) (java.lang.Math.PI / 2.0));
}
}
diff --git a/connectivity/qa/drivers/dbase/DBaseSqlTests.java b/connectivity/qa/drivers/dbase/DBaseSqlTests.java
new file mode 100644
index 0000000000..c60352636f
--- /dev/null
+++ b/connectivity/qa/drivers/dbase/DBaseSqlTests.java
@@ -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: DBaseStringFunctions.java,v $
+ * $Revision: 1.6 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+package qa.drivers.dbase;
+
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.sdbc.*;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.lang.XMultiServiceFactory;
+
+public class DBaseSqlTests
+{
+ private final XMultiServiceFactory m_xORB;
+ private final DBaseDriverTest testcase;
+
+ public DBaseSqlTests(final XMultiServiceFactory _xORB,final DBaseDriverTest _testcase)
+ {
+ m_xORB = _xORB;
+ testcase = _testcase;
+ }
+
+ private void assure(final String s,final boolean b)
+ {
+ testcase.assure2(s, b);
+ }
+
+ public void testFunctions() throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRowSet xRowRes = (XRowSet) UnoRuntime.queryInterface(XRowSet.class,
+ m_xORB.createInstance("com.sun.star.sdb.RowSet"));
+
+ testcase.getLog().println("starting SQL test");
+ // set the properties needed to connect to a database
+ final XPropertySet xProp = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xRowRes);
+ xProp.setPropertyValue("DataSourceName", "Bibliography");
+ xProp.setPropertyValue("CommandType", Integer.valueOf(com.sun.star.sdb.CommandType.COMMAND));
+
+ execute(xRowRes,"1 FROM \"biblio\" \"biblio\" where \"Identifier\" like 'B%'");
+ execute(xRowRes,"1 FROM \"biblio\" \"biblio\" where not \"Identifier\" like 'B%'");
+ execute(xRowRes,"1 FROM \"biblio\" \"biblio\" where not \"Identifier\" not like 'B%'");
+ execute(xRowRes,"1 FROM \"biblio\" \"biblio\" where not(0 = 1)");
+ execute(xRowRes,"1 FROM \"biblio\" \"biblio\" where 0 = 0");
+ execute(xRowRes,"1 FROM \"biblio\" \"biblio\" where (0 = 0)");
+ execute(xRowRes,"1 FROM \"biblio\" \"biblio\" where 0 <> 1");
+ execute(xRowRes,"1 FROM \"biblio\" \"biblio\" where 0 < 1");
+ execute(xRowRes,"1 FROM \"biblio\" \"biblio\" where 2 > 1");
+ execute(xRowRes,"1,1+1,'a' + 'b' FROM \"biblio\" \"biblio\" where 2 > 1");
+ // execute(xRowRes,"1 FROM \"biblio\" \"biblio\" where (0 = 0) is true");
+ // execute(xRowRes,"1 FROM \"biblio\" \"biblio\" where not (0 = 0) is not true");
+ // execute(xRowRes,"1 FROM \"biblio\" \"biblio\" where 1 between 0 and 2");
+ execute(xRowRes,"1 FROM \"biblio\" \"biblio\" where not \"Identifier\" is NULL");
+ execute(xRowRes,"1 FROM \"biblio\" \"biblio\" where \"Identifier\" is not NULL");
+ execute(xRowRes,"1 FROM \"biblio\" \"biblio\" where \"Identifier\" = \"Identifier\"");
+ execute(xRowRes,"1 FROM \"biblio\" \"biblio\" where not(not(\"Identifier\" = \"Identifier\"))");
+ execute(xRowRes,"1 FROM \"biblio\" \"biblio\" where (1 = 1 and 2 = 1) or 3 = 33 or 4 = 44 or ('a' = 'a' and 'b' = 'b')");
+ }
+
+ private void execute(final XRowSet xRowRes, String sql) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ try
+ {
+ final XPropertySet xProp = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xRowRes);
+ xProp.setPropertyValue("Command", "SELECT " + sql);
+ xRowRes.execute();
+ }
+ catch(SQLException e)
+ {
+ testcase.getLog().println(sql + " Error: " + e.getMessage());
+ }
+ }
+
+
+}
diff --git a/connectivity/qa/drivers/dbase/DBaseStringFunctions.java b/connectivity/qa/drivers/dbase/DBaseStringFunctions.java
index 2a98519feb..f6a35dafc7 100644
--- a/connectivity/qa/drivers/dbase/DBaseStringFunctions.java
+++ b/connectivity/qa/drivers/dbase/DBaseStringFunctions.java
@@ -27,244 +27,300 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-package complex.connectivity;
+package qa.drivers.dbase;
-import complex.connectivity.DBaseDriverTest;
import com.sun.star.uno.UnoRuntime;
-import com.sun.star.util.XCloseable;
import com.sun.star.sdbc.*;
-import com.sun.star.sdb.*;
-import com.sun.star.beans.PropertyValue;
import com.sun.star.beans.XPropertySet;
-
import com.sun.star.lang.XMultiServiceFactory;
-import complexlib.ComplexTestCase;
-
-import java.io.PrintWriter;
-
-import util.utils;
-import java.util.*;
-import java.io.*;
+public class DBaseStringFunctions
+{
+ private String where = "FROM \"biblio\" \"biblio\" where \"Identifier\" = 'BOR00'";
+ private final XMultiServiceFactory m_xORB;
+ private final DBaseDriverTest testcase;
+ public DBaseStringFunctions(final XMultiServiceFactory _xORB,final DBaseDriverTest _testcase)
+ {
+ m_xORB = _xORB;
+ testcase = _testcase;
+ }
-public class DBaseStringFunctions {
+ private void assure(final String s,final boolean b)
+ {
+ testcase.assure2(s, b);
+ }
- private String where = "FROM \"biblio\" \"biblio\" where \"Identifier\" = 'BOR00'";
- private XMultiServiceFactory m_xORB;
- private DBaseDriverTest testcase;
- public DBaseStringFunctions(XMultiServiceFactory _xORB,DBaseDriverTest _testcase){
- m_xORB = _xORB;
- testcase = _testcase;
- }
-
- private void assure(String s,boolean b){
- testcase.assure2(s,b);
- }
-
- public void testFunctions() throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRowSet xRowRes = (XRowSet)UnoRuntime.queryInterface(XRowSet.class,
- m_xORB.createInstance("com.sun.star.sdb.RowSet"));
+ public void testFunctions() throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRowSet xRowRes = (XRowSet) UnoRuntime.queryInterface(XRowSet.class,
+ m_xORB.createInstance("com.sun.star.sdb.RowSet"));
- System.out.println("starting String function test");
+ testcase.getLog().println("starting String function test");
// set the properties needed to connect to a database
- XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class,xRowRes);
- xProp.setPropertyValue("DataSourceName","Bibliography");
-
- xProp.setPropertyValue("CommandType",new Integer(com.sun.star.sdb.CommandType.COMMAND));
-
- try {
- upper(xRowRes);
- } catch( SQLException ex){
- assure("upper " + ex.getMessage(),false);
+ final XPropertySet xProp = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xRowRes);
+ xProp.setPropertyValue("DataSourceName", "Bibliography");
+
+ xProp.setPropertyValue("CommandType", Integer.valueOf(com.sun.star.sdb.CommandType.COMMAND));
+
+ try
+ {
+ upper(xRowRes);
+ }
+ catch (SQLException ex)
+ {
+ assure("upper " + ex.getMessage(), false);
throw ex;
}
- try{
- lower(xRowRes);
- } catch( SQLException ex){
- assure("lower " + ex.getMessage(),false);
+ try
+ {
+ lower(xRowRes);
+ }
+ catch (SQLException ex)
+ {
+ assure("lower " + ex.getMessage(), false);
throw ex;
}
- try{
- acsii(xRowRes);
- } catch( SQLException ex){
- assure("ascii " + ex.getMessage(),false);
+ try
+ {
+ acsii(xRowRes);
+ }
+ catch (SQLException ex)
+ {
+ assure("ascii " + ex.getMessage(), false);
throw ex;
}
- try{
- char_length(xRowRes);
- } catch( SQLException ex){
- assure("char_len " + ex.getMessage(),false);
+ try
+ {
+ char_length(xRowRes);
+ }
+ catch (SQLException ex)
+ {
+ assure("char_len " + ex.getMessage(), false);
throw ex;
}
- try{
- concat(xRowRes);
- } catch( SQLException ex){
- assure("concat " + ex.getMessage(),false);
+ try
+ {
+ concat(xRowRes);
+ }
+ catch (SQLException ex)
+ {
+ assure("concat " + ex.getMessage(), false);
throw ex;
}
- try{
+ try
+ {
chartest(xRowRes);
- } catch( SQLException ex){
- assure("char " + ex.getMessage(),false);
+ }
+ catch (SQLException ex)
+ {
+ assure("char " + ex.getMessage(), false);
throw ex;
}
- try{
- locate(xRowRes);
- } catch( SQLException ex){
- assure("locate " + ex.getMessage(),false);
+ try
+ {
+ locate(xRowRes);
+ }
+ catch (SQLException ex)
+ {
+ assure("locate " + ex.getMessage(), false);
throw ex;
}
- try{
- substring(xRowRes);
- } catch( SQLException ex){
- assure("substr " + ex.getMessage(),false);
+ try
+ {
+ substring(xRowRes);
+ }
+ catch (SQLException ex)
+ {
+ assure("substr " + ex.getMessage(), false);
throw ex;
}
- try{
- ltrim(xRowRes);
- } catch( SQLException ex){
- assure("ltrim " + ex.getMessage(),false);
+ try
+ {
+ ltrim(xRowRes);
+ }
+ catch (SQLException ex)
+ {
+ assure("ltrim " + ex.getMessage(), false);
throw ex;
}
- try{
- rtrim(xRowRes);
- } catch( SQLException ex){
- assure("rtrim " + ex.getMessage(),false);
+ try
+ {
+ rtrim(xRowRes);
+ }
+ catch (SQLException ex)
+ {
+ assure("rtrim " + ex.getMessage(), false);
throw ex;
}
- try{
- space(xRowRes);
- } catch( SQLException ex){
- assure("space " + ex.getMessage(),false);
+ try
+ {
+ space(xRowRes);
+ }
+ catch (SQLException ex)
+ {
+ assure("space " + ex.getMessage(), false);
throw ex;
}
- try{
- replace(xRowRes);
- } catch( SQLException ex){
- assure("replace " + ex.getMessage(),false);
+ try
+ {
+ replace(xRowRes);
+ }
+ catch (SQLException ex)
+ {
+ assure("replace " + ex.getMessage(), false);
throw ex;
}
- try{
- repeat(xRowRes);
- } catch( SQLException ex){
- assure("repeat " + ex.getMessage(),false);
+ try
+ {
+ repeat(xRowRes);
+ }
+ catch (SQLException ex)
+ {
+ assure("repeat " + ex.getMessage(), false);
throw ex;
}
- try{
- insert(xRowRes);
- } catch( SQLException ex){
- assure("insert " + ex.getMessage(),false);
+ try
+ {
+ insert(xRowRes);
+ }
+ catch (SQLException ex)
+ {
+ assure("insert " + ex.getMessage(), false);
throw ex;
}
- try{
- left(xRowRes);
- } catch( SQLException ex){
- assure("left " + ex.getMessage(),false);
+ try
+ {
+ left(xRowRes);
+ }
+ catch (SQLException ex)
+ {
+ assure("left " + ex.getMessage(), false);
throw ex;
}
- try{
- right(xRowRes);
- } catch( SQLException ex){
- assure("right " + ex.getMessage(),false);
+ try
+ {
+ right(xRowRes);
+ }
+ catch (SQLException ex)
+ {
+ assure("right " + ex.getMessage(), false);
throw ex;
}
}
-
- private XRow execute(XRowSet xRowRes,String sql) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class,xRowRes);
- xProp.setPropertyValue("Command","SELECT " + sql + where);
+
+ private XRow execute(final XRowSet xRowRes, String sql) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XPropertySet xProp = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xRowRes);
+ xProp.setPropertyValue("Command", "SELECT " + sql + where);
xRowRes.execute();
- XResultSet xRes = (XResultSet)UnoRuntime.queryInterface(XResultSet.class,xRowRes);
- assure("No valid row! ",xRes.next());
-
- return (XRow)UnoRuntime.queryInterface(XRow.class, xRes);
+ final XResultSet xRes = (XResultSet) UnoRuntime.queryInterface(XResultSet.class, xRowRes);
+ assure("No valid row! ", xRes.next());
+
+ return (XRow) UnoRuntime.queryInterface(XRow.class, xRes);
}
-
- private void upper(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"upper('test'),UCASE('test') ");
- assure("upper('test') failed!",row.getString(1).equals("TEST"));
- assure("ucase('test') failed!",row.getString(2).equals("TEST"));
+
+ private void upper(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "upper('test'),UCASE('test') ");
+ assure("upper('test') failed!", row.getString(1).equals("TEST"));
+ assure("ucase('test') failed!", row.getString(2).equals("TEST"));
}
-
- private void lower(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"lower('TEST'),LCASE('TEST') ");
- assure("lower('TEST') failed!",row.getString(1).equals("test"));
- assure("lcase('TEST') failed!",row.getString(2).equals("test"));
- final String t = where;
+
+ private void lower(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "lower('TEST'),LCASE('TEST') ");
+ assure("lower('TEST') failed!", row.getString(1).equals("test"));
+ assure("lcase('TEST') failed!", row.getString(2).equals("test"));
+ final String temp = where;
where = "FROM \"biblio\" \"biblio\" where LOWER(\"Identifier\") like 'bor%'";
- row = execute(xRowRes,"lower('TEST'),LCASE('TEST') ");
- where = t;
+ execute(xRowRes, "lower('TEST'),LCASE('TEST') ");
+ where = temp;
}
-
- private void acsii(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"ASCII('2') ");
- assure("acsii('2') failed!",row.getInt(1) == 50);
+
+ private void acsii(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "ASCII('2') ");
+ assure("acsii('2') failed!", row.getInt(1) == 50);
}
-
- private void char_length(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"char_length('test'),character_length('test'),OCTET_LENGTH('test') ");
- assure("char_length('test') failed!",row.getInt(1) == 4);
- assure("character_length('test') failed!",row.getInt(2) == 4);
- assure("OCTET_LENGTH('test') failed!",row.getInt(3) == 4);
+
+ private void char_length(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "char_length('test'),character_length('test'),OCTET_LENGTH('test') ");
+ assure("char_length('test') failed!", row.getInt(1) == 4);
+ assure("character_length('test') failed!", row.getInt(2) == 4);
+ assure("OCTET_LENGTH('test') failed!", row.getInt(3) == 4);
}
-
- private void concat(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"CONCAT('Hello',' ','World') ");
- assure("CONCAT('Hello',' ',,'World') failed!",row.getString(1).equals("Hello World"));
+
+ private void concat(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "CONCAT('Hello',' ','World') ");
+ assure("CONCAT('Hello',' ',,'World') failed!", row.getString(1).equals("Hello World"));
}
-
- private void locate(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"LOCATE('bar', 'foobarbar') ");
- assure("LOCATE('bar', 'foobarbar') failed!",row.getInt(1) == 4);
+
+ private void locate(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "LOCATE('bar', 'foobarbar') ");
+ assure("LOCATE('bar', 'foobarbar') failed!", row.getInt(1) == 4);
}
-
- private void substring(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"SUBSTRING('Quadratically',5) ");
- assure("SUBSTRING('Quadratically',5) failed!",row.getString(1).equals("ratically"));
+
+ private void substring(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "SUBSTRING('Quadratically',5) ");
+ assure("SUBSTRING('Quadratically',5) failed!", row.getString(1).equals("ratically"));
}
-
- private void ltrim(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"LTRIM(' barbar') ");
- assure("LTRIM(' barbar') failed!",row.getString(1).equals("barbar"));
+
+ private void ltrim(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "LTRIM(' barbar') ");
+ assure("LTRIM(' barbar') failed!", row.getString(1).equals("barbar"));
}
-
- private void rtrim(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"RTRIM('barbar ') ");
- assure("RTRIM('barbar ') failed!",row.getString(1).equals( "barbar"));
+
+ private void rtrim(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "RTRIM('barbar ') ");
+ assure("RTRIM('barbar ') failed!", row.getString(1).equals("barbar"));
}
-
- private void space(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"space(6) ");
- assure("space(6) failed!",row.getString(1).equals(" "));
+
+ private void space(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "space(6) ");
+ assure("space(6) failed!", row.getString(1).equals(" "));
}
-
- private void replace(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"REPLACE('www.OOo.com', 'w', 'Ww') ");
- assure("REPLACE('www.OOo.com', 'w', 'Ww') failed!",row.getString(1).equals("WwWwWw.OOo.com"));
+
+ private void replace(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "REPLACE('www.OOo.com', 'w', 'Ww') ");
+ assure("REPLACE('www.OOo.com', 'w', 'Ww') failed!", row.getString(1).equals("WwWwWw.OOo.com"));
}
-
- private void repeat(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"REPEAT('OOo', 3) ");
- assure("REPEAT('OOo', 3) failed!",row.getString(1).equals("OOoOOoOOo"));
+
+ private void repeat(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "REPEAT('OOo', 3) ");
+ assure("REPEAT('OOo', 3) failed!", row.getString(1).equals("OOoOOoOOo"));
}
-
- private void insert(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"INSERT('Quadratic', 3, 4, 'What') ");
- assure("INSERT('Quadratic', 3, 4, 'What') failed!",row.getString(1).equals("QuWhattic"));
+
+ private void insert(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "INSERT('Quadratic', 3, 4, 'What') ");
+ assure("INSERT('Quadratic', 3, 4, 'What') failed!", row.getString(1).equals("QuWhattic"));
}
-
- private void left(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"LEFT('foobarbar', 5) ");
- assure("LEFT('foobarbar', 5) failed!",row.getString(1).equals("fooba"));
+
+ private void left(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "LEFT('foobarbar', 5) ");
+ assure("LEFT('foobarbar', 5) failed!", row.getString(1).equals("fooba"));
}
-
- private void right(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"RIGHT('foobarbar', 4) ");
- assure("RIGHT('foobarbar', 4) failed!",row.getString(1).equals("rbar"));
+
+ private void right(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "RIGHT('foobarbar', 4) ");
+ assure("RIGHT('foobarbar', 4) failed!", row.getString(1).equals("rbar"));
}
- private void chartest(XRowSet xRowRes) throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- XRow row = execute(xRowRes,"CHAR(ascii('t'),ascii('e'),ascii('s'),ascii('t')) ");
- assure("CHAR(ascii('t'),ascii('e'),ascii('s'),ascii('t')) failed!",row.getString(1).equals("test"));
+
+ private void chartest(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
+ {
+ final XRow row = execute(xRowRes, "CHAR(ascii('t'),ascii('e'),ascii('s'),ascii('t')) ");
+ assure("CHAR(ascii('t'),ascii('e'),ascii('s'),ascii('t')) failed!", row.getString(1).equals("test"));
}
}
diff --git a/connectivity/qa/drivers/dbase/makefile.mk b/connectivity/qa/drivers/dbase/makefile.mk
index 63a4d5a255..4544b2a2bc 100644
--- a/connectivity/qa/drivers/dbase/makefile.mk
+++ b/connectivity/qa/drivers/dbase/makefile.mk
@@ -32,7 +32,7 @@
PRJ = ..$/..$/..
TARGET = DBaseDriverTest
PRJNAME = connectivity
-PACKAGE = complex$/connectivity
+PACKAGE = qa$/drivers$/dbase
# --- Settings -----------------------------------------------------
.INCLUDE: settings.mk
@@ -45,7 +45,8 @@ JAVAFILES =\
DBaseDateFunctions.java\
DBaseDriverTest.java\
DBaseNumericFunctions.java\
- DBaseStringFunctions.java
+ DBaseStringFunctions.java\
+ DBaseSqlTests.java
JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class)
@@ -59,15 +60,9 @@ JARCOMPRESS = TRUE
# --- Targets ------------------------------------------------------
-.IF "$(depend)" == ""
-ALL : ALLTAR
-.ELSE
-ALL: ALLDEP
-.ENDIF
-
.INCLUDE : target.mk
-run:
- java -cp $(CLASSPATH)$(PATH_SEPERATOR)$(SOLARBINDIR)$/OOoRunner.jar org.openoffice.Runner -TestBase java_complex -o complex.connectivity.$(TARGET)
+run: $(CLASSDIR)$/$(JARTARGET)
+ java -cp "$(CLASSPATH)$(PATH_SEPERATOR)$(SOLARBINDIR)$/OOoRunner.jar" org.openoffice.Runner -TestBase java_complex -o qa.drivers.dbase.$(TARGET)
diff --git a/connectivity/source/commontools/DateConversion.cxx b/connectivity/source/commontools/DateConversion.cxx
index 8303d467fe..bd6ad7bd76 100644
--- a/connectivity/source/commontools/DateConversion.cxx
+++ b/connectivity/source/commontools/DateConversion.cxx
@@ -87,14 +87,15 @@ using namespace ::com::sun::star::beans;
break;
case DataType::CHAR:
case DataType::VARCHAR:
+ case DataType::LONGVARCHAR:
if (bQuote)
aRet += ::rtl::OUString::createFromAscii("'");
{
::rtl::OUString aTemp;
_rxTypeConverter->convertToSimpleType(_rVal, TypeClass_STRING) >>= aTemp;
sal_Int32 nIndex = (sal_Int32)-1;
- ::rtl::OUString sQuot(RTL_CONSTASCII_USTRINGPARAM("\'"));
- ::rtl::OUString sQuotToReplace(RTL_CONSTASCII_USTRINGPARAM("\'\'"));
+ const ::rtl::OUString sQuot(RTL_CONSTASCII_USTRINGPARAM("\'"));
+ const ::rtl::OUString sQuotToReplace(RTL_CONSTASCII_USTRINGPARAM("\'\'"));
do
{
nIndex += 2;
diff --git a/connectivity/source/commontools/DriversConfig.cxx b/connectivity/source/commontools/DriversConfig.cxx
new file mode 100644
index 0000000000..dae6b9136f
--- /dev/null
+++ b/connectivity/source/commontools/DriversConfig.cxx
@@ -0,0 +1,241 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: makefile,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: st $ $Date: 2000/11/22 02:32:00 $
+ *
+ * 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 "connectivity/DriversConfig.hxx"
+#include <tools/wldcrd.hxx>
+
+using namespace connectivity;
+using namespace utl;
+using namespace ::com::sun::star;
+
+namespace
+{
+ void lcl_convert(const uno::Sequence< ::rtl::OUString >& _aSource,uno::Any& _rDest)
+ {
+ uno::Sequence<uno::Any> aRet(_aSource.getLength());
+ uno::Any* pAny = aRet.getArray();
+ const ::rtl::OUString* pIter = _aSource.getConstArray();
+ const ::rtl::OUString* pEnd = pIter + _aSource.getLength();
+ for (;pIter != pEnd ; ++pIter,++pAny)
+ {
+ *pAny <<= *pIter;
+ }
+ _rDest <<= aRet;
+ }
+ void lcl_fillValues(const ::utl::OConfigurationNode& _aURLPatternNode,const ::rtl::OUString& _sNode,::comphelper::NamedValueCollection& _rValues)
+ {
+ const ::utl::OConfigurationNode aPropertiesNode = _aURLPatternNode.openNode(_sNode);
+ if ( aPropertiesNode.isValid() )
+ {
+ uno::Sequence< ::rtl::OUString > aStringSeq;
+ static const ::rtl::OUString s_sValue(RTL_CONSTASCII_USTRINGPARAM("/Value"));
+ const uno::Sequence< ::rtl::OUString > aProperties = aPropertiesNode.getNodeNames();
+ const ::rtl::OUString* pPropertiesIter = aProperties.getConstArray();
+ const ::rtl::OUString* pPropertiesEnd = pPropertiesIter + aProperties.getLength();
+ for (;pPropertiesIter != pPropertiesEnd ; ++pPropertiesIter)
+ {
+ uno::Any aValue = aPropertiesNode.getNodeValue(*pPropertiesIter + s_sValue);
+ if ( aValue >>= aStringSeq )
+ {
+ lcl_convert(aStringSeq,aValue);
+ }
+ _rValues.put(*pPropertiesIter,aValue);
+ } // for (;pPropertiesIter != pPropertiesEnd ; ++pPropertiesIter,++pNamedIter)
+ } // if ( aPropertiesNode.isValid() )
+ }
+ void lcl_readURLPatternNode(const ::utl::OConfigurationTreeRoot& _aInstalled,const ::rtl::OUString& _sEntry,TInstalledDriver& _rInstalledDriver)
+ {
+ const ::utl::OConfigurationNode aURLPatternNode = _aInstalled.openNode(_sEntry);
+ if ( aURLPatternNode.isValid() )
+ {
+ static const ::rtl::OUString s_sParentURLPattern(RTL_CONSTASCII_USTRINGPARAM("ParentURLPattern"));
+ static const ::rtl::OUString s_sDriver(RTL_CONSTASCII_USTRINGPARAM("Driver"));
+ static const ::rtl::OUString s_sDriverTypeDisplayName(RTL_CONSTASCII_USTRINGPARAM("DriverTypeDisplayName"));
+ static const ::rtl::OUString s_sProperties(RTL_CONSTASCII_USTRINGPARAM("Properties"));
+ static const ::rtl::OUString s_sFeatures(RTL_CONSTASCII_USTRINGPARAM("Features"));
+ static const ::rtl::OUString s_sMetaData(RTL_CONSTASCII_USTRINGPARAM("MetaData"));
+ ::rtl::OUString sParentURLPattern;
+ aURLPatternNode.getNodeValue(s_sParentURLPattern) >>= sParentURLPattern;
+ if ( sParentURLPattern.getLength() )
+ lcl_readURLPatternNode(_aInstalled,sParentURLPattern,_rInstalledDriver);
+
+ ::rtl::OUString sDriverFactory;
+ aURLPatternNode.getNodeValue(s_sDriver) >>= sDriverFactory;
+ if ( sDriverFactory.getLength() )
+ _rInstalledDriver.sDriverFactory = sDriverFactory;
+
+ ::rtl::OUString sDriverTypeDisplayName;
+ aURLPatternNode.getNodeValue(s_sDriverTypeDisplayName) >>= sDriverTypeDisplayName;
+ OSL_ENSURE(sDriverTypeDisplayName.getLength(),"No valid DriverTypeDisplayName property!");
+ if ( sDriverTypeDisplayName.getLength() )
+ _rInstalledDriver.sDriverTypeDisplayName = sDriverTypeDisplayName;
+
+ lcl_fillValues(aURLPatternNode,s_sProperties,_rInstalledDriver.aProperties);
+ lcl_fillValues(aURLPatternNode,s_sFeatures,_rInstalledDriver.aFeatures);
+ lcl_fillValues(aURLPatternNode,s_sMetaData,_rInstalledDriver.aMetaData);
+ }
+ }
+}
+// -----------------------------------------------------------------------------
+DriversConfigImpl::DriversConfigImpl()
+{
+}
+// -----------------------------------------------------------------------------
+void DriversConfigImpl::Load(const uno::Reference< lang::XMultiServiceFactory >& _rxORB,TInstalledDrivers& _rDrivers)
+{
+ if ( !m_aInstalled.isValid() )
+ {
+ static const ::rtl::OUString s_sNodeName(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.DataAccess.Drivers/Installed")); ///Installed
+ m_aInstalled = ::utl::OConfigurationTreeRoot::createWithServiceFactory(_rxORB, s_sNodeName, -1, ::utl::OConfigurationTreeRoot::CM_READONLY);
+ }
+
+ if ( m_aInstalled.isValid() )
+ {
+ const uno::Sequence< ::rtl::OUString > aURLPatterns = m_aInstalled.getNodeNames();
+ const ::rtl::OUString* pPatternIter = aURLPatterns.getConstArray();
+ const ::rtl::OUString* pPatternEnd = pPatternIter + aURLPatterns.getLength();
+ for (;pPatternIter != pPatternEnd ; ++pPatternIter)
+ {
+ TInstalledDriver aInstalledDriver;
+ lcl_readURLPatternNode(m_aInstalled,*pPatternIter,aInstalledDriver);
+ if ( aInstalledDriver.sDriverFactory.getLength() )
+ _rDrivers.insert(TInstalledDrivers::value_type(*pPatternIter,aInstalledDriver));
+ }
+ }
+}
+// -----------------------------------------------------------------------------
+DriversConfig::DriversConfig(const uno::Reference< lang::XMultiServiceFactory >& _rxORB)
+{
+ m_aNode->Load(_rxORB,m_aDrivers);
+}
+// -----------------------------------------------------------------------------
+::rtl::OUString DriversConfig::getDriverFactoryName(const ::rtl::OUString& _sURL) const
+{
+ ::rtl::OUString sRet;
+ ::rtl::OUString sOldPattern;
+ TInstalledDrivers::const_iterator aIter = m_aDrivers.begin();
+ TInstalledDrivers::const_iterator aEnd = m_aDrivers.end();
+ for(;aIter != aEnd;++aIter)
+ {
+ WildCard aWildCard(aIter->first);
+ if ( sOldPattern.getLength() < aIter->first.getLength() && aWildCard.Matches(_sURL) )
+ {
+ sRet = aIter->second.sDriverFactory;
+ sOldPattern = aIter->first;
+ }
+ }
+
+ return sRet;
+}
+// -----------------------------------------------------------------------------
+::rtl::OUString DriversConfig::getDriverTypeDisplayName(const ::rtl::OUString& _sURL) const
+{
+ ::rtl::OUString sRet;
+ ::rtl::OUString sOldPattern;
+ TInstalledDrivers::const_iterator aIter = m_aDrivers.begin();
+ TInstalledDrivers::const_iterator aEnd = m_aDrivers.end();
+ for(;aIter != aEnd;++aIter)
+ {
+ WildCard aWildCard(aIter->first);
+ if ( sOldPattern.getLength() < aIter->first.getLength() && aWildCard.Matches(_sURL) )
+ {
+ sRet = aIter->second.sDriverTypeDisplayName;
+ sOldPattern = aIter->first;
+ }
+ }
+
+ return sRet;
+}
+// -----------------------------------------------------------------------------
+const ::comphelper::NamedValueCollection& DriversConfig::getProperties(const ::rtl::OUString& _sURL) const
+{
+ return impl_get(_sURL,1);
+}
+// -----------------------------------------------------------------------------
+const ::comphelper::NamedValueCollection& DriversConfig::getFeatures(const ::rtl::OUString& _sURL) const
+{
+ return impl_get(_sURL,0);
+}
+// -----------------------------------------------------------------------------
+const ::comphelper::NamedValueCollection& DriversConfig::getMetaData(const ::rtl::OUString& _sURL) const
+{
+ return impl_get(_sURL,2);
+}
+// -----------------------------------------------------------------------------
+const ::comphelper::NamedValueCollection& DriversConfig::impl_get(const ::rtl::OUString& _sURL,sal_Int32 _nProps) const
+{
+ const ::comphelper::NamedValueCollection* pRet = NULL;
+ ::rtl::OUString sOldPattern;
+ TInstalledDrivers::const_iterator aIter = m_aDrivers.begin();
+ TInstalledDrivers::const_iterator aEnd = m_aDrivers.end();
+ for(;aIter != aEnd;++aIter)
+ {
+ WildCard aWildCard(aIter->first);
+ if ( sOldPattern.getLength() < aIter->first.getLength() && aWildCard.Matches(_sURL) )
+ {
+ switch(_nProps)
+ {
+ case 0:
+ pRet = &aIter->second.aFeatures;
+ break;
+ case 1:
+ pRet = &aIter->second.aProperties;
+ break;
+ case 2:
+ pRet = &aIter->second.aMetaData;
+ break;
+ }
+ sOldPattern = aIter->first;
+ }
+ } // for(;aIter != aEnd;++aIter)
+ if ( pRet == NULL )
+ {
+ static const ::comphelper::NamedValueCollection s_sEmpty;
+ pRet = &s_sEmpty;
+ }
+ return *pRet;
+}
+// -----------------------------------------------------------------------------
+uno::Sequence< ::rtl::OUString > DriversConfig::getURLs() const
+{
+ uno::Sequence< ::rtl::OUString > aRet(m_aDrivers.size());
+ ::rtl::OUString* pIter = aRet.getArray();
+ TInstalledDrivers::const_iterator aIter = m_aDrivers.begin();
+ TInstalledDrivers::const_iterator aEnd = m_aDrivers.end();
+ for(;aIter != aEnd;++aIter,++pIter)
+ {
+ *pIter = aIter->first;
+ }
+ return aRet;
+}
diff --git a/connectivity/source/commontools/FValue.cxx b/connectivity/source/commontools/FValue.cxx
index a24ec4521c..37e91d22c8 100644
--- a/connectivity/source/commontools/FValue.cxx
+++ b/connectivity/source/commontools/FValue.cxx
@@ -37,6 +37,7 @@
#include <connectivity/dbconversion.hxx>
#include <cppuhelper/extract.hxx>
#include <com/sun/star/io/XInputStream.hpp>
+#include <rtl/ustrbuf.hxx>
#include <rtl/logfile.hxx>
using namespace connectivity;
@@ -984,12 +985,13 @@ Any ORowSetValue::makeAny() const
case DataType::VARBINARY:
case DataType::LONGVARBINARY:
{
- aRet = ::rtl::OUString::createFromAscii("0x");
+ ::rtl::OUStringBuffer sVal = ::rtl::OUString::createFromAscii("0x");
Sequence<sal_Int8> aSeq(getSequence());
const sal_Int8* pBegin = aSeq.getConstArray();
const sal_Int8* pEnd = pBegin + aSeq.getLength();
for(;pBegin != pEnd;++pBegin)
- aRet += ::rtl::OUString::valueOf((sal_Int32)*pBegin,16);
+ sVal.append((sal_Int32)*pBegin,16);
+ aRet = sVal.makeStringAndClear();
}
break;
case DataType::BIT:
@@ -1972,20 +1974,20 @@ void ORowSetValue::fill(const Any& _rValue)
setSigned(sal_False);
break;
}
- case TypeClass_HYPER:
- {
- sal_Int64 nValue(0);
- _rValue >>= nValue;
- (*this) = nValue;
- break;
- }
- case TypeClass_UNSIGNED_HYPER:
- {
- sal_uInt64 nValue(0);
- _rValue >>= nValue;
- (*this) = static_cast<sal_Int64>(nValue);
- setSigned(sal_False);
- break;
+ case TypeClass_HYPER:
+ {
+ sal_Int64 nValue(0);
+ _rValue >>= nValue;
+ (*this) = nValue;
+ break;
+ }
+ case TypeClass_UNSIGNED_HYPER:
+ {
+ sal_uInt64 nValue(0);
+ _rValue >>= nValue;
+ (*this) = static_cast<sal_Int64>(nValue);
+ setSigned(sal_False);
+ break;
}
case TypeClass_UNSIGNED_LONG:
{
diff --git a/connectivity/source/commontools/dbconversion.cxx b/connectivity/source/commontools/dbconversion.cxx
index 5b9260c5f4..2d4e51b305 100644
--- a/connectivity/source/commontools/dbconversion.cxx
+++ b/connectivity/source/commontools/dbconversion.cxx
@@ -40,7 +40,7 @@
#include <com/sun/star/util/Date.hpp>
#include <com/sun/star/util/Time.hpp>
#include <com/sun/star/util/DateTime.hpp>
-
+#include <rtl/ustrbuf.hxx>
#define MAX_DAYS 3636532
@@ -96,13 +96,13 @@ namespace dbtools
::rtl::OUString DBTypeConversion::toDateTimeString(const DateTime& _rDateTime)
{
Date aDate(_rDateTime.Day,_rDateTime.Month,_rDateTime.Year);
- ::rtl::OUString aTemp(toDateString(aDate));
- aTemp += ::rtl::OUString::createFromAscii(" ");
+ ::rtl::OUStringBuffer aTemp(toDateString(aDate));
+ aTemp.appendAscii(" ");
Time aTime(0,_rDateTime.Seconds,_rDateTime.Minutes,_rDateTime.Hours);
- aTemp += toTimeString(aTime);
- aTemp += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("."));
- aTemp += ::rtl::OUString::valueOf(static_cast<sal_Int32>(_rDateTime.HundredthSeconds));
- return aTemp;
+ aTemp.append(toTimeString(aTime));
+ aTemp.appendAscii(".");
+ aTemp.append(static_cast<sal_Int32>(_rDateTime.HundredthSeconds));
+ return aTemp.makeStringAndClear();
}
//------------------------------------------------------------------------------
Date DBTypeConversion::toDate(sal_Int32 _nVal)
diff --git a/connectivity/source/commontools/dbmetadata.cxx b/connectivity/source/commontools/dbmetadata.cxx
index c3c0ecc522..064cb08159 100644
--- a/connectivity/source/commontools/dbmetadata.cxx
+++ b/connectivity/source/commontools/dbmetadata.cxx
@@ -276,7 +276,15 @@ namespace dbtools
OSL_VERIFY( setting >>= doGenerate );
return doGenerate;
}
-
+ //--------------------------------------------------------------------
+ bool DatabaseMetaData::isAutoIncrementPrimaryKey() const
+ {
+ bool doGenerate( true );
+ Any setting;
+ if ( lcl_getConnectionSetting( "AutoIncrementIsPrimaryKey", *m_pImpl, setting ) )
+ OSL_VERIFY( setting >>= doGenerate );
+ return doGenerate;
+ }
//--------------------------------------------------------------------
sal_Int32 DatabaseMetaData::getBooleanComparisonMode() const
{
diff --git a/connectivity/source/commontools/dbtools.cxx b/connectivity/source/commontools/dbtools.cxx
index da7bcd1a8d..bfbfdc7383 100644
--- a/connectivity/source/commontools/dbtools.cxx
+++ b/connectivity/source/commontools/dbtools.cxx
@@ -1014,7 +1014,6 @@ try
Property* pResult = ::std::lower_bound(pNewProps, pNewProps + nNewLen,pOldProps[i].Name, ::comphelper::PropertyStringLessFunctor());
if ( pResult
&& ( pResult != pNewProps + nNewLen && pResult->Name == pOldProps[i].Name )
- && ( pResult->Attributes == pOldProps[i].Attributes )
&& ( (pResult->Attributes & PropertyAttribute::READONLY) == 0 )
&& ( pResult->Type.equals(pOldProps[i].Type)) )
{ // Attribute stimmen ueberein und Property ist nicht read-only
diff --git a/connectivity/source/commontools/dbtools2.cxx b/connectivity/source/commontools/dbtools2.cxx
index 55dfc41e26..c9b4990f85 100644
--- a/connectivity/source/commontools/dbtools2.cxx
+++ b/connectivity/source/commontools/dbtools2.cxx
@@ -86,10 +86,10 @@ namespace dbtools
sal_Int32 nPrecision = 0;
sal_Int32 nScale = 0;
- ::rtl::OUString sQuoteString = xMetaData->getIdentifierQuoteString();
- ::rtl::OUString aSql = ::dbtools::quoteName(sQuoteString,::comphelper::getString(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME))));
+ const ::rtl::OUString sQuoteString = xMetaData->getIdentifierQuoteString();
+ ::rtl::OUStringBuffer aSql = ::dbtools::quoteName(sQuoteString,::comphelper::getString(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME))));
- aSql += ::rtl::OUString::createFromAscii(" ");
+ aSql.appendAscii(" ");
nDataType = nPrecision = nScale = 0;
sal_Bool bIsAutoIncrement = sal_False;
@@ -143,54 +143,59 @@ namespace dbtools
sal_Int32 nParenPos = sTypeName.indexOf('(');
if ( nParenPos == -1 )
{
- aSql += sTypeName;
- aSql += ::rtl::OUString::createFromAscii("(");
+ aSql.append(sTypeName);
+ aSql.appendAscii("(");
}
else
{
- aSql += sTypeName.copy(0,++nParenPos);
+ aSql.append(sTypeName.copy(0,++nParenPos));
}
if ( nPrecision > 0 && nDataType != DataType::TIMESTAMP )
{
- aSql += ::rtl::OUString::valueOf(nPrecision);
+ aSql.append(nPrecision);
if ( (nScale > 0) || (_sCreatePattern.getLength() && sCreateParams.indexOf(_sCreatePattern) != -1) )
- aSql += ::rtl::OUString::createFromAscii(",");
+ aSql.appendAscii(",");
}
if ( (nScale > 0) || (_sCreatePattern.getLength() && sCreateParams.indexOf(_sCreatePattern) != -1 ) || nDataType == DataType::TIMESTAMP )
- aSql += ::rtl::OUString::valueOf(nScale);
+ aSql.append(nScale);
if ( nParenPos == -1 )
- aSql += ::rtl::OUString::createFromAscii(")");
+ aSql.appendAscii(")");
else
{
nParenPos = sTypeName.indexOf(')',nParenPos);
- aSql += sTypeName.copy(nParenPos);
+ aSql.append(sTypeName.copy(nParenPos));
}
}
else
- aSql += sTypeName; // simply add the type name
+ aSql.append(sTypeName); // simply add the type name
::rtl::OUString aDefault = ::comphelper::getString(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_DEFAULTVALUE)));
- if(aDefault.getLength())
- aSql += ::rtl::OUString::createFromAscii(" DEFAULT ") + sPreFix + aDefault + sPostFix;
+ if ( aDefault.getLength() )
+ {
+ aSql.append(::rtl::OUString::createFromAscii(" DEFAULT "));
+ aSql.append(sPreFix);
+ aSql.append(aDefault);
+ aSql.append(sPostFix);
+ } // if ( aDefault.getLength() )
if(::comphelper::getINT32(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_ISNULLABLE))) == ColumnValue::NO_NULLS)
- aSql += ::rtl::OUString::createFromAscii(" NOT NULL");
+ aSql.append(::rtl::OUString::createFromAscii(" NOT NULL"));
if ( bIsAutoIncrement && sAutoIncrementValue.getLength())
{
- aSql += ::rtl::OUString::createFromAscii(" ");
- aSql += sAutoIncrementValue;
+ aSql.appendAscii(" ");
+ aSql.append(sAutoIncrementValue);
}
- return aSql;
+ return aSql.makeStringAndClear();
}
// -----------------------------------------------------------------------------
::rtl::OUString createStandardCreateStatement(const Reference< XPropertySet >& descriptor,const Reference< XConnection>& _xConnection,const ::rtl::OUString& _sCreatePattern)
{
- ::rtl::OUString aSql = ::rtl::OUString::createFromAscii("CREATE TABLE ");
+ ::rtl::OUStringBuffer aSql = ::rtl::OUString::createFromAscii("CREATE TABLE ");
::rtl::OUString sCatalog,sSchema,sTable,sComposedName;
Reference<XDatabaseMetaData> xMetaData = _xConnection->getMetaData();
@@ -204,7 +209,8 @@ namespace dbtools
if ( !sComposedName.getLength() )
::dbtools::throwFunctionSequenceException(_xConnection);
- aSql += sComposedName + ::rtl::OUString::createFromAscii(" (");
+ aSql.append(sComposedName);
+ aSql.append(::rtl::OUString::createFromAscii(" ("));
// columns
Reference<XColumnsSupplier> xColumnSup(descriptor,UNO_QUERY);
@@ -220,11 +226,11 @@ namespace dbtools
{
if ( (xColumns->getByIndex(i) >>= xColProp) && xColProp.is() )
{
- aSql += createStandardColumnPart(xColProp,_xConnection,_sCreatePattern);
- aSql += ::rtl::OUString::createFromAscii(",");
+ aSql.append(createStandardColumnPart(xColProp,_xConnection,_sCreatePattern));
+ aSql.appendAscii(",");
}
}
- return aSql;
+ return aSql.makeStringAndClear();
}
namespace
{
@@ -256,7 +262,7 @@ namespace
Reference<XDatabaseMetaData> xMetaData = _xConnection->getMetaData();
::dbtools::OPropertyMap& rPropMap = OMetaConnection::getPropMap();
- ::rtl::OUString aSql;
+ ::rtl::OUStringBuffer aSql;
// keys
Reference<XKeysSupplier> xKeySup(descriptor,UNO_QUERY);
Reference<XIndexAccess> xKeys = xKeySup->getKeys();
@@ -286,8 +292,8 @@ namespace
::dbtools::throwFunctionSequenceException(_xConnection);
const ::rtl::OUString sQuote = xMetaData->getIdentifierQuoteString();
- aSql += ::rtl::OUString::createFromAscii(" PRIMARY KEY ");
- aSql += generateColumnNames(xColumns,xMetaData);
+ aSql.append(::rtl::OUString::createFromAscii(" PRIMARY KEY "));
+ aSql.append(generateColumnNames(xColumns,xMetaData));
}
else if(nKeyType == KeyType::UNIQUE)
{
@@ -297,8 +303,8 @@ namespace
::dbtools::throwFunctionSequenceException(_xConnection);
const ::rtl::OUString sQuote = xMetaData->getIdentifierQuoteString();
- aSql += ::rtl::OUString::createFromAscii(" UNIQUE ");
- aSql += generateColumnNames(xColumns,xMetaData);
+ aSql.append(::rtl::OUString::createFromAscii(" UNIQUE "));
+ aSql.append(generateColumnNames(xColumns,xMetaData));
}
else if(nKeyType == KeyType::FOREIGN)
{
@@ -309,7 +315,7 @@ namespace
if(!xColumns.is() || !xColumns->getCount())
::dbtools::throwFunctionSequenceException(_xConnection);
- aSql += ::rtl::OUString::createFromAscii(" FOREIGN KEY ");
+ aSql.append(::rtl::OUString::createFromAscii(" FOREIGN KEY "));
::rtl::OUString sRefTable = getString(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_REFERENCEDTABLE)));
::dbtools::qualifiedNameComponents(xMetaData,
sRefTable,
@@ -323,21 +329,21 @@ namespace
if ( !sComposedName.getLength() )
::dbtools::throwFunctionSequenceException(_xConnection);
- aSql += generateColumnNames(xColumns,xMetaData);
+ aSql.append(generateColumnNames(xColumns,xMetaData));
switch(nDeleteRule)
{
case KeyRule::CASCADE:
- aSql += ::rtl::OUString::createFromAscii(" ON DELETE CASCADE ");
+ aSql.append(::rtl::OUString::createFromAscii(" ON DELETE CASCADE "));
break;
case KeyRule::RESTRICT:
- aSql += ::rtl::OUString::createFromAscii(" ON DELETE RESTRICT ");
+ aSql.append(::rtl::OUString::createFromAscii(" ON DELETE RESTRICT "));
break;
case KeyRule::SET_NULL:
- aSql += ::rtl::OUString::createFromAscii(" ON DELETE SET NULL ");
+ aSql.append(::rtl::OUString::createFromAscii(" ON DELETE SET NULL "));
break;
case KeyRule::SET_DEFAULT:
- aSql += ::rtl::OUString::createFromAscii(" ON DELETE SET DEFAULT ");
+ aSql.append(::rtl::OUString::createFromAscii(" ON DELETE SET DEFAULT "));
break;
default:
;
@@ -349,13 +355,13 @@ namespace
if ( aSql.getLength() )
{
- if ( aSql.lastIndexOf(',') == (aSql.getLength()-1) )
- aSql = aSql.replaceAt(aSql.getLength()-1,1,::rtl::OUString::createFromAscii(")"));
+ if ( aSql.charAt(aSql.getLength()-1) == ',' )
+ aSql.setCharAt(aSql.getLength()-1,')');
else
- aSql += ::rtl::OUString::createFromAscii(")");
+ aSql.appendAscii(")");
}
- return aSql;
+ return aSql.makeStringAndClear();
}
// -----------------------------------------------------------------------------
@@ -364,7 +370,7 @@ namespace
const ::rtl::OUString& _sCreatePattern)
{
::rtl::OUString aSql = ::dbtools::createStandardCreateStatement(descriptor,_xConnection,_sCreatePattern);
- ::rtl::OUString sKeyStmt = ::dbtools::createStandardKeyStatement(descriptor,_xConnection);
+ const ::rtl::OUString sKeyStmt = ::dbtools::createStandardKeyStatement(descriptor,_xConnection);
if ( sKeyStmt.getLength() )
aSql += sKeyStmt;
else
@@ -603,7 +609,7 @@ Reference< XTablesSupplier> getDataDefinitionByURLAndConnection(
// if we don't get the catalog from the original driver we have to try them all.
if ( !xTablesSup.is() )
- {
+ { // !TODO: Why?
Reference< XEnumerationAccess> xEnumAccess( xManager, UNO_QUERY_THROW );
Reference< XEnumeration > xEnum( xEnumAccess->createEnumeration(), UNO_QUERY_THROW );
while ( xEnum.is() && xEnum->hasMoreElements() && !xTablesSup.is() )
diff --git a/connectivity/source/commontools/makefile.mk b/connectivity/source/commontools/makefile.mk
index a9c942ec9c..ee335705e6 100644
--- a/connectivity/source/commontools/makefile.mk
+++ b/connectivity/source/commontools/makefile.mk
@@ -85,6 +85,7 @@ EXCEPTIONSFILES=\
$(SLO)$/filtermanager.obj \
$(SLO)$/parameters.obj \
$(SLO)$/ParamterSubstitution.obj \
+ $(SLO)$/DriversConfig.obj \
$(SLO)$/formattedcolumnvalue.obj \
$(SLO)$/warningscontainer.obj
diff --git a/connectivity/source/commontools/parameters.cxx b/connectivity/source/commontools/parameters.cxx
index 6185b2fadb..837fb1ddfb 100644
--- a/connectivity/source/commontools/parameters.cxx
+++ b/connectivity/source/commontools/parameters.cxx
@@ -54,6 +54,7 @@
#include <comphelper/proparrhlp.hxx>
#include <comphelper/broadcasthelper.hxx>
#include "connectivity/ParameterCont.hxx"
+#include <rtl/ustrbuf.hxx>
//........................................................................
namespace dbtools
@@ -394,24 +395,24 @@ namespace dbtools
// did we find links where the detail field refers to a detail column (instead of a parameter name)?
if ( !aAdditionalFilterComponents.empty() )
{
+ const static ::rtl::OUString s_sAnd( RTL_CONSTASCII_USTRINGPARAM( " AND " ) );
// build a conjunction of all the filter components
- ::rtl::OUString sAdditionalFilter;
+ ::rtl::OUStringBuffer sAdditionalFilter;
for ( ::std::vector< ::rtl::OUString >::const_iterator aComponent = aAdditionalFilterComponents.begin();
aComponent != aAdditionalFilterComponents.end();
++aComponent
)
{
- ::rtl::OUString sBracketed( RTL_CONSTASCII_USTRINGPARAM( "( " ) );
- sBracketed += *aComponent;
- sBracketed += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( " )" ) );
-
if ( sAdditionalFilter.getLength() )
- sAdditionalFilter += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( " AND " ) );
- sAdditionalFilter += sBracketed;
+ sAdditionalFilter.append(s_sAnd);
+
+ sAdditionalFilter.appendAscii("( ",((sal_Int32)(sizeof("( ")-1)));
+ sAdditionalFilter.append(*aComponent);
+ sAdditionalFilter.appendAscii(" )",((sal_Int32)(sizeof(" )")-1)));
}
// now set this filter at the 's filter manager
- _rFilterManager.setFilterComponent( FilterManager::fcLinkFilter, sAdditionalFilter );
+ _rFilterManager.setFilterComponent( FilterManager::fcLinkFilter, sAdditionalFilter.makeStringAndClear() );
_rColumnsInLinkDetails = true;
}
@@ -1119,3 +1120,4 @@ namespace dbtools
//........................................................................
} // namespace frm
//........................................................................
+
diff --git a/connectivity/source/dbtools/makefile.mk b/connectivity/source/dbtools/makefile.mk
index 908d38c92e..060ff6c554 100644
--- a/connectivity/source/dbtools/makefile.mk
+++ b/connectivity/source/dbtools/makefile.mk
@@ -65,6 +65,7 @@ SHL1STDLIBS=\
$(SALLIB) \
$(JVMACCESSLIB) \
$(UNOTOOLSLIB) \
+ $(TOOLSLIB) \
$(COMPHELPERLIB) \
$(I18NISOLANGLIB)
diff --git a/connectivity/source/drivers/adabas/adabas.xcu b/connectivity/source/drivers/adabas/adabas.xcu
new file mode 100644
index 0000000000..e20ef1d3f7
--- /dev/null
+++ b/connectivity/source/drivers/adabas/adabas.xcu
@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--***********************************************************************
+ *
+ * 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: DataAccess.xcu,v $
+ * $Revision: 1.27 $
+ *
+ * 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.
+ *
+ ************************************************************************ -->
+<oor:component-data oor:name="Drivers" oor:package="org.openoffice.Office.DataAccess" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+ <node oor:name="Installed">
+ <node oor:name="sdbc:adabas:*" oor:op="replace">
+ <prop oor:name="Driver">
+ <value>com.sun.star.comp.sdbcx.adabas.ODriver</value>
+ </prop>
+ <prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
+ <value xml:lang="en-US">Adabas D</value>
+ </prop>
+ <node oor:name="Properties">
+ <node oor:name="ShutdownDatabase" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ </node>
+ <node oor:name="DataCacheSizeIncrement" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:int">
+ <value>20</value>
+ </prop>
+ </node>
+ <node oor:name="DataCacheSize" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:int">
+ <value>20</value>
+ </prop>
+ </node>
+ <node oor:name="ControlUser" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:string">
+ <value></value>
+ </prop>
+ </node>
+ <node oor:name="ControlPassword" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:string">
+ <value></value>
+ </prop>
+ </node>
+ <node oor:name="CharSet" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:string">
+ <value></value>
+ </prop>
+ </node>
+ </node>
+ <node oor:name="Features">
+ <node oor:name="UseSQL92NamingConstraints" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="AppendTableAliasInSelect" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="DisplayVersionColumns" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="UseDOSLineEnds" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="BooleanComparisonMode" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="FormsCheckRequiredFields" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="EscapeDateTime" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ </node>
+ <node oor:name="MetaData">
+ <node oor:name="SupportsTableCreation" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="SupportsBrowsing" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="Authentication" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:string">
+ <value>UserPassword</value>
+ </prop>
+ </node>
+ </node>
+ </node>
+ </node>
+</oor:component-data>
diff --git a/connectivity/source/drivers/adabas/makefile.mk b/connectivity/source/drivers/adabas/makefile.mk
index 59f3238b4f..09b2936e1c 100644
--- a/connectivity/source/drivers/adabas/makefile.mk
+++ b/connectivity/source/drivers/adabas/makefile.mk
@@ -42,8 +42,8 @@ VISIBILITY_HIDDEN=TRUE
ENVCFLAGS+=/FR$(SLO)$/
.ENDIF
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/version.mk
+.INCLUDE : $(PRJ)$/makefile.pmk
+.INCLUDE : $(PRJ)$/version.mk
.IF "$(SYSTEM_ODBC_HEADERS)" == "YES"
CFLAGS+=-DSYSTEM_ODBC_HEADERS
@@ -104,9 +104,7 @@ SHL1DEF= $(MISC)$/$(SHL1TARGET).def
DEF1NAME= $(SHL1TARGET)
DEF1EXPORTFILE= exports.dxp
-
# --- Targets ----------------------------------
-.INCLUDE : target.mk
-
+.INCLUDE : $(PRJ)$/target.pmk \ No newline at end of file
diff --git a/connectivity/source/drivers/ado/ado.xcu b/connectivity/source/drivers/ado/ado.xcu
new file mode 100644
index 0000000000..a99b989c83
--- /dev/null
+++ b/connectivity/source/drivers/ado/ado.xcu
@@ -0,0 +1,242 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--***********************************************************************
+ *
+ * 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: DataAccess.xcu,v $
+ * $Revision: 1.27 $
+ *
+ * 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.
+ *
+ ************************************************************************ -->
+<oor:component-data oor:name="Drivers" oor:package="org.openoffice.Office.DataAccess" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+ <node oor:name="Installed">
+ <node oor:name="sdbc:ado:*" oor:op="replace">
+ <prop oor:name="Driver">
+ <value>com.sun.star.comp.sdbc.ado.ODriver</value>
+ </prop>
+ <prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
+ <value xml:lang="en-US">ADO</value>
+ </prop>
+ <node oor:name="Properties">
+ <node oor:name="CharSet" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:string">
+ <value></value>
+ </prop>
+ </node>
+ </node>
+ <node oor:name="Features">
+ <node oor:name="GeneratedValues" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="UseSQL92NamingConstraints" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="AppendTableAliasInSelect" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="UseKeywordAsBeforeAlias" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="UseBracketedOuterJoinSyntax" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="IgnoreDriverPrivileges" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="DisplayVersionColumns" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="UseCatalogInSelect" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="UseSchemaInSelect" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="UseIndexDirectionKeyword" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="UseDOSLineEnds" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="BooleanComparisonMode" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="FormsCheckRequiredFields" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="EscapeDateTime" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ </node>
+ <node oor:name="MetaData">
+ <node oor:name="SupportsTableCreation" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="SupportsBrowsing" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="Authentication" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:string">
+ <value>UserPassword</value>
+ </prop>
+ </node>
+ </node>
+ </node>
+ <node oor:name="sdbc:ado:access:PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=*" oor:op="replace">
+ <prop oor:name="Driver">
+ <value>com.sun.star.comp.sdbc.ado.ODriver</value>
+ </prop>
+ <prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
+ <value xml:lang="en-US">Microsoft Access</value>
+ </prop>
+ <node oor:name="Properties">
+ <node oor:name="CharSet" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:string">
+ <value></value>
+ </prop>
+ </node>
+ </node>
+ <node oor:name="Features">
+ <node oor:name="UseSQL92NamingConstraints" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="AppendTableAliasInSelect" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="UseBracketedOuterJoinSyntax" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="UseDOSLineEnds" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="BooleanComparisonMode" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="FormsCheckRequiredFields" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="EscapeDateTime" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ </node>
+ <node oor:name="MetaData">
+ <node oor:name="ColumnAliasInOrderBy" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ </node>
+ <node oor:name="SupportsTableCreation" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="SupportsBrowsing" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="FileSystemBased" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="MediaType" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:string">
+ <value>application/msaccess</value>
+ </prop>
+ </node>
+ <node oor:name="Extension" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:string">
+ <value>mdb</value>
+ </prop>
+ </node>
+ <node oor:name="BooleanComparisonMode" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:int">
+ <value>3</value>
+ </prop>
+ </node>
+ </node>
+ </node>
+ <node oor:name="sdbc:ado:access:Provider=Microsoft.ACE.OLEDB.12.0;DATA SOURCE=*" oor:op="replace">
+ <prop oor:name="ParentURLPattern">
+ <value>sdbc:ado:access:PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=*</value>
+ </prop>
+ <prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
+ <value xml:lang="en-US">Microsoft Access 2007</value>
+ </prop>
+ <node oor:name="MetaData">
+ <node oor:name="Extension" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:string">
+ <value></value>
+ </prop>
+ </node>
+ </node>
+ </node>
+ </node>
+</oor:component-data>
diff --git a/connectivity/source/drivers/ado/makefile.mk b/connectivity/source/drivers/ado/makefile.mk
index 1aace34e4d..b453c528e1 100644
--- a/connectivity/source/drivers/ado/makefile.mk
+++ b/connectivity/source/drivers/ado/makefile.mk
@@ -28,7 +28,6 @@
# for a copy of the LGPLv3 License.
#
#*************************************************************************
-.IF "$(GUI)"=="WNT"
PRJ=..$/..$/..
PRJINC=..$/..
@@ -43,9 +42,10 @@ VISIBILITY_HIDDEN=TRUE
ENVCFLAGS+=/FR$(SLO)$/
.ENDIF
-.INCLUDE : settings.mk
.INCLUDE : $(PRJ)$/version.mk
+.INCLUDE : $(PRJ)$/makefile.pmk
+.IF "$(GUI)"=="WNT"
# --- Files -------------------------------------
EXCEPTIONSFILES= \
@@ -109,9 +109,10 @@ SHL1DEF= $(MISC)$/$(SHL1TARGET).def
DEF1NAME= $(SHL1TARGET)
DEF1EXPORTFILE= exports.dxp
-# --- Targets ----------------------------------
-
-.INCLUDE : target.mk
-
+.ELSE
+dummy:
+ @echo "Nothing to build for GUI $(GUI)"
.ENDIF # "$(GUI)"=="WNT"
+# --- Targets ----------------------------------
+.INCLUDE : $(PRJ)$/target.pmk
diff --git a/connectivity/source/drivers/calc/calc.xcu b/connectivity/source/drivers/calc/calc.xcu
new file mode 100644
index 0000000000..5ca6c81b60
--- /dev/null
+++ b/connectivity/source/drivers/calc/calc.xcu
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--***********************************************************************
+ *
+ * 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: DataAccess.xcu,v $
+ * $Revision: 1.27 $
+ *
+ * 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.
+ *
+ ************************************************************************ -->
+<oor:component-data oor:name="Drivers" oor:package="org.openoffice.Office.DataAccess" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+ <node oor:name="Installed">
+ <node oor:name="sdbc:calc:*" oor:op="replace">
+ <prop oor:name="Driver">
+ <value>com.sun.star.comp.sdbc.calc.ODriver</value>
+ </prop>
+ <prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
+ <value xml:lang="en-US">Spreadsheet</value>
+ </prop>
+ <node oor:name="Features">
+ <node oor:name="EscapeDateTime" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ </node>
+ <node oor:name="MetaData">
+ <node oor:name="SupportsBrowsing" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="FileSystemBased" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="MediaType" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:string">
+ <value>application/vnd.oasis.opendocument.spreadsheet</value>
+ </prop>
+ </node>
+ </node>
+ </node>
+ </node>
+</oor:component-data>
diff --git a/connectivity/source/drivers/calc/makefile.mk b/connectivity/source/drivers/calc/makefile.mk
index 08d8342363..620bcd6a8e 100644
--- a/connectivity/source/drivers/calc/makefile.mk
+++ b/connectivity/source/drivers/calc/makefile.mk
@@ -42,7 +42,7 @@ VISIBILITY_HIDDEN=TRUE
ENVCFLAGS+=/FR$(SLO)$/
.ENDIF
-.INCLUDE : settings.mk
+.INCLUDE : $(PRJ)$/makefile.pmk
.INCLUDE : $(PRJ)$/version.mk
@@ -94,6 +94,6 @@ DEF1EXPORTFILE= exports.dxp
# --- Targets ----------------------------------
-.INCLUDE : target.mk
+.INCLUDE : $(PRJ)$/target.pmk
diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx
index 0b49c20466..d776a91c74 100644
--- a/connectivity/source/drivers/dbase/DTable.cxx
+++ b/connectivity/source/drivers/dbase/DTable.cxx
@@ -368,11 +368,12 @@ void ODbaseTable::fillColumns()
cType[0] = aDBFColumn.db_typ;
cType[1] = 0;
aTypeName = ::rtl::OUString::createFromAscii(cType);
+OSL_TRACE("column type: %c",aDBFColumn.db_typ);
switch (aDBFColumn.db_typ)
{
case 'C':
- eType = DataType::CHAR;
+ eType = DataType::VARCHAR;
aTypeName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VARCHAR"));
break;
case 'F':
@@ -2785,13 +2786,13 @@ BOOL ODbaseTable::ReadMemo(ULONG nBlockNo, ORowSetValue& aVariable)
if ( bIsText )
{
// char cChar;
- ::rtl::OUString aStr;
+ ::rtl::OUStringBuffer aStr;
while ( nLength > STRING_MAXLEN )
{
ByteString aBStr;
aBStr.Expand(STRING_MAXLEN);
m_pMemoStream->Read(aBStr.AllocBuffer(STRING_MAXLEN),STRING_MAXLEN);
- aStr += ::rtl::OUString(aBStr.GetBuffer(),aBStr.Len(), m_eEncoding);
+ aStr.append(::rtl::OUString(aBStr.GetBuffer(),aBStr.Len(), m_eEncoding));
nLength -= STRING_MAXLEN;
}
if ( nLength > 0 )
@@ -2800,12 +2801,10 @@ BOOL ODbaseTable::ReadMemo(ULONG nBlockNo, ORowSetValue& aVariable)
aBStr.Expand(static_cast<xub_StrLen>(nLength));
m_pMemoStream->Read(aBStr.AllocBuffer(static_cast<xub_StrLen>(nLength)),nLength);
// aBStr.ReleaseBufferAccess();
-
- aStr += ::rtl::OUString(aBStr.GetBuffer(),aBStr.Len(), m_eEncoding);
-
+ aStr.append(::rtl::OUString(aBStr.GetBuffer(),aBStr.Len(), m_eEncoding));
}
if ( aStr.getLength() )
- aVariable = aStr;
+ aVariable = aStr.makeStringAndClear();
} // if ( bIsText )
else
{
diff --git a/connectivity/source/drivers/dbase/dbase.xcu b/connectivity/source/drivers/dbase/dbase.xcu
new file mode 100644
index 0000000000..4c8a0413ef
--- /dev/null
+++ b/connectivity/source/drivers/dbase/dbase.xcu
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--***********************************************************************
+ *
+ * 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: DataAccess.xcu,v $
+ * $Revision: 1.27 $
+ *
+ * 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.
+ *
+ ************************************************************************ -->
+<oor:component-data oor:name="Drivers" oor:package="org.openoffice.Office.DataAccess" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+ <node oor:name="Installed">
+ <node oor:name="sdbc:dbase:*" oor:op="replace">
+ <prop oor:name="Driver">
+ <value>com.sun.star.comp.sdbc.dbase.ODriver</value>
+ </prop>
+ <prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
+ <value xml:lang="en-US">dBASE</value>
+ </prop>
+ <node oor:name="Properties">
+ <node oor:name="CharSet" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:string">
+ <value></value>
+ </prop>
+ </node>
+ <node oor:name="ShowDeleted" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ </node>
+ <node oor:name="EnableSQL92Check" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ </node>
+ </node>
+ <node oor:name="Features">
+ <node oor:name="UseSQL92NamingConstraints" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="UseDOSLineEnds" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="EscapeDateTime" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ </node>
+ <node oor:name="MetaData">
+ <node oor:name="SupportsTableCreation" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="SupportsBrowsing" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="FileSystemBased" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="MediaType" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:string">
+ <value>application/dbase</value>
+ </prop>
+ </node>
+ </node>
+ </node>
+ </node>
+</oor:component-data>
diff --git a/connectivity/source/drivers/dbase/makefile.mk b/connectivity/source/drivers/dbase/makefile.mk
index 7a827b86d4..37a88ef476 100644
--- a/connectivity/source/drivers/dbase/makefile.mk
+++ b/connectivity/source/drivers/dbase/makefile.mk
@@ -41,7 +41,7 @@ VISIBILITY_HIDDEN=TRUE
ENVCFLAGS+=/FR$(SLO)$/
.ENDIF
-.INCLUDE : settings.mk
+.INCLUDE : $(PRJ)$/makefile.pmk
.INCLUDE : $(PRJ)$/version.mk
# --- Files -------------------------------------
@@ -128,6 +128,6 @@ DEF1EXPORTFILE= exports.dxp
# --- Targets ----------------------------------
-.INCLUDE : target.mk
+.INCLUDE : $(PRJ)$/target.pmk
diff --git a/connectivity/source/drivers/evoab/LCatalog.cxx b/connectivity/source/drivers/evoab/LCatalog.cxx
new file mode 100644
index 0000000000..eda89dd6f8
--- /dev/null
+++ b/connectivity/source/drivers/evoab/LCatalog.cxx
@@ -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: LCatalog.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.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_connectivity.hxx"
+
+
+#include "LCatalog.hxx"
+#include "LConnection.hxx"
+#include "LTables.hxx"
+#include <com/sun/star/sdbc/XRow.hpp>
+#include <com/sun/star/sdbc/XResultSet.hpp>
+
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::sdbcx;
+using namespace ::com::sun::star::sdbc;
+using namespace ::com::sun::star::container;
+
+// -------------------------------------------------------------------------
+using namespace connectivity::evoab;
+// -------------------------------------------------------------------------
+OEvoabCatalog::OEvoabCatalog(OEvoabConnection* _pCon) : file::OFileCatalog(_pCon)
+{
+}
+// -------------------------------------------------------------------------
+void OEvoabCatalog::refreshTables()
+{
+ TStringVector aVector;
+ Sequence< ::rtl::OUString > aTypes;
+ Reference< XResultSet > xResult = m_xMetaData->getTables(Any(),
+ ::rtl::OUString::createFromAscii("%"),::rtl::OUString::createFromAscii("%"),aTypes);
+
+ if(xResult.is())
+ {
+ Reference< XRow > xRow(xResult,UNO_QUERY);
+ while(xResult->next())
+ aVector.push_back(xRow->getString(3));
+ }
+ if(m_pTables)
+ m_pTables->reFill(aVector);
+ else
+ m_pTables = new OEvoabTables(m_xMetaData,*this,m_aMutex,aVector);
+}
+// -----------------------------------------------------------------------------
+
+
+
diff --git a/svx/source/sdr/overlay/overlaylinestriped.cxx b/connectivity/source/drivers/evoab/LCatalog.hxx
index 00400ea84a..92d78d44b8 100644
--- a/svx/source/sdr/overlay/overlaylinestriped.cxx
+++ b/connectivity/source/drivers/evoab/LCatalog.hxx
@@ -6,7 +6,7 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: overlaylinestriped.cxx,v $
+ * $RCSfile: LCatalog.hxx,v $
* $Revision: 1.4 $
*
* This file is part of OpenOffice.org.
@@ -28,20 +28,25 @@
*
************************************************************************/
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-#include <svx/sdr/overlay/overlaylinestriped.hxx>
-#include <tools/gen.hxx>
-#include <vcl/outdev.hxx>
+#ifndef _CONNECTIVITY_EVOAB_LCATALOG_HXX_
+#define _CONNECTIVITY_EVOAB_LCATALOG_HXX_
-//////////////////////////////////////////////////////////////////////////////
+#include "file/FCatalog.hxx"
-namespace sdr
+namespace connectivity
{
- namespace overlay
+ namespace evoab
{
- } // end of namespace overlay
-} // end of namespace sdr
+ class OEvoabConnection;
+ class OEvoabCatalog : public file::OFileCatalog
+ {
+ public:
+ virtual void refreshTables();
+
+ public:
+ OEvoabCatalog(OEvoabConnection* _pCon);
+ };
+ }
+}
+#endif // _CONNECTIVITY_EVOAB_LCATALOG_HXX_
-//////////////////////////////////////////////////////////////////////////////
-// eof
diff --git a/connectivity/source/drivers/evoab/LColumnAlias.cxx b/connectivity/source/drivers/evoab/LColumnAlias.cxx
new file mode 100644
index 0000000000..c59404389c
--- /dev/null
+++ b/connectivity/source/drivers/evoab/LColumnAlias.cxx
@@ -0,0 +1,235 @@
+/*************************************************************************
+ *
+ * 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: LColumnAlias.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.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_connectivity.hxx"
+#include "LColumnAlias.hxx"
+#include "LDriver.hxx"
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/container/XNameAccess.hpp>
+#include "LConfigAccess.hxx"
+
+using namespace ::connectivity;
+using namespace ::connectivity::evoab;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::container;
+
+static const ::rtl::OUString sProgrammaticNames[] =
+{
+ ::rtl::OUString::createFromAscii("FirstName"),
+ ::rtl::OUString::createFromAscii("LastName"),
+ ::rtl::OUString::createFromAscii("DisplayName"),
+ ::rtl::OUString::createFromAscii("NickName"),
+ ::rtl::OUString::createFromAscii("PrimaryEmail"),
+ ::rtl::OUString::createFromAscii("SecondEmail"),
+ ::rtl::OUString::createFromAscii("PreferMailFormat"),
+ ::rtl::OUString::createFromAscii("WorkPhone"),
+ ::rtl::OUString::createFromAscii("HomePhone"),
+ ::rtl::OUString::createFromAscii("FaxNumber"),
+ ::rtl::OUString::createFromAscii("PagerNumber"),
+ ::rtl::OUString::createFromAscii("CellularNumber"),
+ ::rtl::OUString::createFromAscii("HomeAddress"),
+ ::rtl::OUString::createFromAscii("HomeAddress2"),
+ ::rtl::OUString::createFromAscii("HomeCity"),
+ ::rtl::OUString::createFromAscii("HomeState"),
+ ::rtl::OUString::createFromAscii("HomeZipCode"),
+ ::rtl::OUString::createFromAscii("HomeCountry"),
+ ::rtl::OUString::createFromAscii("WorkAddress"),
+ ::rtl::OUString::createFromAscii("WorkAddress2"),
+ ::rtl::OUString::createFromAscii("WorkCity"),
+ ::rtl::OUString::createFromAscii("WorkState"),
+ ::rtl::OUString::createFromAscii("WorkZipCode"),
+ ::rtl::OUString::createFromAscii("WorkCountry"),
+ ::rtl::OUString::createFromAscii("JobTitle"),
+ ::rtl::OUString::createFromAscii("Department"),
+ ::rtl::OUString::createFromAscii("Company"),
+ ::rtl::OUString::createFromAscii("WebPage1"),
+ ::rtl::OUString::createFromAscii("WebPage2"),
+ ::rtl::OUString::createFromAscii("BirthYear"),
+ ::rtl::OUString::createFromAscii("BirthMonth"),
+ ::rtl::OUString::createFromAscii("BirthDay"),
+ ::rtl::OUString::createFromAscii("Notes")
+};
+//------------------------------------------------------------------------------
+OColumnAlias::OColumnAlias()
+{
+ // Initialise m_aAlias with the default values from sProgrammaticNames.
+ initialise();
+
+ // Initialise m_aAlias map with the default values from sProgrammaticNames.
+ setAliasMap();
+}
+//------------------------------------------------------------------
+OColumnAlias::~OColumnAlias()
+{
+}
+//------------------------------------------------------------------
+void OColumnAlias::initialise()
+{
+ m_aAlias.reserve( END - FIRSTNAME + 1 );
+ for (sal_Int32 i(FIRSTNAME); i < END; ++i)
+ {
+ m_aAlias.push_back(sProgrammaticNames[i]);
+ m_aHeadLineNames.push_back(sProgrammaticNames[i]);
+ }
+
+ return;
+}
+//------------------------------------------------------------------
+void OColumnAlias::setAlias(const ::com::sun::star::uno::Reference<
+ ::com::sun::star::lang::XMultiServiceFactory >& _rxORB)
+{
+ OSL_TRACE("OColumnAlias::setAlias()entered");
+
+ // open our driver settings config node
+
+ // the config path for our own driver's settings
+ Reference< XPropertySet > xEvoDriverNode = createDriverConfigNode( _rxORB, OEvoabDriver::getImplementationName_Static() );
+ //Reference< XPropertySet > xMozDriverNode = createDriverConfigNode( _rxORB, mozab::OConnection::getDriverImplementationName() );
+ Reference< XPropertySet > xMozDriverNode = createDriverConfigNode( _rxORB, ::rtl::OUString::createFromAscii ("com.sun.star.comp.sdbc.MozabDriver") );
+ if ( xEvoDriverNode.is() && xMozDriverNode.is() )
+ {
+ try
+ {
+ //=============================================================
+ Reference< XNameAccess > xEvoAliasesNode;
+ Reference< XNameAccess > xMozAliasesNode;
+ xEvoDriverNode->getPropertyValue( ::rtl::OUString::createFromAscii("ColumnAliases") ) >>= xEvoAliasesNode;
+ xMozDriverNode->getPropertyValue( ::rtl::OUString::createFromAscii("ColumnAliases") ) >>= xMozAliasesNode;
+ OSL_ENSURE( xEvoAliasesNode.is(), "OColumnAlias::setAlias: missing the evolution aliases node!" );
+ OSL_ENSURE( xMozAliasesNode.is(), "OColumnAlias::setAlias: missing the mozilla aliases node!" );
+
+ // this is a set of string nodes
+ Sequence< ::rtl::OUString > aColumnProgrammaticNames;
+ //OSL_TRACE("OColumnAlias::setAlias()before xAliasesNode->getElementNames()");
+ if ( xEvoAliasesNode.is() )
+ aColumnProgrammaticNames = xEvoAliasesNode->getElementNames();
+ //OSL_TRACE("OColumnAlias::setAlias()after xAliasesNode->getElementNames()");
+
+ //=============================================================
+ // travel through all the set elements
+ const ::rtl::OUString* pProgrammaticNames = aColumnProgrammaticNames.getConstArray();
+ const ::rtl::OUString* pProgrammaticNamesEnd = pProgrammaticNames + aColumnProgrammaticNames.getLength();
+ ::rtl::OUString sAssignedAlias;
+ ::rtl::OUString sHeadLineName;
+
+ for ( ; pProgrammaticNames < pProgrammaticNamesEnd; ++pProgrammaticNames )
+ {
+ //OSL_TRACE("OColumnAlias::setAlias()::*pProgrammaticNames = %s\n", ((OUtoCStr(*pProgrammaticNames)) ? (OUtoCStr(*pProgrammaticNames)):("NULL")) );
+ OSL_ENSURE( m_aAliasMap.end() != m_aAliasMap.find( *pProgrammaticNames ),
+ "OColumnAlias::setAlias: found an invalid programmtic name!" );
+ // if this asserts, somebody stored a programmatic name in the configuration
+ // which is not allowed (i.e. not in the list of known programmatics).
+ //OSL_TRACE("OColumnAlias::setAlias()before xAliasesNode->getByName()");
+
+#if OSL_DEBUG_LEVEL > 0
+ sal_Bool bExtractionSuccess =
+#endif
+ xMozAliasesNode->getByName( *pProgrammaticNames) >>= sAssignedAlias;
+ OSL_ENSURE( bExtractionSuccess, "OColumnAlias::setAlias: invalid mozilla config data!" );
+#if OSL_DEBUG_LEVEL > 0
+ bExtractionSuccess =
+#endif
+ xEvoAliasesNode->getByName( *pProgrammaticNames) >>= sHeadLineName;
+ OSL_ENSURE( bExtractionSuccess, "OColumnAlias::setAlias: invalid evolution config data!" );
+ //OSL_TRACE("OColumnAlias::setAlias()after xAliasesNode->getByName()");
+
+ // normalize in case the config data is corrupted
+ // (what we really don't need is an empty alias ...)
+ if ( 0 == sAssignedAlias.getLength() )
+ sAssignedAlias = *pProgrammaticNames;
+ if ( 0 == sHeadLineName.getLength() )
+ sHeadLineName = *pProgrammaticNames;
+ //OSL_TRACE("OColumnAlias::setAlias()::sAssignedAlias = %s\n", ((OUtoCStr(sAssignedAlias)) ? (OUtoCStr(sAssignedAlias)):("NULL")) );
+ //OSL_TRACE("OColumnAlias::setAlias()::sHeadLineName = %s\n", ((OUtoCStr(sHeadLineName)) ? (OUtoCStr(sHeadLineName)):("NULL")) );
+
+ //=============================================================
+ // check the value
+ // look up the programmatic indicated by pProgrammaticNames in the known programmatics
+ const ::rtl::OUString* pProgrammatic = sProgrammaticNames + FIRSTNAME;
+ const ::rtl::OUString* pProgrammaticEnd = sProgrammaticNames + END;
+
+ OSL_ENSURE( (sal_Int32)m_aAlias.size() == pProgrammaticEnd - pProgrammatic,
+ "OColumnAlias::setAlias: aliases vector not yet initialized!" );
+
+ // the destination where we want to remember the alias
+ ::std::vector< ::rtl::OUString >::iterator aAlias = m_aAlias.begin();
+ ::std::vector< ::rtl::OUString >::iterator aHeadLineName = m_aHeadLineNames.begin();
+
+ for ( ; pProgrammatic < pProgrammaticEnd; ++pProgrammatic, ++aAlias, ++aHeadLineName )
+ {
+ //OSL_TRACE("OColumnAlias::setAlias()::*pProgrammatic = %s\n", ((OUtoCStr(*pProgrammatic)) ? (OUtoCStr(*pProgrammatic)):("NULL")) );
+ if ( pProgrammaticNames->equals( *pProgrammatic ) )
+ {
+ // add alias to the vector
+ *aAlias = sAssignedAlias;
+ *aHeadLineName = sHeadLineName;
+ break;
+ }
+ }
+ }
+ }
+ catch( const Exception& )
+ {
+ OSL_ENSURE( sal_False, "OColumnAlias::setAlias: could not read my driver's configuration data!" );
+ }
+ }
+
+ // Initialise m_aAliasMap.
+ setAliasMap();
+
+ return;
+}
+//------------------------------------------------------------------
+const ::std::vector< ::rtl::OUString> & OColumnAlias::getAlias() const
+{
+ return m_aAlias;
+}
+//------------------------------------------------------------------
+const ::std::map< ::rtl::OUString, ::rtl::OUString> & OColumnAlias::getAliasMap() const
+{
+ return m_aAliasMap;
+}
+//------------------------------------------------------------------
+void OColumnAlias::setAliasMap()
+{
+ // Fill the map with the values of m_aAlias
+ // and the sProgrammaticNames array.
+ for (sal_Int32 i(FIRSTNAME); i < END; ++i) {
+ m_aAliasMap[m_aAlias[i]] = m_aHeadLineNames[i];
+ //OSL_TRACE("OColumnAlias::setAliasMap()::m_aAlias[i] = %s\n", ((OUtoCStr(m_aAlias[i])) ? (OUtoCStr(m_aAlias[i])):("NULL")) );
+ //OSL_TRACE("OColumnAlias::setAliasMap()::m_aAliasMap[m_aAlias[i]] = %s\n", ((OUtoCStr(m_aAliasMap[m_aAlias[i]])) ? (OUtoCStr(m_aAliasMap[m_aAlias[i]])):("NULL")) );
+ }
+
+ return;
+}
+//------------------------------------------------------------------
diff --git a/connectivity/source/drivers/evoab/LColumnAlias.hxx b/connectivity/source/drivers/evoab/LColumnAlias.hxx
new file mode 100644
index 0000000000..3803a39be5
--- /dev/null
+++ b/connectivity/source/drivers/evoab/LColumnAlias.hxx
@@ -0,0 +1,116 @@
+/*************************************************************************
+ *
+ * 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: LColumnAlias.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 _CONNECTIVITY_EVOAB_LCOLUMNALIAS_HXX_
+#define _CONNECTIVITY_EVOAB_LCOLUMNALIAS_HXX_
+
+#include <unotools/confignode.hxx>
+
+#include <osl/mutex.hxx>
+#include <vector>
+#include <map>
+
+namespace connectivity
+{
+ namespace evoab
+ {
+ typedef enum {
+ FIRSTNAME = 0,
+ LASTNAME,
+ DISPLAYNAME,
+ NICKNAME,
+ PRIMARYEMAIL,
+ SECONDEMAIL,
+ PREFERMAILFORMAT,
+ WORKPHONE,
+ HOMEPHONE,
+ FAXNUMBER,
+ PAGERNUMBER,
+ CELLULARNUMBER,
+ HOMEADDRESS,
+ HOMEADDRESS2,
+ HOMECITY,
+ HOMESTATE,
+ HOMEZIPCODE,
+ HOMECOUNTRY,
+ WORKADDRESS,
+ WORKADDRESS2,
+ WORKCITY,
+ WORKSTATE,
+ WORKZIPCODE,
+ WORKCOUNTRY,
+ JOBTITLE,
+ DEPARTMENT,
+ COMPANY,
+ WEBPAGE1,
+ WEBPAGE2,
+ BIRTHYEAR,
+ BIRTHMONTH,
+ BIRTHDAY,
+ NOTES,
+ END
+ } ProgrammaticName;
+
+ class OColumnAlias
+ {
+ /**
+ * m_Alias holds aliases for the evolution addressbook
+ * column names. This member gets initialised during
+ * creation of the connection to the driver.
+ * m_aAlias initialises m_aAliasMap which then can be
+ * used to find the corresponding programmatic name
+ * when an alias is used as a query attribute. Mozilla
+ * expects programmatic names from its clients.
+ *
+ * m_aAlias: vector of aliases used to initialise m_aAliasMap.
+ * m_AliasMap: map of {alias, programmaticname} pairs.
+ *
+ */
+ private:
+ ::std::vector< ::rtl::OUString> m_aAlias;
+ ::std::vector< ::rtl::OUString> m_aHeadLineNames;
+ ::std::map< ::rtl::OUString, ::rtl::OUString> m_aAliasMap;
+ protected:
+ ::osl::Mutex m_aMutex;
+ public:
+ void initialise(void);
+ const ::std::vector< ::rtl::OUString> & getAlias(void) const;
+ const ::std::map< ::rtl::OUString, ::rtl::OUString> & getAliasMap(void) const;
+ void setAlias(const ::com::sun::star::uno::Reference<
+ ::com::sun::star::lang::XMultiServiceFactory > &);
+ private:
+ void setAliasMap(void);
+ public:
+ OColumnAlias(void);
+ ~OColumnAlias(void);
+ };
+ }
+}
+#endif // _CONNECTIVITY_EVOAB_LCOLUMNALIAS_HXX_
diff --git a/connectivity/source/drivers/evoab/LColumns.cxx b/connectivity/source/drivers/evoab/LColumns.cxx
new file mode 100644
index 0000000000..4837c1406b
--- /dev/null
+++ b/connectivity/source/drivers/evoab/LColumns.cxx
@@ -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: LColumns.cxx,v $
+ * $Revision: 1.6 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_connectivity.hxx"
+
+#include "LColumns.hxx"
+#include "LTable.hxx"
+#include "connectivity/sdbcx/VColumn.hxx"
+
+using namespace connectivity::evoab;
+using namespace connectivity;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::sdbcx;
+using namespace ::com::sun::star::sdbc;
+using namespace ::com::sun::star::container;
+
+
+sdbcx::ObjectType OEvoabColumns::createObject(const ::rtl::OUString& _rName)
+{
+
+ OEvoabTable* pTable = (OEvoabTable*)m_pTable;
+ ::vos::ORef<OSQLColumns> aCols = pTable->getTableColumns();
+ OSQLColumns::Vector::const_iterator aIter = find(aCols->get().begin(),aCols->get().end(),_rName,::comphelper::UStringMixEqual(isCaseSensitive()));
+ sdbcx::ObjectType xRet;
+ if(aIter != aCols->get().end())
+ xRet = sdbcx::ObjectType(*aIter,UNO_QUERY);
+ return xRet;
+}
+// -------------------------------------------------------------------------
+
+
diff --git a/svx/inc/svdtouch.hxx b/connectivity/source/drivers/evoab/LColumns.hxx
index a3ac3dd259..865d4500f4 100644
--- a/svx/inc/svdtouch.hxx
+++ b/connectivity/source/drivers/evoab/LColumns.hxx
@@ -6,8 +6,8 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: svdtouch.hxx,v $
- * $Revision: 1.6 $
+ * $RCSfile: LColumns.hxx,v $
+ * $Revision: 1.5 $
*
* This file is part of OpenOffice.org.
*
@@ -28,26 +28,28 @@
*
************************************************************************/
-#ifndef _SVDTOUCH_HXX
-#define _SVDTOUCH_HXX
-
-#include <tools/solar.h>
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-class Point;
-class Polygon;
-class PolyPolygon;
-class Rectangle;
-
-bool IsPointInsidePoly(const Polygon& rPoly, const Point& rHit);
-bool IsPointInsidePoly(const PolyPolygon& rPoly, const Point& rHit);
-
-bool IsRectTouchesLine(const Point& rPt1, const Point& rPt2, const Rectangle& rHit);
-bool IsRectTouchesLine(const Polygon& rLine, const Rectangle& rHit);
-bool IsRectTouchesLine(const PolyPolygon& rLine, const Rectangle& rHit);
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-#endif //_SVDTOUCH_HXX
+#ifndef _CONNECTIVITY_EVOAB_LCOLUMNS_HXX_
+#define _CONNECTIVITY_EVOAB_LCOLUMNS_HXX_
+
+#include "file/FColumns.hxx"
+
+namespace connectivity
+{
+ namespace evoab
+ {
+ class OEvoabColumns : public file::OColumns
+ {
+ protected:
+ virtual sdbcx::ObjectType createObject(const ::rtl::OUString& _rName);
+ public:
+ OEvoabColumns(file::OFileTable* _pTable,
+ ::osl::Mutex& _rMutex,
+ const TStringVector &_rVector
+ ) : file::OColumns(_pTable,_rMutex,_rVector)
+ {}
+
+ };
+ }
+}
+#endif // _CONNECTIVITY_EVOAB_LCOLUMNS_HXX_
diff --git a/connectivity/source/drivers/evoab/LConfigAccess.cxx b/connectivity/source/drivers/evoab/LConfigAccess.cxx
new file mode 100644
index 0000000000..a7441cb0da
--- /dev/null
+++ b/connectivity/source/drivers/evoab/LConfigAccess.cxx
@@ -0,0 +1,164 @@
+/*************************************************************************
+ *
+ * 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: LConfigAccess.cxx,v $
+ * $Revision: 1.6 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_connectivity.hxx"
+#include "LConfigAccess.hxx"
+#include "LDriver.hxx"
+#ifndef CONNECTIVITY_EVOAB_DEBUG_HELPER_HXX
+#include "LDebug.hxx"
+#endif
+
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::beans;
+
+//.........................................................................
+namespace connectivity
+{
+ namespace evoab
+ {
+ //-----------------------------------------------------------------
+ Reference< XPropertySet > createDriverConfigNode( Reference< XMultiServiceFactory > _rxORB, ::rtl::OUString _sDriverImplementationName )
+ {
+ OSL_TRACE("createDriverConfigNode()entered");
+
+ Reference< XPropertySet > xNode;
+ try
+ {
+ //=============================================================
+ // create the config provider
+ Reference< XMultiServiceFactory > xConfigProvider(
+ _rxORB->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.configuration.ConfigurationProvider" ) ),
+ UNO_QUERY
+ );
+ OSL_ENSURE( xConfigProvider.is(), "createDriverConfigNode: could not create the config provider!" );
+
+ if ( xConfigProvider.is() )
+ {
+ ::rtl::OUString sCompleteNodePath = ::rtl::OUString::createFromAscii ("/org.openoffice.Office.DataAccess/DriverSettings/" );
+ sCompleteNodePath += _sDriverImplementationName;
+ //sCompleteNodePath += OEvoabConnection::getDriverImplementationName();
+ //sCompleteNodePath += ::rtl::OUString::createFromAscii ("com.sun.star.comp.sdbc.MozabDriver");
+ EVO_TRACE_STRING("createDriverConfigNode()::sCompleteNodePath = %s\n", sCompleteNodePath );
+
+ //=========================================================
+ // arguments for creating the config access
+ Sequence< Any > aArguments(2);
+ // the path to the node to open
+ aArguments[0] <<= PropertyValue(
+ ::rtl::OUString::createFromAscii( "nodepath"),
+ 0,
+ makeAny( sCompleteNodePath ),
+ PropertyState_DIRECT_VALUE
+ );
+ // the depth: -1 means unlimited
+ aArguments[1] <<= PropertyValue(
+ ::rtl::OUString::createFromAscii( "depth"),
+ 0,
+ makeAny( (sal_Int32)-1 ),
+ PropertyState_DIRECT_VALUE
+ );
+
+ //=========================================================
+ // create the access
+ Reference< XInterface > xAccess = xConfigProvider->createInstanceWithArguments(
+ ::rtl::OUString::createFromAscii( "com.sun.star.configuration.ConfigurationAccess" ),
+ aArguments
+ );
+ OSL_ENSURE( xAccess.is(), "createDriverConfigNode: invalid access returned (should throw an exception instead)!" );
+
+ xNode = xNode.query( xAccess );
+ }
+ }
+ catch( const Exception& )
+ {
+ OSL_ENSURE( sal_False, "createDriverConfigNode: caught an exception while accessing the driver's config node!" );
+ }
+
+ // outta here
+ return xNode;
+ }
+
+ //-----------------------------------------------------------------
+ namespace
+ {
+ // a private helper to accessing the point where we store the reference
+ // to the factory
+ Reference< XMultiServiceFactory >& accessFactoryStorage( )
+ {
+ static Reference< XMultiServiceFactory > xEvoabServiceFactory;
+ return xEvoabServiceFactory;
+ }
+ }
+
+ //-----------------------------------------------------------------
+ void setEvoabServiceFactory( const Reference< XMultiServiceFactory >& _rxFactory )
+ {
+ accessFactoryStorage( ) = _rxFactory;
+ }
+
+ //-----------------------------------------------------------------
+ const Reference< XMultiServiceFactory >& getEvoabServiceFactory( )
+ {
+ return accessFactoryStorage( );
+ }
+
+ //-----------------------------------------------------------------
+ ::rtl::OUString getFullPathExportingCommand( Reference< XMultiServiceFactory > _rxORB )
+ {
+ ::rtl::OUString sFullPathExportingCommand;
+
+ //Reference< XMultiServiceFactory > xFactory = getEvoabServiceFactory();
+ //OSL_ENSURE( xFactory.is(), "getPreferredProfileName: invalid service factory!" );
+ OSL_ENSURE( _rxORB.is(), "getFullPathExportingCommand: invalid service factory!" );
+ if ( _rxORB.is() )
+ {
+ try
+ {
+ Reference< XPropertySet > xDriverNode = createDriverConfigNode( _rxORB, OEvoabDriver::getImplementationName_Static() );
+ Reference< XPropertySet > xEvoPrefsNode;
+ if ( xDriverNode.is() )
+ xDriverNode->getPropertyValue( ::rtl::OUString::createFromAscii( "EvolutionPreferences" ) ) >>= xEvoPrefsNode;
+ OSL_ENSURE( xEvoPrefsNode.is(), "getFullPathExportingCommand: could not access the node for the evolution preferences!" );
+ if ( xEvoPrefsNode.is() )
+ xEvoPrefsNode->getPropertyValue( ::rtl::OUString::createFromAscii( "FullPathExportingCommand" ) ) >>= sFullPathExportingCommand;
+ }
+ catch( const Exception& )
+ {
+ OSL_ENSURE( sal_False, "getFullPathExportingCommand: caught an exception!" );
+ }
+ }
+ return sFullPathExportingCommand;
+ }
+ }
+}
+
+//.........................................................................
diff --git a/connectivity/source/drivers/evoab/LConfigAccess.hxx b/connectivity/source/drivers/evoab/LConfigAccess.hxx
new file mode 100644
index 0000000000..883af23001
--- /dev/null
+++ b/connectivity/source/drivers/evoab/LConfigAccess.hxx
@@ -0,0 +1,49 @@
+/*************************************************************************
+ *
+ * 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: LConfigAccess.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 _CONNECTIVITY_EVOAB_LCONFIGACCESS_HXX_
+#define _CONNECTIVITY_EVOAB_LCONFIGACCESS_HXX_
+
+// This is the extended version (for use on the SO side of the driver) of MConfigAccess
+// (which is for use on the mozilla side only)
+
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+
+namespace connectivity
+{
+ namespace evoab
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
+ createDriverConfigNode( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > _rxORB, ::rtl::OUString _sDriverImplementationName );
+ ::rtl::OUString getFullPathExportingCommand( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > _rxORB );
+ }
+}
+#endif // _CONNECTIVITY_EVOAB_LCONFIGACCESS_HXX_
diff --git a/connectivity/source/drivers/evoab/LConnection.cxx b/connectivity/source/drivers/evoab/LConnection.cxx
new file mode 100644
index 0000000000..60107d6dbb
--- /dev/null
+++ b/connectivity/source/drivers/evoab/LConnection.cxx
@@ -0,0 +1,270 @@
+/*************************************************************************
+ *
+ * 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: LConnection.cxx,v $
+ * $Revision: 1.12.56.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.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_connectivity.hxx"
+#include "LConnection.hxx"
+#include "LDatabaseMetaData.hxx"
+#include "LCatalog.hxx"
+#include <com/sun/star/lang/DisposedException.hpp>
+#include <tools/urlobj.hxx>
+#include "LPreparedStatement.hxx"
+#include "LStatement.hxx"
+#include <comphelper/extract.hxx>
+#include <connectivity/dbcharset.hxx>
+#include <connectivity/dbexception.hxx>
+#include <comphelper/processfactory.hxx>
+#include <vos/process.hxx>
+#include <tools/debug.hxx>
+#include "LDebug.hxx"
+#include "diagnose_ex.h"
+#include <comphelper/sequence.hxx>
+#include <connectivity/dbexception.hxx>
+#include "resource/common_res.hrc"
+
+using namespace connectivity::evoab;
+using namespace connectivity::file;
+using namespace vos;
+
+typedef connectivity::file::OConnection OConnection_B;
+
+//------------------------------------------------------------------------------
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::sdbcx;
+using namespace ::com::sun::star::sdbc;
+using namespace ::com::sun::star::lang;
+
+::rtl::OUString implGetExceptionMsg( Exception& e, const ::rtl::OUString& aExceptionType_ )
+{
+ ::rtl::OUString aExceptionType = aExceptionType_;
+ if( aExceptionType.getLength() == 0 )
+ aExceptionType = ::rtl::OUString( ::rtl::OUString::createFromAscii("Unknown" ) );
+
+ ::rtl::OUString aTypeLine( ::rtl::OUString::createFromAscii("\nType: " ) );
+ aTypeLine += aExceptionType;
+
+ ::rtl::OUString aMessageLine( ::rtl::OUString::createFromAscii("\nMessage: " ) );
+ aMessageLine += ::rtl::OUString( e.Message );
+
+ ::rtl::OUString aMsg(aTypeLine);
+ aMsg += aMessageLine;
+ return aMsg;
+}
+
+ // Exception type unknown
+::rtl::OUString implGetExceptionMsg( Exception& e )
+{
+ ::rtl::OUString aMsg = implGetExceptionMsg( e, ::rtl::OUString() );
+ return aMsg;
+}
+
+// --------------------------------------------------------------------------------
+OEvoabConnection::OEvoabConnection(OEvoabDriver* _pDriver) : OConnection(_pDriver)
+ ,m_bHeaderLine(sal_True)
+ ,m_cFieldDelimiter(',')
+ ,m_cStringDelimiter('"')
+ ,m_cDecimalDelimiter('.')
+ ,m_cThousandDelimiter(' ')
+{
+ // Initialise m_aColumnAlias.
+ m_aColumnAlias.setAlias(_pDriver->getFactory());
+}
+//-----------------------------------------------------------------------------
+OEvoabConnection::~OEvoabConnection()
+{
+}
+
+// XServiceInfo
+// --------------------------------------------------------------------------------
+IMPLEMENT_SERVICE_INFO(OEvoabConnection, "com.sun.star.sdbc.drivers.evoab.Connection", "com.sun.star.sdbc.Connection")
+
+//-----------------------------------------------------------------------------
+void OEvoabConnection::construct(const ::rtl::OUString& url,const Sequence< PropertyValue >& info) throw(SQLException)
+{
+ osl_incrementInterlockedCount( &m_refCount );
+ EVO_TRACE_STRING("OEvoabConnection::construct()::url = %s\n", url );
+
+
+ ::rtl::OUString aCLICommand = getDriver()->getEvoab_CLI_EffectiveCommand();
+ ::rtl::OUString aWorkingDirPath = getDriver()->getWorkingDirPath();
+ ::rtl::OUString aArg1 = ::rtl::OUString::createFromAscii(OEvoabDriver::getEVOAB_CLI_ARG_LIST_FOLDERS());
+ ::rtl::OUString aArg2 = ::rtl::OUString::createFromAscii(OEvoabDriver::getEVOAB_CLI_ARG_OUTPUT_FILE_PREFIX());
+ aArg2 += aWorkingDirPath;
+ aArg2 += getDriver()->getEvoFolderListFileName();
+ OArgumentList aArgs(2,&aArg1,&aArg2);
+
+ EVO_TRACE_STRING("OEvoabConnection::construct()::aCLICommand = %s\n", aCLICommand );
+ EVO_TRACE_STRING("OEvoabConnection::construct()::aWorkingDirPath = %s\n", aWorkingDirPath );
+ EVO_TRACE_STRING("OEvoabConnection::construct()::aArg1 = %s\n", aArg1 );
+ EVO_TRACE_STRING("OEvoabConnection::construct()::aArg2 = %s\n", aArg2 );
+ OProcess aApp( aCLICommand,aWorkingDirPath);
+ OSL_VERIFY_EQUALS(
+ aApp.execute( (OProcess::TProcessOption)(OProcess::TOption_Hidden | OProcess::TOption_Wait | OProcess::TOption_SearchPath),aArgs),
+ OProcess::E_None,
+ "Error at execute evolution-addressbook-export to get VCards");
+
+
+ Sequence<PropertyValue> aDriverParam;
+ ::std::vector<PropertyValue> aParam;
+
+ aParam.push_back(PropertyValue(::rtl::OUString::createFromAscii("EnableSQL92Check"), 0, Any(), PropertyState_DIRECT_VALUE));
+ ::dbtools::OCharsetMap aLookupIanaName;
+ ::dbtools::OCharsetMap::const_iterator aLookup = aLookupIanaName.find(RTL_TEXTENCODING_UTF8);
+ aParam.push_back(PropertyValue(::rtl::OUString::createFromAscii("CharSet"), 0,
+ makeAny((*aLookup).getIanaName()), PropertyState_DIRECT_VALUE));
+ aParam.push_back(PropertyValue(::rtl::OUString::createFromAscii("Extension"), 0, makeAny(getDriver()->getFileExt()), PropertyState_DIRECT_VALUE));
+ aParam.push_back(PropertyValue(::rtl::OUString::createFromAscii("HeaderLine"), 0, makeAny(m_bHeaderLine), PropertyState_DIRECT_VALUE));
+ aParam.push_back(PropertyValue(::rtl::OUString::createFromAscii("FieldDelimiter"), 0, makeAny(::rtl::OUString(&m_cFieldDelimiter,1)), PropertyState_DIRECT_VALUE));
+ aParam.push_back(PropertyValue(::rtl::OUString::createFromAscii("StringDelimiter"), 0, makeAny(::rtl::OUString(&m_cStringDelimiter,1)), PropertyState_DIRECT_VALUE));
+ aParam.push_back(PropertyValue(::rtl::OUString::createFromAscii("DecimalDelimiter"), 0, makeAny(::rtl::OUString(&m_cDecimalDelimiter,1)), PropertyState_DIRECT_VALUE));
+ aParam.push_back(PropertyValue(::rtl::OUString::createFromAscii("ThousandDelimiter"), 0, makeAny(::rtl::OUString(&m_cThousandDelimiter,1)), PropertyState_DIRECT_VALUE));
+
+ // build a new parameter sequence from the original parameters, appended by the new parameters from above
+ PropertyValue *pParams = aParam.empty() ? 0 : &aParam[0];
+ aDriverParam = ::comphelper::concatSequences(
+ info,
+ Sequence< PropertyValue >( pParams, aParam.size() )
+ );
+
+ // transform "sdbc:address:evolution" part of URL to "sdbc:flat:file:///..."
+ //
+ sal_Int32 nLen = url.indexOf(':');
+ nLen = url.indexOf(':',nLen+1);
+ ::rtl::OUString aAddrbookURI(url.copy(nLen+1));
+ // Get Scheme
+ nLen = aAddrbookURI.indexOf(':');
+ ::rtl::OUString aAddrbookScheme;
+ if ( nLen == -1 )
+ {
+ // There isn't any subschema: - but could be just subschema
+ if ( aAddrbookURI.getLength() > 0 )
+ {
+ aAddrbookScheme= aAddrbookURI;
+ }
+ else
+ {
+ OSL_TRACE( "No subschema given!!!\n");
+ throwGenericSQLException(STR_URI_SYNTAX_ERROR ,*this);
+ }
+ }
+ else
+ {
+ aAddrbookScheme = aAddrbookURI.copy(0, nLen);
+ }
+
+ EVO_TRACE_STRING("OEvoabConnection::construct()::URI = %s\n", aAddrbookURI );
+ EVO_TRACE_STRING("OEvoabConnection::construct()::Scheme = %s\n", aAddrbookScheme );
+
+ //
+ // Now we have a URI convert it to a Evolution CLI flat file URI
+ //
+ // The Mapping being used is:
+ //
+ // * for Evolution
+ // "sdbc:address:evolution:" -> "sdbc:flat:file:///(file path generated)
+
+ rtl::OUString aEvoFlatURI;
+ if ( aAddrbookScheme.compareToAscii( OEvoabDriver::getSDBC_SCHEME_EVOLUTION() ) == 0 )
+ {
+ aEvoFlatURI = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "sdbc:flat:" ));
+ }
+
+
+ aEvoFlatURI += getDriver()->getWorkingDirURL();
+ EVO_TRACE_STRING("OEvoabConnection::construct()::m_aEvoFlatURI = %s\n", aEvoFlatURI );
+ //setURL(aEvoFlatURI);
+ m_aEvoFlatURI = aEvoFlatURI;
+
+ osl_decrementInterlockedCount( &m_refCount );
+ OConnection::construct(aEvoFlatURI,aDriverParam);
+}
+// --------------------------------------------------------------------------------
+Reference< XDatabaseMetaData > SAL_CALL OEvoabConnection::getMetaData( ) throw(SQLException, RuntimeException)
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+ checkDisposed(OConnection_B::rBHelper.bDisposed);
+
+
+ Reference< XDatabaseMetaData > xMetaData = m_xMetaData;
+ if(!xMetaData.is())
+ {
+ xMetaData = new OEvoabDatabaseMetaData(this);
+ m_xMetaData = xMetaData;
+ }
+
+ return xMetaData;
+}
+//------------------------------------------------------------------------------
+::com::sun::star::uno::Reference< XTablesSupplier > OEvoabConnection::createCatalog()
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+ Reference< XTablesSupplier > xTab = m_xCatalog;
+ if(!xTab.is())
+ {
+ OEvoabCatalog *pCat = new OEvoabCatalog(this);
+ xTab = pCat;
+ m_xCatalog = xTab;
+ }
+ return xTab;
+}
+// --------------------------------------------------------------------------------
+Reference< XStatement > SAL_CALL OEvoabConnection::createStatement( ) throw(SQLException, RuntimeException)
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+ checkDisposed(OConnection_B::rBHelper.bDisposed);
+
+ OEvoabStatement* pStmt = new OEvoabStatement(this);
+
+ Reference< XStatement > xStmt = pStmt;
+ m_aStatements.push_back(WeakReferenceHelper(*pStmt));
+ return xStmt;
+}
+// --------------------------------------------------------------------------------
+Reference< XPreparedStatement > SAL_CALL OEvoabConnection::prepareStatement( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+ checkDisposed(OConnection_B::rBHelper.bDisposed);
+
+
+ OEvoabPreparedStatement* pStmt = new OEvoabPreparedStatement(this);
+ Reference< XPreparedStatement > xStmt = pStmt;
+ pStmt->construct(sql);
+
+ m_aStatements.push_back(WeakReferenceHelper(*pStmt));
+ return xStmt;
+}
+// --------------------------------------------------------------------------------
+Reference< XPreparedStatement > SAL_CALL OEvoabConnection::prepareCall( const ::rtl::OUString& /*sql*/ ) throw(SQLException, RuntimeException)
+{
+ ::dbtools::throwFeatureNotImplementedException( "XConnection::prepareCall", *this );
+ return NULL;
+}
+// -------------------------------------------------------------------------
diff --git a/connectivity/source/drivers/evoab/LConnection.hxx b/connectivity/source/drivers/evoab/LConnection.hxx
new file mode 100644
index 0000000000..05191d923a
--- /dev/null
+++ b/connectivity/source/drivers/evoab/LConnection.hxx
@@ -0,0 +1,81 @@
+/*************************************************************************
+ *
+ * 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: LConnection.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 _CONNECTIVITY_EVOAB_LCONNECTION_HXX_
+#define _CONNECTIVITY_EVOAB_LCONNECTION_HXX_
+
+#include "LDriver.hxx"
+#include "file/FConnection.hxx"
+#include "LColumnAlias.hxx"
+
+namespace connectivity
+{
+ namespace evoab
+ {
+ class OEvoabConnection : public file::OConnection
+ {
+ private:
+ OColumnAlias m_aColumnAlias;
+ sal_Bool m_bHeaderLine; // column names in first row
+ sal_Unicode m_cFieldDelimiter; // look at the name
+ sal_Unicode m_cStringDelimiter; // delimiter for strings m_cStringDelimiter blabla m_cStringDelimiter
+ sal_Unicode m_cDecimalDelimiter; // Dezimal-delimiter (Dezimalpoint)
+ sal_Unicode m_cThousandDelimiter; //
+ rtl::OUString m_aEvoFlatURI;
+
+ public:
+ OEvoabConnection(OEvoabDriver* _pDriver);
+ virtual ~OEvoabConnection();
+
+ virtual void construct(const ::rtl::OUString& _rUrl,const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _rInfo ) throw( ::com::sun::star::sdbc::SQLException);
+
+ // own methods
+ inline const OEvoabDriver* getDriver() const { return static_cast< const OEvoabDriver* >( m_pDriver ); }
+ inline sal_Bool isHeaderLine() const { return m_bHeaderLine; }
+ inline sal_Unicode getFieldDelimiter() const { return m_cFieldDelimiter; }
+ inline sal_Unicode getStringDelimiter() const { return m_cStringDelimiter; }
+ inline sal_Unicode getDecimalDelimiter() const { return m_cDecimalDelimiter; }
+ inline sal_Unicode getThousandDelimiter() const { return m_cThousandDelimiter;}
+ const OColumnAlias& getColumnAlias() const { return m_aColumnAlias; }
+
+ // XServiceInfo
+ DECLARE_SERVICE_INFO();
+
+ // XConnection
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData > SAL_CALL getMetaData( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XTablesSupplier > createCatalog();
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XStatement > SAL_CALL createStatement( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XPreparedStatement > SAL_CALL prepareStatement( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XPreparedStatement > SAL_CALL prepareCall( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+
+ };
+ }
+}
+#endif // _CONNECTIVITY_EVOAB_LCONNECTION_HXX_
diff --git a/connectivity/source/drivers/evoab/LDatabaseMetaData.cxx b/connectivity/source/drivers/evoab/LDatabaseMetaData.cxx
new file mode 100644
index 0000000000..fbcf6826e3
--- /dev/null
+++ b/connectivity/source/drivers/evoab/LDatabaseMetaData.cxx
@@ -0,0 +1,394 @@
+/*************************************************************************
+ *
+ * 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: LDatabaseMetaData.cxx,v $
+ * $Revision: 1.8 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_connectivity.hxx"
+#include "LDatabaseMetaData.hxx"
+#include "LConnection.hxx"
+#include <com/sun/star/sdbc/DataType.hpp>
+#include <com/sun/star/sdbc/ResultSetType.hpp>
+#include <com/sun/star/sdbc/ColumnValue.hpp>
+#include <com/sun/star/beans/XFastPropertySet.hpp>
+#include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
+#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
+#include <com/sun/star/sdbcx/XIndexesSupplier.hpp>
+#include <com/sun/star/ucb/XContentAccess.hpp>
+#ifndef _COM_SUN_STAR_SQLC_XROW_HPP_
+#include <com/sun/star/sdbc/XRow.hpp>
+#endif
+#include <tools/urlobj.hxx>
+#include "FDatabaseMetaDataResultSet.hxx"
+#include <com/sun/star/lang/XUnoTunnel.hpp>
+#include <comphelper/extract.hxx>
+#include <comphelper/types.hxx>
+#include "LFolderList.hxx"
+#include "connectivity/CommonTools.hxx"
+#include <vos/process.hxx>
+#include <osl/process.h>
+#include <tools/debug.hxx>
+#include <map>
+#include <vector>
+
+#ifndef CONNECTIVITY_EVOAB_DEBUG_HELPER_HXX
+#include "LDebug.hxx"
+#endif
+#include "diagnose_ex.h"
+
+using namespace ::comphelper;
+using namespace connectivity;
+using namespace connectivity::evoab;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::sdbcx;
+using namespace ::com::sun::star::sdbc;
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::ucb;
+using namespace osl;
+using namespace vos;
+
+namespace connectivity
+{
+ namespace evoab
+ {
+ static sal_Int32 const s_nCOLUMN_SIZE = 256;
+ static sal_Int32 const s_nDECIMAL_DIGITS = 0;
+ static sal_Int32 const s_nNULLABLE = 1;
+ static sal_Int32 const s_nCHAR_OCTET_LENGTH = 65535;
+ }
+}
+
+OEvoabDatabaseMetaData::OEvoabDatabaseMetaData(::connectivity::file::OConnection* _pCon) :ODatabaseMetaData(_pCon)
+{
+}
+// -------------------------------------------------------------------------
+OEvoabDatabaseMetaData::~OEvoabDatabaseMetaData()
+{
+}
+// -------------------------------------------------------------------------
+Reference< XResultSet > OEvoabDatabaseMetaData::impl_getTypeInfo_throw( )
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ ::connectivity::ODatabaseMetaDataResultSet* pResult = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eTypeInfo);
+ Reference< XResultSet > xRef = pResult;
+ static ODatabaseMetaDataResultSet::ORows aRows;
+ if(aRows.empty())
+ {
+ ODatabaseMetaDataResultSet::ORow aRow;
+
+ aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
+ aRow.push_back(new ORowSetValueDecorator(::rtl::OUString::createFromAscii("CHAR")));
+ aRow.push_back(new ORowSetValueDecorator(DataType::CHAR));
+ aRow.push_back(new ORowSetValueDecorator((sal_Int32)254));
+ aRow.push_back(ODatabaseMetaDataResultSet::getQuoteValue());
+ aRow.push_back(ODatabaseMetaDataResultSet::getQuoteValue());
+ aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
+ aRow.push_back(new ORowSetValueDecorator((sal_Int32)ColumnValue::NULLABLE));
+ aRow.push_back(ODatabaseMetaDataResultSet::get1Value());
+ aRow.push_back(new ORowSetValueDecorator((sal_Int32)ColumnSearch::CHAR));
+ aRow.push_back(ODatabaseMetaDataResultSet::get1Value());
+ aRow.push_back(ODatabaseMetaDataResultSet::get0Value());
+ aRow.push_back(ODatabaseMetaDataResultSet::get0Value());
+ aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
+ aRow.push_back(ODatabaseMetaDataResultSet::get0Value());
+ aRow.push_back(ODatabaseMetaDataResultSet::get0Value());
+ aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
+ aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
+ aRow.push_back(new ORowSetValueDecorator((sal_Int32)10));
+
+ aRows.push_back(aRow);
+
+ aRow[1] = new ORowSetValueDecorator(::rtl::OUString::createFromAscii("VARCHAR"));
+ aRow[2] = new ORowSetValueDecorator(DataType::VARCHAR);
+ aRow[4] = ODatabaseMetaDataResultSet::getQuoteValue();
+ aRow[5] = ODatabaseMetaDataResultSet::getQuoteValue();
+ aRows.push_back(aRow);
+
+
+ aRow[1] = new ORowSetValueDecorator(::rtl::OUString::createFromAscii("LONGVARCHAR"));
+ aRow[2] = new ORowSetValueDecorator(DataType::LONGVARCHAR);
+ aRow[3] = new ORowSetValueDecorator((sal_Int32)65535);
+ aRow[4] = ODatabaseMetaDataResultSet::getQuoteValue();
+ aRow[5] = ODatabaseMetaDataResultSet::getQuoteValue();
+ aRows.push_back(aRow);
+
+ aRow[1] = new ORowSetValueDecorator(::rtl::OUString::createFromAscii("DATE"));
+ aRow[2] = new ORowSetValueDecorator(DataType::DATE);
+ aRow[3] = new ORowSetValueDecorator((sal_Int32)10);
+ aRow[4] = ODatabaseMetaDataResultSet::getQuoteValue();
+ aRow[5] = ODatabaseMetaDataResultSet::getQuoteValue();
+ aRows.push_back(aRow);
+
+ aRow[1] = new ORowSetValueDecorator(::rtl::OUString::createFromAscii("TIME"));
+ aRow[2] = new ORowSetValueDecorator(DataType::TIME);
+ aRow[3] = new ORowSetValueDecorator((sal_Int32)8);
+ aRow[4] = ODatabaseMetaDataResultSet::getQuoteValue();
+ aRow[5] = ODatabaseMetaDataResultSet::getQuoteValue();
+ aRows.push_back(aRow);
+
+ aRow[1] = new ORowSetValueDecorator(::rtl::OUString::createFromAscii("TIMESTAMP"));
+ aRow[2] = new ORowSetValueDecorator(DataType::TIMESTAMP);
+ aRow[3] = new ORowSetValueDecorator((sal_Int32)19);
+ aRow[4] = ODatabaseMetaDataResultSet::getQuoteValue();
+ aRow[5] = ODatabaseMetaDataResultSet::getQuoteValue();
+ aRows.push_back(aRow);
+
+ aRow[1] = new ORowSetValueDecorator(::rtl::OUString::createFromAscii("BOOL"));
+ aRow[2] = new ORowSetValueDecorator(DataType::BIT);
+ aRow[3] = ODatabaseMetaDataResultSet::get1Value();
+ aRow[9] = ODatabaseMetaDataResultSet::getBasicValue();
+ aRows.push_back(aRow);
+
+ aRow[1] = new ORowSetValueDecorator(::rtl::OUString::createFromAscii("DECIMAL"));
+ aRow[2] = new ORowSetValueDecorator(DataType::DECIMAL);
+ aRow[3] = new ORowSetValueDecorator((sal_Int32)20);
+ aRow[15] = new ORowSetValueDecorator((sal_Int32)15);
+ aRows.push_back(aRow);
+
+ aRow[1] = new ORowSetValueDecorator(::rtl::OUString::createFromAscii("DOUBLE"));
+ aRow[2] = new ORowSetValueDecorator(DataType::DOUBLE);
+ aRow[3] = new ORowSetValueDecorator((sal_Int32)20);
+ aRow[15] = ODatabaseMetaDataResultSet::get0Value();
+ aRows.push_back(aRow);
+
+ aRow[1] = new ORowSetValueDecorator(::rtl::OUString::createFromAscii("NUMERIC"));
+ aRow[2] = new ORowSetValueDecorator(DataType::NUMERIC);
+ aRow[3] = new ORowSetValueDecorator((sal_Int32)20);
+ aRow[15] = new ORowSetValueDecorator((sal_Int32)20);
+ aRows.push_back(aRow);
+ }
+
+ pResult->setRows(aRows);
+ return xRef;
+}
+// -------------------------------------------------------------------------
+Reference< XResultSet > SAL_CALL OEvoabDatabaseMetaData::getColumns(
+ const Any& /*catalog*/, const ::rtl::OUString& /*schemaPattern*/, const ::rtl::OUString& tableNamePattern,
+ const ::rtl::OUString& columnNamePattern ) throw(SQLException, RuntimeException)
+{
+ OSL_TRACE("OEvoabDatabaseMetaData::getColumns()::Entered\n");
+ EVO_TRACE_STRING("OEvoabDatabaseMetaData::getColumns()::schemaPattern = %s\n", schemaPattern );
+ EVO_TRACE_STRING("OEvoabDatabaseMetaData::getColumns()::tableNamePattern = %s\n", tableNamePattern );
+ EVO_TRACE_STRING("OEvoabDatabaseMetaData::getColumns()::columnNamePattern = %s\n", columnNamePattern );
+
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ Reference< XTablesSupplier > xTables = m_pConnection->createCatalog();
+ if(!xTables.is())
+ throw SQLException();
+
+ Reference< XNameAccess> xNames = xTables->getTables();
+ if(!xNames.is())
+ throw SQLException();
+
+ ODatabaseMetaDataResultSet::ORows aRows;
+ ODatabaseMetaDataResultSet::ORow aRow(19);
+ aRow[10] = new ORowSetValueDecorator((sal_Int32)10);
+ Sequence< ::rtl::OUString> aTabNames(xNames->getElementNames());
+ const ::rtl::OUString* pTabBegin = aTabNames.getConstArray();
+ const ::rtl::OUString* pTabEnd = pTabBegin + aTabNames.getLength();
+ for(;pTabBegin != pTabEnd;++pTabBegin)
+ {
+ if(match(tableNamePattern,*pTabBegin,'\0'))
+ {
+ Reference< XColumnsSupplier> xTable;
+ ::cppu::extractInterface(xTable,xNames->getByName(*pTabBegin));
+ aRow[3] = new ORowSetValueDecorator(*pTabBegin);
+
+ Reference< XNameAccess> xColumns = xTable->getColumns();
+ if(!xColumns.is())
+ throw SQLException();
+
+ Sequence< ::rtl::OUString> aColNames(xColumns->getElementNames());
+
+ const ::rtl::OUString* pBegin = aColNames.getConstArray();
+ const ::rtl::OUString* pEnd = pBegin + aColNames.getLength();
+ Reference< XPropertySet> xColumn;
+ for(sal_Int32 i=1;pBegin != pEnd;++pBegin,++i)
+ {
+ if(match(columnNamePattern,*pBegin,'\0'))
+ {
+ aRow[4] = new ORowSetValueDecorator(*pBegin);
+
+ ::cppu::extractInterface(xColumn,xColumns->getByName(*pBegin));
+ OSL_ENSURE(xColumn.is(),"Columns contains a column who isn't a fastpropertyset!");
+ aRow[5] = new ORowSetValueDecorator(getINT32(xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE))));
+ aRow[6] = new ORowSetValueDecorator(getString(xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPENAME))));
+ aRow[7] = new ORowSetValueDecorator(getINT32(xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PRECISION))));
+ aRow[9] = new ORowSetValueDecorator(getINT32(xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCALE))));
+ aRow[11] = new ORowSetValueDecorator(getINT32(xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISNULLABLE))));
+ aRow[13] = new ORowSetValueDecorator(getString(xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DEFAULTVALUE))));
+
+ switch((sal_Int32)aRow[5]->getValue())
+ {
+ case DataType::CHAR:
+ case DataType::VARCHAR:
+ aRow[16] = new ORowSetValueDecorator((sal_Int32)254);
+ break;
+ case DataType::LONGVARCHAR:
+ aRow[16] = new ORowSetValueDecorator((sal_Int32)65535);
+ break;
+ default:
+ aRow[16] = new ORowSetValueDecorator((sal_Int32)0);
+ }
+ aRow[17] = new ORowSetValueDecorator(i);
+ switch(sal_Int32(aRow[11]->getValue()))
+ {
+ case ColumnValue::NO_NULLS:
+ aRow[18] = new ORowSetValueDecorator(::rtl::OUString::createFromAscii("NO"));
+ break;
+ case ColumnValue::NULLABLE:
+ aRow[18] = new ORowSetValueDecorator(::rtl::OUString::createFromAscii("YES"));
+ break;
+ default:
+ aRow[18] = new ORowSetValueDecorator(::rtl::OUString());
+ }
+ aRows.push_back(aRow);
+ }
+ }
+ }
+ }
+
+ ::connectivity::ODatabaseMetaDataResultSet* pResult = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eColumns);
+ Reference< XResultSet > xRef = pResult;
+ pResult->setRows(aRows);
+
+ return xRef;
+}
+// -------------------------------------------------------------------------
+::rtl::OUString SAL_CALL OEvoabDatabaseMetaData::getURL( ) throw(SQLException, RuntimeException)
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+ return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("sdbc:flat:")) + m_pConnection->getURL();
+}
+// -------------------------------------------------------------------------
+Reference< XResultSet > SAL_CALL OEvoabDatabaseMetaData::getTables(
+ const Any& /*catalog*/, const ::rtl::OUString& /*schemaPattern*/,
+ const ::rtl::OUString& /*tableNamePattern*/, const Sequence< ::rtl::OUString >& types ) throw(SQLException, RuntimeException)
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+
+ ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(ODatabaseMetaDataResultSet::eTables);
+ Reference< XResultSet > xRef = pResult;
+
+ // check if any type is given
+ // when no types are given then we have to return all tables e.g. TABLE
+
+ static const ::rtl::OUString aTable(::rtl::OUString::createFromAscii("TABLE"));
+
+ sal_Bool bTableFound = sal_True;
+ sal_Int32 nLength = types.getLength();
+ if(nLength)
+ {
+ bTableFound = sal_False;
+
+ const ::rtl::OUString* pBegin = types.getConstArray();
+ const ::rtl::OUString* pEnd = pBegin + nLength;
+ for(;pBegin != pEnd;++pBegin)
+ {
+ if(*pBegin == aTable)
+ {
+ bTableFound = sal_True;
+ break;
+ }
+ }
+ }
+ if(!bTableFound)
+ return xRef;
+
+ OEvoabConnection* pOEvoabConnection = (OEvoabConnection*)m_pConnection;
+ OEvoabFolderList* pFolderList = new OEvoabFolderList( pOEvoabConnection );
+
+
+ ODatabaseMetaDataResultSet::ORows aRows;
+ sal_Bool bMoreData = sal_True;
+ ::rtl::OUString aName, aLocation;
+ sal_Int32 nCardsCount;
+
+ pFolderList->initializeRow(3);
+ bMoreData = pFolderList->first();
+ OSL_TRACE("OEvoabDatabaseMetaData::getTables()::first %d\n",bMoreData );
+ do
+ {
+ if(bMoreData)
+ bMoreData = pFolderList->getRow();
+ if(bMoreData)
+ {
+ aLocation = pFolderList->getString(1);
+ aName = pFolderList->getString(2);
+ nCardsCount = pFolderList->getInt(3);
+ EVO_TRACE_STRING( "OEvoabDatabaseMetaData::getTables()::aLocation = %s\n", aLocation );
+ EVO_TRACE_STRING( "OEvoabDatabaseMetaData::getTables()::aName = %s\n", aName );
+ OSL_TRACE("OEvoabDatabaseMetaData::getTables()::nCardsCount = %d\n", nCardsCount);
+
+ ODatabaseMetaDataResultSet::ORow aRow(3);
+ aRow.reserve(6);
+ aRow.push_back(new ORowSetValueDecorator(aName));
+ aRow.push_back(new ORowSetValueDecorator(aTable));
+ aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
+ aRows.push_back(aRow);
+
+ ::rtl::OUString aWorkingDir = pOEvoabConnection->getDriver()->getWorkingDirPath();
+ ::rtl::OUString aCLICommand = pOEvoabConnection->getDriver()->getEvoab_CLI_EffectiveCommand();
+ ::rtl::OUString aArg1 = aLocation;
+ ::rtl::OUString aArg2 = ::rtl::OUString::createFromAscii(pOEvoabConnection->getDriver()->getEVOAB_CLI_ARG_OUTPUT_FILE_PREFIX());
+ aArg2 += aWorkingDir;
+ aArg2 += aName;
+ aArg2 += ::rtl::OUString::createFromAscii(".");
+ aArg2 += ::rtl::OUString(pOEvoabConnection->getExtension());
+ ::rtl::OUString aArg3 = ::rtl::OUString::createFromAscii(pOEvoabConnection->getDriver()->getEVOAB_CLI_ARG_OUTPUT_FORMAT());
+
+ OArgumentList aArgs(3,&aArg1,&aArg2,&aArg3);
+
+ EVO_TRACE_STRING( "OEvoabDatabaseMetaData::getTables()::aCLICommand = %s\n", aCLICommand );
+ EVO_TRACE_STRING( "OEvoabDatabaseMetaData::getTables()::aWorkingDir = %s\n", aWorkingDir );
+ EVO_TRACE_STRING( "OEvoabDatabaseMetaData::getTables()::aArg1 = %s\n", aArg1 );
+ EVO_TRACE_STRING( "OEvoabDatabaseMetaData::getTables()::aArg2 = %s\n", aArg2 );
+ EVO_TRACE_STRING( "OEvoabDatabaseMetaData::getTables()::aArg3 = %s\n", aArg3 );
+
+ OProcess aApp( aCLICommand,aWorkingDir);
+ OSL_VERIFY_EQUALS(
+ aApp.execute( (OProcess::TProcessOption)(OProcess::TOption_Hidden | OProcess::TOption_Wait | OProcess::TOption_SearchPath),aArgs),
+ OProcess::E_None,
+ "Error at execute evolution-addressbook-exporter to get VCards" );
+
+ bMoreData = pFolderList->next();
+ }
+ }
+ while ( bMoreData );
+
+ delete pFolderList;
+ pFolderList = NULL;
+
+ pResult->setRows(aRows);
+
+ return xRef;
+}
diff --git a/connectivity/source/drivers/evoab/LDatabaseMetaData.hxx b/connectivity/source/drivers/evoab/LDatabaseMetaData.hxx
new file mode 100644
index 0000000000..7e60ece946
--- /dev/null
+++ b/connectivity/source/drivers/evoab/LDatabaseMetaData.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: LDatabaseMetaData.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 _CONNECTIVITY_EVOAB_LDATABASEMETADATA_HXX_
+#define _CONNECTIVITY_EVOAB_LDATABASEMETADATA_HXX_
+
+#include "file/FDatabaseMetaData.hxx"
+#include "FDatabaseMetaDataResultSet.hxx"
+
+namespace connectivity
+{
+ namespace evoab
+ {
+ //**************************************************************
+ //************ Class: java.sql.DatabaseMetaDataDate
+ //**************************************************************
+
+ class OEvoabDatabaseMetaData : public file::ODatabaseMetaData
+ {
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > impl_getTypeInfo_throw();
+ virtual ::rtl::OUString SAL_CALL getURL( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getColumns( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern, const ::rtl::OUString& columnNamePattern ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getTables( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& types ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+ protected:
+ virtual ~OEvoabDatabaseMetaData();
+ public:
+ OEvoabDatabaseMetaData(file::OConnection* _pCon);
+ };
+ }
+}
+#endif // _CONNECTIVITY_EVOAB_LDATABASEMETADATA_HXX_
+
diff --git a/connectivity/source/drivers/evoab/LDebug.cxx b/connectivity/source/drivers/evoab/LDebug.cxx
new file mode 100644
index 0000000000..0d0fd4ea8f
--- /dev/null
+++ b/connectivity/source/drivers/evoab/LDebug.cxx
@@ -0,0 +1,45 @@
+/*************************************************************************
+ *
+ * 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: LDebug.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.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_connectivity.hxx"
+
+#ifndef CONNECTIVITY_EVOAB_DEBUG_HELPER_HXX
+#include "LDebug.hxx"
+#endif
+#include <osl/diagnose.h>
+
+void evo_traceStringMessage( const sal_Char* _pFormat, const ::rtl::OUString& _rAsciiString )
+{
+ ::rtl::OString sByteStringMessage( _rAsciiString.getStr(), _rAsciiString.getLength(), RTL_TEXTENCODING_ASCII_US );
+ if ( !sByteStringMessage.getLength() )
+ sByteStringMessage = "<empty>";
+ OSL_TRACE( _pFormat, sByteStringMessage.getStr() );
+}
diff --git a/svx/inc/svx/sdr/overlay/overlaylinestriped.hxx b/connectivity/source/drivers/evoab/LDebug.hxx
index 55923aebd4..10138f73e8 100644
--- a/svx/inc/svx/sdr/overlay/overlaylinestriped.hxx
+++ b/connectivity/source/drivers/evoab/LDebug.hxx
@@ -6,8 +6,8 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: overlaylinestriped.hxx,v $
- * $Revision: 1.3 $
+ * $RCSfile: LDebug.hxx,v $
+ * $Revision: 1.5 $
*
* This file is part of OpenOffice.org.
*
@@ -28,22 +28,18 @@
*
************************************************************************/
-#ifndef _SDR_OVERLAY_OVERLAYLINESTRIPED_HXX
-#define _SDR_OVERLAY_OVERLAYLINESTRIPED_HXX
+#ifndef CONNECTIVITY_EVOAB_DEBUG_HELPER_HXX
+#define CONNECTIVITY_EVOAB_DEBUG_HELPER_HXX
-#include <svx/sdr/overlay/overlayline.hxx>
+#include <rtl/ustring.hxx>
-//////////////////////////////////////////////////////////////////////////////
+#ifdef _DEBUG
+ void evo_traceStringMessage( const sal_Char* _pFormat, const ::rtl::OUString& _rAsciiString );
-namespace sdr
-{
- namespace overlay
- {
- } // end of namespace overlay
-} // end of namespace sdr
+ #define EVO_TRACE_STRING( pFormat, rAsciiString ) evo_traceStringMessage( pFormat, rAsciiString )
+#else
+ #define EVO_TRACE_STRING( pFormat, rAsciiString ) (void)(0)
+#endif
-//////////////////////////////////////////////////////////////////////////////
-#endif //_SDR_OVERLAY_OVERLAYLINESTRIPED_HXX
-
-// eof
+#endif // CONNECTIVITY_EVOAB_DEBUG_HELPER_HXX
diff --git a/connectivity/source/drivers/evoab/LDriver.cxx b/connectivity/source/drivers/evoab/LDriver.cxx
new file mode 100644
index 0000000000..bc11ee5395
--- /dev/null
+++ b/connectivity/source/drivers/evoab/LDriver.cxx
@@ -0,0 +1,508 @@
+/*************************************************************************
+ *
+ * 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: LDriver.cxx,v $
+ * $Revision: 1.10.42.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.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_connectivity.hxx"
+#include "LDriver.hxx"
+#include "LConnection.hxx"
+#include <com/sun/star/lang/DisposedException.hpp>
+#include "connectivity/dbexception.hxx"
+#include "LConfigAccess.hxx"
+#include <osl/file.hxx>
+#include "osl/security.hxx"
+#include <comphelper/processfactory.hxx>
+#include <com/sun/star/ucb/XCommandEnvironment.hpp>
+#include <ucbhelper/content.hxx>
+#include <tools/debug.hxx>
+#include "resource/common_res.hrc"
+#include "resource/sharedresources.hxx"
+#include "LDebug.hxx"
+
+using namespace osl;
+using namespace connectivity::evoab;
+using namespace connectivity::file;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::sdbcx;
+using namespace ::com::sun::star::sdbc;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::ucb;
+
+// --------------------------------------------------------------------------------
+OEvoabDriver::OEvoabDriver(const Reference< XMultiServiceFactory >& _rxFactory) : OFileDriver(_rxFactory)
+ ,m_aTempDir(NULL, sal_True)
+ ,m_aFolderListName(::rtl::OUString::createFromAscii(getEVOAB_FOLDERLIST_FILE_NAME()))
+ ,m_aVersionName(::rtl::OUString::createFromAscii(getEVOAB_VERSION_FILE_NAME()))
+ ,m_aFileExt(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(getEVOAB_META_FILE_EXT())))
+ ,m_bWorkingDirCreated(sal_False)
+ ,m_eSupportedEvoVersion( eUnknown )
+{
+ m_aEvoab_CLI_FullPathCommand = getFullPathExportingCommand(_rxFactory);
+
+ if ( m_aEvoab_CLI_FullPathCommand.getLength() == 0 )
+ m_aEvoab_CLI_FullPathCommand = ::rtl::OUString::createFromAscii(getEVOAB_CLI_FULLPATHCOMMAND());
+ if ( m_aEvoab_CLI_FullPathCommand.copy(0,7) != ::rtl::OUString::createFromAscii("file://") && m_aEvoab_CLI_FullPathCommand.copy(0,1) == ::rtl::OUString::createFromAscii("/"))
+ m_aEvoab_CLI_FullPathCommand = ::rtl::OUString::createFromAscii("file://") + m_aEvoab_CLI_FullPathCommand;
+ m_aEvoab_CLI_EffectiveCommand = m_aEvoab_CLI_FullPathCommand;
+ m_aTempDir.EnableKillingFile();
+
+ EVO_TRACE_STRING("OEvoabDriver::OEvoabDriver()::m_aEvoab_CLI_FullPathCommand = %s", m_aEvoab_CLI_FullPathCommand );
+}
+// static ServiceInfo
+//------------------------------------------------------------------------------
+rtl::OUString OEvoabDriver::getImplementationName_Static( ) throw(RuntimeException)
+{
+ return rtl::OUString::createFromAscii(EVOAB_DRIVER_IMPL_NAME);
+}
+
+//------------------------------------------------------------------
+::rtl::OUString SAL_CALL OEvoabDriver::getImplementationName( ) throw(RuntimeException)
+{
+ return getImplementationName_Static();
+}
+
+//------------------------------------------------------------------
+::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL connectivity::evoab::OEvoabDriver_CreateInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory) throw( ::com::sun::star::uno::Exception )
+{
+ return *(new OEvoabDriver(_rxFactory));
+}
+// --------------------------------------------------------------------------------
+Reference< XConnection > SAL_CALL OEvoabDriver::connect( const ::rtl::OUString& url, const Sequence< PropertyValue >& info ) throw(SQLException, RuntimeException)
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+ if (ODriver_BASE::rBHelper.bDisposed)
+ throw DisposedException();
+
+ if ( ! acceptsURL(url) )
+ return NULL;
+
+ OEvoabConnection* pCon = new OEvoabConnection(this);
+ pCon->construct(url,info);
+ Reference< XConnection > xCon = pCon;
+ m_xConnections.push_back(WeakReferenceHelper(*pCon));
+
+ return xCon;
+}
+// --------------------------------------------------------------------------------
+namespace
+{
+ ::rtl::OUString lcl_translateProcessErrorMessage( oslProcessError nProcErr)
+ {
+ ::rtl::OUString sProcErr = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" not executed!."));
+ switch (nProcErr)
+ {
+ case osl_Process_E_None:
+ sProcErr = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" executed sucessful!"));
+ break;
+ case osl_Process_E_NotFound:
+ sProcErr = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" executed failed: not found!"));
+ break;
+ case osl_Process_E_NoPermission:
+ sProcErr = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" executed failed: has no permission!"));
+ break;
+ case osl_Process_E_TimedOut:
+ sProcErr = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" executed failed: time out!"));
+ break;
+ case osl_Process_E_Unknown:
+ sProcErr = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" executed failed: unkown reason!"));
+ break;
+ case osl_Process_E_InvalidError:
+ sProcErr = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" executed failed: invalid error!"));
+ break;
+ default:
+ sProcErr = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" executed failed: other reason!"));
+ }
+ return sProcErr;
+ }
+ oslProcessError lcl_execute( const ::rtl::OUString& _rCommand, ::rtl::OUString& _rArgument,
+ const ::rtl::OUString& _rWorkingDir, oslProcessOption _nOptions, oslFileHandle& /*[out]*/ _hStdOut )
+ {
+ oslProcessError nError = osl_Process_E_None;
+
+ EVO_TRACE_STRING("LDriver.cxx::lcl_execute: command : %s", _rCommand );
+ EVO_TRACE_STRING("LDriver.cxx::lcl_execute: argument : %s", _rArgument );
+ EVO_TRACE_STRING("LDriver.cxx::lcl_execute: working dir: %s", _rWorkingDir );
+
+ oslProcess hProcess( 0 );
+
+ nError = osl_executeProcess_WithRedirectedIO(
+ _rCommand.pData,
+ &_rArgument.pData,
+ 1,
+ _nOptions,
+ 0,
+ _rWorkingDir.pData,
+ 0,
+ 0,
+ &hProcess,
+ NULL,
+ &_hStdOut,
+ NULL
+ );
+ ::rtl::OUString sError = _rCommand + lcl_translateProcessErrorMessage( nError);
+ EVO_TRACE_STRING( "%s", sError );
+
+ if ( nError == osl_Process_E_None )
+ {
+ TimeValue aFiveSeconds;
+ aFiveSeconds.Seconds = 5;
+ aFiveSeconds.Nanosec = 0;
+ oslProcessError nWaitForProcessError = osl_joinProcessWithTimeout( hProcess, &aFiveSeconds );
+ if ( osl_Process_E_None != nWaitForProcessError )
+ {
+ nError = nWaitForProcessError;
+ // TODO: kill the running process?
+ }
+ osl_freeProcessHandle( hProcess );
+ }
+ return nError;
+ }
+}
+
+// --------------------------------------------------------------------------------
+sal_Bool SAL_CALL OEvoabDriver::acceptsURL( const ::rtl::OUString& url )
+ throw(SQLException, RuntimeException)
+{
+ sal_Bool bRet;
+ bRet = sal_False;
+ // here we have to look if we support this url format
+ if(acceptsURL_Stat(url))
+ {
+ if ( m_eSupportedEvoVersion != eUnknown )
+ return m_eSupportedEvoVersion == eTrue ? sal_True : sal_False;
+
+ if(!m_bWorkingDirCreated)
+ {
+ String sTempDirURL = getTempDirURL();
+ //EVO_TRACE_STRING("OEvoabDriver::acceptsURL()::sTempDirURL = %s", sTempDirURL );
+
+ ::rtl::OUString aTempDirURL(sTempDirURL);
+ m_aWorkingDirURL = aTempDirURL;
+ m_bWorkingDirCreated = sal_True;
+ }
+
+ ::rtl::OUString aCLICommand = getEvoab_CLI_EffectiveCommand();
+ ::rtl::OUString aWorkingDirURL = getWorkingDirURL();
+ ::rtl::OUString aArgVersion = ::rtl::OUString::createFromAscii(getEVOAB_CLI_ARG_VERSION());
+
+ oslFileHandle hStdout = NULL;
+ oslProcessError nProcErr = lcl_execute( aCLICommand, aArgVersion, aWorkingDirURL, 0, hStdout );
+ if(nProcErr != osl_Process_E_None)
+ {
+ if(doesEvoab_CLI_HavePath())
+ aCLICommand = getEvoab_CLI_Command();
+ else
+ aCLICommand = getEvoab_CLI_Path() + getEvoab_CLI_Command();
+ nProcErr = lcl_execute( aCLICommand, aArgVersion, aWorkingDirURL, osl_Process_SEARCHPATH | osl_Process_HIDDEN, hStdout );
+ if ( nProcErr == osl_Process_E_None )
+ m_aEvoab_CLI_EffectiveCommand = aCLICommand;
+ }
+
+ if ( hStdout != NULL )
+ {
+ OSL_ASSERT( hStdout );
+ sal_Char pBuffer[256];
+ sal_uInt64 nBytesRead;
+ oslFileError nFileErr = osl_File_E_None;
+ nFileErr = osl_readFile( hStdout, pBuffer, 256, &nBytesRead);
+ if ( nFileErr != osl_File_E_None )
+ {
+ ::rtl::OUString sErr = translateFileErrorMessage( nFileErr);
+ OSL_ENSURE(false, ::rtl::OUStringToOString( sErr, RTL_TEXTENCODING_ASCII_US ).getStr());
+ }
+ ::rtl::OUString aVersionInfo;
+ if ( nFileErr == osl_File_E_None && nBytesRead > 0 && nBytesRead <= 256)
+ {
+ OSL_TRACE("OEvoabDriver::acceptsURL()::osl_readFile(),nBytesRead = %u",nBytesRead);
+ aVersionInfo =
+ ::rtl::OUString( ( const sal_Char * )pBuffer,
+ (sal_Int32)nBytesRead,
+ RTL_TEXTENCODING_UTF8 );
+ EVO_TRACE_STRING("OEvoabDriver::acceptsURL()::aVersionInfo = %s", aVersionInfo );
+ sal_Int32 nIndex = 0;
+ sal_Bool bNumRetrieved = sal_False;
+ ::rtl::OUString aToken;
+ sal_Int32 aVer[4];
+ sal_Int32 i;
+ for ( i = 0; i < 4; i++ )
+ aVer[i] = 0;
+ do
+ {
+ aToken = aVersionInfo.getToken( 0, ' ', nIndex );
+ //OSL_TRACE("OEvoabDriver::acceptsURL()::Token:%d", nIndex );
+ //EVO_TRACE_STRING("OEvoabDriver::acceptsURL()::aToken = %s", aToken );
+ if( aToken.toChar() >= '0' && aToken.toChar() <= '9' )
+ {
+ bNumRetrieved = sal_True;
+ sal_Int32 nIndex1 = 0;
+ ::rtl::OUString aNum;
+ for(i = 0; i < 4 ; i++)
+ {
+ if( nIndex1 >= 0 )
+ {
+ aNum = aToken.getToken( 0, '.', nIndex1);
+ aVer[i] = aNum.toInt32();
+ OSL_TRACE("OEvoabDriver::acceptsURL()::Ver[%u]=%u", i, aVer[i] );
+ }
+ }
+ }
+ }
+ while ( nIndex >= 0 && !bNumRetrieved );
+
+ if((aVer[0]>1)||(aVer[0]==1 && aVer[1]>3)||(aVer[0]==1 && aVer[1]==3 && aVer[2]>2)||(aVer[0]==1 && aVer[1]==3 && aVer[2]==2 && aVer[3]>=99))
+ bRet = sal_True;
+ else
+ bRet = sal_False;
+ }
+ else
+ bRet = sal_False;
+
+ osl_closeFile( hStdout );
+ }
+ m_eSupportedEvoVersion = bRet ? eTrue : eFalse;
+ }
+ EVO_TRACE_STRING("OEvoabDriver::acceptsURL()::return, return value = %s", ::rtl::OUString::valueOf(bRet) );
+ return bRet;
+}
+
+
+// --------------------------------------------------------------------------------
+sal_Bool OEvoabDriver::acceptsURL_Stat( const ::rtl::OUString& url )
+{
+
+ EVO_TRACE_STRING("OEvoabDriver::acceptsURL_Stat()::Scheme = %s", url );
+ // Skip 'sdbc:address: part of URL
+ //
+ sal_Int32 nLen = url.indexOf(':');
+ nLen = url.indexOf(':',nLen+1);
+ ::rtl::OUString aAddrbookURI(url.copy(nLen+1));
+
+ // Get Scheme
+ nLen = aAddrbookURI.indexOf(':');
+ ::rtl::OUString aAddrbookScheme;
+ if ( nLen == -1 )
+ {
+ // There isn't any subschema: - but could be just subschema
+ if ( aAddrbookURI.getLength() > 0 )
+ aAddrbookScheme= aAddrbookURI;
+ else if(url == ::rtl::OUString::createFromAscii("sdbc:address:") )
+ return sal_True; // special case here
+ else
+ return sal_False;
+ }
+ else
+ aAddrbookScheme = aAddrbookURI.copy(0, nLen);
+
+
+ EVO_TRACE_STRING("OEvoabDriver::acceptsURL_Stat()::URI = %s", aAddrbookURI );
+ EVO_TRACE_STRING("OEvoabDriver::acceptsURL_Stat()::Scheme = %s", aAddrbookScheme );
+
+ return aAddrbookScheme.compareToAscii( getSDBC_SCHEME_EVOLUTION() ) == 0 ;
+}
+// -------------------------------------------------------------------------
+const rtl::OUString OEvoabDriver::getEvoab_CLI_Command() const
+{
+ rtl::OUString aEvoab_CLI_Command;
+ sal_Int32 nLen = m_aEvoab_CLI_FullPathCommand.lastIndexOf('/');
+
+ if ( nLen == -1 )
+ aEvoab_CLI_Command = m_aEvoab_CLI_FullPathCommand;
+ else
+ aEvoab_CLI_Command = m_aEvoab_CLI_FullPathCommand.copy(nLen+1);
+
+ EVO_TRACE_STRING( "OEvoabDriver::getEvoab_CLI_Command()::aEvoab_CLI_Command = %s", aEvoab_CLI_Command );
+
+ return aEvoab_CLI_Command;
+}
+// -------------------------------------------------------------------------
+const rtl::OUString OEvoabDriver::getEvoab_CLI_Path() const
+{
+ rtl::OUString aEvoab_CLI_Path;
+ sal_Int32 nLen = m_aEvoab_CLI_FullPathCommand.lastIndexOf('/');
+
+ if ( nLen == -1 )
+ {
+ rtl::OUString aDefault_CLI_FullPathCommand;
+ aDefault_CLI_FullPathCommand = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(OEvoabDriver::getEVOAB_CLI_FULLPATHCOMMAND()));
+ sal_Int32 nLength = aDefault_CLI_FullPathCommand.lastIndexOf('/');
+ aEvoab_CLI_Path = aDefault_CLI_FullPathCommand.copy(0, nLength+1);
+ }
+ else
+ aEvoab_CLI_Path = m_aEvoab_CLI_FullPathCommand.copy(0, nLen+1);
+ EVO_TRACE_STRING( "OEvoabDriver::getEvoab_CLI_Path()::aEvoab_CLI_Path = %s", aEvoab_CLI_Path );
+
+ return aEvoab_CLI_Path;
+}
+// -------------------------------------------------------------------------
+const rtl::OUString OEvoabDriver::getWorkingDirPath() const
+{
+ ::rtl::OUString aWorkingDirPath;
+ if(m_bWorkingDirCreated)
+ osl::File::getSystemPathFromFileURL( m_aWorkingDirURL, aWorkingDirPath );
+ return aWorkingDirPath;
+}
+// -------------------------------------------------------------------------
+const String OEvoabDriver::getEvoFolderListFileURL() const
+{
+
+ ::rtl::OUString aEvoFolderListFileURL;
+ aEvoFolderListFileURL = getWorkingDirURL() + getEvoFolderListFileName();
+
+ EVO_TRACE_STRING("OEvoabDriver::getEvoFolderListFileURL(): aEvoFolderListFileURL = %s", aEvoFolderListFileURL );
+ return aEvoFolderListFileURL.getStr();
+}
+
+// -------------------------------------------------------------------------
+String OEvoabDriver::getTempDirURL() const
+{
+ ::rtl::OUString aTempDirURL;
+ aTempDirURL = m_aTempDir.GetURL();
+ if((aTempDirURL.lastIndexOf( '/')) != (aTempDirURL.getLength( ) - 1))
+ aTempDirURL += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
+
+ EVO_TRACE_STRING("OEvoabDriver::getTempDirURL(): aTempDirURL = %s", aTempDirURL );
+ return aTempDirURL.getStr();
+}
+//-------------------------------------------------------------------------
+sal_Bool OEvoabDriver::fileExists(const ::rtl::OUString& _rURL, sal_Bool _bIsDir) const
+{
+ ::ucbhelper::Content aCheckExistence;
+ sal_Bool bExists = sal_False;
+ try
+ {
+ aCheckExistence = ::ucbhelper::Content(_rURL, Reference< XCommandEnvironment >());
+ if(_bIsDir)
+ bExists = aCheckExistence.isFolder();
+ else
+ bExists = aCheckExistence.isDocument();
+ }
+ catch(const Exception&) { }
+ return bExists;
+}
+
+// -----------------------------------------------------------------------------
+const sal_Char* OEvoabDriver::getSDBC_SCHEME_EVOLUTION()
+{
+ static const sal_Char* SDBC_SCHEME_EVOLUTION = EVOAB_EVOLUTION_SCHEMA;
+ return SDBC_SCHEME_EVOLUTION;
+}
+const sal_Char* OEvoabDriver::getEVOAB_FOLDERLIST_FILE_NAME()
+{
+ static const sal_Char* EVOAB_FOLDERLIST_FILE_NAME = "FolderList";
+ return EVOAB_FOLDERLIST_FILE_NAME;
+}
+const sal_Char* OEvoabDriver::getEVOAB_VERSION_FILE_NAME()
+{
+ static const sal_Char* EVOAB_VERSION_FILE_NAME = "EvoVersion";
+ return EVOAB_VERSION_FILE_NAME;
+}
+const sal_Char* OEvoabDriver::getEVOAB_META_FILE_EXT()
+{
+ static const sal_Char* EVOAB_META_FILE_EXT = "csv";
+ return EVOAB_META_FILE_EXT;
+}
+const sal_Char* OEvoabDriver::getEVOAB_CLI_FULLPATHCOMMAND()
+{
+ static const sal_Char* EVOAB_CLI_FULLPATHCOMMAND = "file:///home/evoab/extra/share/evolution/*/tools/evolution-addressbook-export";
+ return EVOAB_CLI_FULLPATHCOMMAND;
+}
+const sal_Char* OEvoabDriver::getEVOAB_CLI_ARG_LIST_FOLDERS()
+{
+ static const sal_Char* EVOAB_CLI_ARG_LIST_FOLDERS = "-l";
+ return EVOAB_CLI_ARG_LIST_FOLDERS;
+}
+const sal_Char* OEvoabDriver::getEVOAB_CLI_ARG_OUTPUT_FILE_PREFIX()
+{
+ static const sal_Char* EVOAB_CLI_ARG_OUTPUT_FILE_PREFIX = "--output=";
+ return EVOAB_CLI_ARG_OUTPUT_FILE_PREFIX;
+}
+const sal_Char* OEvoabDriver::getEVOAB_CLI_ARG_OUTPUT_FORMAT()
+{
+ static const sal_Char* EVOAB_CLI_ARG_OUTPUT_FORMAT = "--format=csv";
+ return EVOAB_CLI_ARG_OUTPUT_FORMAT;
+}
+const sal_Char* OEvoabDriver::getEVOAB_CLI_ARG_VERSION()
+{
+ static const sal_Char* EVOAB_CLI_ARG_VERSION = "--version";
+ return EVOAB_CLI_ARG_VERSION;
+}
+const sal_Char* OEvoabDriver::getEVOAB_CLI_ARG_OUTPUT_REDIRECT()
+{
+ static const sal_Char* EVOAB_CLI_ARG_OUTPUT_REDIRECT = ">";
+ return EVOAB_CLI_ARG_OUTPUT_REDIRECT;
+}
+rtl::OUString OEvoabDriver::translateFileErrorMessage( oslFileError nFileErr)
+{
+ ::rtl::OUString sFileErr = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" no file operation!."));
+ switch (nFileErr)
+ {
+ case osl_File_E_None:
+ sFileErr = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" File operation succeeded!"));
+ break;
+ case osl_File_E_INVAL:
+ sFileErr = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" File operation failed: the format of the parameters was not valid!"));
+ break;
+ case osl_File_E_INTR:
+ sFileErr = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" File operation failed: function call was interrupted!"));
+ break;
+ case osl_File_E_IO:
+ sFileErr = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" File operation failed: I/O errors!"));
+ break;
+ case osl_File_E_ISDIR:
+ sFileErr = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" File operation failed: is a directory!"));
+ break;
+ case osl_File_E_BADF:
+ sFileErr = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" File operation failed: bad file!"));
+ break;
+ case osl_File_E_FAULT:
+ sFileErr = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" File operation failed: bad address!"));
+ break;
+ case osl_File_E_AGAIN:
+ sFileErr = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" File operation failed: operation would block!"));
+ break;
+ case osl_File_E_NOLINK:
+ sFileErr = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" File operation failed: link has been severed!"));
+ break;
+ default:
+ sFileErr = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" File operation failed: other reason!"));
+ }
+ return sFileErr;
+}
+// -----------------------------------------------------------------------------
+Sequence< DriverPropertyInfo > SAL_CALL OEvoabDriver::getPropertyInfo( const ::rtl::OUString& url, const Sequence< PropertyValue >& /*info*/ ) throw(SQLException, RuntimeException)
+{
+ if ( !acceptsURL(url) )
+ {
+ ::connectivity::SharedResources aResources;
+ const ::rtl::OUString sMessage = aResources.getResourceString(STR_URI_SYNTAX_ERROR);
+ ::dbtools::throwGenericSQLException(sMessage ,*this);
+ } // if ( !acceptsURL(url) )
+ return Sequence< DriverPropertyInfo >();
+}
diff --git a/connectivity/source/drivers/evoab/LDriver.hxx b/connectivity/source/drivers/evoab/LDriver.hxx
new file mode 100644
index 0000000000..b3c5df824d
--- /dev/null
+++ b/connectivity/source/drivers/evoab/LDriver.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: LDriver.hxx,v $
+ * $Revision: 1.6 $
+ *
+ * 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 _CONNECTIVITY_EVOAB_LDRIVER_HXX_
+#define _CONNECTIVITY_EVOAB_LDRIVER_HXX_
+
+#include <cppuhelper/compbase2.hxx>
+#include "connectivity/CommonTools.hxx"
+#include "file/FDriver.hxx"
+#include <unotools/tempfile.hxx>
+#include <osl/file.h>
+#include <osl/process.h>
+
+#define EVOAB_EVOLUTION_SCHEMA "evolution"
+#define EVOAB_LDAP_SCHEMA "ldap"
+#define EVOAB_DRIVER_IMPL_NAME "com.sun.star.comp.sdbc.evoab.OEvoabDriver"
+
+namespace connectivity
+{
+ namespace evoab
+ {
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL OEvoabDriver_CreateInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory) throw( ::com::sun::star::uno::Exception );
+
+ class OEvoabDriver : public file::OFileDriver
+ {
+ private:
+ enum MaybeVoidBool
+ {
+ eUnknown,
+ eTrue,
+ eFalse
+ };
+ ::utl::TempFile m_aTempDir;
+ rtl::OUString m_aFolderListName;
+ rtl::OUString m_aVersionName;
+ rtl::OUString m_aFileExt;
+ rtl::OUString m_aWorkingDirURL;
+ rtl::OUString m_aEvoab_CLI_EffectiveCommand;
+ rtl::OUString m_aEvoab_CLI_FullPathCommand;
+ sal_Bool m_bWorkingDirCreated;
+ MaybeVoidBool m_eSupportedEvoVersion;
+
+ sal_Bool fileExists(const ::rtl::OUString& _rURL, sal_Bool _bIsDir=sal_False) const;
+
+ public:
+ OEvoabDriver(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory);
+
+ inline rtl::OUString getEvoFolderListName() const { return m_aFolderListName;}
+ inline rtl::OUString getFileExt() const { return m_aFileExt;}
+ inline rtl::OUString getEvoFolderListFileName() const { return m_aFolderListName + ::rtl::OUString::createFromAscii(".") + m_aFileExt;}
+ inline rtl::OUString getEvoVersionFileName() const { return m_aVersionName + ::rtl::OUString::createFromAscii(".") + m_aFileExt;}
+ inline rtl::OUString getWorkingDirURL() const { return m_aWorkingDirURL;}
+ inline rtl::OUString getEvoab_CLI_FullPathCommand() const { return m_aEvoab_CLI_FullPathCommand;}
+ inline rtl::OUString getEvoab_CLI_EffectiveCommand() const { return m_aEvoab_CLI_EffectiveCommand;}
+ inline sal_Bool doesEvoab_CLI_HavePath() const { return m_aEvoab_CLI_FullPathCommand.lastIndexOf('/')!=-1;}
+ const rtl::OUString getEvoab_CLI_Command() const;
+ const rtl::OUString getEvoab_CLI_Path() const;
+ const rtl::OUString getWorkingDirPath() const;
+ const String getEvoFolderListFileURL() const;
+ String getTempDirURL() const;
+
+ // XInterface
+ ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
+ // XDriver
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > SAL_CALL connect( const ::rtl::OUString& url, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL acceptsURL( const ::rtl::OUString& url ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sdbc::DriverPropertyInfo > SAL_CALL getPropertyInfo( const ::rtl::OUString& url, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+
+
+ // static methods
+ static ::rtl::OUString getImplementationName_Static( ) throw(::com::sun::star::uno::RuntimeException);
+ static sal_Bool acceptsURL_Stat( const ::rtl::OUString& url );
+ static ::rtl::OUString translateProcessErrorMessage( oslProcessError nProcErr);
+ static ::rtl::OUString translateFileErrorMessage( oslFileError nFileErr);
+ static const sal_Char* getSDBC_SCHEME_EVOLUTION();
+ static const sal_Char* getEVOAB_FOLDERLIST_FILE_NAME();
+ static const sal_Char* getEVOAB_VERSION_FILE_NAME();
+ static const sal_Char* getEVOAB_META_FILE_EXT();
+ static const sal_Char* getEVOAB_CLI_FULLPATHCOMMAND();
+ static const sal_Char* getEVOAB_CLI_ARG_LIST_FOLDERS();
+ static const sal_Char* getEVOAB_CLI_ARG_OUTPUT_FILE_PREFIX();
+ static const sal_Char* getEVOAB_CLI_ARG_OUTPUT_FORMAT();
+ static const sal_Char* getEVOAB_CLI_ARG_VERSION();
+ static const sal_Char* getEVOAB_CLI_ARG_OUTPUT_REDIRECT();
+
+ };
+ }
+
+}
+#endif //_CONNECTIVITY_EVOAB_LDRIVER_HXX_
diff --git a/connectivity/source/drivers/evoab/LFolderList.cxx b/connectivity/source/drivers/evoab/LFolderList.cxx
new file mode 100644
index 0000000000..577d950ca6
--- /dev/null
+++ b/connectivity/source/drivers/evoab/LFolderList.cxx
@@ -0,0 +1,566 @@
+/*************************************************************************
+ *
+ * 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: LFolderList.cxx,v $
+ * $Revision: 1.15 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_connectivity.hxx"
+
+#include <ctype.h>
+#include <algorithm>
+#include "LFolderList.hxx"
+#include <com/sun/star/sdbc/ColumnValue.hpp>
+#include <com/sun/star/sdbc/DataType.hpp>
+#include <svtools/converter.hxx>
+#include "LConnection.hxx"
+#include "LColumns.hxx"
+#include <osl/thread.h>
+#include <tools/config.hxx>
+#include <comphelper/sequence.hxx>
+#include <svtools/zforlist.hxx>
+#include <rtl/math.hxx>
+#include <stdio.h> //sprintf
+#include <comphelper/extract.hxx>
+#include <comphelper/numbers.hxx>
+#include "LDriver.hxx"
+#include <com/sun/star/util/NumberFormat.hpp>
+#include <unotools/configmgr.hxx>
+#include <i18npool/mslangid.hxx>
+#include "connectivity/dbconversion.hxx"
+#include <comphelper/types.hxx>
+#include <unotools/ucbstreamhelper.hxx>
+#include <tools/debug.hxx>
+#include "connectivity/dbexception.hxx"
+#ifndef CONNECTIVITY_EVOAB_DEBUG_HELPER_HXX
+#include "LDebug.hxx"
+#endif
+#include <svtools/syslocale.hxx>
+
+using namespace ::comphelper;
+using namespace connectivity;
+using namespace connectivity::evoab;
+using namespace connectivity::file;
+using namespace ::cppu;
+using namespace utl;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::sdbcx;
+using namespace ::com::sun::star::sdbc;
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::lang;
+
+// -------------------------------------------------------------------------
+void OEvoabFolderList::fillColumns(const ::com::sun::star::lang::Locale& _aLocale)
+{
+ BOOL bRead = TRUE;
+
+ QuotedTokenizedString aHeaderLine;
+ OEvoabConnection* pConnection = (OEvoabConnection*)m_pConnection;
+
+ // read first row
+ QuotedTokenizedString aFirstLine;
+ bRead = m_pFileStream->ReadByteStringLine(aFirstLine,pConnection->getTextEncoding());
+
+ while(bRead && !aFirstLine.Len())
+ {
+ bRead = m_pFileStream->ReadByteStringLine(aFirstLine,pConnection->getTextEncoding());
+ }
+ // use first row as headerline because we need the number of columns
+ aHeaderLine = aFirstLine;
+
+ // column count
+ xub_StrLen nFieldCount = aHeaderLine.GetTokenCount(pConnection->getFieldDelimiter(),pConnection->getStringDelimiter());
+
+ if(!m_aColumns.isValid())
+ m_aColumns = new OSQLColumns();
+ else
+ m_aColumns->get().clear();
+
+ m_aTypes.clear();
+ m_aPrecisions.clear();
+ m_aScales.clear();
+ // reserve some space
+ m_aColumns->get().reserve(nFieldCount);
+ m_aTypes.reserve(nFieldCount);
+ m_aPrecisions.reserve(nFieldCount);
+ m_aScales.reserve(nFieldCount);
+
+ sal_Bool bCase = getConnection()->getMetaData()->storesMixedCaseQuotedIdentifiers();
+ CharClass aCharClass(pConnection->getDriver()->getFactory(),_aLocale);
+ // read description
+ sal_Unicode cDecimalDelimiter = pConnection->getDecimalDelimiter();
+ sal_Unicode cThousandDelimiter = pConnection->getThousandDelimiter();
+ String aColumnName;
+ ::rtl::OUString aTypeName;
+ ::comphelper::UStringMixEqual aCase(bCase);
+ xub_StrLen nStartPosFirstLine = 0; // use for eficient way to get the tokens
+ xub_StrLen nStartPosFirstLine2 = 0;
+ for (xub_StrLen i = 0; i < nFieldCount; i++)
+ {
+
+ // no column name so ...
+ aColumnName = 'C';
+ aColumnName += String::CreateFromInt32(i+1);
+
+ sal_Int32 eType;
+ UINT16 nPrecision = 0;
+ UINT16 nScale = 0;
+
+ BOOL bNumeric = FALSE;
+ ULONG nIndex = 0;
+
+ // first without fielddelimiter
+ String aField;
+ aFirstLine.GetTokenSpecial(aField,nStartPosFirstLine,pConnection->getFieldDelimiter(),'\0');
+ if (aField.Len() == 0 ||
+ (pConnection->getStringDelimiter() && pConnection->getStringDelimiter() == aField.GetChar(0)))
+ {
+ bNumeric = FALSE;
+ }
+ else
+ {
+ String aField2;
+ if ( pConnection->getStringDelimiter() != '\0' )
+ aFirstLine.GetTokenSpecial(aField2,nStartPosFirstLine2,pConnection->getFieldDelimiter(),pConnection->getStringDelimiter());
+ else
+ aField2 = aField;
+
+ if (aField2.Len() == 0)
+ {
+ bNumeric = FALSE;
+ }
+ else
+ {
+ bNumeric = TRUE;
+ xub_StrLen nDot = 0;
+ for (xub_StrLen j = 0; j < aField2.Len(); j++)
+ {
+ sal_Unicode c = aField2.GetChar(j);
+ // nur Ziffern und Dezimalpunkt und Tausender-Trennzeichen?
+ if ((!cDecimalDelimiter || c != cDecimalDelimiter) &&
+ (!cThousandDelimiter || c != cThousandDelimiter) &&
+ !aCharClass.isDigit(aField2,j))
+ {
+ bNumeric = FALSE;
+ break;
+ }
+ if (cDecimalDelimiter && c == cDecimalDelimiter)
+ {
+ nPrecision = 15; // we have an decimal value
+ nScale = 2;
+ nDot++;
+ }
+ }
+
+ if (nDot > 1) // if there is more than one dot it isn't a number
+ bNumeric = FALSE;
+ if (bNumeric && cThousandDelimiter)
+ {
+ // Ist der Trenner richtig angegeben?
+ String aValue = aField2.GetToken(0,cDecimalDelimiter);
+ for (sal_Int32 j = aValue.Len() - 4; j >= 0; j -= 4)
+ {
+ sal_Unicode c = aValue.GetChar(j);
+ // nur Ziffern und Dezimalpunkt und Tausender-Trennzeichen?
+ if (c == cThousandDelimiter && j)
+ continue;
+ else
+ {
+ bNumeric = FALSE;
+ break;
+ }
+ }
+ }
+
+ // jetzt koennte es noch ein Datumsfeld sein
+ if (!bNumeric)
+ {
+ try
+ {
+ nIndex = m_xNumberFormatter->detectNumberFormat(::com::sun::star::util::NumberFormat::ALL,aField2);
+ }
+ catch(Exception&)
+ {
+ }
+ }
+ }
+ }
+
+ sal_Int32 nFlags = 0;
+ if (bNumeric)
+ {
+ if (cDecimalDelimiter)
+ {
+ if(nPrecision)
+ {
+ eType = DataType::DECIMAL;
+ aTypeName = ::rtl::OUString::createFromAscii("DECIMAL");
+ }
+ else
+ {
+ eType = DataType::DOUBLE;
+ aTypeName = ::rtl::OUString::createFromAscii("DOUBLE");
+ }
+ }
+ else
+ eType = DataType::INTEGER;
+ nFlags = ColumnSearch::BASIC;
+ }
+ else
+ {
+
+ switch (comphelper::getNumberFormatType(m_xNumberFormatter,nIndex))
+ {
+ case NUMBERFORMAT_DATE:
+ eType = DataType::DATE;
+ aTypeName = ::rtl::OUString::createFromAscii("DATE");
+ break;
+ case NUMBERFORMAT_DATETIME:
+ eType = DataType::TIMESTAMP;
+ aTypeName = ::rtl::OUString::createFromAscii("TIMESTAMP");
+ break;
+ case NUMBERFORMAT_TIME:
+ eType = DataType::TIME;
+ aTypeName = ::rtl::OUString::createFromAscii("TIME");
+ break;
+ default:
+ eType = DataType::VARCHAR;
+ nPrecision = 0; // nyi: Daten koennen aber laenger sein!
+ nScale = 0;
+ aTypeName = ::rtl::OUString::createFromAscii("VARCHAR");
+ };
+ nFlags |= ColumnSearch::CHAR;
+ }
+
+ // check if the columname already exists
+ String aAlias(aColumnName);
+ OSQLColumns::Vector::const_iterator aFind = connectivity::find(m_aColumns->get().begin(),m_aColumns->get().end(),aAlias,aCase);
+ sal_Int32 nExprCnt = 0;
+ while(aFind != m_aColumns->get().end())
+ {
+ (aAlias = aColumnName) += String::CreateFromInt32(++nExprCnt);
+ aFind = connectivity::find(m_aColumns->get().begin(),m_aColumns->get().end(),aAlias,aCase);
+ }
+
+ sdbcx::OColumn* pColumn = new sdbcx::OColumn(aAlias,aTypeName,::rtl::OUString(),
+ ColumnValue::NULLABLE,
+ nPrecision,
+ nScale,
+ eType,
+ sal_False,
+ sal_False,
+ sal_False,
+ bCase);
+ Reference< XPropertySet> xCol = pColumn;
+ m_aColumns->get().push_back(xCol);
+ m_aTypes.push_back(eType);
+ m_aPrecisions.push_back(nPrecision);
+ m_aScales.push_back(nScale);
+ }
+ m_pFileStream->Seek(STREAM_SEEK_TO_BEGIN);
+}
+// -------------------------------------------------------------------------
+DBG_NAME( OEvoabFolderList );
+OEvoabFolderList::OEvoabFolderList(OEvoabConnection* _pConnection)
+ :m_nFilePos(0)
+ ,m_pFileStream(NULL)
+ ,m_pConnection(_pConnection)
+ ,m_bIsNull(sal_False)
+{
+ DBG_CTOR( OEvoabFolderList, NULL );
+ m_aColumns = new OSQLColumns();
+
+ construct();
+}
+// -----------------------------------------------------------------------------
+void OEvoabFolderList::construct()
+{
+ SvtSysLocale aLocale;
+ ::com::sun::star::lang::Locale aAppLocale(aLocale.GetLocaleDataPtr()->getLocale());
+ Sequence< ::com::sun::star::uno::Any > aArg(1);
+ aArg[0] <<= aAppLocale;
+
+ Reference< ::com::sun::star::util::XNumberFormatsSupplier > xSupplier(m_pConnection->getDriver()->getFactory()->createInstanceWithArguments(::rtl::OUString::createFromAscii("com.sun.star.util.NumberFormatsSupplier"),aArg),UNO_QUERY);
+ m_xNumberFormatter = Reference< ::com::sun::star::util::XNumberFormatter >(m_pConnection->getDriver()->getFactory()->createInstance(::rtl::OUString::createFromAscii("com.sun.star.util.NumberFormatter")),UNO_QUERY);
+ m_xNumberFormatter->attachNumberFormatsSupplier(xSupplier);
+
+ INetURLObject aURL;
+ aURL.SetURL(m_pConnection->getDriver()->getEvoFolderListFileURL());
+
+ String aFileName = aURL.GetMainURL(INetURLObject::NO_DECODE);
+
+ EVO_TRACE_STRING("OJ::construct()::aFileName = %s\n", aFileName );
+ m_pFileStream = createStream_simpleError( aFileName,STREAM_READWRITE | STREAM_NOCREATE | STREAM_SHARE_DENYWRITE);
+
+ if(!m_pFileStream)
+ m_pFileStream = createStream_simpleError( aFileName,STREAM_READ | STREAM_NOCREATE | STREAM_SHARE_DENYNONE);
+
+ if(m_pFileStream)
+ {
+ m_pFileStream->Seek(STREAM_SEEK_TO_END);
+ sal_Int32 nSize = m_pFileStream->Tell();
+ m_pFileStream->Seek(STREAM_SEEK_TO_BEGIN);
+
+ // Buffersize abhaengig von der Filegroesse
+ m_pFileStream->SetBufferSize(nSize > 1000000 ? 32768 :
+ nSize > 100000 ? 16384 :
+ nSize > 10000 ? 4096 : 1024);
+ OSL_TRACE("OEvoabFolderList::construct()::m_pFileStream->Tell() = %d\n", nSize );
+
+ fillColumns(aAppLocale);
+ }
+}
+
+
+//------------------------------------------------------------------
+sal_Bool OEvoabFolderList::fetchRow(OValueRow _rRow,const OSQLColumns & _rCols)
+{
+ (_rRow->get())[0] = m_nFilePos; // the "bookmark"
+
+ OEvoabConnection* pConnection = (OEvoabConnection*)m_pConnection;
+ // Felder:
+ xub_StrLen nStartPos = 0;
+ String aStr;
+ OSQLColumns::Vector::const_iterator aIter = _rCols.get().begin();
+ for (sal_Int32 i = 0; aIter != _rCols.get().end();++aIter, ++i)
+ {
+ m_aCurrentLine.GetTokenSpecial(aStr,nStartPos,pConnection->getFieldDelimiter(),pConnection->getStringDelimiter());
+ //OSL_TRACE("OEvoabFolderList::fetchRow()::aStr = %s\n", ((OUtoCStr(::rtl::OUString(aStr))) ? (OUtoCStr(::rtl::OUString(aStr))):("NULL")) );
+
+ if (aStr.Len() == 0)
+ (_rRow->get())[i+1].setNull();
+ else
+ {
+ // length depending on the data type
+ sal_Int32 nType = m_aTypes[i];
+ switch(nType)
+ {
+ case DataType::TIMESTAMP:
+ case DataType::DATE:
+ case DataType::TIME:
+ {
+ double nRes = 0.0;
+ try
+ {
+ nRes = m_xNumberFormatter->convertStringToNumber(::com::sun::star::util::NumberFormat::ALL,aStr);
+ Reference<XPropertySet> xProp(m_xNumberFormatter->getNumberFormatsSupplier()->getNumberFormatSettings(),UNO_QUERY);
+ com::sun::star::util::Date aDate;
+ xProp->getPropertyValue(::rtl::OUString::createFromAscii("NullDate")) >>= aDate;
+
+ switch(nType)
+ {
+ case DataType::DATE:
+ (_rRow->get())[i+1] = ::dbtools::DBTypeConversion::toDouble(::dbtools::DBTypeConversion::toDate(nRes,aDate));
+ break;
+ case DataType::TIMESTAMP:
+ (_rRow->get())[i+1] = ::dbtools::DBTypeConversion::toDouble(::dbtools::DBTypeConversion::toDateTime(nRes,aDate));
+ break;
+ default:
+ (_rRow->get())[i+1] = ::dbtools::DBTypeConversion::toDouble(::dbtools::DBTypeConversion::toTime(nRes));
+ }
+ }
+ catch(Exception&)
+ {
+ (_rRow->get())[i+1].setNull();
+ }
+ } break;
+ case DataType::DOUBLE:
+ case DataType::INTEGER:
+ case DataType::DECIMAL: // #99178# OJ
+ case DataType::NUMERIC:
+ {
+ sal_Unicode cDecimalDelimiter = pConnection->getDecimalDelimiter();
+ sal_Unicode cThousandDelimiter = pConnection->getThousandDelimiter();
+ String aStrConverted;
+
+ OSL_ENSURE(cDecimalDelimiter && nType != DataType::INTEGER ||
+ !cDecimalDelimiter && nType == DataType::INTEGER,
+ "FalscherTyp");
+
+ // In Standard-Notation (DezimalPUNKT ohne Tausender-Komma) umwandeln:
+ for (xub_StrLen j = 0; j < aStr.Len(); ++j)
+ {
+ if (cDecimalDelimiter && aStr.GetChar(j) == cDecimalDelimiter)
+ aStrConverted += '.';
+ else if ( aStr.GetChar(j) == '.' ) // special case, if decimal seperator isn't '.' we have to vut the string after it
+ break; // #99189# OJ
+ else if (cThousandDelimiter && aStr.GetChar(j) == cThousandDelimiter)
+ {
+ // weglassen
+ }
+ else
+ aStrConverted += aStr.GetChar(j) ;
+ }
+ double nVal = ::rtl::math::stringToDouble(aStrConverted.GetBuffer(),',','.',NULL,NULL);
+
+ // #99178# OJ
+ if ( DataType::DECIMAL == nType || DataType::NUMERIC == nType )
+ (_rRow->get())[i+1] = String::CreateFromDouble(nVal);
+ else
+ (_rRow->get())[i+1] = nVal;
+ } break;
+
+ default:
+ {
+ // Wert als String in Variable der Row uebernehmen
+ (_rRow->get())[i+1] = aStr;
+ }
+ break;
+ }
+ }
+ }
+ return sal_True;
+}
+
+
+//------------------------------------------------------------------
+sal_Bool OEvoabFolderList::seekRow(IResultSetHelper::Movement eCursorPosition)
+{
+ //OSL_TRACE("OEvoabFolderList::seekRow()::(before SeekRow)m_aCurrentLine = %d\n", ((OUtoCStr(::rtl::OUString(m_aCurrentLine))) ? (OUtoCStr(::rtl::OUString(m_aCurrentLine))):("NULL")) );
+
+ if ( !m_pFileStream )
+ return sal_False;
+ OEvoabConnection* pConnection = (OEvoabConnection*)m_pConnection;
+ // ----------------------------------------------------------
+ // Positionierung vorbereiten:
+ //OSL_TRACE("OEvoabFolderList::seekRow()::(before SeekRow,m_pFileStriam Exist)m_aCurrentLine = %d\n", ((OUtoCStr(::rtl::OUString(m_aCurrentLine))) ? (OUtoCStr(::rtl::OUString(m_aCurrentLine))):("NULL")) );
+
+ switch(eCursorPosition)
+ {
+ case IResultSetHelper::FIRST:
+ m_nFilePos = 0;
+ // run through
+
+ case IResultSetHelper::NEXT:
+ m_pFileStream->Seek(m_nFilePos);
+
+ if (m_pFileStream->IsEof())
+ {
+ OSL_TRACE( "OEvoabFolderList::seekRow: EOF /before/ reading the line." );
+ return sal_False;
+ }
+
+ m_pFileStream->ReadByteStringLine(m_aCurrentLine,pConnection->getTextEncoding());
+ if (m_pFileStream->IsEof())
+ {
+ OSL_TRACE( "OEvoabFolderList::seekRow: EOF /after/ reading the line." );
+ if ( !m_aCurrentLine.Len() )
+ {
+ OSL_TRACE( "OEvoabFolderList::seekRow: empty line read." );
+ return sal_False;
+ }
+ }
+ m_nFilePos = m_pFileStream->Tell();
+ break;
+
+ default:
+ OSL_ENSURE( sal_False, "OEvoabFolderList::seekRow: unsupported positioning!" );
+ break;
+ }
+
+ //OSL_TRACE("OEvoabFolderList::seekRow()::(after SeekRow)m_aCurrentLine = %d\n", ((OUtoCStr(::rtl::OUString(m_aCurrentLine))) ? (OUtoCStr(::rtl::OUString(m_aCurrentLine))):("NULL")) );
+
+ return sal_True;
+}
+// -----------------------------------------------------------------------------
+SvStream* OEvoabFolderList::createStream_simpleError( const String& _rFileName, StreamMode _eOpenMode)
+{
+ utl::UcbLockBytesHandler* p_null_dummy=NULL;
+ SvStream* pReturn = ::utl::UcbStreamHelper::CreateStream( _rFileName, _eOpenMode, p_null_dummy);
+ if (pReturn && (ERRCODE_NONE != pReturn->GetErrorCode()))
+ {
+ delete pReturn;
+ pReturn = NULL;
+ }
+ return pReturn;
+}
+// -----------------------------------------------------------------------------
+const ORowSetValue& OEvoabFolderList::getValue(sal_Int32 _nColumnIndex ) throw(::com::sun::star::sdbc::SQLException)
+{
+ checkIndex( _nColumnIndex );
+
+ m_bIsNull = (m_aRow->get())[_nColumnIndex].isNull();
+ return (m_aRow->get())[_nColumnIndex];
+}
+// -----------------------------------------------------------------------------
+void OEvoabFolderList::checkIndex(sal_Int32 _nColumnIndex ) throw(::com::sun::star::sdbc::SQLException)
+{
+ if ( _nColumnIndex <= 0 || _nColumnIndex >= (sal_Int32)m_aRow->get().size() ) {
+// ::dbtools::throwInvalidIndexException();
+ ;
+ }
+}
+// -------------------------------------------------------------------------
+::rtl::OUString SAL_CALL OEvoabFolderList::getString( sal_Int32 _nColumnIndex ) throw(SQLException, RuntimeException)
+{
+ return getValue(_nColumnIndex);
+}
+// -------------------------------------------------------------------------
+sal_Int32 SAL_CALL OEvoabFolderList::getInt( sal_Int32 _nColumnIndex ) throw(SQLException, RuntimeException)
+{
+ return getValue( _nColumnIndex );
+}
+// -----------------------------------------------------------------------------
+void OEvoabFolderList::initializeRow(sal_Int32 _nColumnCount)
+{
+ if(!m_aRow.isValid())
+ {
+ m_aRow = new OValueVector(_nColumnCount);
+ (m_aRow->get())[0].setBound(sal_True);
+ ::std::for_each(m_aRow->get().begin()+1,m_aRow->get().end(),TSetBound(sal_False));
+ }
+ //OSL_TRACE("OEvoabFolderList::initializeRow()::_nColumnCount = %d\n", _nColumnCount);
+
+}
+// -------------------------------------------------------------------------
+
+sal_Bool SAL_CALL OEvoabFolderList::first( ) throw(SQLException, RuntimeException)
+{
+ sal_Bool bSuccess = seekRow(IResultSetHelper::FIRST);
+
+ EVO_TRACE_STRING("OEvoabFolderList::first(): returning %s\n", ::rtl::OUString::valueOf(bSuccess) );
+ return bSuccess;
+}
+// -------------------------------------------------------------------------
+
+sal_Bool SAL_CALL OEvoabFolderList::next( ) throw(SQLException, RuntimeException)
+{
+ sal_Bool bSuccess = seekRow(IResultSetHelper::NEXT);
+
+ EVO_TRACE_STRING("OEvoabFolderList::next(): returning %s\n", ::rtl::OUString::valueOf(bSuccess) );
+ return bSuccess;
+}
+// -------------------------------------------------------------------------
+
+sal_Int32 SAL_CALL OEvoabFolderList::getRow( ) throw(SQLException, RuntimeException)
+{
+ sal_Bool bRet = fetchRow(m_aRow,getTableColumns().getBody());
+ EVO_TRACE_STRING("OEvoabFolderList::getRow()::fetchRow() = %s\n", ::rtl::OUString::valueOf(bRet) );
+
+ return bRet;
+}
diff --git a/connectivity/source/drivers/evoab/LFolderList.hxx b/connectivity/source/drivers/evoab/LFolderList.hxx
new file mode 100644
index 0000000000..690c3bb140
--- /dev/null
+++ b/connectivity/source/drivers/evoab/LFolderList.hxx
@@ -0,0 +1,95 @@
+/*************************************************************************
+ *
+ * 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: LFolderList.hxx,v $
+ * $Revision: 1.6 $
+ *
+ * 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 _CONNECTIVITY_EVOAB_LEVOABFOLDERLIST_HXX_
+#define _CONNECTIVITY_EVOAB_LEVOABFOLDERLIST_HXX_
+
+#include "connectivity/sdbcx/VColumn.hxx"
+#include "connectivity/CommonTools.hxx"
+#include <tools/urlobj.hxx>
+#include "LTable.hxx"
+#include "TResultSetHelper.hxx"
+
+
+namespace connectivity
+{
+ namespace evoab
+ {
+ //==================================================================
+ // Ableitung von String mit ueberladenen GetToken/GetTokenCount-Methoden
+ // Speziell fuer FLAT FILE-Format: Strings koennen gequotet sein
+ //==================================================================
+
+ class OEvoabConnection;
+
+ class OEvoabFolderList
+ {
+ // maps a row postion to a file position
+ ::std::vector<sal_Int32> m_aTypes; // holds all type for columns just to avoid to ask the propertyset
+ ::std::vector<sal_Int32> m_aPrecisions; // same as aboth
+ ::std::vector<sal_Int32> m_aScales;
+ QuotedTokenizedString m_aCurrentLine;
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter > m_xNumberFormatter;
+ sal_Int32 m_nFilePos; // aktuelle IResultSetHelper::Movement
+ SvStream* m_pFileStream;
+ OEvoabConnection* m_pConnection;
+ ::vos::ORef<OSQLColumns> m_aColumns;
+ OValueRow m_aRow;
+ sal_Bool m_bIsNull;
+
+ private:
+ void fillColumns(const ::com::sun::star::lang::Locale& _aLocale);
+ BOOL CreateFile(const INetURLObject& aFile, BOOL& bCreateMemo);
+
+ sal_Bool fetchRow(OValueRow _rRow,const OSQLColumns& _rCols);
+ sal_Bool seekRow(IResultSetHelper::Movement eCursorPosition);
+
+ public:
+
+ OEvoabFolderList( OEvoabConnection* _pConnection);
+
+ OEvoabConnection* getConnection() const { return m_pConnection;}
+ ::vos::ORef<OSQLColumns> getTableColumns() const {return m_aColumns;}
+ void construct(); // can throw any exception
+ static SvStream* createStream_simpleError( const String& _rFileName, StreamMode _eOpenMode);
+ void initializeRow(sal_Int32 _nColumnCount);
+ void checkIndex(sal_Int32 _nColumnIndex ) throw(::com::sun::star::sdbc::SQLException);
+ const ORowSetValue& getValue(sal_Int32 _nColumnIndex ) throw(::com::sun::star::sdbc::SQLException);
+ ::rtl::OUString SAL_CALL getString( sal_Int32 _nColumnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+ sal_Int32 SAL_CALL getInt( sal_Int32 _nColumnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+ sal_Bool SAL_CALL first( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+ sal_Bool SAL_CALL next( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+ sal_Int32 SAL_CALL getRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+
+ };
+ }
+}
+#endif // _CONNECTIVITY_EVOAB_LEVOABFOLDERLIST_HXX_
+
diff --git a/connectivity/source/drivers/evoab/LNoException.cxx b/connectivity/source/drivers/evoab/LNoException.cxx
new file mode 100644
index 0000000000..b1cd94cd86
--- /dev/null
+++ b/connectivity/source/drivers/evoab/LNoException.cxx
@@ -0,0 +1,327 @@
+/*************************************************************************
+ *
+ * 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: LNoException.cxx,v $
+ * $Revision: 1.6 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_connectivity.hxx"
+#include "LTable.hxx"
+#include "LConnection.hxx"
+
+using namespace connectivity;
+using namespace connectivity::evoab;
+
+//------------------------------------------------------------------
+xub_StrLen OEvoabString::GetTokenCount( sal_Unicode cTok, sal_Unicode cStrDel ) const
+{
+ if ( !Len() )
+ return 0;
+
+ xub_StrLen nTokCount = 1;
+ BOOL bStart = TRUE; // Stehen wir auf dem ersten Zeichen im Token?
+ BOOL bInString = FALSE; // Befinden wir uns INNERHALB eines (cStrDel delimited) String?
+
+ // Suche bis Stringende nach dem ersten nicht uebereinstimmenden Zeichen
+ for( xub_StrLen i = 0; i < Len(); i++ )
+ {
+ if (bStart)
+ {
+ bStart = FALSE;
+ // Erstes Zeichen ein String-Delimiter?
+ if ((*this).GetChar(i) == cStrDel)
+ {
+ bInString = TRUE; // dann sind wir jetzt INNERHALB des Strings!
+ continue; // dieses Zeichen ueberlesen!
+ }
+ }
+
+ if (bInString) {
+ // Wenn jetzt das String-Delimiter-Zeichen auftritt ...
+ if ( (*this).GetChar(i) == cStrDel )
+ {
+ if ((i+1 < Len()) && ((*this).GetChar(i+1) == cStrDel))
+ {
+ // Verdoppeltes String-Delimiter-Zeichen:
+ i++; // kein String-Ende, naechstes Zeichen ueberlesen.
+ }
+ else
+ {
+ // String-Ende
+ bInString = FALSE;
+ }
+ }
+ } else {
+ // Stimmt das Tokenzeichen ueberein, dann erhoehe TokCount
+ if ( (*this).GetChar(i) == cTok )
+ {
+ nTokCount++;
+ bStart = TRUE;
+ }
+ }
+ }
+ //OSL_TRACE("OEvoabString::nTokCount = %d\n", ((OUtoCStr(::rtl::OUString(nTokCount))) ? (OUtoCStr(::rtl::OUString(nTokCount))):("NULL")) );
+
+ return nTokCount;
+}
+
+//------------------------------------------------------------------
+void OEvoabString::GetTokenSpecial( String& _rStr,xub_StrLen& nStartPos, sal_Unicode cTok, sal_Unicode cStrDel ) const
+{
+ _rStr.Erase();
+ xub_StrLen nLen = Len();
+ if ( nLen )
+ {
+ BOOL bInString = (nStartPos < nLen) && ((*this).GetChar(nStartPos) == cStrDel); // Befinden wir uns INNERHALB eines (cStrDel delimited) String?
+
+ // Erstes Zeichen ein String-Delimiter?
+ if (bInString )
+ ++nStartPos; // dieses Zeichen ueberlesen!
+ // Suche bis Stringende nach dem ersten nicht uebereinstimmenden Zeichen
+ for( xub_StrLen i = nStartPos; i < nLen; ++i )
+ {
+ if (bInString)
+ {
+ // Wenn jetzt das String-Delimiter-Zeichen auftritt ...
+ if ( (*this).GetChar(i) == cStrDel )
+ {
+ if ((i+1 < nLen) && ((*this).GetChar(i+1) == cStrDel))
+ {
+ // Verdoppeltes String-Delimiter-Zeichen:
+ ++i; // kein String-Ende, naechstes Zeichen ueberlesen.
+
+ _rStr += (*this).GetChar(i); // Zeichen gehoert zum Resultat-String
+ }
+ else
+ {
+ // String-Ende
+ bInString = FALSE;
+ }
+ }
+ else
+ {
+ _rStr += (*this).GetChar(i); // Zeichen gehoert zum Resultat-String
+ }
+
+ }
+ else
+ {
+ // Stimmt das Tokenzeichen ueberein, dann erhoehe nTok
+ if ( (*this).GetChar(i) == cTok )
+ {
+ // Vorzeitiger Abbruch der Schleife moeglich, denn
+ // wir haben, was wir wollten.
+ nStartPos = i+1;
+ break;
+ }
+ else
+ {
+ _rStr += (*this).GetChar(i); // Zeichen gehoert zum Resultat-String
+ }
+ }
+ }
+ }
+}
+// -----------------------------------------------------------------------------
+void OEvoabTable::refreshIndexes()
+{
+}
+// -----------------------------------------------------------------------------
+sal_Bool OEvoabTable::checkHeaderLine()
+{
+ if (m_nFilePos == 0 && ((OEvoabConnection*)m_pConnection)->isHeaderLine())
+ {
+ BOOL bRead2;
+ do
+ {
+ bRead2 = m_pFileStream->ReadByteStringLine(m_aCurrentLine,m_pConnection->getTextEncoding());
+ }
+ while(bRead2 && !m_aCurrentLine.Len());
+
+ m_nFilePos = m_pFileStream->Tell();
+ if (m_pFileStream->IsEof())
+ return sal_False;
+ }
+ return sal_True;
+}
+//------------------------------------------------------------------
+sal_Bool OEvoabTable::seekRow(IResultSetHelper::Movement eCursorPosition, sal_Int32 nOffset, sal_Int32& nCurPos)
+{
+ //OSL_TRACE("OEvoabTable::(before SeekRow)m_aCurrentLine = %d\n", ((OUtoCStr(::rtl::OUString(m_aCurrentLine))) ? (OUtoCStr(::rtl::OUString(m_aCurrentLine))):("NULL")) );
+
+ if ( !m_pFileStream )
+ return sal_False;
+ OEvoabConnection* pConnection = (OEvoabConnection*)m_pConnection;
+ // ----------------------------------------------------------
+ // Positionierung vorbereiten:
+ //OSL_TRACE("OEvoabTable::(before SeekRow,m_pFileStriam Exist)m_aCurrentLine = %d\n", ((OUtoCStr(::rtl::OUString(m_aCurrentLine))) ? (OUtoCStr(::rtl::OUString(m_aCurrentLine))):("NULL")) );
+
+ m_nFilePos = nCurPos;
+
+ switch(eCursorPosition)
+ {
+ case IResultSetHelper::FIRST:
+ m_nFilePos = 0;
+ m_nRowPos = 1;
+ // run through
+ case IResultSetHelper::NEXT:
+ if(eCursorPosition != IResultSetHelper::FIRST)
+ ++m_nRowPos;
+ m_pFileStream->Seek(m_nFilePos);
+ if (m_pFileStream->IsEof() || !checkHeaderLine())
+ {
+ m_nMaxRowCount = m_nRowPos;
+ return sal_False;
+ }
+
+ m_aRowToFilePos.insert(::std::map<sal_Int32,sal_Int32>::value_type(m_nRowPos,m_nFilePos));
+
+ m_pFileStream->ReadByteStringLine(m_aCurrentLine,pConnection->getTextEncoding());
+ if (m_pFileStream->IsEof())
+ {
+ m_nMaxRowCount = m_nRowPos;
+ return sal_False;
+ }
+ nCurPos = m_pFileStream->Tell();
+ break;
+ case IResultSetHelper::PRIOR:
+ --m_nRowPos;
+ if(m_nRowPos > 0)
+ {
+ m_nFilePos = m_aRowToFilePos.find(m_nRowPos)->second;
+ m_pFileStream->Seek(m_nFilePos);
+ if (m_pFileStream->IsEof() || !checkHeaderLine())
+ return sal_False;
+ m_pFileStream->ReadByteStringLine(m_aCurrentLine,pConnection->getTextEncoding());
+ if (m_pFileStream->IsEof())
+ return sal_False;
+ nCurPos = m_pFileStream->Tell();
+ }
+ else
+ m_nRowPos = 0;
+
+ break;
+
+ break;
+ case IResultSetHelper::LAST:
+ if(m_nMaxRowCount)
+ {
+ m_nFilePos = m_aRowToFilePos.rbegin()->second;
+ m_nRowPos = m_aRowToFilePos.rbegin()->first;
+ m_pFileStream->Seek(m_nFilePos);
+ if (m_pFileStream->IsEof() || !checkHeaderLine())
+ return sal_False;
+ m_pFileStream->ReadByteStringLine(m_aCurrentLine,pConnection->getTextEncoding());
+ if (m_pFileStream->IsEof())
+ return sal_False;
+ nCurPos = m_pFileStream->Tell();
+ }
+ else
+ {
+ while(seekRow(IResultSetHelper::NEXT,1,nCurPos)) ; // run through after last row
+ // now I know all
+ seekRow(IResultSetHelper::PRIOR,1,nCurPos);
+ }
+ break;
+ case IResultSetHelper::RELATIVE:
+ if(nOffset > 0)
+ {
+ for(sal_Int32 i = 0;i<nOffset;++i)
+ seekRow(IResultSetHelper::NEXT,1,nCurPos);
+ }
+ else if(nOffset < 0)
+ {
+ for(sal_Int32 i = nOffset;i;++i)
+ seekRow(IResultSetHelper::PRIOR,1,nCurPos);
+ }
+ break;
+ case IResultSetHelper::ABSOLUTE:
+ {
+ if(nOffset < 0)
+ nOffset = m_nRowPos + nOffset;
+ ::std::map<sal_Int32,sal_Int32>::const_iterator aIter = m_aRowToFilePos.find(nOffset);
+ if(aIter != m_aRowToFilePos.end())
+ {
+ m_nFilePos = aIter->second;
+ m_pFileStream->Seek(m_nFilePos);
+ if (m_pFileStream->IsEof() || !checkHeaderLine())
+ return sal_False;
+ m_pFileStream->ReadByteStringLine(m_aCurrentLine,pConnection->getTextEncoding());
+ if (m_pFileStream->IsEof())
+ return sal_False;
+ nCurPos = m_pFileStream->Tell();
+ }
+ else if(m_nMaxRowCount && nOffset > m_nMaxRowCount) // offset is outside the table
+ {
+ m_nRowPos = m_nMaxRowCount;
+ return sal_False;
+ }
+ else
+ {
+ aIter = m_aRowToFilePos.upper_bound(nOffset);
+ if(aIter == m_aRowToFilePos.end())
+ {
+ m_nRowPos = m_aRowToFilePos.rbegin()->first;
+ nCurPos = m_nFilePos = m_aRowToFilePos.rbegin()->second;
+ while(m_nRowPos != nOffset)
+ seekRow(IResultSetHelper::NEXT,1,nCurPos);
+ }
+ else
+ {
+ --aIter;
+ m_nRowPos = aIter->first;
+ m_nFilePos = aIter->second;
+ m_pFileStream->Seek(m_nFilePos);
+ if (m_pFileStream->IsEof() || !checkHeaderLine())
+ return sal_False;
+ m_pFileStream->ReadByteStringLine(m_aCurrentLine,pConnection->getTextEncoding());
+ if (m_pFileStream->IsEof())
+ return sal_False;
+ nCurPos = m_pFileStream->Tell();
+ }
+ }
+ }
+
+ break;
+ case IResultSetHelper::BOOKMARK:
+ m_pFileStream->Seek(nOffset);
+ if (m_pFileStream->IsEof())
+ return sal_False;
+
+ m_nFilePos = m_pFileStream->Tell(); // Byte-Position in der Datei merken (am ZeilenANFANG)
+ m_pFileStream->ReadByteStringLine(m_aCurrentLine,pConnection->getTextEncoding());
+ if (m_pFileStream->IsEof())
+ return sal_False;
+ nCurPos = m_pFileStream->Tell();
+ break;
+ }
+
+ //OSL_TRACE("OEvoabTable::(after SeekRow)m_aCurrentLine = %d\n", ((OUtoCStr(::rtl::OUString(m_aCurrentLine))) ? (OUtoCStr(::rtl::OUString(m_aCurrentLine))):("NULL")) );
+
+ return sal_True;
+}
+// -----------------------------------------------------------------------------
diff --git a/connectivity/source/drivers/evoab/LPreparedStatement.cxx b/connectivity/source/drivers/evoab/LPreparedStatement.cxx
new file mode 100644
index 0000000000..c2f010d415
--- /dev/null
+++ b/connectivity/source/drivers/evoab/LPreparedStatement.cxx
@@ -0,0 +1,46 @@
+/*************************************************************************
+ *
+ * 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: LPreparedStatement.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.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_connectivity.hxx"
+#include "LPreparedStatement.hxx"
+#include "LResultSet.hxx"
+
+using namespace connectivity::evoab;
+using namespace connectivity::file;
+using namespace ::com::sun::star::uno;
+// -------------------------------------------------------------------------
+OResultSet* OEvoabPreparedStatement::createResultSet()
+{
+ return new OEvoabResultSet(this,m_aSQLIterator);
+}
+// -------------------------------------------------------------------------
+IMPLEMENT_SERVICE_INFO(OEvoabPreparedStatement,"com.sun.star.sdbc.driver.evoab.PreparedStatement","com.sun.star.sdbc.PreparedStatement");
+
diff --git a/connectivity/source/drivers/evoab/LPreparedStatement.hxx b/connectivity/source/drivers/evoab/LPreparedStatement.hxx
new file mode 100644
index 0000000000..5fa43b72d0
--- /dev/null
+++ b/connectivity/source/drivers/evoab/LPreparedStatement.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: LPreparedStatement.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 _CONNECTIVITY_EVOAB_LPREPAREDSTATEMENT_HXX_
+#define _CONNECTIVITY_EVOAB_LPREPAREDSTATEMENT_HXX_
+
+#include "file/FPreparedStatement.hxx"
+
+namespace connectivity
+{
+ namespace evoab
+ {
+ class OConnection;
+ class OEvoabPreparedStatement : public file::OPreparedStatement
+ {
+ protected:
+ virtual file::OResultSet* createResultSet();
+ public:
+ OEvoabPreparedStatement( file::OConnection* _pConnection) : file::OPreparedStatement( _pConnection){};
+ DECLARE_SERVICE_INFO();
+ };
+ }
+}
+
+#endif //_CONNECTIVITY_EVOAB_LPREPAREDSTATEMENT_HXX_
+
diff --git a/connectivity/source/drivers/evoab/LResultSet.cxx b/connectivity/source/drivers/evoab/LResultSet.cxx
new file mode 100644
index 0000000000..2caecef296
--- /dev/null
+++ b/connectivity/source/drivers/evoab/LResultSet.cxx
@@ -0,0 +1,193 @@
+/*************************************************************************
+ *
+ * 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: LResultSet.cxx,v $
+ * $Revision: 1.8 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_connectivity.hxx"
+#include <com/sun/star/sdbcx/CompareBookmark.hpp>
+#include <com/sun/star/sdbcx/XDeleteRows.hpp>
+#include "LResultSet.hxx"
+#include <com/sun/star/lang/DisposedException.hpp>
+#include <comphelper/sequence.hxx>
+#include <comphelper/types.hxx>
+
+using namespace ::comphelper;
+
+using namespace connectivity::evoab;
+using namespace connectivity::file;
+using namespace ::cppu;
+using namespace com::sun::star::uno;
+using namespace com::sun::star::lang;
+using namespace com::sun::star::beans;
+using namespace com::sun::star::sdbc;
+using namespace com::sun::star::sdbcx;
+// using namespace com::sun::star::container;
+// using namespace com::sun::star::util;
+//------------------------------------------------------------------------------
+OEvoabResultSet::OEvoabResultSet( OStatement_Base* pStmt,connectivity::OSQLParseTreeIterator& _aSQLIterator)
+ : file::OResultSet(pStmt,_aSQLIterator)
+ ,m_bBookmarkable(sal_True)
+{
+ registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISBOOKMARKABLE), PROPERTY_ID_ISBOOKMARKABLE, PropertyAttribute::READONLY,&m_bBookmarkable, ::getBooleanCppuType());
+}
+// -------------------------------------------------------------------------
+::rtl::OUString SAL_CALL OEvoabResultSet::getImplementationName( ) throw ( RuntimeException)
+{
+ return ::rtl::OUString::createFromAscii("com.sun.star.sdbcx.evoab.ResultSet");
+}
+// -------------------------------------------------------------------------
+Sequence< ::rtl::OUString > SAL_CALL OEvoabResultSet::getSupportedServiceNames( ) throw( RuntimeException)
+{
+ Sequence< ::rtl::OUString > aSupported(2);
+ aSupported[0] = ::rtl::OUString::createFromAscii("com.sun.star.sdbc.ResultSet");
+ aSupported[1] = ::rtl::OUString::createFromAscii("com.sun.star.sdbcx.ResultSet");
+ return aSupported;
+}
+// -------------------------------------------------------------------------
+sal_Bool SAL_CALL OEvoabResultSet::supportsService( const ::rtl::OUString& _rServiceName ) throw( RuntimeException)
+{
+ Sequence< ::rtl::OUString > aSupported(getSupportedServiceNames());
+ const ::rtl::OUString* pSupported = aSupported.getConstArray();
+ const ::rtl::OUString* pEnd = pSupported + aSupported.getLength();
+ for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported)
+ ;
+
+ return pSupported != pEnd;
+}
+// -------------------------------------------------------------------------
+Any SAL_CALL OEvoabResultSet::queryInterface( const Type & rType ) throw(RuntimeException)
+{
+ if(rType == ::getCppuType((const Reference<XDeleteRows>*)0) || rType == ::getCppuType((const Reference<XResultSetUpdate>*)0)
+ || rType == ::getCppuType((const Reference<XRowUpdate>*)0))
+ return Any();
+
+ Any aRet = OResultSet::queryInterface(rType);
+ return aRet.hasValue() ? aRet : OEvoabResultSet_BASE::queryInterface(rType);
+}
+// -------------------------------------------------------------------------
+Sequence< Type > SAL_CALL OEvoabResultSet::getTypes( ) throw( RuntimeException)
+{
+ Sequence< Type > aTypes = OResultSet::getTypes();
+ ::std::vector<Type> aOwnTypes;
+ aOwnTypes.reserve(aTypes.getLength());
+ const Type* pBegin = aTypes.getConstArray();
+ const Type* pEnd = pBegin + aTypes.getLength();
+ for(;pBegin != pEnd;++pBegin)
+ {
+ if(!(*pBegin == ::getCppuType((const Reference<XDeleteRows>*)0) ||
+ *pBegin == ::getCppuType((const Reference<XResultSetUpdate>*)0) ||
+ *pBegin == ::getCppuType((const Reference<XRowUpdate>*)0)))
+ {
+ aOwnTypes.push_back(*pBegin);
+ }
+ }
+ Type *pTypes = aOwnTypes.empty() ? 0 : &aOwnTypes[0];
+ Sequence< Type > aRet(pTypes, aOwnTypes.size());
+ return ::comphelper::concatSequences(aRet,OEvoabResultSet_BASE::getTypes());
+}
+
+// -------------------------------------------------------------------------
+// XRowLocate
+Any SAL_CALL OEvoabResultSet::getBookmark( ) throw( SQLException, RuntimeException)
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
+
+ return makeAny((sal_Int32)(m_aRow->get())[0]->getValue());
+}
+// -------------------------------------------------------------------------
+sal_Bool SAL_CALL OEvoabResultSet::moveToBookmark( const Any& bookmark ) throw( SQLException, RuntimeException)
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
+
+ m_bRowDeleted = m_bRowInserted = m_bRowUpdated = sal_False;
+
+ return Move(IResultSetHelper::BOOKMARK,comphelper::getINT32(bookmark),sal_True);
+}
+// -------------------------------------------------------------------------
+sal_Bool SAL_CALL OEvoabResultSet::moveRelativeToBookmark( const Any& bookmark, sal_Int32 rows ) throw( SQLException, RuntimeException)
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
+
+ m_bRowDeleted = m_bRowInserted = m_bRowUpdated = sal_False;
+
+ Move(IResultSetHelper::BOOKMARK,comphelper::getINT32(bookmark),sal_False);
+
+ return relative(rows);
+}
+
+// -------------------------------------------------------------------------
+sal_Int32 SAL_CALL OEvoabResultSet::compareBookmarks( const Any& lhs, const Any& rhs ) throw( SQLException, RuntimeException)
+{
+ return (lhs == rhs) ? 0 : 2;
+}
+// -------------------------------------------------------------------------
+sal_Bool SAL_CALL OEvoabResultSet::hasOrderedBookmarks( ) throw( SQLException, RuntimeException)
+{
+ return sal_True;
+}
+// -------------------------------------------------------------------------
+sal_Int32 SAL_CALL OEvoabResultSet::hashBookmark( const Any& bookmark ) throw( SQLException, RuntimeException)
+{
+ return comphelper::getINT32(bookmark);
+}
+// -------------------------------------------------------------------------
+IPropertyArrayHelper* OEvoabResultSet::createArrayHelper( ) const
+{
+ Sequence< Property > aProps;
+ describeProperties(aProps);
+ return new ::cppu::OPropertyArrayHelper(aProps);
+}
+// -------------------------------------------------------------------------
+IPropertyArrayHelper & OEvoabResultSet::getInfoHelper()
+{
+ return *OEvoabResultSet_BASE3::getArrayHelper();
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OEvoabResultSet::acquire() throw()
+{
+ OEvoabResultSet_BASE2::acquire();
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OEvoabResultSet::release() throw()
+{
+ OEvoabResultSet_BASE2::release();
+}
+// -----------------------------------------------------------------------------
+::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL OEvoabResultSet::getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException)
+{
+ return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
+}
+// -----------------------------------------------------------------------------
+
diff --git a/connectivity/source/drivers/evoab/LResultSet.hxx b/connectivity/source/drivers/evoab/LResultSet.hxx
new file mode 100644
index 0000000000..a9506ac267
--- /dev/null
+++ b/connectivity/source/drivers/evoab/LResultSet.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: LResultSet.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 _CONNECTIVITY_EVOAB_LRESULTSET_HXX_
+#define _CONNECTIVITY_EVOAB_LRESULTSET_HXX_
+
+#include "file/FResultSet.hxx"
+#include <com/sun/star/sdbcx/XRowLocate.hpp>
+#include <cppuhelper/implbase1.hxx>
+
+namespace connectivity
+{
+ namespace evoab
+ {
+ class OEvoabResultSet;
+ // these typedef's are only necessary for the compiler
+ typedef ::cppu::ImplHelper1< ::com::sun::star::sdbcx::XRowLocate> OEvoabResultSet_BASE;
+ typedef file::OResultSet OEvoabResultSet_BASE2;
+ typedef ::comphelper::OPropertyArrayUsageHelper<OEvoabResultSet> OEvoabResultSet_BASE3;
+
+
+ class OEvoabResultSet : public OEvoabResultSet_BASE2,
+ public OEvoabResultSet_BASE,
+ public OEvoabResultSet_BASE3
+ {
+ sal_Bool m_bBookmarkable;
+ protected:
+ // OPropertyArrayUsageHelper
+ virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const;
+ // OPropertySetHelper
+ virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
+ public:
+ DECLARE_SERVICE_INFO();
+
+ OEvoabResultSet( file::OStatement_Base* pStmt,connectivity::OSQLParseTreeIterator& _aSQLIterator);
+
+ // XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL acquire() throw();
+ virtual void SAL_CALL release() throw();
+ //XTypeProvider
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
+ // XPropertySet
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XRowLocate
+ virtual ::com::sun::star::uno::Any SAL_CALL getBookmark( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL moveToBookmark( const ::com::sun::star::uno::Any& bookmark ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL moveRelativeToBookmark( const ::com::sun::star::uno::Any& bookmark, sal_Int32 rows ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL compareBookmarks( const ::com::sun::star::uno::Any& first, const ::com::sun::star::uno::Any& second ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL hasOrderedBookmarks( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL hashBookmark( const ::com::sun::star::uno::Any& bookmark ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+ };
+ }
+}
+#endif //_CONNECTIVITY_EVOAB_LRESULTSET_HXX_
+
diff --git a/connectivity/source/drivers/evoab/LServices.cxx b/connectivity/source/drivers/evoab/LServices.cxx
new file mode 100644
index 0000000000..7993ca1691
--- /dev/null
+++ b/connectivity/source/drivers/evoab/LServices.cxx
@@ -0,0 +1,178 @@
+/*************************************************************************
+ *
+ * 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: LServices.cxx,v $
+ * $Revision: 1.6 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_connectivity.hxx"
+#include "LDriver.hxx"
+#include <cppuhelper/factory.hxx>
+#include <osl/diagnose.h>
+
+using namespace connectivity::evoab;
+using ::rtl::OUString;
+using ::com::sun::star::uno::Reference;
+using ::com::sun::star::uno::Sequence;
+using ::com::sun::star::registry::XRegistryKey;
+using ::com::sun::star::lang::XSingleServiceFactory;
+using ::com::sun::star::lang::XMultiServiceFactory;
+
+typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc)
+ (
+ const Reference< XMultiServiceFactory > & rServiceManager,
+ const OUString & rComponentName,
+ ::cppu::ComponentInstantiation pCreateFunction,
+ const Sequence< OUString > & rServiceNames,
+ rtl_ModuleCount* _pT
+ );
+
+//***************************************************************************************
+//
+// Die vorgeschriebene C-Api muss erfuellt werden!
+// Sie besteht aus drei Funktionen, die von dem Modul exportiert werden muessen.
+//
+
+//---------------------------------------------------------------------------------------
+void REGISTER_PROVIDER(
+ const OUString& aServiceImplName,
+ const Sequence< OUString>& Services,
+ const Reference< ::com::sun::star::registry::XRegistryKey > & xKey)
+{
+ OUString aMainKeyName;
+ aMainKeyName = OUString::createFromAscii("/");
+ aMainKeyName += aServiceImplName;
+ aMainKeyName += OUString::createFromAscii("/UNO/SERVICES");
+
+ Reference< ::com::sun::star::registry::XRegistryKey > xNewKey( xKey->createKey(aMainKeyName) );
+ OSL_ENSURE(xNewKey.is(), "FILE::component_writeInfo : could not create a registry key !");
+
+ for (sal_Int32 i=0; i<Services.getLength(); ++i)
+ xNewKey->createKey(Services[i]);
+}
+
+
+//---------------------------------------------------------------------------------------
+struct ProviderRequest
+{
+ Reference< XSingleServiceFactory > xRet;
+ Reference< XMultiServiceFactory > const xServiceManager;
+ OUString const sImplementationName;
+
+ ProviderRequest(
+ void* pServiceManager,
+ sal_Char const* pImplementationName
+ )
+ : xServiceManager(reinterpret_cast<XMultiServiceFactory*>(pServiceManager))
+ , sImplementationName(OUString::createFromAscii(pImplementationName))
+ {
+ }
+
+ inline
+ sal_Bool CREATE_PROVIDER(
+ const OUString& Implname,
+ const Sequence< OUString > & Services,
+ ::cppu::ComponentInstantiation Factory,
+ createFactoryFunc creator
+ )
+ {
+ if (!xRet.is() && (Implname == sImplementationName))
+ try
+ {
+ xRet = creator( xServiceManager, sImplementationName,Factory, Services,0);
+ }
+ catch(...)
+ {
+ }
+ return xRet.is();
+ }
+
+ void* getProvider() const { return xRet.get(); }
+};
+
+//---------------------------------------------------------------------------------------
+
+extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL
+component_getImplementationEnvironment(
+ const sal_Char **ppEnvTypeName,
+ uno_Environment ** /*ppEnv*/
+ )
+{
+ *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
+}
+
+//---------------------------------------------------------------------------------------
+extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
+ void* /*pServiceManager*/,
+ void* pRegistryKey
+ )
+{
+ if (pRegistryKey)
+ try
+ {
+ Reference< ::com::sun::star::registry::XRegistryKey > xKey(reinterpret_cast< ::com::sun::star::registry::XRegistryKey*>(pRegistryKey));
+
+ REGISTER_PROVIDER(
+ OEvoabDriver::getImplementationName_Static(),
+ OEvoabDriver::getSupportedServiceNames_Static(), xKey);
+
+ return sal_True;
+ }
+ catch (::com::sun::star::registry::InvalidRegistryException& )
+ {
+ OSL_ENSURE(sal_False, "FILE::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !");
+ }
+
+ return sal_False;
+}
+
+//---------------------------------------------------------------------------------------
+extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(
+ const sal_Char* pImplementationName,
+ void* pServiceManager,
+ void* /*pRegistryKey*/)
+{
+ void* pRet = 0;
+ if (pServiceManager)
+ {
+ ProviderRequest aReq(pServiceManager,pImplementationName);
+
+ aReq.CREATE_PROVIDER(
+ OEvoabDriver::getImplementationName_Static(),
+ OEvoabDriver::getSupportedServiceNames_Static(),
+ OEvoabDriver_CreateInstance, ::cppu::createSingleFactory)
+ ;
+
+ if(aReq.xRet.is())
+ aReq.xRet->acquire();
+
+ pRet = aReq.getProvider();
+ }
+
+ return pRet;
+};
+
diff --git a/connectivity/source/drivers/evoab/LStatement.cxx b/connectivity/source/drivers/evoab/LStatement.cxx
new file mode 100644
index 0000000000..b71df43747
--- /dev/null
+++ b/connectivity/source/drivers/evoab/LStatement.cxx
@@ -0,0 +1,46 @@
+/*************************************************************************
+ *
+ * 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: LStatement.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.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_connectivity.hxx"
+#include "LStatement.hxx"
+#include "LResultSet.hxx"
+
+using namespace connectivity::evoab;
+using namespace connectivity::file;
+using namespace com::sun::star::uno;
+// -------------------------------------------------------------------------
+OResultSet* OEvoabStatement::createResultSet()
+{
+ return new OEvoabResultSet(this,m_aSQLIterator);
+}
+// -------------------------------------------------------------------------
+IMPLEMENT_SERVICE_INFO(OEvoabStatement,"com.sun.star.sdbc.driver.evoab.Statement","com.sun.star.sdbc.Statement");
+
diff --git a/connectivity/source/drivers/evoab/LStatement.hxx b/connectivity/source/drivers/evoab/LStatement.hxx
new file mode 100644
index 0000000000..0d2c26b7f3
--- /dev/null
+++ b/connectivity/source/drivers/evoab/LStatement.hxx
@@ -0,0 +1,52 @@
+/*************************************************************************
+ *
+ * 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: LStatement.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 _CONNECTIVITY_EVOAB_LSTATEMENT_HXX_
+#define _CONNECTIVITY_EVOAB_LSTATEMENT_HXX_
+
+#include "file/FStatement.hxx"
+
+namespace connectivity
+{
+ namespace evoab
+ {
+ class OConnection;
+ class OEvoabStatement : public file::OStatement
+ {
+ protected:
+ virtual file::OResultSet* createResultSet();
+ public:
+ OEvoabStatement( file::OConnection* _pConnection) : file::OStatement( _pConnection){}
+ DECLARE_SERVICE_INFO();
+ };
+ }
+}
+
+#endif //_CONNECTIVITY_EVOAB_LSTATEMENT_HXX_
diff --git a/connectivity/source/drivers/evoab/LTable.cxx b/connectivity/source/drivers/evoab/LTable.cxx
new file mode 100644
index 0000000000..47e8368694
--- /dev/null
+++ b/connectivity/source/drivers/evoab/LTable.cxx
@@ -0,0 +1,873 @@
+/*************************************************************************
+ *
+ * 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: LTable.cxx,v $
+ * $Revision: 1.18 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_connectivity.hxx"
+
+#include <ctype.h>
+#include "LTable.hxx"
+#include <com/sun/star/sdbc/ColumnValue.hpp>
+#include <com/sun/star/sdbc/DataType.hpp>
+#include <com/sun/star/ucb/XContentAccess.hpp>
+#ifndef _COM_SUN_STAR_SQLC_XROW_HPP_
+//#include <com/sun/star/sdbc/XRow.hpp>
+#endif
+#include <svtools/converter.hxx>
+#include "LConnection.hxx"
+#include "LColumns.hxx"
+#include <osl/thread.h>
+#include <tools/config.hxx>
+#include <comphelper/sequence.hxx>
+#include <svtools/zforlist.hxx>
+#include <rtl/math.hxx>
+#include <stdio.h> //sprintf
+#include <comphelper/extract.hxx>
+#include <comphelper/numbers.hxx>
+#include "LDriver.hxx"
+#include <com/sun/star/util/NumberFormat.hpp>
+#include <unotools/configmgr.hxx>
+#include <i18npool/mslangid.hxx>
+#include "connectivity/dbconversion.hxx"
+#include <comphelper/types.hxx>
+#include <svtools/syslocale.hxx>
+#ifndef CONNECTIVITY_EVOAB_DEBUG_HELPER_HXX
+#include "LDebug.hxx"
+#endif
+#include <map>
+
+using namespace ::comphelper;
+using namespace connectivity;
+using namespace connectivity::evoab;
+using namespace connectivity::file;
+using namespace ::cppu;
+using namespace utl;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::ucb;
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::sdbcx;
+using namespace ::com::sun::star::sdbc;
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::lang;
+
+// -------------------------------------------------------------------------
+void OEvoabTable::fillColumns(const ::com::sun::star::lang::Locale& _aLocale)
+{
+ BOOL bRead = TRUE;
+
+ QuotedTokenizedString aHeaderLine;
+ OEvoabConnection* pConnection = (OEvoabConnection*)m_pConnection;
+ if (pConnection->isHeaderLine())
+ {
+ while(bRead && !aHeaderLine.Len())
+ {
+ bRead = m_pFileStream->ReadByteStringLine(aHeaderLine,pConnection->getTextEncoding());
+ }
+ }
+
+ // read first row
+ QuotedTokenizedString aFirstLine;
+ bRead = m_pFileStream->ReadByteStringLine(aFirstLine,pConnection->getTextEncoding());
+
+ if (!pConnection->isHeaderLine() || !aHeaderLine.Len())
+ {
+ while(bRead && !aFirstLine.Len())
+ {
+ bRead = m_pFileStream->ReadByteStringLine(aFirstLine,pConnection->getTextEncoding());
+ }
+ // use first row as headerline because we need the number of columns
+ aHeaderLine = aFirstLine;
+ }
+ // column count
+ xub_StrLen nFieldCount = aHeaderLine.GetTokenCount(pConnection->getFieldDelimiter(),pConnection->getStringDelimiter());
+
+ if(!m_aColumns.isValid())
+ m_aColumns = new OSQLColumns();
+ else
+ m_aColumns->get().clear();
+
+ m_aTypes.clear();
+ m_aPrecisions.clear();
+ m_aScales.clear();
+ // reserve some space
+ m_aColumnRawNames.reserve(nFieldCount);
+ m_aColumns->get().reserve(nFieldCount);
+ m_aTypes.reserve(nFieldCount);
+ m_aPrecisions.reserve(nFieldCount);
+ m_aScales.reserve(nFieldCount);
+
+ sal_Bool bCase = getConnection()->getMetaData()->storesMixedCaseQuotedIdentifiers();
+ CharClass aCharClass(pConnection->getDriver()->getFactory(),_aLocale);
+ // read description
+ sal_Unicode cDecimalDelimiter = pConnection->getDecimalDelimiter();
+ sal_Unicode cThousandDelimiter = pConnection->getThousandDelimiter();
+ String aColumnName;
+ ::rtl::OUString aTypeName;
+ ::comphelper::UStringMixEqual aCase(bCase);
+ xub_StrLen nStartPosHeaderLine = 0; // use for eficient way to get the tokens
+ xub_StrLen nStartPosFirstLine = 0; // use for eficient way to get the tokens
+ xub_StrLen nStartPosFirstLine2 = 0;
+ for (xub_StrLen i = 0; i < nFieldCount; i++)
+ {
+ if (pConnection->isHeaderLine())
+ {
+ aHeaderLine.GetTokenSpecial(aColumnName,nStartPosHeaderLine,pConnection->getFieldDelimiter(),pConnection->getStringDelimiter());
+ }
+ else
+ {
+ // no column name so ...
+ aColumnName = 'C';
+ aColumnName += String::CreateFromInt32(i+1);
+ }
+ //OSL_TRACE("OEvoabTable::aColumnName = %s\n", ((OUtoCStr(::rtl::OUString(aColumnName))) ? (OUtoCStr(::rtl::OUString(aColumnName))):("NULL")) );
+
+ sal_Int32 eType;
+ UINT16 nPrecision = 0;
+ UINT16 nScale = 0;
+
+ BOOL bNumeric = FALSE;
+ ULONG nIndex = 0;
+
+ // first without fielddelimiter
+ String aField;
+ aFirstLine.GetTokenSpecial(aField,nStartPosFirstLine,pConnection->getFieldDelimiter(),'\0');
+ //OSL_TRACE("OEvoabTable::aField = %s\n", ((OUtoCStr(::rtl::OUString(aField))) ? (OUtoCStr(::rtl::OUString(aField))):("NULL")) );
+
+ if (aField.Len() == 0 ||
+ (pConnection->getStringDelimiter() && pConnection->getStringDelimiter() == aField.GetChar(0)))
+ {
+ bNumeric = FALSE;
+ }
+ else
+ {
+ String aField2;
+ if ( pConnection->getStringDelimiter() != '\0' )
+ aFirstLine.GetTokenSpecial(aField2,nStartPosFirstLine2,pConnection->getFieldDelimiter(),pConnection->getStringDelimiter());
+ else
+ aField2 = aField;
+
+ //OSL_TRACE("OEvoabTable::aField2 = %s\n", ((OUtoCStr(::rtl::OUString(aField2))) ? (OUtoCStr(::rtl::OUString(aField2))):("NULL")) );
+
+ if (aField2.Len() == 0)
+ {
+ bNumeric = FALSE;
+ }
+ else
+ {
+ bNumeric = TRUE;
+ xub_StrLen nDot = 0;
+ for (xub_StrLen j = 0; j < aField2.Len(); j++)
+ {
+ sal_Unicode c = aField2.GetChar(j);
+ // nur Ziffern und Dezimalpunkt und Tausender-Trennzeichen?
+ if ((!cDecimalDelimiter || c != cDecimalDelimiter) &&
+ (!cThousandDelimiter || c != cThousandDelimiter) &&
+ !aCharClass.isDigit(aField2,j))
+ {
+ bNumeric = FALSE;
+ break;
+ }
+ if (cDecimalDelimiter && c == cDecimalDelimiter)
+ {
+ nPrecision = 15; // we have an decimal value
+ nScale = 2;
+ nDot++;
+ }
+ }
+
+ if (nDot > 1) // if there is more than one dot it isn't a number
+ bNumeric = FALSE;
+ if (bNumeric && cThousandDelimiter)
+ {
+ // Ist der Trenner richtig angegeben?
+ String aValue = aField2.GetToken(0,cDecimalDelimiter);
+ for (sal_Int32 j = aValue.Len() - 4; j >= 0; j -= 4)
+ {
+ sal_Unicode c = aValue.GetChar(j);
+ // nur Ziffern und Dezimalpunkt und Tausender-Trennzeichen?
+ if (c == cThousandDelimiter && j)
+ continue;
+ else
+ {
+ bNumeric = FALSE;
+ break;
+ }
+ }
+ }
+
+ // jetzt koennte es noch ein Datumsfeld sein
+ if (!bNumeric)
+ {
+ try
+ {
+ nIndex = m_xNumberFormatter->detectNumberFormat(::com::sun::star::util::NumberFormat::ALL,aField2);
+ }
+ catch(Exception&)
+ {
+ }
+ }
+ }
+ }
+
+ sal_Int32 nFlags = 0;
+ if (bNumeric)
+ {
+ if (cDecimalDelimiter)
+ {
+ if(nPrecision)
+ {
+ eType = DataType::DECIMAL;
+ aTypeName = ::rtl::OUString::createFromAscii("DECIMAL");
+ }
+ else
+ {
+ eType = DataType::DOUBLE;
+ aTypeName = ::rtl::OUString::createFromAscii("DOUBLE");
+ }
+ }
+ else
+ eType = DataType::INTEGER;
+ nFlags = ColumnSearch::BASIC;
+ }
+ else
+ {
+
+ switch (comphelper::getNumberFormatType(m_xNumberFormatter,nIndex))
+ {
+ case NUMBERFORMAT_DATE:
+ eType = DataType::DATE;
+ aTypeName = ::rtl::OUString::createFromAscii("DATE");
+ break;
+ case NUMBERFORMAT_DATETIME:
+ eType = DataType::TIMESTAMP;
+ aTypeName = ::rtl::OUString::createFromAscii("TIMESTAMP");
+ break;
+ case NUMBERFORMAT_TIME:
+ eType = DataType::TIME;
+ aTypeName = ::rtl::OUString::createFromAscii("TIME");
+ break;
+ default:
+ eType = DataType::VARCHAR;
+ nPrecision = 0; // nyi: Daten koennen aber laenger sein!
+ nScale = 0;
+ aTypeName = ::rtl::OUString::createFromAscii("VARCHAR");
+ };
+ nFlags |= ColumnSearch::CHAR;
+ }
+
+ // check if the columname already exists
+ String aAlias(aColumnName);
+ OSQLColumns::Vector::const_iterator aFind = connectivity::find(m_aColumns->get().begin(),m_aColumns->get().end(),aAlias,aCase);
+ sal_Int32 nExprCnt = 0;
+ while(aFind != m_aColumns->get().end())
+ {
+ (aAlias = aColumnName) += String::CreateFromInt32(++nExprCnt);
+ aFind = connectivity::find(m_aColumns->get().begin(),m_aColumns->get().end(),aAlias,aCase);
+ }
+
+ m_aColumnRawNames.push_back(::rtl::OUString(aAlias));
+
+ //~ sdbcx::OColumn* pColumn = new sdbcx::OColumn(aAlias,aTypeName,::rtl::OUString(),
+ //~ ColumnValue::NULLABLE,
+ //~ nPrecision,
+ //~ nScale,
+ //~ eType,
+ //~ sal_False,
+ //~ sal_False,
+ //~ sal_False,
+ //~ bCase);
+ //~ Reference< XPropertySet> xCol = pColumn;
+ //~ m_aColumns->push_back(xCol);
+ m_aTypes.push_back(eType);
+ m_aPrecisions.push_back(nPrecision);
+ m_aScales.push_back(nScale);
+ }
+ setColumnAliases();
+ m_pFileStream->Seek(STREAM_SEEK_TO_BEGIN);
+}
+// -------------------------------------------------------------------------
+OEvoabTable::OEvoabTable(sdbcx::OCollection* _pTables,OEvoabConnection* _pConnection) : OEvoabTable_BASE(_pTables,_pConnection)
+{
+
+}
+// -------------------------------------------------------------------------
+OEvoabTable::OEvoabTable(sdbcx::OCollection* _pTables,OEvoabConnection* _pConnection,
+ const ::rtl::OUString& _Name,
+ const ::rtl::OUString& _Type,
+ const ::rtl::OUString& _Description ,
+ const ::rtl::OUString& _SchemaName,
+ const ::rtl::OUString& _CatalogName
+ ) : OEvoabTable_BASE(_pTables,_pConnection,_Name,
+ _Type,
+ _Description,
+ _SchemaName,
+ _CatalogName)
+ ,m_nRowPos(0)
+ ,m_nMaxRowCount(0)
+{
+ //~ OSL_TRACE("OEvoabTable::(in constructor)_Name = %s\n", ((OUtoCStr(_Name)) ? (OUtoCStr(_Name)):("NULL")) );
+ //~ OSL_TRACE("OEvoabTable::(in constructor)_Type = %s\n", ((OUtoCStr(_Type)) ? (OUtoCStr(_Type)):("NULL")) );
+ //~ OSL_TRACE("OEvoabTable::(in constructor)_Description = %s\n", ((OUtoCStr(_Description)) ? (OUtoCStr(_Description)):("NULL")) );
+ //~ OSL_TRACE("OEvoabTable::(in constructor)_SchemaName = %s\n", ((OUtoCStr(_SchemaName)) ? (OUtoCStr(_SchemaName)):("NULL")) );
+ //~ OSL_TRACE("OEvoabTable::(in constructor)_CatalogName = %s\n", ((OUtoCStr(_CatalogName)) ? (OUtoCStr(_CatalogName)):("NULL")) );
+}
+// -----------------------------------------------------------------------------
+void OEvoabTable::construct()
+{
+ SvtSysLocale aLocale;
+ ::com::sun::star::lang::Locale aAppLocale(aLocale.GetLocaleDataPtr()->getLocale());
+ Sequence< ::com::sun::star::uno::Any > aArg(1);
+ aArg[0] <<= aAppLocale;
+
+ Reference< ::com::sun::star::util::XNumberFormatsSupplier > xSupplier(m_pConnection->getDriver()->getFactory()->createInstanceWithArguments(::rtl::OUString::createFromAscii("com.sun.star.util.NumberFormatsSupplier"),aArg),UNO_QUERY);
+ m_xNumberFormatter = Reference< ::com::sun::star::util::XNumberFormatter >(m_pConnection->getDriver()->getFactory()->createInstance(::rtl::OUString::createFromAscii("com.sun.star.util.NumberFormatter")),UNO_QUERY);
+ m_xNumberFormatter->attachNumberFormatsSupplier(xSupplier);
+
+ INetURLObject aURL;
+ aURL.SetURL(getEntry());
+
+ if(aURL.getExtension() != rtl::OUString(m_pConnection->getExtension()))
+ aURL.setExtension(m_pConnection->getExtension());
+
+ String aFileName = aURL.GetMainURL(INetURLObject::NO_DECODE);
+
+ m_pFileStream = createStream_simpleError( aFileName,STREAM_READWRITE | STREAM_NOCREATE | STREAM_SHARE_DENYWRITE);
+
+ if(!m_pFileStream)
+ m_pFileStream = createStream_simpleError( aFileName,STREAM_READ | STREAM_NOCREATE | STREAM_SHARE_DENYNONE);
+
+ if(m_pFileStream)
+ {
+ OSL_TRACE("OEvoabTable::construct()::m_pFileStream created\n" );
+ m_pFileStream->Seek(STREAM_SEEK_TO_END);
+ sal_Int32 nSize = m_pFileStream->Tell();
+ m_pFileStream->Seek(STREAM_SEEK_TO_BEGIN);
+
+ // Buffersize abhaengig von der Filegroesse
+ m_pFileStream->SetBufferSize(nSize > 1000000 ? 32768 :
+ nSize > 100000 ? 16384 :
+ nSize > 10000 ? 4096 : 1024);
+ OSL_TRACE("OEvoabTable::construct()::m_pFileStream->Tell() = %d\n", nSize );
+
+ fillColumns(aAppLocale);
+
+ refreshColumns();
+ }
+}
+// -------------------------------------------------------------------------
+String OEvoabTable::getEntry()
+{
+ ::rtl::OUString sURL;
+ try
+ {
+ Reference< XResultSet > xDir = m_pConnection->getDir()->getStaticResultSet();
+ Reference< XRow> xRow(xDir,UNO_QUERY);
+ ::rtl::OUString sName;
+ ::rtl::OUString sExt;
+
+ INetURLObject aURL;
+ xDir->beforeFirst();
+ static const ::rtl::OUString s_sSeparator(RTL_CONSTASCII_USTRINGPARAM("/"));
+ while(xDir->next())
+ {
+ sName = xRow->getString(1);
+ aURL.SetSmartProtocol(INET_PROT_FILE);
+ String sUrl = m_pConnection->getURL() + s_sSeparator + sName;
+ aURL.SetSmartURL( sUrl );
+
+ // cut the extension
+ sExt = aURL.getExtension();
+
+ // name and extension have to coincide
+ if ( m_pConnection->matchesExtension( sExt ) )
+ {
+ sName = sName.replaceAt(sName.getLength()-(sExt.getLength()+1),sExt.getLength()+1,::rtl::OUString());
+ if ( sName == m_Name )
+ {
+ Reference< XContentAccess > xContentAccess( xDir, UNO_QUERY );
+ sURL = xContentAccess->queryContentIdentifierString();
+ break;
+ }
+ }
+ }
+ xDir->beforeFirst(); // move back to before first record
+ }
+ catch(Exception&)
+ {
+ OSL_ASSERT(0);
+ }
+ return sURL.getStr();
+}
+// -------------------------------------------------------------------------
+void OEvoabTable::refreshColumns()
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ TStringVector aVector;
+ aVector.reserve(m_aColumns->get().size());
+
+ for(OSQLColumns::Vector::const_iterator aIter = m_aColumns->get().begin();aIter != m_aColumns->get().end();++aIter)
+ aVector.push_back(Reference< XNamed>(*aIter,UNO_QUERY)->getName());
+
+ if(m_pColumns)
+ m_pColumns->reFill(aVector);
+ else
+ m_pColumns = new OEvoabColumns(this,m_aMutex,aVector);
+
+ OSL_TRACE("OEvoabTable::refreshColumns()::end\n" );
+}
+
+// -------------------------------------------------------------------------
+void SAL_CALL OEvoabTable::disposing(void)
+{
+ OFileTable::disposing();
+ ::osl::MutexGuard aGuard(m_aMutex);
+ m_aColumns = NULL;
+}
+// -------------------------------------------------------------------------
+Sequence< Type > SAL_CALL OEvoabTable::getTypes( ) throw(RuntimeException)
+{
+ Sequence< Type > aTypes = OTable_TYPEDEF::getTypes();
+ ::std::vector<Type> aOwnTypes;
+ aOwnTypes.reserve(aTypes.getLength());
+ const Type* pBegin = aTypes.getConstArray();
+ const Type* pEnd = pBegin + aTypes.getLength();
+ for(;pBegin != pEnd;++pBegin)
+ {
+ if(!(*pBegin == ::getCppuType((const Reference<XKeysSupplier>*)0) ||
+ *pBegin == ::getCppuType((const Reference<XRename>*)0) ||
+ *pBegin == ::getCppuType((const Reference<XIndexesSupplier>*)0) ||
+ *pBegin == ::getCppuType((const Reference<XAlterTable>*)0) ||
+ *pBegin == ::getCppuType((const Reference<XDataDescriptorFactory>*)0)))
+ {
+ aOwnTypes.push_back(*pBegin);
+ }
+ }
+ Type *pTypes = aOwnTypes.empty() ? 0 : &aOwnTypes[0];
+ return Sequence< Type >(pTypes, aOwnTypes.size());
+}
+
+// -------------------------------------------------------------------------
+Any SAL_CALL OEvoabTable::queryInterface( const Type & rType ) throw(RuntimeException)
+{
+ if( rType == ::getCppuType((const Reference<XKeysSupplier>*)0) ||
+ rType == ::getCppuType((const Reference<XIndexesSupplier>*)0) ||
+ rType == ::getCppuType((const Reference<XRename>*)0) ||
+ rType == ::getCppuType((const Reference<XAlterTable>*)0) ||
+ rType == ::getCppuType((const Reference<XDataDescriptorFactory>*)0))
+ return Any();
+
+ Any aRet = OTable_TYPEDEF::queryInterface(rType);
+ return aRet.hasValue() ? aRet : ::cppu::queryInterface(rType,static_cast< ::com::sun::star::lang::XUnoTunnel*> (this));
+}
+
+//--------------------------------------------------------------------------
+Sequence< sal_Int8 > OEvoabTable::getUnoTunnelImplementationId()
+{
+ static ::cppu::OImplementationId * pId = 0;
+ if (! pId)
+ {
+ ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
+ if (! pId)
+ {
+ static ::cppu::OImplementationId aId;
+ pId = &aId;
+ }
+ }
+ return pId->getImplementationId();
+}
+
+// com::sun::star::lang::XUnoTunnel
+//------------------------------------------------------------------
+sal_Int64 OEvoabTable::getSomething( const Sequence< sal_Int8 > & rId ) throw (RuntimeException)
+{
+ return (rId.getLength() == 16 && 0 == rtl_compareMemory(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) )
+ ? reinterpret_cast< sal_Int64 >( this )
+ : OEvoabTable_BASE::getSomething(rId);
+}
+//------------------------------------------------------------------
+sal_Bool OEvoabTable::fetchRow(OValueRefRow& _rRow,const OSQLColumns & _rCols,sal_Bool bIsTable,sal_Bool bRetrieveData)
+{
+ *(_rRow->get())[0] = m_nFilePos;
+
+ if (!bRetrieveData)
+ return TRUE;
+
+ OEvoabConnection* pConnection = (OEvoabConnection*)m_pConnection;
+ // Felder:
+ xub_StrLen nStartPos = 0;
+ String aStr;
+ OSQLColumns::Vector::const_iterator aIter = _rCols.get().begin();
+ for (sal_Int32 i = 0; aIter != _rCols.get().end();++aIter, ++i)
+ {
+ m_aCurrentLine.GetTokenSpecial(aStr,nStartPos,pConnection->getFieldDelimiter(),pConnection->getStringDelimiter());
+ //OSL_TRACE("OEvoabTable::fetchRow()::aStr = %s\n", ((OUtoCStr(::rtl::OUString(aStr))) ? (OUtoCStr(::rtl::OUString(aStr))):("NULL")) );
+
+ if (aStr.Len() == 0)
+ (_rRow->get())[i+1]->setNull();
+ else
+ {
+ // Laengen je nach Datentyp:
+ sal_Int32 nLen,
+ nType = 0;
+ if(bIsTable)
+ {
+ nLen = m_aPrecisions[i];
+ nType = m_aTypes[i];
+ }
+ else
+ {
+ Reference< XPropertySet> xColumn = *aIter;
+ xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PRECISION)) >>= nLen;
+ xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE)) >>= nType;
+ }
+ switch(nType)
+ {
+ case DataType::TIMESTAMP:
+ case DataType::DATE:
+ case DataType::TIME:
+ {
+ double nRes = 0.0;
+ try
+ {
+ nRes = m_xNumberFormatter->convertStringToNumber(::com::sun::star::util::NumberFormat::ALL,aStr);
+ Reference<XPropertySet> xProp(m_xNumberFormatter->getNumberFormatsSupplier()->getNumberFormatSettings(),UNO_QUERY);
+ com::sun::star::util::Date aDate;
+ xProp->getPropertyValue(::rtl::OUString::createFromAscii("NullDate")) >>= aDate;
+
+ switch(nType)
+ {
+ case DataType::DATE:
+ *(_rRow->get())[i+1] = ::dbtools::DBTypeConversion::toDouble(::dbtools::DBTypeConversion::toDate(nRes,aDate));
+ break;
+ case DataType::TIMESTAMP:
+ *(_rRow->get())[i+1] = ::dbtools::DBTypeConversion::toDouble(::dbtools::DBTypeConversion::toDateTime(nRes,aDate));
+ break;
+ default:
+ *(_rRow->get())[i+1] = ::dbtools::DBTypeConversion::toDouble(::dbtools::DBTypeConversion::toTime(nRes));
+ }
+ }
+ catch(Exception&)
+ {
+ (_rRow->get())[i+1]->setNull();
+ }
+ } break;
+ case DataType::DOUBLE:
+ case DataType::INTEGER:
+ case DataType::DECIMAL: // #99178# OJ
+ case DataType::NUMERIC:
+ {
+ sal_Unicode cDecimalDelimiter = pConnection->getDecimalDelimiter();
+ sal_Unicode cThousandDelimiter = pConnection->getThousandDelimiter();
+ String aStrConverted;
+
+ OSL_ENSURE(cDecimalDelimiter && nType != DataType::INTEGER ||
+ !cDecimalDelimiter && nType == DataType::INTEGER,
+ "FalscherTyp");
+
+ // In Standard-Notation (DezimalPUNKT ohne Tausender-Komma) umwandeln:
+ for (xub_StrLen j = 0; j < aStr.Len(); ++j)
+ {
+ if (cDecimalDelimiter && aStr.GetChar(j) == cDecimalDelimiter)
+ aStrConverted += '.';
+ else if ( aStr.GetChar(j) == '.' ) // special case, if decimal seperator isn't '.' we have to vut the string after it
+ break; // #99189# OJ
+ else if (cThousandDelimiter && aStr.GetChar(j) == cThousandDelimiter)
+ {
+ // weglassen
+ }
+ else
+ aStrConverted += aStr.GetChar(j) ;
+ }
+ double nVal = ::rtl::math::stringToDouble(aStrConverted.GetBuffer(),',','.',NULL,NULL);
+
+ // #99178# OJ
+ if ( DataType::DECIMAL == nType || DataType::NUMERIC == nType )
+ *(_rRow->get())[i+1] = ORowSetValue(String::CreateFromDouble(nVal));
+ else
+ *(_rRow->get())[i+1] = nVal;
+ } break;
+
+ default:
+ {
+ // Wert als String in Variable der Row uebernehmen
+ *(_rRow->get())[i+1] = ORowSetValue(aStr);
+ }
+ break;
+ }
+ }
+ }
+ return sal_True;
+}
+// -----------------------------------------------------------------------------
+sal_Bool OEvoabTable::setColumnAliases()
+{
+
+ size_t nSize = m_aColumnRawNames.size();
+ if(nSize == 0 || m_aPrecisions.size() != nSize || m_aScales.size() != nSize || m_aTypes.size() != nSize)
+ return sal_False;
+ m_aColumns->get().clear();
+ m_aColumns->get().reserve(nSize);
+ ::rtl::OUString aColumnReadName;
+ ::rtl::OUString aColumnHeadlineName;
+ ::rtl::OUString aColumnDisplayName;
+ ::rtl::OUString aColumnFinalName;
+ String sColumnFinalName;
+
+ const TStringVector& colAliasNames = ((OEvoabConnection*)m_pConnection)->getColumnAlias().getAlias();
+ const ::std::map< ::rtl::OUString, ::rtl::OUString > & colMap = ((OEvoabConnection*)m_pConnection)->getColumnAlias().getAliasMap();
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ for(size_t i = 0;i < nSize; ++i)
+ {
+ aColumnReadName = m_aColumnRawNames[i];
+ //OSL_TRACE("OEvoabTable::getColumnRows()::aColumnReadName = %s\n", ((OUtoCStr(aColumnReadName)) ? (OUtoCStr(aColumnReadName)):("NULL")) );
+ sal_Bool bFound = sal_False;
+ for ( size_t j = 0; j < colAliasNames.size(); ++j )
+ {
+ aColumnDisplayName = colAliasNames[j];
+
+ ::std::map< ::rtl::OUString, ::rtl::OUString >::const_iterator aPos = colMap.find( aColumnDisplayName );
+ if ( colMap.end() != aPos )
+ {
+ aColumnHeadlineName = aPos->second;
+ EVO_TRACE_STRING( "OEvoabTable::getColumnRows()::aColumnDisplayName = %s\n", aColumnDisplayName );
+ EVO_TRACE_STRING( "OEvoabTable::getColumnRows()::aColumnHeadlineName= %s\n", aColumnHeadlineName );
+ if(aColumnReadName == aColumnHeadlineName)
+ {
+ //OSL_TRACE("OEvoabTable::getColumnRows()::aColumnHeadlineName = %s\n", ((OUtoCStr(aColumnHeadlineName)) ? (OUtoCStr(aColumnHeadlineName)):("NULL")) );
+ //OSL_TRACE("OEvoabTable::getColumnRows()::aColumnDisplayName = %s\n", ((OUtoCStr(aColumnDisplayName)) ? (OUtoCStr(aColumnDisplayName)):("NULL")) );
+ aColumnFinalName = aColumnDisplayName;
+ bFound = sal_True;
+ //OSL_TRACE("OEvoabTable::getColumnRows()::j = %d\n", j );
+
+ break;
+ }
+ }
+ else
+ OSL_ENSURE( sal_False, "OEvoabTable::setColumnAliases: did not find one of the aliases!" );
+ }
+ if(!bFound)
+ aColumnFinalName = aColumnReadName;
+ sColumnFinalName = aColumnFinalName;
+
+ sal_Bool bCase = getConnection()->getMetaData()->storesMixedCaseQuotedIdentifiers();
+ ::rtl::OUString aTypeName;
+ aTypeName = ::rtl::OUString::createFromAscii("VARCHAR");
+ sdbcx::OColumn* pColumn = new sdbcx::OColumn(sColumnFinalName,aTypeName,::rtl::OUString(),
+ ColumnValue::NULLABLE,
+ m_aPrecisions[i],
+ m_aScales[i],
+ m_aTypes[i],
+ sal_False,
+ sal_False,
+ sal_False,
+ bCase);
+ Reference< XPropertySet> xCol = pColumn;
+ m_aColumns->get().push_back(xCol);
+ }
+ return sal_True;
+}
+// -----------------------------------------------------------------------------
+void OEvoabTable::refreshIndexes()
+{
+}
+// -----------------------------------------------------------------------------
+sal_Bool OEvoabTable::checkHeaderLine()
+{
+ if (m_nFilePos == 0 && ((OEvoabConnection*)m_pConnection)->isHeaderLine())
+ {
+ BOOL bRead2;
+ do
+ {
+ bRead2 = m_pFileStream->ReadByteStringLine(m_aCurrentLine,m_pConnection->getTextEncoding());
+ }
+ while(bRead2 && !m_aCurrentLine.Len());
+
+ m_nFilePos = m_pFileStream->Tell();
+ if (m_pFileStream->IsEof())
+ return sal_False;
+ }
+ return sal_True;
+}
+//------------------------------------------------------------------
+sal_Bool OEvoabTable::seekRow(IResultSetHelper::Movement eCursorPosition, sal_Int32 nOffset, sal_Int32& nCurPos)
+{
+ //OSL_TRACE("OEvoabTable::(before SeekRow)m_aCurrentLine = %d\n", ((OUtoCStr(::rtl::OUString(m_aCurrentLine))) ? (OUtoCStr(::rtl::OUString(m_aCurrentLine))):("NULL")) );
+
+ if ( !m_pFileStream )
+ return sal_False;
+ OEvoabConnection* pConnection = (OEvoabConnection*)m_pConnection;
+ // ----------------------------------------------------------
+ // Positionierung vorbereiten:
+ //OSL_TRACE("OEvoabTable::(before SeekRow,m_pFileStriam Exist)m_aCurrentLine = %d\n", ((OUtoCStr(::rtl::OUString(m_aCurrentLine))) ? (OUtoCStr(::rtl::OUString(m_aCurrentLine))):("NULL")) );
+
+ m_nFilePos = nCurPos;
+
+ switch(eCursorPosition)
+ {
+ case IResultSetHelper::FIRST:
+ m_nFilePos = 0;
+ m_nRowPos = 1;
+ // run through
+ case IResultSetHelper::NEXT:
+ if(eCursorPosition != IResultSetHelper::FIRST)
+ ++m_nRowPos;
+ m_pFileStream->Seek(m_nFilePos);
+ if (m_pFileStream->IsEof() || !checkHeaderLine())
+ {
+ m_nMaxRowCount = m_nRowPos;
+ return sal_False;
+ }
+
+ m_aRowToFilePos.insert(::std::map<sal_Int32,sal_Int32>::value_type(m_nRowPos,m_nFilePos));
+
+ m_pFileStream->ReadByteStringLine(m_aCurrentLine,pConnection->getTextEncoding());
+ if (m_pFileStream->IsEof())
+ {
+ m_nMaxRowCount = m_nRowPos;
+ return sal_False;
+ }
+ nCurPos = m_pFileStream->Tell();
+ break;
+ case IResultSetHelper::PRIOR:
+ --m_nRowPos;
+ if(m_nRowPos > 0)
+ {
+ m_nFilePos = m_aRowToFilePos.find(m_nRowPos)->second;
+ m_pFileStream->Seek(m_nFilePos);
+ if (m_pFileStream->IsEof() || !checkHeaderLine())
+ return sal_False;
+ m_pFileStream->ReadByteStringLine(m_aCurrentLine,pConnection->getTextEncoding());
+ if (m_pFileStream->IsEof())
+ return sal_False;
+ nCurPos = m_pFileStream->Tell();
+ }
+ else
+ m_nRowPos = 0;
+
+ break;
+ case IResultSetHelper::LAST:
+ if(m_nMaxRowCount)
+ {
+ m_nFilePos = m_aRowToFilePos.rbegin()->second;
+ m_nRowPos = m_aRowToFilePos.rbegin()->first;
+ m_pFileStream->Seek(m_nFilePos);
+ if (m_pFileStream->IsEof() || !checkHeaderLine())
+ return sal_False;
+ m_pFileStream->ReadByteStringLine(m_aCurrentLine,pConnection->getTextEncoding());
+ if (m_pFileStream->IsEof())
+ return sal_False;
+ nCurPos = m_pFileStream->Tell();
+ }
+ else
+ {
+ while(seekRow(IResultSetHelper::NEXT,1,nCurPos)) ; // run through after last row
+ // now I know all
+ seekRow(IResultSetHelper::PRIOR,1,nCurPos);
+ }
+ break;
+ case IResultSetHelper::RELATIVE:
+ if(nOffset > 0)
+ {
+ for(sal_Int32 i = 0;i<nOffset;++i)
+ seekRow(IResultSetHelper::NEXT,1,nCurPos);
+ }
+ else if(nOffset < 0)
+ {
+ for(sal_Int32 i = nOffset;i;++i)
+ seekRow(IResultSetHelper::PRIOR,1,nCurPos);
+ }
+ break;
+ case IResultSetHelper::ABSOLUTE:
+ {
+ if(nOffset < 0)
+ nOffset = m_nRowPos + nOffset;
+ ::std::map<sal_Int32,sal_Int32>::const_iterator aIter = m_aRowToFilePos.find(nOffset);
+ if(aIter != m_aRowToFilePos.end())
+ {
+ m_nFilePos = aIter->second;
+ m_pFileStream->Seek(m_nFilePos);
+ if (m_pFileStream->IsEof() || !checkHeaderLine())
+ return sal_False;
+ m_pFileStream->ReadByteStringLine(m_aCurrentLine,pConnection->getTextEncoding());
+ if (m_pFileStream->IsEof())
+ return sal_False;
+ nCurPos = m_pFileStream->Tell();
+ }
+ else if(m_nMaxRowCount && nOffset > m_nMaxRowCount) // offset is outside the table
+ {
+ m_nRowPos = m_nMaxRowCount;
+ return sal_False;
+ }
+ else
+ {
+ aIter = m_aRowToFilePos.upper_bound(nOffset);
+ if(aIter == m_aRowToFilePos.end())
+ {
+ m_nRowPos = m_aRowToFilePos.rbegin()->first;
+ nCurPos = m_nFilePos = m_aRowToFilePos.rbegin()->second;
+ while(m_nRowPos != nOffset)
+ seekRow(IResultSetHelper::NEXT,1,nCurPos);
+ }
+ else
+ {
+ --aIter;
+ m_nRowPos = aIter->first;
+ m_nFilePos = aIter->second;
+ m_pFileStream->Seek(m_nFilePos);
+ if (m_pFileStream->IsEof() || !checkHeaderLine())
+ return sal_False;
+ m_pFileStream->ReadByteStringLine(m_aCurrentLine,pConnection->getTextEncoding());
+ if (m_pFileStream->IsEof())
+ return sal_False;
+ nCurPos = m_pFileStream->Tell();
+ }
+ }
+ }
+
+ break;
+ case IResultSetHelper::BOOKMARK:
+ m_pFileStream->Seek(nOffset);
+ if (m_pFileStream->IsEof())
+ return sal_False;
+
+ m_nFilePos = m_pFileStream->Tell(); // Byte-Position in der Datei merken (am ZeilenANFANG)
+ m_pFileStream->ReadByteStringLine(m_aCurrentLine,pConnection->getTextEncoding());
+ if (m_pFileStream->IsEof())
+ return sal_False;
+ nCurPos = m_pFileStream->Tell();
+ break;
+ }
+
+ //OSL_TRACE("OEvoabTable::(after SeekRow)m_aCurrentLine = %d\n", ((OUtoCStr(::rtl::OUString(m_aCurrentLine))) ? (OUtoCStr(::rtl::OUString(m_aCurrentLine))):("NULL")) );
+
+ return sal_True;
+}
+// -----------------------------------------------------------------------------
diff --git a/connectivity/source/drivers/evoab/LTable.hxx b/connectivity/source/drivers/evoab/LTable.hxx
new file mode 100644
index 0000000000..20a65dba16
--- /dev/null
+++ b/connectivity/source/drivers/evoab/LTable.hxx
@@ -0,0 +1,103 @@
+/*************************************************************************
+ *
+ * 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: LTable.hxx,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.
+ *
+ ************************************************************************/
+
+#ifndef _CONNECTIVITY_EVOAB_LTABLE_HXX_
+#define _CONNECTIVITY_EVOAB_LTABLE_HXX_
+
+#include "file/FTable.hxx"
+#include "connectivity/sdbcx/VColumn.hxx"
+#include "connectivity/CommonTools.hxx"
+#include <tools/urlobj.hxx>
+#include "file/quotedstring.hxx"
+#include <vector>
+
+namespace connectivity
+{
+ namespace evoab
+ {
+ typedef file::OFileTable OEvoabTable_BASE;
+ class OEvoabConnection;
+
+ typedef ::std::map< ::rtl::OUString,
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XNamed>, comphelper::UStringMixLess > OContainer;
+
+ class OEvoabTable : public OEvoabTable_BASE
+ {
+ private:
+ // maps a row postion to a file position
+ ::std::map<sal_Int32,sal_Int32> m_aRowToFilePos;
+ ::std::vector<sal_Int32> m_aTypes; // holds all type for columns just to avoid to ask the propertyset
+ ::std::vector<sal_Int32> m_aPrecisions; // same as aboth
+ ::std::vector<sal_Int32> m_aScales;
+ QuotedTokenizedString m_aCurrentLine;
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter > m_xNumberFormatter;
+ sal_Int32 m_nRowPos;
+ sal_Int32 m_nMaxRowCount; // will be set if stream is once eof
+ ::std::vector< ::rtl::OUString> m_aColumnRawNames;
+ sal_Bool setColumnAliases();
+ void fillColumns(const ::com::sun::star::lang::Locale& _aLocale);
+ sal_Bool checkHeaderLine();
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XFastPropertySet> isUniqueByColumnName(const ::rtl::OUString& _rColName);
+
+ public:
+ virtual void refreshColumns();
+ virtual void refreshIndexes();
+
+ public:
+ // DECLARE_CTY_DEFAULTS( OFlatTable_BASE);
+ OEvoabTable( sdbcx::OCollection* _pTables,OEvoabConnection* _pConnection);
+ OEvoabTable( sdbcx::OCollection* _pTables,OEvoabConnection* _pConnection,
+ const ::rtl::OUString& _Name,
+ const ::rtl::OUString& _Type,
+ const ::rtl::OUString& _Description = ::rtl::OUString(),
+ const ::rtl::OUString& _SchemaName = ::rtl::OUString(),
+ const ::rtl::OUString& _CatalogName = ::rtl::OUString()
+ );
+
+ void construct(); // can throw any exception
+
+ virtual sal_Bool seekRow(IResultSetHelper::Movement eCursorPosition, sal_Int32 nOffset, sal_Int32& nCurPos);
+ virtual sal_Bool fetchRow(OValueRefRow& _rRow,const OSQLColumns& _rCols, sal_Bool bIsTable,sal_Bool bRetrieveData);
+
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ //XTypeProvider
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL disposing(void);
+
+ // com::sun::star::lang::XUnoTunnel
+ virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
+ static ::com::sun::star::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
+
+ String getEntry();
+ };
+ }
+}
+#endif // _CONNECTIVITY_EVOAB_LTABLE_HXX_
+
diff --git a/connectivity/source/drivers/evoab/LTables.cxx b/connectivity/source/drivers/evoab/LTables.cxx
new file mode 100644
index 0000000000..11ece8210a
--- /dev/null
+++ b/connectivity/source/drivers/evoab/LTables.cxx
@@ -0,0 +1,65 @@
+/*************************************************************************
+ *
+ * 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: LTables.cxx,v $
+ * $Revision: 1.6 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_connectivity.hxx"
+#include "LTables.hxx"
+#include "LTable.hxx"
+#include <com/sun/star/sdbc/XRow.hpp>
+#include <com/sun/star/sdbc/XResultSet.hpp>
+#include <com/sun/star/sdbc/ColumnValue.hpp>
+#include <com/sun/star/sdbc/KeyRule.hpp>
+#include <com/sun/star/sdbcx/KeyType.hpp>
+#include "file/FCatalog.hxx"
+#include "file/FConnection.hxx"
+#include <comphelper/types.hxx>
+
+using namespace connectivity;
+using namespace ::comphelper;
+using namespace connectivity::evoab;
+using namespace connectivity::file;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::sdbcx;
+using namespace ::com::sun::star::sdbc;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::container;
+namespace starutil = ::com::sun::star::util;
+
+sdbcx::ObjectType OEvoabTables::createObject(const ::rtl::OUString& _rName)
+{
+ OEvoabTable* pRet = new OEvoabTable(this,(OEvoabConnection*)static_cast<OFileCatalog&>(m_rParent).getConnection(),
+ _rName,::rtl::OUString::createFromAscii("TABLE"));
+ sdbcx::ObjectType xRet = pRet;
+ pRet->construct();
+ return xRet;
+}
+// -------------------------------------------------------------------------
+
diff --git a/connectivity/source/drivers/evoab/LTables.hxx b/connectivity/source/drivers/evoab/LTables.hxx
new file mode 100644
index 0000000000..656607193d
--- /dev/null
+++ b/connectivity/source/drivers/evoab/LTables.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: LTables.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 _CONNECTIVITY_EVOAB_LTABLES_HXX_
+#define _CONNECTIVITY_EVOAB_LTABLES_HXX_
+
+#include "file/FTables.hxx"
+
+namespace connectivity
+{
+ namespace evoab
+ {
+ // namespace ::com::sun::star::sdbcx = ::com::sun::star::sdbcx;
+ typedef file::OTables OEvoabTables_BASE;
+
+ class OEvoabTables : public OEvoabTables_BASE
+ {
+ protected:
+ virtual sdbcx::ObjectType createObject(const ::rtl::OUString& _rName);
+ public:
+ OEvoabTables(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _rMetaData,::cppu::OWeakObject& _rParent, ::osl::Mutex& _rMutex,
+ const TStringVector &_rVector) : OEvoabTables_BASE(_rMetaData,_rParent,_rMutex,_rVector)
+ {}
+ };
+ }
+}
+#endif // _CONNECTIVITY_EVOAB_LTABLES_HXX_
+
diff --git a/connectivity/source/drivers/evoab/evoab.map b/connectivity/source/drivers/evoab/evoab.map
new file mode 100644
index 0000000000..00cf7191f1
--- /dev/null
+++ b/connectivity/source/drivers/evoab/evoab.map
@@ -0,0 +1,8 @@
+EVOAB_1_0 {
+ global:
+ component_getImplementationEnvironment;
+ component_writeInfo;
+ component_getFactory;
+ local:
+ *;
+};
diff --git a/connectivity/source/drivers/evoab/evoab.xcu b/connectivity/source/drivers/evoab/evoab.xcu
new file mode 100644
index 0000000000..947c639bc6
--- /dev/null
+++ b/connectivity/source/drivers/evoab/evoab.xcu
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--***********************************************************************
+ *
+ * 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: DataAccess.xcu,v $
+ * $Revision: 1.27 $
+ *
+ * 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.
+ *
+ ************************************************************************ -->
+<oor:component-data oor:name="Drivers" oor:package="org.openoffice.Office.DataAccess" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+ <node oor:name="Installed">
+ <node oor:name="sdbc:address:evolution:ldap" oor:op="replace">
+ <prop oor:name="Driver">
+ <value>com.sun.star.comp.sdbc.evoab.OEvoabDriver</value>
+ </prop>
+ <prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
+ <value xml:lang="en-US">Evolution LDAP</value>
+ </prop>
+ <node oor:name="Features">
+ <node oor:name="EscapeDateTime" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ </node>
+ </node>
+ <node oor:name="sdbc:address:evolution:groupwise" oor:op="replace">
+ <prop oor:name="Driver">
+ <value>com.sun.star.comp.sdbc.evoab.OEvoabDriver</value>
+ </prop>
+ <prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
+ <value xml:lang="en-US">Groupwise</value>
+ </prop>
+ <node oor:name="Features">
+ <node oor:name="EscapeDateTime" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ </node>
+ </node>
+ </node>
+</oor:component-data>
diff --git a/connectivity/source/drivers/evoab/evoab.xml b/connectivity/source/drivers/evoab/evoab.xml
new file mode 100644
index 0000000000..fbf5aac136
--- /dev/null
+++ b/connectivity/source/drivers/evoab/evoab.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE module-description PUBLIC "-//W3C//DTD HTML 3.2//EN" "module-description.dtd">
+<module-description>
+ <module-name>file</module-name>
+ <component-description>
+ <author>Xibei(Berry) Jia</author>
+ <name>com.sun.star.comp.sdbc.evoab.OEvoabDriver</name>
+ <description>This library implements the database driver for evolution address book formats.
+</description>
+ <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
+ <language>c++</language>
+ <status value="final"/>
+ <supported-service>com.sun.star.sdbc.Driver</supported-service>
+ <supported-service>com.sun.star.sdbcx.Driver</supported-service>
+ <service-dependency> ... </service-dependency>
+ </component-description>
+ <project-build-dependency>cppuhelper</project-build-dependency>
+ <project-build-dependency>cppu</project-build-dependency>
+ <project-build-dependency>sal</project-build-dependency>
+ <project-build-dependency>vos</project-build-dependency>
+ <runtime-module-dependency>file</runtime-module-dependency>
+ <runtime-module-dependency>cppuhelper</runtime-module-dependency>
+ <runtime-module-dependency>cppu</runtime-module-dependency>
+ <runtime-module-dependency>sal</runtime-module-dependency>
+ <runtime-module-dependency>vos</runtime-module-dependency>
+ <runtime-module-dependency>osl</runtime-module-dependency>
+ <runtime-module-dependency>svtools-light1</runtime-module-dependency>
+ <runtime-module-dependency>svtools</runtime-module-dependency>
+ <runtime-module-dependency>ucbhelper</runtime-module-dependency>
+ <runtime-module-dependency>dbtools</runtime-module-dependency>
+ <runtime-module-dependency>unotools</runtime-module-dependency>
+ <runtime-module-dependency>comphelper</runtime-module-dependency>
+</module-description>
diff --git a/connectivity/source/drivers/evoab/exports.dxp b/connectivity/source/drivers/evoab/exports.dxp
new file mode 100644
index 0000000000..9630d7e067
--- /dev/null
+++ b/connectivity/source/drivers/evoab/exports.dxp
@@ -0,0 +1,3 @@
+component_getImplementationEnvironment
+component_writeInfo
+component_getFactory
diff --git a/connectivity/source/drivers/evoab/makefile.mk b/connectivity/source/drivers/evoab/makefile.mk
new file mode 100644
index 0000000000..8982322513
--- /dev/null
+++ b/connectivity/source/drivers/evoab/makefile.mk
@@ -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: makefile.mk,v $
+#
+# $Revision: 1.9 $
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+PRJ=..$/..$/..
+PRJINC=..$/..
+PRJNAME=connectivity
+TARGET=evoab
+
+VISIBILITY_HIDDEN=TRUE
+
+# --- Settings ----------------------------------
+.IF "$(DBGUTIL_OJ)"!=""
+ENVCFLAGS+=/FR$(SLO)$/
+.ENDIF
+
+.INCLUDE : $(PRJ)$/version.mk
+.INCLUDE : $(PRJ)$/makefile.pmk
+
+.IF "$(GUI)"=="UNX"
+
+# --- Files -------------------------------------
+
+EXCEPTIONSFILES=\
+ $(SLO)$/LResultSet.obj \
+ $(SLO)$/LStatement.obj \
+ $(SLO)$/LPreparedStatement.obj \
+ $(SLO)$/LFolderList.obj \
+ $(SLO)$/LConfigAccess.obj \
+ $(SLO)$/LColumnAlias.obj \
+ $(SLO)$/LTable.obj \
+ $(SLO)$/LDatabaseMetaData.obj \
+ $(SLO)$/LCatalog.obj \
+ $(SLO)$/LColumns.obj \
+ $(SLO)$/LTables.obj \
+ $(SLO)$/LConnection.obj \
+ $(SLO)$/LServices.obj \
+ $(SLO)$/LDriver.obj
+
+SLOFILES=\
+ $(EXCEPTIONSFILES) \
+ $(SLO)$/LDebug.obj
+
+
+SHL1VERSIONMAP=$(TARGET).map
+
+
+# --- Library -----------------------------------
+#SHL1TARGET=$(TARGET)$(DLLPOSTFIX)
+SHL1TARGET= $(EVOAB_TARGET)$(DLLPOSTFIX)
+SHL1OBJS=$(SLOFILES)
+SHL1STDLIBS=\
+ $(CPPULIB) \
+ $(CPPUHELPERLIB) \
+ $(VOSLIB) \
+ $(TOOLSLIB) \
+ $(SVTOOLLIB) \
+ $(UNOTOOLSLIB) \
+ $(UCBHELPERLIB) \
+ $(SALLIB) \
+ $(DBTOOLSLIB) \
+ $(DBFILELIB) \
+ $(COMPHELPERLIB)
+
+.IF "$(DBFILELIB)" == ""
+SHL1STDLIBS+= ifile.lib
+.ENDIF
+
+SHL1DEPN=
+SHL1IMPLIB= i$(TARGET)
+
+SHL1DEF= $(MISC)$/$(SHL1TARGET).def
+
+DEF1NAME= $(SHL1TARGET)
+
+.ELSE
+dummy:
+ @echo "Nothing to build for GUI $(GUI)"
+.ENDIF
+# --- Targets ----------------------------------
+.INCLUDE : $(PRJ)$/target.pmk
diff --git a/connectivity/source/drivers/evoab2/evoab2.xcu b/connectivity/source/drivers/evoab2/evoab2.xcu
new file mode 100644
index 0000000000..e1adbab087
--- /dev/null
+++ b/connectivity/source/drivers/evoab2/evoab2.xcu
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--***********************************************************************
+ *
+ * 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: DataAccess.xcu,v $
+ * $Revision: 1.27 $
+ *
+ * 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.
+ *
+ ************************************************************************ -->
+<oor:component-data oor:name="Drivers" oor:package="org.openoffice.Office.DataAccess" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+ <node oor:name="Installed">
+ <node oor:name="sdbc:address:evolution:local" oor:op="replace">
+ <prop oor:name="Driver">
+ <value>com.sun.star.comp.sdbc.evoab.OEvoabDriver</value>
+ </prop>
+ <prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
+ <value xml:lang="en-US">Evolution Local</value>
+ </prop>
+ <node oor:name="Features">
+ <node oor:name="EscapeDateTime" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ </node>
+ </node>
+ <node oor:name="sdbc:address:evolution:ldap" oor:op="replace">
+ <prop oor:name="Driver">
+ <value>com.sun.star.comp.sdbc.evoab.OEvoabDriver</value>
+ </prop>
+ <prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
+ <value xml:lang="en-US">Evolution LDAP</value>
+ </prop>
+ <node oor:name="Features">
+ <node oor:name="EscapeDateTime" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ </node>
+ </node>
+ <node oor:name="sdbc:address:evolution:groupwise" oor:op="replace">
+ <prop oor:name="Driver">
+ <value>com.sun.star.comp.sdbc.evoab.OEvoabDriver</value>
+ </prop>
+ <prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
+ <value xml:lang="en-US">Groupwise</value>
+ </prop>
+ <node oor:name="Features">
+ <node oor:name="EscapeDateTime" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ </node>
+ </node>
+ </node>
+</oor:component-data>
diff --git a/connectivity/source/drivers/evoab2/makefile.mk b/connectivity/source/drivers/evoab2/makefile.mk
index a911bd2625..e9bb9fdc4d 100644
--- a/connectivity/source/drivers/evoab2/makefile.mk
+++ b/connectivity/source/drivers/evoab2/makefile.mk
@@ -39,7 +39,7 @@ dummy:
# --- Settings ----------------------------------
-.INCLUDE : settings.mk
+.INCLUDE : $(PRJ)$/makefile.pmk
.INCLUDE : $(PRJ)$/version.mk
PKGCONFIG_MODULES=gtk+-2.0
@@ -111,4 +111,4 @@ DEF1NAME= $(SHL1TARGET)
.ENDIF
# --- Targets ----------------------------------
-.INCLUDE : target.mk
+.INCLUDE : $(PRJ)$/target.pmk
diff --git a/connectivity/source/drivers/file/FResultSet.cxx b/connectivity/source/drivers/file/FResultSet.cxx
index 03f0d6f317..ae614f0c28 100644
--- a/connectivity/source/drivers/file/FResultSet.cxx
+++ b/connectivity/source/drivers/file/FResultSet.cxx
@@ -1303,8 +1303,9 @@ void OResultSet::sortRows()
OSL_ENSURE((sal_Int32)m_aRow->get().size() > *aOrderByIter,"Invalid Index");
switch ((*(m_aRow->get().begin()+*aOrderByIter))->getValue().getTypeKind())
{
- case DataType::CHAR:
+ case DataType::CHAR:
case DataType::VARCHAR:
+ case DataType::LONGVARCHAR:
eKeyType[i] = SQL_ORDERBYKEY_STRING;
break;
@@ -1471,6 +1472,7 @@ BOOL OResultSet::OpenImpl()
if(IsSorted())
{
aOrderbyColumnNumberSave = m_aOrderbyColumnNumber;// .assign(m_aOrderbyColumnNumber.begin(), m_aOrderbyColumnNumber.end());
+ m_aOrderbyColumnNumber.clear();
aOrderbyAscendingSave.assign(m_aOrderbyAscending.begin(), m_aOrderbyAscending.end());
bWasSorted = TRUE;
}
diff --git a/connectivity/source/drivers/file/FStatement.cxx b/connectivity/source/drivers/file/FStatement.cxx
index 68624bb584..6d82486dae 100644
--- a/connectivity/source/drivers/file/FStatement.cxx
+++ b/connectivity/source/drivers/file/FStatement.cxx
@@ -639,7 +639,7 @@ void OStatement_Base::GetAssignValues()
aColumnNameList.push_back(pCol->getTokenValue());
}
}
- if(!aColumnNameList.size())
+ if ( aColumnNameList.empty() )
throwFunctionSequenceException(*this);
// Werte ...
@@ -652,10 +652,10 @@ void OStatement_Base::GetAssignValues()
if (! SQL_ISTOKEN(pValuesOrQuerySpec->getChild(0),VALUES))
throwFunctionSequenceException(*this);
- OSL_ENSURE(pValuesOrQuerySpec->count() == 2,"OResultSet: pValuesOrQuerySpec->count() != 2");
+ OSL_ENSURE(pValuesOrQuerySpec->count() == 4,"OResultSet: pValuesOrQuerySpec->count() != 4");
// Liste von Werten
- OSQLParseNode * pInsertAtomCommalist = pValuesOrQuerySpec->getChild(1);
+ OSQLParseNode * pInsertAtomCommalist = pValuesOrQuerySpec->getChild(2);
OSL_ENSURE(pInsertAtomCommalist != NULL,"OResultSet: pInsertAtomCommalist darf nicht NULL sein!");
OSL_ENSURE(pInsertAtomCommalist->count() > 0,"OResultSet: pInsertAtomCommalist <= 0");
@@ -665,40 +665,22 @@ void OStatement_Base::GetAssignValues()
for (sal_uInt32 i = 0; i < pInsertAtomCommalist->count(); i++)
{
pRow_Value_Const = pInsertAtomCommalist->getChild(i); // row_value_constructor
- if(pRow_Value_Const->count() == 3) // '(' row_value_const_list ')'
+ OSL_ENSURE(pRow_Value_Const != NULL,"OResultSet: pRow_Value_Const darf nicht NULL sein!");
+ if(SQL_ISRULE(pRow_Value_Const,parameter))
{
- pRow_Value_Const = pRow_Value_Const->getChild(1); // row_value_const_list
- OSL_ENSURE(pRow_Value_Const != NULL,"OResultSet: pRow_Value_Const darf nicht NULL sein!");
- if(SQL_ISRULE(pRow_Value_Const,parameter))
- {
- if(pRow_Value_Const->count() == aColumnNameList.size())
- ParseAssignValues(aColumnNameList,pRow_Value_Const,nIndex++); // kann nur ein Columnname vorhanden sein pro Schleife
- else
- {
-// aStatus.Set(SQL_STAT_ERROR,
-// String::CreateFromAscii("S1000"),
-// aStatus.CreateErrorMessage(String(SdbResId(STR_STAT_SYNTAX_ERROR))),
-// 0, String() );
- throwFunctionSequenceException(*this);
- }
- }
- else if(pRow_Value_Const->isToken())
- ParseAssignValues(aColumnNameList,pRow_Value_Const,static_cast<xub_StrLen>(i));
- else
- {
- if(pRow_Value_Const->count() == aColumnNameList.size())
- {
- for (sal_uInt32 j = 0; j < pRow_Value_Const->count(); ++j)
- ParseAssignValues(aColumnNameList,pRow_Value_Const->getChild(j),nIndex++);
- }
- else
- throwFunctionSequenceException(*this);
- }
+ ParseAssignValues(aColumnNameList,pRow_Value_Const,nIndex++); // kann nur ein Columnname vorhanden sein pro Schleife
}
+ else if(pRow_Value_Const->isToken())
+ ParseAssignValues(aColumnNameList,pRow_Value_Const,static_cast<xub_StrLen>(i));
else
{
- // aStatus.SetStatementTooComplex();
- throwFunctionSequenceException(*this);
+ if(pRow_Value_Const->count() == aColumnNameList.size())
+ {
+ for (sal_uInt32 j = 0; j < pRow_Value_Const->count(); ++j)
+ ParseAssignValues(aColumnNameList,pRow_Value_Const->getChild(j),nIndex++);
+ }
+ else
+ throwFunctionSequenceException(*this);
}
}
}
@@ -814,6 +796,7 @@ void OStatement_Base::SetAssignValue(const String& aColumnName,
// Kriterium je nach Typ als String oder double in die Variable packen ...
case DataType::CHAR:
case DataType::VARCHAR:
+ case DataType::LONGVARCHAR:
*(m_aAssignValues->get())[nId] = ORowSetValue(aValue);
// Zeichensatz ist bereits konvertiert, da ja das gesamte Statement konvertiert wurde
break;
diff --git a/connectivity/source/drivers/file/FStringFunctions.cxx b/connectivity/source/drivers/file/FStringFunctions.cxx
index 3cced25cca..c5a9429340 100644
--- a/connectivity/source/drivers/file/FStringFunctions.cxx
+++ b/connectivity/source/drivers/file/FStringFunctions.cxx
@@ -32,6 +32,7 @@
#include "precompiled_connectivity.hxx"
#include "file/FStringFunctions.hxx"
+#include <rtl/ustrbuf.hxx>
#include <rtl/logfile.hxx>
using namespace connectivity;
@@ -102,7 +103,7 @@ ORowSetValue OOp_Concat::operate(const ::std::vector<ORowSetValue>& lhs) const
if ( lhs.empty() )
return ORowSetValue();
- ::rtl::OUString sRet;
+ ::rtl::OUStringBuffer sRet;
::std::vector<ORowSetValue>::const_reverse_iterator aIter = lhs.rbegin();
::std::vector<ORowSetValue>::const_reverse_iterator aEnd = lhs.rend();
for (; aIter != aEnd; ++aIter)
@@ -110,10 +111,10 @@ ORowSetValue OOp_Concat::operate(const ::std::vector<ORowSetValue>& lhs) const
if ( aIter->isNull() )
return ORowSetValue();
- sRet += *aIter;
+ sRet.append(aIter->operator ::rtl::OUString());
}
- return sRet;
+ return sRet.makeStringAndClear();
}
//------------------------------------------------------------------
ORowSetValue OOp_Locate::operate(const ::std::vector<ORowSetValue>& lhs) const
@@ -183,13 +184,13 @@ ORowSetValue OOp_Space::operate(const ORowSetValue& lhs) const
return lhs;
const sal_Char c = ' ';
- ::rtl::OUString sRet;
+ ::rtl::OUStringBuffer sRet;
sal_Int32 nCount = lhs;
for (sal_Int32 i=0; i < nCount; ++i)
{
- sRet += ::rtl::OUString(&c,1,RTL_TEXTENCODING_ASCII_US);
+ sRet.appendAscii(&c,1);
}
- return sRet;
+ return sRet.makeStringAndClear();
}
//------------------------------------------------------------------
ORowSetValue OOp_Replace::operate(const ::std::vector<ORowSetValue>& lhs) const
diff --git a/connectivity/source/drivers/file/fcode.cxx b/connectivity/source/drivers/file/fcode.cxx
index 9c686df607..1793cf58e3 100644
--- a/connectivity/source/drivers/file/fcode.cxx
+++ b/connectivity/source/drivers/file/fcode.cxx
@@ -65,6 +65,7 @@ TYPEINIT1(OStopOperand, OOperandValue);
TYPEINIT1(OOperator, OCode);
TYPEINIT1(OBoolOperator,OOperator);
+TYPEINIT1(OOp_NOT, OBoolOperator);
TYPEINIT1(OOp_AND, OBoolOperator);
TYPEINIT1(OOp_OR, OBoolOperator);
TYPEINIT1(OOp_ISNULL, OBoolOperator);
@@ -242,6 +243,29 @@ void OBoolOperator::Exec(OCodeStack& rCodeStack)
if (IS_TYPE(OOperandResult,pRight))
delete pRight;
}
+//------------------------------------------------------------------
+sal_Bool OOp_NOT::operate(const OOperand* pLeft, const OOperand* ) const
+{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OOp_AND::operate" );
+ return !pLeft->isValid();
+}
+//------------------------------------------------------------------
+void OOp_NOT::Exec(OCodeStack& rCodeStack)
+{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OOp_ISNULL::Exec" );
+ OOperand* pOperand = rCodeStack.top();
+ rCodeStack.pop();
+
+ rCodeStack.push(new OOperandResultBOOL(operate(pOperand)));
+ if (IS_TYPE(OOperandResult,pOperand))
+ delete pOperand;
+}
+//------------------------------------------------------------------
+sal_uInt16 OOp_NOT::getRequestedOperands() const
+{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OOp_NOT::getRequestedOperands" );
+ return 1;
+}
//------------------------------------------------------------------
sal_Bool OOp_AND::operate(const OOperand* pLeft, const OOperand* pRight) const
@@ -331,6 +355,7 @@ sal_Bool OOp_COMPARE::operate(const OOperand* pLeft, const OOperand* pRight) con
{
case DataType::CHAR:
case DataType::VARCHAR:
+ case DataType::LONGVARCHAR:
{
rtl::OUString sLH = aLH, sRH = aRH;
INT32 nRes = rtl_ustr_compareIgnoreAsciiCase_WithLength
diff --git a/connectivity/source/drivers/file/fcomp.cxx b/connectivity/source/drivers/file/fcomp.cxx
index c3dd5eb478..c402bdefc5 100644
--- a/connectivity/source/drivers/file/fcomp.cxx
+++ b/connectivity/source/drivers/file/fcomp.cxx
@@ -166,7 +166,7 @@ OOperand* OPredicateCompiler::execute(OSQLParseNode* pPredicateNode)
}
else if ((SQL_ISRULE(pPredicateNode,search_condition) || (SQL_ISRULE(pPredicateNode,boolean_term)))
&& // AND/OR-Verknuepfung:
- pPredicateNode->count() == 3)
+ pPredicateNode->count() == 3)
{
execute(pPredicateNode->getChild(0)); // Bearbeiten des linken Zweigs
execute(pPredicateNode->getChild(2)); // Bearbeiten des rechten Zweigs
@@ -183,6 +183,11 @@ OOperand* OPredicateCompiler::execute(OSQLParseNode* pPredicateNode)
DBG_ERROR("OPredicateCompiler: Fehler im Parse Tree");
}
}
+ else if (SQL_ISRULE(pPredicateNode,boolean_factor))
+ {
+ execute(pPredicateNode->getChild(1));
+ m_aCodeList.push_back(new OOp_NOT());
+ }
else if (SQL_ISRULE(pPredicateNode,comparison_predicate))
{
execute_COMPARE(pPredicateNode);
diff --git a/connectivity/source/drivers/file/quotedstring.cxx b/connectivity/source/drivers/file/quotedstring.cxx
index e3474c322f..2b78034b2d 100644
--- a/connectivity/source/drivers/file/quotedstring.cxx
+++ b/connectivity/source/drivers/file/quotedstring.cxx
@@ -113,7 +113,7 @@ namespace connectivity
if ( nStartPos >= nLen )
return;
- sal_Unicode* pData = _rStr.AllocBuffer(nLen - nStartPos);
+ sal_Unicode* pData = _rStr.AllocBuffer( nLen - nStartPos + 1 );
const sal_Unicode* pStart = pData;
// Suche bis Stringende nach dem ersten nicht uebereinstimmenden Zeichen
for( xub_StrLen i = nStartPos; i < nLen; ++i )
@@ -135,6 +135,7 @@ namespace connectivity
{
// String-Ende
bInString = FALSE;
+ *pData = 0;
}
}
else
@@ -151,6 +152,7 @@ namespace connectivity
// Vorzeitiger Abbruch der Schleife moeglich, denn
// wir haben, was wir wollten.
nStartPos = i+1;
+ *pData = 0;
break;
}
else
diff --git a/connectivity/source/drivers/flat/ETable.cxx b/connectivity/source/drivers/flat/ETable.cxx
index 4721228485..7fbc472586 100644
--- a/connectivity/source/drivers/flat/ETable.cxx
+++ b/connectivity/source/drivers/flat/ETable.cxx
@@ -180,13 +180,15 @@ void OFlatTable::fillColumns(const ::com::sun::star::lang::Locale& _aLocale)
{
bNumeric = TRUE;
xub_StrLen nDot = 0;
+ xub_StrLen nDecimalDelCount = 0;
for (xub_StrLen j = 0; j < aField2.Len(); j++)
{
const sal_Unicode c = aField2.GetChar(j);
// nur Ziffern und Dezimalpunkt und Tausender-Trennzeichen?
- if ((!cDecimalDelimiter || c != cDecimalDelimiter) &&
- (!cThousandDelimiter || c != cThousandDelimiter) &&
- !aCharClass.isDigit(aField2,j))
+ if ( ( !cDecimalDelimiter || c != cDecimalDelimiter ) &&
+ ( !cThousandDelimiter || c != cThousandDelimiter ) &&
+ !aCharClass.isDigit(aField2,j) &&
+ ( j != 0 || (c != '+' && c != '-' ) ) )
{
bNumeric = FALSE;
break;
@@ -195,11 +197,13 @@ void OFlatTable::fillColumns(const ::com::sun::star::lang::Locale& _aLocale)
{
nPrecision = 15; // we have an decimal value
nScale = 2;
- nDot++;
- }
+ ++nDecimalDelCount;
+ } // if (cDecimalDelimiter && c == cDecimalDelimiter)
+ if ( c == '.' )
+ ++nDot;
}
- if (nDot > 1) // if there is more than one dot it isn't a number
+ if (nDecimalDelCount > 1 || nDot > 1 ) // if there is more than one dot it isn't a number
bNumeric = FALSE;
if (bNumeric && cThousandDelimiter)
{
@@ -656,7 +660,10 @@ sal_Bool OFlatTable::fetchRow(OValueRefRow& _rRow,const OSQLColumns & _rCols,sal
}
return sal_True;
}
-
+void OFlatTable::refreshHeader()
+{
+ m_nRowPos = 0;
+}
// -----------------------------------------------------------------------------
sal_Bool OFlatTable::seekRow(IResultSetHelper::Movement eCursorPosition, sal_Int32 nOffset, sal_Int32& nCurPos)
{
@@ -688,7 +695,7 @@ sal_Bool OFlatTable::seekRow(IResultSetHelper::Movement eCursorPosition, sal_Int
m_pFileStream->Seek(m_nFilePos);
if ( m_pFileStream->IsEof() || !readLine(nCurPos) /*|| !checkHeaderLine()*/)
{
- m_nMaxRowCount = m_nRowPos;
+ m_nMaxRowCount = m_nRowPos -1;
return sal_False;
} // if ( m_pFileStream->IsEof() || !readLine(nCurPos) /*|| !checkHeaderLine()*/)
@@ -793,7 +800,10 @@ sal_Bool OFlatTable::seekRow(IResultSetHelper::Movement eCursorPosition, sal_Int
TRowPositionsInFile::const_iterator aFind = m_aFilePosToEndLinePos.find(nOffset);
m_bNeedToReadLine = aFind != m_aFilePosToEndLinePos.end();
if ( m_bNeedToReadLine )
+ {
+ m_nFilePos = aFind->first;
nCurPos = aFind->second;
+ }
else
{
m_nFilePos = nOffset;
diff --git a/connectivity/source/drivers/flat/flat.xcu b/connectivity/source/drivers/flat/flat.xcu
new file mode 100644
index 0000000000..6a22ed8662
--- /dev/null
+++ b/connectivity/source/drivers/flat/flat.xcu
@@ -0,0 +1,113 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--***********************************************************************
+ *
+ * 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: DataAccess.xcu,v $
+ * $Revision: 1.27 $
+ *
+ * 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.
+ *
+ ************************************************************************ -->
+<oor:component-data oor:name="Drivers" oor:package="org.openoffice.Office.DataAccess" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+ <node oor:name="Installed">
+ <node oor:name="sdbc:flat:*" oor:op="replace">
+ <prop oor:name="Driver">
+ <value>com.sun.star.comp.sdbc.flat.ODriver</value>
+ </prop>
+ <prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
+ <value xml:lang="en-US">Text</value>
+ </prop>
+ <node oor:name="Properties">
+ <node oor:name="CharSet" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:string">
+ <value></value>
+ </prop>
+ </node>
+ <node oor:name="Extension" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:string">
+ <value></value>
+ </prop>
+ </node>
+ <node oor:name="HeaderLine" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="FieldDelimiter" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:string">
+ <value>,</value>
+ </prop>
+ </node>
+ <node oor:name="StringDelimiter" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:string">
+ <value>"</value>
+ </prop>
+ </node>
+ <node oor:name="DecimalDelimiter" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:string">
+ <value>.</value>
+ </prop>
+ </node>
+ <node oor:name="ThousandDelimiter" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:string">
+ <value></value>
+ </prop>
+ </node>
+ <node oor:name="EnableSQL92Check" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ </node>
+ </node>
+ <node oor:name="Features">
+ <node oor:name="UseSQL92NamingConstraints" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="EscapeDateTime" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ </node>
+ <node oor:name="MetaData">
+ <node oor:name="SupportsBrowsing" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="FileSystemBased" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="MediaType" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:string">
+ <value>text/csv</value>
+ </prop>
+ </node>
+ </node>
+ </node>
+ </node>
+</oor:component-data>
diff --git a/connectivity/source/drivers/flat/makefile.mk b/connectivity/source/drivers/flat/makefile.mk
index 0cc44de7c5..d044eab279 100644
--- a/connectivity/source/drivers/flat/makefile.mk
+++ b/connectivity/source/drivers/flat/makefile.mk
@@ -41,7 +41,7 @@ VISIBILITY_HIDDEN=TRUE
ENVCFLAGS+=/FR$(SLO)$/
.ENDIF
-.INCLUDE : settings.mk
+.INCLUDE : $(PRJ)$/makefile.pmk
.INCLUDE : $(PRJ)$/version.mk
@@ -106,6 +106,6 @@ DEF1EXPORTFILE= exports.dxp
# --- Targets ----------------------------------
-.INCLUDE : target.mk
+.INCLUDE : $(PRJ)$/target.pmk
diff --git a/connectivity/source/drivers/hsqldb/hsqldb.xcu b/connectivity/source/drivers/hsqldb/hsqldb.xcu
new file mode 100644
index 0000000000..befa202f4c
--- /dev/null
+++ b/connectivity/source/drivers/hsqldb/hsqldb.xcu
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--***********************************************************************
+ *
+ * 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: DataAccess.xcu,v $
+ * $Revision: 1.27 $
+ *
+ * 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.
+ *
+ ************************************************************************ -->
+<oor:component-data oor:name="Drivers" oor:package="org.openoffice.Office.DataAccess" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+ <node oor:name="Installed">
+ <node oor:name="sdbc:embedded:hsqldb" oor:op="replace">
+ <prop oor:name="Driver">
+ <value>com.sun.star.sdbcx.comp.hsqldb.Driver</value>
+ </prop>
+ <prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
+ <value xml:lang="en-US">HSQL database engine</value>
+ </prop>
+ <node oor:name="Features">
+ <node oor:name="UseDOSLineEnds" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="FormsCheckRequiredFields" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="EscapeDateTime" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ </node>
+ <node oor:name="MetaData">
+ <node oor:name="SupportsTableCreation" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="UseJava" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="AutoIncrementIsPrimaryKey" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ </node>
+ </node>
+ </node>
+</oor:component-data>
diff --git a/connectivity/source/drivers/hsqldb/makefile.mk b/connectivity/source/drivers/hsqldb/makefile.mk
index a97365a4d8..9ed5acb17d 100644
--- a/connectivity/source/drivers/hsqldb/makefile.mk
+++ b/connectivity/source/drivers/hsqldb/makefile.mk
@@ -39,7 +39,7 @@ VISIBILITY_HIDDEN=TRUE
USE_DEFFILE=TRUE
# --- Settings ----------------------------------
-.INCLUDE : settings.mk
+.INCLUDE : $(PRJ)$/makefile.pmk
.INCLUDE : $(PRJ)$/version.mk
.IF "$(SOLAR_JAVA)"==""
@@ -115,6 +115,6 @@ DEF1EXPORTFILE= exports.dxp
# --- Targets ----------------------------------
-.INCLUDE : target.mk
+.INCLUDE : $(PRJ)$/target.pmk
diff --git a/connectivity/source/drivers/jdbc/DatabaseMetaData.cxx b/connectivity/source/drivers/jdbc/DatabaseMetaData.cxx
index 9a81d9617e..55c8b69838 100644
--- a/connectivity/source/drivers/jdbc/DatabaseMetaData.cxx
+++ b/connectivity/source/drivers/jdbc/DatabaseMetaData.cxx
@@ -616,7 +616,8 @@ Reference< XResultSet > java_sql_DatabaseMetaData::impl_callResultSetMethodWithS
const ::rtl::OUString* _pOptionalAdditionalString )
{
bool bCatalog = _rCatalog.hasValue();
- ::rtl::OUString sCatalog( ::comphelper::getString( _rCatalog ) );
+ ::rtl::OUString sCatalog;
+ _rCatalog >>= sCatalog;
bool bSchema = _rSchemaPattern.toChar() != '%';
diff --git a/connectivity/source/drivers/jdbc/ResultSet.cxx b/connectivity/source/drivers/jdbc/ResultSet.cxx
index 0af6640c34..7bcd93f23b 100644
--- a/connectivity/source/drivers/jdbc/ResultSet.cxx
+++ b/connectivity/source/drivers/jdbc/ResultSet.cxx
@@ -261,7 +261,7 @@ sal_Int64 SAL_CALL java_sql_ResultSet::getLong( sal_Int32 columnIndex ) throw(SQ
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getLong" );
static jmethodID mID(NULL);
jlong (JNIEnv::*pCallMethod)( jobject obj, jmethodID methodID, ... ) = &JNIEnv::CallLongMethod;
- return callMethodWithIntArg<jlong>(pCallMethod,"getLong","(I)L",mID,columnIndex);
+ return callMethodWithIntArg<jlong>(pCallMethod,"getLong","(I)J",mID,columnIndex);
}
// -------------------------------------------------------------------------
diff --git a/connectivity/source/drivers/jdbc/jdbc.xcu b/connectivity/source/drivers/jdbc/jdbc.xcu
new file mode 100644
index 0000000000..c758a79bd0
--- /dev/null
+++ b/connectivity/source/drivers/jdbc/jdbc.xcu
@@ -0,0 +1,207 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--***********************************************************************
+ *
+ * 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: DataAccess.xcu,v $
+ * $Revision: 1.27 $
+ *
+ * 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.
+ *
+ ************************************************************************ -->
+<oor:component-data oor:name="Drivers" oor:package="org.openoffice.Office.DataAccess" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+ <node oor:name="Installed">
+ <node oor:name="jdbc:*" oor:op="replace">
+ <prop oor:name="Driver">
+ <value>com.sun.star.comp.sdbc.JDBCDriver</value>
+ </prop>
+ <prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
+ <value xml:lang="en-US">JDBC</value>
+ </prop>
+ <node oor:name="Properties">
+ <node oor:name="JavaDriverClass" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:string">
+ <value></value>
+ </prop>
+ </node>
+ <node oor:name="JavaDriverClassPath" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:string">
+ <value></value>
+ </prop>
+ </node>
+ <node oor:name="AutoIncrementCreation" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:string">
+ <value></value>
+ </prop>
+ </node>
+ <node oor:name="AutoRetrievingStatement" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:string">
+ <value></value>
+ </prop>
+ </node>
+ <node oor:name="IsAutoRetrievingEnabled" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ </node>
+ <node oor:name="AddIndexAppendix" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ </node>
+ <node oor:name="Features">
+ <node oor:name="GeneratedValues" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="UseSQL92NamingConstraints" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="AppendTableAliasInSelect" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="UseKeywordAsBeforeAlias" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="UseBracketedOuterJoinSyntax" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="IgnoreDriverPrivileges" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="ParameterNameSubstitution" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="DisplayVersionColumns" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="UseCatalogInSelect" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="UseSchemaInSelect" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="UseIndexDirectionKeyword" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="UseDOSLineEnds" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="BooleanComparisonMode" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="FormsCheckRequiredFields" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="EscapeDateTime" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ </node>
+ <node oor:name="MetaData">
+ <node oor:name="SupportsTableCreation" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="UseJava" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="Authentication" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:string">
+ <value>UserPassword</value>
+ </prop>
+ </node>
+ </node>
+ </node>
+ <node oor:name="jdbc:oracle:thin:*" oor:op="replace">
+ <prop oor:name="ParentURLPattern">
+ <value>jdbc:*</value>
+ </prop>
+ <prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
+ <value xml:lang="en-US">Oracle JDBC</value>
+ </prop>
+ <node oor:name="Properties">
+ <node oor:name="IgnoreCurrency" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ </node>
+ <node oor:name="TypeInfoSettings" oor:op="replace">
+ <prop oor:name="Value" oor:type="oor:string-list">
+ <value oor:separator=",">Column(2) = -5,Column(6) = PRECISION,Column(2) = -4,Column(6) = PRECISION,Column(2) = -3,Column(6) = PRECISION,Column(2) = -2,Column(6) = PRECISION,Column(2) = -1,Column(6) = PRECISION,Column(2) = -1,Column(6) = PRECISION,Column(2) = 2,Column(6) = PRECISION,Column(2) = 12,Column(6) = PRECISION</value>
+ </prop>
+ </node>
+ <node oor:name="JavaDriverClass" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:string">
+ <value>oracle.jdbc.driver.OracleDriver</value>
+ </prop>
+ </node>
+ </node>
+ <node oor:name="Features">
+ <node oor:name="IgnoreCurrency" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ </node>
+ <node oor:name="MetaData">
+ <node oor:name="Authentication" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:string">
+ <value>UserPassword</value>
+ </prop>
+ </node>
+ </node>
+ </node>
+ </node>
+</oor:component-data>
diff --git a/connectivity/source/drivers/jdbc/makefile.mk b/connectivity/source/drivers/jdbc/makefile.mk
index b8d6a54dd0..831a6755af 100644
--- a/connectivity/source/drivers/jdbc/makefile.mk
+++ b/connectivity/source/drivers/jdbc/makefile.mk
@@ -42,7 +42,7 @@ VISIBILITY_HIDDEN=TRUE
ENVCFLAGS+=/FR$(SLO)$/
.ENDIF
-.INCLUDE : settings.mk
+.INCLUDE : $(PRJ)$/makefile.pmk
.INCLUDE : $(PRJ)$/version.mk
@@ -110,6 +110,6 @@ DEF1EXPORTFILE= exports.dxp
# --- Targets ----------------------------------
-.INCLUDE : target.mk
+.INCLUDE : $(PRJ)$/target.pmk
diff --git a/connectivity/source/drivers/jdbc/tools.cxx b/connectivity/source/drivers/jdbc/tools.cxx
index 76fdcfffc2..8a3ca446dc 100644
--- a/connectivity/source/drivers/jdbc/tools.cxx
+++ b/connectivity/source/drivers/jdbc/tools.cxx
@@ -150,6 +150,9 @@ java_util_Properties* connectivity::createStringPropertyArray(const Sequence< Pr
&& pBegin->Name.compareToAscii( "IgnoreDriverPrivileges" )
&& pBegin->Name.compareToAscii( "ImplicitCatalogRestriction" )
&& pBegin->Name.compareToAscii( "ImplicitSchemaRestriction" )
+ && pBegin->Name.compareToAscii( "SupportsTableCreation" )
+ && pBegin->Name.compareToAscii( "UseJava" )
+ && pBegin->Name.compareToAscii( "Authentication" )
)
{
::rtl::OUString aStr;
diff --git a/connectivity/source/drivers/kab/kab.xcu b/connectivity/source/drivers/kab/kab.xcu
new file mode 100644
index 0000000000..c4bb50bb83
--- /dev/null
+++ b/connectivity/source/drivers/kab/kab.xcu
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--***********************************************************************
+ *
+ * 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: DataAccess.xcu,v $
+ * $Revision: 1.27 $
+ *
+ * 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.
+ *
+ ************************************************************************ -->
+<oor:component-data oor:name="Drivers" oor:package="org.openoffice.Office.DataAccess" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+ <node oor:name="Installed">
+ <node oor:name="sdbc:address:kab" oor:op="replace">
+ <prop oor:name="Driver">
+ <value>com.sun.star.comp.sdbc.kab.Driver</value>
+ </prop>
+ <prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
+ <value xml:lang="en-US">KDE Address Book</value>
+ </prop>
+ <node oor:name="Features">
+ <node oor:name="EscapeDateTime" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ </node>
+ </node>
+ </node>
+</oor:component-data>
diff --git a/connectivity/source/drivers/kab/makefile.mk b/connectivity/source/drivers/kab/makefile.mk
index 4ee3303456..2c0a86f856 100644
--- a/connectivity/source/drivers/kab/makefile.mk
+++ b/connectivity/source/drivers/kab/makefile.mk
@@ -40,7 +40,7 @@ VISIBILITY_HIDDEN=TRUE
# --- Settings ----------------------------------
-.INCLUDE : settings.mk
+.INCLUDE : $(PRJ)$/makefile.pmk
.INCLUDE : $(PRJ)$/version.mk
.IF "$(GUI)" == "UNX"
@@ -137,5 +137,5 @@ dummy:
@echo "Nothing to build for GUI $(GUI)"
.ENDIF
-.INCLUDE : target.mk
+.INCLUDE : $(PRJ)$/target.pmk
diff --git a/connectivity/source/drivers/macab/macab.xcu b/connectivity/source/drivers/macab/macab.xcu
new file mode 100644
index 0000000000..ead6b5fb23
--- /dev/null
+++ b/connectivity/source/drivers/macab/macab.xcu
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--***********************************************************************
+ *
+ * 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: DataAccess.xcu,v $
+ * $Revision: 1.27 $
+ *
+ * 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.
+ *
+ ************************************************************************ -->
+<oor:component-data oor:name="Drivers" oor:package="org.openoffice.Office.DataAccess" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+ <node oor:name="Installed">
+ <node oor:name="sdbc:address:macab:*" oor:op="replace">
+ <prop oor:name="Driver">
+ <value>com.sun.star.comp.sdbc.macab.Driver</value>
+ </prop>
+ <prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
+ <value xml:lang="en-US">Mac OS X Address Book</value>
+ </prop>
+ <node oor:name="Features">
+ <node oor:name="EscapeDateTime" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ </node>
+ </node>
+ </node>
+</oor:component-data>
diff --git a/connectivity/source/drivers/macab/makefile.mk b/connectivity/source/drivers/macab/makefile.mk
index 67f40f2d45..8edc8951fa 100755
--- a/connectivity/source/drivers/macab/makefile.mk
+++ b/connectivity/source/drivers/macab/makefile.mk
@@ -39,7 +39,7 @@ ENABLE_EXCEPTIONS=TRUE
# --- Settings ----------------------------------
-.INCLUDE : settings.mk
+.INCLUDE : $(PRJ)$/makefile.pmk
.INCLUDE : $(PRJ)$/version.mk
.IF "$(GUI)" == "UNX"
@@ -133,5 +133,5 @@ dummy:
@echo "Nothing to build for GUI $(GUI)"
.ENDIF
-.INCLUDE : target.mk
+.INCLUDE : $(PRJ)$/target.pmk
diff --git a/connectivity/source/drivers/mozab/MColumnAlias.cxx b/connectivity/source/drivers/mozab/MColumnAlias.cxx
index 3cde4328e6..3eb6d449bb 100644
--- a/connectivity/source/drivers/mozab/MColumnAlias.cxx
+++ b/connectivity/source/drivers/mozab/MColumnAlias.cxx
@@ -32,12 +32,15 @@
#include "precompiled_connectivity.hxx"
#include "MColumnAlias.hxx"
#include "MConnection.hxx"
+#include "MExtConfigAccess.hxx"
+
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
-#ifndef CONNECTIVITY_MOZAB_MEXTCONFIGACCESS_HXX
-#include "MExtConfigAccess.hxx"
-#endif
+#include <tools/diagnose_ex.h>
+
+#include <algorithm>
+#include <functional>
using namespace ::connectivity;
using namespace ::connectivity::mozab;
@@ -46,56 +49,57 @@ using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::container;
-static const ::rtl::OUString sProgrammaticNames[] =
-{
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FirstName")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("LastName")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("DisplayName")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("NickName")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("PrimaryEmail")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("SecondEmail")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("PreferMailFormat")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("WorkPhone")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HomePhone")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FaxNumber")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("PagerNumber")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("CellularNumber")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HomeAddress")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HomeAddress2")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HomeCity")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HomeState")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HomeZipCode")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HomeCountry")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("WorkAddress")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("WorkAddress2")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("WorkCity")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("WorkState")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("WorkZipCode")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("WorkCountry")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("JobTitle")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Department")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Company")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("WebPage1")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("WebPage2")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("BirthYear")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("BirthMonth")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("BirthDay")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Custom1")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Custom2")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Custom3")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Custom4")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Notes"))
-};
//------------------------------------------------------------------------------
OColumnAlias::OColumnAlias( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB )
{
- for ( size_t i = 0; i < END - BEGIN; ++i )
- m_aAliasMap[ sProgrammaticNames[i] ] = AliasDescription( sProgrammaticNames[i], static_cast< ProgrammaticName>( i ) );
+ static const sal_Char* s_pProgrammaticNames[] =
+ {
+ "FirstName",
+ "LastName",
+ "DisplayName",
+ "NickName",
+ "PrimaryEmail",
+ "SecondEmail",
+ "PreferMailFormat",
+ "WorkPhone",
+ "HomePhone",
+ "FaxNumber",
+ "PagerNumber",
+ "CellularNumber",
+ "HomeAddress",
+ "HomeAddress2",
+ "HomeCity",
+ "HomeState",
+ "HomeZipCode",
+ "HomeCountry",
+ "WorkAddress",
+ "WorkAddress2",
+ "WorkCity",
+ "WorkState",
+ "WorkZipCode",
+ "WorkCountry",
+ "JobTitle",
+ "Department",
+ "Company",
+ "WebPage1",
+ "WebPage2",
+ "BirthYear",
+ "BirthMonth",
+ "BirthDay",
+ "Custom1",
+ "Custom2",
+ "Custom3",
+ "Custom4",
+ "Notes",
+ };
+
+ for ( size_t i = 0; i < sizeof( s_pProgrammaticNames ) / sizeof( s_pProgrammaticNames[0] ); ++i )
+ m_aAliasMap[ ::rtl::OUString::createFromAscii( s_pProgrammaticNames[i] ) ] = AliasEntry( s_pProgrammaticNames[i], i );
initialize( _rxORB );
}
-//------------------------------------------------------------------
+//------------------------------------------------------------------------------
void OColumnAlias::initialize( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB )
{
// open our driver settings config node
@@ -112,34 +116,26 @@ void OColumnAlias::initialize( const ::com::sun::star::uno::Reference< ::com::su
OSL_ENSURE( xAliasesNode.is(), "OColumnAlias::setAlias: missing the aliases node!" );
// this is a set of string nodes
- Sequence< ::rtl::OUString > aColumnProgrammaticNames;
+ Sequence< ::rtl::OUString > aProgrammaticNames;
if ( xAliasesNode.is() )
- aColumnProgrammaticNames = xAliasesNode->getElementNames();
+ aProgrammaticNames = xAliasesNode->getElementNames();
//.............................................................
// travel through all the set elements
- const ::rtl::OUString* pProgrammaticNames = aColumnProgrammaticNames.getConstArray();
- const ::rtl::OUString* pProgrammaticNamesEnd = pProgrammaticNames + aColumnProgrammaticNames.getLength();
+ const ::rtl::OUString* pProgrammaticNames = aProgrammaticNames.getConstArray();
+ const ::rtl::OUString* pProgrammaticNamesEnd = pProgrammaticNames + aProgrammaticNames.getLength();
::rtl::OUString sAssignedAlias;
for ( ; pProgrammaticNames < pProgrammaticNamesEnd; ++pProgrammaticNames )
{
- OSL_ENSURE( m_aAliasMap.end() != m_aAliasMap.find( *pProgrammaticNames ),
- "OColumnAlias::setAlias: found an invalid programmtic name!" );
- // if this asserts, somebody stored a programmatic name in the configuration
- // which is not allowed (i.e. not in the list of known programmatics).
-
-#if OSL_DEBUG_LEVEL > 0
- sal_Bool bExtractionSuccess =
-#endif
- xAliasesNode->getByName( *pProgrammaticNames) >>= sAssignedAlias;
- OSL_ENSURE( bExtractionSuccess, "OColumnAlias::setAlias: invalid config data!" );
+ OSL_VERIFY( xAliasesNode->getByName( *pProgrammaticNames ) >>= sAssignedAlias );
// normalize in case the config data is corrupted
// (what we really don't need is an empty alias ...)
if ( 0 == sAssignedAlias.getLength() )
sAssignedAlias = *pProgrammaticNames;
+ ::rtl::OString sAsciiProgrammaticName( ::rtl::OUStringToOString( *pProgrammaticNames, RTL_TEXTENCODING_ASCII_US ) );
//.............................................................
#if OSL_DEBUG_LEVEL > 0
bool bFound = false;
@@ -149,15 +145,11 @@ void OColumnAlias::initialize( const ::com::sun::star::uno::Reference< ::com::su
++search
)
{
- if ( search->second.sProgrammaticName == *pProgrammaticNames )
+ if ( search->second.programmaticAsciiName.equals( sAsciiProgrammaticName ) )
{
- AliasDescription aDescription( search->second );
-
- // delete this old entry for this programmatic name
+ AliasEntry entry( search->second );
m_aAliasMap.erase( search );
-
- // insert the same AliasDescription under a new name - its alias
- m_aAliasMap[ sAssignedAlias ] = aDescription;
+ m_aAliasMap[ sAssignedAlias ] = entry;
#if OSL_DEBUG_LEVEL > 0
bFound = true;
@@ -172,29 +164,31 @@ void OColumnAlias::initialize( const ::com::sun::star::uno::Reference< ::com::su
}
catch( const Exception& )
{
- OSL_ENSURE( sal_False, "OColumnAlias::setAlias: could not read my driver's configuration data!" );
+ DBG_UNHANDLED_EXCEPTION();
}
}
}
//------------------------------------------------------------------
-OColumnAlias::ProgrammaticName OColumnAlias::getProgrammaticNameIndex( const ::rtl::OUString& _rAliasName ) const
+::rtl::OString OColumnAlias::getProgrammaticNameOrFallbackToUTF8Alias( const ::rtl::OUString& _rAlias ) const
{
- AliasMap::const_iterator pos = m_aAliasMap.find( _rAliasName );
+ AliasMap::const_iterator pos = m_aAliasMap.find( _rAlias );
if ( pos == m_aAliasMap.end() )
{
- OSL_ENSURE( false, "OColumnAlias::getProgrammaticNameIndex: unknown column alias!" );
- return END;
+ OSL_ENSURE( false, "OColumnAlias::getProgrammaticNameOrFallbackToUTF8Alias: no programmatic name for this alias!" );
+ return ::rtl::OUStringToOString( _rAlias, RTL_TEXTENCODING_UTF8 );
}
-
- return pos->second.eProgrammaticNameIndex;
+ return pos->second.programmaticAsciiName;
}
//------------------------------------------------------------------
-::rtl::OUString OColumnAlias::getProgrammaticNameOrFallbackToAlias( const ::rtl::OUString& _rAlias ) const
+bool OColumnAlias::isColumnSearchable( const ::rtl::OUString _alias ) const
{
- AliasMap::const_iterator pos = m_aAliasMap.find( _rAlias );
- if ( pos == m_aAliasMap.end() )
- return _rAlias;
- return pos->second.sProgrammaticName;
+ ::rtl::OString sProgrammatic = getProgrammaticNameOrFallbackToUTF8Alias( _alias );
+
+ return ( !sProgrammatic.equals( "HomeCountry" )
+ && !sProgrammatic.equals( "WorkCountry" )
+ );
+ // for those, we know that they're not searchable in the Mozilla/LDAP implementation.
+ // There might be more ...
}
diff --git a/connectivity/source/drivers/mozab/MColumnAlias.hxx b/connectivity/source/drivers/mozab/MColumnAlias.hxx
index c9eef3d58f..e98a398a95 100644
--- a/connectivity/source/drivers/mozab/MColumnAlias.hxx
+++ b/connectivity/source/drivers/mozab/MColumnAlias.hxx
@@ -36,7 +36,7 @@
#include <osl/mutex.hxx>
#include <vector>
-#include <map>
+#include <hash_map>
namespace connectivity
{
@@ -45,88 +45,41 @@ namespace connectivity
class OColumnAlias
{
public:
- typedef enum {
- BEGIN = 0,
-
- FIRSTNAME = BEGIN,
- LASTNAME,
- DISPLAYNAME,
- NICKNAME,
- PRIMARYEMAIL,
- SECONDEMAIL,
- PREFERMAILFORMAT,
- WORKPHONE,
- HOMEPHONE,
- FAXNUMBER,
- PAGERNUMBER,
- CELLULARNUMBER,
- HOMEADDRESS,
- HOMEADDRESS2,
- HOMECITY,
- HOMESTATE,
- HOMEZIPCODE,
- HOMECOUNTRY,
- WORKADDRESS,
- WORKADDRESS2,
- WORKCITY,
- WORKSTATE,
- WORKZIPCODE,
- WORKCOUNTRY,
- JOBTITLE,
- DEPARTMENT,
- COMPANY,
- WEBPAGE1,
- WEBPAGE2,
- BIRTHYEAR,
- BIRTHMONTH,
- BIRTHDAY,
- CUSTOM1,
- CUSTOM2,
- CUSTOM3,
- CUSTOM4,
- NOTES,
-
- END
- } ProgrammaticName;
-
- struct AliasDescription
+ struct AliasEntry
{
- ::rtl::OUString sProgrammaticName;
- ProgrammaticName eProgrammaticNameIndex;
+ ::rtl::OString programmaticAsciiName;
+ sal_Int32 columnPosition;
- AliasDescription()
- :eProgrammaticNameIndex( END )
+ AliasEntry()
+ :programmaticAsciiName()
+ ,columnPosition( 0 )
{
}
-
- AliasDescription( const ::rtl::OUString& _rName, ProgrammaticName _eIndex )
- :sProgrammaticName( _rName ), eProgrammaticNameIndex( _eIndex )
+ AliasEntry( const sal_Char* _programmaticAsciiName, sal_Int32 _columnPosition )
+ :programmaticAsciiName( _programmaticAsciiName )
+ ,columnPosition( _columnPosition )
{
}
};
-
- typedef ::std::map< ::rtl::OUString, AliasDescription > AliasMap;
+ typedef ::std::hash_map< ::rtl::OUString, AliasEntry, ::rtl::OUStringHash > AliasMap;
private:
AliasMap m_aAliasMap;
- protected:
- ::osl::Mutex m_aMutex;
-
public:
- OColumnAlias(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & );
+ OColumnAlias( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & );
- ProgrammaticName getProgrammaticNameIndex( const ::rtl::OUString& _rAliasName ) const;
inline bool hasAlias( const ::rtl::OUString& _rAlias ) const
{
return m_aAliasMap.find( _rAlias ) != m_aAliasMap.end();
}
- ::rtl::OUString getProgrammaticNameOrFallbackToAlias( const ::rtl::OUString& _rAlias ) const;
+ ::rtl::OString getProgrammaticNameOrFallbackToUTF8Alias( const ::rtl::OUString& _rAlias ) const;
inline AliasMap::const_iterator begin() const { return m_aAliasMap.begin(); }
inline AliasMap::const_iterator end() const { return m_aAliasMap.end(); }
+ bool isColumnSearchable( const ::rtl::OUString _alias ) const;
+
private:
void initialize( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB );
};
diff --git a/connectivity/source/drivers/mozab/MConnection.cxx b/connectivity/source/drivers/mozab/MConnection.cxx
index b5124933f9..f84b150e86 100644
--- a/connectivity/source/drivers/mozab/MConnection.cxx
+++ b/connectivity/source/drivers/mozab/MConnection.cxx
@@ -378,8 +378,7 @@ Reference< XPreparedStatement > SAL_CALL OConnection::prepareStatement( const ::
// the statement can only be executed more than once
OPreparedStatement* pPrepared = new OPreparedStatement(this,_sSql);
Reference< XPreparedStatement > xReturn = pPrepared;
- if ( !pPrepared->lateInit() )
- throw SQLException();
+ pPrepared->lateInit();
m_aStatements.push_back(WeakReferenceHelper(xReturn));
return xReturn;
diff --git a/connectivity/source/drivers/mozab/MConnection.hxx b/connectivity/source/drivers/mozab/MConnection.hxx
index 83f69ba5dd..9fcaa1b126 100644
--- a/connectivity/source/drivers/mozab/MConnection.hxx
+++ b/connectivity/source/drivers/mozab/MConnection.hxx
@@ -51,7 +51,6 @@ namespace connectivity
namespace mozab
{
- class OStatement_Base;
class MozabDriver;
class ODatabaseMetaData;
class MNameMapper;
diff --git a/connectivity/source/drivers/mozab/MDatabaseMetaData.cxx b/connectivity/source/drivers/mozab/MDatabaseMetaData.cxx
index 5b474d0ba9..ecfe0ea9c3 100644
--- a/connectivity/source/drivers/mozab/MDatabaseMetaData.cxx
+++ b/connectivity/source/drivers/mozab/MDatabaseMetaData.cxx
@@ -157,7 +157,7 @@ ODatabaseMetaDataResultSet::ORows& SAL_CALL ODatabaseMetaData::getColumnRows(
// COLUMN_NAME
aRow[4] = new ORowSetValueDecorator( compare->first );
// ORDINAL_POSITION
- aRow[17] = new ORowSetValueDecorator( static_cast< sal_Int32 >( compare->second.eProgrammaticNameIndex ) + 1 );
+ aRow[17] = new ORowSetValueDecorator( static_cast< sal_Int32 >( compare->second.columnPosition ) + 1 );
aRows.push_back(aRow);
}
}
diff --git a/connectivity/source/drivers/mozab/MPreparedStatement.cxx b/connectivity/source/drivers/mozab/MPreparedStatement.cxx
index 481e702e0a..b3fd20bd2f 100644
--- a/connectivity/source/drivers/mozab/MPreparedStatement.cxx
+++ b/connectivity/source/drivers/mozab/MPreparedStatement.cxx
@@ -67,11 +67,11 @@ IMPLEMENT_SERVICE_INFO(OPreparedStatement,"com.sun.star.sdbcx.mozab.PreparedStat
OPreparedStatement::OPreparedStatement( OConnection* _pConnection,const ::rtl::OUString& sql)
- :OStatement_BASE2(_pConnection)
+ :OCommonStatement(_pConnection)
,m_nNumParams(0)
,m_sSqlStatement(sql)
,m_bPrepared(sal_False)
- ,m_pResultSet( NULL )
+ ,m_pResultSet()
{
}
// -----------------------------------------------------------------------------
@@ -79,21 +79,17 @@ OPreparedStatement::~OPreparedStatement()
{
}
// -----------------------------------------------------------------------------
-sal_Bool OPreparedStatement::lateInit()
+void OPreparedStatement::lateInit()
{
- return parseSql( m_sSqlStatement );
+ if ( eSelect != parseSql( m_sSqlStatement ) )
+ throw SQLException();
}
// -------------------------------------------------------------------------
void SAL_CALL OPreparedStatement::disposing()
{
::osl::MutexGuard aGuard(m_aMutex);
- if(m_pResultSet)
- m_pResultSet->release();
-
- clearMyResultSet();
-
- OStatement_BASE2::disposing();
+ OCommonStatement::disposing();
m_xMetaData = NULL;
if(m_aParameterRow.isValid())
@@ -105,63 +101,61 @@ void SAL_CALL OPreparedStatement::disposing()
}
// -----------------------------------------------------------------------------
-sal_Bool OPreparedStatement::parseSql( const ::rtl::OUString& sql , sal_Bool bAdjusted ) throw (
- ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException )
+OCommonStatement::StatementType OPreparedStatement::parseSql( const ::rtl::OUString& sql , sal_Bool bAdjusted )
+ throw ( ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException )
{
- OSL_TRACE("in :: OPreparedStatement::parseSql()");
- if (!OStatement_Base::parseSql( sql, bAdjusted ))
- return sal_False;
+ StatementType eStatementType = OCommonStatement::parseSql( sql, bAdjusted );
+ if ( eStatementType != eSelect )
+ return eStatementType;
m_xParamColumns = new OSQLColumns();
- Reference<XIndexAccess> xNames(m_xColNames,UNO_QUERY);
-
// describe all parameters need for the resultset
describeParameter();
- OResultSet::setBoundedColumns(m_aRow,m_xParamColumns,xNames,sal_False,m_xDBMetaData,m_aColMapping);
+ Reference<XIndexAccess> xNames(m_xColNames,UNO_QUERY);
+ OResultSet::setBoundedColumns( m_aRow, m_xParamColumns, xNames, sal_False, m_xDBMetaData, m_aColMapping );
- m_pResultSet = createResultSet();
- m_pResultSet->acquire();
- m_xResultSet = Reference<XResultSet>(m_pResultSet);
- initializeResultSet(m_pResultSet);
- OSL_TRACE("Out :: OPreparedStatement::parseSql()");
- return sal_True;
+ return eStatementType;
}
// -----------------------------------------------------------------------------
-
-OResultSet* OPreparedStatement::createResultSet( )
+void OPreparedStatement::initializeResultSet( OResultSet* _pResult )
{
- OSL_TRACE("In/Out : OPreparedStatement::createResultSet( )");
- return new OResultSet( this, m_pSQLIterator );
+ OCommonStatement::initializeResultSet( _pResult );
+ _pResult->setParameterColumns( m_xParamColumns );
+ _pResult->setParameterRow( m_aParameterRow );
}
// -----------------------------------------------------------------------------
-void OPreparedStatement::initializeResultSet( OResultSet* _pResult )
+void OPreparedStatement::clearCachedResultSet()
{
- OSL_TRACE("In : OPreparedStatement::initializeResultSet( )");
- OStatement_Base::initializeResultSet( _pResult );
-
- _pResult->setParameterColumns(m_xParamColumns);
- _pResult->setParameterRow(m_aParameterRow);
- OSL_TRACE("Out : OPreparedStatement::initializeResultSet( )");
+ OCommonStatement::clearCachedResultSet();
+ m_pResultSet.clear();
+ m_xMetaData.clear();
+}
+// -----------------------------------------------------------------------------
+void OPreparedStatement::cacheResultSet( const ::rtl::Reference< OResultSet >& _pResult )
+{
+ OCommonStatement::cacheResultSet( _pResult );
+ OSL_PRECOND( m_pResultSet == NULL, "OPreparedStatement::parseSql: you should call clearCachedResultSet before!" );
+ m_pResultSet = _pResult;
}
// -----------------------------------------------------------------------------
void SAL_CALL OPreparedStatement::acquire() throw()
{
- OStatement_BASE2::acquire();
+ OCommonStatement::acquire();
}
// -----------------------------------------------------------------------------
void SAL_CALL OPreparedStatement::release() throw()
{
- OStatement_BASE2::release();
+ OCommonStatement::release();
}
// -----------------------------------------------------------------------------
Any SAL_CALL OPreparedStatement::queryInterface( const Type & rType ) throw(RuntimeException)
{
- Any aRet = OStatement_BASE2::queryInterface(rType);
+ Any aRet = OCommonStatement::queryInterface(rType);
if(!aRet.hasValue())
aRet = OPreparedStatement_BASE::queryInterface(rType);
return aRet;
@@ -169,61 +163,41 @@ Any SAL_CALL OPreparedStatement::queryInterface( const Type & rType ) throw(Runt
// -------------------------------------------------------------------------
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL OPreparedStatement::getTypes( ) throw(::com::sun::star::uno::RuntimeException)
{
- return ::comphelper::concatSequences(OPreparedStatement_BASE::getTypes(),OStatement_BASE2::getTypes());
+ return ::comphelper::concatSequences(OPreparedStatement_BASE::getTypes(),OCommonStatement::getTypes());
}
// -------------------------------------------------------------------------
Reference< XResultSetMetaData > SAL_CALL OPreparedStatement::getMetaData( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
- sal_Bool bReadOnly= sal_True;
- if (m_pResultSet)
+ checkDisposed(OCommonStatement_IBASE::rBHelper.bDisposed);
+
+ sal_Bool bReadOnly = sal_True;
+ if ( m_pResultSet.is() )
bReadOnly = m_pResultSet->determineReadOnly();
- if(!m_xMetaData.is())
+ // if we do not have a result set, then we have not been executed, yet. In this case, assuming readonly=true is
+ // okay, /me thinks.
+
+ if ( !m_xMetaData.is() )
m_xMetaData = new OResultSetMetaData( m_pSQLIterator->getSelectColumns(), m_pSQLIterator->getTables().begin()->first ,m_pTable,bReadOnly );
+
return m_xMetaData;
}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::close( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
-
- // Reset last warning message
-
- try {
- clearWarnings ();
- clearMyResultSet();
- // OStatement_BASE2::close();
- }
- catch (SQLException &) {
- // If we get an error, ignore
- }
- // Remove this Statement object from the Connection object's
- // list
-}
// -------------------------------------------------------------------------
-
sal_Bool SAL_CALL OPreparedStatement::execute( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
+ checkDisposed(OCommonStatement_IBASE::rBHelper.bDisposed);
-
- Reference< XResultSet> xRS = OStatement_Base::executeQuery( m_sSqlStatement );
- // same as in statement with the difference that this statement also can contain parameter
-
- OSL_TRACE("In/Out: OPreparedStatement::execute" );
- return xRS.is();
+ Reference< XResultSet> xResult = executeQuery();
+ return xResult.is();
}
// -------------------------------------------------------------------------
sal_Int32 SAL_CALL OPreparedStatement::executeUpdate( ) throw(SQLException, RuntimeException)
{
+ ::dbtools::throwFeatureNotImplementedException( "XStatement::executeUpdate", *this );
return 0;
}
// -------------------------------------------------------------------------
@@ -231,7 +205,7 @@ sal_Int32 SAL_CALL OPreparedStatement::executeUpdate( ) throw(SQLException, Run
void SAL_CALL OPreparedStatement::setString( sal_Int32 parameterIndex, const ::rtl::OUString& x ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
+ checkDisposed(OCommonStatement_IBASE::rBHelper.bDisposed);
OSL_TRACE("prepStmt::setString( %s )", OUtoCStr( x ) );
setParameter( parameterIndex, x );
@@ -241,7 +215,7 @@ void SAL_CALL OPreparedStatement::setString( sal_Int32 parameterIndex, const ::r
Reference< XConnection > SAL_CALL OPreparedStatement::getConnection( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
+ checkDisposed(OCommonStatement_IBASE::rBHelper.bDisposed);
return (Reference< XConnection >)m_pConnection;
}
@@ -251,12 +225,11 @@ Reference< XResultSet > SAL_CALL OPreparedStatement::executeQuery( ) throw(SQLE
{
::osl::MutexGuard aGuard( m_aMutex );
OSL_TRACE("In: OPreparedStatement::executeQuery" );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
- Reference< XResultSet > rs = OStatement_Base::executeQuery( m_sSqlStatement );
+ checkDisposed(OCommonStatement_IBASE::rBHelper.bDisposed);
- OSL_TRACE("Out: OPreparedStatement::executeQuery" );
- return rs;
+ // our statement has already been parsed in lateInit, no need to do all this (potentially expensive)
+ // stuff again. Just execute.
+ return impl_executeCurrentQuery();
}
// -------------------------------------------------------------------------
@@ -318,7 +291,7 @@ void SAL_CALL OPreparedStatement::setLong( sal_Int32 /*parameterIndex*/, sal_Int
void SAL_CALL OPreparedStatement::setNull( sal_Int32 parameterIndex, sal_Int32 /*sqlType*/ ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
+ checkDisposed(OCommonStatement_IBASE::rBHelper.bDisposed);
checkAndResizeParameters(parameterIndex);
@@ -410,7 +383,7 @@ void OPreparedStatement::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,cons
case PROPERTY_ID_USEBOOKMARKS:
break;
default:
- OStatement_Base::setFastPropertyValue_NoBroadcast(nHandle,rValue);
+ OCommonStatement::setFastPropertyValue_NoBroadcast(nHandle,rValue);
}
}
// -----------------------------------------------------------------------------
@@ -422,7 +395,7 @@ void OPreparedStatement::checkParameterIndex(sal_Int32 _parameterIndex)
// -----------------------------------------------------------------------------
void OPreparedStatement::checkAndResizeParameters(sal_Int32 parameterIndex)
{
- ::connectivity::checkDisposed(OStatement_BASE::rBHelper.bDisposed);
+ ::connectivity::checkDisposed(OCommonStatement_IBASE::rBHelper.bDisposed);
if ( !m_aParameterRow.isValid() ) {
m_aParameterRow = new OValueVector();
diff --git a/connectivity/source/drivers/mozab/MPreparedStatement.hxx b/connectivity/source/drivers/mozab/MPreparedStatement.hxx
index 3a4a591cd5..d1d835c5ac 100644
--- a/connectivity/source/drivers/mozab/MPreparedStatement.hxx
+++ b/connectivity/source/drivers/mozab/MPreparedStatement.hxx
@@ -53,7 +53,7 @@ namespace connectivity
::com::sun::star::sdbc::XMultipleResults,
::com::sun::star::lang::XServiceInfo> OPreparedStatement_BASE;
- class OPreparedStatement : public OStatement_BASE2,
+ class OPreparedStatement : public OCommonStatement,
public OPreparedStatement_BASE
{
protected:
@@ -79,7 +79,7 @@ namespace connectivity
::rtl::OUString m_sSqlStatement;
::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > m_xMetaData;
sal_Bool m_bPrepared;
- OResultSet* m_pResultSet;
+ ::rtl::Reference< OResultSet > m_pResultSet;
::vos::ORef<connectivity::OSQLColumns> m_xParamColumns; // the parameter columns
OValueRow m_aParameterRow;
@@ -93,29 +93,29 @@ namespace connectivity
virtual ~OPreparedStatement();
virtual void SAL_CALL disposing();
- virtual sal_Bool parseSql( const ::rtl::OUString& sql , sal_Bool bAdjusted = sal_False) throw (
- ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException );
- virtual OResultSet* createResultSet();
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet> initResultSet();
+ // OCommonStatement overridables
+ virtual StatementType
+ parseSql( const ::rtl::OUString& sql , sal_Bool bAdjusted = sal_False) throw ( ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException );
+ virtual void initializeResultSet( OResultSet* _pResult );
+ virtual void clearCachedResultSet();
+ virtual void cacheResultSet( const ::rtl::Reference< OResultSet >& _pResult );
+
void checkAndResizeParameters(sal_Int32 parameterIndex);
void setParameter(sal_Int32 parameterIndex, const ORowSetValue& x);
-
sal_uInt32 AddParameter(connectivity::OSQLParseNode * pParameter,
const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xCol);
void scanParameter(OSQLParseNode* pParseNode,::std::vector< OSQLParseNode*>& _rParaNodes);
void describeColumn(OSQLParseNode* _pParameter,OSQLParseNode* _pNode,const OSQLTable& _xTable);
void describeParameter();
- virtual void initializeResultSet( OResultSet* _pResult );
-
public:
DECLARE_SERVICE_INFO();
// ein Konstruktor, der fuer das Returnen des Objektes benoetigt wird:
OPreparedStatement( OConnection* _pConnection,const ::rtl::OUString& sql);
- sal_Bool lateInit();
+ void lateInit();
//XInterface
virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
@@ -153,8 +153,6 @@ namespace connectivity
virtual void SAL_CALL setClob( sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XClob >& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setArray( sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XArray >& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL clearParameters( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XCloseable
- virtual void SAL_CALL close( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
// XResultSetMetaDataSupplier
virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > SAL_CALL getMetaData( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
// XMultipleResults
@@ -163,9 +161,9 @@ namespace connectivity
virtual sal_Bool SAL_CALL getMoreResults( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
public:
- using OStatement_Base::executeQuery;
- using OStatement_Base::executeUpdate;
- using OStatement_Base::execute;
+ using OCommonStatement::executeQuery;
+ using OCommonStatement::executeUpdate;
+ using OCommonStatement::execute;
protected:
using OPropertySetHelper::getFastPropertyValue;
};
diff --git a/connectivity/source/drivers/mozab/MResultSet.cxx b/connectivity/source/drivers/mozab/MResultSet.cxx
index e9bc6915cc..f3755e95ab 100644
--- a/connectivity/source/drivers/mozab/MResultSet.cxx
+++ b/connectivity/source/drivers/mozab/MResultSet.cxx
@@ -99,7 +99,7 @@ sal_Bool SAL_CALL OResultSet::supportsService( const ::rtl::OUString& _rServiceN
}
// -------------------------------------------------------------------------
-OResultSet::OResultSet(OStatement_Base* pStmt, const ::boost::shared_ptr< connectivity::OSQLParseTreeIterator >& _pSQLIterator )
+OResultSet::OResultSet(OCommonStatement* pStmt, const ::boost::shared_ptr< connectivity::OSQLParseTreeIterator >& _pSQLIterator )
: OResultSet_BASE(m_aMutex)
,OPropertySetHelper(OResultSet_BASE::rBHelper)
,m_pStatement(pStmt)
@@ -512,7 +512,7 @@ void SAL_CALL OResultSet::close( ) throw(SQLException, RuntimeException)
{
ResultSetEntryGuard aGuard( *this );
OSL_TRACE("In/Out: OResultSet::close" );
- // dispose();
+ dispose();
}
// -------------------------------------------------------------------------
@@ -1125,9 +1125,6 @@ void OResultSet::fillRowData()
m_aQuery.setExpression( queryExpression );
- // We need a unique id for caching mechanism so should fetch card:URI
- m_aQuery.setAttributes( m_aAttributeStrings );
-
rtl::OUString aStr( m_pTable->getName() );
m_aQuery.setAddressbook( aStr );
diff --git a/connectivity/source/drivers/mozab/MResultSet.hxx b/connectivity/source/drivers/mozab/MResultSet.hxx
index e0c1a24462..d93a723213 100644
--- a/connectivity/source/drivers/mozab/MResultSet.hxx
+++ b/connectivity/source/drivers/mozab/MResultSet.hxx
@@ -83,7 +83,7 @@ namespace connectivity
public ::comphelper::OPropertyArrayUsageHelper<OResultSet>
{
protected:
- OStatement_Base* m_pStatement;
+ OCommonStatement* m_pStatement;
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> m_xStatement;
::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData> m_xMetaData;
sal_uInt32 m_nRowPos;
@@ -126,7 +126,7 @@ namespace connectivity
public:
DECLARE_SERVICE_INFO();
- OResultSet(OStatement_Base* pStmt, const ::boost::shared_ptr< ::connectivity::OSQLParseTreeIterator >& _pSQLIterator );
+ OResultSet(OCommonStatement* pStmt, const ::boost::shared_ptr< ::connectivity::OSQLParseTreeIterator >& _pSQLIterator );
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > operator *()
diff --git a/connectivity/source/drivers/mozab/MResultSetMetaData.cxx b/connectivity/source/drivers/mozab/MResultSetMetaData.cxx
index ddbf4b7766..ccfe2e3e90 100644
--- a/connectivity/source/drivers/mozab/MResultSetMetaData.cxx
+++ b/connectivity/source/drivers/mozab/MResultSetMetaData.cxx
@@ -184,12 +184,7 @@ sal_Bool SAL_CALL OResultSetMetaData::isSearchable( sal_Int32 column ) throw(SQL
if ( m_pTable->getConnection()->isLDAP() )
{
const OColumnAlias& aAliases( m_pTable->getConnection()->getColumnAlias() );
- OColumnAlias::ProgrammaticName eProgrammatic( aAliases.getProgrammaticNameIndex( sColumnName ) );
- if ( ( eProgrammatic == OColumnAlias::HOMECOUNTRY )
- || ( eProgrammatic == OColumnAlias::WORKCOUNTRY )
- )
- // for those, we know that they're not searchable in the Mozilla/LDAP implementation.
- // There might be more ...
+ if ( !aAliases.isColumnSearchable( sColumnName ) )
return sal_False;
}
diff --git a/connectivity/source/drivers/mozab/MStatement.cxx b/connectivity/source/drivers/mozab/MStatement.cxx
index 92ad5ac867..19f32d0cb5 100644
--- a/connectivity/source/drivers/mozab/MStatement.cxx
+++ b/connectivity/source/drivers/mozab/MStatement.cxx
@@ -36,6 +36,7 @@
#include <comphelper/property.hxx>
#include <comphelper/uno3.hxx>
#include <osl/thread.h>
+#include <tools/diagnose_ex.h>
#include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
#include <com/sun/star/sdbc/ResultSetType.hpp>
#include <com/sun/star/sdbc/FetchDirection.hpp>
@@ -78,39 +79,33 @@ using namespace com::sun::star::container;
using namespace com::sun::star::io;
using namespace com::sun::star::util;
//------------------------------------------------------------------------------
-OStatement_Base::OStatement_Base(OConnection* _pConnection )
- :OStatement_BASE(m_aMutex)
- ,OPropertySetHelper(OStatement_BASE::rBHelper)
+OCommonStatement::OCommonStatement(OConnection* _pConnection )
+ :OCommonStatement_IBASE(m_aMutex)
+ ,OPropertySetHelper(OCommonStatement_IBASE::rBHelper)
+ ,OCommonStatement_SBASE((::cppu::OWeakObject*)_pConnection, this)
,m_xDBMetaData(_pConnection->getMetaData())
,m_pTable(NULL)
,m_pConnection(_pConnection)
,m_aParser(_pConnection->getDriver()->getMSFactory())
,m_pSQLIterator( new OSQLParseTreeIterator( _pConnection, _pConnection->createCatalog()->getTables(), m_aParser, NULL ) )
,m_pParseTree(NULL)
- ,rBHelper(OStatement_BASE::rBHelper)
+ ,rBHelper(OCommonStatement_IBASE::rBHelper)
{
m_pConnection->acquire();
- OSL_TRACE("In/Out: OStatement_Base::OStatement_Base" );
+ OSL_TRACE("In/Out: OCommonStatement::OCommonStatement" );
}
// -----------------------------------------------------------------------------
-OStatement_Base::~OStatement_Base()
+OCommonStatement::~OCommonStatement()
{
}
+
//------------------------------------------------------------------------------
-void OStatement_Base::disposeResultSet()
-{
- // free the cursor if alive
- Reference< XComponent > xComp(m_xResultSet.get(), UNO_QUERY);
- if (xComp.is())
- xComp->dispose();
- m_xResultSet = Reference< XResultSet>();
-}
-//------------------------------------------------------------------------------
-void OStatement_BASE2::disposing()
+void OCommonStatement::disposing()
{
::osl::MutexGuard aGuard(m_aMutex);
- disposeResultSet();
+ clearWarnings();
+ clearCachedResultSet();
if (m_pConnection)
m_pConnection->release();
@@ -119,76 +114,38 @@ void OStatement_BASE2::disposing()
m_pSQLIterator->dispose();
dispose_ChildImpl();
- OStatement_Base::disposing();
+ OCommonStatement_IBASE::disposing();
}
//-----------------------------------------------------------------------------
-void SAL_CALL OStatement_BASE2::release() throw()
+Any SAL_CALL OCommonStatement::queryInterface( const Type & rType ) throw(RuntimeException)
{
- relase_ChildImpl();
-}
-//-----------------------------------------------------------------------------
-Any SAL_CALL OStatement_Base::queryInterface( const Type & rType ) throw(RuntimeException)
-{
- Any aRet = OStatement_BASE::queryInterface(rType);
+ Any aRet = OCommonStatement_IBASE::queryInterface(rType);
if(!aRet.hasValue())
aRet = OPropertySetHelper::queryInterface(rType);
return aRet;
}
// -------------------------------------------------------------------------
-Sequence< Type > SAL_CALL OStatement_Base::getTypes( ) throw(RuntimeException)
+Sequence< Type > SAL_CALL OCommonStatement::getTypes( ) throw(RuntimeException)
{
::cppu::OTypeCollection aTypes( ::getCppuType( (const Reference< XMultiPropertySet > *)0 ),
::getCppuType( (const Reference< XFastPropertySet > *)0 ),
::getCppuType( (const Reference< XPropertySet > *)0 ));
- return ::comphelper::concatSequences(aTypes.getTypes(),OStatement_BASE::getTypes());
+ return ::comphelper::concatSequences(aTypes.getTypes(),OCommonStatement_IBASE::getTypes());
}
// -------------------------------------------------------------------------
-void SAL_CALL OStatement_Base::close( ) throw(SQLException, RuntimeException)
+void SAL_CALL OCommonStatement::close( ) throw(SQLException, RuntimeException)
{
{
::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
+ checkDisposed(OCommonStatement_IBASE::rBHelper.bDisposed);
}
dispose();
}
-// -------------------------------------------------------------------------
-
-void OStatement_Base::reset() throw (SQLException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
- clearWarnings ();
-
- if (m_xResultSet.get().is())
- clearMyResultSet();
-}
-//--------------------------------------------------------------------
-// clearMyResultSet
-// If a ResultSet was created for this Statement, close it
-//--------------------------------------------------------------------
-
-void OStatement_Base::clearMyResultSet () throw (SQLException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
- try
- {
- Reference<XCloseable> xCloseable;
- if ( ::comphelper::query_interface( m_xResultSet.get(), xCloseable ) )
- xCloseable->close();
- }
- catch( const DisposedException& ) { }
-
- m_xResultSet = Reference< XResultSet >();
-}
-
-void OStatement_Base::createTable( )
- throw ( SQLException, RuntimeException )
+// -------------------------------------------------------------------------
+void OCommonStatement::createTable( ) throw ( SQLException, RuntimeException )
{
if(m_pParseTree)
{
@@ -233,13 +190,11 @@ void OStatement_Base::createTable( )
getOwnConnection()->throwSQLException( STR_QUERY_TOO_COMPLEX, *this );
}
// -------------------------------------------------------------------------
-sal_Bool OStatement_Base::parseSql( const ::rtl::OUString& sql , sal_Bool bAdjusted)
+OCommonStatement::StatementType OCommonStatement::parseSql( const ::rtl::OUString& sql , sal_Bool bAdjusted)
throw ( SQLException, RuntimeException )
{
::rtl::OUString aErr;
- OSL_TRACE("In/Out :: OStatement::parseSql(%s)\n", OUtoCStr( sql ) );
-
m_pParseTree = m_aParser.parseTree(aErr,sql);
#if OSL_DEBUG_LEVEL > 0
@@ -285,12 +240,14 @@ sal_Bool OStatement_Base::parseSql( const ::rtl::OUString& sql , sal_Bool bAdjus
createColumnMapping();
analyseSQL();
- break;
+ return eSelect;
+
case SQL_STATEMENT_CREATE_TABLE:
createTable();
- return sal_False;
+ return eCreateTable;
+
default:
- getOwnConnection()->throwSQLException( STR_QUERY_TOO_COMPLEX, *this );
+ break;
}
}
else if(!bAdjusted) //Our sql parser does not support a statement like "create table foo"
@@ -298,35 +255,71 @@ sal_Bool OStatement_Base::parseSql( const ::rtl::OUString& sql , sal_Bool bAdjus
{
return parseSql(sql + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("(""E-mail"" caracter)")),sal_True);
}
- else
- getOwnConnection()->throwSQLException( STR_QUERY_TOO_COMPLEX, *this );
- return sal_True;
+
+ getOwnConnection()->throwSQLException( STR_QUERY_TOO_COMPLEX, *this );
+ OSL_ENSURE( false, "OCommonStatement::parseSql: unreachable!" );
+ return eSelect;
}
// -------------------------------------------------------------------------
-
-OResultSet* OStatement_Base::createResultSet()
+Reference< XResultSet > OCommonStatement::impl_executeCurrentQuery()
{
- return new OResultSet( this, m_pSQLIterator );
+ clearCachedResultSet();
+
+ ::rtl::Reference< OResultSet > pResult( new OResultSet( this, m_pSQLIterator ) );
+ initializeResultSet( pResult.get() );
+
+ pResult->executeQuery();
+ cacheResultSet( pResult ); // only cache if we survived the execution
+
+ return pResult.get();
+
}
-// -------------------------------------------------------------------------
-void OStatement_Base::initializeResultSet( OResultSet* _pResult )
+// -------------------------------------------------------------------------
+void OCommonStatement::initializeResultSet( OResultSet* _pResult )
{
- OSL_TRACE("In : initializeResultSet");
+ ENSURE_OR_THROW( _pResult, "invalid result set" );
+
_pResult->setColumnMapping(m_aColMapping);
_pResult->setOrderByColumns(m_aOrderbyColumnNumber);
_pResult->setOrderByAscending(m_aOrderbyAscending);
_pResult->setBindingRow(m_aRow);
_pResult->setTable(m_pTable);
- OSL_TRACE("Out : initializeResultSet");
}
// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OStatement_Base::execute( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
+void OCommonStatement::clearCachedResultSet()
+{
+ Reference< XResultSet > xResultSet( m_xResultSet.get(), UNO_QUERY );
+ if ( !xResultSet.is() )
+ return;
+
+ try
+ {
+ Reference< XCloseable > xCloseable( xResultSet, UNO_QUERY_THROW );
+ xCloseable->close();
+ }
+ catch( const DisposedException& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+
+ m_xResultSet = Reference< XResultSet >();
+}
+
+// -------------------------------------------------------------------------
+void OCommonStatement::cacheResultSet( const ::rtl::Reference< OResultSet >& _pResult )
+{
+ ENSURE_OR_THROW( _pResult.is(), "invalid result set" );
+ m_xResultSet = Reference< XResultSet >( _pResult.get() );
+}
+
+// -------------------------------------------------------------------------
+sal_Bool SAL_CALL OCommonStatement::execute( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
+ checkDisposed(OCommonStatement_IBASE::rBHelper.bDisposed);
OSL_TRACE("Statement::execute( %s )", OUtoCStr( sql ) );
@@ -336,31 +329,26 @@ sal_Bool SAL_CALL OStatement_Base::execute( const ::rtl::OUString& sql ) throw(S
}
// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL OStatement_Base::executeQuery( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
+Reference< XResultSet > SAL_CALL OCommonStatement::executeQuery( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_ThreadMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
+ checkDisposed(OCommonStatement_IBASE::rBHelper.bDisposed);
OSL_TRACE("Statement::executeQuery( %s )", OUtoCStr( sql ) );
- if (!parseSql( sql )) //parseSql return false means this sql is a create table statement
+ // parse the statement
+ StatementType eStatementType = parseSql( sql );
+ if ( eStatementType != eSelect )
return NULL;
- OResultSet* pResult = createResultSet();
- Reference< XResultSet > xRS = pResult;
- initializeResultSet( pResult );
-
- pResult->executeQuery();
- m_xResultSet = xRS; // we need a reference to it for later use
-
- return xRS;
+ return impl_executeCurrentQuery();
}
// -------------------------------------------------------------------------
-Reference< XConnection > SAL_CALL OStatement_Base::getConnection( ) throw(SQLException, RuntimeException)
+Reference< XConnection > SAL_CALL OCommonStatement::getConnection( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
+ checkDisposed(OCommonStatement_IBASE::rBHelper.bDisposed);
// just return our connection here
return (Reference< XConnection >)m_pConnection;
@@ -370,37 +358,37 @@ Any SAL_CALL OStatement::queryInterface( const Type & rType ) throw(RuntimeExcep
{
Any aRet = ::cppu::queryInterface(rType,static_cast< XServiceInfo*> (this));
if(!aRet.hasValue())
- aRet = OStatement_Base::queryInterface(rType);
+ aRet = OCommonStatement::queryInterface(rType);
return aRet;
}
// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OStatement_Base::executeUpdate( const ::rtl::OUString& /*sql*/ ) throw(SQLException, RuntimeException)
+sal_Int32 SAL_CALL OCommonStatement::executeUpdate( const ::rtl::OUString& /*sql*/ ) throw(SQLException, RuntimeException)
{
- ::dbtools::throwFeatureNotImplementedException( "XPreparedStatement::executeUpdate", *this );
+ ::dbtools::throwFeatureNotImplementedException( "XStatement::executeUpdate", *this );
return 0;
}
// -------------------------------------------------------------------------
-Any SAL_CALL OStatement_Base::getWarnings( ) throw(SQLException, RuntimeException)
+Any SAL_CALL OCommonStatement::getWarnings( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
+ checkDisposed(OCommonStatement_IBASE::rBHelper.bDisposed);
return makeAny(m_aLastWarning);
}
// -------------------------------------------------------------------------
// -------------------------------------------------------------------------
-void SAL_CALL OStatement_Base::clearWarnings( ) throw(SQLException, RuntimeException)
+void SAL_CALL OCommonStatement::clearWarnings( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
+ checkDisposed(OCommonStatement_IBASE::rBHelper.bDisposed);
m_aLastWarning = SQLWarning();
}
// -------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper* OStatement_Base::createArrayHelper( ) const
+::cppu::IPropertyArrayHelper* OCommonStatement::createArrayHelper( ) const
{
// this properties are define by the service resultset
// they must in alphabetic order
@@ -421,12 +409,12 @@ void SAL_CALL OStatement_Base::clearWarnings( ) throw(SQLException, RuntimeExce
}
// -------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper & OStatement_Base::getInfoHelper()
+::cppu::IPropertyArrayHelper & OCommonStatement::getInfoHelper()
{
- return *const_cast<OStatement_Base*>(this)->getArrayHelper();
+ return *const_cast<OCommonStatement*>(this)->getArrayHelper();
}
// -------------------------------------------------------------------------
-sal_Bool OStatement_Base::convertFastPropertyValue(
+sal_Bool OCommonStatement::convertFastPropertyValue(
Any & /*rConvertedValue*/,
Any & /*rOldValue*/,
sal_Int32 /*nHandle*/,
@@ -438,7 +426,7 @@ sal_Bool OStatement_Base::convertFastPropertyValue(
return bConverted;
}
// -------------------------------------------------------------------------
-void OStatement_Base::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any& /*rValue*/) throw (Exception)
+void OCommonStatement::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any& /*rValue*/) throw (Exception)
{
// set the value to what ever is nescessary
switch(nHandle)
@@ -456,7 +444,7 @@ void OStatement_Base::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const A
}
}
// -------------------------------------------------------------------------
-void OStatement_Base::getFastPropertyValue(Any& /*rValue*/,sal_Int32 nHandle) const
+void OCommonStatement::getFastPropertyValue(Any& /*rValue*/,sal_Int32 nHandle) const
{
switch(nHandle)
{
@@ -475,32 +463,32 @@ void OStatement_Base::getFastPropertyValue(Any& /*rValue*/,sal_Int32 nHandle) co
// -------------------------------------------------------------------------
IMPLEMENT_SERVICE_INFO(OStatement,"com.sun.star.sdbcx.OStatement","com.sun.star.sdbc.Statement");
// -----------------------------------------------------------------------------
-void SAL_CALL OStatement_Base::acquire() throw()
+void SAL_CALL OCommonStatement::acquire() throw()
{
- OStatement_BASE::acquire();
+ OCommonStatement_IBASE::acquire();
}
// -----------------------------------------------------------------------------
-void SAL_CALL OStatement_Base::release() throw()
+void SAL_CALL OCommonStatement::release() throw()
{
- OStatement_BASE::release();
+ relase_ChildImpl();
}
// -----------------------------------------------------------------------------
void SAL_CALL OStatement::acquire() throw()
{
- OStatement_BASE2::acquire();
+ OCommonStatement::acquire();
}
// -----------------------------------------------------------------------------
void SAL_CALL OStatement::release() throw()
{
- OStatement_BASE2::release();
+ OCommonStatement::release();
}
// -----------------------------------------------------------------------------
-Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL OStatement_Base::getPropertySetInfo( ) throw(RuntimeException)
+Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL OCommonStatement::getPropertySetInfo( ) throw(RuntimeException)
{
return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
}
// -----------------------------------------------------------------------------
-void OStatement_Base::createColumnMapping()
+void OCommonStatement::createColumnMapping()
{
size_t i;
@@ -524,7 +512,7 @@ void OStatement_Base::createColumnMapping()
}
// -----------------------------------------------------------------------------
-void OStatement_Base::analyseSQL()
+void OCommonStatement::analyseSQL()
{
const OSQLParseNode* pOrderbyClause = m_pSQLIterator->getOrderTree();
if(pOrderbyClause)
@@ -549,7 +537,7 @@ void OStatement_Base::analyseSQL()
}
}
//------------------------------------------------------------------
-void OStatement_Base::setOrderbyColumn( OSQLParseNode* pColumnRef,
+void OCommonStatement::setOrderbyColumn( OSQLParseNode* pColumnRef,
OSQLParseNode* pAscendingDescending)
{
::rtl::OUString aColumnName;
diff --git a/connectivity/source/drivers/mozab/MStatement.hxx b/connectivity/source/drivers/mozab/MStatement.hxx
index ed75db0ae0..97ae08aa70 100644
--- a/connectivity/source/drivers/mozab/MStatement.hxx
+++ b/connectivity/source/drivers/mozab/MStatement.hxx
@@ -64,21 +64,28 @@ namespace connectivity
typedef ::cppu::WeakComponentImplHelper3< ::com::sun::star::sdbc::XStatement,
::com::sun::star::sdbc::XWarningsSupplier,
- ::com::sun::star::sdbc::XCloseable> OStatement_BASE;
+ ::com::sun::star::sdbc::XCloseable> OCommonStatement_IBASE;
//**************************************************************
- //************ Class: OStatement_Base
+ //************ Class: OCommonStatement
// is a base class for the normal statement and for the prepared statement
//**************************************************************
- class OStatement_Base : public comphelper::OBaseMutex,
- public OStatement_BASE,
- public ::cppu::OPropertySetHelper,
- public ::comphelper::OPropertyArrayUsageHelper<OStatement_Base>
-
+ class OCommonStatement;
+ typedef ::connectivity::OSubComponent< OCommonStatement, OCommonStatement_IBASE > OCommonStatement_SBASE;
+
+ class OCommonStatement :public comphelper::OBaseMutex
+ ,public OCommonStatement_IBASE
+ ,public ::cppu::OPropertySetHelper
+ ,public ::comphelper::OPropertyArrayUsageHelper< OCommonStatement >
+ ,public OCommonStatement_SBASE
{
- ::com::sun::star::sdbc::SQLWarning m_aLastWarning;
+ friend class ::connectivity::OSubComponent< OCommonStatement, OCommonStatement_IBASE >;
+
+ private:
+ ::com::sun::star::sdbc::SQLWarning m_aLastWarning;
+
protected:
- ::com::sun::star::uno::WeakReference< ::com::sun::star::sdbc::XResultSet> m_xResultSet; // The last ResultSet created
+ ::com::sun::star::uno::WeakReference< ::com::sun::star::sdbc::XResultSet > m_xResultSet;
::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData> m_xDBMetaData;
::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess> m_xColNames; // table columns
@@ -105,8 +112,6 @@ namespace connectivity
protected:
- void disposeResultSet();
-
// OPropertyArrayUsageHelper
virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const;
// OPropertySetHelper
@@ -123,23 +128,37 @@ namespace connectivity
virtual void SAL_CALL getFastPropertyValue(
::com::sun::star::uno::Any& rValue,
sal_Int32 nHandle) const;
- virtual ~OStatement_Base();
+ virtual ~OCommonStatement();
protected:
//
// Driver Internal Methods
//
- virtual sal_Bool parseSql( const ::rtl::OUString& sql , sal_Bool bAdjusted = sal_False) throw (
- ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException );
+ enum StatementType { eSelect, eCreateTable };
+ /** called to do the parsing of a to-be-executed SQL statement, and set all members as needed
+ */
+ virtual StatementType
+ parseSql( const ::rtl::OUString& sql , sal_Bool bAdjusted = sal_False) throw ( ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException );
+ /** called to initialize a result set, according to a previously parsed SQL statement
+ */
+ virtual void initializeResultSet( OResultSet* _pResult );
+ /** called when a possible cached instance of our last result set should be cleared
+ */
+ virtual void clearCachedResultSet();
+ /** caches a result set which has just been created by an execution of an SQL statement
+ */
+ virtual void cacheResultSet( const ::rtl::Reference< OResultSet >& _pResult );
+
+
+ /** executes the current query (the one which has been passed to the last parseSql call)
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet >
+ impl_executeCurrentQuery();
- OResultSet* createResultSet();
- virtual void initializeResultSet( OResultSet* _pResult );
void createColumnMapping();
void analyseSQL();
void setOrderbyColumn( connectivity::OSQLParseNode* pColumnRef,
connectivity::OSQLParseNode* pAscendingDescending);
- void reset () throw( ::com::sun::star::sdbc::SQLException);
- void clearMyResultSet () throw( ::com::sun::star::sdbc::SQLException);
virtual void createTable( ) throw (
::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException );
@@ -147,11 +166,12 @@ namespace connectivity
// other methods
OConnection* getOwnConnection() const { return m_pConnection;}
- OStatement_Base(OConnection* _pConnection );
- using OStatement_BASE::operator ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >;
+ OCommonStatement(OConnection* _pConnection );
+ using OCommonStatement_IBASE::operator ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >;
// OComponentHelper
- virtual void SAL_CALL disposing(void){OStatement_BASE::disposing();}
+ virtual void SAL_CALL disposing(void);
+
// XInterface
virtual void SAL_CALL release() throw();
virtual void SAL_CALL acquire() throw();
@@ -177,28 +197,14 @@ namespace connectivity
using OPropertySetHelper::getFastPropertyValue;
};
- class OStatement_BASE2 :public OStatement_Base
- ,public ::connectivity::OSubComponent<OStatement_BASE2, OStatement_BASE>
-
- {
- friend class OSubComponent<OStatement_BASE2, OStatement_BASE>;
- public:
- OStatement_BASE2(OConnection* _pConnection ) : OStatement_Base(_pConnection ),
- ::connectivity::OSubComponent<OStatement_BASE2, OStatement_BASE>((::cppu::OWeakObject*)_pConnection, this){}
- // OComponentHelper
- virtual void SAL_CALL disposing(void);
- // XInterface
- virtual void SAL_CALL release() throw();
- };
-
- class OStatement : public OStatement_BASE2,
+ class OStatement : public OCommonStatement,
public ::com::sun::star::lang::XServiceInfo
{
protected:
~OStatement(){}
public:
// ein Konstruktor, der fuer das Returnen des Objektes benoetigt wird:
- OStatement( OConnection* _pConnection) : OStatement_BASE2( _pConnection){}
+ OStatement( OConnection* _pConnection) : OCommonStatement( _pConnection){}
DECLARE_SERVICE_INFO();
virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
diff --git a/connectivity/source/drivers/mozab/bootstrap/MMozillaBootstrap.cxx b/connectivity/source/drivers/mozab/bootstrap/MMozillaBootstrap.cxx
index 4f0dad1460..d504f75224 100644
--- a/connectivity/source/drivers/mozab/bootstrap/MMozillaBootstrap.cxx
+++ b/connectivity/source/drivers/mozab/bootstrap/MMozillaBootstrap.cxx
@@ -30,6 +30,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_connectivity.hxx"
+
#include "MMozillaBootstrap.hxx"
using namespace com::sun::star::uno;
diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSInit.cxx b/connectivity/source/drivers/mozab/bootstrap/MNSInit.cxx
index 7c71ab1041..f929108dd1 100644
--- a/connectivity/source/drivers/mozab/bootstrap/MNSInit.cxx
+++ b/connectivity/source/drivers/mozab/bootstrap/MNSInit.cxx
@@ -34,12 +34,13 @@
#include "mozilla_nsinit.h"
+#include <MNSInit.hxx>
+
#include <sal/types.h>
#include <osl/diagnose.h>
#include <osl/conditn.hxx>
#include <osl/file.hxx>
#include <rtl/bootstrap.hxx>
-#include <MNSInit.hxx>
#ifndef CONNECTIVITY_MOZAB_MCONFIGACCESS_HXX
#include "MConfigAccess.hxx"
@@ -77,7 +78,8 @@ extern "C" void NS_SetupRegistry();
const PRUnichar* pUsedProfile = *_pValidProfiles;
// have a look what the configuration suggests as preferred profile
- const PRUnichar* pPreferredProfile = static_cast< const PRUnichar* >( getUserProfile( ) );
+ // PRUnichar != sal_Unicode in mingw
+ const PRUnichar* pPreferredProfile = reinterpret_cast_mingw_only< const PRUnichar* >( getUserProfile( ) );
if ( pPreferredProfile && *pPreferredProfile )
{
PRUnichar const* const* pLoop = _pValidProfiles;
@@ -128,7 +130,12 @@ sal_Bool MNS_InitXPCOM(sal_Bool* aProfileExists)
nsCOMPtr<nsILocalFile> binDir;
// Note: if path3 construction fails, mozilla will default to using MOZILLA_FIVE_HOME in the NS_InitXPCOM2()
rtl::OUString path1(
- RTL_CONSTASCII_USTRINGPARAM("$OOO_BASE_DIR/program"));
+#if defined WNT
+ RTL_CONSTASCII_USTRINGPARAM("$BRAND_BASE_DIR/program")
+#else
+ RTL_CONSTASCII_USTRINGPARAM("$OOO_BASE_DIR/program")
+#endif
+ );
rtl::Bootstrap::expandMacros(path1);
rtl::OString path2;
if ((osl::FileBase::getSystemPathFromFileURL(path1, path1) ==
diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSProfile.cxx b/connectivity/source/drivers/mozab/bootstrap/MNSProfile.cxx
index 93a3a05087..f33cc519b9 100644
--- a/connectivity/source/drivers/mozab/bootstrap/MNSProfile.cxx
+++ b/connectivity/source/drivers/mozab/bootstrap/MNSProfile.cxx
@@ -179,7 +179,8 @@ NS_IMETHODIMP nsProfile::ProfileExists(const PRUnichar *profileName, PRBool *exi
NS_ENSURE_ARG_POINTER(profileName);
NS_ENSURE_ARG_POINTER(exists);
- *exists = xMozillaBootstrap->getProfileExists(xMozillaBootstrap->getCurrentProduct(),profileName);
+ // PRUnichar != sal_Unicode in mingw
+ *exists = xMozillaBootstrap->getProfileExists(xMozillaBootstrap->getCurrentProduct(),reinterpret_cast_mingw_only<const sal_Unicode *>(profileName));
return NS_OK;
}
// Returns the name of the current profile i.e., the last used profile
@@ -463,10 +464,12 @@ NS_IMETHODIMP nsProfile::GetProfileDir(const PRUnichar *profileName, nsIFile **p
nsresult rv = NS_OK;
- rtl::OUString path = xMozillaBootstrap->getProfilePath(xMozillaBootstrap->getCurrentProduct(),profileName);
+ // PRUnichar != sal_Unicode in mingw
+ rtl::OUString path = xMozillaBootstrap->getProfilePath(xMozillaBootstrap->getCurrentProduct(),reinterpret_cast_mingw_only<const sal_Unicode *>(profileName));
nsCOMPtr<nsILocalFile> localFile;
- nsAutoString filePath(path.getStr());
+ // PRUnichar != sal_Unicode in mingw
+ nsAutoString filePath(reinterpret_cast_mingw_only<const PRUnichar *>(path.getStr()));
rv = NS_NewLocalFile(filePath, PR_TRUE,
getter_AddRefs(localFile));
diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx b/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx
index 3ac42b4c5b..26fab98748 100644
--- a/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx
+++ b/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx
@@ -129,7 +129,8 @@ namespace connectivity
nsAutoString path;
nsresult rv = profilePath->GetPath(path);
NS_ENSURE_SUCCESS(rv, ::rtl::OUString());
- return ::rtl::OUString(path.get());
+ // PRUnichar != sal_Unicode in mingw
+ return ::rtl::OUString(reinterpret_cast_mingw_only<const sal_Unicode *>(path.get()));
}
else
return ::rtl::OUString();
@@ -170,7 +171,8 @@ namespace connectivity
//step 1 : get mozilla registry file
nsCOMPtr<nsILocalFile> localFile;
::rtl::OUString regDir( getRegistryFileName( MozillaProductType_Mozilla ) );
- nsAutoString registryDir(regDir.getStr());
+ // PRUnichar != sal_Unicode in mingw
+ nsAutoString registryDir(reinterpret_cast_mingw_only<const PRUnichar *>(regDir.getStr()));
rv = NS_NewLocalFile(registryDir, PR_TRUE,
getter_AddRefs(localFile));
NS_ENSURE_SUCCESS(rv,rv);
@@ -190,7 +192,8 @@ namespace connectivity
//step 3:Enumerator it
rv = registry->GetKey(nsIRegistry::Common,
- szProfileSubtreeString.getStr(),
+ // PRUnichar != sal_Unicode in mingw
+ reinterpret_cast_mingw_only<const PRUnichar *>(szProfileSubtreeString.getStr()),
&profilesTreeKey);
if (NS_FAILED(rv)) return rv;
@@ -198,12 +201,14 @@ namespace connectivity
// Get the current profile
rv = registry->GetString(profilesTreeKey,
- szCurrentProfileString.getStr(),
+ // PRUnichar != sal_Unicode in mingw
+ reinterpret_cast_mingw_only<const PRUnichar *>(szCurrentProfileString.getStr()),
getter_Copies(tmpCurrentProfile));
if (tmpCurrentProfile)
{
- m_Product.setCurrentProfile ( NS_STATIC_CAST(const PRUnichar*, tmpCurrentProfile));
+ // PRUnichar != sal_Unicode in mingw
+ m_Product.setCurrentProfile ( reinterpret_cast_mingw_only<const sal_Unicode *>(NS_STATIC_CAST(const PRUnichar*, tmpCurrentProfile)));
}
@@ -243,7 +248,8 @@ namespace connectivity
nsXPIDLString regData;
rv = registry->GetString(profKey,
- szDirectoryString.getStr(),
+ // PRUnichar != sal_Unicode in mingw
+ reinterpret_cast_mingw_only<const PRUnichar *>(szDirectoryString.getStr()),
getter_Copies(regData));
if (NS_FAILED(rv)) continue;
@@ -257,7 +263,8 @@ namespace connectivity
//Add found profile to profile lists
if (NS_SUCCEEDED(rv) && tempLocal)
{
- ProfileStruct* profileItem = new ProfileStruct(MozillaProductType_Mozilla,NS_STATIC_CAST(const PRUnichar*, profile),tempLocal);
+ // PRUnichar != sal_Unicode in mingw
+ ProfileStruct* profileItem = new ProfileStruct(MozillaProductType_Mozilla,reinterpret_cast_mingw_only<const sal_Unicode *>(NS_STATIC_CAST(const PRUnichar*, profile)),tempLocal);
m_Product.mProfileList[profileItem->getProfileName()] = profileItem;
}
@@ -330,7 +337,8 @@ namespace connectivity
nsCAutoString filePath(sPath.getStr());
if (isRelative) {
- nsAutoString registryDir( regDir.getStr() );
+ // PRUnichar != sal_Unicode in mingw
+ nsAutoString registryDir( reinterpret_cast_mingw_only<const PRUnichar *>(regDir.getStr()) );
nsCOMPtr<nsILocalFile> mAppData;
rv = NS_NewLocalFile(registryDir, PR_TRUE,
getter_AddRefs(mAppData));
@@ -490,7 +498,8 @@ namespace connectivity
if (!path.getLength())
return sal_True;
- nsAutoString filePath(path.getStr());
+ // PRUnichar != sal_Unicode in mingw
+ nsAutoString filePath(reinterpret_cast_mingw_only<const PRUnichar *>(path.getStr()));
nsresult rv;
nsCOMPtr<nsILocalFile> localFile;
diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSProfileManager.cxx b/connectivity/source/drivers/mozab/bootstrap/MNSProfileManager.cxx
index 90c36f2f6c..67d405915e 100644
--- a/connectivity/source/drivers/mozab/bootstrap/MNSProfileManager.cxx
+++ b/connectivity/source/drivers/mozab/bootstrap/MNSProfileManager.cxx
@@ -83,7 +83,8 @@ namespace connectivity
rv = theProfile->GetCurrentProfile(getter_Copies(currentProfileStr));
if (NS_FAILED(rv) || currentProfileStr.get() == nsnull)
return ::rtl::OUString();
- return ::rtl::OUString(currentProfileStr.get());
+ // PRUnichar != sal_Unicode in mingw
+ return ::rtl::OUString(reinterpret_cast_mingw_only<const sal_Unicode *>(currentProfileStr.get()));
}
::rtl::OUString ProfileManager::setCurrentProfile( ::com::sun::star::mozilla::MozillaProductType product, const ::rtl::OUString& profileName ) throw (::com::sun::star::uno::RuntimeException)
{
@@ -102,7 +103,8 @@ namespace connectivity
nsCOMPtr<nsIProfile> theProfile(do_GetService(NS_PROFILE_CONTRACTID,&rv));
if (NS_FAILED(rv)) return ::rtl::OUString();
- const PRUnichar* pUsedProfile = profileName.getStr();
+ // PRUnichar != sal_Unicode in mingw
+ const PRUnichar* pUsedProfile = reinterpret_cast_mingw_only<const PRUnichar *>(profileName.getStr());
//set current profile
rv = theProfile->SetCurrentProfile( pUsedProfile );
if (NS_FAILED(rv)) return ::rtl::OUString();
diff --git a/connectivity/source/drivers/mozab/bootstrap/makefile.mk b/connectivity/source/drivers/mozab/bootstrap/makefile.mk
index 5e4927f811..a22b369976 100644
--- a/connectivity/source/drivers/mozab/bootstrap/makefile.mk
+++ b/connectivity/source/drivers/mozab/bootstrap/makefile.mk
@@ -88,6 +88,8 @@ SLOFILES += \
$(SLO)$/MNSProfileDirServiceProvider.obj
.ENDIF
+CDEFS += -DMOZILLA_INTERNAL_API
+
.IF "$(GUI)"=="UNX"
.IF "$(COMNAME)"=="sunpro5"
CFLAGS += -features=tmplife
@@ -167,7 +169,7 @@ CFLAGS += -fPIC
CFLAGSCXX += \
-fno-rtti -Wconversion -Wpointer-arith \
-Wcast-align -Woverloaded-virtual -Wsynth \
- -Wno-long-long
+ -Wno-long-long -Wno-deprecated
CDEFS += -DTRACING
.ENDIF
diff --git a/connectivity/source/drivers/mozab/makefile.mk b/connectivity/source/drivers/mozab/makefile.mk
index a842c75c7a..42ce1ab8ca 100644
--- a/connectivity/source/drivers/mozab/makefile.mk
+++ b/connectivity/source/drivers/mozab/makefile.mk
@@ -66,30 +66,32 @@ MOZ_REG_LIB := $(MOZ_LIB)$/mozreg.lib
.IF "$(OS)"=="WNT"
.IF "$(COM)"=="GCC"
-MOZ_LIB_XPCOM= -L$(MOZ_LIB) -lembed_base_s -lnspr4 -lmozreg_s -lxpcom
+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= $(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) -lembed_base_s -lnspr4 -lmozreg_s -lxpcom
+MOZ_LIB_XPCOM= -L$(MOZ_LIB) -lnspr4 -lxpcom_core -lmozreg_s -lembed_base_s
.ENDIF
#End of mozilla specific stuff.
-# Disable '-z defs' due to broken libxpcom.
-LINKFLAGSDEFS=$(0)
-
USE_DEFFILE=TRUE
ENABLE_EXCEPTIONS=TRUE
VISIBILITY_HIDDEN=TRUE
+.IF "$(OS)"!="WNT"
+COMPONENT_CONFIG_DATA=$(TARGET)2.xcu
+COMPONENT_CONFIG_SCHEMA=$(TARGET)2.xcs
+.ENDIF
+
# --- Settings ----------------------------------
.IF "$(DBGUTIL_OJ)"!=""
ENVCFLAGS+=/FR$(SLO)$/
.ENDIF
-.INCLUDE : settings.mk
+.INCLUDE : $(PRJ)$/makefile.pmk
.INCLUDE : $(PRJ)$/version.mk
@@ -98,7 +100,6 @@ ENVCFLAGS+=/FR$(SLO)$/
SLOFILES=\
$(SLO)$/MDriver.obj \
$(SLO)$/MServices.obj
-
# --- MOZAB BASE Library -----------------------------------
@@ -140,7 +141,8 @@ MOZSLOFILES=\
$(SLO)$/MNSINIParser.obj \
$(SLO)$/MNSRunnable.obj \
$(SLO)$/MNSProfile.obj \
- $(SLO)$/MNSProfileDirServiceProvider.obj
+ $(SLO)$/MNSProfileDirServiceProvider.obj \
+ $(SLO)$/MLdapAttributeMap.obj
SLO2FILES=\
@@ -186,7 +188,7 @@ DEF2NAME= $(SHL2TARGET)
# --- Targets ----------------------------------
-.INCLUDE : target.mk
+.INCLUDE : $(PRJ)$/target.pmk
# --- filter file ------------------------------
diff --git a/connectivity/source/drivers/mozab/mozab.xcu b/connectivity/source/drivers/mozab/mozab.xcu
new file mode 100644
index 0000000000..7d3b78e3fe
--- /dev/null
+++ b/connectivity/source/drivers/mozab/mozab.xcu
@@ -0,0 +1,157 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--***********************************************************************
+ *
+ * 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: DataAccess.xcu,v $
+ * $Revision: 1.27 $
+ *
+ * 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.
+ *
+ ************************************************************************ -->
+<oor:component-data oor:name="Drivers" oor:package="org.openoffice.Office.DataAccess" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+ <node oor:name="Installed">
+ <node oor:name="sdbc:address:outlook" oor:op="replace">
+ <prop oor:name="Driver">
+ <value>com.sun.star.comp.sdbc.MozabDriver</value>
+ </prop>
+ <prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
+ <value xml:lang="en-US">Microsoft Outlook Address Book</value>
+ </prop>
+ <node oor:name="Features">
+ <node oor:name="EscapeDateTime" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ </node>
+ </node>
+ <node oor:name="sdbc:address:outlookexp" oor:op="replace">
+ <prop oor:name="Driver">
+ <value>com.sun.star.comp.sdbc.MozabDriver</value>
+ </prop>
+ <prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
+ <value xml:lang="en-US">Microsoft Windows Address Book</value>
+ </prop>
+ <node oor:name="Features">
+ <node oor:name="EscapeDateTime" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ </node>
+ </node>
+ <node oor:name="sdbc:address:mozilla:" oor:op="replace">
+ <prop oor:name="Driver">
+ <value>com.sun.star.comp.sdbc.MozabDriver</value>
+ </prop>
+ <prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
+ <value xml:lang="en-US">Mozilla Address Book</value>
+ </prop>
+ <node oor:name="Features">
+ <node oor:name="EscapeDateTime" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ </node>
+ <node oor:name="MetaData">
+ <node oor:name="SupportsBrowsing" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ </node>
+ </node>
+ <node oor:name="sdbc:address:thunderbird:" oor:op="replace">
+ <prop oor:name="Driver">
+ <value>com.sun.star.comp.sdbc.MozabDriver</value>
+ </prop>
+ <prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
+ <value xml:lang="en-US">Thunderbird Address Book</value>
+ </prop>
+ <node oor:name="Features">
+ <node oor:name="EscapeDateTime" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ </node>
+ <node oor:name="MetaData">
+ <node oor:name="SupportsBrowsing" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ </node>
+ </node>
+ <node oor:name="sdbc:address:ldap:*" oor:op="replace">
+ <prop oor:name="Driver">
+ <value>com.sun.star.comp.sdbc.MozabDriver</value>
+ </prop>
+ <prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
+ <value xml:lang="en-US">LDAP Address Book</value>
+ </prop>
+ <node oor:name="Properties">
+ <node oor:name="BaseDN" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:string">
+ <value></value>
+ </prop>
+ </node>
+ <node oor:name="MaxRowCount" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:int">
+ <value>100</value>
+ </prop>
+ </node>
+ <node oor:name="PortNumber" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:int">
+ <value>389</value>
+ </prop>
+ </node>
+ <node oor:name="UseSSL" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ </node>
+ </node>
+ <node oor:name="Features">
+ <node oor:name="EscapeDateTime" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ </node>
+ <node oor:name="MetaData">
+ <node oor:name="SupportsTableCreation" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="Authentication" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:string">
+ <value>UserPassword</value>
+ </prop>
+ </node>
+ </node>
+ </node>
+ </node>
+</oor:component-data>
diff --git a/connectivity/source/drivers/mozab/mozab2.xcu b/connectivity/source/drivers/mozab/mozab2.xcu
new file mode 100644
index 0000000000..33e0bebcd4
--- /dev/null
+++ b/connectivity/source/drivers/mozab/mozab2.xcu
@@ -0,0 +1,121 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--***********************************************************************
+ *
+ * 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: DataAccess.xcu,v $
+ * $Revision: 1.27 $
+ *
+ * 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.
+ *
+ ************************************************************************ -->
+<oor:component-data oor:name="Drivers" oor:package="org.openoffice.Office.DataAccess" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+ <node oor:name="Installed">
+ <node oor:name="sdbc:address:mozilla:" oor:op="replace">
+ <prop oor:name="Driver">
+ <value>com.sun.star.comp.sdbc.MozabDriver</value>
+ </prop>
+ <prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
+ <value xml:lang="en-US">Mozilla Address Book</value>
+ </prop>
+ <node oor:name="MetaData">
+ <node oor:name="SupportsBrowsing" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="EscapeDateTime" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ </node>
+ </node>
+ <node oor:name="sdbc:address:thunderbird:" oor:op="replace">
+ <prop oor:name="Driver">
+ <value>com.sun.star.comp.sdbc.MozabDriver</value>
+ </prop>
+ <prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
+ <value xml:lang="en-US">Thunderbird Address Book</value>
+ </prop>
+ <node oor:name="MetaData">
+ <node oor:name="SupportsBrowsing" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="EscapeDateTime" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ </node>
+ </node>
+ <node oor:name="sdbc:address:ldap:*" oor:op="replace">
+ <prop oor:name="Driver">
+ <value>com.sun.star.comp.sdbc.MozabDriver</value>
+ </prop>
+ <prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
+ <value xml:lang="en-US">LDAP Address Book</value>
+ </prop>
+ <node oor:name="Properties">
+ <node oor:name="BaseDN" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:string">
+ <value></value>
+ </prop>
+ </node>
+ <node oor:name="MaxRowCount" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:int">
+ <value>100</value>
+ </prop>
+ </node>
+ <node oor:name="PortNumber" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:int">
+ <value>389</value>
+ </prop>
+ </node>
+ <node oor:name="UseSSL" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ </node>
+ </node>
+ <node oor:name="MetaData">
+ <node oor:name="SupportsTableCreation" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="Authentication" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:string">
+ <value>UserPassword</value>
+ </prop>
+ </node>
+ <node oor:name="EscapeDateTime" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ </node>
+ </node>
+ </node>
+</oor:component-data>
diff --git a/connectivity/source/drivers/mozab/mozillasrc/MDatabaseMetaDataHelper.cxx b/connectivity/source/drivers/mozab/mozillasrc/MDatabaseMetaDataHelper.cxx
index 6515976958..f7e8d7750b 100644
--- a/connectivity/source/drivers/mozab/mozillasrc/MDatabaseMetaDataHelper.cxx
+++ b/connectivity/source/drivers/mozab/mozillasrc/MDatabaseMetaDataHelper.cxx
@@ -48,10 +48,12 @@
#include <osl/mutex.hxx>
#include <osl/conditn.hxx>
+#include <nsIAbDirFactoryService.h>
#include <MNSInit.hxx>
#include <MNameMapper.hxx>
#include "MNSMozabProxy.hxx"
#include <MNSDeclares.hxx>
+
static ::osl::Mutex m_aMetaMutex;
#include <osl/diagnose.h>
diff --git a/connectivity/source/drivers/mozab/mozillasrc/MLdapAttributeMap.cxx b/connectivity/source/drivers/mozab/mozillasrc/MLdapAttributeMap.cxx
new file mode 100644
index 0000000000..ba6abb3f17
--- /dev/null
+++ b/connectivity/source/drivers/mozab/mozillasrc/MLdapAttributeMap.cxx
@@ -0,0 +1,453 @@
+/*************************************************************************
+* 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: code,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.
+************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_connectivity.hxx"
+
+#include <rtl/strbuf.hxx>
+ // keep this include at the beginning. Some of the other includes seems to inject a symbol "l" into the
+ // global namespace, which leads to a compiler warning in strbuf.hxx, about some parameters named "l"
+ // hiding objects "in an outer scope".
+
+#include "MLdapAttributeMap.hxx"
+#include "MTypeConverter.hxx"
+#include "MQueryHelper.hxx"
+
+#include <tools/diagnose_ex.h>
+
+#include <hash_map>
+
+//........................................................................
+namespace connectivity { namespace mozab {
+//........................................................................
+
+ //====================================================================
+ //= helper
+ //====================================================================
+ namespace
+ {
+ typedef nsresult (NS_STDCALL nsIAbCard::*CardPropertyGetter)( PRUnichar** aFirstName );
+ typedef nsresult (NS_STDCALL nsIAbCard::*CardPropertySetter)( const PRUnichar* aFirstName );
+ struct CardPropertyData
+ {
+ const sal_Char* pLDAPAttributeList;
+ CardPropertyGetter PropGetter;
+ CardPropertySetter PropSetter;
+
+ CardPropertyData()
+ :pLDAPAttributeList( NULL )
+ ,PropGetter( NULL )
+ ,PropSetter( NULL )
+ {
+ }
+ CardPropertyData( const sal_Char* _pLDAPAttributeList, CardPropertyGetter _PropGetter, CardPropertySetter _PropSetter )
+ :pLDAPAttributeList( _pLDAPAttributeList )
+ ,PropGetter( _PropGetter )
+ ,PropSetter( _PropSetter )
+ {
+ }
+ };
+
+ typedef ::std::hash_map< ::rtl::OString, CardPropertyData, ::rtl::OStringHash > MapPropertiesToAttributes;
+
+ #define DEF_CARD_ACCESS( PropertyName ) \
+ &nsIAbCard::Get##PropertyName, &nsIAbCard::Set##PropertyName
+
+ static const MapPropertiesToAttributes& lcl_getPropertyMap()
+ {
+ static MapPropertiesToAttributes aMap;
+ if ( aMap.empty() )
+ {
+ struct MapEntry
+ {
+ const sal_Char* pAsciiPropertyName;
+ const sal_Char* pAsciiAttrributeList;
+ CardPropertyGetter PropGetter;
+ CardPropertySetter PropSetter;
+ };
+ const MapEntry aEntries[] = {
+ { "FirstName", "givenname", DEF_CARD_ACCESS( FirstName ) },
+ { "LastName", "sn,surnname", DEF_CARD_ACCESS( LastName ) },
+ { "DisplayName", "cn,commonname,displayname", DEF_CARD_ACCESS( DisplayName ) },
+ { "NickName", "xmozillanickname", DEF_CARD_ACCESS( NickName ) },
+ { "PrimaryEmail", "mail", DEF_CARD_ACCESS( PrimaryEmail ) },
+ { "SecondEmail", "xmozillasecondemail", DEF_CARD_ACCESS( SecondEmail ) },
+ { "WorkPhone", "telephonenumber", DEF_CARD_ACCESS( WorkPhone ) },
+ { "HomePhone", "homephone", DEF_CARD_ACCESS( HomePhone ) },
+ { "FaxNumber", "fax,facsimiletelephonenumber", DEF_CARD_ACCESS( FaxNumber ) },
+ { "PagerNumber", "pager,pagerphone", DEF_CARD_ACCESS( PagerNumber ) },
+ { "CellularNumber", "mobile,cellphone,carphone", DEF_CARD_ACCESS( CellularNumber ) },
+ { "HomeAddress", "homepostaladdress,mozillaHomeStreet", DEF_CARD_ACCESS( HomeAddress ) },
+ { "HomeAddress2", "mozillaHomeStreet2", DEF_CARD_ACCESS( HomeAddress2 ) },
+ { "HomeCity", "homelocality,mozillaHomeLocalityName", DEF_CARD_ACCESS( HomeCity ) },
+ { "HomeState", "homeregion,mozillaHomeState", DEF_CARD_ACCESS( HomeState ) },
+ { "HomeZipCode", "homepostalcode,mozillaHomePostalCode", DEF_CARD_ACCESS( HomeZipCode ) },
+ { "HomeCountry", "homecountryname,mozillaHomeCountryName", DEF_CARD_ACCESS( HomeCountry ) },
+ { "WorkAddress", "postofficebox,streetaddress,streetaddress1", DEF_CARD_ACCESS( WorkAddress ) },
+ { "WorkAddress2", "streetaddress2", DEF_CARD_ACCESS( WorkAddress2 ) },
+ { "WorkCity", "l,locality", DEF_CARD_ACCESS( WorkCity ) },
+ { "WorkState", "st,region", DEF_CARD_ACCESS( WorkState ) },
+ { "WorkZipCode", "postalcode,zip", DEF_CARD_ACCESS( WorkZipCode ) },
+ { "WorkCountry", "countryname", DEF_CARD_ACCESS( WorkCountry ) },
+ { "JobTitle", "title", DEF_CARD_ACCESS( JobTitle ) },
+ { "Department", "ou,orgunit,department,departmentnumber", DEF_CARD_ACCESS( Department ) },
+ { "Company", "o,company", DEF_CARD_ACCESS( Company ) },
+ { "WebPage1", "workurl", DEF_CARD_ACCESS( WebPage1 ) },
+ { "WebPage2", "homeurl", DEF_CARD_ACCESS( WebPage2 ) },
+ { "BirthYear", "birthyear", DEF_CARD_ACCESS( BirthYear ) },
+ { "BirthMonth", "birthmonth", DEF_CARD_ACCESS( BirthMonth ) },
+ { "BirthYear", "birthday", DEF_CARD_ACCESS( BirthDay ) },
+ { "Custom1", "custom1", DEF_CARD_ACCESS( Custom1 ) },
+ { "Custom2", "custom2", DEF_CARD_ACCESS( Custom2 ) },
+ { "Custom3", "custom3", DEF_CARD_ACCESS( Custom3 ) },
+ { "Custom4", "custom4", DEF_CARD_ACCESS( Custom4 ) },
+ { "Notes", "notes,description", DEF_CARD_ACCESS( Notes ) },
+ { "PreferMailFormat", "xmozillausehtmlmail", NULL, NULL },
+ { NULL, NULL, NULL, NULL }
+ };
+ const MapEntry* loop = aEntries;
+ while ( loop->pAsciiPropertyName )
+ {
+ aMap[ ::rtl::OString( loop->pAsciiPropertyName ) ] =
+ CardPropertyData( loop->pAsciiAttrributeList, loop->PropGetter, loop->PropSetter );
+ ++loop;
+ }
+ }
+ return aMap;
+ }
+ }
+
+ //====================================================================
+ //= AttributeMap_Data
+ //====================================================================
+ struct AttributeMap_Data
+ {
+ };
+
+ //====================================================================
+ //= MLdapAttributeMap
+ //====================================================================
+ // -------------------------------------------------------------------
+ MLdapAttributeMap::MLdapAttributeMap()
+ :m_pData( new AttributeMap_Data )
+ {
+ }
+
+ // -------------------------------------------------------------------
+ MLdapAttributeMap::~MLdapAttributeMap()
+ {
+ }
+
+ // -------------------------------------------------------------------
+ NS_IMPL_THREADSAFE_ISUPPORTS1( MLdapAttributeMap, nsIAbLDAPAttributeMap )
+
+ // -------------------------------------------------------------------
+ NS_IMETHODIMP MLdapAttributeMap::GetAttributeList(const nsACString & aProperty, nsACString & _retval)
+ {
+ ::rtl::OString sProperty( MTypeConverter::nsACStringToOString( aProperty ) );
+
+ const MapPropertiesToAttributes& rPropertyMap( lcl_getPropertyMap() );
+ MapPropertiesToAttributes::const_iterator pos = rPropertyMap.find( sProperty );
+
+ if ( pos == rPropertyMap.end() )
+ {
+ _retval.SetIsVoid( PR_TRUE );
+ }
+ else
+ {
+ MTypeConverter::asciiToNsACString( pos->second.pLDAPAttributeList, _retval );
+ }
+
+ return NS_OK;
+ }
+
+ // -------------------------------------------------------------------
+ NS_IMETHODIMP MLdapAttributeMap::GetAttributes(const nsACString & aProperty, PRUint32* aCount, char*** aAttrs)
+ {
+ OSL_ENSURE( false, "MLdapAttributeMap::GetAttributes: not implemented!" );
+ (void)aProperty;
+ (void)aCount;
+ (void)aAttrs;
+ return NS_ERROR_NOT_IMPLEMENTED;
+ }
+
+ // -------------------------------------------------------------------
+ NS_IMETHODIMP MLdapAttributeMap::GetFirstAttribute(const nsACString & aProperty, nsACString & _retval)
+ {
+ ::rtl::OString sProperty( MTypeConverter::nsACStringToOString( aProperty ) );
+
+ const MapPropertiesToAttributes& rPropertyMap( lcl_getPropertyMap() );
+ MapPropertiesToAttributes::const_iterator pos = rPropertyMap.find( sProperty );
+
+ if ( pos == rPropertyMap.end() )
+ {
+ _retval.SetIsVoid( PR_TRUE );
+ }
+ else
+ {
+ sal_Int32 tokenPos(0);
+ ::rtl::OString sAttributeList( pos->second.pLDAPAttributeList );
+ MTypeConverter::asciiToNsACString( sAttributeList.getToken( 0, ',', tokenPos ).getStr(), _retval );
+ }
+
+ return NS_OK;
+ }
+
+ // -------------------------------------------------------------------
+ NS_IMETHODIMP MLdapAttributeMap::SetAttributeList(const nsACString & aProperty, const nsACString & aAttributeList, PRBool allowInconsistencies)
+ {
+ OSL_ENSURE( false, "MLdapAttributeMap::SetAttributeList: not implemented!" );
+ (void)aProperty;
+ (void)aAttributeList;
+ (void)allowInconsistencies;
+ return NS_ERROR_NOT_IMPLEMENTED;
+ }
+
+ // -------------------------------------------------------------------
+ NS_IMETHODIMP MLdapAttributeMap::GetProperty(const nsACString & aAttribute, nsACString & _retval)
+ {
+ OSL_ENSURE( false, "MLdapAttributeMap::GetProperty: not implemented!" );
+ (void)aAttribute;
+ (void)_retval;
+ return NS_ERROR_NOT_IMPLEMENTED;
+ }
+
+ // -------------------------------------------------------------------
+ NS_IMETHODIMP MLdapAttributeMap::GetAllCardAttributes(nsACString & _retval)
+ {
+ const MapPropertiesToAttributes& rPropertyMap( lcl_getPropertyMap() );
+
+ ::rtl::OStringBuffer aAllAttributes;
+ for ( MapPropertiesToAttributes::const_iterator loop = rPropertyMap.begin();
+ loop != rPropertyMap.end();
+ ++loop
+ )
+ {
+ aAllAttributes.append( loop->second.pLDAPAttributeList );
+ if ( loop != rPropertyMap.end() )
+ aAllAttributes.append( ',' );
+ }
+
+ MTypeConverter::asciiToNsACString( aAllAttributes.getStr(), _retval );
+ return NS_OK;
+ }
+
+ // -------------------------------------------------------------------
+ NS_IMETHODIMP MLdapAttributeMap::CheckState(void)
+ {
+ // we do not allow modifying the map, so we're always in a valid state
+ return NS_OK;
+ }
+
+ // -------------------------------------------------------------------
+ NS_IMETHODIMP MLdapAttributeMap::SetFromPrefs(const nsACString & aPrefBranchName)
+ {
+ OSL_ENSURE( false, "MLdapAttributeMap::SetFromPrefs: not implemented!" );
+ (void)aPrefBranchName;
+ return NS_ERROR_NOT_IMPLEMENTED;
+ }
+
+ // -------------------------------------------------------------------
+ NS_IMETHODIMP MLdapAttributeMap::SetCardPropertiesFromLDAPMessage(nsILDAPMessage* aMessage, nsIAbCard* aCard)
+ {
+ NS_ENSURE_ARG_POINTER( aMessage );
+ NS_ENSURE_ARG_POINTER( aCard );
+
+ // in case that's not present in the LDAP message: set the "preferred mail format" to "none"
+ aCard->SetPreferMailFormat( nsIAbPreferMailFormat::unknown );
+
+ const MapPropertiesToAttributes& rPropertyMap( lcl_getPropertyMap() );
+ for ( MapPropertiesToAttributes::const_iterator prop = rPropertyMap.begin();
+ prop != rPropertyMap.end();
+ ++prop
+ )
+ {
+ // split the list of attributes for the current property
+ ::rtl::OString sAttributeList( prop->second.pLDAPAttributeList );
+ ::rtl::OString sAttribute;
+
+ sal_Int32 tokenPos = 0;
+ while ( tokenPos != -1 )
+ {
+ sAttribute = sAttributeList.getToken( 0, ',', tokenPos );
+
+ // retrieve the values for the current attribute
+ PRUint32 valueCount = 0;
+ PRUnichar** values = NULL;
+ nsresult rv = aMessage->GetValues( sAttribute.getStr(), &valueCount, &values );
+ if ( NS_FAILED( rv ) )
+ // try the next attribute
+ continue;
+
+ if ( valueCount )
+ {
+ CardPropertySetter propSetter = prop->second.PropSetter;
+ OSL_ENSURE( propSetter,
+ "MLdapAttributeMap::SetCardPropertiesFromLDAPMessage: "
+ "unexpected: could retrieve an attribute value, but have no setter for it!" );
+ if ( propSetter )
+ {
+ (aCard->*propSetter)( values[0] );
+ }
+
+ // we're done with this property - no need to handle the remaining attributes which
+ // map to it
+ break;
+ }
+ }
+ }
+ return NS_OK;
+ }
+
+ // -------------------------------------------------------------------
+ namespace
+ {
+ struct PreferMailFormatType
+ {
+ const sal_Char* description;
+ PRUint32 formatType;
+
+ PreferMailFormatType()
+ :description( NULL )
+ ,formatType( nsIAbPreferMailFormat::unknown )
+ {
+ }
+
+ PreferMailFormatType( const sal_Char* _description, PRUint32 _formatType )
+ :description( _description )
+ ,formatType( _formatType )
+ {
+ }
+ };
+
+ static const PreferMailFormatType* lcl_getMailFormatTypes()
+ {
+ static const PreferMailFormatType aMailFormatTypes[] =
+ {
+ PreferMailFormatType( "text/plain", nsIAbPreferMailFormat::plaintext ),
+ PreferMailFormatType( "text/html", nsIAbPreferMailFormat::html ),
+ PreferMailFormatType( "unknown", nsIAbPreferMailFormat::unknown ),
+ PreferMailFormatType()
+ };
+ return aMailFormatTypes;
+ }
+ }
+
+ // -------------------------------------------------------------------
+ void MLdapAttributeMap::fillCardFromResult( nsIAbCard& _card, const MQueryHelperResultEntry& _result )
+ {
+ _card.SetPreferMailFormat( nsIAbPreferMailFormat::unknown );
+
+ ::rtl::OUString resultValue;
+
+ const MapPropertiesToAttributes& rPropertyMap( lcl_getPropertyMap() );
+ for ( MapPropertiesToAttributes::const_iterator prop = rPropertyMap.begin();
+ prop != rPropertyMap.end();
+ ++prop
+ )
+ {
+ resultValue = _result.getValue( prop->first );
+
+ CardPropertySetter propSetter = prop->second.PropSetter;
+ if ( propSetter )
+ {
+ // PRUnichar != sal_Unicode in mingw
+ (_card.*propSetter)( reinterpret_cast_mingw_only<const PRUnichar *>(resultValue.getStr()) );
+ }
+ else
+ {
+ if ( prop->first.equals( "PreferMailFormat" ) )
+ {
+ unsigned int format = nsIAbPreferMailFormat::unknown;
+ const PreferMailFormatType* pMailFormatType = lcl_getMailFormatTypes();
+ while ( pMailFormatType->description )
+ {
+ if ( resultValue.equalsAscii( pMailFormatType->description ) )
+ {
+ format = pMailFormatType->formatType;
+ break;
+ }
+ ++pMailFormatType;
+ }
+ _card.SetPreferMailFormat(format);
+ }
+ else
+ OSL_ENSURE( false, "MLdapAttributeMap::fillCardFromResult: unexpected property without default setters!" );
+ }
+ }
+ }
+
+ // -------------------------------------------------------------------
+ void MLdapAttributeMap::fillResultFromCard( MQueryHelperResultEntry& _result, nsIAbCard& _card )
+ {
+ nsXPIDLString value;
+ ::rtl::OUString resultValue;
+
+ const MapPropertiesToAttributes& rPropertyMap( lcl_getPropertyMap() );
+ for ( MapPropertiesToAttributes::const_iterator prop = rPropertyMap.begin();
+ prop != rPropertyMap.end();
+ ++prop
+ )
+ {
+ CardPropertyGetter propGetter = prop->second.PropGetter;
+ if ( propGetter )
+ {
+ (_card.*propGetter)( getter_Copies( value ) );
+
+ nsAutoString temp( value );
+ MTypeConverter::nsStringToOUString( temp, resultValue );
+ }
+ else
+ {
+ if ( prop->first.equals( "PreferMailFormat" ) )
+ {
+ unsigned int format = nsIAbPreferMailFormat::unknown;
+ _card.GetPreferMailFormat( &format );
+ const PreferMailFormatType* pMailFormatType = lcl_getMailFormatTypes();
+ while ( pMailFormatType->description )
+ {
+ if ( format == pMailFormatType->formatType )
+ {
+ resultValue = ::rtl::OUString::createFromAscii( pMailFormatType->description );
+ break;
+ }
+ ++pMailFormatType;
+ }
+ }
+ else
+ OSL_ENSURE( false, "MLdapAttributeMap::fillResultFromCard: unexpected property without default getters!" );
+ }
+
+ _result.insert( prop->first, resultValue );
+ }
+ }
+
+//........................................................................
+} } // namespace connectivity::mozab
+//........................................................................
diff --git a/connectivity/source/drivers/mozab/mozillasrc/MLdapAttributeMap.hxx b/connectivity/source/drivers/mozab/mozillasrc/MLdapAttributeMap.hxx
new file mode 100644
index 0000000000..80bd222f6a
--- /dev/null
+++ b/connectivity/source/drivers/mozab/mozillasrc/MLdapAttributeMap.hxx
@@ -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: code,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 CONNECTIVITY_MLDAPATTRIBUTEMAP_HXX
+#define CONNECTIVITY_MLDAPATTRIBUTEMAP_HXX
+
+#include <MNSInclude.hxx>
+
+#include <memory>
+
+//........................................................................
+namespace connectivity { namespace mozab {
+//........................................................................
+
+ struct AttributeMap_Data;
+ class MQueryHelperResultEntry;
+
+ //====================================================================
+ //= class MLdapAttributeMap
+ //====================================================================
+ /** implements the nsIAbLDAPAttributeMap interface
+
+ Somewhere between Mozilla 1.7.5 and SeaMonkey 1.1.12, the LDAP address book
+ implementation was changed to take the attribute mapping (from LDAP attributes
+ to address book properties) not directly from the preferences. Instead, this mapping
+ is now delivered by a dedicated implementation (supporting the nsIAbLDAPAttributeMap
+ interface).
+
+ */
+ class MLdapAttributeMap : public nsIAbLDAPAttributeMap
+ {
+ public:
+ MLdapAttributeMap();
+
+ NS_DECL_ISUPPORTS
+ NS_DECL_NSIABLDAPATTRIBUTEMAP
+
+ static void fillCardFromResult( nsIAbCard& _card, const MQueryHelperResultEntry& _result );
+ static void fillResultFromCard( MQueryHelperResultEntry& _result, nsIAbCard& _card );
+
+ protected:
+ virtual ~MLdapAttributeMap();
+
+ private:
+ ::std::auto_ptr< AttributeMap_Data > m_pData;
+ };
+
+//........................................................................
+} } // namespace connectivity::mozab
+//........................................................................
+
+#endif // CONNECTIVITY_MLDAPATTRIBUTEMAP_HXX
diff --git a/connectivity/source/drivers/mozab/mozillasrc/MNSInclude.hxx b/connectivity/source/drivers/mozab/mozillasrc/MNSInclude.hxx
index 93739132c6..57eec5adb7 100644
--- a/connectivity/source/drivers/mozab/mozillasrc/MNSInclude.hxx
+++ b/connectivity/source/drivers/mozab/mozillasrc/MNSInclude.hxx
@@ -34,6 +34,9 @@
// Only include Mozilla include files once and using this file...
//
+// moved this here and in first position due to "long l;" unxsoli4 warning
+#include <rtl/ustrbuf.hxx>
+
#include "pre_include_mozilla.h"
#if defined __GNUC__
#pragma GCC system_header
@@ -44,6 +47,7 @@
#include <nsCOMPtr.h>
#include <nsISupportsArray.h>
#include <nsString.h>
+
#if defined __SUNPRO_CC
#pragma disable_warn
// somewhere in the files included directly or indirectly in nsString.h, warnings are enabled, again
@@ -70,6 +74,8 @@
#include <nsIAbDirectoryQueryProxy.h>
#include <nsIAbDirFactory.h>
#include <nsIRunnable.h>
+#include <nsIAbLDAPAttributeMap.h>
+#include <nsILDAPMessage.h>
#include <prerr.h>
diff --git a/connectivity/source/drivers/mozab/mozillasrc/MNSMozabProxy.cxx b/connectivity/source/drivers/mozab/mozillasrc/MNSMozabProxy.cxx
index b1f2eaa49f..42f0821d86 100644
--- a/connectivity/source/drivers/mozab/mozillasrc/MNSMozabProxy.cxx
+++ b/connectivity/source/drivers/mozab/mozillasrc/MNSMozabProxy.cxx
@@ -379,7 +379,8 @@ MNSMozabProxy::InitLDAP(sal_Char* sUri, sal_Unicode* sBindDN, sal_Unicode* pPass
messageListener->AddRef();
nsCAutoString nsBind;
- nsBind.AssignWithConversion(sBindDN);
+ // PRUnichar != sal_Unicode in mingw
+ nsBind.AssignWithConversion(reinterpret_cast_mingw_only<const PRUnichar *>(sBindDN));
// Now lets initialize the LDAP connection properly.
rv = ldapConnection->Init(host.get(), port, useSSL, nsBind,
@@ -395,7 +396,8 @@ MNSMozabProxy::InitLDAP(sal_Char* sUri, sal_Unicode* sBindDN, sal_Unicode* pPass
if ( pPasswd && *pPasswd )
{
nsCAutoString nsPassword;
- nsPassword.AssignWithConversion(pPasswd);
+ // PRUnichar != sal_Unicode in mingw
+ nsPassword.AssignWithConversion(reinterpret_cast_mingw_only<const PRUnichar *>(pPasswd));
rv = ldapOperation->SimpleBind(nsPassword);
}
diff --git a/connectivity/source/drivers/mozab/mozillasrc/MQuery.cxx b/connectivity/source/drivers/mozab/mozillasrc/MQuery.cxx
index 8da4e1019b..f50ad7d4a8 100644
--- a/connectivity/source/drivers/mozab/mozillasrc/MQuery.cxx
+++ b/connectivity/source/drivers/mozab/mozillasrc/MQuery.cxx
@@ -30,14 +30,14 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_connectivity.hxx"
+
#include <MQueryHelper.hxx>
#include <MNameMapper.hxx>
#include <MConnection.hxx>
#include <connectivity/dbexception.hxx>
#include "MQuery.hxx"
-#ifndef _CONNECTIVITY_MAB_CONVERSIONS_HXX_
+#include "MLdapAttributeMap.hxx"
#include "MTypeConverter.hxx"
-#endif
#include "MNSMozabProxy.hxx"
#include <com/sun/star/uno/Reference.hxx>
#include <unotools/processfactory.hxx>
@@ -54,6 +54,7 @@ static NS_DEFINE_CID(kAbDirectoryQueryArgumentsCID, NS_ABDIRECTORYQUERYARGUMENTS
static NS_DEFINE_CID(kBooleanConditionStringCID, NS_BOOLEANCONDITIONSTRING_CID);
static NS_DEFINE_CID(kBooleanExpressionCID, NS_BOOLEANEXPRESSION_CID);
static NS_DEFINE_CID(kAbDirectoryQueryProxyCID, NS_ABDIRECTORYQUERYPROXY_CID);
+static NS_DEFINE_CID(kAbLDAPAttributeMap, NS_IABLDAPATTRIBUTEMAP_IID);
using namespace connectivity::mozab;
using namespace connectivity;
@@ -139,31 +140,6 @@ void MQuery::construct()
NS_IF_ADDREF( m_aQueryHelper);
}
// -------------------------------------------------------------------------
-void MQuery::setAttributes(::std::vector< ::rtl::OUString> &attrs)
-{
- OSL_TRACE("IN MQuery::setAttributes()\n");
- ::osl::MutexGuard aGuard( m_aMutex );
-
- m_aAttributes.clear();
- m_aAttributes.reserve(attrs.size());
- ::std::vector< ::rtl::OUString>::iterator aIterAttr = attrs.begin();
- ::std::map< ::rtl::OUString, ::rtl::OUString>::iterator aIterMap;
-
- for ( aIterAttr = attrs.begin(); aIterAttr != attrs.end();++aIterAttr )
- m_aAttributes.push_back( m_rColumnAlias.getProgrammaticNameOrFallbackToAlias( *aIterAttr ) );
-
- OSL_TRACE("\tOUT MQuery::setAttributes()\n");
-}
-// -------------------------------------------------------------------------
-const ::std::vector< ::rtl::OUString> &MQuery::getAttributes() const
-{
- OSL_TRACE("IN MQuery::getAttributes()\n");
-
- OSL_TRACE("\tOUT MQuery::getAttributes()\n");
-
- return(m_aAttributes);
-}
-// -------------------------------------------------------------------------
void MQuery::setAddressbook(::rtl::OUString &ab)
{
OSL_TRACE("IN MQuery::setAddressbook()\n");
@@ -253,12 +229,9 @@ static sal_Int32 generateExpression( MQuery* _aQuery, MQueryExpression* _aExpr,
// Set the 'name' property of the boolString.
// Check if it's an alias first...
- rtl::OUString attrName;
- ::std::map< ::rtl::OUString, ::rtl::OUString>::const_iterator aIterMap;
- attrName = _aQuery->getColumnAlias().getProgrammaticNameOrFallbackToAlias( evStr->getName() );
- ::std::string aMiName = MTypeConverter::ouStringToStlString(attrName);
- boolString->SetName(strdup(aMiName.c_str()));
- OSL_TRACE("Name = %s ;", aMiName.c_str() );
+ rtl::OString attrName = _aQuery->getColumnAlias().getProgrammaticNameOrFallbackToUTF8Alias( evStr->getName() );
+ boolString->SetName( strdup( attrName.getStr() ) );
+ OSL_TRACE("Name = %s ;", attrName.getStr() );
// Set the 'matchType' property of the boolString. Check for equal length.
sal_Bool requiresValue = sal_True;
switch(evStr->getCond()) {
@@ -609,8 +582,8 @@ sal_Int32 MQuery::executeQueryProxied(OConnection* _pCon)
PRInt32 count=1;
nsCOMPtr< nsIAbDirectoryQueryArguments > arguments = do_CreateInstance( kAbDirectoryQueryArgumentsCID, &rv);
-
NS_ENSURE_SUCCESS( rv, rv );
+
rv = arguments->SetExpression(queryExpression);
NS_ENSURE_SUCCESS( rv, rv );
@@ -620,6 +593,10 @@ sal_Int32 MQuery::executeQueryProxied(OConnection* _pCon)
rv = arguments->SetQuerySubDirectories(m_bQuerySubDirs);
NS_ENSURE_SUCCESS( rv, rv );
+ nsCOMPtr< nsIAbLDAPAttributeMap > attributeMap( new MLdapAttributeMap );
+ rv = arguments->SetTypeSpecificArg( attributeMap );
+ NS_ENSURE_SUCCESS( rv, rv );
+
// Execute the query.
OSL_TRACE( "****** calling DoQuery\n");
@@ -719,7 +696,7 @@ MQuery::setRowValue( ORowSetValue& rValue, sal_Int32 nDBRow,const rtl::OUString&
switch ( nType )
{
case DataType::VARCHAR:
- xResEntry->setValue( m_rColumnAlias.getProgrammaticNameOrFallbackToAlias( aDBColumnName ), rValue.getString() );
+ xResEntry->setValue( m_rColumnAlias.getProgrammaticNameOrFallbackToUTF8Alias( aDBColumnName ), rValue.getString() );
break;
default:
OSL_ENSURE( sal_False, "invalid data type!" );
@@ -745,7 +722,7 @@ MQuery::getRowValue( ORowSetValue& rValue, sal_Int32 nDBRow,const rtl::OUString&
switch ( nType )
{
case DataType::VARCHAR:
- rValue = xResEntry->getValue( m_rColumnAlias.getProgrammaticNameOrFallbackToAlias( aDBColumnName ) );
+ rValue = xResEntry->getValue( m_rColumnAlias.getProgrammaticNameOrFallbackToUTF8Alias( aDBColumnName ) );
break;
default:
@@ -828,8 +805,7 @@ MQuery::FreeNameMapper( MNameMapper* _ptr )
delete _ptr;
}
// -------------------------------------------------------------------------
-sal_Bool MQuery::
-isWritable(OConnection* _pCon)
+sal_Bool MQuery::isWritable(OConnection* _pCon)
{
if ( !m_aQueryDirectory )
return sal_False;
diff --git a/connectivity/source/drivers/mozab/mozillasrc/MQuery.hxx b/connectivity/source/drivers/mozab/mozillasrc/MQuery.hxx
index 9ea54c7f74..685f8e3152 100644
--- a/connectivity/source/drivers/mozab/mozillasrc/MQuery.hxx
+++ b/connectivity/source/drivers/mozab/mozillasrc/MQuery.hxx
@@ -205,7 +205,6 @@ namespace connectivity
private:
MQueryDirectory *m_aQueryDirectory;
MQueryHelper *m_aQueryHelper;
- ::std::vector< ::rtl::OUString> m_aAttributes;
::rtl::OUString m_aAddressbook;
sal_Int32 m_nMaxNrOfReturns;
sal_Bool m_bQuerySubDirs;
@@ -240,9 +239,6 @@ namespace connectivity
sal_uInt32 InsertLoginInfo(OConnection* _pCon);
- void setAttributes( ::std::vector< ::rtl::OUString>&);
- const ::std::vector< ::rtl::OUString> &getAttributes(void) const;
-
void setAddressbook( ::rtl::OUString&);
::rtl::OUString getAddressbook(void) const;
diff --git a/connectivity/source/drivers/mozab/mozillasrc/MQueryHelper.cxx b/connectivity/source/drivers/mozab/mozillasrc/MQueryHelper.cxx
index a02a4cb2eb..08830ee3a1 100644
--- a/connectivity/source/drivers/mozab/mozillasrc/MQueryHelper.cxx
+++ b/connectivity/source/drivers/mozab/mozillasrc/MQueryHelper.cxx
@@ -30,62 +30,20 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_connectivity.hxx"
-#include <MQueryHelper.hxx>
+#include "MQueryHelper.hxx"
#include "MTypeConverter.hxx"
+#include "MConnection.hxx"
+#include "MNSDeclares.hxx"
+#include "MLdapAttributeMap.hxx"
+
#include <connectivity/dbexception.hxx>
-#ifndef _CONNECTIVITY_MOZAB_BCONNECTION_HXX_
-#include <MConnection.hxx>
-#endif
#include "resource/mozab_res.hrc"
-#include "MNSDeclares.hxx"
using namespace connectivity::mozab;
-enum
-{
- index_FirstName=0,
- index_LastName,
- index_DisplayName,
- index_NickName,
- index_PrimaryEmail,
- index_SecondEmail,
- index_PreferMailFormat,
- index_WorkPhone,
- index_HomePhone,
- index_FaxNumber,
- index_PagerNumber,
- index_CellularNumber,
- index_HomeAddress,
- index_HomeAddress2,
- index_HomeCity,
- index_HomeState,
- index_HomeZipCode,
- index_HomeCountry,
- index_WorkAddress,
- index_WorkAddress2,
- index_WorkCity,
- index_WorkState,
- index_WorkZipCode,
- index_WorkCountry,
- index_JobTitle,
- index_Department,
- index_Company,
- index_WebPage1,
- index_WebPage2,
- index_BirthYear,
- index_BirthMonth,
- index_BirthDay,
- index_Custom1,
- index_Custom2,
- index_Custom3,
- index_Custom4,
- index_Notes
-};
-
-
NS_IMPL_THREADSAFE_ISUPPORTS1(connectivity::mozab::MQueryHelper,nsIAbDirectoryQueryResultListener)
//
@@ -101,8 +59,6 @@ MQueryHelperResultEntry::MQueryHelperResultEntry()
MQueryHelperResultEntry::~MQueryHelperResultEntry()
{
-
-
OSL_TRACE("IN MQueryHelperResultEntry::~MQueryHelperResultEntry()\n");
OSL_TRACE("OUT MQueryHelperResultEntry::~MQueryHelperResultEntry()\n");
@@ -117,39 +73,31 @@ MQueryHelperResultEntry::getCard()
{
return m_Card;
}
-void
-MQueryHelperResultEntry::insert( const rtl::OUString &key, rtl::OUString &value )
+void MQueryHelperResultEntry::insert( const rtl::OString &key, rtl::OUString &value )
{
- m_Fields.insert( fieldMap::value_type( key, value ) );
+ m_Fields[ key ] = value;
}
-rtl::OUString
-MQueryHelperResultEntry::getValue( const rtl::OUString &key ) const
+rtl::OUString MQueryHelperResultEntry::getValue( const rtl::OString &key ) const
{
- fieldMap::const_iterator iter;
-
- iter = m_Fields.find( key );
-
- if ( iter == m_Fields.end() ) {
+ FieldMap::const_iterator iter = m_Fields.find( key );
+ if ( iter == m_Fields.end() )
+ {
return rtl::OUString();
- } else {
- return (*iter).second;
+ }
+ else
+ {
+ return iter->second;
}
}
-rtl::OUString
-MQueryHelperResultEntry::setValue( const rtl::OUString &key, const rtl::OUString & rValue)
+void MQueryHelperResultEntry::setValue( const rtl::OString &key, const rtl::OUString & rValue)
{
- m_Fields.erase(key);
- m_Fields.insert( fieldMap::value_type( key, rValue ) );
- return rValue;
+ m_Fields[ key ] = rValue;
}
//
// class MQueryHelper
//
-// MIME-types.
-static char PreferMailFormatTypes[2][11] = {"text/plain",
- "text/html"};
MQueryHelper::MQueryHelper()
:m_nIndex( 0 )
,m_bHasMore( sal_True )
@@ -473,7 +421,7 @@ NS_IMETHODIMP MQueryHelper::OnQueryItem(nsIAbDirectoryQueryResult *result)
nsCOMPtr<nsIAbCard> card(do_QueryInterface(cardSupports, &rv));
NS_ENSURE_SUCCESS(rv, rv);
- getCardValues(card);
+ getCardValues(card);
}
nsMemory::Free(name);
@@ -484,56 +432,13 @@ NS_IMETHODIMP MQueryHelper::OnQueryItem(nsIAbDirectoryQueryResult *result)
return(NS_OK);
}
+// -----------------------------------------------------------------------------
void MQueryHelper::notifyQueryError()
{
m_bQueryComplete = sal_True ;
notifyResultOrComplete() ;
}
-static const ::rtl::OUString& getAttribute(PRUint32 index)
-{
- static const ::rtl::OUString sAttributeNames[] =
- {
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FirstName")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("LastName")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("DisplayName")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("NickName")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("PrimaryEmail")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("SecondEmail")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("PreferMailFormat")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("WorkPhone")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HomePhone")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FaxNumber")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("PagerNumber")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("CellularNumber")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HomeAddress")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HomeAddress2")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HomeCity")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HomeState")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HomeZipCode")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HomeCountry")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("WorkAddress")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("WorkAddress2")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("WorkCity")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("WorkState")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("WorkZipCode")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("WorkCountry")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("JobTitle")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Department")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Company")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("WebPage1")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("WebPage2")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("BirthYear")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("BirthMonth")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("BirthDay")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Custom1")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Custom2")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Custom3")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Custom4")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Notes"))
- };
- return sAttributeNames[index];
-}
const char * getAddrURI(const nsIAbDirectory* directory)
{
nsresult retCode;
@@ -687,127 +592,7 @@ sal_Bool MQueryHelper::setCardValues(const sal_Int32 rowIndex)
return sal_False;
}
- ::rtl::OUString sValue;
-
- getCardAttributeAndValue(getAttribute(index_FirstName),sValue,resEntry);
- card->SetFirstName(sValue.getStr());
-
- getCardAttributeAndValue(getAttribute(index_LastName),sValue,resEntry);
- card->SetLastName(sValue.getStr());
-
- getCardAttributeAndValue(getAttribute(index_DisplayName),sValue,resEntry);
- card->SetDisplayName(sValue.getStr());
-
- getCardAttributeAndValue(getAttribute(index_NickName),sValue,resEntry);
- card->SetNickName(sValue.getStr());
-
- getCardAttributeAndValue(getAttribute(index_PrimaryEmail),sValue,resEntry);
- card->SetPrimaryEmail(sValue.getStr());
-
- getCardAttributeAndValue(getAttribute(index_SecondEmail),sValue,resEntry);
- card->SetSecondEmail(sValue.getStr());
-
- unsigned int format;
- ::rtl::OUString prefMailValue;
- getCardAttributeAndValue(getAttribute(index_WorkPhone),prefMailValue,resEntry);
- for(format=2;format >0;format--)
- {
- if (! prefMailValue.compareTo(
- ::rtl::OUString::createFromAscii(PreferMailFormatTypes[format-1]) ) )
- break;
- }
- card->SetPreferMailFormat(format);
-
- getCardAttributeAndValue(getAttribute(index_WorkPhone),sValue,resEntry);
- card->SetWorkPhone(sValue.getStr());
-
- getCardAttributeAndValue(getAttribute(index_HomePhone),sValue,resEntry);
- card->SetHomePhone(sValue.getStr());
-
- getCardAttributeAndValue(getAttribute(index_FaxNumber),sValue,resEntry);
- card->SetFaxNumber(sValue.getStr());
-
- getCardAttributeAndValue(getAttribute(index_PagerNumber),sValue,resEntry);
- card->SetPagerNumber(sValue.getStr());
-
- getCardAttributeAndValue(getAttribute(index_CellularNumber),sValue,resEntry);
- card->SetCellularNumber(sValue.getStr());
-
- getCardAttributeAndValue(getAttribute(index_HomeAddress),sValue,resEntry);
- card->SetHomeAddress(sValue.getStr());
-
- getCardAttributeAndValue(getAttribute(index_HomeAddress2),sValue,resEntry);
- card->SetHomeAddress2(sValue.getStr());
-
- getCardAttributeAndValue(getAttribute(index_HomeCity),sValue,resEntry);
- card->SetHomeCity(sValue.getStr());
-
- getCardAttributeAndValue(getAttribute(index_HomeState),sValue,resEntry);
- card->SetHomeState(sValue.getStr());
-
- getCardAttributeAndValue(getAttribute(index_HomeZipCode),sValue,resEntry);
- card->SetHomeZipCode(sValue.getStr());
-
- getCardAttributeAndValue(getAttribute(index_HomeCountry),sValue,resEntry);
- card->SetHomeCountry(sValue.getStr());
-
- getCardAttributeAndValue(getAttribute(index_WorkAddress),sValue,resEntry);
- card->SetWorkAddress(sValue.getStr());
-
- getCardAttributeAndValue(getAttribute(index_WorkAddress2),sValue,resEntry);
- card->SetWorkAddress2(sValue.getStr());
-
- getCardAttributeAndValue(getAttribute(index_WorkCity),sValue,resEntry);
- card->SetWorkCity(sValue.getStr());
-
- getCardAttributeAndValue(getAttribute(index_WorkState),sValue,resEntry);
- card->SetWorkState(sValue.getStr());
-
- getCardAttributeAndValue(getAttribute(index_WorkZipCode),sValue,resEntry);
- card->SetWorkZipCode(sValue.getStr());
-
- getCardAttributeAndValue(getAttribute(index_WorkCountry),sValue,resEntry);
- card->SetWorkCountry(sValue.getStr());
-
- getCardAttributeAndValue(getAttribute(index_JobTitle),sValue,resEntry);
- card->SetJobTitle(sValue.getStr());
-
- getCardAttributeAndValue(getAttribute(index_Department),sValue,resEntry);
- card->SetDepartment(sValue.getStr());
-
- getCardAttributeAndValue(getAttribute(index_Company),sValue,resEntry);
- card->SetCompany(sValue.getStr());
-
- getCardAttributeAndValue(getAttribute(index_WebPage1),sValue,resEntry);
- card->SetWebPage1(sValue.getStr());
-
- getCardAttributeAndValue(getAttribute(index_WebPage2),sValue,resEntry);
- card->SetWebPage2(sValue.getStr());
-
- getCardAttributeAndValue(getAttribute(index_BirthYear),sValue,resEntry);
- card->SetBirthYear(sValue.getStr());
-
- getCardAttributeAndValue(getAttribute(index_BirthMonth),sValue,resEntry);
- card->SetBirthMonth(sValue.getStr());
-
- getCardAttributeAndValue(getAttribute(index_BirthDay),sValue,resEntry);
- card->SetBirthDay(sValue.getStr());
-
- getCardAttributeAndValue(getAttribute(index_Custom1),sValue,resEntry);
- card->SetCustom1(sValue.getStr());
-
- getCardAttributeAndValue(getAttribute(index_Custom2),sValue,resEntry);
- card->SetCustom2(sValue.getStr());
-
- getCardAttributeAndValue(getAttribute(index_Custom3),sValue,resEntry);
- card->SetCustom3(sValue.getStr());
-
- getCardAttributeAndValue(getAttribute(index_Custom4),sValue,resEntry);
- card->SetCustom4(sValue.getStr());
-
- getCardAttributeAndValue(getAttribute(index_Notes),sValue,resEntry);
- card->SetNotes(sValue.getStr());
-
+ MLdapAttributeMap::fillCardFromResult( *card, *resEntry );
return sal_True;
}
@@ -821,142 +606,7 @@ void MQueryHelper::getCardValues(nsIAbCard *card,sal_Int32 rowIndex)
else
resEntry = new MQueryHelperResultEntry();
- nsXPIDLString sValue;
-
- card->GetFirstName(getter_Copies(sValue));
- addCardAttributeAndValue(getAttribute(index_FirstName),sValue,resEntry);
-
- card->GetLastName(getter_Copies(sValue));
- addCardAttributeAndValue(getAttribute(index_LastName),sValue,resEntry);
-
- card->GetDisplayName(getter_Copies(sValue));
- addCardAttributeAndValue(getAttribute(index_DisplayName),sValue,resEntry);
-
- card->GetNickName(getter_Copies(sValue));
- addCardAttributeAndValue(getAttribute(index_NickName),sValue,resEntry);
-
- card->GetPrimaryEmail(getter_Copies(sValue));
- addCardAttributeAndValue(getAttribute(index_PrimaryEmail),sValue,resEntry);
-
- card->GetSecondEmail(getter_Copies(sValue));
- addCardAttributeAndValue(getAttribute(index_SecondEmail),sValue,resEntry);
-
- unsigned int format = 0;
- card->GetPreferMailFormat(&format);
- ::rtl::OUString prefMailValue;
- switch(format)
- {
- case nsIAbPreferMailFormat::html:
- prefMailValue = ::rtl::OUString::createFromAscii(PreferMailFormatTypes[1]);
- break;
- case nsIAbPreferMailFormat::plaintext:
- prefMailValue = ::rtl::OUString::createFromAscii(PreferMailFormatTypes[0]);
- break;
- case nsIAbPreferMailFormat::unknown:
- default:
- prefMailValue = ::rtl::OUString::createFromAscii(PreferMailFormatTypes[0]);
- break;
-
- }
- resEntry->insert( getAttribute(index_PreferMailFormat), prefMailValue );
-
- card->GetWorkPhone(getter_Copies(sValue));
- addCardAttributeAndValue(getAttribute(index_WorkPhone),sValue,resEntry);
-
- card->GetHomePhone(getter_Copies(sValue));
- addCardAttributeAndValue(getAttribute(index_HomePhone),sValue,resEntry);
-
- card->GetFaxNumber(getter_Copies(sValue));
- addCardAttributeAndValue(getAttribute(index_FaxNumber),sValue,resEntry);
-
- card->GetPagerNumber(getter_Copies(sValue));
- addCardAttributeAndValue(getAttribute(index_PagerNumber),sValue,resEntry);
-
- card->GetCellularNumber(getter_Copies(sValue));
- addCardAttributeAndValue(getAttribute(index_CellularNumber),sValue,resEntry);
-
- card->GetHomeAddress(getter_Copies(sValue));
- PRInt32 offset;
- nsXPIDLString space;
- space.Assign(NS_LITERAL_STRING(" "));
- while ((offset = sValue.FindChar('\r')) >= 0) sValue.Replace(offset, 1, space);
- while ((offset = sValue.FindChar('\n')) >= 0) sValue.Replace(offset, 1, space);
- addCardAttributeAndValue(getAttribute(index_HomeAddress),sValue,resEntry);
-
- card->GetHomeAddress2(getter_Copies(sValue));
- addCardAttributeAndValue(getAttribute(index_HomeAddress2),sValue,resEntry);
-
- card->GetHomeCity(getter_Copies(sValue));
- addCardAttributeAndValue(getAttribute(index_HomeCity),sValue,resEntry);
-
- card->GetHomeState(getter_Copies(sValue));
- addCardAttributeAndValue(getAttribute(index_HomeState),sValue,resEntry);
-
- card->GetHomeZipCode(getter_Copies(sValue));
- addCardAttributeAndValue(getAttribute(index_HomeZipCode),sValue,resEntry);
-
- card->GetHomeCountry(getter_Copies(sValue));
- addCardAttributeAndValue(getAttribute(index_HomeCountry),sValue,resEntry);
-
- card->GetWorkAddress(getter_Copies(sValue));
- while ((offset = sValue.FindChar('\r')) >= 0) sValue.Replace(offset, 1, space);
- while ((offset = sValue.FindChar('\n')) >= 0) sValue.Replace(offset, 1, space);
- addCardAttributeAndValue(getAttribute(index_WorkAddress),sValue,resEntry);
-
- card->GetWorkAddress2(getter_Copies(sValue));
- addCardAttributeAndValue(getAttribute(index_WorkAddress2),sValue,resEntry);
-
- card->GetWorkCity(getter_Copies(sValue));
- addCardAttributeAndValue(getAttribute(index_WorkCity),sValue,resEntry);
-
- card->GetWorkState(getter_Copies(sValue));
- addCardAttributeAndValue(getAttribute(index_WorkState),sValue,resEntry);
-
- card->GetWorkZipCode(getter_Copies(sValue));
- addCardAttributeAndValue(getAttribute(index_WorkZipCode),sValue,resEntry);
-
- card->GetWorkCountry(getter_Copies(sValue));
- addCardAttributeAndValue(getAttribute(index_WorkCountry),sValue,resEntry);
-
- card->GetJobTitle(getter_Copies(sValue));
- addCardAttributeAndValue(getAttribute(index_JobTitle),sValue,resEntry);
-
- card->GetDepartment(getter_Copies(sValue));
- addCardAttributeAndValue(getAttribute(index_Department),sValue,resEntry);
-
- card->GetCompany(getter_Copies(sValue));
- addCardAttributeAndValue(getAttribute(index_Company),sValue,resEntry);
-
- card->GetWebPage1(getter_Copies(sValue));
- addCardAttributeAndValue(getAttribute(index_WebPage1),sValue,resEntry);
-
- card->GetWebPage2(getter_Copies(sValue));
- addCardAttributeAndValue(getAttribute(index_WebPage2),sValue,resEntry);
-
- card->GetBirthYear(getter_Copies(sValue));
- addCardAttributeAndValue(getAttribute(index_BirthYear),sValue,resEntry);
-
- card->GetBirthMonth(getter_Copies(sValue));
- addCardAttributeAndValue(getAttribute(index_BirthMonth),sValue,resEntry);
-
- card->GetBirthDay(getter_Copies(sValue));
- addCardAttributeAndValue(getAttribute(index_BirthDay),sValue,resEntry);
-
- card->GetCustom1(getter_Copies(sValue));
- addCardAttributeAndValue(getAttribute(index_Custom1),sValue,resEntry);
-
- card->GetCustom2(getter_Copies(sValue));
- addCardAttributeAndValue(getAttribute(index_Custom2),sValue,resEntry);
-
- card->GetCustom3(getter_Copies(sValue));
- addCardAttributeAndValue(getAttribute(index_Custom3),sValue,resEntry);
-
- card->GetCustom4(getter_Copies(sValue));
- addCardAttributeAndValue(getAttribute(index_Custom4),sValue,resEntry);
-
- card->GetNotes(getter_Copies(sValue));
- addCardAttributeAndValue(getAttribute(index_Notes),sValue,resEntry);
-
+ MLdapAttributeMap::fillResultFromCard( *resEntry, *card );
resEntry->setCard(card);
if (!rowIndex)
append( resEntry );
@@ -975,21 +625,8 @@ sal_Bool MQueryHelper::resyncRow(sal_Int32 rowIndex)
getCardValues(card,rowIndex);
return sal_True;
}
-void MQueryHelper::addCardAttributeAndValue(const ::rtl::OUString& sName, nsXPIDLString Value, MQueryHelperResultEntry *resEntry)
-{
- nsAutoString temp(Value) ;
- ::rtl::OUString attrValue;
- MTypeConverter::nsStringToOUString( temp, attrValue );
- resEntry->insert( sName, attrValue );
-}
-
-void MQueryHelper::getCardAttributeAndValue(const ::rtl::OUString& sName, ::rtl::OUString &ouValue, MQueryHelperResultEntry *resEntry)
-{
- ouValue = resEntry->getValue( sName);
-}
-
// -------------------------------------------------------------------------
-sal_Int32 MQueryHelper::createNewCard()
+sal_Int32 MQueryHelper::createNewCard()
{
::osl::MutexGuard aGuard( m_aMutex );
nsresult rv;
diff --git a/connectivity/source/drivers/mozab/mozillasrc/MQueryHelper.hxx b/connectivity/source/drivers/mozab/mozillasrc/MQueryHelper.hxx
index ec2dc2e227..a33fe7f5ca 100644
--- a/connectivity/source/drivers/mozab/mozillasrc/MQueryHelper.hxx
+++ b/connectivity/source/drivers/mozab/mozillasrc/MQueryHelper.hxx
@@ -40,6 +40,8 @@
#include <comphelper/stl_types.hxx>
#include <osl/thread.hxx>
+#include <hash_map>
+
namespace connectivity
{
namespace mozab
@@ -47,20 +49,20 @@ namespace connectivity
class MQueryHelperResultEntry
{
private:
- mutable ::osl::Mutex m_aMutex;
+ typedef ::std::hash_map< ::rtl::OString, ::rtl::OUString, ::rtl::OStringHash > FieldMap;
- DECLARE_STL_USTRINGACCESS_MAP(::rtl::OUString,fieldMap);
+ mutable ::osl::Mutex m_aMutex;
+ FieldMap m_Fields;
+ nsCOMPtr<nsIAbCard> m_Card;
+ sal_Int32 m_RowStates;
- fieldMap m_Fields;
- nsCOMPtr<nsIAbCard> m_Card;
- sal_Int32 m_RowStates;
public:
MQueryHelperResultEntry();
~MQueryHelperResultEntry();
- void insert( const rtl::OUString &key, rtl::OUString &value );
- rtl::OUString getValue( const rtl::OUString &key ) const;
- rtl::OUString setValue( const rtl::OUString &key, const rtl::OUString & rValue);
+ void insert( const rtl::OString &key, rtl::OUString &value );
+ rtl::OUString getValue( const rtl::OString &key ) const;
+ void setValue( const rtl::OString &key, const rtl::OUString & rValue);
void setCard(nsIAbCard *card);
nsIAbCard *getCard();
@@ -90,8 +92,6 @@ namespace connectivity
void clearResultOrComplete();
void notifyResultOrComplete();
sal_Bool waitForResultOrComplete( );
- void addCardAttributeAndValue(const ::rtl::OUString& sName, nsXPIDLString sValue,MQueryHelperResultEntry *resEntry);
- void getCardAttributeAndValue(const ::rtl::OUString& sName, ::rtl::OUString &ouValue, MQueryHelperResultEntry *resEntry) ;
void getCardValues(nsIAbCard *card,sal_Int32 rowIndex=0);
#if OSL_DEBUG_LEVEL > 0
oslThreadIdentifier m_oThreadID;
diff --git a/connectivity/source/drivers/mozab/mozillasrc/MTypeConverter.cxx b/connectivity/source/drivers/mozab/mozillasrc/MTypeConverter.cxx
index 647cd6adeb..657b294722 100644
--- a/connectivity/source/drivers/mozab/mozillasrc/MTypeConverter.cxx
+++ b/connectivity/source/drivers/mozab/mozillasrc/MTypeConverter.cxx
@@ -51,6 +51,32 @@ void MTypeConverter::ouStringToNsString(::rtl::OUString const &ous, nsString &ns
nss = mozString; // temp.
}
// -------------------------------------------------------------------------
+::rtl::OUString MTypeConverter::nsACStringToOUString( const nsACString& _source )
+{
+ const char* buffer = _source.BeginReading();
+ const char* bufferEnd = _source.EndReading();
+ return ::rtl::OUString( buffer, bufferEnd - buffer, RTL_TEXTENCODING_ASCII_US );
+}
+// -------------------------------------------------------------------------
+::rtl::OString MTypeConverter::nsACStringToOString( const nsACString& _source )
+{
+ const char* buffer = _source.BeginReading();
+ const char* bufferEnd = _source.EndReading();
+ return ::rtl::OString( buffer, bufferEnd - buffer );
+}
+// -------------------------------------------------------------------------
+void MTypeConverter::asciiOUStringToNsACString( const ::rtl::OUString& _asciiString, nsACString& _dest )
+{
+ ::rtl::OString sAsciiVersion( _asciiString.getStr(), _asciiString.getLength(), RTL_TEXTENCODING_ASCII_US );
+ asciiToNsACString( sAsciiVersion.getStr(), _dest );
+}
+// -------------------------------------------------------------------------
+void MTypeConverter::asciiToNsACString( const sal_Char* _asciiString, nsACString& _dest )
+{
+ _dest.Truncate();
+ _dest.AppendASCII( _asciiString );
+}
+// -------------------------------------------------------------------------
void MTypeConverter::nsStringToOUString(nsString const &nss, ::rtl::OUString &ous)
{
// Get clone of buffer.
@@ -58,7 +84,8 @@ void MTypeConverter::nsStringToOUString(nsString const &nss, ::rtl::OUString &ou
sal_Int32 nssLen = nss.Length();
// TODO check if this is ok.
- ::rtl::OUString _ous(uc, nssLen);
+ // PRUnichar != sal_Unicode in mingw
+ ::rtl::OUString _ous(reinterpret_cast_mingw_only<sal_Unicode *>(uc), nssLen);
ous = _ous;
nsMemory::Free(uc);
@@ -67,7 +94,8 @@ void MTypeConverter::nsStringToOUString(nsString const &nss, ::rtl::OUString &ou
void MTypeConverter::prUnicharToOUString(PRUnichar const *pru, ::rtl::OUString &ous)
{
// TODO, specify length.
- ::rtl::OUString _ous(pru);
+ // PRUnichar != sal_Unicode in mingw
+ ::rtl::OUString _ous(reinterpret_cast_mingw_only<const sal_Unicode *>(pru));
ous = _ous;
}
// -------------------------------------------------------------------------
diff --git a/connectivity/source/drivers/mozab/mozillasrc/MTypeConverter.hxx b/connectivity/source/drivers/mozab/mozillasrc/MTypeConverter.hxx
index 30dd006043..9b2264ff57 100644
--- a/connectivity/source/drivers/mozab/mozillasrc/MTypeConverter.hxx
+++ b/connectivity/source/drivers/mozab/mozillasrc/MTypeConverter.hxx
@@ -54,6 +54,11 @@ namespace connectivity
static ::std::string ouStringToStlString(const ::rtl::OUString&);
static ::std::string nsStringToStlString(const nsString&);
+ static ::rtl::OUString nsACStringToOUString( const nsACString& _source );
+ static ::rtl::OString nsACStringToOString( const nsACString& _source );
+ static void asciiOUStringToNsACString( const ::rtl::OUString& _asciiString, nsACString& _dest );
+ static void asciiToNsACString( const sal_Char* _asciiString, nsACString& _dest );
+
private:
MTypeConverter() {};
};
diff --git a/connectivity/source/drivers/mozab/mozillasrc/makefile.mk b/connectivity/source/drivers/mozab/mozillasrc/makefile.mk
index 7640816197..e350365d34 100644
--- a/connectivity/source/drivers/mozab/mozillasrc/makefile.mk
+++ b/connectivity/source/drivers/mozab/mozillasrc/makefile.mk
@@ -71,10 +71,13 @@ SLOFILES = \
$(SLO)$/MQuery.obj \
$(SLO)$/MTypeConverter.obj \
$(SLO)$/MNameMapper.obj \
- $(SLO)$/MNSMozabProxy.obj \
- $(SLO)$/MNSTerminateListener.obj
+ $(SLO)$/MNSMozabProxy.obj \
+ $(SLO)$/MNSTerminateListener.obj \
+ $(SLO)$/MLdapAttributeMap.obj \
+CDEFS += -DMOZILLA_INTERNAL_API
+
.IF "$(GUI)"=="UNX"
.IF "$(COMNAME)"=="sunpro5"
CFLAGS += -features=tmplife
@@ -154,7 +157,7 @@ CFLAGS += -fPIC
CFLAGSCXX += \
-fno-rtti -Wconversion -Wpointer-arith \
-Wcast-align -Woverloaded-virtual -Wsynth \
- -Wno-long-long
+ -Wno-long-long -Wno-deprecated
CDEFS += -DTRACING
.ENDIF
.ENDIF
diff --git a/connectivity/source/drivers/mozab/post_include_mozilla.h b/connectivity/source/drivers/mozab/post_include_mozilla.h
index a7aeae2ad0..544e927b6f 100644
--- a/connectivity/source/drivers/mozab/post_include_mozilla.h
+++ b/connectivity/source/drivers/mozab/post_include_mozilla.h
@@ -47,3 +47,15 @@
#define _DEBUG _DEBUG_WAS_DEFINED
#endif
+#ifndef _CONNECTIVITY_MOZILLA_REINTERPRET_CAST_MINGW_ONLY_
+#define _CONNECTIVITY_MOZILLA_REINTERPRET_CAST_MINGW_ONLY_
+
+#ifdef __cplusplus
+#ifdef __MINGW32__
+template<class T1, class T2> T1 inline reinterpret_cast_mingw_only(T2 p) { return reinterpret_cast<T1>(p); }
+#else
+template<class T1, class T2> T1 inline reinterpret_cast_mingw_only(T2 p) { return p; }
+#endif
+#endif
+
+#endif
diff --git a/connectivity/source/drivers/mozab/pre_include_mozilla.h b/connectivity/source/drivers/mozab/pre_include_mozilla.h
index 982900ef13..29da16b718 100644
--- a/connectivity/source/drivers/mozab/pre_include_mozilla.h
+++ b/connectivity/source/drivers/mozab/pre_include_mozilla.h
@@ -38,18 +38,28 @@
// Turn off DEBUG Assertions
#ifdef _DEBUG
#define _DEBUG_WAS_DEFINED _DEBUG
- #undef _DEBUG
+ #ifndef MOZILLA_ENABLE_DEBUG
+ #undef _DEBUG
+ #endif
#else
#undef _DEBUG_WAS_DEFINED
+ #ifdef MOZILLA_ENABLE_DEBUG
+ #define _DEBUG 1
+ #endif
#endif
// and turn off the additional virtual methods which are part of some interfaces when compiled
// with debug
#ifdef DEBUG
#define DEBUG_WAS_DEFINED DEBUG
- #undef DEBUG
+ #ifndef MOZILLA_ENABLE_DEBUG
+ #undef DEBUG
+ #endif
#else
#undef DEBUG_WAS_DEFINED
+ #ifdef MOZILLA_ENABLE_DEBUG
+ #define DEBUG 1
+ #endif
#endif
#if defined __GNUC__
diff --git a/connectivity/source/drivers/mysql/makefile.mk b/connectivity/source/drivers/mysql/makefile.mk
index 9a24864a9b..0d46f0c35d 100644
--- a/connectivity/source/drivers/mysql/makefile.mk
+++ b/connectivity/source/drivers/mysql/makefile.mk
@@ -42,7 +42,7 @@ VISIBILITY_HIDDEN=TRUE
ENVCFLAGS+=/FR$(SLO)$/
.ENDIF
-.INCLUDE : settings.mk
+.INCLUDE : $(PRJ)$/makefile.pmk
.INCLUDE : $(PRJ)$/version.mk
@@ -83,6 +83,6 @@ DEF1EXPORTFILE= exports.dxp
# --- Targets ----------------------------------
-.INCLUDE : target.mk
+.INCLUDE : $(PRJ)$/target.pmk
diff --git a/connectivity/source/drivers/mysql/mysql.xcu b/connectivity/source/drivers/mysql/mysql.xcu
new file mode 100644
index 0000000000..27c84c92d9
--- /dev/null
+++ b/connectivity/source/drivers/mysql/mysql.xcu
@@ -0,0 +1,177 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--***********************************************************************
+ *
+ * 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: DataAccess.xcu,v $
+ * $Revision: 1.27 $
+ *
+ * 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.
+ *
+ ************************************************************************ -->
+<oor:component-data oor:name="Drivers" oor:package="org.openoffice.Office.DataAccess" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+ <node oor:name="Installed">
+ <node oor:name="sdbc:mysql:jdbc:*" oor:op="replace">
+ <prop oor:name="Driver">
+ <value>org.openoffice.comp.drivers.MySQL.Driver</value>
+ </prop>
+ <prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
+ <value xml:lang="en-US">MySQL (JDBC)</value>
+ </prop>
+ <node oor:name="Properties">
+ <node oor:name="CharSet" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:string">
+ <value></value>
+ </prop>
+ </node>
+ <node oor:name="JavaDriverClass" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:string">
+ <value>com.mysql.jdbc.Driver</value>
+ </prop>
+ </node>
+ </node>
+ <node oor:name="Features">
+ <node oor:name="UseKeywordAsBeforeAlias" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="IgnoreDriverPrivileges" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="DisplayVersionColumns" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="UseDOSLineEnds" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="BooleanComparisonMode" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="FormsCheckRequiredFields" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="EscapeDateTime" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ </node>
+ <node oor:name="MetaData">
+ <node oor:name="SupportsTableCreation" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="UseJava" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="Authentication" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:string">
+ <value>UserPassword</value>
+ </prop>
+ </node>
+ </node>
+ </node>
+ <node oor:name="sdbc:mysql:odbc:*" oor:op="replace">
+ <prop oor:name="Driver">
+ <value>org.openoffice.comp.drivers.MySQL.Driver</value>
+ </prop>
+ <prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
+ <value xml:lang="en-US">MySQL (ODBC)</value>
+ </prop>
+ <node oor:name="Properties">
+ <node oor:name="CharSet" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:string">
+ <value></value>
+ </prop>
+ </node>
+ </node>
+ <node oor:name="Features">
+ <node oor:name="UseKeywordAsBeforeAlias" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="IgnoreDriverPrivileges" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="DisplayVersionColumns" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="UseDOSLineEnds" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="BooleanComparisonMode" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="FormsCheckRequiredFields" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="EscapeDateTime" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ </node>
+ <node oor:name="MetaData">
+ <node oor:name="SupportsTableCreation" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="SupportsBrowsing" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="Authentication" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:string">
+ <value>UserPassword</value>
+ </prop>
+ </node>
+ </node>
+ </node>
+ </node>
+</oor:component-data>
diff --git a/connectivity/source/drivers/odbc/makefile.mk b/connectivity/source/drivers/odbc/makefile.mk
index f84f2a725d..8f37b6185d 100644
--- a/connectivity/source/drivers/odbc/makefile.mk
+++ b/connectivity/source/drivers/odbc/makefile.mk
@@ -45,7 +45,7 @@ LDUMP=ldump2.exe
ENVCFLAGS+=/FR$(SLO)$/
.ENDIF
-.INCLUDE : settings.mk
+.INCLUDE : $(PRJ)$/makefile.pmk
.INCLUDE : $(PRJ)$/version.mk
.IF "$(SYSTEM_ODBC_HEADERS)" == "YES"
@@ -79,4 +79,4 @@ SHL1VERSIONMAP=odbc.map
# --- Targets ----------------------------------
-.INCLUDE : target.mk
+.INCLUDE : $(PRJ)$/target.pmk
diff --git a/connectivity/source/drivers/odbc/odbc.xcu b/connectivity/source/drivers/odbc/odbc.xcu
new file mode 100644
index 0000000000..f906d08bdd
--- /dev/null
+++ b/connectivity/source/drivers/odbc/odbc.xcu
@@ -0,0 +1,173 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--***********************************************************************
+ *
+ * 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: DataAccess.xcu,v $
+ * $Revision: 1.27 $
+ *
+ * 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.
+ *
+ ************************************************************************ -->
+<oor:component-data oor:name="Drivers" oor:package="org.openoffice.Office.DataAccess" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+ <node oor:name="Installed">
+ <node oor:name="sdbc:odbc:*" oor:op="replace">
+ <prop oor:name="Driver">
+ <value>com.sun.star.comp.sdbc.ODBCDriver</value>
+ </prop>
+ <prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
+ <value xml:lang="en-US">ODBC</value>
+ </prop>
+ <node oor:name="Properties">
+ <node oor:name="CharSet" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:string">
+ <value></value>
+ </prop>
+ </node>
+ <node oor:name="SystemDriverSettings" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:string">
+ <value></value>
+ </prop>
+ </node>
+ <node oor:name="UseCatalog" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ </node>
+ <node oor:name="AutoIncrementCreation" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:string">
+ <value></value>
+ </prop>
+ </node>
+ <node oor:name="AutoRetrievingStatement" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:string">
+ <value></value>
+ </prop>
+ </node>
+ <node oor:name="IsAutoRetrievingEnabled" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ </node>
+ <node oor:name="AddIndexAppendix" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ </node>
+ <node oor:name="Features">
+ <node oor:name="GeneratedValues" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="UseSQL92NamingConstraints" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="AppendTableAliasInSelect" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="UseKeywordAsBeforeAlias" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="UseBracketedOuterJoinSyntax" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="IgnoreDriverPrivileges" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="ParameterNameSubstitution" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="DisplayVersionColumns" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="UseCatalogInSelect" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="UseSchemaInSelect" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="UseIndexDirectionKeyword" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="UseDOSLineEnds" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="BooleanComparisonMode" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="FormsCheckRequiredFields" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="EscapeDateTime" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ </node>
+ <node oor:name="MetaData">
+ <node oor:name="SupportsTableCreation" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="SupportsBrowsing" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+ <node oor:name="Authentication" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:string">
+ <value>UserPassword</value>
+ </prop>
+ </node>
+ </node>
+ </node>
+ </node>
+</oor:component-data>
diff --git a/connectivity/source/drivers/odbcbase/OTools.cxx b/connectivity/source/drivers/odbcbase/OTools.cxx
index 74c5e670c7..caecaa7bca 100644
--- a/connectivity/source/drivers/odbcbase/OTools.cxx
+++ b/connectivity/source/drivers/odbcbase/OTools.cxx
@@ -37,6 +37,8 @@
#include "odbc/OConnection.hxx"
#include "diagnose_ex.h"
#include <rtl/logfile.hxx>
+#include <rtl/ustrbuf.hxx>
+
#include <string.h>
#include <string>
@@ -544,7 +546,7 @@ Sequence<sal_Int8> OTools::getBytesValue(OConnection* _pConnection,
rtl_TextEncoding _nTextEncoding) throw(SQLException, RuntimeException)
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OTools::getStringValue" );
- ::rtl::OUString aData;
+ ::rtl::OUStringBuffer aData;
switch(_fSqlType)
{
case SQL_WVARCHAR:
@@ -599,7 +601,7 @@ Sequence<sal_Int8> OTools::getBytesValue(OConnection* _pConnection,
nLen = pcbValue != SQL_NO_TOTAL ? std::min(pcbValue, nMaxLen) : (nMaxLen-1);
waCharArray[nLen] = 0;
- aData += ::rtl::OUString(waCharArray);
+ aData.append(::rtl::OUString(waCharArray));
}
}
break;
@@ -648,7 +650,7 @@ Sequence<sal_Int8> OTools::getBytesValue(OConnection* _pConnection,
--nLen;
aCharArray[nLen] = 0;
- aData += ::rtl::OUString((const sal_Char*)aCharArray,nLen,_nTextEncoding);
+ aData.append(::rtl::OUString((const sal_Char*)aCharArray,nLen,_nTextEncoding));
}
// delete all blanks
@@ -656,7 +658,7 @@ Sequence<sal_Int8> OTools::getBytesValue(OConnection* _pConnection,
}
}
- return aData;
+ return aData.makeStringAndClear();
}
// -------------------------------------------------------------------------
void OTools::GetInfo(OConnection* _pConnection,
diff --git a/connectivity/source/inc/file/fcode.hxx b/connectivity/source/inc/file/fcode.hxx
index 89c68f654a..de07555d40 100644
--- a/connectivity/source/inc/file/fcode.hxx
+++ b/connectivity/source/inc/file/fcode.hxx
@@ -236,6 +236,16 @@ namespace connectivity
virtual sal_Bool operate(const OOperand*, const OOperand*) const;
};
+ class OOp_NOT : public OBoolOperator
+ {
+ public:
+ TYPEINFO();
+
+ protected:
+ virtual void Exec(OCodeStack&);
+ virtual sal_Bool operate(const OOperand*, const OOperand* = NULL) const;
+ virtual sal_uInt16 getRequestedOperands() const;
+ };
class OOp_AND : public OBoolOperator
{
diff --git a/connectivity/source/inc/flat/ETable.hxx b/connectivity/source/inc/flat/ETable.hxx
index 45702a4e20..24c0b150a0 100644
--- a/connectivity/source/inc/flat/ETable.hxx
+++ b/connectivity/source/inc/flat/ETable.hxx
@@ -87,6 +87,7 @@ namespace connectivity
virtual sal_Bool seekRow(IResultSetHelper::Movement eCursorPosition, sal_Int32 nOffset, sal_Int32& nCurPos);
virtual sal_Bool fetchRow(OValueRefRow& _rRow,const OSQLColumns& _rCols, sal_Bool bIsTable,sal_Bool bRetrieveData);
+ virtual void refreshHeader();
virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
//XTypeProvider
diff --git a/connectivity/source/manager/makefile.mk b/connectivity/source/manager/makefile.mk
index ce16b2f887..7cb514cd36 100644
--- a/connectivity/source/manager/makefile.mk
+++ b/connectivity/source/manager/makefile.mk
@@ -35,6 +35,7 @@ PRJNAME=connectivity
TARGET=sdbc
ENABLE_EXCEPTIONS=TRUE
+VISIBILITY_HIDDEN=TRUE
# --- Settings ----------------------------------
.IF "$(DBGUTIL_OJ)"!=""
@@ -62,6 +63,8 @@ SHL1STDLIBS=\
$(CPPULIB) \
$(CPPUHELPERLIB) \
$(COMPHELPERLIB) \
+ $(DBTOOLSLIB) \
+ $(UNOTOOLSLIB) \
$(SALLIB)
SHL1DEPN=
diff --git a/connectivity/source/manager/mdrivermanager.cxx b/connectivity/source/manager/mdrivermanager.cxx
index 083b47d98a..64526b8a23 100644
--- a/connectivity/source/manager/mdrivermanager.cxx
+++ b/connectivity/source/manager/mdrivermanager.cxx
@@ -278,13 +278,26 @@ Any SAL_CALL ODriverEnumeration::nextElement( ) throw(NoSuchElementException, W
}
};
+ /// and STL argorithm compatible predicate comparing a DriverAccess' impl name to a string
+ struct EqualDriverAccessToName : public ::std::binary_function< DriverAccess, ::rtl::OUString, bool >
+ {
+ ::rtl::OUString m_sImplName;
+ EqualDriverAccessToName(const ::rtl::OUString& _sImplName) : m_sImplName(_sImplName){}
+ //.................................................................
+ bool operator()( const DriverAccess& lhs)
+ {
+ return lhs.sImplementationName.equals(m_sImplName);
+ }
+ };
+
//==========================================================================
//= OSDBCDriverManager
//==========================================================================
//--------------------------------------------------------------------------
- OSDBCDriverManager::OSDBCDriverManager( const Reference< XComponentContext >& _rxContext )
+OSDBCDriverManager::OSDBCDriverManager( const Reference< XComponentContext >& _rxContext )
:m_aContext( _rxContext )
,m_aEventLogger( _rxContext, "org.openoffice.logging.sdbc.DriverManager" )
+ ,m_aDriverConfig(m_aContext.getLegacyServiceFactory())
,m_nLoginTimeout(0)
{
// bootstrap all objects supporting the .sdb.Driver service
@@ -375,7 +388,7 @@ void OSDBCDriverManager::bootstrapDrivers()
//--------------------------------------------------------------------------
void OSDBCDriverManager::initializeDriverPrecedence()
{
- if (!m_aDriversBS.size())
+ if ( m_aDriversBS.empty() )
// nothing to do
return;
@@ -420,7 +433,7 @@ void OSDBCDriverManager::initializeDriverPrecedence()
{ // we have a DriverAccess with this impl name
OSL_ENSURE( ::std::distance( aPos.first, aPos.second ) == 1,
- "OSDBCDriverManager::initializeDriverPrecedence: move than one driver with this impl name? How this?" );
+ "OSDBCDriverManager::initializeDriverPrecedence: more than one driver with this impl name? How this?" );
// move the DriverAccess pointed to by aPos.first to the position pointed to by aNoPrefDriversStart
if ( aPos.first != aNoPrefDriversStart )
@@ -686,17 +699,29 @@ Reference< XDriver > OSDBCDriverManager::implGetDriverForURL(const ::rtl::OUStri
Reference< XDriver > xReturn;
{
- // search all bootstrapped drivers
- DriverAccessArrayIterator aPos = ::std::find_if(
- m_aDriversBS.begin(), // begin of search range
- m_aDriversBS.end(), // end of search range
- std::unary_compose< AcceptsURL, ExtractAfterLoad >( AcceptsURL( _rURL ), ExtractAfterLoad() )
- // compose two functors: extract the driver from the access, then ask the resulting driver for acceptance
- );
+ const ::rtl::OUString sDriverFactoryName = m_aDriverConfig.getDriverFactoryName(_rURL);
+
+ EqualDriverAccessToName aEqual(sDriverFactoryName);
+ DriverAccessArray::iterator aFind = ::std::find_if(m_aDriversBS.begin(),m_aDriversBS.end(),aEqual);
+ if ( aFind == m_aDriversBS.end() )
+ {
+ // search all bootstrapped drivers
+ aFind = ::std::find_if(
+ m_aDriversBS.begin(), // begin of search range
+ m_aDriversBS.end(), // end of search range
+ std::unary_compose< AcceptsURL, ExtractAfterLoad >( AcceptsURL( _rURL ), ExtractAfterLoad() )
+ // compose two functors: extract the driver from the access, then ask the resulting driver for acceptance
+ );
+ } // if ( m_aDriversBS.find(sDriverFactoryName ) == m_aDriversBS.end() )
+ else
+ {
+ EnsureDriver aEnsure;
+ aEnsure(*aFind);
+ }
// found something?
- if ( m_aDriversBS.end() != aPos )
- xReturn = aPos->xDriver;
+ if ( m_aDriversBS.end() != aFind )
+ xReturn = aFind->xDriver;
}
if ( !xReturn.is() )
diff --git a/connectivity/source/manager/mdrivermanager.hxx b/connectivity/source/manager/mdrivermanager.hxx
index 60988bef5d..ba5dbb795b 100644
--- a/connectivity/source/manager/mdrivermanager.hxx
+++ b/connectivity/source/manager/mdrivermanager.hxx
@@ -44,6 +44,7 @@
#include <comphelper/logging.hxx>
#include <comphelper/componentcontext.hxx>
#include <osl/mutex.hxx>
+#include "connectivity/DriversConfig.hxx"
namespace drivermanager
{
@@ -81,16 +82,15 @@ namespace drivermanager
::comphelper::EventLogger m_aEventLogger;
DECLARE_STL_VECTOR(DriverAccess, DriverAccessArray);
- DriverAccessArray m_aDriversBS;
+ DriverAccessArray m_aDriversBS;
// for drivers registered at runtime (not bootstrapped) we don't require an XServiceInfo interface,
// so we have to remember their impl-name in another way
DECLARE_STL_USTRINGACCESS_MAP(SdbcDriver, DriverCollection);
DriverCollection m_aDriversRT;
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
- m_xServiceFactory;
- sal_Int32 m_nLoginTimeout;
+ ::connectivity::DriversConfig m_aDriverConfig;
+ sal_Int32 m_nLoginTimeout;
private:
OSDBCDriverManager(
diff --git a/connectivity/source/manager/mregistration.cxx b/connectivity/source/manager/mregistration.cxx
index 49938b0751..d6a3562564 100644
--- a/connectivity/source/manager/mregistration.cxx
+++ b/connectivity/source/manager/mregistration.cxx
@@ -48,13 +48,13 @@ extern "C"
{
//---------------------------------------------------------------------------------------
- void SAL_CALL component_getImplementationEnvironment(const sal_Char** _ppEnvTypeName, uno_Environment** /*_ppEnv*/)
+SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(const sal_Char** _ppEnvTypeName, uno_Environment** /*_ppEnv*/)
{
*_ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
//---------------------------------------------------------------------------------------
-sal_Bool SAL_CALL component_writeInfo(void* /*_pServiceManager*/, com::sun::star::registry::XRegistryKey* _pRegistryKey)
+SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(void* /*_pServiceManager*/, com::sun::star::registry::XRegistryKey* _pRegistryKey)
{
@@ -86,7 +86,7 @@ sal_Bool SAL_CALL component_writeInfo(void* /*_pServiceManager*/, com::sun::star
}
//---------------------------------------------------------------------------------------
-void* SAL_CALL component_getFactory(const sal_Char* _pImplName, ::com::sun::star::lang::XMultiServiceFactory* _pServiceManager, void* /*_pRegistryKey*/)
+SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(const sal_Char* _pImplName, ::com::sun::star::lang::XMultiServiceFactory* _pServiceManager, void* /*_pRegistryKey*/)
{
void* pRet = NULL;
diff --git a/connectivity/source/parse/sqlbison.y b/connectivity/source/parse/sqlbison.y
index a42c3cb230..be1ee39d9b 100644
--- a/connectivity/source/parse/sqlbison.y
+++ b/connectivity/source/parse/sqlbison.y
@@ -107,7 +107,7 @@ static connectivity::OSQLInternalNode* newNode(const sal_Char* pNewValue,
const connectivity::SQLNodeType eNodeType,
const sal_uInt32 nNodeID = 0)
{
-
+ OSL_TRACE("connectivity: Rule Number: %d,%d",eNodeType,nNodeID);
return new connectivity::OSQLInternalNode(pNewValue, eNodeType, nNodeID);
}
@@ -115,7 +115,7 @@ static connectivity::OSQLInternalNode* newNode(const ::rtl::OString& _NewValue,
const connectivity::SQLNodeType eNodeType,
const sal_uInt32 nNodeID = 0)
{
-
+ OSL_TRACE("connectivity: Rule Number: %d,%d",eNodeType,nNodeID);
return new connectivity::OSQLInternalNode(_NewValue, eNodeType, nNodeID);
}
@@ -123,7 +123,7 @@ static connectivity::OSQLInternalNode* newNode(const ::rtl::OUString& _NewValue,
const connectivity::SQLNodeType eNodeType,
const sal_uInt32 nNodeID = 0)
{
-
+ OSL_TRACE("connectivity: Rule Number: %d,%d",eNodeType,nNodeID);
return new connectivity::OSQLInternalNode(_NewValue, eNodeType, nNodeID);
}
@@ -209,7 +209,7 @@ using namespace connectivity;
/* numeric functions */
%token <pParseNode> SQL_TOKEN_ABS SQL_TOKEN_ACOS SQL_TOKEN_ASIN SQL_TOKEN_ATAN SQL_TOKEN_ATAN2 SQL_TOKEN_CEILING
-%token <pParseNode> SQL_TOKEN_COS SQL_TOKEN_COT SQL_TOKEN_DEGREES SQL_TOKEN_EXP SQL_TOKEN_DIV SQL_TOKEN_FLOOR SQL_TOKEN_LOGF SQL_TOKEN_LOG SQL_TOKEN_LN
+%token <pParseNode> SQL_TOKEN_COS SQL_TOKEN_COT SQL_TOKEN_DEGREES SQL_TOKEN_EXP SQL_TOKEN_FLOOR SQL_TOKEN_LOGF SQL_TOKEN_LOG SQL_TOKEN_LN
%token <pParseNode> SQL_TOKEN_LOG10 SQL_TOKEN_MOD SQL_TOKEN_PI SQL_TOKEN_POWER SQL_TOKEN_RADIANS SQL_TOKEN_RAND SQL_TOKEN_ROUNDMAGIC
%token <pParseNode> SQL_TOKEN_ROUND SQL_TOKEN_SIGN SQL_TOKEN_SIN SQL_TOKEN_SQRT SQL_TOKEN_TAN SQL_TOKEN_TRUNCATE
@@ -676,15 +676,12 @@ manipulative_statement_list:
;
***/
-/*sql:
- {$$ = SQL_NEW_LISTRULE;}
- ;
-*/
sql_not:
{$$ = SQL_NEW_RULE;}
| SQL_TOKEN_NOT
;
- /* manipulative statements */
+
+/* manipulative statements */
sql: manipulative_statement
;
@@ -767,10 +764,12 @@ insert_statement:
$$->append($5);}
;
values_or_query_spec:
- SQL_TOKEN_VALUES table_value_const_list
+ SQL_TOKEN_VALUES '(' table_value_const_list ')'
{$$ = SQL_NEW_RULE;
$$->append($1);
- $$->append($2);
+ $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
+ $$->append($3);
+ $$->append($4 = newNode(")", SQL_NODE_PUNCTUATION));
}
;
@@ -792,18 +791,14 @@ row_value_const_list:
;
row_value_constructor:
row_value_constructor_elem
- | '(' row_value_const_list ')'
+/* | '(' row_value_const_list ')'
{
$$ = SQL_NEW_RULE;
$$->append($1 = newNode("(", SQL_NODE_PUNCTUATION));
$$->append($2);
$$->append($3 = newNode(")", SQL_NODE_PUNCTUATION));
}
-/* | subquery
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- }*/
+ */
;
row_value_constructor_elem:
value_exp /*[^')']*/
@@ -1053,47 +1048,16 @@ truth_value:
;
boolean_primary:
predicate
- | '(' search_condition ')'
- {
+ | '(' search_condition ')'
+ { // boolean_primary: rule 2
$$ = SQL_NEW_RULE;
$$->append($1 = newNode("(", SQL_NODE_PUNCTUATION));
$$->append($2);
$$->append($3 = newNode(")", SQL_NODE_PUNCTUATION));
}
- ;
-
-boolean_test:
- boolean_primary
- | boolean_primary SQL_TOKEN_IS sql_not truth_value
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- $$->append($4);
- }
- ;
-boolean_factor:
- boolean_test
- | SQL_TOKEN_NOT boolean_test
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- }
- ;
-boolean_term:
- boolean_factor
- | boolean_term SQL_TOKEN_AND boolean_factor
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- }
| row_value_constructor_elem /*[^')' ',']*/
{
- if(xxx_pGLOBAL_SQLPARSER->inPredicateCheck())
+ if(xxx_pGLOBAL_SQLPARSER->inPredicateCheck())// boolean_primary: rule 3
{
$$ = SQL_NEW_RULE;
sal_Int16 nErg = xxx_pGLOBAL_SQLPARSER->buildComparsionRule($$,$1);
@@ -1115,54 +1079,43 @@ boolean_term:
else
YYERROR;
}
- | boolean_term SQL_TOKEN_AND literal
- {
- if(xxx_pGLOBAL_SQLPARSER->inPredicateCheck())
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- sal_Int16 nErg = xxx_pGLOBAL_SQLPARSER->buildComparsionRule($$,$3);
- if(nErg < 1)
- {
- delete $$;
- if(nErg)
- YYERROR;
- else
- YYABORT;
- }
- }
- else
- YYERROR;
+ ;
+boolean_test:
+ boolean_primary
+ | boolean_primary SQL_TOKEN_IS sql_not truth_value
+ {
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ $$->append($3);
+ $$->append($4);
}
- | boolean_term SQL_TOKEN_AND SQL_TOKEN_STRING
+ ;
+boolean_factor:
+ boolean_test
+ | SQL_TOKEN_NOT boolean_test
+ { // boolean_factor: rule 1
+ $$ = SQL_NEW_RULE;
+ $$->append($1);
+ $$->append($2);
+ }
+ ;
+boolean_term:
+ boolean_factor
+ | boolean_term SQL_TOKEN_AND boolean_factor
{
- if(xxx_pGLOBAL_SQLPARSER->inPredicateCheck())
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- sal_Int16 nErg = xxx_pGLOBAL_SQLPARSER->buildComparsionRule($$,$3);
- if(nErg < 1)
- {
- delete $$;
- if(nErg)
- YYERROR;
- else
- YYABORT;
- }
- }
- else
- YYERROR;
-
+ $$ = SQL_NEW_RULE; // boolean_term: rule 1
+ $$->append($1);
+ $$->append($2);
+ $$->append($3);
}
;
search_condition:
boolean_term
| search_condition SQL_TOKEN_OR boolean_term
{
- $$ = SQL_NEW_RULE;
+ $$ = SQL_NEW_RULE; // search_condition
$$->append($1);
$$->append($2);
$$->append($3);
@@ -1182,14 +1135,14 @@ predicate:
comparison_predicate:
row_value_constructor comparison row_value_constructor
{
- $$ = SQL_NEW_RULE;
+ $$ = SQL_NEW_RULE; // comparison_predicate: rule 1
$$->append($1);
$$->append($2);
$$->append($3);
}
| comparison row_value_constructor
{
- if(xxx_pGLOBAL_SQLPARSER->inPredicateCheck())
+ if(xxx_pGLOBAL_SQLPARSER->inPredicateCheck()) // comparison_predicate: rule 2
{
$$ = SQL_NEW_RULE;
sal_Int16 nErg = xxx_pGLOBAL_SQLPARSER->buildPredicateRule($$,$2,$1);
@@ -1221,7 +1174,7 @@ comparison:
;
between_predicate:
row_value_constructor sql_not SQL_TOKEN_BETWEEN row_value_constructor SQL_TOKEN_AND row_value_constructor
- {$$ = SQL_NEW_RULE;
+ {$$ = SQL_NEW_RULE; // between_predicate: rule 1
$$->append($1);
$$->append($2);
$$->append($3);
@@ -1231,7 +1184,7 @@ between_predicate:
}
| sql_not SQL_TOKEN_BETWEEN row_value_constructor SQL_TOKEN_AND row_value_constructor
{
- if (xxx_pGLOBAL_SQLPARSER->inPredicateCheck())
+ if (xxx_pGLOBAL_SQLPARSER->inPredicateCheck()) // between_predicate: rule 2
{
$$ = SQL_NEW_RULE;
@@ -1258,7 +1211,7 @@ between_predicate:
like_predicate:
row_value_constructor SQL_TOKEN_NOT SQL_TOKEN_LIKE string_value_exp opt_escape
{
- $$ = SQL_NEW_RULE;
+ $$ = SQL_NEW_RULE; // like_predicate: rule 1
$$->append($1);
$$->append($2);
$$->append($3);
@@ -1267,7 +1220,7 @@ like_predicate:
}
| row_value_constructor SQL_TOKEN_LIKE string_value_exp opt_escape
{
- $$ = SQL_NEW_RULE;
+ $$ = SQL_NEW_RULE; // like_predicate: rule 2
$$->append($1);
$$->append($2);
$$->append($3);
@@ -1275,7 +1228,7 @@ like_predicate:
}
| row_value_constructor SQL_TOKEN_NOT SQL_TOKEN_LIKE value_exp_primary opt_escape
{
- $$ = SQL_NEW_RULE;
+ $$ = SQL_NEW_RULE; // like_predicate: rule 3
$$->append($1);
$$->append($2);
$$->append($3);
@@ -1284,7 +1237,7 @@ like_predicate:
}
| row_value_constructor SQL_TOKEN_LIKE value_exp_primary opt_escape
{
- $$ = SQL_NEW_RULE;
+ $$ = SQL_NEW_RULE; // like_predicate: rule 4
$$->append($1);
$$->append($2);
$$->append($3);
@@ -1292,7 +1245,7 @@ like_predicate:
}
| sql_not SQL_TOKEN_LIKE string_value_exp opt_escape
{
- if (xxx_pGLOBAL_SQLPARSER->inPredicateCheck())
+ if (xxx_pGLOBAL_SQLPARSER->inPredicateCheck()) // like_predicate: rule 5
{
OSQLParseNode* pColumnRef = newNode(aEmptyString, SQL_NODE_RULE,OSQLParser::RuleID(OSQLParseNode::column_ref));
pColumnRef->append(newNode(xxx_pGLOBAL_SQLPARSER->getFieldName(),SQL_NODE_NAME));
@@ -1314,7 +1267,7 @@ like_predicate:
}
| sql_not SQL_TOKEN_LIKE value_exp_primary opt_escape
{
- if (xxx_pGLOBAL_SQLPARSER->inPredicateCheck())
+ if (xxx_pGLOBAL_SQLPARSER->inPredicateCheck()) // like_predicate: rule 6
{
OSQLParseNode* pColumnRef = newNode(aEmptyString, SQL_NODE_RULE,OSQLParser::RuleID(OSQLParseNode::column_ref));
pColumnRef->append(newNode(xxx_pGLOBAL_SQLPARSER->getFieldName(),SQL_NODE_NAME));
@@ -1355,7 +1308,7 @@ opt_escape:
test_for_null:
row_value_constructor SQL_TOKEN_IS sql_not truth_value
{
- $$ = SQL_NEW_RULE;
+ $$ = SQL_NEW_RULE; // test_for_null: rule 1
$$->append($1);
$$->append($2);
$$->append($3);
@@ -1363,7 +1316,7 @@ test_for_null:
}
| SQL_TOKEN_IS sql_not truth_value
{
- if (xxx_pGLOBAL_SQLPARSER->inPredicateCheck())
+ if (xxx_pGLOBAL_SQLPARSER->inPredicateCheck())// test_for_null: rule 2
{
OSQLParseNode* pColumnRef = newNode(aEmptyString, SQL_NODE_RULE,OSQLParser::RuleID(OSQLParseNode::column_ref));
pColumnRef->append(newNode(xxx_pGLOBAL_SQLPARSER->getFieldName(),SQL_NODE_NAME));
@@ -1393,15 +1346,15 @@ in_predicate_value:
in_predicate:
row_value_constructor sql_not SQL_TOKEN_IN in_predicate_value
{
- $$ = SQL_NEW_RULE;
+ $$ = SQL_NEW_RULE;// in_predicate: rule 1
$$->append($1);
$$->append($2);
$$->append($3);
$$->append($4);
}
- | sql_not SQL_TOKEN_IN in_predicate_value
+ | sql_not SQL_TOKEN_IN in_predicate_value
{
- if ( xxx_pGLOBAL_SQLPARSER->inPredicateCheck() )
+ if ( xxx_pGLOBAL_SQLPARSER->inPredicateCheck() )// in_predicate: rule 2
{
OSQLParseNode* pColumnRef = newNode(aEmptyString, SQL_NODE_RULE,OSQLParser::RuleID(OSQLParseNode::column_ref));
pColumnRef->append(newNode(xxx_pGLOBAL_SQLPARSER->getFieldName(),SQL_NODE_NAME));
@@ -3132,7 +3085,7 @@ user: SQL_TOKEN_NAME
sql:
search_condition /* checking predicats */
{
- if (xxx_pGLOBAL_SQLPARSER->inPredicateCheck())
+ if (xxx_pGLOBAL_SQLPARSER->inPredicateCheck()) // sql: rule 1
{
$$ = $1;
if ( SQL_ISRULE($$,search_condition) )
@@ -3143,7 +3096,9 @@ sql:
}
else
YYERROR;
- };
+ }
+ | '(' sql ')' /* checking predicats */
+ ;
%%
diff --git a/connectivity/source/parse/sqlflex.l b/connectivity/source/parse/sqlflex.l
index 19d2b8a27d..e365fdec1e 100644
--- a/connectivity/source/parse/sqlflex.l
+++ b/connectivity/source/parse/sqlflex.l
@@ -192,7 +192,6 @@ COLLECT {SQL_NEW_KEYWORD(SQL_TOKEN_COLLE
[Dd][Ee][Ss][Cc] {SQL_NEW_KEYWORD(SQL_TOKEN_DESC); return SQL_TOKEN_DESC; }
[Dd][Ii][Ff][Ff][Ee][Rr][Ee][Nn][Cc][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_DIFFERENCE); return SQL_TOKEN_DIFFERENCE; }
[Dd][Ii][Ss][Tt][Ii][Nn][Cc][Tt] {SQL_NEW_KEYWORD(SQL_TOKEN_DISTINCT); return SQL_TOKEN_DISTINCT; }
-[Dd][Ii][Vv] {SQL_NEW_KEYWORD(SQL_TOKEN_DIV); return SQL_TOKEN_DIV; }
[Dd][Oo][Uu][Bb][Ll][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_DOUBLE); return SQL_TOKEN_DOUBLE; }
[Dd][Rr][Oo][Pp] {SQL_NEW_KEYWORD(SQL_TOKEN_DROP); return SQL_TOKEN_DROP; }
@@ -484,7 +483,7 @@ sal_Int32 gatherString( sal_Int32 delim, sal_Int32 nTyp)
}
}
- else if (ch == '\r' || ch == '\n')
+ else if (nTyp != 1 && (ch == '\r' || ch == '\n') )
break;
else
{
diff --git a/connectivity/source/parse/sqliterator.cxx b/connectivity/source/parse/sqliterator.cxx
index 40e1c04859..10a71b5015 100644
--- a/connectivity/source/parse/sqliterator.cxx
+++ b/connectivity/source/parse/sqliterator.cxx
@@ -1493,6 +1493,20 @@ void OSQLParseTreeIterator::traverseParameter(const OSQLParseNode* _pParseNode
}
if ( bNotFound )
{
+ sal_Int32 nType = DataType::VARCHAR;
+ OSQLParseNode* pParent = _pColumnRef ? _pColumnRef->getParent() : NULL;
+ if ( pParent && (SQL_ISRULE(pParent,general_set_fct) || SQL_ISRULE(pParent,set_fct_spec)) )
+ {
+ const sal_uInt32 nCount = _pColumnRef->count();
+ sal_uInt32 i = 0;
+ for(; i < nCount;++i)
+ {
+ if ( _pColumnRef->getChild(i) == _pParseNode )
+ break;
+ }
+ nType = ::connectivity::OSQLParser::getFunctionParameterType( pParent->getChild(0)->getTokenID(), i+1);
+ }
+
::rtl::OUString aNewColName( getUniqueColumnName( sParameterName ) );
OParseColumn* pColumn = new OParseColumn(aNewColName,
@@ -1501,7 +1515,7 @@ void OSQLParseTreeIterator::traverseParameter(const OSQLParseNode* _pParseNode
ColumnValue::NULLABLE_UNKNOWN,
0,
0,
- DataType::VARCHAR,
+ nType,
sal_False,
sal_False,
isCaseSensitive() );
diff --git a/connectivity/source/parse/sqlnode.cxx b/connectivity/source/parse/sqlnode.cxx
index 99a11a9703..7ca6c92020 100644
--- a/connectivity/source/parse/sqlnode.cxx
+++ b/connectivity/source/parse/sqlnode.cxx
@@ -304,9 +304,10 @@ void OSQLParseNode::parseNodeToStr(::rtl::OUString& rString,
if ( _rxConnection.is() )
{
+ ::rtl::OUStringBuffer sBuffer = rString;
try
{
- OSQLParseNode::impl_parseNodeToString_throw( rString,
+ OSQLParseNode::impl_parseNodeToString_throw( sBuffer,
SQLParseNodeParameter(
_rxConnection, xFormatter, _xField, rIntl, pContext,
_bIntl, _bQuote, _cDecSep, _bPredicate, _bSubstitute
@@ -320,6 +321,7 @@ void OSQLParseNode::parseNodeToStr(::rtl::OUString& rString,
// in the sub queries, but this cannot be the case here, as we do not parse to
// SDBC level.
}
+ rString = sBuffer.makeStringAndClear();
}
}
//-----------------------------------------------------------------------------
@@ -342,10 +344,11 @@ bool OSQLParseNode::parseNodeToExecutableStatement( ::rtl::OUString& _out_rStrin
aParseParam.pParser = &_rParser;
_out_rString = ::rtl::OUString();
+ ::rtl::OUStringBuffer sBuffer;
bool bSuccess = false;
try
{
- impl_parseNodeToString_throw( _out_rString, aParseParam );
+ impl_parseNodeToString_throw( sBuffer, aParseParam );
bSuccess = true;
}
catch( const SQLException& e )
@@ -353,6 +356,7 @@ bool OSQLParseNode::parseNodeToExecutableStatement( ::rtl::OUString& _out_rStrin
if ( _pErrorHolder )
*_pErrorHolder = e;
}
+ _out_rString = sBuffer.makeStringAndClear();
return bSuccess;
}
@@ -366,7 +370,7 @@ namespace
}
//-----------------------------------------------------------------------------
-void OSQLParseNode::impl_parseNodeToString_throw(::rtl::OUString& rString, const SQLParseNodeParameter& rParam) const
+void OSQLParseNode::impl_parseNodeToString_throw(::rtl::OUStringBuffer& rString, const SQLParseNodeParameter& rParam) const
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseNode::getTableRange" );
if ( isToken() )
@@ -385,19 +389,19 @@ void OSQLParseNode::impl_parseNodeToString_throw(::rtl::OUString& rString, const
case parameter:
{
if(rString.getLength())
- rString += ::rtl::OUString::createFromAscii(" ");
+ rString.appendAscii(" ");
if (nCount == 1) // ?
m_aChildren[0]->impl_parseNodeToString_throw( rString, rParam );
else if (nCount == 2) // :Name
{
m_aChildren[0]->impl_parseNodeToString_throw( rString, rParam );
- rString += m_aChildren[1]->m_aNodeValue;
+ rString.append(m_aChildren[1]->m_aNodeValue);
} // [Name]
else
{
m_aChildren[0]->impl_parseNodeToString_throw( rString, rParam );
- rString += m_aChildren[1]->m_aNodeValue;
- rString += m_aChildren[2]->m_aNodeValue;
+ rString.append(m_aChildren[1]->m_aNodeValue);
+ rString.append(m_aChildren[2]->m_aNodeValue);
}
bHandled = true;
}
@@ -419,7 +423,7 @@ void OSQLParseNode::impl_parseNodeToString_throw(::rtl::OUString& rString, const
case as:
if ( rParam.aMetaData.generateASBeforeCorrelationName() )
- rString += ::rtl::OUString::createFromAscii( " AS" );
+ rString.append(::rtl::OUString::createFromAscii( " AS" ));
bHandled = true;
break;
@@ -447,7 +451,7 @@ void OSQLParseNode::impl_parseNodeToString_throw(::rtl::OUString& rString, const
m_aChildren[0]->impl_parseNodeToString_throw( rString, aNewParam );
aNewParam.bQuote = rParam.bQuote;
//aNewParam.bPredicate = sal_False; // disable [ ] around names // look at i73215
- ::rtl::OUString aStringPara;
+ ::rtl::OUStringBuffer aStringPara;
for (sal_uInt32 i=1; i<nCount; i++)
{
const OSQLParseNode * pSubTree = m_aChildren[i];
@@ -457,13 +461,12 @@ void OSQLParseNode::impl_parseNodeToString_throw(::rtl::OUString& rString, const
// bei den CommaListen zwischen alle Subtrees Commas setzen
if ((m_eNodeType == SQL_NODE_COMMALISTRULE) && (i < (nCount - 1)))
- aStringPara += ::rtl::OUString::createFromAscii(",");
+ aStringPara.appendAscii(",");
}
else
i++;
}
- aStringPara.trim();
- rString += aStringPara;
+ rString.append(aStringPara.makeStringAndClear());
}
bHandled = true;
}
@@ -542,7 +545,7 @@ void OSQLParseNode::impl_parseNodeToString_throw(::rtl::OUString& rString, const
// bei den CommaListen zwischen alle Subtrees Commas setzen
if ((m_eNodeType == SQL_NODE_COMMALISTRULE) && (i != m_aChildren.end()))
- rString += ::rtl::OUString::createFromAscii(",");
+ rString.appendAscii(",");
}
}
else
@@ -554,9 +557,9 @@ void OSQLParseNode::impl_parseNodeToString_throw(::rtl::OUString& rString, const
if ((m_eNodeType == SQL_NODE_COMMALISTRULE) && (i != m_aChildren.end()))
{
if (SQL_ISRULE(this,value_exp_commalist) && rParam.bPredicate)
- rString += ::rtl::OUString::createFromAscii(";");
+ rString.appendAscii(";");
else
- rString += ::rtl::OUString::createFromAscii(",");
+ rString.appendAscii(",");
}
}
}
@@ -564,7 +567,7 @@ void OSQLParseNode::impl_parseNodeToString_throw(::rtl::OUString& rString, const
}
//-----------------------------------------------------------------------------
-bool OSQLParseNode::impl_parseTableNameNodeToString_throw( ::rtl::OUString& rString, const SQLParseNodeParameter& rParam ) const
+bool OSQLParseNode::impl_parseTableNameNodeToString_throw( ::rtl::OUStringBuffer& rString, const SQLParseNodeParameter& rParam ) const
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseNode::impl_parseTableNameNodeToString_throw" );
// is the table_name part of a table_ref?
@@ -623,25 +626,25 @@ bool OSQLParseNode::impl_parseTableNameNodeToString_throw( ::rtl::OUString& rStr
if ( pSubQueryNode.get() )
{
// parse the sub-select to SDBC level, too
- ::rtl::OUString sSubSelect;
+ ::rtl::OUStringBuffer sSubSelect;
pSubQueryNode->impl_parseNodeToString_throw( sSubSelect, rParam );
if ( sSubSelect.getLength() )
- sCommand = sSubSelect;
+ sCommand = sSubSelect.makeStringAndClear();
}
}
- rString += ::rtl::OUString::createFromAscii( " ( " );
- rString += sCommand;
- rString += ::rtl::OUString::createFromAscii( " )" );
+ rString.appendAscii( " ( " );
+ rString.append(sCommand);
+ rString.appendAscii( " )" );
// append the query name as table alias, since it might be referenced in other
// parts of the statement - but only if there's no other alias name present
if ( !lcl_isAliasNamePresent( *this ) )
{
- rString += ::rtl::OUString::createFromAscii( " AS " );
+ rString.appendAscii( " AS " );
if ( rParam.bQuote )
- rString += SetQuotation( sTableOrQueryName,
- rParam.aMetaData.getIdentifierQuoteString(), rParam.aMetaData.getIdentifierQuoteString() );
+ rString.append(SetQuotation( sTableOrQueryName,
+ rParam.aMetaData.getIdentifierQuoteString(), rParam.aMetaData.getIdentifierQuoteString() ));
}
// don't forget to remove the query name from the history, else multiple inclusions
@@ -663,7 +666,7 @@ bool OSQLParseNode::impl_parseTableNameNodeToString_throw( ::rtl::OUString& rStr
}
//-----------------------------------------------------------------------------
-void OSQLParseNode::impl_parseTableRangeNodeToString_throw(::rtl::OUString& rString, const SQLParseNodeParameter& rParam) const
+void OSQLParseNode::impl_parseTableRangeNodeToString_throw(::rtl::OUStringBuffer& rString, const SQLParseNodeParameter& rParam) const
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseNode::impl_parseTableRangeNodeToString_throw" );
OSL_PRECOND( ( count() == 2 ) || ( count() == 3 ) || ( count() == 5 ) ,"Illegal count");
@@ -674,7 +677,7 @@ void OSQLParseNode::impl_parseTableRangeNodeToString_throw(::rtl::OUString& rStr
}
//-----------------------------------------------------------------------------
-void OSQLParseNode::impl_parseLikeNodeToString_throw( ::rtl::OUString& rString, const SQLParseNodeParameter& rParam ) const
+void OSQLParseNode::impl_parseLikeNodeToString_throw( ::rtl::OUStringBuffer& rString, const SQLParseNodeParameter& rParam ) const
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseNode::impl_parseLikeNodeToString_throw" );
OSL_ENSURE(count() >= 4,"count != 5: Prepare for GPF");
@@ -725,8 +728,8 @@ void OSQLParseNode::impl_parseLikeNodeToString_throw( ::rtl::OUString& rString,
if (pParaNode->isToken())
{
::rtl::OUString aStr = ConvertLikeToken(pParaNode, pEscNode, rParam.bInternational);
- rString += ::rtl::OUString::createFromAscii(" ");
- rString += SetQuotation(aStr,::rtl::OUString::createFromAscii("\'"),::rtl::OUString::createFromAscii("\'\'"));
+ rString.appendAscii(" ");
+ rString.append(SetQuotation(aStr,::rtl::OUString::createFromAscii("\'"),::rtl::OUString::createFromAscii("\'\'")));
}
else
pParaNode->impl_parseNodeToString_throw( rString, aNewParam );
@@ -1687,7 +1690,7 @@ void OSQLParseNode::append(OSQLParseNode* pNewNode)
m_aChildren.push_back(pNewNode);
}
// -----------------------------------------------------------------------------
-sal_Bool OSQLParseNode::addDateValue(::rtl::OUString& rString, const SQLParseNodeParameter& rParam) const
+sal_Bool OSQLParseNode::addDateValue(::rtl::OUStringBuffer& rString, const SQLParseNodeParameter& rParam) const
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseNode::addDateValue" );
// special display for date/time values
@@ -1708,10 +1711,6 @@ sal_Bool OSQLParseNode::addDateValue(::rtl::OUString& rString, const SQLParseNod
{
suQuote = ::rtl::OUString::createFromAscii("#");
}
- else
- {
- suQuote = ::rtl::OUString::createFromAscii("'");
- }
}
else
{
@@ -1720,29 +1719,25 @@ sal_Bool OSQLParseNode::addDateValue(::rtl::OUString& rString, const SQLParseNod
// suQuote = ::rtl::OUString::createFromAscii("'");
return sal_False;
}
- else
- {
- suQuote = ::rtl::OUString::createFromAscii("'");
- }
}
if (rString.getLength())
- rString += ::rtl::OUString::createFromAscii(" ");
- rString += suQuote;
+ rString.appendAscii(" ");
+ rString.append(suQuote);
const ::rtl::OUString sTokenValue = pODBCNode->m_aChildren[1]->getTokenValue();
if (SQL_ISTOKEN(pODBCNodeChild, D))
{
- rString += rParam.bPredicate ? convertDateString(rParam, sTokenValue) : sTokenValue;
+ rString.append(rParam.bPredicate ? convertDateString(rParam, sTokenValue) : sTokenValue);
}
else if (SQL_ISTOKEN(pODBCNodeChild, T))
{
- rString += rParam.bPredicate ? convertTimeString(rParam, sTokenValue) : sTokenValue;
+ rString.append(rParam.bPredicate ? convertTimeString(rParam, sTokenValue) : sTokenValue);
}
else
{
- rString += rParam.bPredicate ? convertDateTimeString(rParam, sTokenValue) : sTokenValue;
+ rString.append(rParam.bPredicate ? convertDateTimeString(rParam, sTokenValue) : sTokenValue);
}
- rString += suQuote;
+ rString.append(suQuote);
return sal_True;
}
}
@@ -2443,7 +2438,7 @@ OSQLParseNode* OSQLParseNode::replace (OSQLParseNode* pOldSubNode, OSQLParseNode
return pOldSubNode;
}
// -----------------------------------------------------------------------------
-void OSQLParseNode::parseLeaf(::rtl::OUString & rString, const SQLParseNodeParameter& rParam) const
+void OSQLParseNode::parseLeaf(::rtl::OUStringBuffer& rString, const SQLParseNodeParameter& rParam) const
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseNode::parseLeaf" );
// ein Blatt ist gefunden
@@ -2453,51 +2448,51 @@ void OSQLParseNode::parseLeaf(::rtl::OUString & rString, const SQLParseNodeParam
case SQL_NODE_KEYWORD:
{
if (rString.getLength())
- rString += ::rtl::OUString::createFromAscii(" ");
+ rString.appendAscii(" ");
- ::rtl::OString sT = OSQLParser::TokenIDToStr(m_nNodeID, &rParam.m_rContext);
- rString += ::rtl::OUString(sT,sT.getLength(),RTL_TEXTENCODING_UTF8);
+ const ::rtl::OString sT = OSQLParser::TokenIDToStr(m_nNodeID, &rParam.m_rContext);
+ rString.append(::rtl::OUString(sT,sT.getLength(),RTL_TEXTENCODING_UTF8));
} break;
case SQL_NODE_STRING:
if (rString.getLength())
- rString += ::rtl::OUString::createFromAscii(" ");
- rString += SetQuotation(m_aNodeValue,::rtl::OUString::createFromAscii("\'"),::rtl::OUString::createFromAscii("\'\'"));
+ rString.appendAscii(" ");
+ rString.append(SetQuotation(m_aNodeValue,::rtl::OUString::createFromAscii("\'"),::rtl::OUString::createFromAscii("\'\'")));
break;
case SQL_NODE_NAME:
if (rString.getLength())
{
- switch(rString.getStr()[rString.getLength()-1] )
+ switch(rString.charAt(rString.getLength()-1) )
{
case ' ' :
case '.' : break;
default :
if ( !rParam.aMetaData.getCatalogSeparator().getLength()
- || rString.getStr()[ rString.getLength()-1 ] != rParam.aMetaData.getCatalogSeparator().toChar()
+ || rString.charAt( rString.getLength()-1 ) != rParam.aMetaData.getCatalogSeparator().toChar()
)
- rString += ::rtl::OUString::createFromAscii(" "); break;
+ rString.appendAscii(" "); break;
}
}
if (rParam.bQuote)
{
if (rParam.bPredicate)
{
- rString+= ::rtl::OUString::createFromAscii("[");
- rString += m_aNodeValue;
- rString+= ::rtl::OUString::createFromAscii("]");
+ rString.appendAscii("[");
+ rString.append(m_aNodeValue);
+ rString.appendAscii("]");
}
else
- rString += SetQuotation(m_aNodeValue,
- rParam.aMetaData.getIdentifierQuoteString(), rParam.aMetaData.getIdentifierQuoteString() );
+ rString.append(SetQuotation(m_aNodeValue,
+ rParam.aMetaData.getIdentifierQuoteString(), rParam.aMetaData.getIdentifierQuoteString() ));
}
else
- rString += m_aNodeValue;
+ rString.append(m_aNodeValue);
break;
case SQL_NODE_ACCESS_DATE:
if (rString.getLength())
- rString += ::rtl::OUString::createFromAscii(" ");
- rString += ::rtl::OUString::createFromAscii("#");
- rString += m_aNodeValue;
- rString += ::rtl::OUString::createFromAscii("#");
+ rString.appendAscii(" ");
+ rString.appendAscii("#");
+ rString.append(m_aNodeValue);
+ rString.appendAscii("#");
break;
case SQL_NODE_INTNUM:
case SQL_NODE_APPROXNUM:
@@ -2507,26 +2502,26 @@ void OSQLParseNode::parseLeaf(::rtl::OUString & rString, const SQLParseNodeParam
aTmp = aTmp.replace('.', rParam.cDecSep);
if (rString.getLength())
- rString += ::rtl::OUString::createFromAscii(" ");
- rString += aTmp;
+ rString.appendAscii(" ");
+ rString.append(aTmp);
} break;
// fall through
default:
if (rString.getLength() && m_aNodeValue.toChar() != '.' && m_aNodeValue.toChar() != ':' )
{
- switch( rString.getStr()[rString.getLength()-1] )
+ switch( rString.charAt(rString.getLength()-1) )
{
case ' ' :
case '.' : break;
default :
if ( !rParam.aMetaData.getCatalogSeparator().getLength()
- || rString.getStr()[ rString.getLength()-1 ] != rParam.aMetaData.getCatalogSeparator().toChar()
+ || rString.charAt( rString.getLength()-1 ) != rParam.aMetaData.getCatalogSeparator().toChar()
)
- rString += ::rtl::OUString::createFromAscii(" "); break;
+ rString.appendAscii(" "); break;
}
}
- rString += m_aNodeValue;
+ rString.append(m_aNodeValue);
}
}
@@ -2621,6 +2616,113 @@ sal_Int32 OSQLParser::getFunctionReturnType(const ::rtl::OUString& _sFunctionNam
return nType;
}
+// -----------------------------------------------------------------------------
+sal_Int32 OSQLParser::getFunctionParameterType(sal_uInt32 _nTokenId, sal_uInt32 _nPos)
+{
+ sal_Int32 nType = DataType::VARCHAR;
+
+ if(_nTokenId == SQL_TOKEN_CHAR) nType = DataType::INTEGER;
+ else if(_nTokenId == SQL_TOKEN_INSERT)
+ {
+ if ( _nPos == 2 || _nPos == 3 )
+ nType = DataType::INTEGER;
+ }
+ else if(_nTokenId == SQL_TOKEN_LEFT)
+ {
+ if ( _nPos == 2 )
+ nType = DataType::INTEGER;
+ }
+ else if(_nTokenId == SQL_TOKEN_LOCATE)
+ {
+ if ( _nPos == 3 )
+ nType = DataType::INTEGER;
+ }
+ else if(_nTokenId == SQL_TOKEN_LOCATE_2)
+ {
+ if ( _nPos == 3 )
+ nType = DataType::INTEGER;
+ }
+ else if( _nTokenId == SQL_TOKEN_REPEAT || _nTokenId == SQL_TOKEN_RIGHT )
+ {
+ if ( _nPos == 2 )
+ nType = DataType::INTEGER;
+ }
+ else if(_nTokenId == SQL_TOKEN_SPACE )
+ {
+ nType = DataType::INTEGER;
+ }
+ else if(_nTokenId == SQL_TOKEN_SUBSTRING)
+ {
+ if ( _nPos != 1 )
+ nType = DataType::INTEGER;
+ }
+ else if(_nTokenId == SQL_TOKEN_DATEDIFF)
+ {
+ if ( _nPos != 1 )
+ nType = DataType::TIMESTAMP;
+ }
+ else if(_nTokenId == SQL_TOKEN_DATEVALUE)
+ nType = DataType::DATE;
+ else if(_nTokenId == SQL_TOKEN_DAYNAME)
+ nType = DataType::DATE;
+ else if(_nTokenId == SQL_TOKEN_DAYOFMONTH)
+ nType = DataType::DATE;
+ else if(_nTokenId == SQL_TOKEN_DAYOFWEEK)
+ nType = DataType::DATE;
+ else if(_nTokenId == SQL_TOKEN_DAYOFYEAR)
+ nType = DataType::DATE;
+ else if(_nTokenId == SQL_TOKEN_EXTRACT) nType = DataType::VARCHAR;
+ else if(_nTokenId == SQL_TOKEN_HOUR) nType = DataType::TIME;
+ else if(_nTokenId == SQL_TOKEN_MINUTE) nType = DataType::TIME;
+ else if(_nTokenId == SQL_TOKEN_MONTH) nType = DataType::DATE;
+ else if(_nTokenId == SQL_TOKEN_MONTHNAME) nType = DataType::DATE;
+ else if(_nTokenId == SQL_TOKEN_NOW) nType = DataType::TIMESTAMP;
+ else if(_nTokenId == SQL_TOKEN_QUARTER) nType = DataType::DATE;
+ else if(_nTokenId == SQL_TOKEN_SECOND) nType = DataType::TIME;
+ else if(_nTokenId == SQL_TOKEN_TIMESTAMPADD) nType = DataType::TIMESTAMP;
+ else if(_nTokenId == SQL_TOKEN_TIMESTAMPDIFF) nType = DataType::TIMESTAMP;
+ else if(_nTokenId == SQL_TOKEN_TIMEVALUE) nType = DataType::TIMESTAMP;
+ else if(_nTokenId == SQL_TOKEN_WEEK) nType = DataType::DATE;
+ else if(_nTokenId == SQL_TOKEN_YEAR) nType = DataType::DATE;
+
+ else if(_nTokenId == SQL_TOKEN_ABS) nType = DataType::DOUBLE;
+ else if(_nTokenId == SQL_TOKEN_ACOS) nType = DataType::DOUBLE;
+ else if(_nTokenId == SQL_TOKEN_ASIN) nType = DataType::DOUBLE;
+ else if(_nTokenId == SQL_TOKEN_ATAN) nType = DataType::DOUBLE;
+ else if(_nTokenId == SQL_TOKEN_ATAN2) nType = DataType::DOUBLE;
+ else if(_nTokenId == SQL_TOKEN_CEILING) nType = DataType::DOUBLE;
+ else if(_nTokenId == SQL_TOKEN_COS) nType = DataType::DOUBLE;
+ else if(_nTokenId == SQL_TOKEN_COT) nType = DataType::DOUBLE;
+ else if(_nTokenId == SQL_TOKEN_DEGREES) nType = DataType::DOUBLE;
+ else if(_nTokenId == SQL_TOKEN_EXP) nType = DataType::DOUBLE;
+ else if(_nTokenId == SQL_TOKEN_FLOOR) nType = DataType::DOUBLE;
+ else if(_nTokenId == SQL_TOKEN_LOGF) nType = DataType::DOUBLE;
+ else if(_nTokenId == SQL_TOKEN_LOG) nType = DataType::DOUBLE;
+ else if(_nTokenId == SQL_TOKEN_LOG10) nType = DataType::DOUBLE;
+ else if(_nTokenId == SQL_TOKEN_LN) nType = DataType::DOUBLE;
+ else if(_nTokenId == SQL_TOKEN_MOD) nType = DataType::DOUBLE;
+ else if(_nTokenId == SQL_TOKEN_PI) nType = DataType::DOUBLE;
+ else if(_nTokenId == SQL_TOKEN_POWER) nType = DataType::DOUBLE;
+ else if(_nTokenId == SQL_TOKEN_RADIANS) nType = DataType::DOUBLE;
+ else if(_nTokenId == SQL_TOKEN_RAND) nType = DataType::DOUBLE;
+ else if(_nTokenId == SQL_TOKEN_ROUND) nType = DataType::DOUBLE;
+ else if(_nTokenId == SQL_TOKEN_ROUNDMAGIC) nType = DataType::DOUBLE;
+ else if(_nTokenId == SQL_TOKEN_SIGN) nType = DataType::DOUBLE;
+ else if(_nTokenId == SQL_TOKEN_SIN) nType = DataType::DOUBLE;
+ else if(_nTokenId == SQL_TOKEN_SQRT) nType = DataType::DOUBLE;
+ else if(_nTokenId == SQL_TOKEN_TAN) nType = DataType::DOUBLE;
+ else if(_nTokenId == SQL_TOKEN_TRUNCATE) nType = DataType::DOUBLE;
+ else if(_nTokenId == SQL_TOKEN_COUNT) nType = DataType::INTEGER;
+ else if(_nTokenId == SQL_TOKEN_MAX) nType = DataType::DOUBLE;
+ else if(_nTokenId == SQL_TOKEN_MIN) nType = DataType::DOUBLE;
+ else if(_nTokenId == SQL_TOKEN_AVG) nType = DataType::DOUBLE;
+ else if(_nTokenId == SQL_TOKEN_SUM) nType = DataType::DOUBLE;
+
+ else if(_nTokenId == SQL_TOKEN_LOWER) nType = DataType::VARCHAR;
+ else if(_nTokenId == SQL_TOKEN_UPPER) nType = DataType::VARCHAR;
+
+ return nType;
+}
// -----------------------------------------------------------------------------
const SQLError& OSQLParser::getErrorHelper() const
diff --git a/connectivity/source/resource/conn_shared_res.src b/connectivity/source/resource/conn_shared_res.src
index d9b5a08457..ea3fb4e065 100644
--- a/connectivity/source/resource/conn_shared_res.src
+++ b/connectivity/source/resource/conn_shared_res.src
@@ -292,23 +292,23 @@ String STR_OPERATOR_TOO_COMPLEX
};
String STR_QUERY_INVALID_LIKE_COLUMN
{
- Text [ en-US ] = "The query can not be executed. The 'LIKE' can only be used with a column name.";
+ Text [ en-US ] = "The query can not be executed. You cannot use 'LIKE' with columns of this type.";
};
String STR_QUERY_INVALID_LIKE_STRING
{
- Text [ en-US ] = "The query can not be executed. The 'LIKE' can only be used with a string argument.";
+ Text [ en-US ] = "The query can not be executed. 'LIKE' can be used with a string argument only.";
};
String STR_QUERY_NOT_LIKE_TOO_COMPLEX
{
- Text [ en-US ] = "The query can not be executed. The 'NOT LIKE' is too complex.";
+ Text [ en-US ] = "The query can not be executed. The 'NOT LIKE' condition is too complex.";
};
String STR_QUERY_LIKE_WILDCARD
{
- Text [ en-US ] = "The query can not be executed. The 'LIKE' statement contains wildcard in the middle.";
+ Text [ en-US ] = "The query can not be executed. The 'LIKE' condition contains wildcard in the middle.";
};
String STR_QUERY_LIKE_WILDCARD_MANY
{
- Text [ en-US ] = "The query can not be executed. The 'LIKE' statement contains too many wildcards.";
+ Text [ en-US ] = "The query can not be executed. The 'LIKE' condition contains too many wildcards.";
};
String STR_INVALID_COLUMNNAME
{
@@ -407,7 +407,7 @@ String STR_COULD_NOT_CREATE_INDEX_NAME
};
String STR_COULD_NOT_CREATE_INDEX_KEYSIZE
{
- Text [ en-US ] = "The index could not be created. The size of the choosen column is to big.";
+ Text [ en-US ] = "The index could not be created. The size of the chosen column is to big.";
};
String STR_SQL_NAME_ERROR
diff --git a/connectivity/target.pmk b/connectivity/target.pmk
new file mode 100644
index 0000000000..97ef318b5f
--- /dev/null
+++ b/connectivity/target.pmk
@@ -0,0 +1,40 @@
+#*************************************************************************
+#
+# 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.pmk,v $
+#
+# $Revision: 1.6 $
+#
+# 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 : target.mk
+
+COMPONENT_CONFIG_SCHEMA*=$(TARGET).xcs
+
+ALLTAR: "$(PWD)$/$(MISC)$/registry$/schema$/$(PACKAGEDIR)$/$(COMPONENT_CONFIG_SCHEMA)"
+"$(PWD)$/$(MISC)$/registry$/schema$/$(PACKAGEDIR)$/$(COMPONENT_CONFIG_SCHEMA)" : $(SOLARXMLDIR)$/registry$/schema$/$(PACKAGEDIR)$/Drivers.xcs
+ @@-$(MKDIRHIER) $(@:d)
+ $(COPY) $< $@
+
diff --git a/connectivity/util/delzip b/connectivity/util/delzip
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/connectivity/util/delzip
diff --git a/connectivity/util/langfilter.xsl b/connectivity/util/langfilter.xsl
new file mode 100644
index 0000000000..76cfcff20a
--- /dev/null
+++ b/connectivity/util/langfilter.xsl
@@ -0,0 +1,37 @@
+<?xml version='1.0' encoding="UTF-8"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:oor="http://openoffice.org/2001/registry">
+<xsl:output method="xml" indent="yes" omit-xml-declaration="no" version="1.0" encoding="UTF-8"/>
+<xsl:param name="lang"/>
+<xsl:template match="*">
+ <xsl:if test="count(.//*[@xml:lang=$lang])&gt;0">
+ <xsl:copy>
+ <xsl:apply-templates select="*|@*"/>
+ </xsl:copy>
+ </xsl:if>
+</xsl:template>
+
+<xsl:template match="@*">
+ <xsl:copy>
+ <xsl:apply-templates select="*|@*"/>
+ </xsl:copy>
+</xsl:template>
+
+<xsl:template match="value">
+ <xsl:if test="@xml:lang=$lang">
+ <xsl:copy>
+ <xsl:apply-templates select="@*|text()"/>
+ </xsl:copy>
+ </xsl:if>
+</xsl:template>
+
+<xsl:template match="text()">
+ <xsl:if test="../@xml:lang=$lang">
+ <xsl:copy>
+ <xsl:apply-templates select="@*|text()"/>
+ </xsl:copy>
+ </xsl:if>
+</xsl:template>
+
+
+</xsl:stylesheet>
+
diff --git a/connectivity/util/makefile.mk b/connectivity/util/makefile.mk
new file mode 100644
index 0000000000..805aa0110f
--- /dev/null
+++ b/connectivity/util/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.22 $
+#
+# 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 = ..
+TARGET = connectivity
+PRJNAME = connectivity
+
+# -----------------------------------------------------------------------------
+# include global settings
+# -----------------------------------------------------------------------------
+
+.INCLUDE : settings.mk
+
+DIR_FILTERCFGOUT := $(MISC)$/drivers
+DIR_LANGPACK := $(DIR_FILTERCFGOUT)
+.IF "$(WITH_LANG)"!=""
+DIR_LANG_SOURCE := $(MISC)$/merge
+.ELSE
+DIR_LANG_SOURCE := $(MISC)$/registry$/data
+.ENDIF
+DRIVER_MERGE_XCU := $(shell -@$(FIND) $(DIR_LANG_SOURCE)$/org$/openoffice$/Office$/DataAccess -name "*.xcu")
+
+REALFILTERPACKAGES_FILTERS_UI_LANGPACKS = \
+ $(foreach,i,$(alllangiso) $(foreach,j,$(DRIVER_MERGE_XCU) $(DIR_LANGPACK)$/$i$/org$/openoffice$/Office$/DataAccess$/$(j:f)))
+
+.INCLUDE: target.mk
+
+PACKLANG := $(XSLTPROC) --nonet
+PACKLANG_IN :=
+PACKLANG_PARAM := --stringparam
+PACKLANG_XSL :=
+
+$(REALFILTERPACKAGES_FILTERS_UI_LANGPACKS) :
+ @echo ===================================================================
+ @echo Building language package for driver $(@:b:s/Filter_//)
+ @echo ===================================================================
+ +-$(MKDIRHIER) $(@:d)
+ $(PACKLANG) $(PACKLANG_PARAM) lang $(@:d:d:d:d:d:d:d:d:d:d:b) $(PACKLANG_XSL) langfilter.xsl $(PACKLANG_IN) $(DIR_LANG_SOURCE)$/org$/openoffice$/Office$/DataAccess$/$(@:f) > $@
+
+$(MISC)$/$(TARGET)_delzip :
+ -$(RM) $(BIN)$/fcfg_drivers_{$(alllangiso)}.zip
+
+$(BIN)$/fcfg_drivers_{$(alllangiso)}.zip : $(REALFILTERPACKAGES_FILTERS_UI_LANGPACKS)
+ cd $(DIR_FILTERCFGOUT)$/$(@:b:s/fcfg_drivers_//) && zip -ru ..$/..$/..$/bin$/fcfg_drivers_$(@:b:s/fcfg_drivers_//).zip org/*
+.IF "$(USE_SHELL)"!="4nt"
+ $(PERL) -w $(SOLARENV)$/bin$/cleanzip.pl $@
+.ENDIF # "$(USE_SHELL)"!="4nt"
+
+ALLTAR: \
+ $(MISC)$/$(TARGET)_delzip \
+ $(BIN)$/fcfg_drivers_{$(alllangiso)}.zip
+
diff --git a/desktop/inc/app.hxx b/desktop/inc/app.hxx
index 72d34d0a3d..432006a50a 100644
--- a/desktop/inc/app.hxx
+++ b/desktop/inc/app.hxx
@@ -134,6 +134,7 @@ class Desktop : public Application
static rtl::OUString GetLicensePath();
static sal_Bool LicenseNeedsAcceptance();
static sal_Bool IsFirstStartWizardNeeded();
+ static sal_Bool CheckExtensionDependencies();
private:
// Bootstrap methods
diff --git a/desktop/prj/build.lst b/desktop/prj/build.lst
index 2154169314..ec04f3d7fc 100644
--- a/desktop/prj/build.lst
+++ b/desktop/prj/build.lst
@@ -16,6 +16,7 @@ dt desktop\win32\source\guiloader nmake - w dt_guiloader dt_wrapper.w dt_inc N
dt desktop\win32\source\guistdio nmake - w dt_guistdio dt_inc NULL
dt desktop\win32\source\applauncher nmake - w dt_applauncher dt_inc NULL
dt desktop\win32\source\applauncher\ooo nmake - w dt_applauncher_ooo dt_applauncher.w dt_inc NULL
+dt desktop\win32\source\rebase nmake - w dt_rebase dt_inc NULL
dt desktop\os2\source\applauncher nmake - p dt_applauncher dt_inc NULL
dt desktop\unx\source\officeloader nmake - u dt_officeloader_unx dt_inc NULL
dt desktop\source\pagein nmake - u dt_pagein dt_inc NULL
@@ -35,5 +36,5 @@ dt desktop\source\deployment\registry\configuration nmake - all dt_dp_registry_c
dt desktop\source\deployment\registry\help nmake - all dt_dp_registry_help dt_inc NULL
dt desktop\source\deployment\registry\executable nmake - all dt_dp_registry_executable dt_inc NULL
dt desktop\scripts nmake - u dt_scripts dt_inc NULL
-dt desktop\util nmake - all dt_util dt_app dt_so_comp dt_spl dt_wrapper.w dt_officeloader.w dt_officeloader_unx.u dt_migr NULL
+dt desktop\util nmake - all dt_util dt_app dt_so_comp dt_spl dt_wrapper.w dt_officeloader.w dt_officeloader_unx.u dt_migr dt_rebase.w NULL
dt desktop\zipintro nmake - all dt_zipintro NULL
diff --git a/desktop/prj/d.lst b/desktop/prj/d.lst
index 78897216c3..eb0d93886e 100644
--- a/desktop/prj/d.lst
+++ b/desktop/prj/d.lst
@@ -82,6 +82,8 @@ mkdir: %_DEST%\bin%_EXT%\odf4ms
..\%__SRC%\bin\unopkga*.dll %_DEST%\bin%_EXT%\unopkga*.dll
..\%__SRC%\lib\libunopkgapp.dylib %_DEST%\lib%_EXT%\libunopkgapp.dylib
..\%__SRC%\lib\libunopkgapp.so %_DEST%\lib%_EXT%\libunopkgapp.so
+..\%__SRC%\bin\rebasegui.exe %_DEST%\bin%_EXT%\rebasegui.exe
+..\%__SRC%\bin\rebaseoo.exe %_DEST%\bin%_EXT%\rebaseoo.exe
..\%__SRC%\bin\pagein %_DEST%\bin%_EXT%\pagein
..\%__SRC%\misc\pagein-* %_DEST%\bin%_EXT%\pagein-*
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index b306b5c653..cc32947f0f 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -1387,6 +1387,10 @@ void Desktop::Main()
tools::InitTestToolLib();
RTL_LOGFILE_CONTEXT_TRACE( aLog, "} tools::InitTestToolLib" );
+ bool bAbort = CheckExtensionDependencies();
+ if ( bAbort )
+ return;
+
// First Start Wizard allowed ?
if ( ! pCmdLineArgs->IsNoFirstStartWizard())
{
diff --git a/desktop/source/app/check_ext_deps.cxx b/desktop/source/app/check_ext_deps.cxx
new file mode 100644
index 0000000000..f61f577694
--- /dev/null
+++ b/desktop/source/app/check_ext_deps.cxx
@@ -0,0 +1,256 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2009 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.
+ *
+ ************************************************************************/
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_desktop.hxx"
+
+#include <rtl/bootstrap.hxx>
+#include <rtl/ustring.hxx>
+#include <unotools/configmgr.hxx>
+
+#include <comphelper/processfactory.hxx>
+#include <comphelper/sequence.hxx>
+#include <cppuhelper/bootstrap.hxx>
+
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/beans/NamedValue.hpp>
+#include "com/sun/star/deployment/XPackage.hpp"
+#include "com/sun/star/deployment/XPackageManager.hpp"
+#include "com/sun/star/deployment/thePackageManagerFactory.hpp"
+#include <com/sun/star/task/XJob.hpp>
+#include <com/sun/star/task/XJobExecutor.hpp>
+#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
+#include <com/sun/star/util/XChangesBatch.hpp>
+
+#include "app.hxx"
+
+using rtl::OUString;
+using namespace desktop;
+using namespace com::sun::star;
+
+#define UNISTRING(s) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s))
+
+static const OUString sConfigSrvc( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationProvider" ) );
+static const OUString sAccessSrvc( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationUpdateAccess" ) );
+
+//------------------------------------------------------------------------------
+static sal_Int16 impl_showExtensionDialog( uno::Reference< uno::XComponentContext > &xContext )
+{
+ rtl::OUString sServiceName = UNISTRING("com.sun.star.deployment.ui.UpdateRequiredDialog");
+ uno::Reference< uno::XInterface > xService;
+ sal_Int16 nRet = 0;
+
+ uno::Reference< lang::XMultiComponentFactory > xServiceManager( xContext->getServiceManager() );
+ if( !xServiceManager.is() )
+ throw uno::RuntimeException(
+ UNISTRING( "impl_showExtensionDialog(): unable to obtain service manager from component context" ), uno::Reference< uno::XInterface > () );
+
+ xService = xServiceManager->createInstanceWithContext( sServiceName, xContext );
+ uno::Reference< ui::dialogs::XExecutableDialog > xExecuteable( xService, uno::UNO_QUERY );
+ if ( xExecuteable.is() )
+ nRet = xExecuteable->execute();
+
+ return nRet;
+}
+
+//------------------------------------------------------------------------------
+// Check dependencies of all packages
+//------------------------------------------------------------------------------
+static bool impl_checkDependencies( const uno::Reference< deployment::XPackageManager > &xPackageManager )
+{
+ uno::Sequence< uno::Reference< deployment::XPackage > > packages;
+
+ try {
+ packages = xPackageManager->getDeployedPackages( uno::Reference< task::XAbortChannel >(),
+ uno::Reference< ucb::XCommandEnvironment >() );
+ }
+ catch ( deployment::DeploymentException & ) { /* handleGeneralError(e.Cause);*/ }
+ catch ( ucb::CommandFailedException & ) { /* handleGeneralError(e.Reason);*/ }
+ catch ( ucb::CommandAbortedException & ) {}
+ catch ( lang::IllegalArgumentException & e ) {
+ throw uno::RuntimeException( e.Message, e.Context );
+ }
+
+ for ( sal_Int32 i = 0; i < packages.getLength(); ++i )
+ {
+ bool bRegistered = false;
+ try {
+ beans::Optional< beans::Ambiguous< sal_Bool > > option( packages[i]->isRegistered( uno::Reference< task::XAbortChannel >(),
+ uno::Reference< ucb::XCommandEnvironment >() ) );
+ if ( option.IsPresent )
+ {
+ ::beans::Ambiguous< sal_Bool > const & reg = option.Value;
+ if ( reg.IsAmbiguous )
+ bRegistered = false;
+ else
+ bRegistered = reg.Value ? true : false;
+ }
+ else
+ bRegistered = false;
+ }
+ catch ( uno::RuntimeException & ) { throw; }
+ catch ( uno::Exception & exc) {
+ (void) exc;
+ OSL_ENSURE( 0, ::rtl::OUStringToOString( exc.Message, RTL_TEXTENCODING_UTF8 ).getStr() );
+ bRegistered = false;
+ }
+
+ if ( bRegistered )
+ {
+ bool bDependenciesValid = false;
+ try {
+ bDependenciesValid = packages[i]->checkDependencies( uno::Reference< ucb::XCommandEnvironment >() );
+ }
+ catch ( deployment::DeploymentException & ) {}
+ if ( ! bDependenciesValid )
+ {
+ return false;
+ }
+ }
+ }
+ return true;
+}
+
+//------------------------------------------------------------------------------
+// resets the 'check needed' flag (needed, if aborted)
+//------------------------------------------------------------------------------
+static void impl_setNeedsCompatCheck()
+{
+ try {
+ Reference < XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory();
+ // get configuration provider
+ Reference< XMultiServiceFactory > theConfigProvider = Reference< XMultiServiceFactory >(
+ xFactory->createInstance(sConfigSrvc), UNO_QUERY_THROW);
+
+ Sequence< Any > theArgs(1);
+ beans::NamedValue v( OUString::createFromAscii("NodePath"),
+ makeAny( OUString::createFromAscii("org.openoffice.Setup/Office") ) );
+ theArgs[0] <<= v;
+ Reference< beans::XPropertySet > pset = Reference< beans::XPropertySet >(
+ theConfigProvider->createInstanceWithArguments( sAccessSrvc, theArgs ), UNO_QUERY_THROW );
+
+ Any value = makeAny( OUString::createFromAscii("never") );
+
+ pset->setPropertyValue( OUString::createFromAscii("LastCompatibilityCheckID"), value );
+ Reference< util::XChangesBatch >( pset, UNO_QUERY_THROW )->commitChanges();
+ }
+ catch (const Exception&) {}
+}
+
+//------------------------------------------------------------------------------
+static bool impl_check()
+{
+ uno::Reference< uno::XComponentContext > xContext = comphelper_getProcessComponentContext();
+ uno::Reference< deployment::XPackageManager > xManager;
+ bool bDependenciesValid = true;
+
+ try {
+ xManager = deployment::thePackageManagerFactory::get( xContext )->getPackageManager( UNISTRING("user") );
+ }
+ catch ( ucb::CommandFailedException & ){}
+ catch ( uno::RuntimeException & ) {}
+
+ if ( xManager.is() )
+ bDependenciesValid = impl_checkDependencies( xManager );
+
+ if ( bDependenciesValid )
+ {
+ try {
+ xManager = deployment::thePackageManagerFactory::get( xContext )->getPackageManager( UNISTRING("shared") );
+ }
+ catch ( ucb::CommandFailedException & ){}
+ catch ( uno::RuntimeException & ) {}
+
+ if ( xManager.is() )
+ bDependenciesValid = impl_checkDependencies( xManager );
+ }
+
+ short nRet = 0;
+ if ( !bDependenciesValid )
+ nRet = impl_showExtensionDialog( xContext );
+
+ if ( nRet == -1 )
+ {
+ impl_setNeedsCompatCheck();
+ return true;
+ }
+ else
+ return false;
+}
+
+//------------------------------------------------------------------------------
+// to check, if we need checking the dependencies of the extensions again, we compare
+// the build id of the office with the one of the last check
+//------------------------------------------------------------------------------
+static bool impl_needsCompatCheck()
+{
+ bool bNeedsCheck = false;
+ rtl::OUString aLastCheckBuildID;
+ rtl::OUString aCurrentBuildID( UNISTRING( "${$OOO_BASE_DIR/program/" SAL_CONFIGFILE("version") ":buildid}" ) );
+ rtl::Bootstrap::expandMacros( aCurrentBuildID );
+
+ try {
+ Reference < XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory();
+ // get configuration provider
+ Reference< XMultiServiceFactory > theConfigProvider = Reference< XMultiServiceFactory >(
+ xFactory->createInstance(sConfigSrvc), UNO_QUERY_THROW);
+
+ Sequence< Any > theArgs(1);
+ beans::NamedValue v( OUString::createFromAscii("NodePath"),
+ makeAny( OUString::createFromAscii("org.openoffice.Setup/Office") ) );
+ theArgs[0] <<= v;
+ Reference< beans::XPropertySet > pset = Reference< beans::XPropertySet >(
+ theConfigProvider->createInstanceWithArguments( sAccessSrvc, theArgs ), UNO_QUERY_THROW );
+
+ Any result = pset->getPropertyValue( OUString::createFromAscii("LastCompatibilityCheckID") );
+
+ result >>= aLastCheckBuildID;
+ if ( aLastCheckBuildID != aCurrentBuildID )
+ {
+ bNeedsCheck = true;
+ result <<= aCurrentBuildID;
+ pset->setPropertyValue( OUString::createFromAscii("LastCompatibilityCheckID"), result );
+ Reference< util::XChangesBatch >( pset, UNO_QUERY_THROW )->commitChanges();
+ }
+ }
+ catch (const Exception&) {}
+
+ return bNeedsCheck;
+}
+
+//------------------------------------------------------------------------------
+// Do we need to check the dependencies of the extensions?
+// When there are unresolved issues, we can't continue with startup
+sal_Bool Desktop::CheckExtensionDependencies()
+{
+ sal_Bool bAbort = false;
+
+ if ( impl_needsCompatCheck() )
+ bAbort = impl_check();
+
+ return bAbort;
+}
+
diff --git a/desktop/source/app/makefile.mk b/desktop/source/app/makefile.mk
index 18c2170d3f..36993bfdf3 100644
--- a/desktop/source/app/makefile.mk
+++ b/desktop/source/app/makefile.mk
@@ -56,6 +56,7 @@ SHL1OBJS = \
$(SLO)$/appsys.obj \
$(SLO)$/cfgfilter.obj \
$(SLO)$/checkinstall.obj \
+ $(SLO)$/check_ext_deps.obj \
$(SLO)$/cmdlineargs.obj \
$(SLO)$/cmdlinehelp.obj \
$(SLO)$/configinit.obj \
diff --git a/desktop/source/deployment/gui/dp_gui.h b/desktop/source/deployment/gui/dp_gui.h
index 1a41fdf169..cf4bcb9343 100644
--- a/desktop/source/deployment/gui/dp_gui.h
+++ b/desktop/source/deployment/gui/dp_gui.h
@@ -82,6 +82,7 @@ enum PackageState { REGISTERED, NOT_REGISTERED, AMBIGUOUS, NOT_AVAILABLE };
class SelectedPackage: public salhelper::SimpleReferenceObject {
public:
+ SelectedPackage() {}
SelectedPackage( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage> &xPackage,
const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager> &xPackageManager )
: m_xPackage( xPackage ),
diff --git a/desktop/source/deployment/gui/dp_gui.hrc b/desktop/source/deployment/gui/dp_gui.hrc
index fae3b16df6..9a3e294c04 100644
--- a/desktop/source/deployment/gui/dp_gui.hrc
+++ b/desktop/source/deployment/gui/dp_gui.hrc
@@ -32,7 +32,8 @@
#include "helpid.hrc"
// Package Manager Dialog:
-#define RID_DLG_PACKAGE_MANAGER RID_DEPLOYMENT_GUI_START
+#define RID_DLG_EXTENSION_MANAGER RID_DEPLOYMENT_GUI_START
+#define RID_DLG_UPDATE_REQUIRED (RID_DEPLOYMENT_GUI_START + 11)
#define RID_EM_BTN_CLOSE 10
#define RID_EM_BTN_HELP 11
@@ -42,27 +43,9 @@
#define RID_EM_BTN_CANCEL 15
#define RID_EM_FT_GET_EXTENSIONS 20
#define RID_EM_FT_PROGRESS 21
+#define RID_EM_FT_MSG 22
// local RIDs:
-#define RID_FT_PACKAGES 5
-
-#define RID_BTN_CLOSE 10
-#define RID_BTN_HELP 11
-
-#define RID_BTN_ADD 20
-#define RID_BTN_REMOVE 21
-#define RID_BTN_ENABLE 22
-#define RID_BTN_DISABLE 23
-#define RID_BTN_EXPORT 24
-#define RID_BTN_CHECK_UPDATES 25
-#define RID_BTN_OPTIONS 26
-#define RID_BTN_GET_EXTENSIONS 27
-
-#define RID_IMG_PLUS 41
-#define RID_IMG_PLUS_HC 42
-#define RID_IMG_MINUS 43
-#define RID_IMG_MINUS_HC 44
-
#define PB_LICENSE_DOWN 50
#define ML_LICENSE 51
#define BTN_LICENSE_DECLINE 53
@@ -145,18 +128,10 @@
#define RID_DLG_UPDATE_NOUPDATE 30
#define RID_DLG_UPDATE_VERSION 31
-#define RID_DLG_EXTENSION_MANAGER (RID_DEPLOYMENT_GUI_START + 6)
-
#define RID_DLG_UPDATEINSTALL (RID_DEPLOYMENT_GUI_START + 20)
#define RID_INFOBOX_UPDATE_SHARED_EXTENSION (RID_DEPLOYMENT_GUI_START + 21)
-#define RID_IMG_DEF_INSTALLATION (RID_DEPLOYMENT_GUI_START+50)
-#define RID_IMG_DEF_INSTALLATION_HC (RID_DEPLOYMENT_GUI_START+51)
-#define RID_IMG_DEF_DOCUMENT (RID_DEPLOYMENT_GUI_START+52)
-#define RID_IMG_DEF_DOCUMENT_HC (RID_DEPLOYMENT_GUI_START+53)
-#define RID_IMG_DEF_PACKAGE (RID_DEPLOYMENT_GUI_START+54)
-#define RID_IMG_DEF_PACKAGE_HC (RID_DEPLOYMENT_GUI_START+55)
#define RID_IMG_WARNING (RID_DEPLOYMENT_GUI_START+56)
#define RID_IMG_WARNING_HC (RID_DEPLOYMENT_GUI_START+57)
#define RID_IMG_LOCKED (RID_DEPLOYMENT_GUI_START+58)
@@ -164,39 +139,26 @@
#define RID_IMG_EXTENSION (RID_DEPLOYMENT_GUI_START+60)
#define RID_IMG_EXTENSION_HC (RID_DEPLOYMENT_GUI_START+61)
-
-#define RID_STR_USER_INSTALLATION (RID_DEPLOYMENT_GUI_START+60)
-#define RID_STR_SHARED_INSTALLATION (RID_DEPLOYMENT_GUI_START+61)
-#define RID_STR_ENABLED (RID_DEPLOYMENT_GUI_START+62)
-#define RID_STR_DISABLED (RID_DEPLOYMENT_GUI_START+63)
-#define RID_STR_UNKNOWN (RID_DEPLOYMENT_GUI_START+64)
-#define RID_STR_PACKAGE (RID_DEPLOYMENT_GUI_START+65)
-#define RID_STR_PACKAGE_STATUS (RID_DEPLOYMENT_GUI_START+66)
-#define RID_STR_EXTENSION_VERSION (RID_DEPLOYMENT_GUI_START+67)
-
-
#define RID_STR_ADD_PACKAGES (RID_DEPLOYMENT_GUI_START+70)
-#define RID_STR_EXPORT_PACKAGE (RID_DEPLOYMENT_GUI_START+71)
-#define RID_STR_EXPORT_PACKAGES (RID_DEPLOYMENT_GUI_START+72)
-
-#define RID_CTX_ITEM_ADD (RID_DEPLOYMENT_GUI_START+80)
-#define RID_CTX_ITEM_REMOVE (RID_DEPLOYMENT_GUI_START+81)
-#define RID_CTX_ITEM_ENABLE (RID_DEPLOYMENT_GUI_START+82)
-#define RID_CTX_ITEM_DISABLE (RID_DEPLOYMENT_GUI_START+83)
-#define RID_CTX_ITEM_EXPORT (RID_DEPLOYMENT_GUI_START+84)
-#define RID_CTX_ITEM_CHECK_UPDATE (RID_DEPLOYMENT_GUI_START+85)
-#define RID_CTX_ITEM_OPTIONS (RID_DEPLOYMENT_GUI_START+86)
-
-#define RID_STR_ADDING_PACKAGES (RID_DEPLOYMENT_GUI_START+90)
-#define RID_STR_REMOVING_PACKAGES (RID_DEPLOYMENT_GUI_START+91)
-#define RID_STR_ENABLING_PACKAGES (RID_DEPLOYMENT_GUI_START+92)
-#define RID_STR_DISABLING_PACKAGES (RID_DEPLOYMENT_GUI_START+93)
-#define RID_STR_EXPORTING_PACKAGES (RID_DEPLOYMENT_GUI_START+94)
-
-#define RID_STR_INSTALL_FOR_ALL (RID_DEPLOYMENT_GUI_START+95)
-#define RID_STR_INSTALL_FOR_ME (RID_DEPLOYMENT_GUI_START+96)
-#define RID_STR_PUBLISHER_LINK (RID_DEPLOYMENT_GUI_START+97)
-#define RID_STR_ERROR_UNKNOWN_STATUS (RID_DEPLOYMENT_GUI_START+98)
+
+#define RID_CTX_ITEM_REMOVE (RID_DEPLOYMENT_GUI_START+80)
+#define RID_CTX_ITEM_ENABLE (RID_DEPLOYMENT_GUI_START+81)
+#define RID_CTX_ITEM_DISABLE (RID_DEPLOYMENT_GUI_START+82)
+#define RID_CTX_ITEM_CHECK_UPDATE (RID_DEPLOYMENT_GUI_START+83)
+#define RID_CTX_ITEM_OPTIONS (RID_DEPLOYMENT_GUI_START+84)
+
+#define RID_STR_ADDING_PACKAGES (RID_DEPLOYMENT_GUI_START+85)
+#define RID_STR_REMOVING_PACKAGES (RID_DEPLOYMENT_GUI_START+86)
+#define RID_STR_ENABLING_PACKAGES (RID_DEPLOYMENT_GUI_START+87)
+#define RID_STR_DISABLING_PACKAGES (RID_DEPLOYMENT_GUI_START+88)
+
+#define RID_STR_INSTALL_FOR_ALL (RID_DEPLOYMENT_GUI_START+90)
+#define RID_STR_INSTALL_FOR_ME (RID_DEPLOYMENT_GUI_START+91)
+#define RID_STR_ERROR_UNKNOWN_STATUS (RID_DEPLOYMENT_GUI_START+92)
+#define RID_STR_CLOSE_BTN (RID_DEPLOYMENT_GUI_START+93)
+#define RID_STR_EXIT_BTN (RID_DEPLOYMENT_GUI_START+94)
+#define RID_STR_NO_ADMIN_PRIVILEGE (RID_DEPLOYMENT_GUI_START+95)
+#define RID_STR_ERROR_MISSING_DEPENDENCIES (RID_DEPLOYMENT_GUI_START+96)
#define WARNINGBOX_CONCURRENTINSTANCE (RID_DEPLOYMENT_GUI_START+100)
diff --git a/desktop/source/deployment/gui/dp_gui_dialog.src b/desktop/source/deployment/gui/dp_gui_dialog.src
index 07bca99ec6..b46d97e02d 100644
--- a/desktop/source/deployment/gui/dp_gui_dialog.src
+++ b/desktop/source/deployment/gui/dp_gui_dialog.src
@@ -30,192 +30,10 @@
#include "svtools/controldims.hrc"
#include "dp_gui.hrc"
-ModelessDialog RID_DLG_PACKAGE_MANAGER
-{
- HelpId = HID_PACKAGE_MANAGER;
- Text [ en-US ] = "Extension Manager";
-
- Size = MAP_APPFONT( 300, 200 );
- OutputSize = TRUE;
- SVLook = TRUE;
- Moveable = TRUE;
- Closeable = TRUE;
- Sizeable = TRUE;
- Hide = TRUE;
-
- FixedText RID_FT_PACKAGES
- {
- Group = TRUE;
- Left = TRUE;
- NoLabel = TRUE;
- Text [ en-US ] = "Browse extensions";
- };
-
- PushButton RID_BTN_ADD
- {
- TabStop = TRUE;
- Text [ en-US ] = "~Add...";
- };
- PushButton RID_BTN_REMOVE
- {
- TabStop = TRUE;
- Text [ en-US ] = "~Remove";
- };
- PushButton RID_BTN_ENABLE
- {
- TabStop = TRUE;
- Text [ en-US ] = "~Enable";
- };
- PushButton RID_BTN_DISABLE
- {
- TabStop = TRUE;
- Text [ en-US ] = "~Disable";
- };
- PushButton RID_BTN_EXPORT
- {
- TabStop = TRUE;
- Text [ en-US ] = "E~xport...";
- };
- PushButton RID_BTN_CHECK_UPDATES
- {
- Disable = TRUE;
- TabStop = TRUE;
- Text [ en-US ] = "~Updates...";
- };
- PushButton RID_BTN_OPTIONS
- {
- Disable = TRUE;
- TabStop = TRUE;
- Text [ en-US ] = "~Options...";
- };
-
-
-
- FixedText RID_BTN_GET_EXTENSIONS
- {
- NoLabel = TRUE;
- TabStop = TRUE;
- Text [ en-US ] = "Get more extensions here...";
- };
-
- OKButton RID_BTN_CLOSE
- {
- TabStop = TRUE;
- DefButton = TRUE;
- Text [ en-US ] = "Close";
- };
- HelpButton RID_BTN_HELP
- {
- TabStop = TRUE;
- };
-
- Image RID_IMG_PLUS
- {
- ImageBitmap = Bitmap { File = "plus.bmp"; };
- MASKCOLOR
- };
-
- Image RID_IMG_PLUS_HC
- {
- ImageBitmap = Bitmap { File = "plus_sch.bmp"; };
- MASKCOLOR
- };
- Image RID_IMG_MINUS
- {
- ImageBitmap = Bitmap { File = "minus.bmp"; };
- MASKCOLOR
- };
- Image RID_IMG_MINUS_HC
- {
- ImageBitmap = Bitmap { File = "minus_sch.bmp"; };
- MASKCOLOR
- };
-};
-
-
-Image RID_IMG_DEF_INSTALLATION
-{
- ImageBitmap = Bitmap { File = "harddisk_16.bmp"; };
- MASKCOLOR
-};
-Image RID_IMG_DEF_INSTALLATION_HC
-{
- ImageBitmap = Bitmap { File = "harddisk_16_h.bmp"; };
- MASKCOLOR
-};
-
-Image RID_IMG_DEF_DOCUMENT
-{
- ImageBitmap = Bitmap { File = "sc05500.bmp"; };
- MASKCOLOR
-};
-Image RID_IMG_DEF_DOCUMENT_HC
-{
- ImageBitmap = Bitmap { File = "sch05500.bmp"; };
- MASKCOLOR
-};
-
-Image RID_IMG_DEF_PACKAGE
-{
- ImageBitmap = Bitmap { File = "puzzleslice_16.bmp"; };
- MASKCOLOR
-};
-Image RID_IMG_DEF_PACKAGE_HC
-{
- ImageBitmap = Bitmap { File = "puzzleslice_16_h.bmp"; };
- MASKCOLOR
-};
-
-
-String RID_STR_USER_INSTALLATION
-{
- Text [ en-US ] = "My Extensions";
-};
-
-String RID_STR_SHARED_INSTALLATION
-{
- Text [ en-US ] = "%PRODUCTNAME Extensions";
-};
-
-String RID_STR_PACKAGE
-{
- Text [ en-US ] = "Extension";
-};
-
-String RID_STR_PACKAGE_STATUS
-{
- Text [ en-US ] = "Status";
-};
-
-String RID_STR_EXTENSION_VERSION
-{
- Text [ en-US ] = "Version";
-};
-
String RID_STR_ADD_PACKAGES
{
Text [ en-US ] = "Add Extension(s)";
};
-
-String RID_STR_ENABLED
-{
- Text [ en-US ] = "Enabled";
-};
-
-String RID_STR_DISABLED
-{
- Text [ en-US ] = "Disabled";
-};
-
-String RID_STR_UNKNOWN
-{
- Text [ en-US ] = "Unknown";
-};
-
-String RID_CTX_ITEM_ADD
-{
- Text [ en-US ] = "~Add...";
-};
String RID_CTX_ITEM_REMOVE
{
Text [ en-US ] = "~Remove";
@@ -228,30 +46,15 @@ String RID_CTX_ITEM_DISABLE
{
Text [ en-US ] = "~Disable";
};
-String RID_CTX_ITEM_EXPORT
-{
- Text [ en-US ] = "E~xport...";
-};
String RID_CTX_ITEM_CHECK_UPDATE
{
Text [ en-US ] = "~Update...";
};
-
String RID_CTX_ITEM_OPTIONS
{
Text [ en-US ] = "~Options...";
};
-String RID_STR_EXPORT_PACKAGE
-{
- Text [ en-US ] = "Export Extension";
-};
-
-String RID_STR_EXPORT_PACKAGES
-{
- Text [ en-US ] = "Export Extensions to...";
-};
-
String RID_STR_ADDING_PACKAGES
{
Text [ en-US ] = "Adding %EXTENSION_NAME";
@@ -272,11 +75,6 @@ String RID_STR_DISABLING_PACKAGES
Text [ en-US ] = "Disabling %EXTENSION_NAME";
};
-String RID_STR_EXPORTING_PACKAGES
-{
- Text [ en-US ] = "Exporting Extension(s)";
-};
-
String RID_STR_INSTALL_FOR_ALL
{
Text [ en-US ] = "~For all users";
@@ -287,14 +85,31 @@ String RID_STR_INSTALL_FOR_ME
Text [ en-US ] = "~Only for me";
};
-String RID_STR_PUBLISHER_LINK
+String RID_STR_ERROR_UNKNOWN_STATUS
{
- Text [ en-US ] = "Publisher";
+ Text [ en-US ] = "Error: The status of this extension is unknown";
};
-String RID_STR_ERROR_UNKNOWN_STATUS
+String RID_STR_CLOSE_BTN
{
- Text [ en-US ] = "Error: The status of this extension is unknown";
+ Text [ en-US ] = "Close";
+};
+
+String RID_STR_EXIT_BTN
+{
+ Text [ en-US ] = "Quit";
+};
+
+String RID_STR_NO_ADMIN_PRIVILEGE
+{
+ Text [ en-US ] = "%PRODUCTNAME has been updated to a new version. "
+ "Some shared %PRODUCTNAME extensions are not compatible with this version and need to be updated before %PRODUCTNAME can be started.\n\n"
+ "Updating of shared extension requires administrator privileges. Contact your system administrator to update the following shared extensions:";
+};
+
+String RID_STR_ERROR_MISSING_DEPENDENCIES
+{
+ Text [ en-US ] = "The extension cannot be enabled as the following system dependencies are not fulfilled:";
};
// Dialog layout
diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
index 7aec6dd9e8..4430b5b444 100644
--- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx
+++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
@@ -36,7 +36,9 @@
#include "svtools/controldims.hrc"
#include "svtools/svtools.hrc"
+#include "dp_gui.h"
#include "dp_gui_dialog2.hxx"
+#include "dp_gui_extlistbox.hxx"
#include "dp_gui_shared.hxx"
#include "dp_gui_theextmgr.hxx"
#include "dp_misc.h"
@@ -55,7 +57,7 @@
#include "comphelper/anytostring.hxx"
#include "cppuhelper/exc_hlp.hxx"
-#include "cppuhelper/implbase1.hxx"
+#include "cppuhelper/bootstrap.hxx"
#include "comphelper/processfactory.hxx"
#include "ucbhelper/content.hxx"
@@ -76,6 +78,8 @@
#include "com/sun/star/uno/Any.hxx"
#include "com/sun/star/uno/XComponentContext.hpp"
+#include "com/sun/star/deployment/thePackageManagerFactory.hpp"
+
#include <map>
#include <vector>
#include <boost/shared_ptr.hpp>
@@ -91,11 +95,7 @@ using ::rtl::OUString;
namespace dp_gui {
#define ICON_OFFSET 50
-#define ICON_HEIGHT 42
-#define SMALL_ICON_SIZE 16
-#define RIGHT_ICON_OFFSET 5
#define TOP_OFFSET 3
-#define SPACE_BETWEEN 3
#define LINE_SIZE 4
#define PROGRESS_WIDTH 60
#define PROGRESS_HEIGHT 14
@@ -113,112 +113,18 @@ struct StrAllFiles : public rtl::StaticWithInit< const OUString, StrAllFiles >
};
//------------------------------------------------------------------------------
-// struct Entry_Impl
-//------------------------------------------------------------------------------
-struct Entry_Impl;
-
-typedef ::boost::shared_ptr< Entry_Impl > TEntry_Impl;
-
-struct Entry_Impl
-{
- bool m_bActive;
- bool m_bLocked;
- bool m_bHasOptions;
- bool m_bShared;
- bool m_bNew;
- bool m_bChecked;
- PackageState m_eState;
- String m_sTitle;
- String m_sVersion;
- String m_sDescription;
- String m_sPublisher;
- String m_sPublisherURL;
- String m_sErrorText;
- Image m_aIcon;
- Image m_aIconHC;
- svt::FixedHyperlink *m_pPublisher;
-
- uno::Reference< deployment::XPackage> m_xPackage;
- uno::Reference< deployment::XPackageManager> m_xPackageManager;
-
- Entry_Impl( const uno::Reference< deployment::XPackage > &xPackage,
- const uno::Reference< deployment::XPackageManager > &xPackageManager,
- PackageState eState );
- ~Entry_Impl();
-
- StringCompare CompareTo( const CollatorWrapper *pCollator, const TEntry_Impl pEntry ) const;
-};
-
-//------------------------------------------------------------------------------
-Entry_Impl::Entry_Impl( const uno::Reference< deployment::XPackage > &xPackage,
- const uno::Reference< deployment::XPackageManager > &xPackageManager,
- PackageState eState ) :
- m_bActive( false ),
- m_bLocked( false ),
- m_bHasOptions( false ),
- m_bShared( false ),
- m_bNew( false ),
- m_bChecked( false ),
- m_eState( eState ),
- m_pPublisher( NULL ),
+UpdateListEntry::UpdateListEntry( const uno::Reference< deployment::XPackage > &xPackage,
+ const uno::Reference< deployment::XPackageManager > &xPackageManager ) :
m_xPackage( xPackage ),
m_xPackageManager( xPackageManager )
-{
- m_sTitle = xPackage->getDisplayName();
- m_sVersion = xPackage->getVersion();
- m_sDescription = xPackage->getDescription();
-
- beans::StringPair aInfo( m_xPackage->getPublisherInfo() );
- m_sPublisher = aInfo.First;
- m_sPublisherURL = aInfo.Second;
-
- // get the icons for the package if there are any
- uno::Reference< graphic::XGraphic > xGraphic = xPackage->getIcon( false );
- if ( xGraphic.is() )
- m_aIcon = Image( xGraphic );
-
- xGraphic = xPackage->getIcon( true );
- if ( xGraphic.is() )
- m_aIconHC = Image( xGraphic );
- else
- m_aIconHC = m_aIcon;
-
- m_bLocked = m_xPackageManager->isReadOnly();
-
- if ( eState == AMBIGUOUS )
- m_sErrorText = ExtMgrDialog::getResourceString( RID_STR_ERROR_UNKNOWN_STATUS );
-}
+{}
//------------------------------------------------------------------------------
-Entry_Impl::~Entry_Impl()
-{
- delete m_pPublisher;
-}
+UpdateListEntry::~UpdateListEntry()
+{}
//------------------------------------------------------------------------------
-StringCompare Entry_Impl::CompareTo( const CollatorWrapper *pCollator, const TEntry_Impl pEntry ) const
-{
- StringCompare eCompare = (StringCompare) pCollator->compareString( m_sTitle, pEntry->m_sTitle );
- if ( eCompare == COMPARE_EQUAL )
- {
- eCompare = m_sVersion.CompareTo( pEntry->m_sVersion );
- if ( eCompare == COMPARE_EQUAL )
- {
- if ( m_xPackageManager != pEntry->m_xPackageManager )
- {
- sal_Int32 nCompare = m_xPackageManager->getContext().compareTo( pEntry->m_xPackageManager->getContext() );
- if ( nCompare < 0 )
- eCompare = COMPARE_LESS;
- else if ( nCompare > 0 )
- eCompare = COMPARE_GREATER;
- }
- }
- }
- return eCompare;
-}
-
-//------------------------------------------------------------------------------
-// ExtensionBox_Impl
+// ExtBoxWithBtns_Impl
//------------------------------------------------------------------------------
enum MENU_COMMAND
@@ -230,63 +136,21 @@ enum MENU_COMMAND
CMD_UPDATE
};
-class ExtensionBox_Impl : public ::svt::IExtensionListBox,
- public ::cppu::WeakImplHelper1< ::com::sun::star::lang::XEventListener >
+class ExtBoxWithBtns_Impl : public ExtensionBox_Impl
{
- bool m_bHasScrollBar;
- bool m_bHasActive;
- bool m_bNeedsRecalc;
- bool m_bHasNew;
- bool m_bInCheckMode;
- bool m_bInterfaceLocked;
- //Must be guarded together with m_vEntries to ensure a valid index at all times.
- //Use m_entriesMutex as guard.
- long m_nActive;
- long m_nTopIndex;
- long m_nStdHeight;
- long m_nActiveHeight;
- long m_nBtnHeight;
Size m_aOutputSize;
- Image m_aLockedImage;
- Image m_aLockedImageHC;
- Image m_aWarningImage;
- Image m_aWarningImageHC;
- Image m_aDefaultImage;
- Image m_aDefaultImageHC;
+ bool m_bInterfaceLocked;
PushButton *m_pOptionsBtn;
PushButton *m_pEnableBtn;
PushButton *m_pRemoveBtn;
- ScrollBar *m_pScrollBar;
-
- ExtMgrDialog *m_pParent;
- TheExtensionManager *m_pManager;
- //This mutex is used for synchronizing access to m_vEntries.
- //Currently it is used to synchronize adding, removing entries and
- //functions like getItemName, getItemDescription, etc. to prevent
- //that m_vEntries is accessed at an invalid index.
- //ToDo: There are many more places where m_vEntries is read and which may
- //fail. For example the Paint method is probable called from the main thread
- //while new entries are added / removed in a separate thread.
- mutable ::osl::Mutex m_entriesMutex;
- std::vector< TEntry_Impl > m_vEntries;
-
- lang::Locale *m_pLocale;
- CollatorWrapper *m_pCollator;
-
- void CalcActiveHeight( const long nPos );
- long GetTotalHeight() const;
- Rectangle GetEntryRect( const long nPos ) const;
+
+ ExtMgrDialog *m_pParent;
+
void SetButtonPos( const Rectangle& rRect );
void SetButtonStatus( const TEntry_Impl pEntry );
- void SetupScrollBar();
- void DrawRow( const Rectangle& rRect, const TEntry_Impl pEntry );
bool HandleTabKey( bool bReverse );
- bool HandleCursorKey( USHORT nKeyCode );
MENU_COMMAND ShowPopupMenu( const Point &rPos, const long nPos );
- void RecalcAll();
- bool FindEntryPos( const TEntry_Impl pEntry, long nStart, long nEnd, long &nFound );
- bool isHCMode();
//-----------------
DECL_DLLPRIVATE_LINK( ScrollHdl, ScrollBar * );
@@ -296,115 +160,29 @@ class ExtensionBox_Impl : public ::svt::IExtensionListBox,
DECL_DLLPRIVATE_LINK( HandleRemoveBtn, void * );
DECL_DLLPRIVATE_LINK( HandleHyperlink, svt::FixedHyperlink * );
- //Index starts with 1.
- //Throws an com::sun::star::lang::IllegalArgumentException, when the index is invalid.
- void checkIndex(sal_Int32 pos) const;
-
-
public:
- ExtensionBox_Impl( ExtMgrDialog* pParent, TheExtensionManager *pManager );
- ~ExtensionBox_Impl();
+ ExtBoxWithBtns_Impl( ExtMgrDialog* pParent, TheExtensionManager *pManager );
+ ~ExtBoxWithBtns_Impl();
virtual void MouseButtonDown( const MouseEvent& rMEvt );
- virtual void Paint( const Rectangle &rPaintRect );
- virtual void Resize();
virtual long Notify( NotifyEvent& rNEvt );
const Size GetMinOutputSizePixel() const;
+ virtual void RecalcAll();
+ virtual void selectEntry( const long nPos );
//-----------------
- long addEntry( const uno::Reference< deployment::XPackage > &xPackage,
- const uno::Reference< deployment::XPackageManager > &xPackageManager );
- void selectEntry( const long nPos );
void enableButtons( bool bEnable );
-
- void updateEntry( const uno::Reference< deployment::XPackage > &xPackage );
-
- void prepareChecking( const uno::Reference< deployment::XPackageManager > &xPackageMgr );
- void checkEntries();
-
- TheExtensionManager* getExtensionManager() const { return m_pManager; }
-
- //===================================================================================
- //These functions are used for automatic testing
-
- /** @return The count of the entries in the list box. */
- virtual sal_Int32 getItemCount() const;
-
- /** @return The index of the first selected entry in the list box.
- When nothing is selected, which is the case when getItemCount returns '0',
- then this function returns EXTENSION_LISTBOX_ENTRY_NOTFOUND */
- virtual sal_Int32 getSelIndex() const;
-
- /** @return The item name of the entry with the given index
- The index starts with 0.
- Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
- virtual OUString getItemName( sal_Int32 index ) const;
-
- /** @return The version string of the entry with the given index
- The index starts with 0.
- Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
- virtual OUString getItemVersion( sal_Int32 index ) const;
-
- /** @return The description string of the entry with the given index
- The index starts with 0.
- Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
- virtual OUString getItemDescription( sal_Int32 index ) const;
-
- /** @return The publisher string of the entry with the given index
- The index starts with 0.
- Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
- virtual ::rtl::OUString getItemPublisher( sal_Int32 index ) const;
-
- /** @return The link behind the publisher text of the entry with the given index
- The index starts with 0.
- Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
- virtual ::rtl::OUString getItemPublisherLink( sal_Int32 index ) const;
-
- /** The entry at the given position will be selected
- Index starts with 0.
- Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
- virtual void select( sal_Int32 pos );
-
- /** The first found entry with the given name will be selected
- When there was no entry found with the name, the selection doesn't change.
- Please note that there might be more than one entry with the same
- name, because:
- 1. the name is not unique
- 2. one extension can be installed as user and shared extension.
- */
- virtual void select( const OUString & sName );
-
- //===================================================================================
- // XEventListener
- virtual void SAL_CALL disposing( ::com::sun::star::lang::EventObject const & evt )
- throw (::com::sun::star::uno::RuntimeException);
};
//------------------------------------------------------------------------------
-ExtensionBox_Impl::ExtensionBox_Impl( ExtMgrDialog* pParent, TheExtensionManager *pManager ) :
- IExtensionListBox( pParent, WB_BORDER | WB_TABSTOP | WB_CHILDDLGCTRL ),
- m_bHasScrollBar( false ),
- m_bHasActive( false ),
- m_bNeedsRecalc( true ),
- m_bHasNew( false ),
- m_bInCheckMode( false ),
+ExtBoxWithBtns_Impl::ExtBoxWithBtns_Impl( ExtMgrDialog* pParent, TheExtensionManager *pManager ) :
+ ExtensionBox_Impl( pParent, pManager ),
m_bInterfaceLocked( false ),
- m_nActive( 0 ),
- m_nTopIndex( 0 ),
- m_nActiveHeight( 0 ),
- m_aLockedImage( ExtMgrDialog::getResId( RID_IMG_LOCKED ) ),
- m_aLockedImageHC( ExtMgrDialog::getResId( RID_IMG_LOCKED_HC ) ),
- m_aWarningImage( ExtMgrDialog::getResId( RID_IMG_WARNING ) ),
- m_aWarningImageHC( ExtMgrDialog::getResId( RID_IMG_WARNING_HC ) ),
- m_aDefaultImage( ExtMgrDialog::getResId( RID_IMG_EXTENSION ) ),
- m_aDefaultImageHC( ExtMgrDialog::getResId( RID_IMG_EXTENSION_HC ) ),
m_pOptionsBtn( NULL ),
m_pEnableBtn( NULL ),
m_pRemoveBtn( NULL ),
- m_pScrollBar( NULL ),
- m_pParent( pParent ),
- m_pManager( pManager )
+ m_pParent( pParent )
{
m_pOptionsBtn = new PushButton( this, WB_TABSTOP );
m_pEnableBtn = new PushButton( this, WB_TABSTOP );
@@ -415,17 +193,13 @@ ExtensionBox_Impl::ExtensionBox_Impl( ExtMgrDialog* pParent, TheExtensionManager
m_pEnableBtn->SetHelpId( HID_EXTENSION_MANAGER_LISTBOX_DISABLE );
m_pRemoveBtn->SetHelpId( HID_EXTENSION_MANAGER_LISTBOX_REMOVE );
- m_pOptionsBtn->SetClickHdl( LINK( this, ExtensionBox_Impl, HandleOptionsBtn ) );
- m_pEnableBtn->SetClickHdl( LINK( this, ExtensionBox_Impl, HandleEnableBtn ) );
- m_pRemoveBtn->SetClickHdl( LINK( this, ExtensionBox_Impl, HandleRemoveBtn ) );
+ m_pOptionsBtn->SetClickHdl( LINK( this, ExtBoxWithBtns_Impl, HandleOptionsBtn ) );
+ m_pEnableBtn->SetClickHdl( LINK( this, ExtBoxWithBtns_Impl, HandleEnableBtn ) );
+ m_pRemoveBtn->SetClickHdl( LINK( this, ExtBoxWithBtns_Impl, HandleRemoveBtn ) );
- m_pScrollBar = new ScrollBar( this, WB_VERT );
- m_pScrollBar->SetScrollHdl( LINK( this, ExtensionBox_Impl, ScrollHdl ) );
- m_pScrollBar->EnableDrag();
-
- m_pOptionsBtn->SetText( ExtMgrDialog::getResourceString( RID_CTX_ITEM_OPTIONS ) );
- m_pEnableBtn->SetText( ExtMgrDialog::getResourceString( RID_CTX_ITEM_DISABLE ) );
- m_pRemoveBtn->SetText( ExtMgrDialog::getResourceString( RID_CTX_ITEM_REMOVE ) );
+ m_pOptionsBtn->SetText( DialogHelper::getResourceString( RID_CTX_ITEM_OPTIONS ) );
+ m_pEnableBtn->SetText( DialogHelper::getResourceString( RID_CTX_ITEM_DISABLE ) );
+ m_pRemoveBtn->SetText( DialogHelper::getResourceString( RID_CTX_ITEM_REMOVE ) );
Size aSize = LogicToPixel( Size( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT ),
MapMode( MAP_APPFONT ) );
@@ -433,288 +207,69 @@ ExtensionBox_Impl::ExtensionBox_Impl( ExtMgrDialog* pParent, TheExtensionManager
m_pEnableBtn->SetSizePixel( aSize );
m_pRemoveBtn->SetSizePixel( aSize );
- SetPaintTransparent( true );
- SetPosPixel( Point( RSC_SP_DLG_INNERBORDER_LEFT, RSC_SP_DLG_INNERBORDER_TOP ) );
- long nIconHeight = 2*TOP_OFFSET + SMALL_ICON_SIZE;
- long nTitleHeight = 2*TOP_OFFSET + GetTextHeight();
- if ( nIconHeight < nTitleHeight )
- m_nStdHeight = nTitleHeight;
- else
- m_nStdHeight = nIconHeight;
- m_nStdHeight += GetTextHeight() + TOP_OFFSET;
+ SetExtraSize( aSize.Height() + 2 * TOP_OFFSET );
- nIconHeight = ICON_HEIGHT + 2*TOP_OFFSET + 1;
- if ( m_nStdHeight < nIconHeight )
- m_nStdHeight = nIconHeight;
-
- m_nActiveHeight = m_nStdHeight;
- m_nBtnHeight = aSize.Height() + 2 * TOP_OFFSET;
-
- const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
- if( IsControlBackground() )
- SetBackground( GetControlBackground() );
- else
- SetBackground( rStyleSettings.GetFieldColor() );
-
- m_pLocale = new lang::Locale( Application::GetSettings().GetLocale() );
- m_pCollator = new CollatorWrapper( ::comphelper::getProcessServiceFactory() );
- m_pCollator->loadDefaultCollator( *m_pLocale, i18n::CollatorOptions::CollatorOptions_IGNORE_CASE );
-
- Show();
+ SetScrollHdl( LINK( this, ExtBoxWithBtns_Impl, ScrollHdl ) );
}
//------------------------------------------------------------------------------
-ExtensionBox_Impl::~ExtensionBox_Impl()
+ExtBoxWithBtns_Impl::~ExtBoxWithBtns_Impl()
{
- typedef std::vector< TEntry_Impl >::iterator ITER;
-
-// for ( ITER iIndex = m_vEntries.begin(); iIndex < m_vEntries.end(); ++iIndex )
-// (*iIndex)->m_xPackage->removeEventListener( this );
-
- m_vEntries.clear();
-
delete m_pOptionsBtn;
delete m_pEnableBtn;
delete m_pRemoveBtn;
- delete m_pScrollBar;
-
- delete m_pLocale;
- delete m_pCollator;
-}
-
-//------------------------------------------------------------------------------
-sal_Int32 ExtensionBox_Impl::getItemCount() const
-{
- return static_cast< sal_Int32 >( m_vEntries.size() );
-}
-
-//------------------------------------------------------------------------------
-sal_Int32 ExtensionBox_Impl::getSelIndex() const
-{
- if ( m_bHasActive )
- {
- OSL_ASSERT( m_nActive >= -1);
- return static_cast< sal_Int32 >( m_nActive );
- }
- else
- return static_cast< sal_Int32 >( EXTENSION_LISTBOX_ENTRY_NOTFOUND );
-}
-
-//------------------------------------------------------------------------------
-void ExtensionBox_Impl::checkIndex( sal_Int32 nIndex ) const
-{
- if ( nIndex < 0 )
- throw lang::IllegalArgumentException( OUSTR("The list index starts with 0"),0, 0 );
- if ( static_cast< sal_uInt32 >( nIndex ) >= m_vEntries.size())
- throw lang::IllegalArgumentException( OUSTR("There is no element at the provided position."
- "The position exceeds the number of available list entries"),0, 0 );
-}
-
-//------------------------------------------------------------------------------
-OUString ExtensionBox_Impl::getItemName( sal_Int32 nIndex ) const
-{
- const ::osl::MutexGuard aGuard( m_entriesMutex );
- checkIndex( nIndex );
- return m_vEntries[ nIndex ]->m_sTitle;
-}
-
-//------------------------------------------------------------------------------
-OUString ExtensionBox_Impl::getItemVersion( sal_Int32 nIndex ) const
-{
- const ::osl::MutexGuard aGuard( m_entriesMutex );
- checkIndex( nIndex );
- return m_vEntries[ nIndex ]->m_sVersion;
-}
-
-//------------------------------------------------------------------------------
-OUString ExtensionBox_Impl::getItemDescription( sal_Int32 nIndex ) const
-{
- const ::osl::MutexGuard aGuard( m_entriesMutex );
- checkIndex( nIndex );
- return m_vEntries[ nIndex ]->m_sDescription;
}
//------------------------------------------------------------------------------
-OUString ExtensionBox_Impl::getItemPublisher( sal_Int32 nIndex ) const
-{
- const ::osl::MutexGuard aGuard( m_entriesMutex );
- checkIndex( nIndex );
- return m_vEntries[ nIndex ]->m_sPublisher;
-}
-
//------------------------------------------------------------------------------
-OUString ExtensionBox_Impl::getItemPublisherLink( sal_Int32 nIndex ) const
-{
- const ::osl::MutexGuard aGuard( m_entriesMutex );
- checkIndex( nIndex );
- return m_vEntries[ nIndex ]->m_sPublisherURL;
-}
-
//------------------------------------------------------------------------------
-void ExtensionBox_Impl::select( sal_Int32 nIndex )
+const Size ExtBoxWithBtns_Impl::GetMinOutputSizePixel() const
{
- const ::osl::MutexGuard aGuard( m_entriesMutex );
- checkIndex( nIndex );
- selectEntry( nIndex );
-}
-
-//------------------------------------------------------------------------------
-void ExtensionBox_Impl::select( const OUString & sName )
-{
- const ::osl::MutexGuard aGuard( m_entriesMutex );
- typedef ::std::vector< TEntry_Impl >::const_iterator It;
-
- for ( It iIter = m_vEntries.begin(); iIter < m_vEntries.end(); iIter++ )
- {
- if ( sName.equals( (*iIter)->m_sTitle ) )
- {
- long nPos = iIter - m_vEntries.begin();
- selectEntry( nPos );
- break;
- }
- }
-}
-
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-// Title + description + buttons height
-void ExtensionBox_Impl::CalcActiveHeight( const long nPos )
-{
- // get title height
- long aTextHeight;
- long nIconHeight = 2*TOP_OFFSET + SMALL_ICON_SIZE;
- long nTitleHeight = 2*TOP_OFFSET + GetTextHeight();
- if ( nIconHeight < nTitleHeight )
- aTextHeight = nTitleHeight;
- else
- aTextHeight = nIconHeight;
-
- // calc description height
- Size aSize = GetOutputSizePixel();
- if ( m_bHasScrollBar )
- aSize.Width() -= m_pScrollBar->GetSizePixel().Width();
-
- aSize.Width() -= ICON_OFFSET;
- aSize.Height() = 10000;
-
- Rectangle aRect = GetTextRect( Rectangle( Point(), aSize ),
- m_vEntries[ nPos ]->m_sDescription,
- TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK );
- aTextHeight += aRect.GetHeight();
-
- if ( aTextHeight < m_nStdHeight )
- aTextHeight = m_nStdHeight;
-
- m_nActiveHeight = aTextHeight + m_nBtnHeight; // button bar height
-}
-
-//------------------------------------------------------------------------------
-const Size ExtensionBox_Impl::GetMinOutputSizePixel() const
-{
- long nHeight = m_nStdHeight;
+ Size aMinSize( ExtensionBox_Impl::GetMinOutputSizePixel() );
+ long nHeight = aMinSize.Height();
nHeight += m_pOptionsBtn->GetSizePixel().Height();
nHeight += 2 * TOP_OFFSET;
long nWidth = m_pOptionsBtn->GetSizePixel().Width();
nWidth *= 3;
- nWidth += 5*TOP_OFFSET;
- nWidth += m_pScrollBar->GetSizePixel().Width();
+ nWidth += 5*TOP_OFFSET + 20;
return Size( nWidth, nHeight );
}
-//------------------------------------------------------------------------------
-Rectangle ExtensionBox_Impl::GetEntryRect( const long nPos ) const
+// -----------------------------------------------------------------------
+void ExtBoxWithBtns_Impl::RecalcAll()
{
- Size aSize( GetOutputSizePixel() );
+ ExtensionBox_Impl::RecalcAll();
- if ( m_bHasScrollBar )
- aSize.Width() -= m_pScrollBar->GetSizePixel().Width();
+ const sal_Int32 nActive = getSelIndex();
- if ( m_vEntries[ nPos ]->m_bActive )
- aSize.Height() = m_nActiveHeight;
+ if ( nActive != EXTENSION_LISTBOX_ENTRY_NOTFOUND )
+ SetButtonPos( GetEntryRect( nActive ) );
else
- aSize.Height() = m_nStdHeight;
-
- Point aPos( 0, -m_nTopIndex + nPos * m_nStdHeight );
- if ( m_bHasActive && ( nPos < m_nActive ) )
- aPos.Y() += m_nActiveHeight - m_nStdHeight;
-
- return Rectangle( aPos, aSize );
+ {
+ m_pOptionsBtn->Hide();
+ m_pEnableBtn->Hide();
+ m_pRemoveBtn->Hide();
+ }
}
+
//------------------------------------------------------------------------------
//This function may be called with nPos < 0
-void ExtensionBox_Impl::selectEntry( long nPos )
+void ExtBoxWithBtns_Impl::selectEntry( const long nPos )
{
- //ToDo whe should not use the guard at such a big scope here.
- //Currently it is used to gard m_vEntries and m_nActive. m_nActive will be
- //modified in this function.
- //It would be probably best to always use a copy of m_vEntries
- //and some other state variables from ExtensionBox_Impl for
- //the whole painting operation. See issue i86993
- ::osl::ClearableMutexGuard guard(m_entriesMutex);
-
- if ( m_bInCheckMode )
+ if ( HasActive() && ( nPos == getSelIndex() ) )
return;
- if ( m_bHasActive )
- {
- if ( nPos == m_nActive )
- return;
+ ExtensionBox_Impl::selectEntry( nPos );
- m_bHasActive = false;
- m_vEntries[ m_nActive ]->m_bActive = false;
-
- if ( IsReallyVisible() )
- Invalidate();
- }
-
- if ( ( nPos >= 0 ) && ( nPos < (long) m_vEntries.size() ) )
+ if ( ( nPos >= 0 ) && ( nPos < GetEntryCount() ) )
{
- m_bHasActive = true;
- m_nActive = nPos;
- m_vEntries[ nPos ]->m_bActive = true;
-
if ( IsReallyVisible() )
{
- Invalidate();
- CalcActiveHeight( nPos );
- SetupScrollBar();
- Rectangle aEntryRect = GetEntryRect( nPos );
-
- // If the top of the selected entry isn't visible, make it visible
- if ( aEntryRect.Top() < 0 )
- {
- m_nTopIndex += aEntryRect.Top();
- aEntryRect.Move( 0, -aEntryRect.Top() );
- }
-
- // If the bottom of the selected entry isn't visible, make it visible even if now the top
- // isn't visible any longer ( the buttons are more important )
- Size aOutputSize = GetOutputSizePixel();
- if ( aEntryRect.Bottom() > aOutputSize.Height() )
- {
- m_nTopIndex += ( aEntryRect.Bottom() - aOutputSize.Height() );
- aEntryRect.Move( 0, -( aEntryRect.Bottom() - aOutputSize.Height() ) );
- }
-
- // If there is unused space below the last entry but all entries don't fit into the box,
- // move the content down to use the whole space
- const long nTotalHeight = GetTotalHeight();
- if ( m_bHasScrollBar && ( aOutputSize.Height() + m_nTopIndex > nTotalHeight ) )
- {
- long nOffset = m_nTopIndex;
- m_nTopIndex = nTotalHeight - aOutputSize.Height();
- nOffset -= m_nTopIndex;
- aEntryRect.Move( 0, nOffset );
- }
-
- if ( m_bHasScrollBar )
- m_pScrollBar->SetThumbPos( m_nTopIndex );
-
- SetButtonPos( aEntryRect );
+ SetButtonPos( GetEntryRect( nPos ) );
}
- SetButtonStatus( m_vEntries[ nPos ] ); //dv
+ SetButtonStatus( GetEntryData( nPos) );
}
else
{
@@ -722,12 +277,10 @@ void ExtensionBox_Impl::selectEntry( long nPos )
m_pEnableBtn->Hide();
m_pRemoveBtn->Hide();
}
- guard.clear();
-
}
// -----------------------------------------------------------------------
-void ExtensionBox_Impl::SetButtonPos( const Rectangle& rRect )
+void ExtBoxWithBtns_Impl::SetButtonPos( const Rectangle& rRect )
{
Size aBtnSize( m_pOptionsBtn->GetSizePixel() );
Point aBtnPos( rRect.Left() + ICON_OFFSET,
@@ -741,20 +294,20 @@ void ExtensionBox_Impl::SetButtonPos( const Rectangle& rRect )
}
// -----------------------------------------------------------------------
-void ExtensionBox_Impl::SetButtonStatus( const TEntry_Impl pEntry )
+void ExtBoxWithBtns_Impl::SetButtonStatus( const TEntry_Impl pEntry )
{
if ( ( pEntry->m_eState == REGISTERED ) || ( pEntry->m_eState == NOT_AVAILABLE ) )
{
- m_pEnableBtn->SetText( ExtMgrDialog::getResourceString( RID_CTX_ITEM_DISABLE ) );
+ m_pEnableBtn->SetText( DialogHelper::getResourceString( RID_CTX_ITEM_DISABLE ) );
m_pEnableBtn->SetHelpId( HID_EXTENSION_MANAGER_LISTBOX_DISABLE );
}
else
{
- m_pEnableBtn->SetText( ExtMgrDialog::getResourceString( RID_CTX_ITEM_ENABLE ) );
+ m_pEnableBtn->SetText( DialogHelper::getResourceString( RID_CTX_ITEM_ENABLE ) );
m_pEnableBtn->SetHelpId( HID_EXTENSION_MANAGER_LISTBOX_ENABLE );
}
- if ( pEntry->m_eState == NOT_AVAILABLE )
+ if ( ( pEntry->m_eState == NOT_AVAILABLE ) || pEntry->m_bMissingDeps )
m_pEnableBtn->Hide();
else
{
@@ -775,183 +328,23 @@ void ExtensionBox_Impl::SetButtonStatus( const TEntry_Impl pEntry )
}
// -----------------------------------------------------------------------
-void ExtensionBox_Impl::DrawRow( const Rectangle& rRect, const TEntry_Impl pEntry )
+bool ExtBoxWithBtns_Impl::HandleTabKey( bool bReverse )
{
- const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
-
- if ( pEntry->m_bActive )
- SetTextColor( rStyleSettings.GetHighlightTextColor() );
- else if ( ( pEntry->m_eState != REGISTERED ) && ( pEntry->m_eState != NOT_AVAILABLE ) )
- SetTextColor( rStyleSettings.GetDisableColor() );
- else if ( IsControlForeground() )
- SetTextColor( GetControlForeground() );
- else
- SetTextColor( rStyleSettings.GetFieldTextColor() );
-
- if ( pEntry->m_bActive )
- {
- SetLineColor();
- SetFillColor( rStyleSettings.GetHighlightColor() );
- DrawRect( rRect );
- }
- else
- {
- if( IsControlBackground() )
- SetBackground( GetControlBackground() );
- else
- SetBackground( rStyleSettings.GetFieldColor() );
+ sal_Int32 nIndex = getSelIndex();
- SetTextFillColor();
- Erase( rRect );
- }
-
- // Draw extension icon
- Point aPos( rRect.TopLeft() );
- aPos += Point( TOP_OFFSET, TOP_OFFSET );
- Image aImage;
- if ( ! pEntry->m_aIcon )
- aImage = isHCMode() ? m_aDefaultImageHC : m_aDefaultImage;
- else
- aImage = isHCMode() ? pEntry->m_aIconHC : pEntry->m_aIcon;
- Size aImageSize = aImage.GetSizePixel();
- if ( ( aImageSize.Width() <= ICON_HEIGHT ) && ( aImageSize.Height() <= ICON_HEIGHT ) )
- DrawImage( Point( aPos.X()+((ICON_HEIGHT-aImageSize.Width())/2), aPos.Y()+((ICON_HEIGHT-aImageSize.Height())/2) ), aImage );
- else
- DrawImage( aPos, Size( ICON_HEIGHT, ICON_HEIGHT ), aImage );
-
- // Setup fonts
- Font aStdFont( GetFont() );
- Font aBoldFont( aStdFont );
- aBoldFont.SetWeight( WEIGHT_BOLD );
- SetFont( aBoldFont );
- long aTextHeight = GetTextHeight();
-
- // Init publisher link here
- if ( !pEntry->m_pPublisher && pEntry->m_sPublisher.Len() )
- {
- pEntry->m_pPublisher = new svt::FixedHyperlink( this );
- pEntry->m_pPublisher->SetBackground();
- pEntry->m_pPublisher->SetPaintTransparent( true );
- pEntry->m_pPublisher->SetURL( pEntry->m_sPublisherURL );
- pEntry->m_pPublisher->SetDescription( pEntry->m_sPublisher );
- Size aSize = FixedText::CalcMinimumTextSize( pEntry->m_pPublisher );
- pEntry->m_pPublisher->SetSizePixel( aSize );
- pEntry->m_pPublisher->SetClickHdl( LINK( this, ExtensionBox_Impl, HandleHyperlink ) );
- }
-
- // Get max title width
- long nMaxTitleWidth = rRect.GetWidth() - ICON_OFFSET;
- nMaxTitleWidth -= ( 2 * SMALL_ICON_SIZE ) + ( 4 * SPACE_BETWEEN );
- if ( pEntry->m_pPublisher )
- {
- nMaxTitleWidth -= pEntry->m_pPublisher->GetSizePixel().Width() + (2*SPACE_BETWEEN);
- }
-
- long aVersionWidth = GetTextWidth( pEntry->m_sVersion );
- long aTitleWidth = GetTextWidth( pEntry->m_sTitle ) + (aTextHeight / 3);
-
- aPos = rRect.TopLeft() + Point( ICON_OFFSET, TOP_OFFSET );
-
- if ( aTitleWidth > nMaxTitleWidth - aVersionWidth )
- {
- aTitleWidth = nMaxTitleWidth - aVersionWidth - (aTextHeight / 3);
- String aShortTitle = GetEllipsisString( pEntry->m_sTitle, aTitleWidth );
- DrawText( aPos, aShortTitle );
- aTitleWidth += (aTextHeight / 3);
- }
- else
- DrawText( aPos, pEntry->m_sTitle );
-
- SetFont( aStdFont );
- DrawText( Point( aPos.X() + aTitleWidth, aPos.Y() ), pEntry->m_sVersion );
-
- long nIconHeight = TOP_OFFSET + SMALL_ICON_SIZE;
- long nTitleHeight = TOP_OFFSET + GetTextHeight();
- if ( nIconHeight < nTitleHeight )
- aTextHeight = nTitleHeight;
- else
- aTextHeight = nIconHeight;
-
- // draw description
- String sDescription;
- if ( pEntry->m_sErrorText.Len() )
- {
- if ( pEntry->m_bActive )
- sDescription = pEntry->m_sErrorText + OUSTR("\n") + pEntry->m_sDescription;
- else
- sDescription = pEntry->m_sErrorText;
- }
- else
- sDescription = pEntry->m_sDescription;
-
- aPos.Y() += aTextHeight;
- if ( pEntry->m_bActive )
- {
- DrawText( Rectangle( aPos.X(), aPos.Y(), rRect.Right(), rRect.Bottom() - m_nBtnHeight ),
- sDescription, TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK );
- }
- else
- {
- const long nWidth = GetTextWidth( sDescription );
- if ( nWidth > rRect.GetWidth() - aPos.X() )
- sDescription = GetEllipsisString( sDescription, rRect.GetWidth() - aPos.X() );
- DrawText( aPos, sDescription );
- }
-
- // Draw publisher link
- if ( pEntry->m_pPublisher )
- {
- pEntry->m_pPublisher->Show();
- aPos = rRect.TopLeft() + Point( ICON_OFFSET + nMaxTitleWidth + (2*SPACE_BETWEEN), TOP_OFFSET );
- pEntry->m_pPublisher->SetPosPixel( aPos );
- }
-
- // Draw status icons
- if ( pEntry->m_bShared )
- {
- aPos = rRect.TopRight() + Point( -(RIGHT_ICON_OFFSET + SMALL_ICON_SIZE), TOP_OFFSET );
- DrawImage( aPos, Size( SMALL_ICON_SIZE, SMALL_ICON_SIZE ), isHCMode() ? m_aLockedImageHC : m_aLockedImage );
- }
- if ( pEntry->m_eState == AMBIGUOUS )
- {
- aPos = rRect.TopRight() + Point( -(RIGHT_ICON_OFFSET + SPACE_BETWEEN + 2*SMALL_ICON_SIZE), TOP_OFFSET );
- DrawImage( aPos, Size( SMALL_ICON_SIZE, SMALL_ICON_SIZE ), isHCMode() ? m_aWarningImageHC : m_aWarningImage );
- }
-
- SetLineColor( Color( COL_LIGHTGRAY ) );
- DrawLine( rRect.BottomLeft(), rRect.BottomRight() );
-}
-
-// -----------------------------------------------------------------------
-void ExtensionBox_Impl::RecalcAll()
-{
- if ( m_bHasActive )
- CalcActiveHeight( m_nActive );
-
- SetupScrollBar();
-
- if ( m_bHasActive )
- SetButtonPos( GetEntryRect( m_nActive ) );
-
- m_bNeedsRecalc = false;
-}
-
-// -----------------------------------------------------------------------
-bool ExtensionBox_Impl::HandleTabKey( bool bReverse )
-{
- if ( ! m_bHasActive )
+ if ( nIndex == EXTENSION_LISTBOX_ENTRY_NOTFOUND )
return false;
PushButton *pNext = NULL;
if ( m_pOptionsBtn->HasFocus() ) {
- if ( !bReverse && !m_vEntries[ m_nActive ]->m_bLocked )
+ if ( !bReverse && !GetEntryData( nIndex )->m_bLocked )
pNext = m_pEnableBtn;
}
else if ( m_pEnableBtn->HasFocus() ) {
if ( !bReverse )
pNext = m_pRemoveBtn;
- else if ( m_vEntries[ m_nActive ]->m_bHasOptions )
+ else if ( GetEntryData( nIndex )->m_bHasOptions )
pNext = m_pOptionsBtn;
}
else if ( m_pRemoveBtn->HasFocus() ) {
@@ -960,14 +353,14 @@ bool ExtensionBox_Impl::HandleTabKey( bool bReverse )
}
else {
if ( !bReverse ) {
- if ( m_vEntries[ m_nActive ]->m_bHasOptions )
+ if ( GetEntryData( nIndex )->m_bHasOptions )
pNext = m_pOptionsBtn;
- else if ( ! m_vEntries[ m_nActive ]->m_bLocked )
+ else if ( ! GetEntryData( nIndex )->m_bLocked )
pNext = m_pEnableBtn;
} else {
- if ( ! m_vEntries[ m_nActive ]->m_bLocked )
+ if ( ! GetEntryData( nIndex )->m_bLocked )
pNext = m_pRemoveBtn;
- else if ( m_vEntries[ m_nActive ]->m_bHasOptions )
+ else if ( GetEntryData( nIndex )->m_bHasOptions )
pNext = m_pOptionsBtn;
}
}
@@ -982,194 +375,67 @@ bool ExtensionBox_Impl::HandleTabKey( bool bReverse )
}
// -----------------------------------------------------------------------
-bool ExtensionBox_Impl::HandleCursorKey( USHORT nKeyCode )
-{
- if ( m_vEntries.empty() )
- return true;
-
- long nSelect = 0;
-
- if ( m_bHasActive )
- {
- long nPageSize = GetOutputSizePixel().Height() / m_nStdHeight;
- if ( nPageSize < 2 )
- nPageSize = 2;
-
- if ( ( nKeyCode == KEY_DOWN ) || ( nKeyCode == KEY_RIGHT ) )
- nSelect = m_nActive + 1;
- else if ( ( nKeyCode == KEY_UP ) || ( nKeyCode == KEY_LEFT ) )
- nSelect = m_nActive - 1;
- else if ( nKeyCode == KEY_HOME )
- nSelect = 0;
- else if ( nKeyCode == KEY_END )
- nSelect = m_vEntries.size() - 1;
- else if ( nKeyCode == KEY_PAGEUP )
- nSelect = m_nActive - nPageSize + 1;
- else if ( nKeyCode == KEY_PAGEDOWN )
- nSelect = m_nActive + nPageSize - 1;
- }
- else // when there is no selected entry, we will select the first or the last.
- {
- if ( ( nKeyCode == KEY_DOWN ) || ( nKeyCode == KEY_PAGEDOWN ) || ( nKeyCode == KEY_HOME ) )
- nSelect = 0;
- else if ( ( nKeyCode == KEY_UP ) || ( nKeyCode == KEY_PAGEUP ) || ( nKeyCode == KEY_END ) )
- nSelect = m_vEntries.size() - 1;
- }
-
- if ( nSelect < 0 )
- nSelect = 0;
- if ( nSelect >= (long) m_vEntries.size() )
- nSelect = m_vEntries.size() - 1;
-
- selectEntry( nSelect );
-
- return true;
-}
-
-// -----------------------------------------------------------------------
-MENU_COMMAND ExtensionBox_Impl::ShowPopupMenu( const Point & rPos, const long nPos )
+MENU_COMMAND ExtBoxWithBtns_Impl::ShowPopupMenu( const Point & rPos, const long nPos )
{
- if ( nPos >= (long) m_vEntries.size() )
+ if ( nPos >= (long) getItemCount() )
return CMD_NONE;
PopupMenu aPopup;
- aPopup.InsertItem( CMD_UPDATE, ExtMgrDialog::getResourceString( RID_CTX_ITEM_CHECK_UPDATE ) );
+ aPopup.InsertItem( CMD_UPDATE, DialogHelper::getResourceString( RID_CTX_ITEM_CHECK_UPDATE ) );
- if ( ! m_vEntries[ nPos ]->m_bLocked )
+ if ( ! GetEntryData( nPos )->m_bLocked )
{
- if ( m_vEntries[ nPos ]->m_eState == REGISTERED )
- aPopup.InsertItem( CMD_DISABLE, ExtMgrDialog::getResourceString( RID_CTX_ITEM_DISABLE ) );
- else if ( m_vEntries[ nPos ]->m_eState != NOT_AVAILABLE )
- aPopup.InsertItem( CMD_ENABLE, ExtMgrDialog::getResourceString( RID_CTX_ITEM_ENABLE ) );
+ if ( GetEntryData( nPos )->m_eState == REGISTERED )
+ aPopup.InsertItem( CMD_DISABLE, DialogHelper::getResourceString( RID_CTX_ITEM_DISABLE ) );
+ else if ( GetEntryData( nPos )->m_eState != NOT_AVAILABLE )
+ aPopup.InsertItem( CMD_ENABLE, DialogHelper::getResourceString( RID_CTX_ITEM_ENABLE ) );
- aPopup.InsertItem( CMD_REMOVE, ExtMgrDialog::getResourceString( RID_CTX_ITEM_REMOVE ) );
+ aPopup.InsertItem( CMD_REMOVE, DialogHelper::getResourceString( RID_CTX_ITEM_REMOVE ) );
}
return (MENU_COMMAND) aPopup.Execute( this, rPos );
}
-// -----------------------------------------------------------------------
-void ExtensionBox_Impl::Paint( const Rectangle &/*rPaintRect*/ )
-{
- if ( m_bNeedsRecalc )
- RecalcAll();
-
- Point aStart( 0, -m_nTopIndex );
- Size aSize( GetOutputSizePixel() );
-
- if ( m_bHasScrollBar )
- aSize.Width() -= m_pScrollBar->GetSizePixel().Width();
-
- typedef std::vector< TEntry_Impl >::iterator ITER;
- for ( ITER iIndex = m_vEntries.begin(); iIndex < m_vEntries.end(); ++iIndex )
- {
- aSize.Height() = (*iIndex)->m_bActive ? m_nActiveHeight : m_nStdHeight;
- Rectangle aEntryRect( aStart, aSize );
-// if ( aEntryRect.IsOver( rPaintRect ) )
- DrawRow( aEntryRect, *iIndex );
- aStart.Y() += aSize.Height();
- }
-}
-
-// -----------------------------------------------------------------------
-long ExtensionBox_Impl::GetTotalHeight() const
-{
- long nHeight = m_vEntries.size() * m_nStdHeight;
-
- if ( m_bHasActive )
- {
- nHeight += m_nActiveHeight - m_nStdHeight;
- }
-
- return nHeight;
-}
-
-// -----------------------------------------------------------------------
-void ExtensionBox_Impl::SetupScrollBar()
-{
- const Size aSize = GetOutputSizePixel();
- const long nScrBarSize = GetSettings().GetStyleSettings().GetScrollBarSize();
- const long nTotalHeight = GetTotalHeight();
- const bool bNeedsScrollBar = ( nTotalHeight > aSize.Height() );
-
- if ( bNeedsScrollBar )
- {
- if ( m_nTopIndex + aSize.Height() > nTotalHeight )
- m_nTopIndex = nTotalHeight - aSize.Height();
-
- m_pScrollBar->SetPosSizePixel( Point( aSize.Width() - nScrBarSize, 0 ),
- Size( nScrBarSize, aSize.Height() ) );
- m_pScrollBar->SetRangeMax( nTotalHeight );
- m_pScrollBar->SetVisibleSize( aSize.Height() );
- m_pScrollBar->SetPageSize( ( aSize.Height() * 4 ) / 5 );
- m_pScrollBar->SetLineSize( m_nStdHeight );
- m_pScrollBar->SetThumbPos( m_nTopIndex );
-
- if ( !m_bHasScrollBar )
- m_pScrollBar->Show();
- }
- else if ( m_bHasScrollBar )
- {
- m_pScrollBar->Hide();
- m_nTopIndex = 0;
- }
-
- m_bHasScrollBar = bNeedsScrollBar;
-}
-
-// -----------------------------------------------------------------------
-void ExtensionBox_Impl::Resize()
-{
- RecalcAll();
-}
-
//------------------------------------------------------------------------------
-void ExtensionBox_Impl::MouseButtonDown( const MouseEvent& rMEvt )
+void ExtBoxWithBtns_Impl::MouseButtonDown( const MouseEvent& rMEvt )
{
if ( m_bInterfaceLocked )
return;
const Point aMousePos( rMEvt.GetPosPixel() );
- long nPos = ( aMousePos.Y() + m_nTopIndex ) / m_nStdHeight;
- if ( m_bHasActive && ( nPos > m_nActive ) )
- {
- if ( aMousePos.Y() + m_nTopIndex <= m_nActive*m_nStdHeight + m_nActiveHeight )
- nPos = m_nActive;
- else
- nPos = ( aMousePos.Y() + m_nTopIndex - (m_nActiveHeight - m_nStdHeight) ) / m_nStdHeight;
- }
+ const long nPos = PointToPos( aMousePos );
if ( rMEvt.IsRight() )
{
switch( ShowPopupMenu( aMousePos, nPos ) )
{
case CMD_NONE: break;
- case CMD_ENABLE: m_pParent->enablePackage( m_vEntries[ nPos ]->m_xPackageManager,
- m_vEntries[ nPos ]->m_xPackage, true );
+ case CMD_ENABLE: m_pParent->enablePackage( GetEntryData( nPos )->m_xPackageManager,
+ GetEntryData( nPos )->m_xPackage, true );
break;
- case CMD_DISABLE: m_pParent->enablePackage( m_vEntries[ nPos ]->m_xPackageManager,
- m_vEntries[ nPos ]->m_xPackage, false );
+ case CMD_DISABLE: m_pParent->enablePackage( GetEntryData( nPos )->m_xPackageManager,
+ GetEntryData( nPos )->m_xPackage, false );
break;
- case CMD_UPDATE: m_pParent->updatePackage( m_vEntries[ nPos ]->m_xPackageManager,
- m_vEntries[ nPos ]->m_xPackage );
+ case CMD_UPDATE: m_pParent->updatePackage( GetEntryData( nPos )->m_xPackageManager,
+ GetEntryData( nPos )->m_xPackage );
break;
- case CMD_REMOVE: m_pParent->removePackage( m_vEntries[ nPos ]->m_xPackageManager,
- m_vEntries[ nPos ]->m_xPackage );
+ case CMD_REMOVE: m_pParent->removePackage( GetEntryData( nPos )->m_xPackageManager,
+ GetEntryData( nPos )->m_xPackage );
break;
}
}
else if ( rMEvt.IsLeft() )
{
- if ( rMEvt.IsMod1() && m_bHasActive )
- selectEntry( m_vEntries.size() ); // Selecting an not existing entry will deselect the current one
+ if ( rMEvt.IsMod1() && HasActive() )
+ selectEntry( EXTENSION_LISTBOX_ENTRY_NOTFOUND ); // Selecting an not existing entry will deselect the current one
else
selectEntry( nPos );
}
}
//------------------------------------------------------------------------------
-long ExtensionBox_Impl::Notify( NotifyEvent& rNEvt )
+long ExtBoxWithBtns_Impl::Notify( NotifyEvent& rNEvt )
{
bool bHandled = false;
@@ -1181,364 +447,259 @@ long ExtensionBox_Impl::Notify( NotifyEvent& rNEvt )
if ( nKeyCode == KEY_TAB )
bHandled = HandleTabKey( aKeyCode.IsShift() );
- else if ( aKeyCode.GetGroup() == KEYGROUP_CURSOR )
- bHandled = HandleCursorKey( nKeyCode );
- }
-
- if ( rNEvt.GetType() == EVENT_COMMAND )
- {
- if ( m_bHasScrollBar &&
- ( rNEvt.GetCommandEvent()->GetCommand() == COMMAND_WHEEL ) )
- {
- const CommandWheelData* pData = rNEvt.GetCommandEvent()->GetWheelData();
- if ( pData->GetMode() == COMMAND_WHEEL_SCROLL )
- {
- long nThumbPos = m_pScrollBar->GetThumbPos();
- if ( pData->GetDelta() < 0 )
- m_pScrollBar->DoScroll( nThumbPos + m_nStdHeight );
- else
- m_pScrollBar->DoScroll( nThumbPos - m_nStdHeight );
- bHandled = true;
- }
- }
}
if ( !bHandled )
- return Control::Notify( rNEvt );
+ return ExtensionBox_Impl::Notify( rNEvt );
else
return true;
}
//------------------------------------------------------------------------------
-bool ExtensionBox_Impl::FindEntryPos( const TEntry_Impl pEntry, const long nStart,
- const long nEnd, long &nPos )
+void ExtBoxWithBtns_Impl::enableButtons( bool bEnable )
{
- nPos = nStart;
- if ( nStart > nEnd )
- return false;
-
- StringCompare eCompare;
+ m_bInterfaceLocked = ! bEnable;
- if ( nStart == nEnd )
+ if ( bEnable )
{
- eCompare = pEntry->CompareTo( m_pCollator, m_vEntries[ nStart ] );
- if ( eCompare == COMPARE_LESS )
- return false;
- else if ( eCompare == COMPARE_EQUAL )
- {
- //Workaround. See i86963.
- if (pEntry->m_xPackage != m_vEntries[nStart]->m_xPackage)
- return false;
-
- if ( m_bInCheckMode )
- m_vEntries[ nStart ]->m_bChecked = true;
- return true;
- }
- else
- {
- nPos = nStart + 1;
- return false;
- }
+ sal_Int32 nIndex = getSelIndex();
+ if ( nIndex != EXTENSION_LISTBOX_ENTRY_NOTFOUND )
+ SetButtonStatus( GetEntryData( nIndex ) );
}
-
- const long nMid = nStart + ( ( nEnd - nStart ) / 2 );
- eCompare = pEntry->CompareTo( m_pCollator, m_vEntries[ nMid ] );
-
- if ( eCompare == COMPARE_LESS )
- return FindEntryPos( pEntry, nStart, nMid-1, nPos );
- else if ( eCompare == COMPARE_GREATER )
- return FindEntryPos( pEntry, nMid+1, nEnd, nPos );
else
{
- //Workaround.See i86963.
- if (pEntry->m_xPackage != m_vEntries[nMid]->m_xPackage)
- return false;
-
- if ( m_bInCheckMode )
- m_vEntries[ nMid ]->m_bChecked = true;
- nPos = nMid;
- return true;
+ m_pOptionsBtn->Enable( false );
+ m_pRemoveBtn->Enable( false );
+ m_pEnableBtn->Enable( false );
}
}
-//------------------------------------------------------------------------------
-long ExtensionBox_Impl::addEntry( const uno::Reference< deployment::XPackage > &xPackage,
- const uno::Reference< deployment::XPackageManager > &xPackageManager )
+// -----------------------------------------------------------------------
+IMPL_LINK( ExtBoxWithBtns_Impl, ScrollHdl, ScrollBar*, pScrBar )
{
- long nPos = 0;
- PackageState eState = m_pManager->getPackageState( xPackage );
+ long nDelta = pScrBar->GetDelta();
+
+ Point aNewOptPt( m_pOptionsBtn->GetPosPixel() - Point( 0, nDelta ) );
+ Point aNewRemPt( m_pRemoveBtn->GetPosPixel() - Point( 0, nDelta ) );
+ Point aNewEnPt( m_pEnableBtn->GetPosPixel() - Point( 0, nDelta ) );
- TEntry_Impl pEntry( new Entry_Impl( xPackage, xPackageManager, eState ) );
- xPackage->addEventListener( this );
+ DoScroll( nDelta );
+
+ m_pOptionsBtn->SetPosPixel( aNewOptPt );
+ m_pRemoveBtn->SetPosPixel( aNewRemPt );
+ m_pEnableBtn->SetPosPixel( aNewEnPt );
- ::osl::ClearableMutexGuard guard(m_entriesMutex);
- if ( m_vEntries.empty() )
- {
- pEntry->m_bHasOptions = m_pManager->supportsOptions( xPackage );
- pEntry->m_bShared = ( m_pManager->getSharedPkgMgr() == xPackageManager );
- pEntry->m_bNew = m_bInCheckMode;
- m_vEntries.push_back( pEntry );
- }
- else
+ return 1;
+}
+
+// -----------------------------------------------------------------------
+IMPL_LINK( ExtBoxWithBtns_Impl, HandleOptionsBtn, void*, EMPTYARG )
+{
+ const sal_Int32 nActive = getSelIndex();
+
+ if ( nActive != EXTENSION_LISTBOX_ENTRY_NOTFOUND )
{
- if ( !FindEntryPos( pEntry, 0, m_vEntries.size()-1, nPos ) )
- {
- pEntry->m_bHasOptions = m_pManager->supportsOptions( xPackage );
- pEntry->m_bShared = ( m_pManager->getSharedPkgMgr() == xPackageManager );
- pEntry->m_bNew = m_bInCheckMode;
- m_vEntries.insert( m_vEntries.begin()+nPos, pEntry );
- }
- else if ( !m_bInCheckMode )
+ SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
+
+ if ( pFact )
{
- OSL_ENSURE( 0, "ExtensionBox_Impl::addEntry(): Will not add duplicate entries" );
+ OUString sExtensionId = GetEntryData( nActive )->m_xPackage->getIdentifier().Value;
+ VclAbstractDialog* pDlg = pFact->CreateOptionsDialog( this, sExtensionId, rtl::OUString() );
+
+ pDlg->Execute();
+
+ delete pDlg;
}
}
- //access to m_nActive must be guarded
- if ( !m_bInCheckMode && m_bHasActive && ( m_nActive >= nPos ) )
- m_nActive += 1;
-
- guard.clear();
- if ( IsReallyVisible() )
- Invalidate();
-
- m_bNeedsRecalc = true;
-
- return nPos;
+ return 1;
}
-//------------------------------------------------------------------------------
-void ExtensionBox_Impl::updateEntry( const uno::Reference< deployment::XPackage > &xPackage )
+// -----------------------------------------------------------------------
+IMPL_LINK( ExtBoxWithBtns_Impl, HandleEnableBtn, void*, EMPTYARG )
{
- typedef std::vector< TEntry_Impl >::iterator ITER;
- for ( ITER iIndex = m_vEntries.begin(); iIndex < m_vEntries.end(); ++iIndex )
+ const sal_Int32 nActive = getSelIndex();
+
+ if ( nActive != EXTENSION_LISTBOX_ENTRY_NOTFOUND )
{
- if ( (*iIndex)->m_xPackage == xPackage )
- {
- PackageState eState = m_pManager->getPackageState( xPackage );
- (*iIndex)->m_bHasOptions = m_pManager->supportsOptions( xPackage );
- (*iIndex)->m_eState = eState;
- (*iIndex)->m_sTitle = xPackage->getDisplayName();
- (*iIndex)->m_sVersion = xPackage->getVersion();
- (*iIndex)->m_sDescription = xPackage->getDescription();
-
- if ( eState == AMBIGUOUS )
- (*iIndex)->m_sErrorText = ExtMgrDialog::getResourceString( RID_STR_ERROR_UNKNOWN_STATUS );
- else
- (*iIndex)->m_sErrorText = String();
+ TEntry_Impl pEntry = GetEntryData( nActive );
+ const bool bEnable( pEntry->m_eState != REGISTERED );
- if ( IsReallyVisible() )
- Invalidate();
- break;
- }
+ m_pParent->enablePackage( pEntry->m_xPackageManager,
+ pEntry->m_xPackage,
+ bEnable );
}
+
+ return 1;
}
-//------------------------------------------------------------------------------
-void ExtensionBox_Impl::prepareChecking( const uno::Reference< deployment::XPackageManager > &xPackageMgr )
+// -----------------------------------------------------------------------
+IMPL_LINK( ExtBoxWithBtns_Impl, HandleRemoveBtn, void*, EMPTYARG )
{
- m_bInCheckMode = true;
- typedef std::vector< TEntry_Impl >::iterator ITER;
- for ( ITER iIndex = m_vEntries.begin(); iIndex < m_vEntries.end(); ++iIndex )
+ const sal_Int32 nActive = getSelIndex();
+
+ if ( nActive != EXTENSION_LISTBOX_ENTRY_NOTFOUND )
{
- if ( (*iIndex)->m_xPackageManager == xPackageMgr )
- (*iIndex)->m_bChecked = false;
- else
- (*iIndex)->m_bChecked = true;
- (*iIndex)->m_bNew = false;
+ TEntry_Impl pEntry = GetEntryData( nActive );
+ m_pParent->removePackage( pEntry->m_xPackageManager,
+ pEntry->m_xPackage );
}
+
+ return 1;
}
//------------------------------------------------------------------------------
-void ExtensionBox_Impl::checkEntries()
+// DialogHelper
+//------------------------------------------------------------------------------
+DialogHelper::DialogHelper( const uno::Reference< uno::XComponentContext > &xContext,
+ Dialog *pWindow ) :
+ m_pVCLWindow( pWindow ),
+ m_nEventID( 0 ),
+ m_bIsBusy( false )
{
- long nNewPos = -1;
- long nPos = 0;
- bool bNeedsUpdate = false;
-
- ::osl::ClearableMutexGuard guard(m_entriesMutex);
- typedef std::vector< TEntry_Impl >::iterator ITER;
- ITER iIndex = m_vEntries.begin();
- while ( iIndex < m_vEntries.end() )
- {
- if ( (*iIndex)->m_bChecked == false )
- {
- bNeedsUpdate = true;
- nPos = iIndex-m_vEntries.begin();
- if ( (*iIndex)->m_bNew )
- {
- if ( nNewPos == - 1)
- nNewPos = nPos;
- if ( nPos <= m_nActive )
- m_nActive += 1;
- }
- }
- iIndex++;
- }
- guard.clear();
+ m_xContext = xContext;
+}
- m_bInCheckMode = false;
+//------------------------------------------------------------------------------
+DialogHelper::~DialogHelper()
+{
+ if ( m_nEventID )
+ Application::RemoveUserEvent( m_nEventID );
+}
- if ( nNewPos != - 1)
- selectEntry( nNewPos );
+//------------------------------------------------------------------------------
+ResId DialogHelper::getResId( USHORT nId )
+{
+ const ::vos::OGuard guard( Application::GetSolarMutex() );
+ return ResId( nId, *DeploymentGuiResMgr::get() );
+}
- if ( bNeedsUpdate )
- {
- m_bNeedsRecalc = true;
- if ( IsReallyVisible() )
- Invalidate();
+//------------------------------------------------------------------------------
+String DialogHelper::getResourceString( USHORT id )
+{
+ // init with non-acquired solar mutex:
+ BrandName::get();
+ const ::vos::OGuard guard( Application::GetSolarMutex() );
+ String ret( ResId( id, *DeploymentGuiResMgr::get() ) );
+ if (ret.SearchAscii( "%PRODUCTNAME" ) != STRING_NOTFOUND) {
+ ret.SearchAndReplaceAllAscii( "%PRODUCTNAME", BrandName::get() );
}
+ return ret;
}
+
//------------------------------------------------------------------------------
-bool ExtensionBox_Impl::isHCMode()
+bool DialogHelper::IsSharedPkgMgr( const uno::Reference< deployment::XPackageManager > &xPackageManager )
{
- return (bool)GetDisplayBackground().GetColor().IsDark();
+ if ( xPackageManager->getContext().equals( OUSTR("shared") ) )
+ return true;
+ else
+ return false;
}
//------------------------------------------------------------------------------
-void ExtensionBox_Impl::enableButtons( bool bEnable )
+bool DialogHelper::continueOnSharedExtension( const uno::Reference< deployment::XPackageManager > &xPackageManager,
+ Window *pParent,
+ const USHORT nResID,
+ bool &bHadWarning )
{
- m_bInterfaceLocked = ! bEnable;
-
- if ( bEnable )
+ if ( !bHadWarning && IsSharedPkgMgr( xPackageManager ) )
{
- if ( m_bHasActive )
- SetButtonStatus( m_vEntries[ m_nActive ] );
+ const ::vos::OGuard guard( Application::GetSolarMutex() );
+ WarningBox aInfoBox( pParent, getResId( nResID ) );
+ String aMsgText = aInfoBox.GetMessText();
+ aMsgText.SearchAndReplaceAllAscii( "%PRODUCTNAME", BrandName::get() );
+ aInfoBox.SetMessText( aMsgText );
+
+ bHadWarning = true;
+
+ if ( RET_OK == aInfoBox.Execute() )
+ return true;
+ else
+ return false;
}
else
- {
- m_pOptionsBtn->Enable( false );
- m_pRemoveBtn->Enable( false );
- m_pEnableBtn->Enable( false );
- }
+ return true;
}
//------------------------------------------------------------------------------
-// XEventListener
-void ExtensionBox_Impl::disposing( lang::EventObject const & rEvt )
- throw ( uno::RuntimeException )
+void DialogHelper::openWebBrowser( const OUString & sURL, const OUString &sTitle ) const
{
- uno::Reference< deployment::XPackage > xPackage( rEvt.Source, uno::UNO_QUERY );
+ if ( ! sURL.getLength() ) // Nothing to do, when the URL is empty
+ return;
- if ( xPackage.is() )
+ try
{
- ::osl::ClearableMutexGuard aGuard( m_entriesMutex );
- typedef std::vector< TEntry_Impl >::iterator ITER;
-
- for ( ITER iIndex = m_vEntries.begin(); iIndex < m_vEntries.end(); ++iIndex )
- {
- if ( (*iIndex)->m_xPackage == xPackage )
- {
- long nPos = iIndex - m_vEntries.begin();
-
- m_vEntries.erase( iIndex );
-
- if ( IsReallyVisible() )
- Invalidate();
-
- if ( m_bHasActive )
- {
- if ( nPos < m_nActive )
- m_nActive -= 1;
- else if ( ( nPos == m_nActive ) &&
- ( nPos == (long) m_vEntries.size() ) )
- m_nActive -= 1;
-
- m_bHasActive = false;
- //clear before calling out of this method
- aGuard.clear();
- selectEntry( m_nActive );
- }
- break;
- }
- }
+ uno::Reference< XSystemShellExecute > xSystemShellExecute(
+ m_xContext->getServiceManager()->createInstanceWithContext( OUSTR( "com.sun.star.system.SystemShellExecute" ), m_xContext), uno::UNO_QUERY_THROW);
+ //throws css::lang::IllegalArgumentException, css::system::SystemShellExecuteException
+ xSystemShellExecute->execute( sURL, OUString(), SystemShellExecuteFlags::DEFAULTS );
+ }
+ catch ( uno::Exception& )
+ {
+ uno::Any exc( ::cppu::getCaughtException() );
+ OUString msg( ::comphelper::anyToString( exc ) );
+ const ::vos::OGuard guard( Application::GetSolarMutex() );
+ ErrorBox aErrorBox( NULL, WB_OK, msg );
+ aErrorBox.SetText( sTitle );
+ aErrorBox.Execute();
}
}
-// -----------------------------------------------------------------------
-IMPL_LINK( ExtensionBox_Impl, ScrollHdl, ScrollBar*, pScrBar )
+//------------------------------------------------------------------------------
+bool DialogHelper::installExtensionWarn( const OUString &rExtensionName ) const
{
- long nDelta = pScrBar->GetDelta();
-
- m_nTopIndex += nDelta;
- Point aNewOptPt( m_pOptionsBtn->GetPosPixel() - Point( 0, nDelta ) );
- Point aNewRemPt( m_pRemoveBtn->GetPosPixel() - Point( 0, nDelta ) );
- Point aNewEnPt( m_pEnableBtn->GetPosPixel() - Point( 0, nDelta ) );
- Point aNewSBPt( m_pScrollBar->GetPosPixel() );
-
- Rectangle aScrRect( Point(), GetOutputSizePixel() );
- aScrRect.Right() -= pScrBar->GetSizePixel().Width();
- Scroll( 0, -nDelta, aScrRect );
+ const ::vos::OGuard guard( Application::GetSolarMutex() );
+ WarningBox aInfo( m_pVCLWindow, getResId( RID_WARNINGBOX_INSTALL_EXTENSION ) );
- m_pOptionsBtn->SetPosPixel( aNewOptPt );
- m_pRemoveBtn->SetPosPixel( aNewRemPt );
- m_pEnableBtn->SetPosPixel( aNewEnPt );
- m_pScrollBar->SetPosPixel( aNewSBPt );
+ String sText( aInfo.GetMessText() );
+ sText.SearchAndReplaceAllAscii( "%NAME", rExtensionName );
+ aInfo.SetMessText( sText );
- return 1;
+ return ( RET_OK == aInfo.Execute() );
}
-// -----------------------------------------------------------------------
-IMPL_LINK( ExtensionBox_Impl, HandleOptionsBtn, void*, EMPTYARG )
+//------------------------------------------------------------------------------
+bool DialogHelper::installForAllUsers( bool &bInstallForAll ) const
{
- if ( m_bHasActive )
- {
- SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
-
- if ( pFact )
- {
- OUString sExtensionId = m_vEntries[ m_nActive ]->m_xPackage->getIdentifier().Value;
- VclAbstractDialog* pDlg = pFact->CreateOptionsDialog( this, sExtensionId, rtl::OUString() );
-
- pDlg->Execute();
-
- delete pDlg;
- }
- }
+ const ::vos::OGuard guard( Application::GetSolarMutex() );
+ QueryBox aQuery( m_pVCLWindow, getResId( RID_QUERYBOX_INSTALL_FOR_ALL ) );
- return 1;
-}
+ String sMsgText = aQuery.GetMessText();
+ sMsgText.SearchAndReplaceAllAscii( "%PRODUCTNAME", BrandName::get() );
+ aQuery.SetMessText( sMsgText );
-// -----------------------------------------------------------------------
-IMPL_LINK( ExtensionBox_Impl, HandleEnableBtn, void*, EMPTYARG )
-{
- if ( m_bHasActive )
- {
- const bool bEnable( m_vEntries[ m_nActive ]->m_eState != REGISTERED );
+ USHORT nYesBtnID = aQuery.GetButtonId( 0 );
+ USHORT nNoBtnID = aQuery.GetButtonId( 1 );
- m_pParent->enablePackage( m_vEntries[ m_nActive ]->m_xPackageManager,
- m_vEntries[ m_nActive ]->m_xPackage,
- bEnable );
- }
+ if ( nYesBtnID != BUTTONDIALOG_BUTTON_NOTFOUND )
+ aQuery.SetButtonText( nYesBtnID, getResourceString( RID_STR_INSTALL_FOR_ME ) );
+ if ( nNoBtnID != BUTTONDIALOG_BUTTON_NOTFOUND )
+ aQuery.SetButtonText( nNoBtnID, getResourceString( RID_STR_INSTALL_FOR_ALL ) );
- return 1;
-}
+ short nRet = aQuery.Execute();
-// -----------------------------------------------------------------------
-IMPL_LINK( ExtensionBox_Impl, HandleRemoveBtn, void*, EMPTYARG )
-{
- if ( m_bHasActive )
- {
- m_pParent->removePackage( m_vEntries[ m_nActive ]->m_xPackageManager,
- m_vEntries[ m_nActive ]->m_xPackage );
- }
+ if ( nRet == RET_CANCEL )
+ return false;
- return 1;
+ bInstallForAll = ( nRet == RET_NO );
+ return true;
}
-// -----------------------------------------------------------------------
-IMPL_LINK( ExtensionBox_Impl, HandleHyperlink, svt::FixedHyperlink*, pHyperlink )
+//------------------------------------------------------------------------------
+void DialogHelper::PostUserEvent( const Link& rLink, void* pCaller )
{
- m_pParent->openWebBrowser( pHyperlink->GetURL() );
- return 1;
-}
+ if ( m_nEventID )
+ Application::RemoveUserEvent( m_nEventID );
+ m_nEventID = Application::PostUserEvent( rLink, pCaller );
+}
//------------------------------------------------------------------------------
// ExtMgrDialog
//------------------------------------------------------------------------------
ExtMgrDialog::ExtMgrDialog( Window *pParent, TheExtensionManager *pManager ) :
ModelessDialog( pParent, getResId( RID_DLG_EXTENSION_MANAGER ) ),
+ DialogHelper( pManager->getContext(), (Dialog*) this ),
m_aAddBtn( this, getResId( RID_EM_BTN_ADD ) ),
m_aUpdateBtn( this, getResId( RID_EM_BTN_CHECK_UPDATES ) ),
m_aCloseBtn( this, getResId( RID_EM_BTN_CLOSE ) ),
@@ -1557,14 +718,14 @@ ExtMgrDialog::ExtMgrDialog( Window *pParent, TheExtensionManager *pManager ) :
m_bEnableWarning( false ),
m_bDisableWarning( false ),
m_bDeleteWarning( false ),
- m_bIsBusy( false ),
m_nProgress( 0 ),
m_pManager( pManager )
{
// free local resources (RID < 256):
FreeResource();
- m_pExtensionBox = new ExtensionBox_Impl( this, pManager );
+ m_pExtensionBox = new ExtBoxWithBtns_Impl( this, pManager );
+ m_pExtensionBox->SetHyperlinkHdl( LINK( this, ExtMgrDialog, HandleHyperlink ) );
m_aAddBtn.SetClickHdl( LINK( this, ExtMgrDialog, HandleAddBtn ) );
m_aUpdateBtn.SetClickHdl( LINK( this, ExtMgrDialog, HandleUpdateBtn ) );
@@ -1608,35 +769,6 @@ ExtMgrDialog::~ExtMgrDialog()
}
//------------------------------------------------------------------------------
-ResId ExtMgrDialog::getResId( USHORT id )
-{
- const ::vos::OGuard guard( Application::GetSolarMutex() );
- return ResId( id, *DeploymentGuiResMgr::get() );
-}
-
-//------------------------------------------------------------------------------
-String ExtMgrDialog::getResourceString( USHORT id )
-{
- // init with non-acquired solar mutex:
- BrandName::get();
- const ::vos::OGuard guard( Application::GetSolarMutex() );
- String ret( ResId( id, *DeploymentGuiResMgr::get() ) );
- if (ret.SearchAscii( "%PRODUCTNAME" ) != STRING_NOTFOUND) {
- ret.SearchAndReplaceAllAscii( "%PRODUCTNAME", BrandName::get() );
- }
- return ret;
-}
-
-//------------------------------------------------------------------------------
-bool ExtMgrDialog::IsSharedPkgMgr( const uno::Reference< deployment::XPackageManager > &xPackageManager )
-{
- if ( xPackageManager->getContext().equals( OUSTR("shared") ) )
- return true;
- else
- return false;
-}
-
-//------------------------------------------------------------------------------
void ExtMgrDialog::selectEntry( long nPos )
{
m_pExtensionBox->selectEntry( nPos );
@@ -1671,96 +803,6 @@ void ExtMgrDialog::checkEntries()
}
//------------------------------------------------------------------------------
-bool ExtMgrDialog::continueOnSharedExtension( const uno::Reference< deployment::XPackageManager > &xPackageManager,
- const USHORT nResID,
- bool &bHadWarning ) const
-{
- if ( IsSharedPkgMgr( xPackageManager ) && !bHadWarning )
- {
- const ::vos::OGuard guard( Application::GetSolarMutex() );
- WarningBox aInfoBox( const_cast< ExtMgrDialog* >(this), getResId( nResID ) );
- String aMsgText = aInfoBox.GetMessText();
- aMsgText.SearchAndReplaceAllAscii( "%PRODUCTNAME", BrandName::get() );
- aInfoBox.SetMessText( aMsgText );
-
- bHadWarning = true;
-
- if ( RET_OK == aInfoBox.Execute() )
- return true;
- else
- return false;
- }
- else
- return true;
-}
-
-//------------------------------------------------------------------------------
-void ExtMgrDialog::openWebBrowser( OUString const & sURL ) const
-{
- if ( ! sURL.getLength() ) // Nothing to do, when the URL is empty
- return;
-
- try
- {
- uno::Reference< uno::XComponentContext > xContext = m_pManager->getContext();
-
- uno::Reference< XSystemShellExecute > xSystemShellExecute(
- xContext->getServiceManager()->createInstanceWithContext( OUSTR( "com.sun.star.system.SystemShellExecute" ), xContext), uno::UNO_QUERY_THROW);
- //throws css::lang::IllegalArgumentException, css::system::SystemShellExecuteException
- xSystemShellExecute->execute( sURL, OUString(), SystemShellExecuteFlags::DEFAULTS );
- }
- catch ( uno::Exception& )
- {
- uno::Any exc( ::cppu::getCaughtException() );
- OUString msg( ::comphelper::anyToString( exc ) );
- const ::vos::OGuard guard( Application::GetSolarMutex() );
- ErrorBox aErrorBox( const_cast< ExtMgrDialog* >(this), WB_OK, msg );
- aErrorBox.SetText( GetText() );
- aErrorBox.Execute();
- }
-}
-
-//------------------------------------------------------------------------------
-bool ExtMgrDialog::installForAllUsers( bool &bInstallForAll ) const
-{
- const ::vos::OGuard guard( Application::GetSolarMutex() );
- QueryBox aQuery( const_cast< ExtMgrDialog* >(this), getResId( RID_QUERYBOX_INSTALL_FOR_ALL ) );
-
- String sMsgText = aQuery.GetMessText();
- sMsgText.SearchAndReplaceAllAscii( "%PRODUCTNAME", BrandName::get() );
- aQuery.SetMessText( sMsgText );
-
- USHORT nYesBtnID = aQuery.GetButtonId( 0 );
- USHORT nNoBtnID = aQuery.GetButtonId( 1 );
-
- if ( nYesBtnID != BUTTONDIALOG_BUTTON_NOTFOUND )
- aQuery.SetButtonText( nYesBtnID, getResourceString( RID_STR_INSTALL_FOR_ME ) );
- if ( nNoBtnID != BUTTONDIALOG_BUTTON_NOTFOUND )
- aQuery.SetButtonText( nNoBtnID, getResourceString( RID_STR_INSTALL_FOR_ALL ) );
-
- short nRet = aQuery.Execute();
-
- if ( nRet == RET_CANCEL )
- return false;
-
- bInstallForAll = ( nRet == RET_NO );
- return true;
-}
-
-//------------------------------------------------------------------------------
-bool ExtMgrDialog::installExtensionWarn( const OUString &rExtensionName ) const
-{
- const ::vos::OGuard guard( Application::GetSolarMutex() );
- WarningBox aInfo( const_cast< ExtMgrDialog* >(this), getResId( RID_WARNINGBOX_INSTALL_EXTENSION ) );
-
- String sText( aInfo.GetMessText() );
- sText.SearchAndReplaceAllAscii( "%NAME", rExtensionName );
- aInfo.SetMessText( sText );
-
- return ( RET_OK == aInfo.Execute() );
-}
-
-//------------------------------------------------------------------------------
bool ExtMgrDialog::removeExtensionWarn( const OUString &rExtensionName ) const
{
const ::vos::OGuard guard( Application::GetSolarMutex() );
@@ -1783,12 +825,12 @@ bool ExtMgrDialog::enablePackage( const uno::Reference< deployment::XPackageMana
if ( bEnable )
{
- if ( ! continueOnSharedExtension( xPackageManager, RID_WARNINGBOX_ENABLE_SHARED_EXTENSION, m_bEnableWarning ) )
+ if ( ! continueOnSharedExtension( xPackageManager, this, RID_WARNINGBOX_ENABLE_SHARED_EXTENSION, m_bEnableWarning ) )
return false;
}
else
{
- if ( ! continueOnSharedExtension( xPackageManager, RID_WARNINGBOX_DISABLE_SHARED_EXTENSION, m_bDisableWarning ) )
+ if ( ! continueOnSharedExtension( xPackageManager, this, RID_WARNINGBOX_DISABLE_SHARED_EXTENSION, m_bDisableWarning ) )
return false;
}
@@ -1810,7 +852,7 @@ bool ExtMgrDialog::removePackage( const uno::Reference< deployment::XPackageMana
return false;
}
- if ( ! continueOnSharedExtension( xPackageManager, RID_WARNINGBOX_REMOVE_SHARED_EXTENSION, m_bDeleteWarning ) )
+ if ( ! continueOnSharedExtension( xPackageManager, this, RID_WARNINGBOX_REMOVE_SHARED_EXTENSION, m_bDeleteWarning ) )
return false;
m_pManager->removePackage( xPackageManager, xPackage );
@@ -1825,7 +867,11 @@ bool ExtMgrDialog::updatePackage( const uno::Reference< deployment::XPackageMana
if ( !xPackageManager.is() || !xPackage.is() )
return false;
- m_pManager->updatePackage( xPackageManager, xPackage );
+ std::vector< TUpdateListEntry > vEntries;
+ TUpdateListEntry pEntry( new UpdateListEntry( xPackage, xPackageManager ) );
+ vEntries.push_back( pEntry );
+
+ m_pManager->updatePackages( vEntries );
return true;
}
@@ -1932,7 +978,7 @@ IMPL_LINK( ExtMgrDialog, startProgress, void*, _bLockInterface )
if ( m_aProgressBar.IsVisible() )
m_aProgressBar.SetValue( 100 );
m_xAbortChannel.clear();
-// bLockInterface = false;
+
OSL_TRACE( " startProgress handler: stop\n" );
}
else
@@ -1945,7 +991,8 @@ IMPL_LINK( ExtMgrDialog, startProgress, void*, _bLockInterface )
m_aUpdateBtn.Enable( !bLockInterface && m_pExtensionBox->getItemCount() );
m_pExtensionBox->enableButtons( !bLockInterface );
-// pCond->set();
+ clearEventID();
+
return 0;
}
@@ -1969,10 +1016,7 @@ void ExtMgrDialog::showProgress( bool _bStart )
OSL_TRACE( "showProgress stop!\n" );
}
- Application::PostUserEvent( LINK( this, ExtMgrDialog, startProgress ), (void*) bStart );
-// ::osl::Condition cond;
-// Application::PostUserEvent( LINK( this, ExtMgrDialog, startProgress ), &cond );
-// cond.wait();
+ DialogHelper::PostUserEvent( LINK( this, ExtMgrDialog, startProgress ), (void*) bStart );
}
// -----------------------------------------------------------------------
@@ -2003,7 +1047,7 @@ void ExtMgrDialog::updatePackageInfo( const uno::Reference< deployment::XPackage
// -----------------------------------------------------------------------
IMPL_LINK( ExtMgrDialog, HandleAddBtn, void*, EMPTYARG )
{
- m_bIsBusy = true;
+ setBusy( true );
uno::Reference< deployment::XPackageManager > xUserPkgMgr = m_pManager->getUserPkgMgr();
uno::Sequence< OUString > aFileList = raiseAddPicker( xUserPkgMgr );
@@ -2013,7 +1057,7 @@ IMPL_LINK( ExtMgrDialog, HandleAddBtn, void*, EMPTYARG )
m_pManager->installPackage( aFileList[0] );
}
- m_bIsBusy = false;
+ setBusy( false );
return 1;
}
@@ -2028,7 +1072,7 @@ IMPL_LINK( ExtMgrDialog, HandleUpdateBtn, void*, EMPTYARG )
// -----------------------------------------------------------------------
IMPL_LINK( ExtMgrDialog, HandleHyperlink, svt::FixedHyperlink*, pHyperlink )
{
- openWebBrowser( pHyperlink->GetURL() );
+ openWebBrowser( pHyperlink->GetURL(), GetText() );
return 1;
}
@@ -2191,6 +1235,554 @@ BOOL ExtMgrDialog::Close()
return bRet;
}
+//------------------------------------------------------------------------------
+// UpdateRequiredDialog
+//------------------------------------------------------------------------------
+UpdateRequiredDialog::UpdateRequiredDialog( Window *pParent, TheExtensionManager *pManager ) :
+ ModalDialog( pParent, getResId( RID_DLG_UPDATE_REQUIRED ) ),
+ DialogHelper( pManager->getContext(), (Dialog*) this ),
+ m_aUpdateNeeded( this, getResId( RID_EM_FT_MSG ) ),
+ m_aUpdateBtn( this, getResId( RID_EM_BTN_CHECK_UPDATES ) ),
+ m_aCloseBtn( this, getResId( RID_EM_BTN_CLOSE ) ),
+ m_aHelpBtn( this, getResId( RID_EM_BTN_HELP ) ),
+ m_aCancelBtn( this, getResId( RID_EM_BTN_CANCEL ) ),
+ m_aDivider( this ),
+ m_aProgressText( this, getResId( RID_EM_FT_PROGRESS ) ),
+ m_aProgressBar( this, WB_BORDER + WB_3DLOOK ),
+ m_sAddPackages( getResourceString( RID_STR_ADD_PACKAGES ) ),
+ m_sCloseText( getResourceString( RID_STR_CLOSE_BTN ) ),
+ m_bHasProgress( false ),
+ m_bProgressChanged( false ),
+ m_bStartProgress( false ),
+ m_bStopProgress( false ),
+ m_bUpdateWarning( false ),
+ m_bDisableWarning( false ),
+ m_bHasLockedEntries( false ),
+ m_nProgress( 0 ),
+ m_pManager( pManager )
+{
+ // free local resources (RID < 256):
+ FreeResource();
+
+ m_pExtensionBox = new ExtensionBox_Impl( this, pManager );
+ m_pExtensionBox->SetHyperlinkHdl( LINK( this, UpdateRequiredDialog, HandleHyperlink ) );
+
+ m_aUpdateBtn.SetClickHdl( LINK( this, UpdateRequiredDialog, HandleUpdateBtn ) );
+ m_aCloseBtn.SetClickHdl( LINK( this, UpdateRequiredDialog, HandleCloseBtn ) );
+ m_aCancelBtn.SetClickHdl( LINK( this, UpdateRequiredDialog, HandleCancelBtn ) );
+
+ String aText = m_aUpdateNeeded.GetText();
+ aText.SearchAndReplaceAllAscii( "%PRODUCTNAME", BrandName::get() );
+ m_aUpdateNeeded.SetText( aText );
+
+ // resize update button
+ Size aBtnSize = m_aUpdateBtn.GetSizePixel();
+ String sTitle = m_aUpdateBtn.GetText();
+ long nWidth = m_aUpdateBtn.GetCtrlTextWidth( sTitle );
+ nWidth += 2 * m_aUpdateBtn.GetTextHeight();
+ if ( nWidth > aBtnSize.Width() )
+ m_aUpdateBtn.SetSizePixel( Size( nWidth, aBtnSize.Height() ) );
+
+ // resize update button
+ aBtnSize = m_aCloseBtn.GetSizePixel();
+ sTitle = m_aCloseBtn.GetText();
+ nWidth = m_aCloseBtn.GetCtrlTextWidth( sTitle );
+ nWidth += 2 * m_aCloseBtn.GetTextHeight();
+ if ( nWidth > aBtnSize.Width() )
+ m_aCloseBtn.SetSizePixel( Size( nWidth, aBtnSize.Height() ) );
+
+ // minimum size:
+ SetMinOutputSizePixel(
+ Size( // width:
+ (5 * m_aHelpBtn.GetSizePixel().Width()) +
+ (5 * RSC_SP_DLG_INNERBORDER_LEFT ),
+ // height:
+ (1 * m_aHelpBtn.GetSizePixel().Height()) +
+ (1 * m_aUpdateNeeded.GetSizePixel().Height()) +
+ (1 * m_pExtensionBox->GetMinOutputSizePixel().Height()) +
+ (3 * RSC_SP_DLG_INNERBORDER_LEFT) ) );
+
+ m_aDivider.Show();
+ m_aProgressBar.Hide();
+ m_aUpdateBtn.Enable( false );
+ m_aCloseBtn.GrabFocus();
+
+ m_aTimeoutTimer.SetTimeout( 50 ); // mSec
+ m_aTimeoutTimer.SetTimeoutHdl( LINK( this, UpdateRequiredDialog, TimeOutHdl ) );
+}
+
+//------------------------------------------------------------------------------
+UpdateRequiredDialog::~UpdateRequiredDialog()
+{
+ m_aTimeoutTimer.Stop();
+
+ delete m_pExtensionBox;
+}
+
+//------------------------------------------------------------------------------
+long UpdateRequiredDialog::addPackageToList( const uno::Reference< deployment::XPackage > &xPackage,
+ const uno::Reference< deployment::XPackageManager > &xPackageManager )
+{
+ // We will only add entries to the list with unsatisfied dependencies
+ if ( !checkDependencies( xPackage ) )
+ {
+ m_bHasLockedEntries |= (bool) xPackageManager->isReadOnly();
+ m_aUpdateBtn.Enable( true );
+ return m_pExtensionBox->addEntry( xPackage, xPackageManager );
+ }
+ return 0;
+}
+
+//------------------------------------------------------------------------------
+void UpdateRequiredDialog::prepareChecking( const uno::Reference< deployment::XPackageManager > &xPackageManager )
+{
+ if ( xPackageManager.is() )
+ m_pExtensionBox->prepareChecking( xPackageManager );
+}
+
+//------------------------------------------------------------------------------
+void UpdateRequiredDialog::checkEntries()
+{
+ const ::vos::OGuard guard( Application::GetSolarMutex() );
+ m_pExtensionBox->checkEntries();
+
+ if ( ! hasActiveEntries() )
+ {
+ m_aCloseBtn.SetText( m_sCloseText );
+ m_aCloseBtn.GrabFocus();
+ }
+}
+
+//------------------------------------------------------------------------------
+bool UpdateRequiredDialog::enablePackage( const uno::Reference< deployment::XPackageManager > &,
+ const uno::Reference< deployment::XPackage > &xPackage,
+ bool bEnable )
+{
+ m_pManager->enablePackage( xPackage, bEnable );
+
+ return true;
+}
+
+//------------------------------------------------------------------------------
+IMPL_LINK( UpdateRequiredDialog, HandleCancelBtn, void*, EMPTYARG )
+{
+ // m_dialog->m_cmdEnv->m_aborted = true;
+ if ( m_xAbortChannel.is() )
+ {
+ try
+ {
+ m_xAbortChannel->sendAbort();
+ }
+ catch ( uno::RuntimeException & )
+ {
+ OSL_ENSURE( 0, "### unexpected RuntimeException!" );
+ }
+ }
+ return 1;
+}
+
+// ------------------------------------------------------------------------------
+IMPL_LINK( UpdateRequiredDialog, startProgress, void*, _bLockInterface )
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+ bool bLockInterface = (bool) _bLockInterface;
+
+ if ( m_bStartProgress && !m_bHasProgress )
+ m_aTimeoutTimer.Start();
+
+ if ( m_bStopProgress )
+ {
+ if ( m_aProgressBar.IsVisible() )
+ m_aProgressBar.SetValue( 100 );
+ m_xAbortChannel.clear();
+ OSL_TRACE( " startProgress handler: stop\n" );
+ }
+ else
+ {
+ OSL_TRACE( " startProgress handler: start\n" );
+ }
+
+ m_aCancelBtn.Enable( bLockInterface );
+ m_aUpdateBtn.Enable( false );
+ clearEventID();
+
+ return 0;
+}
+
+// ------------------------------------------------------------------------------
+void UpdateRequiredDialog::showProgress( bool _bStart )
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ bool bStart = _bStart;
+
+ if ( bStart )
+ {
+ m_nProgress = 0;
+ m_bStartProgress = true;
+ OSL_TRACE( "showProgress start\n" );
+ }
+ else
+ {
+ m_nProgress = 100;
+ m_bStopProgress = true;
+ OSL_TRACE( "showProgress stop!\n" );
+ }
+
+ DialogHelper::PostUserEvent( LINK( this, UpdateRequiredDialog, startProgress ), (void*) bStart );
+}
+
+// -----------------------------------------------------------------------
+void UpdateRequiredDialog::updateProgress( const long nProgress )
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ m_nProgress = nProgress;
+}
+
+// -----------------------------------------------------------------------
+void UpdateRequiredDialog::updateProgress( const OUString &rText,
+ const uno::Reference< task::XAbortChannel > &xAbortChannel)
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ m_xAbortChannel = xAbortChannel;
+ m_sProgressText = rText;
+ m_bProgressChanged = true;
+}
+
+//------------------------------------------------------------------------------
+void UpdateRequiredDialog::updatePackageInfo( const uno::Reference< deployment::XPackage > &xPackage )
+{
+ // We will remove all updated packages with satisfied dependencies, but
+ // we will show all disabled entries so the user sees the result
+ // of the 'disable all' button
+ if ( isEnabled( xPackage ) && checkDependencies( xPackage ) )
+ m_pExtensionBox->removeEntry( xPackage );
+ else
+ m_pExtensionBox->updateEntry( xPackage );
+
+ if ( ! hasActiveEntries() )
+ {
+ m_aCloseBtn.SetText( m_sCloseText );
+ m_aCloseBtn.GrabFocus();
+ }
+}
+
+// -----------------------------------------------------------------------
+IMPL_LINK( UpdateRequiredDialog, HandleUpdateBtn, void*, EMPTYARG )
+{
+ ::osl::ClearableMutexGuard aGuard( m_aMutex );
+
+ std::vector< TUpdateListEntry > vUpdateEntries;
+ sal_Int32 nCount = m_pExtensionBox->GetEntryCount();
+
+ for ( sal_Int32 i = 0; i < nCount; ++i )
+ {
+ TEntry_Impl pEntry = m_pExtensionBox->GetEntryData( i );
+ TUpdateListEntry pUpdateEntry( new UpdateListEntry( pEntry->m_xPackage,
+ pEntry->m_xPackageManager ) );
+ vUpdateEntries.push_back( pUpdateEntry );
+ }
+
+ aGuard.clear();
+
+ m_pManager->updatePackages( vUpdateEntries );
+
+ return 1;
+}
+
+// -----------------------------------------------------------------------
+IMPL_LINK( UpdateRequiredDialog, HandleCloseBtn, void*, EMPTYARG )
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ if ( !isBusy() )
+ {
+ if ( m_bHasLockedEntries )
+ EndDialog( -1 );
+ else if ( hasActiveEntries() )
+ disableAllEntries();
+ else
+ EndDialog( 0 );
+ }
+
+ return 1;
+}
+
+// -----------------------------------------------------------------------
+IMPL_LINK( UpdateRequiredDialog, HandleHyperlink, svt::FixedHyperlink*, pHyperlink )
+{
+ openWebBrowser( pHyperlink->GetURL(), GetText() );
+
+ return 1;
+}
+
+// -----------------------------------------------------------------------
+IMPL_LINK( UpdateRequiredDialog, TimeOutHdl, Timer*, EMPTYARG )
+{
+ if ( m_bStopProgress )
+ {
+ m_bHasProgress = false;
+ m_bStopProgress = false;
+ m_aProgressText.Hide();
+ m_aProgressBar.Hide();
+ m_aCancelBtn.Hide();
+ }
+ else
+ {
+ if ( m_bProgressChanged )
+ {
+ m_bProgressChanged = false;
+ m_aProgressText.SetText( m_sProgressText );
+ }
+
+ if ( m_bStartProgress )
+ {
+ m_bStartProgress = false;
+ m_bHasProgress = true;
+ m_aProgressBar.Show();
+ m_aProgressText.Show();
+ m_aCancelBtn.Enable();
+ m_aCancelBtn.Show();
+ }
+
+ if ( m_aProgressBar.IsVisible() )
+ m_aProgressBar.SetValue( (USHORT) m_nProgress );
+
+ m_aTimeoutTimer.Start();
+ }
+
+ return 1;
+}
+
+//------------------------------------------------------------------------------
+// VCL::Window / Dialog
+void UpdateRequiredDialog::Resize()
+{
+ Size aTotalSize( GetOutputSizePixel() );
+ Size aBtnSize( m_aHelpBtn.GetSizePixel() );
+
+ Point aPos( RSC_SP_DLG_INNERBORDER_LEFT,
+ aTotalSize.Height() - RSC_SP_DLG_INNERBORDER_BOTTOM - aBtnSize.Height() );
+
+ m_aHelpBtn.SetPosPixel( aPos );
+
+ aPos.X() = aTotalSize.Width() - RSC_SP_DLG_INNERBORDER_RIGHT - m_aCloseBtn.GetSizePixel().Width();
+ m_aCloseBtn.SetPosPixel( aPos );
+
+ aPos.X() -= ( RSC_SP_CTRL_X + m_aUpdateBtn.GetSizePixel().Width() );
+ m_aUpdateBtn.SetPosPixel( aPos );
+
+ Size aDivSize( aTotalSize.Width(), LINE_SIZE );
+ aPos = Point( 0, aPos.Y() - LINE_SIZE - RSC_SP_DLG_INNERBORDER_BOTTOM );
+ m_aDivider.SetPosSizePixel( aPos, aDivSize );
+
+ // Calc fixed text size
+ aPos = Point( RSC_SP_DLG_INNERBORDER_LEFT, RSC_SP_DLG_INNERBORDER_TOP );
+ Size aFTSize = m_aUpdateNeeded.CalcMinimumSize( aTotalSize.Width() - RSC_SP_DLG_INNERBORDER_RIGHT - RSC_SP_DLG_INNERBORDER_LEFT );
+ m_aUpdateNeeded.SetPosSizePixel( aPos, aFTSize );
+
+ // Calc list box size
+ Size aSize( aTotalSize.Width() - RSC_SP_DLG_INNERBORDER_LEFT - RSC_SP_DLG_INNERBORDER_RIGHT,
+ aTotalSize.Height() - 2*aBtnSize.Height() - LINE_SIZE -
+ 2*RSC_SP_DLG_INNERBORDER_TOP - 3*RSC_SP_DLG_INNERBORDER_BOTTOM - aFTSize.Height() );
+ aPos.Y() += aFTSize.Height()+RSC_SP_DLG_INNERBORDER_TOP;
+
+ m_pExtensionBox->SetPosSizePixel( aPos, aSize );
+
+ aPos.X() = aTotalSize.Width() - RSC_SP_DLG_INNERBORDER_RIGHT - aBtnSize.Width();
+ aPos.Y() += aSize.Height()+RSC_SP_DLG_INNERBORDER_TOP;
+ m_aCancelBtn.SetPosPixel( aPos );
+
+ // Calc progress height
+ aFTSize = m_aProgressText.GetSizePixel();
+ long nProgressHeight = aFTSize.Height();
+
+ if( IsNativeControlSupported( CTRL_PROGRESS, PART_ENTIRE_CONTROL ) )
+ {
+ ImplControlValue aValue;
+ bool bNativeOK;
+ Region aControlRegion( Rectangle( (const Point&)Point(), m_aProgressBar.GetSizePixel() ) );
+ Region aNativeControlRegion, aNativeContentRegion;
+ if( (bNativeOK = GetNativeControlRegion( CTRL_PROGRESS, PART_ENTIRE_CONTROL, aControlRegion,
+ CTRL_STATE_ENABLED, aValue, rtl::OUString(),
+ aNativeControlRegion, aNativeContentRegion ) ) != FALSE )
+ {
+ nProgressHeight = aNativeControlRegion.GetBoundRect().GetHeight();
+ }
+ }
+
+ if ( nProgressHeight < PROGRESS_HEIGHT )
+ nProgressHeight = PROGRESS_HEIGHT;
+
+ aPos.X() -= ( RSC_SP_CTRL_GROUP_Y + PROGRESS_WIDTH );
+ m_aProgressBar.SetPosSizePixel( Point( aPos.X(), aPos.Y() + ((aBtnSize.Height()-nProgressHeight)/2) ),
+ Size( PROGRESS_WIDTH, nProgressHeight ) );
+
+ aFTSize.Width() = aPos.X() - 2*RSC_SP_DLG_INNERBORDER_LEFT;
+ aPos.X() = RSC_SP_DLG_INNERBORDER_LEFT;
+ aPos.Y() += ( aBtnSize.Height() - aFTSize.Height() - 1 ) / 2;
+ m_aProgressText.SetPosSizePixel( aPos, aFTSize );
+}
+
+//------------------------------------------------------------------------------
+// VCL::Dialog
+short UpdateRequiredDialog::Execute()
+{
+ if ( m_bHasLockedEntries )
+ {
+ // Set other text, disable update btn, remove not shared entries from list;
+ m_aUpdateNeeded.SetText( DialogHelper::getResourceString( RID_STR_NO_ADMIN_PRIVILEGE ) );
+ m_aCloseBtn.SetText( DialogHelper::getResourceString( RID_STR_EXIT_BTN ) );
+ m_aUpdateBtn.Enable( false );
+ m_pExtensionBox->RemoveUnlocked();
+ Resize();
+ }
+
+ return Dialog::Execute();
+}
+
+//------------------------------------------------------------------------------
+// VCL::Dialog
+BOOL UpdateRequiredDialog::Close()
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ if ( !isBusy() )
+ {
+ if ( m_bHasLockedEntries )
+ EndDialog( -1 );
+ else if ( hasActiveEntries() )
+ disableAllEntries();
+ else
+ EndDialog( 0 );
+ }
+
+ return false;
+}
+
+//------------------------------------------------------------------------------
+// Check dependencies of all packages
+//------------------------------------------------------------------------------
+bool UpdateRequiredDialog::isEnabled( const uno::Reference< deployment::XPackage > &xPackage ) const
+{
+ bool bRegistered = false;
+ try {
+ beans::Optional< beans::Ambiguous< sal_Bool > > option( xPackage->isRegistered( uno::Reference< task::XAbortChannel >(),
+ uno::Reference< ucb::XCommandEnvironment >() ) );
+ if ( option.IsPresent )
+ {
+ ::beans::Ambiguous< sal_Bool > const & reg = option.Value;
+ if ( reg.IsAmbiguous )
+ bRegistered = false;
+ else
+ bRegistered = reg.Value ? true : false;
+ }
+ else
+ bRegistered = false;
+ }
+ catch ( uno::RuntimeException & ) { throw; }
+ catch ( uno::Exception & exc) {
+ (void) exc;
+ OSL_ENSURE( 0, ::rtl::OUStringToOString( exc.Message, RTL_TEXTENCODING_UTF8 ).getStr() );
+ bRegistered = false;
+ }
+
+ return bRegistered;
+}
+
+//------------------------------------------------------------------------------
+bool UpdateRequiredDialog::checkDependencies( const uno::Reference< deployment::XPackage > &xPackage ) const
+{
+ if ( isEnabled( xPackage ) )
+ {
+ bool bDependenciesValid = false;
+ try {
+ bDependenciesValid = xPackage->checkDependencies( uno::Reference< ucb::XCommandEnvironment >() );
+ }
+ catch ( deployment::DeploymentException & ) {}
+ if ( ! bDependenciesValid )
+ {
+ return false;
+ }
+ }
+ return true;
+}
+
+//------------------------------------------------------------------------------
+bool UpdateRequiredDialog::hasActiveEntries()
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ bool bRet = false;
+ long nCount = m_pExtensionBox->GetEntryCount();
+ for ( long nIndex = 0; nIndex < nCount; nIndex++ )
+ {
+ TEntry_Impl pEntry = m_pExtensionBox->GetEntryData( nIndex );
+
+ if ( !checkDependencies( pEntry->m_xPackage ) )
+ {
+ bRet = true;
+ break;
+ }
+ }
+
+ return bRet;
+}
+
+//------------------------------------------------------------------------------
+void UpdateRequiredDialog::disableAllEntries()
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ setBusy( true );
+
+ long nCount = m_pExtensionBox->GetEntryCount();
+ for ( long nIndex = 0; nIndex < nCount; nIndex++ )
+ {
+ TEntry_Impl pEntry = m_pExtensionBox->GetEntryData( nIndex );
+ enablePackage( pEntry->m_xPackageManager, pEntry->m_xPackage, false );
+ }
+
+ setBusy( false );
+
+ if ( ! hasActiveEntries() )
+ m_aCloseBtn.SetText( m_sCloseText );
+}
+
+//=================================================================================
+// UpdateRequiredDialogService
+//=================================================================================
+UpdateRequiredDialogService::UpdateRequiredDialogService( uno::Sequence< uno::Any > const&,
+ uno::Reference< uno::XComponentContext > const& xComponentContext )
+ : m_xComponentContext( xComponentContext )
+{
+}
+
+//------------------------------------------------------------------------------
+// XExecutableDialog
+//------------------------------------------------------------------------------
+void UpdateRequiredDialogService::setTitle( OUString const & ) throw ( uno::RuntimeException )
+{
+}
+
+//------------------------------------------------------------------------------
+sal_Int16 UpdateRequiredDialogService::execute() throw ( uno::RuntimeException )
+{
+ ::rtl::Reference< ::dp_gui::TheExtensionManager > xManager( TheExtensionManager::get(
+ m_xComponentContext,
+ uno::Reference< awt::XWindow >(),
+ OUString() ) );
+ xManager->createDialog( true );
+ sal_Int16 nRet = xManager->execute();
+
+ return nRet;
+}
+
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
SelectedPackage::~SelectedPackage() {}
} //namespace dp_gui
diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.hxx b/desktop/source/deployment/gui/dp_gui_dialog2.hxx
index a00183f9da..de8982a7e3 100644
--- a/desktop/source/deployment/gui/dp_gui_dialog2.hxx
+++ b/desktop/source/deployment/gui/dp_gui_dialog2.hxx
@@ -46,20 +46,71 @@
#include "rtl/ref.hxx"
#include "rtl/ustring.hxx"
+#include "cppuhelper/implbase1.hxx"
+
+#include "com/sun/star/awt/XWindow.hpp"
#include "com/sun/star/deployment/XPackage.hpp"
#include "com/sun/star/deployment/XPackageManager.hpp"
+#include "com/sun/star/uno/XComponentContext.hpp"
+#include "com/sun/star/ui/dialogs/XExecutableDialog.hpp"
#include "com/sun/star/util/XModifyListener.hpp"
namespace dp_gui {
//==============================================================================
+class ExtBoxWithBtns_Impl;
class ExtensionBox_Impl;
class TheExtensionManager;
//==============================================================================
-class ExtMgrDialog : public ModelessDialog
+class DialogHelper
{
- ExtensionBox_Impl *m_pExtensionBox;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
+ Dialog* m_pVCLWindow;
+ ULONG m_nEventID;
+ bool m_bIsBusy;
+
+public:
+ DialogHelper( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > &,
+ Dialog *pWindow );
+ virtual ~DialogHelper();
+
+ void openWebBrowser( const ::rtl::OUString & sURL, const ::rtl::OUString & sTitle ) const;
+ Dialog* getWindow() const { return m_pVCLWindow; };
+ void PostUserEvent( const Link& rLink, void* pCaller );
+ void clearEventID() { m_nEventID = 0; }
+
+ virtual void showProgress( bool bStart ) = 0;
+ virtual void updateProgress( const ::rtl::OUString &rText,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::task::XAbortChannel > &xAbortChannel) = 0;
+ virtual void updateProgress( const long nProgress ) = 0;
+
+ virtual void updatePackageInfo( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &xPackage ) = 0;
+ virtual long addPackageToList( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > & ) = 0;
+
+ virtual void prepareChecking( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > &xPackageManager ) = 0;
+ virtual void checkEntries() = 0;
+
+ static ResId getResId( USHORT nId );
+ static String getResourceString( USHORT id );
+ static bool IsSharedPkgMgr( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > &);
+ static bool continueOnSharedExtension( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > &,
+ Window *pParent,
+ const USHORT nResID,
+ bool &bHadWarning );
+
+ void setBusy( const bool bBusy ) { m_bIsBusy = bBusy; }
+ bool isBusy() const { return m_bIsBusy; }
+ bool installExtensionWarn( const ::rtl::OUString &rExtensionURL ) const;
+ bool installForAllUsers( bool &bInstallForAll ) const;
+};
+
+//==============================================================================
+class ExtMgrDialog : public ModelessDialog,
+ public DialogHelper
+{
+ ExtBoxWithBtns_Impl *m_pExtensionBox;
PushButton m_aAddBtn;
PushButton m_aUpdateBtn;
OKButton m_aCloseBtn;
@@ -81,16 +132,12 @@ class ExtMgrDialog : public ModelessDialog
bool m_bEnableWarning;
bool m_bDisableWarning;
bool m_bDeleteWarning;
- bool m_bIsBusy;
long m_nProgress;
Timer m_aTimeoutTimer;
TheExtensionManager *m_pManager;
::com::sun::star::uno::Reference< ::com::sun::star::task::XAbortChannel > m_xAbortChannel;
- bool continueOnSharedExtension( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > &,
- const USHORT nResID,
- bool &bHadWarning ) const;
bool removeExtensionWarn( const ::rtl::OUString &rExtensionTitle ) const;
DECL_DLLPRIVATE_LINK( HandleAddBtn, void * );
@@ -108,9 +155,16 @@ public:
virtual long Notify( NotifyEvent& rNEvt );
virtual BOOL Close();
+ virtual void showProgress( bool bStart );
+ virtual void updateProgress( const ::rtl::OUString &rText,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::task::XAbortChannel > &xAbortChannel);
+ virtual void updateProgress( const long nProgress );
+
+ virtual void updatePackageInfo( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &xPackage );
+
void setGetExtensionsURL( const ::rtl::OUString &rURL );
void selectEntry( long nPos );
- long addPackageToList( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &,
+ virtual long addPackageToList( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &,
const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > & );
bool enablePackage( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > &xPackageManager,
const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &xPackage,
@@ -120,27 +174,102 @@ public:
bool updatePackage( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > &xPackageManager,
const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &xPackage );
- bool isBusy() { return m_bIsBusy; }
+ virtual void prepareChecking( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > &xPackageManager );
+ virtual void checkEntries();
+
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > raiseAddPicker( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > &xPackageManager );
+};
+
+//==============================================================================
+class UpdateRequiredDialog : public ModalDialog,
+ public DialogHelper
+{
+ ExtensionBox_Impl *m_pExtensionBox;
+ FixedText m_aUpdateNeeded;
+ PushButton m_aUpdateBtn;
+ PushButton m_aCloseBtn;
+ HelpButton m_aHelpBtn;
+ CancelButton m_aCancelBtn;
+ FixedLine m_aDivider;
+ FixedText m_aProgressText;
+ ProgressBar m_aProgressBar;
+ const String m_sAddPackages;
+ const String m_sCloseText;
+ String m_sProgressText;
+ ::osl::Mutex m_aMutex;
+ bool m_bHasProgress;
+ bool m_bProgressChanged;
+ bool m_bStartProgress;
+ bool m_bStopProgress;
+ bool m_bUpdateWarning;
+ bool m_bDisableWarning;
+ bool m_bHasLockedEntries;
+ long m_nProgress;
+ Timer m_aTimeoutTimer;
+ TheExtensionManager *m_pManager;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::task::XAbortChannel > m_xAbortChannel;
+
+ DECL_DLLPRIVATE_LINK( HandleUpdateBtn, void * );
+ DECL_DLLPRIVATE_LINK( HandleCloseBtn, void * );
+ DECL_DLLPRIVATE_LINK( HandleCancelBtn, void * );
+ DECL_DLLPRIVATE_LINK( TimeOutHdl, Timer* );
+ DECL_DLLPRIVATE_LINK( startProgress, void * );
+ DECL_DLLPRIVATE_LINK( HandleHyperlink, svt::FixedHyperlink * );
- void showProgress( bool bStart );
- void updateProgress( const ::rtl::OUString &rText,
+ bool isEnabled( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &xPackage ) const;
+ bool checkDependencies( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &xPackage ) const;
+ bool hasActiveEntries();
+ void disableAllEntries();
+
+public:
+ UpdateRequiredDialog( Window * pParent, TheExtensionManager *pManager );
+ virtual ~UpdateRequiredDialog();
+
+ virtual short Execute();
+ virtual void Resize();
+ virtual BOOL Close();
+// virtual long Notify( NotifyEvent& rNEvt );
+
+ virtual void showProgress( bool bStart );
+ virtual void updateProgress( const ::rtl::OUString &rText,
const ::com::sun::star::uno::Reference< ::com::sun::star::task::XAbortChannel > &xAbortChannel);
- void updateProgress( const long nProgress );
- void updatePackageInfo( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &xPackage );
+ virtual void updateProgress( const long nProgress );
- void prepareChecking( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > &xPackageManager );
- void checkEntries();
+ virtual void updatePackageInfo( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &xPackage );
- ::com::sun::star::uno::Sequence< ::rtl::OUString > raiseAddPicker( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > &xPackageManager );
+ void selectEntry( long nPos );
+ virtual long addPackageToList( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > & );
+ bool enablePackage( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > &xPackageManager,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &xPackage,
+ bool bEnable );
+ bool updatePackage( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > &xPackageManager,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &xPackage );
- void openWebBrowser( ::rtl::OUString const &sURL ) const;
+ virtual void prepareChecking( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > &xPackageManager );
+ virtual void checkEntries();
+
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > raiseAddPicker( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > &xPackageManager );
bool installForAllUsers( bool &bInstallForAll ) const;
bool installExtensionWarn( const ::rtl::OUString &rExtensionURL ) const;
+};
- static ResId getResId( USHORT id );
- static String getResourceString( USHORT id );
- static bool IsSharedPkgMgr( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > &);
+//==============================================================================
+class UpdateRequiredDialogService : public ::cppu::WeakImplHelper1< ::com::sun::star::ui::dialogs::XExecutableDialog >
+{
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const m_xComponentContext;
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > m_xParent;
+ ::rtl::OUString m_sInitialTitle;
+
+public:
+ UpdateRequiredDialogService( ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > const & args,
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext> const & xComponentContext );
+
+ // XExecutableDialog
+ virtual void SAL_CALL setTitle( rtl::OUString const & title ) throw ( ::com::sun::star::uno::RuntimeException );
+ virtual sal_Int16 SAL_CALL execute() throw ( ::com::sun::star::uno::RuntimeException );
};
} // namespace dp_gui
diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.src b/desktop/source/deployment/gui/dp_gui_dialog2.src
index 949c396621..bac9299fee 100644
--- a/desktop/source/deployment/gui/dp_gui_dialog2.src
+++ b/desktop/source/deployment/gui/dp_gui_dialog2.src
@@ -97,6 +97,66 @@ ModelessDialog RID_DLG_EXTENSION_MANAGER
};
};
+ModalDialog RID_DLG_UPDATE_REQUIRED
+{
+ HelpId = HID_PACKAGE_MANAGER_UPD_REQ;
+ Text [ en-US ] = "Extension Update Required";
+
+ Size = MAP_APPFONT( 300, 200 );
+ OutputSize = TRUE;
+ SVLook = TRUE;
+ Moveable = TRUE;
+ Closeable = TRUE;
+ Sizeable = TRUE;
+ Hide = TRUE;
+
+ FixedText RID_EM_FT_MSG
+ {
+ Text [ en-US ] = "%PRODUCTNAME has been updated to a new version. Some installed %PRODUCTNAME extensions are not compatible with this version and need to be updated before they can be used.";
+ WordBreak = TRUE;
+ NoLabel = TRUE;
+ Size = MAP_APPFONT( 280, 3*RSC_BS_CHARHEIGHT );
+ Pos = MAP_APPFONT( 5, 5 );
+ };
+
+ FixedText RID_EM_FT_PROGRESS
+ {
+ Hide = TRUE;
+ Right = TRUE;
+ Text [ en-US ] = "Adding %EXTENSION_NAME";
+ Size = MAP_APPFONT(RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_FIXEDTEXT_HEIGHT );
+ };
+
+ HelpButton RID_EM_BTN_HELP
+ {
+ TabStop = TRUE;
+ Size = MAP_APPFONT(RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT );
+ };
+
+ PushButton RID_EM_BTN_CHECK_UPDATES
+ {
+ TabStop = TRUE;
+ Text [ en-US ] = "Check for ~Updates...";
+ Size = MAP_APPFONT(RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT );
+ };
+
+ PushButton RID_EM_BTN_CLOSE
+ {
+ TabStop = TRUE;
+ DefButton = TRUE;
+ Text [ en-US ] = "Disable all";
+ Size = MAP_APPFONT(RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT );
+ };
+
+ CancelButton RID_EM_BTN_CANCEL
+ {
+ TabStop = TRUE;
+ Hide = TRUE;
+ Size = MAP_APPFONT(RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT );
+ };
+
+};
+
Image RID_IMG_WARNING
{
ImageBitmap = Bitmap { File = "caution_16.png"; };
diff --git a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
index c5ad87788d..f31d63a703 100644
--- a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
+++ b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
@@ -136,7 +136,7 @@ class ProgressCmdEnv
uno::Reference< uno::XComponentContext > m_xContext;
uno::Reference< task::XAbortChannel> m_xAbortChannel;
- ExtMgrDialog *m_pDialog;
+ DialogHelper *m_pDialogHelper;
OUString m_sTitle;
bool m_bAborted;
bool m_bWarnUser;
@@ -157,16 +157,16 @@ public:
*/
ProgressCmdEnv( const uno::Reference< uno::XComponentContext > rContext,
- ExtMgrDialog *pDialog,
+ DialogHelper *pDialogHelper,
const OUString &rTitle )
: m_xContext( rContext ),
- m_pDialog( pDialog ),
+ m_pDialogHelper( pDialogHelper ),
m_sTitle( rTitle ),
m_bAborted( false ),
m_bWarnUser( false )
{}
- Dialog * activeDialog() { return m_pDialog; }
+ Dialog * activeDialog() { return m_pDialogHelper->getWindow(); }
void setTitle( const OUString& rNewTitle ) { m_sTitle = rNewTitle; }
void startProgress();
@@ -197,14 +197,14 @@ public:
//------------------------------------------------------------------------------
struct ExtensionCmd
{
- enum E_CMD_TYPE { ADD, ENABLE, DISABLE, REMOVE, CHECK_FOR_UPDATE, CHECK_FOR_UPDATES };
+ enum E_CMD_TYPE { ADD, ENABLE, DISABLE, REMOVE, CHECK_FOR_UPDATES };
E_CMD_TYPE m_eCmdType;
bool m_bWarnUser;
OUString m_sExtensionURL;
uno::Reference< deployment::XPackageManager > m_xPackageManager;
uno::Reference< deployment::XPackage > m_xPackage;
- uno::Sequence< uno::Reference< deployment::XPackageManager > > m_xPackageManagers;
+ std::vector< TUpdateListEntry > m_vExtensionList;
ExtensionCmd( const E_CMD_TYPE eCommand,
const uno::Reference< deployment::XPackageManager > &rPackageManager,
@@ -227,10 +227,10 @@ struct ExtensionCmd
m_bWarnUser( false ),
m_xPackage( rPackage ) {};
ExtensionCmd( const E_CMD_TYPE eCommand,
- const uno::Sequence< uno::Reference< deployment::XPackageManager > > &rPackageManagers )
+ const std::vector< TUpdateListEntry > &vExtensionList )
: m_eCmdType( eCommand ),
m_bWarnUser( false ),
- m_xPackageManagers( rPackageManagers ) {};
+ m_vExtensionList( vExtensionList ) {};
};
typedef ::boost::shared_ptr< ExtensionCmd > TExtensionCmd;
@@ -239,7 +239,7 @@ typedef ::boost::shared_ptr< ExtensionCmd > TExtensionCmd;
class ExtensionCmdQueue::Thread: public dp_gui::Thread
{
public:
- Thread( ExtMgrDialog *pDialog,
+ Thread( DialogHelper *pDialogHelper,
TheExtensionManager *pManager,
const uno::Reference< uno::XComponentContext > & rContext );
@@ -250,9 +250,7 @@ public:
const uno::Reference< deployment::XPackage > &rPackage );
void enableExtension( const uno::Reference< deployment::XPackage > &rPackage,
const bool bEnable );
- void checkForUpdates( const uno::Sequence< uno::Reference< deployment::XPackageManager > > &rPackageManagers );
- void checkForUpdate( const uno::Reference< deployment::XPackageManager > &rPackageManager,
- const uno::Reference< deployment::XPackage > &rPackage );
+ void checkForUpdates( const std::vector< TUpdateListEntry > &vExtensionList );
void stop();
bool hasTerminated();
bool isBusy();
@@ -280,16 +278,14 @@ private:
const uno::Reference< deployment::XPackage > &xPackage );
void _disableExtension( ::rtl::Reference< ProgressCmdEnv > &rCmdEnv,
const uno::Reference< deployment::XPackage > &xPackage );
- void _checkForUpdates( const uno::Sequence< uno::Reference< deployment::XPackageManager > > &rPackageManagers,
- const uno::Reference< deployment::XPackageManager > &xPackageManager,
- const uno::Reference< deployment::XPackage > &xPackage );
+ void _checkForUpdates( const std::vector< TUpdateListEntry > &vExtensionList );
enum Input { NONE, START, STOP };
uno::Reference< uno::XComponentContext > m_xContext;
std::queue< TExtensionCmd > m_queue;
- ExtMgrDialog *m_pDialog;
+ DialogHelper *m_pDialogHelper;
TheExtensionManager *m_pManager;
const OUString m_sEnablingPackages;
@@ -310,13 +306,15 @@ void ProgressCmdEnv::startProgress()
{
m_nCurrentProgress = 0;
- m_pDialog->showProgress( true );
+ if ( m_pDialogHelper )
+ m_pDialogHelper->showProgress( true );
}
//------------------------------------------------------------------------------
void ProgressCmdEnv::stopProgress()
{
- m_pDialog->showProgress( false );
+ if ( m_pDialogHelper )
+ m_pDialogHelper->showProgress( false );
}
//------------------------------------------------------------------------------
@@ -327,8 +325,11 @@ void ProgressCmdEnv::progressSection( const OUString &rText,
if (! m_bAborted)
{
m_nCurrentProgress = 0;
- m_pDialog->updateProgress( rText, xAbortChannel );
- m_pDialog->updateProgress( 5 );
+ if ( m_pDialogHelper )
+ {
+ m_pDialogHelper->updateProgress( rText, xAbortChannel );
+ m_pDialogHelper->updateProgress( 5 );
+ }
}
}
@@ -338,7 +339,8 @@ void ProgressCmdEnv::updateProgress()
if ( ! m_bAborted )
{
long nProgress = ((m_nCurrentProgress*5) % 100) + 5;
- m_pDialog->updateProgress( nProgress );
+ if ( m_pDialogHelper )
+ m_pDialogHelper->updateProgress( nProgress );
}
}
@@ -434,7 +436,7 @@ void ProgressCmdEnv::handle( uno::Reference< task::XInteractionRequest > const &
}
{
vos::OGuard guard(Application::GetSolarMutex());
- short n = DependencyDialog( m_pDialog, deps ).Execute();
+ short n = DependencyDialog( m_pDialogHelper? m_pDialogHelper->getWindow() : NULL, deps ).Execute();
// Distinguish between closing the dialog and programatically
// canceling the dialog (headless VCL):
approve = n == RET_OK
@@ -445,19 +447,19 @@ void ProgressCmdEnv::handle( uno::Reference< task::XInteractionRequest > const &
{
vos::OGuard aSolarGuard( Application::GetSolarMutex() );
ResId warnId(WARNINGBOX_NOSHAREDALLOWED, *DeploymentGuiResMgr::get());
- WarningBox warn( m_pDialog, warnId);
+ WarningBox warn( m_pDialogHelper? m_pDialogHelper->getWindow() : NULL, warnId);
String msgText = warn.GetMessText();
msgText.SearchAndReplaceAllAscii( "%PRODUCTNAME", BrandName::get() );
msgText.SearchAndReplaceAllAscii("%NAME", licAgreementExc.ExtensionName);
warn.SetMessText(msgText);
warn.Execute();
- abort = true;
+ abort = true;
}
else if (request >>= licExc)
{
uno::Reference< ui::dialogs::XExecutableDialog > xDialog(
deployment::ui::LicenseDialog::create(
- m_xContext, VCLUnoHelper::GetInterface( m_pDialog ), licExc.Text ) );
+ m_xContext, VCLUnoHelper::GetInterface( m_pDialogHelper? m_pDialogHelper->getWindow() : NULL ), licExc.Text ) );
sal_Int16 res = xDialog->execute();
if ( res == ui::dialogs::ExecutableDialogResults::CANCEL )
abort = true;
@@ -488,7 +490,7 @@ void ProgressCmdEnv::handle( uno::Reference< task::XInteractionRequest > const &
verExc.Deployed->getDisplayName());
{
vos::OGuard guard(Application::GetSolarMutex());
- WarningBox box( m_pDialog, ResId(id, *DeploymentGuiResMgr::get()));
+ WarningBox box( m_pDialogHelper? m_pDialogHelper->getWindow() : NULL, ResId(id, *DeploymentGuiResMgr::get()));
String s;
if (bEqualNames)
{
@@ -526,9 +528,14 @@ void ProgressCmdEnv::handle( uno::Reference< task::XInteractionRequest > const &
}
else
{
- vos::OGuard guard(Application::GetSolarMutex());
-
- approve = m_pDialog->installExtensionWarn( instExc.New->getDisplayName() );
+ if ( m_pDialogHelper )
+ {
+ vos::OGuard guard(Application::GetSolarMutex());
+
+ approve = m_pDialogHelper->installExtensionWarn( instExc.New->getDisplayName() );
+ }
+ else
+ approve = false;
abort = !approve;
}
}
@@ -537,7 +544,7 @@ void ProgressCmdEnv::handle( uno::Reference< task::XInteractionRequest > const &
vos::OGuard guard( Application::GetSolarMutex() );
String sMsg( ResId( RID_STR_UNSUPPORTED_PLATFORM, *DeploymentGuiResMgr::get() ) );
sMsg.SearchAndReplaceAllAscii( "%Name", platExc.package->getDisplayName() );
- ErrorBox box( m_pDialog, WB_OK, sMsg );
+ ErrorBox box( m_pDialogHelper? m_pDialogHelper->getWindow() : NULL, WB_OK, sMsg );
box.Execute();
approve = true;
}
@@ -609,7 +616,7 @@ void ProgressCmdEnv::update_( uno::Any const & rStatus )
text = ::comphelper::anyToString( rStatus ); // fallback
const ::vos::OGuard aGuard( Application::GetSolarMutex() );
- const ::std::auto_ptr< ErrorBox > aBox( new ErrorBox( m_pDialog, WB_OK, text ) );
+ const ::std::auto_ptr< ErrorBox > aBox( new ErrorBox( m_pDialogHelper? m_pDialogHelper->getWindow() : NULL, WB_OK, text ) );
aBox->Execute();
}
++m_nCurrentProgress;
@@ -631,23 +638,23 @@ void ProgressCmdEnv::pop()
}
//------------------------------------------------------------------------------
-ExtensionCmdQueue::Thread::Thread( ExtMgrDialog *pDialog,
+ExtensionCmdQueue::Thread::Thread( DialogHelper *pDialogHelper,
TheExtensionManager *pManager,
const uno::Reference< uno::XComponentContext > & rContext ) :
m_xContext( rContext ),
- m_pDialog( pDialog ),
+ m_pDialogHelper( pDialogHelper ),
m_pManager( pManager ),
- m_sEnablingPackages( ExtMgrDialog::getResourceString( RID_STR_ENABLING_PACKAGES ) ),
- m_sDisablingPackages( ExtMgrDialog::getResourceString( RID_STR_DISABLING_PACKAGES ) ),
- m_sAddingPackages( ExtMgrDialog::getResourceString( RID_STR_ADDING_PACKAGES ) ),
- m_sRemovingPackages( ExtMgrDialog::getResourceString( RID_STR_REMOVING_PACKAGES ) ),
- m_sDefaultCmd( ExtMgrDialog::getResourceString( RID_STR_ADD_PACKAGES ) ),
+ m_sEnablingPackages( DialogHelper::getResourceString( RID_STR_ENABLING_PACKAGES ) ),
+ m_sDisablingPackages( DialogHelper::getResourceString( RID_STR_DISABLING_PACKAGES ) ),
+ m_sAddingPackages( DialogHelper::getResourceString( RID_STR_ADDING_PACKAGES ) ),
+ m_sRemovingPackages( DialogHelper::getResourceString( RID_STR_REMOVING_PACKAGES ) ),
+ m_sDefaultCmd( DialogHelper::getResourceString( RID_STR_ADD_PACKAGES ) ),
m_eInput( NONE ),
m_bTerminated( false ),
m_bStopped( false ),
m_bWorking( false )
{
- OSL_ASSERT( pDialog );
+ OSL_ASSERT( pDialogHelper );
}
//------------------------------------------------------------------------------
@@ -713,41 +720,21 @@ void ExtensionCmdQueue::Thread::enableExtension( const uno::Reference< deploymen
}
//------------------------------------------------------------------------------
-void ExtensionCmdQueue::Thread::checkForUpdates( const uno::Sequence< uno::Reference< deployment::XPackageManager > > &rPackageManagers )
+void ExtensionCmdQueue::Thread::checkForUpdates( const std::vector< TUpdateListEntry > &vExtensionList )
{
::osl::MutexGuard aGuard( m_mutex );
- //If someone called stop then we do not remove the extension -> game over!
+ //If someone called stop then we do not update the extension -> game over!
if ( m_bStopped )
return;
- TExtensionCmd pEntry( new ExtensionCmd( ExtensionCmd::CHECK_FOR_UPDATES, rPackageManagers ) );
+ TExtensionCmd pEntry( new ExtensionCmd( ExtensionCmd::CHECK_FOR_UPDATES, vExtensionList ) );
m_queue.push( pEntry );
m_eInput = START;
m_wakeup.set();
}
//------------------------------------------------------------------------------
-void ExtensionCmdQueue::Thread::checkForUpdate( const uno::Reference< deployment::XPackageManager > &rPackageManager,
- const uno::Reference< deployment::XPackage > &rPackage )
-{
- ::osl::MutexGuard aGuard( m_mutex );
-
- //If someone called stop then we do not remove the extension -> game over!
- if ( m_bStopped )
- return;
-
- if ( rPackageManager.is() && rPackage.is() )
- {
- TExtensionCmd pEntry( new ExtensionCmd( ExtensionCmd::CHECK_FOR_UPDATE, rPackageManager, rPackage ) );
-
- m_queue.push( pEntry );
- m_eInput = START;
- m_wakeup.set();
- }
-}
-
-//------------------------------------------------------------------------------
//Stopping this thread will not abort the installation of extensions.
void ExtensionCmdQueue::Thread::stop()
{
@@ -779,7 +766,7 @@ void ExtensionCmdQueue::Thread::execute()
{
#ifdef WNT
//Needed for use of the service "com.sun.star.system.SystemShellExecute" in
- //ExtMgrDialog::openWebBrowser
+ //DialogHelper::openWebBrowser
CoUninitialize();
HRESULT r = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
#endif
@@ -813,7 +800,7 @@ void ExtensionCmdQueue::Thread::execute()
if ( eInput == STOP )
break;
- ::rtl::Reference< ProgressCmdEnv > currentCmdEnv( new ProgressCmdEnv( m_xContext, m_pDialog, m_sDefaultCmd ) );
+ ::rtl::Reference< ProgressCmdEnv > currentCmdEnv( new ProgressCmdEnv( m_xContext, m_pDialogHelper, m_sDefaultCmd ) );
// Do not lock the following part with addExtension. addExtension may be called in the main thread.
// If the message box "Do you want to install the extension (or similar)" is shown and then
@@ -836,8 +823,7 @@ void ExtensionCmdQueue::Thread::execute()
m_queue.pop();
}
- if ( bStartProgress && ( pEntry->m_eCmdType != ExtensionCmd::CHECK_FOR_UPDATE ) &&
- ( pEntry->m_eCmdType != ExtensionCmd::CHECK_FOR_UPDATES ) )
+ if ( bStartProgress && ( pEntry->m_eCmdType != ExtensionCmd::CHECK_FOR_UPDATES ) )
{
currentCmdEnv->startProgress();
bStartProgress = false;
@@ -856,9 +842,8 @@ void ExtensionCmdQueue::Thread::execute()
case ExtensionCmd::DISABLE :
_disableExtension( currentCmdEnv, pEntry->m_xPackage );
break;
- case ExtensionCmd::CHECK_FOR_UPDATE :
case ExtensionCmd::CHECK_FOR_UPDATES :
- _checkForUpdates( pEntry->m_xPackageManagers, pEntry->m_xPackageManager, pEntry->m_xPackage );
+ _checkForUpdates( pEntry->m_vExtensionList );
break;
}
}
@@ -908,7 +893,8 @@ void ExtensionCmdQueue::Thread::execute()
const ::vos::OGuard guard( Application::GetSolarMutex() );
::std::auto_ptr<ErrorBox> box(
new ErrorBox( currentCmdEnv->activeDialog(), WB_OK, msg ) );
- box->SetText( m_pDialog->GetText() );
+ if ( m_pDialogHelper )
+ box->SetText( m_pDialogHelper->getWindow()->GetText() );
box->Execute();
//Continue with installation of the remaining extensions
}
@@ -1009,21 +995,14 @@ void ExtensionCmdQueue::Thread::_removeExtension( ::rtl::Reference< ProgressCmdE
}
//------------------------------------------------------------------------------
-void ExtensionCmdQueue::Thread::_checkForUpdates( const uno::Sequence< uno::Reference< deployment::XPackageManager > > &rPackageManagers,
- const uno::Reference< deployment::XPackageManager > &xPackageManager,
- const uno::Reference< deployment::XPackage > &xPackage )
+void ExtensionCmdQueue::Thread::_checkForUpdates( const std::vector< TUpdateListEntry > &vExtensionList )
{
UpdateDialog* pUpdateDialog;
std::vector< UpdateData > vData;
const ::vos::OGuard guard( Application::GetSolarMutex() );
- if ( xPackageManager.is() && xPackage.is() )
- pUpdateDialog = new UpdateDialog( m_xContext, m_pDialog, new SelectedPackage( xPackage, xPackageManager ),
- uno::Sequence< uno::Reference< deployment::XPackageManager > >(), &vData );
- else
- pUpdateDialog = new UpdateDialog( m_xContext, m_pDialog, rtl::Reference< SelectedPackage >(),
- rPackageManagers, &vData );
+ pUpdateDialog = new UpdateDialog( m_xContext, m_pDialogHelper? m_pDialogHelper->getWindow() : NULL, vExtensionList, &vData );
pUpdateDialog->notifyMenubar( true, false ); // prepare the checking, if there updates to be notified via menu bar icon
@@ -1046,7 +1025,7 @@ void ExtensionCmdQueue::Thread::_checkForUpdates( const uno::Sequence< uno::Refe
short nDialogResult = RET_OK;
if ( !dataDownload.empty() )
{
- nDialogResult = UpdateInstallDialog( m_pDialog, dataDownload, m_xContext ).Execute();
+ nDialogResult = UpdateInstallDialog( m_pDialogHelper? m_pDialogHelper->getWindow() : NULL, dataDownload, m_xContext ).Execute();
pUpdateDialog->notifyMenubar( false, true ); // Check, if there are still pending updates to be notified via menu bar icon
}
else
@@ -1057,8 +1036,8 @@ void ExtensionCmdQueue::Thread::_checkForUpdates( const uno::Sequence< uno::Refe
{
for ( cit i = vData.begin(); i < vData.end(); i++ )
{
- if ( i->sWebsiteURL.getLength() > 0 )
- m_pDialog->openWebBrowser( i->sWebsiteURL );
+ if ( m_pDialogHelper && ( i->sWebsiteURL.getLength() > 0 ) )
+ m_pDialogHelper->openWebBrowser( i->sWebsiteURL, m_pDialogHelper->getWindow()->GetText() );
}
}
}
@@ -1082,7 +1061,8 @@ void ExtensionCmdQueue::Thread::_enableExtension( ::rtl::Reference< ProgressCmdE
try
{
xPackage->registerPackage( xAbortChannel, rCmdEnv.get() );
- m_pDialog->updatePackageInfo( xPackage );
+ if ( m_pDialogHelper )
+ m_pDialogHelper->updatePackageInfo( xPackage );
}
catch ( ::ucb::CommandAbortedException & )
{}
@@ -1102,7 +1082,8 @@ void ExtensionCmdQueue::Thread::_disableExtension( ::rtl::Reference< ProgressCmd
try
{
xPackage->revokePackage( xAbortChannel, rCmdEnv.get() );
- m_pDialog->updatePackageInfo( xPackage );
+ if ( m_pDialogHelper )
+ m_pDialogHelper->updatePackageInfo( xPackage );
}
catch ( ::ucb::CommandAbortedException & )
{}
@@ -1139,10 +1120,10 @@ OUString ExtensionCmdQueue::Thread::searchAndReplaceAll( const OUString &rSource
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
-ExtensionCmdQueue::ExtensionCmdQueue( ExtMgrDialog * pDialog,
+ExtensionCmdQueue::ExtensionCmdQueue( DialogHelper * pDialogHelper,
TheExtensionManager *pManager,
const uno::Reference< uno::XComponentContext > &rContext )
- : m_thread( new Thread( pDialog, pManager, rContext ) )
+ : m_thread( new Thread( pDialogHelper, pManager, rContext ) )
{
m_thread->launch();
}
@@ -1170,15 +1151,9 @@ void ExtensionCmdQueue::enableExtension( const uno::Reference< deployment::XPack
m_thread->enableExtension( rPackage, bEnable );
}
-void ExtensionCmdQueue::checkForUpdates( const uno::Sequence< uno::Reference< deployment::XPackageManager > > &rPackageManagers )
-{
- m_thread->checkForUpdates( rPackageManagers );
-}
-
-void ExtensionCmdQueue::checkForUpdate( const uno::Reference< deployment::XPackageManager > &rPackageManager,
- const uno::Reference< deployment::XPackage > &rPackage )
+void ExtensionCmdQueue::checkForUpdates( const std::vector< TUpdateListEntry > &vExtensionList )
{
- m_thread->checkForUpdate( rPackageManager, rPackage );
+ m_thread->checkForUpdates( vExtensionList );
}
void ExtensionCmdQueue::stop()
diff --git a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.hxx b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.hxx
index 08c4eaed15..853ce946c2 100644
--- a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.hxx
+++ b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.hxx
@@ -32,19 +32,14 @@
#ifndef INCLUDED_DP_GUI_EXTENSIONCMDQUEUE_HXX
#define INCLUDED_DP_GUI_EXTENSIONCMDQUEUE_HXX
-#ifndef _SAL_CONFIG_H_
#include "sal/config.h"
-#endif
-#ifndef _COM_SUN_STAR_UNO_REFERENCE_HXX_
#include "com/sun/star/uno/Reference.hxx"
-#endif
-#ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX_
-#include "com/sun/star/uno/Sequence.hxx"
-#endif
-#ifndef _RTL_REF_HXX_
#include "rtl/ref.hxx"
-#endif
+
+#include <vector>
+
+#include "dp_gui_updatedata.hxx"
/// @HTML
@@ -56,7 +51,7 @@ namespace com { namespace sun { namespace star {
namespace dp_gui {
-class ExtMgrDialog;
+class DialogHelper;
class TheExtensionManager;
/**
@@ -79,7 +74,7 @@ public:
/**
Create an instance.
*/
- ExtensionCmdQueue( ExtMgrDialog * pDialog,
+ ExtensionCmdQueue( DialogHelper * pDialogHelper,
TheExtensionManager *pManager,
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > & rContext);
@@ -94,9 +89,7 @@ public:
const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &rPackage );
void enableExtension( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &rPackage,
const bool bEnable );
- void checkForUpdates( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > > &rPackageManagers );
- void checkForUpdate( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > &rPackageManager,
- const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &rPackage );
+ void checkForUpdates( const std::vector< TUpdateListEntry > &vList );
/**
This call does not block. It signals the internal thread
that it should install the remaining extensions and then terminate.
diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
new file mode 100644
index 0000000000..f4473c2c6f
--- /dev/null
+++ b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
@@ -0,0 +1,1175 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2009 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.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_desktop.hxx"
+
+#include "svtools/controldims.hrc"
+
+#include "dp_gui.h"
+#include "dp_gui_extlistbox.hxx"
+#include "dp_gui_theextmgr.hxx"
+#include "dp_gui_dialog2.hxx"
+#include "dp_dependencies.hxx"
+
+#include "comphelper/processfactory.hxx"
+#include "com/sun/star/i18n/CollatorOptions.hpp"
+#include "com/sun/star/deployment/DependencyException.hpp"
+#include "com/sun/star/deployment/DeploymentException.hpp"
+
+
+#define OUSTR(x) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(x) )
+
+using namespace ::com::sun::star;
+
+namespace dp_gui {
+
+//------------------------------------------------------------------------------
+// struct Entry_Impl
+//------------------------------------------------------------------------------
+Entry_Impl::Entry_Impl( const uno::Reference< deployment::XPackage > &xPackage,
+ const uno::Reference< deployment::XPackageManager > &xPackageManager,
+ PackageState eState ) :
+ m_bActive( false ),
+ m_bLocked( false ),
+ m_bHasOptions( false ),
+ m_bShared( false ),
+ m_bNew( false ),
+ m_bChecked( false ),
+ m_bMissingDeps( false ),
+ m_eState( eState ),
+ m_pPublisher( NULL ),
+ m_xPackage( xPackage ),
+ m_xPackageManager( xPackageManager )
+{
+ m_sTitle = xPackage->getDisplayName();
+ m_sVersion = xPackage->getVersion();
+ m_sDescription = xPackage->getDescription();
+
+ beans::StringPair aInfo( m_xPackage->getPublisherInfo() );
+ m_sPublisher = aInfo.First;
+ m_sPublisherURL = aInfo.Second;
+
+ // get the icons for the package if there are any
+ uno::Reference< graphic::XGraphic > xGraphic = xPackage->getIcon( false );
+ if ( xGraphic.is() )
+ m_aIcon = Image( xGraphic );
+
+ xGraphic = xPackage->getIcon( true );
+ if ( xGraphic.is() )
+ m_aIconHC = Image( xGraphic );
+ else
+ m_aIconHC = m_aIcon;
+
+ m_bLocked = m_xPackageManager->isReadOnly();
+
+ if ( eState == AMBIGUOUS )
+ m_sErrorText = DialogHelper::getResourceString( RID_STR_ERROR_UNKNOWN_STATUS );
+ else if ( eState == NOT_REGISTERED )
+ checkDependencies();
+}
+
+//------------------------------------------------------------------------------
+Entry_Impl::~Entry_Impl()
+{}
+
+//------------------------------------------------------------------------------
+StringCompare Entry_Impl::CompareTo( const CollatorWrapper *pCollator, const TEntry_Impl pEntry ) const
+{
+ StringCompare eCompare = (StringCompare) pCollator->compareString( m_sTitle, pEntry->m_sTitle );
+ if ( eCompare == COMPARE_EQUAL )
+ {
+ eCompare = m_sVersion.CompareTo( pEntry->m_sVersion );
+ if ( eCompare == COMPARE_EQUAL )
+ {
+ if ( m_xPackageManager != pEntry->m_xPackageManager )
+ {
+ sal_Int32 nCompare = m_xPackageManager->getContext().compareTo( pEntry->m_xPackageManager->getContext() );
+ if ( nCompare < 0 )
+ eCompare = COMPARE_LESS;
+ else if ( nCompare > 0 )
+ eCompare = COMPARE_GREATER;
+ }
+ }
+ }
+ return eCompare;
+}
+
+//------------------------------------------------------------------------------
+void Entry_Impl::checkDependencies()
+{
+ try {
+ m_xPackage->checkDependencies( uno::Reference< ucb::XCommandEnvironment >() );
+ }
+ catch ( deployment::DeploymentException &e )
+ {
+ deployment::DependencyException depExc;
+ if ( e.Cause >>= depExc )
+ {
+ rtl::OUString aMissingDep( DialogHelper::getResourceString( RID_STR_ERROR_MISSING_DEPENDENCIES ) );
+ for ( sal_Int32 i = 0; i < depExc.UnsatisfiedDependencies.getLength(); ++i )
+ {
+ aMissingDep += OUSTR("\n");
+ aMissingDep += dp_misc::Dependencies::getErrorText( depExc.UnsatisfiedDependencies[i]);
+ }
+ aMissingDep += OUSTR("\n");
+ m_sErrorText = aMissingDep;
+ m_bMissingDeps = true;
+ }
+ }
+}
+//------------------------------------------------------------------------------
+// ExtensionRemovedListener
+//------------------------------------------------------------------------------
+void ExtensionRemovedListener::disposing( lang::EventObject const & rEvt )
+ throw ( uno::RuntimeException )
+{
+ uno::Reference< deployment::XPackage > xPackage( rEvt.Source, uno::UNO_QUERY );
+
+ if ( xPackage.is() )
+ {
+ m_pParent->removeEntry( xPackage );
+ }
+}
+
+//------------------------------------------------------------------------------
+ExtensionRemovedListener::~ExtensionRemovedListener()
+{
+}
+
+//------------------------------------------------------------------------------
+// ExtensionBox_Impl
+//------------------------------------------------------------------------------
+ExtensionBox_Impl::ExtensionBox_Impl( Dialog* pParent, TheExtensionManager *pManager ) :
+ IExtensionListBox( pParent, WB_BORDER | WB_TABSTOP | WB_CHILDDLGCTRL ),
+ m_bHasScrollBar( false ),
+ m_bHasActive( false ),
+ m_bNeedsRecalc( true ),
+ m_bHasNew( false ),
+ m_bInCheckMode( false ),
+ m_bAdjustActive( false ),
+ m_bInDelete( false ),
+ m_nActive( 0 ),
+ m_nTopIndex( 0 ),
+ m_nActiveHeight( 0 ),
+ m_nExtraHeight( 2 ),
+ m_aLockedImage( DialogHelper::getResId( RID_IMG_LOCKED ) ),
+ m_aLockedImageHC( DialogHelper::getResId( RID_IMG_LOCKED_HC ) ),
+ m_aWarningImage( DialogHelper::getResId( RID_IMG_WARNING ) ),
+ m_aWarningImageHC( DialogHelper::getResId( RID_IMG_WARNING_HC ) ),
+ m_aDefaultImage( DialogHelper::getResId( RID_IMG_EXTENSION ) ),
+ m_aDefaultImageHC( DialogHelper::getResId( RID_IMG_EXTENSION_HC ) ),
+ m_pScrollBar( NULL ),
+ m_pManager( pManager )
+{
+ SetHelpId( HID_EXTENSION_MANAGER_LISTBOX );
+
+ m_pScrollBar = new ScrollBar( this, WB_VERT );
+ m_pScrollBar->SetScrollHdl( LINK( this, ExtensionBox_Impl, ScrollHdl ) );
+ m_pScrollBar->EnableDrag();
+
+ SetPaintTransparent( true );
+ SetPosPixel( Point( RSC_SP_DLG_INNERBORDER_LEFT, RSC_SP_DLG_INNERBORDER_TOP ) );
+ long nIconHeight = 2*TOP_OFFSET + SMALL_ICON_SIZE;
+ long nTitleHeight = 2*TOP_OFFSET + GetTextHeight();
+ if ( nIconHeight < nTitleHeight )
+ m_nStdHeight = nTitleHeight;
+ else
+ m_nStdHeight = nIconHeight;
+ m_nStdHeight += GetTextHeight() + TOP_OFFSET;
+
+ nIconHeight = ICON_HEIGHT + 2*TOP_OFFSET + 1;
+ if ( m_nStdHeight < nIconHeight )
+ m_nStdHeight = nIconHeight;
+
+ m_nActiveHeight = m_nStdHeight;
+
+ const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+ if( IsControlBackground() )
+ SetBackground( GetControlBackground() );
+ else
+ SetBackground( rStyleSettings.GetFieldColor() );
+
+ m_xRemoveListener = new ExtensionRemovedListener( this );
+
+ m_pLocale = new lang::Locale( Application::GetSettings().GetLocale() );
+ m_pCollator = new CollatorWrapper( ::comphelper::getProcessServiceFactory() );
+ m_pCollator->loadDefaultCollator( *m_pLocale, i18n::CollatorOptions::CollatorOptions_IGNORE_CASE );
+
+ Show();
+}
+
+//------------------------------------------------------------------------------
+ExtensionBox_Impl::~ExtensionBox_Impl()
+{
+ if ( ! m_bInDelete )
+ DeleteRemoved();
+
+ m_bInDelete = true;
+
+ typedef std::vector< TEntry_Impl >::iterator ITER;
+
+ for ( ITER iIndex = m_vEntries.begin(); iIndex < m_vEntries.end(); ++iIndex )
+ {
+ if ( (*iIndex)->m_pPublisher )
+ {
+ delete (*iIndex)->m_pPublisher;
+ (*iIndex)->m_pPublisher = NULL;
+ }
+ (*iIndex)->m_xPackage->removeEventListener( uno::Reference< lang::XEventListener > ( m_xRemoveListener, uno::UNO_QUERY ) );
+ }
+
+ m_vEntries.clear();
+
+ delete m_pScrollBar;
+
+ m_xRemoveListener.clear();
+
+ delete m_pLocale;
+ delete m_pCollator;
+}
+
+//------------------------------------------------------------------------------
+sal_Int32 ExtensionBox_Impl::getItemCount() const
+{
+ return static_cast< sal_Int32 >( m_vEntries.size() );
+}
+
+//------------------------------------------------------------------------------
+sal_Int32 ExtensionBox_Impl::getSelIndex() const
+{
+ if ( m_bHasActive )
+ {
+ OSL_ASSERT( m_nActive >= -1);
+ return static_cast< sal_Int32 >( m_nActive );
+ }
+ else
+ return static_cast< sal_Int32 >( EXTENSION_LISTBOX_ENTRY_NOTFOUND );
+}
+
+//------------------------------------------------------------------------------
+void ExtensionBox_Impl::checkIndex( sal_Int32 nIndex ) const
+{
+ if ( nIndex < 0 )
+ throw lang::IllegalArgumentException( OUSTR("The list index starts with 0"),0, 0 );
+ if ( static_cast< sal_uInt32 >( nIndex ) >= m_vEntries.size())
+ throw lang::IllegalArgumentException( OUSTR("There is no element at the provided position."
+ "The position exceeds the number of available list entries"),0, 0 );
+}
+
+//------------------------------------------------------------------------------
+rtl::OUString ExtensionBox_Impl::getItemName( sal_Int32 nIndex ) const
+{
+ const ::osl::MutexGuard aGuard( m_entriesMutex );
+ checkIndex( nIndex );
+ return m_vEntries[ nIndex ]->m_sTitle;
+}
+
+//------------------------------------------------------------------------------
+rtl::OUString ExtensionBox_Impl::getItemVersion( sal_Int32 nIndex ) const
+{
+ const ::osl::MutexGuard aGuard( m_entriesMutex );
+ checkIndex( nIndex );
+ return m_vEntries[ nIndex ]->m_sVersion;
+}
+
+//------------------------------------------------------------------------------
+rtl::OUString ExtensionBox_Impl::getItemDescription( sal_Int32 nIndex ) const
+{
+ const ::osl::MutexGuard aGuard( m_entriesMutex );
+ checkIndex( nIndex );
+ return m_vEntries[ nIndex ]->m_sDescription;
+}
+
+//------------------------------------------------------------------------------
+rtl::OUString ExtensionBox_Impl::getItemPublisher( sal_Int32 nIndex ) const
+{
+ const ::osl::MutexGuard aGuard( m_entriesMutex );
+ checkIndex( nIndex );
+ return m_vEntries[ nIndex ]->m_sPublisher;
+}
+
+//------------------------------------------------------------------------------
+rtl::OUString ExtensionBox_Impl::getItemPublisherLink( sal_Int32 nIndex ) const
+{
+ const ::osl::MutexGuard aGuard( m_entriesMutex );
+ checkIndex( nIndex );
+ return m_vEntries[ nIndex ]->m_sPublisherURL;
+}
+
+//------------------------------------------------------------------------------
+void ExtensionBox_Impl::select( sal_Int32 nIndex )
+{
+ const ::osl::MutexGuard aGuard( m_entriesMutex );
+ checkIndex( nIndex );
+ selectEntry( nIndex );
+}
+
+//------------------------------------------------------------------------------
+void ExtensionBox_Impl::select( const rtl::OUString & sName )
+{
+ const ::osl::MutexGuard aGuard( m_entriesMutex );
+ typedef ::std::vector< TEntry_Impl >::const_iterator It;
+
+ for ( It iIter = m_vEntries.begin(); iIter < m_vEntries.end(); iIter++ )
+ {
+ if ( sName.equals( (*iIter)->m_sTitle ) )
+ {
+ long nPos = iIter - m_vEntries.begin();
+ selectEntry( nPos );
+ break;
+ }
+ }
+}
+
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+// Title + description
+void ExtensionBox_Impl::CalcActiveHeight( const long nPos )
+{
+ const ::osl::MutexGuard aGuard( m_entriesMutex );
+
+ // get title height
+ long aTextHeight;
+ long nIconHeight = 2*TOP_OFFSET + SMALL_ICON_SIZE;
+ long nTitleHeight = 2*TOP_OFFSET + GetTextHeight();
+ if ( nIconHeight < nTitleHeight )
+ aTextHeight = nTitleHeight;
+ else
+ aTextHeight = nIconHeight;
+
+ // calc description height
+ Size aSize = GetOutputSizePixel();
+ if ( m_bHasScrollBar )
+ aSize.Width() -= m_pScrollBar->GetSizePixel().Width();
+
+ aSize.Width() -= ICON_OFFSET;
+ aSize.Height() = 10000;
+
+ rtl::OUString aText( m_vEntries[ nPos ]->m_sErrorText );
+ aText += m_vEntries[ nPos ]->m_sDescription;
+
+ Rectangle aRect = GetTextRect( Rectangle( Point(), aSize ), aText,
+ TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK );
+ aTextHeight += aRect.GetHeight();
+
+ if ( aTextHeight < m_nStdHeight )
+ aTextHeight = m_nStdHeight;
+
+ m_nActiveHeight = aTextHeight + m_nExtraHeight;
+}
+
+//------------------------------------------------------------------------------
+const Size ExtensionBox_Impl::GetMinOutputSizePixel() const
+{
+ return Size( 200, 80 );
+}
+
+//------------------------------------------------------------------------------
+Rectangle ExtensionBox_Impl::GetEntryRect( const long nPos ) const
+{
+ const ::osl::MutexGuard aGuard( m_entriesMutex );
+
+ Size aSize( GetOutputSizePixel() );
+
+ if ( m_bHasScrollBar )
+ aSize.Width() -= m_pScrollBar->GetSizePixel().Width();
+
+ if ( m_vEntries[ nPos ]->m_bActive )
+ aSize.Height() = m_nActiveHeight;
+ else
+ aSize.Height() = m_nStdHeight;
+
+ Point aPos( 0, -m_nTopIndex + nPos * m_nStdHeight );
+ if ( m_bHasActive && ( nPos < m_nActive ) )
+ aPos.Y() += m_nActiveHeight - m_nStdHeight;
+
+ return Rectangle( aPos, aSize );
+}
+
+//------------------------------------------------------------------------------
+void ExtensionBox_Impl::DeleteRemoved()
+{
+ const ::osl::MutexGuard aGuard( m_entriesMutex );
+
+ m_bInDelete = true;
+
+ if ( ! m_vRemovedEntries.empty() )
+ {
+ typedef std::vector< TEntry_Impl >::iterator ITER;
+
+ for ( ITER iIndex = m_vRemovedEntries.begin(); iIndex < m_vRemovedEntries.end(); ++iIndex )
+ {
+ if ( (*iIndex)->m_pPublisher )
+ {
+ delete (*iIndex)->m_pPublisher;
+ (*iIndex)->m_pPublisher = NULL;
+ }
+ }
+
+ m_vRemovedEntries.clear();
+ }
+
+ m_bInDelete = false;
+}
+
+//------------------------------------------------------------------------------
+//This function may be called with nPos < 0
+void ExtensionBox_Impl::selectEntry( const long nPos )
+{
+ //ToDo whe should not use the guard at such a big scope here.
+ //Currently it is used to gard m_vEntries and m_nActive. m_nActive will be
+ //modified in this function.
+ //It would be probably best to always use a copy of m_vEntries
+ //and some other state variables from ExtensionBox_Impl for
+ //the whole painting operation. See issue i86993
+ ::osl::ClearableMutexGuard guard(m_entriesMutex);
+
+ if ( m_bInCheckMode )
+ return;
+
+ if ( m_bHasActive )
+ {
+ if ( nPos == m_nActive )
+ return;
+
+ m_bHasActive = false;
+ m_vEntries[ m_nActive ]->m_bActive = false;
+ }
+
+ if ( ( nPos >= 0 ) && ( nPos < (long) m_vEntries.size() ) )
+ {
+ m_bHasActive = true;
+ m_nActive = nPos;
+ m_vEntries[ nPos ]->m_bActive = true;
+
+ if ( IsReallyVisible() )
+ {
+ m_bNeedsRecalc = true;
+ m_bAdjustActive = true;
+ }
+ }
+
+ if ( IsReallyVisible() )
+ Invalidate();
+
+ guard.clear();
+}
+
+// -----------------------------------------------------------------------
+void ExtensionBox_Impl::DrawRow( const Rectangle& rRect, const TEntry_Impl pEntry )
+{
+ const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+
+ if ( pEntry->m_bActive )
+ SetTextColor( rStyleSettings.GetHighlightTextColor() );
+ else if ( ( pEntry->m_eState != REGISTERED ) && ( pEntry->m_eState != NOT_AVAILABLE ) )
+ SetTextColor( rStyleSettings.GetDisableColor() );
+ else if ( IsControlForeground() )
+ SetTextColor( GetControlForeground() );
+ else
+ SetTextColor( rStyleSettings.GetFieldTextColor() );
+
+ if ( pEntry->m_bActive )
+ {
+ SetLineColor();
+ SetFillColor( rStyleSettings.GetHighlightColor() );
+ DrawRect( rRect );
+ }
+ else
+ {
+ if( IsControlBackground() )
+ SetBackground( GetControlBackground() );
+ else
+ SetBackground( rStyleSettings.GetFieldColor() );
+
+ SetTextFillColor();
+ Erase( rRect );
+ }
+
+ // Draw extension icon
+ Point aPos( rRect.TopLeft() );
+ aPos += Point( TOP_OFFSET, TOP_OFFSET );
+ Image aImage;
+ if ( ! pEntry->m_aIcon )
+ aImage = isHCMode() ? m_aDefaultImageHC : m_aDefaultImage;
+ else
+ aImage = isHCMode() ? pEntry->m_aIconHC : pEntry->m_aIcon;
+ Size aImageSize = aImage.GetSizePixel();
+ if ( ( aImageSize.Width() <= ICON_HEIGHT ) && ( aImageSize.Height() <= ICON_HEIGHT ) )
+ DrawImage( Point( aPos.X()+((ICON_HEIGHT-aImageSize.Width())/2), aPos.Y()+((ICON_HEIGHT-aImageSize.Height())/2) ), aImage );
+ else
+ DrawImage( aPos, Size( ICON_HEIGHT, ICON_HEIGHT ), aImage );
+
+ // Setup fonts
+ Font aStdFont( GetFont() );
+ Font aBoldFont( aStdFont );
+ aBoldFont.SetWeight( WEIGHT_BOLD );
+ SetFont( aBoldFont );
+ long aTextHeight = GetTextHeight();
+
+ // Init publisher link here
+ if ( !pEntry->m_pPublisher && pEntry->m_sPublisher.Len() )
+ {
+ pEntry->m_pPublisher = new svt::FixedHyperlink( this );
+ pEntry->m_pPublisher->SetBackground();
+ pEntry->m_pPublisher->SetPaintTransparent( true );
+ pEntry->m_pPublisher->SetURL( pEntry->m_sPublisherURL );
+ pEntry->m_pPublisher->SetDescription( pEntry->m_sPublisher );
+ Size aSize = FixedText::CalcMinimumTextSize( pEntry->m_pPublisher );
+ pEntry->m_pPublisher->SetSizePixel( aSize );
+
+ if ( m_aClickHdl.IsSet() )
+ pEntry->m_pPublisher->SetClickHdl( m_aClickHdl );
+ }
+
+ // Get max title width
+ long nMaxTitleWidth = rRect.GetWidth() - ICON_OFFSET;
+ nMaxTitleWidth -= ( 2 * SMALL_ICON_SIZE ) + ( 4 * SPACE_BETWEEN );
+ if ( pEntry->m_pPublisher )
+ {
+ nMaxTitleWidth -= pEntry->m_pPublisher->GetSizePixel().Width() + (2*SPACE_BETWEEN);
+ }
+
+ long aVersionWidth = GetTextWidth( pEntry->m_sVersion );
+ long aTitleWidth = GetTextWidth( pEntry->m_sTitle ) + (aTextHeight / 3);
+
+ aPos = rRect.TopLeft() + Point( ICON_OFFSET, TOP_OFFSET );
+
+ if ( aTitleWidth > nMaxTitleWidth - aVersionWidth )
+ {
+ aTitleWidth = nMaxTitleWidth - aVersionWidth - (aTextHeight / 3);
+ String aShortTitle = GetEllipsisString( pEntry->m_sTitle, aTitleWidth );
+ DrawText( aPos, aShortTitle );
+ aTitleWidth += (aTextHeight / 3);
+ }
+ else
+ DrawText( aPos, pEntry->m_sTitle );
+
+ SetFont( aStdFont );
+ DrawText( Point( aPos.X() + aTitleWidth, aPos.Y() ), pEntry->m_sVersion );
+
+ long nIconHeight = TOP_OFFSET + SMALL_ICON_SIZE;
+ long nTitleHeight = TOP_OFFSET + GetTextHeight();
+ if ( nIconHeight < nTitleHeight )
+ aTextHeight = nTitleHeight;
+ else
+ aTextHeight = nIconHeight;
+
+ // draw description
+ String sDescription;
+ if ( pEntry->m_sErrorText.Len() )
+ {
+ if ( pEntry->m_bActive )
+ sDescription = pEntry->m_sErrorText + OUSTR("\n") + pEntry->m_sDescription;
+ else
+ sDescription = pEntry->m_sErrorText;
+ }
+ else
+ sDescription = pEntry->m_sDescription;
+
+ aPos.Y() += aTextHeight;
+ if ( pEntry->m_bActive )
+ {
+ DrawText( Rectangle( aPos.X(), aPos.Y(), rRect.Right(), rRect.Bottom() - m_nExtraHeight ),
+ sDescription, TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK );
+ }
+ else
+ {
+ const long nWidth = GetTextWidth( sDescription );
+ if ( nWidth > rRect.GetWidth() - aPos.X() )
+ sDescription = GetEllipsisString( sDescription, rRect.GetWidth() - aPos.X() );
+ DrawText( aPos, sDescription );
+ }
+
+ // Draw publisher link
+ if ( pEntry->m_pPublisher )
+ {
+ pEntry->m_pPublisher->Show();
+ aPos = rRect.TopLeft() + Point( ICON_OFFSET + nMaxTitleWidth + (2*SPACE_BETWEEN), TOP_OFFSET );
+ pEntry->m_pPublisher->SetPosPixel( aPos );
+ }
+
+ // Draw status icons
+ if ( pEntry->m_bShared )
+ {
+ aPos = rRect.TopRight() + Point( -(RIGHT_ICON_OFFSET + SMALL_ICON_SIZE), TOP_OFFSET );
+ DrawImage( aPos, Size( SMALL_ICON_SIZE, SMALL_ICON_SIZE ), isHCMode() ? m_aLockedImageHC : m_aLockedImage );
+ }
+ if ( ( pEntry->m_eState == AMBIGUOUS ) || pEntry->m_bMissingDeps )
+ {
+ aPos = rRect.TopRight() + Point( -(RIGHT_ICON_OFFSET + SPACE_BETWEEN + 2*SMALL_ICON_SIZE), TOP_OFFSET );
+ DrawImage( aPos, Size( SMALL_ICON_SIZE, SMALL_ICON_SIZE ), isHCMode() ? m_aWarningImageHC : m_aWarningImage );
+ }
+
+ SetLineColor( Color( COL_LIGHTGRAY ) );
+ DrawLine( rRect.BottomLeft(), rRect.BottomRight() );
+}
+
+// -----------------------------------------------------------------------
+void ExtensionBox_Impl::RecalcAll()
+{
+ if ( m_bHasActive )
+ CalcActiveHeight( m_nActive );
+
+ SetupScrollBar();
+
+ if ( m_bHasActive )
+ {
+ Rectangle aEntryRect = GetEntryRect( m_nActive );
+
+ if ( m_bAdjustActive )
+ {
+ m_bAdjustActive = false;
+
+ // If the top of the selected entry isn't visible, make it visible
+ if ( aEntryRect.Top() < 0 )
+ {
+ m_nTopIndex += aEntryRect.Top();
+ aEntryRect.Move( 0, -aEntryRect.Top() );
+ }
+
+ // If the bottom of the selected entry isn't visible, make it visible even if now the top
+ // isn't visible any longer ( the buttons are more important )
+ Size aOutputSize = GetOutputSizePixel();
+ if ( aEntryRect.Bottom() > aOutputSize.Height() )
+ {
+ m_nTopIndex += ( aEntryRect.Bottom() - aOutputSize.Height() );
+ aEntryRect.Move( 0, -( aEntryRect.Bottom() - aOutputSize.Height() ) );
+ }
+
+ // If there is unused space below the last entry but all entries don't fit into the box,
+ // move the content down to use the whole space
+ const long nTotalHeight = GetTotalHeight();
+ if ( m_bHasScrollBar && ( aOutputSize.Height() + m_nTopIndex > nTotalHeight ) )
+ {
+ long nOffset = m_nTopIndex;
+ m_nTopIndex = nTotalHeight - aOutputSize.Height();
+ nOffset -= m_nTopIndex;
+ aEntryRect.Move( 0, nOffset );
+ }
+
+ if ( m_bHasScrollBar )
+ m_pScrollBar->SetThumbPos( m_nTopIndex );
+ }
+ }
+
+ m_bNeedsRecalc = false;
+}
+
+// -----------------------------------------------------------------------
+bool ExtensionBox_Impl::HandleTabKey( bool )
+{
+ return false;
+}
+
+// -----------------------------------------------------------------------
+bool ExtensionBox_Impl::HandleCursorKey( USHORT nKeyCode )
+{
+ if ( m_vEntries.empty() )
+ return true;
+
+ long nSelect = 0;
+
+ if ( m_bHasActive )
+ {
+ long nPageSize = GetOutputSizePixel().Height() / m_nStdHeight;
+ if ( nPageSize < 2 )
+ nPageSize = 2;
+
+ if ( ( nKeyCode == KEY_DOWN ) || ( nKeyCode == KEY_RIGHT ) )
+ nSelect = m_nActive + 1;
+ else if ( ( nKeyCode == KEY_UP ) || ( nKeyCode == KEY_LEFT ) )
+ nSelect = m_nActive - 1;
+ else if ( nKeyCode == KEY_HOME )
+ nSelect = 0;
+ else if ( nKeyCode == KEY_END )
+ nSelect = m_vEntries.size() - 1;
+ else if ( nKeyCode == KEY_PAGEUP )
+ nSelect = m_nActive - nPageSize + 1;
+ else if ( nKeyCode == KEY_PAGEDOWN )
+ nSelect = m_nActive + nPageSize - 1;
+ }
+ else // when there is no selected entry, we will select the first or the last.
+ {
+ if ( ( nKeyCode == KEY_DOWN ) || ( nKeyCode == KEY_PAGEDOWN ) || ( nKeyCode == KEY_HOME ) )
+ nSelect = 0;
+ else if ( ( nKeyCode == KEY_UP ) || ( nKeyCode == KEY_PAGEUP ) || ( nKeyCode == KEY_END ) )
+ nSelect = m_vEntries.size() - 1;
+ }
+
+ if ( nSelect < 0 )
+ nSelect = 0;
+ if ( nSelect >= (long) m_vEntries.size() )
+ nSelect = m_vEntries.size() - 1;
+
+ selectEntry( nSelect );
+
+ return true;
+}
+
+// -----------------------------------------------------------------------
+void ExtensionBox_Impl::Paint( const Rectangle &/*rPaintRect*/ )
+{
+ if ( !m_bInDelete )
+ DeleteRemoved();
+
+ if ( m_bNeedsRecalc )
+ RecalcAll();
+
+ Point aStart( 0, -m_nTopIndex );
+ Size aSize( GetOutputSizePixel() );
+
+ if ( m_bHasScrollBar )
+ aSize.Width() -= m_pScrollBar->GetSizePixel().Width();
+
+ const ::osl::MutexGuard aGuard( m_entriesMutex );
+
+ typedef std::vector< TEntry_Impl >::iterator ITER;
+ for ( ITER iIndex = m_vEntries.begin(); iIndex < m_vEntries.end(); ++iIndex )
+ {
+ aSize.Height() = (*iIndex)->m_bActive ? m_nActiveHeight : m_nStdHeight;
+ Rectangle aEntryRect( aStart, aSize );
+ DrawRow( aEntryRect, *iIndex );
+ aStart.Y() += aSize.Height();
+ }
+}
+
+// -----------------------------------------------------------------------
+long ExtensionBox_Impl::GetTotalHeight() const
+{
+ long nHeight = m_vEntries.size() * m_nStdHeight;
+
+ if ( m_bHasActive )
+ {
+ nHeight += m_nActiveHeight - m_nStdHeight;
+ }
+
+ return nHeight;
+}
+
+// -----------------------------------------------------------------------
+void ExtensionBox_Impl::SetupScrollBar()
+{
+ const Size aSize = GetOutputSizePixel();
+ const long nScrBarSize = GetSettings().GetStyleSettings().GetScrollBarSize();
+ const long nTotalHeight = GetTotalHeight();
+ const bool bNeedsScrollBar = ( nTotalHeight > aSize.Height() );
+
+ if ( bNeedsScrollBar )
+ {
+ if ( m_nTopIndex + aSize.Height() > nTotalHeight )
+ m_nTopIndex = nTotalHeight - aSize.Height();
+
+ m_pScrollBar->SetPosSizePixel( Point( aSize.Width() - nScrBarSize, 0 ),
+ Size( nScrBarSize, aSize.Height() ) );
+ m_pScrollBar->SetRangeMax( nTotalHeight );
+ m_pScrollBar->SetVisibleSize( aSize.Height() );
+ m_pScrollBar->SetPageSize( ( aSize.Height() * 4 ) / 5 );
+ m_pScrollBar->SetLineSize( m_nStdHeight );
+ m_pScrollBar->SetThumbPos( m_nTopIndex );
+
+ if ( !m_bHasScrollBar )
+ m_pScrollBar->Show();
+ }
+ else if ( m_bHasScrollBar )
+ {
+ m_pScrollBar->Hide();
+ m_nTopIndex = 0;
+ }
+
+ m_bHasScrollBar = bNeedsScrollBar;
+}
+
+// -----------------------------------------------------------------------
+void ExtensionBox_Impl::Resize()
+{
+ RecalcAll();
+}
+
+//------------------------------------------------------------------------------
+long ExtensionBox_Impl::PointToPos( const Point& rPos )
+{
+ long nPos = ( rPos.Y() + m_nTopIndex ) / m_nStdHeight;
+
+ if ( m_bHasActive && ( nPos > m_nActive ) )
+ {
+ if ( rPos.Y() + m_nTopIndex <= m_nActive*m_nStdHeight + m_nActiveHeight )
+ nPos = m_nActive;
+ else
+ nPos = ( rPos.Y() + m_nTopIndex - (m_nActiveHeight - m_nStdHeight) ) / m_nStdHeight;
+ }
+
+ return nPos;
+}
+
+//------------------------------------------------------------------------------
+void ExtensionBox_Impl::MouseButtonDown( const MouseEvent& rMEvt )
+{
+ long nPos = PointToPos( rMEvt.GetPosPixel() );
+
+ if ( rMEvt.IsLeft() )
+ {
+ if ( rMEvt.IsMod1() && m_bHasActive )
+ selectEntry( m_vEntries.size() ); // Selecting an not existing entry will deselect the current one
+ else
+ selectEntry( nPos );
+ }
+}
+
+//------------------------------------------------------------------------------
+long ExtensionBox_Impl::Notify( NotifyEvent& rNEvt )
+{
+ if ( !m_bInDelete )
+ DeleteRemoved();
+
+ bool bHandled = false;
+
+ if ( rNEvt.GetType() == EVENT_KEYINPUT )
+ {
+ const KeyEvent* pKEvt = rNEvt.GetKeyEvent();
+ KeyCode aKeyCode = pKEvt->GetKeyCode();
+ USHORT nKeyCode = aKeyCode.GetCode();
+
+ if ( nKeyCode == KEY_TAB )
+ bHandled = HandleTabKey( aKeyCode.IsShift() );
+ else if ( aKeyCode.GetGroup() == KEYGROUP_CURSOR )
+ bHandled = HandleCursorKey( nKeyCode );
+ }
+
+ if ( rNEvt.GetType() == EVENT_COMMAND )
+ {
+ if ( m_bHasScrollBar &&
+ ( rNEvt.GetCommandEvent()->GetCommand() == COMMAND_WHEEL ) )
+ {
+ const CommandWheelData* pData = rNEvt.GetCommandEvent()->GetWheelData();
+ if ( pData->GetMode() == COMMAND_WHEEL_SCROLL )
+ {
+ long nThumbPos = m_pScrollBar->GetThumbPos();
+ if ( pData->GetDelta() < 0 )
+ m_pScrollBar->DoScroll( nThumbPos + m_nStdHeight );
+ else
+ m_pScrollBar->DoScroll( nThumbPos - m_nStdHeight );
+ bHandled = true;
+ }
+ }
+ }
+
+ if ( !bHandled )
+ return Control::Notify( rNEvt );
+ else
+ return true;
+}
+
+//------------------------------------------------------------------------------
+bool ExtensionBox_Impl::FindEntryPos( const TEntry_Impl pEntry, const long nStart,
+ const long nEnd, long &nPos )
+{
+ nPos = nStart;
+ if ( nStart > nEnd )
+ return false;
+
+ StringCompare eCompare;
+
+ if ( nStart == nEnd )
+ {
+ eCompare = pEntry->CompareTo( m_pCollator, m_vEntries[ nStart ] );
+ if ( eCompare == COMPARE_LESS )
+ return false;
+ else if ( eCompare == COMPARE_EQUAL )
+ {
+ //Workaround. See i86963.
+ if (pEntry->m_xPackage != m_vEntries[nStart]->m_xPackage)
+ return false;
+
+ if ( m_bInCheckMode )
+ m_vEntries[ nStart ]->m_bChecked = true;
+ return true;
+ }
+ else
+ {
+ nPos = nStart + 1;
+ return false;
+ }
+ }
+
+ const long nMid = nStart + ( ( nEnd - nStart ) / 2 );
+ eCompare = pEntry->CompareTo( m_pCollator, m_vEntries[ nMid ] );
+
+ if ( eCompare == COMPARE_LESS )
+ return FindEntryPos( pEntry, nStart, nMid-1, nPos );
+ else if ( eCompare == COMPARE_GREATER )
+ return FindEntryPos( pEntry, nMid+1, nEnd, nPos );
+ else
+ {
+ //Workaround.See i86963.
+ if (pEntry->m_xPackage != m_vEntries[nMid]->m_xPackage)
+ return false;
+
+ if ( m_bInCheckMode )
+ m_vEntries[ nMid ]->m_bChecked = true;
+ nPos = nMid;
+ return true;
+ }
+}
+
+//------------------------------------------------------------------------------
+long ExtensionBox_Impl::addEntry( const uno::Reference< deployment::XPackage > &xPackage,
+ const uno::Reference< deployment::XPackageManager > &xPackageManager )
+{
+ long nPos = 0;
+ PackageState eState = m_pManager->getPackageState( xPackage );
+
+ TEntry_Impl pEntry( new Entry_Impl( xPackage, xPackageManager, eState ) );
+ xPackage->addEventListener( uno::Reference< lang::XEventListener > ( m_xRemoveListener, uno::UNO_QUERY ) );
+
+ ::osl::ClearableMutexGuard guard(m_entriesMutex);
+ if ( m_vEntries.empty() )
+ {
+ pEntry->m_bHasOptions = m_pManager->supportsOptions( xPackage );
+ pEntry->m_bShared = ( m_pManager->getSharedPkgMgr() == xPackageManager );
+ pEntry->m_bNew = m_bInCheckMode;
+ m_vEntries.push_back( pEntry );
+ }
+ else
+ {
+ if ( !FindEntryPos( pEntry, 0, m_vEntries.size()-1, nPos ) )
+ {
+ pEntry->m_bHasOptions = m_pManager->supportsOptions( xPackage );
+ pEntry->m_bShared = ( m_pManager->getSharedPkgMgr() == xPackageManager );
+ pEntry->m_bNew = m_bInCheckMode;
+ m_vEntries.insert( m_vEntries.begin()+nPos, pEntry );
+ }
+ else if ( !m_bInCheckMode )
+ {
+ OSL_ENSURE( 0, "ExtensionBox_Impl::addEntry(): Will not add duplicate entries" );
+ }
+ }
+ //access to m_nActive must be guarded
+ if ( !m_bInCheckMode && m_bHasActive && ( m_nActive >= nPos ) )
+ m_nActive += 1;
+
+ guard.clear();
+
+ if ( IsReallyVisible() )
+ Invalidate();
+
+ m_bNeedsRecalc = true;
+
+ return nPos;
+}
+
+//------------------------------------------------------------------------------
+void ExtensionBox_Impl::updateEntry( const uno::Reference< deployment::XPackage > &xPackage )
+{
+ typedef std::vector< TEntry_Impl >::iterator ITER;
+ for ( ITER iIndex = m_vEntries.begin(); iIndex < m_vEntries.end(); ++iIndex )
+ {
+ if ( (*iIndex)->m_xPackage == xPackage )
+ {
+ PackageState eState = m_pManager->getPackageState( xPackage );
+ (*iIndex)->m_bHasOptions = m_pManager->supportsOptions( xPackage );
+ (*iIndex)->m_eState = eState;
+ (*iIndex)->m_sTitle = xPackage->getDisplayName();
+ (*iIndex)->m_sVersion = xPackage->getVersion();
+ (*iIndex)->m_sDescription = xPackage->getDescription();
+
+ if ( eState == AMBIGUOUS )
+ (*iIndex)->m_sErrorText = DialogHelper::getResourceString( RID_STR_ERROR_UNKNOWN_STATUS );
+ else
+ (*iIndex)->m_sErrorText = String();
+
+ if ( IsReallyVisible() )
+ Invalidate();
+ break;
+ }
+ }
+}
+
+//------------------------------------------------------------------------------
+void ExtensionBox_Impl::removeEntry( const uno::Reference< deployment::XPackage > &xPackage )
+{
+ if ( ! m_bInDelete )
+ {
+ ::osl::ClearableMutexGuard aGuard( m_entriesMutex );
+
+ typedef std::vector< TEntry_Impl >::iterator ITER;
+
+ for ( ITER iIndex = m_vEntries.begin(); iIndex < m_vEntries.end(); ++iIndex )
+ {
+ if ( (*iIndex)->m_xPackage == xPackage )
+ {
+ long nPos = iIndex - m_vEntries.begin();
+
+ // Entries mustn't removed here, because they contain a hyperlink control
+ // which can only be deleted when the thread has the solar mutex. Therefor
+ // the entry will be moved into the m_vRemovedEntries list which will be
+ // cleared on the next paint event
+ m_vRemovedEntries.push_back( *iIndex );
+ m_vEntries.erase( iIndex );
+
+ m_bNeedsRecalc = true;
+
+ if ( IsReallyVisible() )
+ Invalidate();
+
+ if ( m_bHasActive )
+ {
+ if ( nPos < m_nActive )
+ m_nActive -= 1;
+ else if ( ( nPos == m_nActive ) &&
+ ( nPos == (long) m_vEntries.size() ) )
+ m_nActive -= 1;
+
+ m_bHasActive = false;
+ //clear before calling out of this method
+ aGuard.clear();
+ selectEntry( m_nActive );
+ }
+ break;
+ }
+ }
+ }
+}
+
+//------------------------------------------------------------------------------
+void ExtensionBox_Impl::RemoveUnlocked()
+{
+ bool bAllRemoved = false;
+
+ while ( ! bAllRemoved )
+ {
+ bAllRemoved = true;
+
+ ::osl::ClearableMutexGuard aGuard( m_entriesMutex );
+
+ typedef std::vector< TEntry_Impl >::iterator ITER;
+
+ for ( ITER iIndex = m_vEntries.begin(); iIndex < m_vEntries.end(); ++iIndex )
+ {
+ if ( !(*iIndex)->m_bLocked )
+ {
+ bAllRemoved = false;
+ uno::Reference< deployment::XPackage> xPackage = (*iIndex)->m_xPackage;
+ aGuard.clear();
+ removeEntry( xPackage );
+ break;
+ }
+ }
+ }
+}
+
+//------------------------------------------------------------------------------
+void ExtensionBox_Impl::prepareChecking( const uno::Reference< deployment::XPackageManager > &xPackageMgr )
+{
+ m_bInCheckMode = true;
+ typedef std::vector< TEntry_Impl >::iterator ITER;
+ for ( ITER iIndex = m_vEntries.begin(); iIndex < m_vEntries.end(); ++iIndex )
+ {
+ if ( (*iIndex)->m_xPackageManager == xPackageMgr )
+ (*iIndex)->m_bChecked = false;
+ else
+ (*iIndex)->m_bChecked = true;
+ (*iIndex)->m_bNew = false;
+ }
+}
+
+//------------------------------------------------------------------------------
+void ExtensionBox_Impl::checkEntries()
+{
+ long nNewPos = -1;
+ long nPos = 0;
+ bool bNeedsUpdate = false;
+
+ ::osl::ClearableMutexGuard guard(m_entriesMutex);
+ typedef std::vector< TEntry_Impl >::iterator ITER;
+ ITER iIndex = m_vEntries.begin();
+ while ( iIndex < m_vEntries.end() )
+ {
+ if ( (*iIndex)->m_bChecked == false )
+ {
+ bNeedsUpdate = true;
+ nPos = iIndex-m_vEntries.begin();
+ if ( (*iIndex)->m_bNew )
+ {
+ if ( nNewPos == - 1)
+ nNewPos = nPos;
+ if ( nPos <= m_nActive )
+ m_nActive += 1;
+ }
+ }
+ iIndex++;
+ }
+ guard.clear();
+
+ m_bInCheckMode = false;
+
+ if ( nNewPos != - 1)
+ selectEntry( nNewPos );
+
+ if ( bNeedsUpdate )
+ {
+ m_bNeedsRecalc = true;
+ if ( IsReallyVisible() )
+ Invalidate();
+ }
+}
+//------------------------------------------------------------------------------
+bool ExtensionBox_Impl::isHCMode()
+{
+ return (bool)GetDisplayBackground().GetColor().IsDark();
+}
+
+//------------------------------------------------------------------------------
+void ExtensionBox_Impl::SetScrollHdl( const Link& rLink )
+{
+ if ( m_pScrollBar )
+ m_pScrollBar->SetScrollHdl( rLink );
+}
+
+// -----------------------------------------------------------------------
+void ExtensionBox_Impl::DoScroll( long nDelta )
+{
+ m_nTopIndex += nDelta;
+ Point aNewSBPt( m_pScrollBar->GetPosPixel() );
+
+ Rectangle aScrRect( Point(), GetOutputSizePixel() );
+ aScrRect.Right() -= m_pScrollBar->GetSizePixel().Width();
+ Scroll( 0, -nDelta, aScrRect );
+
+ m_pScrollBar->SetPosPixel( aNewSBPt );
+}
+
+// -----------------------------------------------------------------------
+IMPL_LINK( ExtensionBox_Impl, ScrollHdl, ScrollBar*, pScrBar )
+{
+ DoScroll( pScrBar->GetDelta() );
+
+ return 1;
+}
+
+} //namespace dp_gui
diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.hxx b/desktop/source/deployment/gui/dp_gui_extlistbox.hxx
new file mode 100644
index 0000000000..e1a17bb06d
--- /dev/null
+++ b/desktop/source/deployment/gui/dp_gui_extlistbox.hxx
@@ -0,0 +1,271 @@
+/*************************************************************************
+ *
+ * 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: dp_gui_dialog2.cxx,v $
+ *
+ * $Revision: 1.8.4.8 $
+ *
+ * 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 "rtl/ustring.hxx"
+#include "vcl/scrbar.hxx"
+#include "vcl/fixed.hxx"
+#include "vcl/dialog.hxx"
+
+#include "svtools/extensionlistbox.hxx"
+#include "svtools/fixedhyper.hxx"
+#include "cppuhelper/implbase1.hxx"
+#include "unotools/collatorwrapper.hxx"
+
+#include "com/sun/star/lang/Locale.hpp"
+#include "com/sun/star/lang/XEventListener.hpp"
+#include "com/sun/star/deployment/XPackage.hpp"
+#include "com/sun/star/deployment/XPackageManager.hpp"
+
+#include <boost/shared_ptr.hpp>
+
+namespace dp_gui {
+
+#define SMALL_ICON_SIZE 16
+#define TOP_OFFSET 3
+#define ICON_HEIGHT 42
+#define ICON_OFFSET 50
+#define RIGHT_ICON_OFFSET 5
+#define SPACE_BETWEEN 3
+
+class TheExtensionManager;
+
+typedef ::boost::shared_ptr< svt::FixedHyperlink > TFixedHyperlink;
+
+//------------------------------------------------------------------------------
+// struct Entry_Impl
+//------------------------------------------------------------------------------
+struct Entry_Impl;
+
+typedef ::boost::shared_ptr< Entry_Impl > TEntry_Impl;
+
+struct Entry_Impl
+{
+ bool m_bActive;
+ bool m_bLocked;
+ bool m_bHasOptions;
+ bool m_bShared;
+ bool m_bNew;
+ bool m_bChecked;
+ bool m_bMissingDeps;
+ PackageState m_eState;
+ String m_sTitle;
+ String m_sVersion;
+ String m_sDescription;
+ String m_sPublisher;
+ String m_sPublisherURL;
+ String m_sErrorText;
+ Image m_aIcon;
+ Image m_aIconHC;
+ svt::FixedHyperlink *m_pPublisher;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage> m_xPackage;
+ ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager> m_xPackageManager;
+
+ Entry_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &xPackage,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > &xPackageManager,
+ PackageState eState );
+ ~Entry_Impl();
+
+ StringCompare CompareTo( const CollatorWrapper *pCollator, const TEntry_Impl pEntry ) const;
+ void checkDependencies();
+};
+
+//------------------------------------------------------------------------------
+// class ExtensionBox_Impl
+//------------------------------------------------------------------------------
+
+class ExtensionBox_Impl;
+
+//------------------------------------------------------------------------------
+class ExtensionRemovedListener : public ::cppu::WeakImplHelper1< ::com::sun::star::lang::XEventListener >
+{
+ ExtensionBox_Impl *m_pParent;
+
+public:
+
+ ExtensionRemovedListener( ExtensionBox_Impl *pParent ) { m_pParent = pParent; }
+ ~ExtensionRemovedListener();
+
+ //===================================================================================
+ // XEventListener
+ virtual void SAL_CALL disposing( ::com::sun::star::lang::EventObject const & evt )
+ throw (::com::sun::star::uno::RuntimeException);
+};
+
+//------------------------------------------------------------------------------
+class ExtensionBox_Impl : public ::svt::IExtensionListBox
+{
+ bool m_bHasScrollBar;
+ bool m_bHasActive;
+ bool m_bNeedsRecalc;
+ bool m_bHasNew;
+ bool m_bInCheckMode;
+ bool m_bAdjustActive;
+ bool m_bInDelete;
+ //Must be guarded together with m_vEntries to ensure a valid index at all times.
+ //Use m_entriesMutex as guard.
+ long m_nActive;
+ long m_nTopIndex;
+ long m_nStdHeight;
+ long m_nActiveHeight;
+ long m_nExtraHeight;
+ Size m_aOutputSize;
+ Image m_aLockedImage;
+ Image m_aLockedImageHC;
+ Image m_aWarningImage;
+ Image m_aWarningImageHC;
+ Image m_aDefaultImage;
+ Image m_aDefaultImageHC;
+ Link m_aClickHdl;
+
+ ScrollBar *m_pScrollBar;
+
+ com::sun::star::uno::Reference< ExtensionRemovedListener > m_xRemoveListener;
+
+ TheExtensionManager *m_pManager;
+ //This mutex is used for synchronizing access to m_vEntries.
+ //Currently it is used to synchronize adding, removing entries and
+ //functions like getItemName, getItemDescription, etc. to prevent
+ //that m_vEntries is accessed at an invalid index.
+ //ToDo: There are many more places where m_vEntries is read and which may
+ //fail. For example the Paint method is probable called from the main thread
+ //while new entries are added / removed in a separate thread.
+ mutable ::osl::Mutex m_entriesMutex;
+ std::vector< TEntry_Impl > m_vEntries;
+ std::vector< TEntry_Impl > m_vRemovedEntries;
+
+ ::com::sun::star::lang::Locale *m_pLocale;
+ CollatorWrapper *m_pCollator;
+
+ void CalcActiveHeight( const long nPos );
+ long GetTotalHeight() const;
+ void SetupScrollBar();
+ void DrawRow( const Rectangle& rRect, const TEntry_Impl pEntry );
+ bool HandleTabKey( bool bReverse );
+ bool HandleCursorKey( USHORT nKeyCode );
+ bool FindEntryPos( const TEntry_Impl pEntry, long nStart, long nEnd, long &nFound );
+ bool isHCMode();
+ void DeleteRemoved();
+
+ //-----------------
+ DECL_DLLPRIVATE_LINK( ScrollHdl, ScrollBar * );
+
+ //Index starts with 1.
+ //Throws an com::sun::star::lang::IllegalArgumentException, when the index is invalid.
+ void checkIndex(sal_Int32 pos) const;
+
+
+public:
+ ExtensionBox_Impl( Dialog* pParent, TheExtensionManager *pManager );
+ ~ExtensionBox_Impl();
+
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void Paint( const Rectangle &rPaintRect );
+ virtual void Resize();
+ virtual long Notify( NotifyEvent& rNEvt );
+
+ const Size GetMinOutputSizePixel() const;
+ void SetExtraSize( long nSize ) { m_nExtraHeight = nSize; }
+ TEntry_Impl GetEntryData( long nPos ) { return m_vEntries[ nPos ]; }
+ long GetEntryCount() { return (long) m_vEntries.size(); }
+ Rectangle GetEntryRect( const long nPos ) const;
+ bool HasActive() { return m_bHasActive; }
+ long PointToPos( const Point& rPos );
+ void SetScrollHdl( const Link& rLink );
+ void DoScroll( long nDelta );
+ void SetHyperlinkHdl( const Link& rLink ){ m_aClickHdl = rLink; }
+ virtual void RecalcAll();
+ void RemoveUnlocked();
+
+ //-----------------
+ virtual void selectEntry( const long nPos );
+ long addEntry( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &xPackage,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > &xPackageManager );
+ void updateEntry( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &xPackage );
+ void removeEntry( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &xPackage );
+
+ void prepareChecking( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > &xPackageMgr );
+ void checkEntries();
+
+ TheExtensionManager* getExtensionManager() const { return m_pManager; }
+
+ //===================================================================================
+ //These functions are used for automatic testing
+
+ /** @return The count of the entries in the list box. */
+ virtual sal_Int32 getItemCount() const;
+
+ /** @return The index of the first selected entry in the list box.
+ When nothing is selected, which is the case when getItemCount returns '0',
+ then this function returns EXTENSION_LISTBOX_ENTRY_NOTFOUND */
+ virtual sal_Int32 getSelIndex() const;
+
+ /** @return The item name of the entry with the given index
+ The index starts with 0.
+ Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
+ virtual ::rtl::OUString getItemName( sal_Int32 index ) const;
+
+ /** @return The version string of the entry with the given index
+ The index starts with 0.
+ Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
+ virtual ::rtl::OUString getItemVersion( sal_Int32 index ) const;
+
+ /** @return The description string of the entry with the given index
+ The index starts with 0.
+ Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
+ virtual ::rtl::OUString getItemDescription( sal_Int32 index ) const;
+
+ /** @return The publisher string of the entry with the given index
+ The index starts with 0.
+ Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
+ virtual ::rtl::OUString getItemPublisher( sal_Int32 index ) const;
+
+ /** @return The link behind the publisher text of the entry with the given index
+ The index starts with 0.
+ Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
+ virtual ::rtl::OUString getItemPublisherLink( sal_Int32 index ) const;
+
+ /** The entry at the given position will be selected
+ Index starts with 0.
+ Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
+ virtual void select( sal_Int32 pos );
+
+ /** The first found entry with the given name will be selected
+ When there was no entry found with the name, the selection doesn't change.
+ Please note that there might be more than one entry with the same
+ name, because:
+ 1. the name is not unique
+ 2. one extension can be installed as user and shared extension.
+ */
+ virtual void select( const ::rtl::OUString & sName );
+};
+
+}
diff --git a/desktop/source/deployment/gui/dp_gui_service.cxx b/desktop/source/deployment/gui/dp_gui_service.cxx
index 32b80b78d0..7425c14ae4 100644
--- a/desktop/source/deployment/gui/dp_gui_service.cxx
+++ b/desktop/source/deployment/gui/dp_gui_service.cxx
@@ -48,6 +48,7 @@
#include "boost/bind.hpp"
#include "license_dialog.hxx"
+#include "dp_gui_dialog2.hxx"
using namespace ::dp_misc;
using namespace ::com::sun::star;
@@ -271,27 +272,28 @@ void ServiceImpl::startExecuteModal(
{
const ::vos::OGuard guard( Application::GetSolarMutex() );
- ::rtl::Reference< ::dp_gui::TheExtensionManager > dialog(
+ ::rtl::Reference< ::dp_gui::TheExtensionManager > myExtMgr(
::dp_gui::TheExtensionManager::get(
m_xComponentContext,
m_parent ? *m_parent : Reference<awt::XWindow>(),
m_extensionURL ? *m_extensionURL : OUString() ) );
+ myExtMgr->createDialog( false );
if (m_initialTitle.getLength() > 0) {
- dialog->SetText( m_initialTitle );
+ myExtMgr->SetText( m_initialTitle );
m_initialTitle = OUString();
}
if ( m_bShowUpdateOnly )
{
- dialog->checkUpdates( true, !bCloseDialog );
+ myExtMgr->checkUpdates( true, !bCloseDialog );
if ( bCloseDialog )
- dialog->Close();
+ myExtMgr->Close();
else
- dialog->ToTop( TOTOP_RESTOREWHENMIN );
+ myExtMgr->ToTop( TOTOP_RESTOREWHENMIN );
}
else
{
- dialog->Show();
- dialog->ToTop( TOTOP_RESTOREWHENMIN );
+ myExtMgr->Show();
+ myExtMgr->ToTop( TOTOP_RESTOREWHENMIN );
}
}
@@ -331,6 +333,12 @@ sdecl::ServiceDecl const licenseDecl(
licenseSI,
"com.sun.star.comp.deployment.ui.LicenseDialog",
"com.sun.star.deployment.ui.LicenseDialog" );
+
+sdecl::class_<UpdateRequiredDialogService, sdecl::with_args<true> > updateSI;
+sdecl::ServiceDecl const updateDecl(
+ updateSI,
+ "com.sun.star.comp.deployment.ui.UpdateRequiredDialog",
+ "com.sun.star.deployment.ui.UpdateRequiredDialog" );
} // namespace dp_gui
extern "C" {
@@ -346,7 +354,7 @@ sal_Bool SAL_CALL component_writeInfo(
registry::XRegistryKey * pRegistryKey )
{
return component_writeInfoHelper(
- pServiceManager, pRegistryKey, dp_gui::serviceDecl, dp_gui::licenseDecl );
+ pServiceManager, pRegistryKey, dp_gui::serviceDecl, dp_gui::licenseDecl, dp_gui::updateDecl );
}
void * SAL_CALL component_getFactory(
@@ -355,7 +363,7 @@ void * SAL_CALL component_getFactory(
registry::XRegistryKey * pRegistryKey )
{
return component_getFactoryHelper(
- pImplName, pServiceManager, pRegistryKey, dp_gui::serviceDecl, dp_gui::licenseDecl );
+ pImplName, pServiceManager, pRegistryKey, dp_gui::serviceDecl, dp_gui::licenseDecl, dp_gui::updateDecl );
}
} // extern "C"
diff --git a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
index e5bdb36ecb..82577c614a 100644
--- a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
+++ b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
@@ -66,7 +66,10 @@ namespace dp_gui {
TheExtensionManager::TheExtensionManager( Window *pParent,
const uno::Reference< uno::XComponentContext > &xContext ) :
- m_xContext( xContext )
+ m_xContext( xContext ),
+ m_pParent( pParent ),
+ m_pExtMgrDialog( NULL ),
+ m_pUpdReqDialog( NULL )
{
if ( dp_misc::office_is_running() )
{
@@ -76,10 +79,6 @@ TheExtensionManager::TheExtensionManager( Window *pParent,
m_xDesktop->addTerminateListener( this );
}
- m_pDialog = new ExtMgrDialog( pParent, this );
-
- m_pExecuteCmdQueue.reset( new ExtensionCmdQueue( m_pDialog, this, xContext ) );
-
m_sPackageManagers.realloc(2);
m_sPackageManagers[0] = deployment::thePackageManagerFactory::get( m_xContext )->getPackageManager( OUSTR("user") );
m_sPackageManagers[1] = deployment::thePackageManagerFactory::get( m_xContext )->getPackageManager( OUSTR("shared") );;
@@ -110,21 +109,43 @@ TheExtensionManager::TheExtensionManager( Window *pParent,
uno::Sequence< uno::Any >( args, 1 )), uno::UNO_QUERY_THROW);
try
{ //throws css::container::NoSuchElementException, css::lang::WrappedTargetException
- OUString sURL;
uno::Any value = xNameAccessRepositories->getByName( OUSTR( "WebsiteLink" ) );
- sURL = value.get< OUString > ();
- m_pDialog->setGetExtensionsURL( sURL );
+ m_sGetExtensionsURL = value.get< OUString > ();
}
catch ( uno::Exception& )
{}
-
- createPackageList();
}
//------------------------------------------------------------------------------
TheExtensionManager::~TheExtensionManager()
{
- delete m_pDialog;
+ if ( m_pUpdReqDialog )
+ delete m_pUpdReqDialog;
+ if ( m_pExtMgrDialog )
+ delete m_pExtMgrDialog;
+}
+
+//------------------------------------------------------------------------------
+void TheExtensionManager::createDialog( const bool bCreateUpdDlg )
+{
+ const ::vos::OGuard guard( Application::GetSolarMutex() );
+
+ if ( bCreateUpdDlg )
+ {
+ if ( !m_pUpdReqDialog )
+ {
+ m_pUpdReqDialog = new UpdateRequiredDialog( NULL, this );
+ m_pExecuteCmdQueue.reset( new ExtensionCmdQueue( (DialogHelper*) m_pUpdReqDialog, this, m_xContext ) );
+ createPackageList();
+ }
+ }
+ else if ( !m_pExtMgrDialog )
+ {
+ m_pExtMgrDialog = new ExtMgrDialog( m_pParent, this );
+ m_pExecuteCmdQueue.reset( new ExtensionCmdQueue( (DialogHelper*) m_pExtMgrDialog, this, m_xContext ) );
+ m_pExtMgrDialog->setGetExtensionsURL( m_sGetExtensionsURL );
+ createPackageList();
+ }
}
//------------------------------------------------------------------------------
@@ -132,7 +153,7 @@ void TheExtensionManager::Show()
{
const ::vos::OGuard guard( Application::GetSolarMutex() );
- m_pDialog->Show();
+ getDialog()->Show();
}
//------------------------------------------------------------------------------
@@ -140,7 +161,7 @@ void TheExtensionManager::SetText( const ::rtl::OUString &rTitle )
{
const ::vos::OGuard guard( Application::GetSolarMutex() );
- m_pDialog->SetText( rTitle );
+ getDialog()->SetText( rTitle );
}
//------------------------------------------------------------------------------
@@ -148,25 +169,69 @@ void TheExtensionManager::ToTop( USHORT nFlags )
{
const ::vos::OGuard guard( Application::GetSolarMutex() );
- m_pDialog->ToTop( nFlags );
+ getDialog()->ToTop( nFlags );
}
//------------------------------------------------------------------------------
bool TheExtensionManager::Close()
{
- return m_pDialog->Close();
+ if ( m_pExtMgrDialog )
+ return m_pExtMgrDialog->Close();
+ else if ( m_pUpdReqDialog )
+ return m_pUpdReqDialog->Close();
+ else
+ return true;
+}
+
+//------------------------------------------------------------------------------
+sal_Int16 TheExtensionManager::execute()
+{
+ sal_Int16 nRet = 0;
+
+ if ( m_pUpdReqDialog )
+ {
+ nRet = m_pUpdReqDialog->Execute();
+ delete m_pUpdReqDialog;
+ m_pUpdReqDialog = NULL;
+ }
+
+ return nRet;
}
//------------------------------------------------------------------------------
bool TheExtensionManager::isVisible()
{
- return m_pDialog->IsVisible();
+ return getDialog()->IsVisible();
}
//------------------------------------------------------------------------------
bool TheExtensionManager::checkUpdates( bool /* bShowUpdateOnly */, bool /*bParentVisible*/ )
{
- m_pExecuteCmdQueue->checkForUpdates( m_sPackageManagers );
+ std::vector< TUpdateListEntry > vEntries;
+
+ for ( sal_Int32 i = 0; i < m_sPackageManagers.getLength(); ++i )
+ {
+ uno::Sequence< uno::Reference< deployment::XPackage > > xPackages;
+ try {
+ xPackages = m_sPackageManagers[i]->getDeployedPackages( uno::Reference< task::XAbortChannel >(),
+ uno::Reference< ucb::XCommandEnvironment >() );
+ for ( sal_Int32 k = 0; k < xPackages.getLength(); ++k )
+ {
+ TUpdateListEntry pEntry( new UpdateListEntry( xPackages[k], m_sPackageManagers[i] ) );
+ vEntries.push_back( pEntry );
+ }
+ } catch ( deployment::DeploymentException & ) {
+ continue;
+ } catch ( ucb::CommandFailedException & ) {
+ continue;
+ } catch ( ucb::CommandAbortedException & ) {
+ return true;
+ } catch ( lang::IllegalArgumentException & e ) {
+ throw uno::RuntimeException( e.Message, e.Context );
+ }
+ }
+
+ m_pExecuteCmdQueue->checkForUpdates( vEntries );
return true;
}
@@ -189,10 +254,9 @@ bool TheExtensionManager::removePackage( const uno::Reference< deployment::XPack
}
//------------------------------------------------------------------------------
-bool TheExtensionManager::updatePackage( const uno::Reference< deployment::XPackageManager > &xPackageManager,
- const uno::Reference< deployment::XPackage > &xPackage )
+bool TheExtensionManager::updatePackages( const std::vector< TUpdateListEntry > &vList )
{
- m_pExecuteCmdQueue->checkForUpdate( xPackageManager, xPackage );
+ m_pExecuteCmdQueue->checkForUpdates( vList );
return true;
}
@@ -203,6 +267,8 @@ bool TheExtensionManager::installPackage( const OUString &rPackageURL, bool bWar
if ( rPackageURL.getLength() == 0 )
return false;
+ createDialog( false );
+
uno::Reference< deployment::XPackageManager > xUserPkgMgr = getUserPkgMgr();
uno::Reference< deployment::XPackageManager > xSharedPkgMgr = getSharedPkgMgr();
@@ -210,7 +276,7 @@ bool TheExtensionManager::installPackage( const OUString &rPackageURL, bool bWar
bool bInstallForAll = false;
if ( !bWarnUser && ! xSharedPkgMgr->isReadOnly() )
- bInstall = m_pDialog->installForAllUsers( bInstallForAll );
+ bInstall = getDialogHelper()->installForAllUsers( bInstallForAll );
if ( !bInstall )
return false;
@@ -239,8 +305,10 @@ void TheExtensionManager::terminateDialog()
if ( ! dp_misc::office_is_running() )
{
const ::vos::OGuard guard( Application::GetSolarMutex() );
- delete m_pDialog;
- m_pDialog = NULL;
+ delete m_pExtMgrDialog;
+ m_pExtMgrDialog = NULL;
+ delete m_pUpdReqDialog;
+ m_pUpdReqDialog = NULL;
Application::Quit();
}
}
@@ -252,7 +320,7 @@ bool TheExtensionManager::createPackageList( const uno::Reference< deployment::X
try {
packages = xPackageManager->getDeployedPackages( uno::Reference< task::XAbortChannel >(),
- uno::Reference< ucb::XCommandEnvironment >() );
+ uno::Reference< ucb::XCommandEnvironment >() );
} catch ( deployment::DeploymentException & ) {
//handleGeneralError(e.Cause);
return true;
@@ -267,7 +335,7 @@ bool TheExtensionManager::createPackageList( const uno::Reference< deployment::X
for ( sal_Int32 j = 0; j < packages.getLength(); ++j )
{
- m_pDialog->addPackageToList( packages[j], xPackageManager );
+ getDialogHelper()->addPackageToList( packages[j], xPackageManager );
}
return true;
@@ -381,8 +449,10 @@ void TheExtensionManager::disposing( lang::EventObject const & rEvt )
if ( dp_misc::office_is_running() )
{
const ::vos::OGuard guard( Application::GetSolarMutex() );
- delete m_pDialog;
- m_pDialog = NULL;
+ delete m_pExtMgrDialog;
+ m_pExtMgrDialog = NULL;
+ delete m_pUpdReqDialog;
+ m_pUpdReqDialog = NULL;
}
s_ExtMgr.clear();
}
@@ -393,15 +463,22 @@ void TheExtensionManager::disposing( lang::EventObject const & rEvt )
void TheExtensionManager::queryTermination( ::lang::EventObject const & )
throw ( frame::TerminationVetoException, uno::RuntimeException )
{
- if ( m_pExecuteCmdQueue->isBusy() || ( m_pDialog && m_pDialog->isBusy() ) )
+ DialogHelper *pDialogHelper = getDialogHelper();
+
+ if ( m_pExecuteCmdQueue->isBusy() || ( pDialogHelper && pDialogHelper->isBusy() ) )
{
ToTop( TOTOP_RESTOREWHENMIN );
throw frame::TerminationVetoException(
OUSTR("The office cannot be closed while the Extension Manager is running"),
uno::Reference<XInterface>(static_cast<frame::XTerminateListener*>(this), uno::UNO_QUERY));
}
- else if ( m_pDialog )
- m_pDialog->Close();
+ else
+ {
+ if ( m_pExtMgrDialog )
+ m_pExtMgrDialog->Close();
+ if ( m_pUpdReqDialog )
+ m_pUpdReqDialog->Close();
+ }
}
//------------------------------------------------------------------------------
@@ -419,9 +496,9 @@ void TheExtensionManager::modified( ::lang::EventObject const & rEvt )
uno::Reference< deployment::XPackageManager > xPackageManager( rEvt.Source, uno::UNO_QUERY );
if ( xPackageManager.is() )
{
- m_pDialog->prepareChecking( xPackageManager );
+ getDialogHelper()->prepareChecking( xPackageManager );
createPackageList( xPackageManager );
- m_pDialog->checkEntries();
+ getDialogHelper()->checkEntries();
}
}
@@ -433,7 +510,8 @@ void TheExtensionManager::modified( ::lang::EventObject const & rEvt )
if ( s_ExtMgr.is() )
{
OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
- s_ExtMgr->installPackage( extensionURL, true );
+ if ( extensionURL.getLength() )
+ s_ExtMgr->installPackage( extensionURL, true );
return s_ExtMgr;
}
@@ -450,7 +528,8 @@ void TheExtensionManager::modified( ::lang::EventObject const & rEvt )
s_ExtMgr = that;
}
- s_ExtMgr->installPackage( extensionURL, true );
+ if ( extensionURL.getLength() )
+ s_ExtMgr->installPackage( extensionURL, true );
return s_ExtMgr;
}
diff --git a/desktop/source/deployment/gui/dp_gui_theextmgr.hxx b/desktop/source/deployment/gui/dp_gui_theextmgr.hxx
index d2e9a5a444..982fb00c83 100644
--- a/desktop/source/deployment/gui/dp_gui_theextmgr.hxx
+++ b/desktop/source/deployment/gui/dp_gui_theextmgr.hxx
@@ -44,12 +44,13 @@
#include "com/sun/star/util/XModifyListener.hpp"
#include "dp_gui.h"
+#include "dp_gui_dialog2.hxx"
+#include "dp_gui_updatedata.hxx"
//==============================================================================
namespace dp_gui {
//------------------------------------------------------------------------------
-class ExtMgrDialog;
class ExtensionCmdQueue;
//------------------------------------------------------------------------------
@@ -65,7 +66,11 @@ private:
::std::auto_ptr< ExtensionCmdQueue > m_pExecuteCmdQueue;
- ExtMgrDialog *m_pDialog;
+ Window *m_pParent;
+ ExtMgrDialog *m_pExtMgrDialog;
+ UpdateRequiredDialog *m_pUpdReqDialog;
+
+ ::rtl::OUString m_sGetExtensionsURL;
// liste der packages ( xpackage?, mit parent manager, ... )
@@ -79,6 +84,12 @@ public:
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > &xContext );
~TheExtensionManager();
+ void createDialog( const bool bCreateUpdDlg );
+ sal_Int16 execute();
+
+ Dialog* getDialog() { return m_pExtMgrDialog ? (Dialog*) m_pExtMgrDialog : (Dialog*) m_pUpdReqDialog; }
+ DialogHelper* getDialogHelper() { return m_pExtMgrDialog ? (DialogHelper*) m_pExtMgrDialog : (DialogHelper*) m_pUpdReqDialog; }
+
void SetText( const ::rtl::OUString &rTitle );
void Show();
void ToTop( USHORT nFlags );
@@ -87,12 +98,12 @@ public:
//-----------------
bool checkUpdates( bool showUpdateOnly, bool parentVisible );
+ bool updatePackages( const std::vector< TUpdateListEntry > &vList );
+
bool enablePackage( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &xPackage,
bool bEnable );
bool removePackage( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > &xPackageManager,
const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &xPackage );
- bool updatePackage( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > &xPackageManager,
- const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &xPackage );
bool installPackage( const ::rtl::OUString &rPackageURL, bool bWarnUser = false );
bool queryTermination();
diff --git a/desktop/source/deployment/gui/dp_gui_updatedata.hxx b/desktop/source/deployment/gui/dp_gui_updatedata.hxx
index 8678bb9991..a764c63c01 100644
--- a/desktop/source/deployment/gui/dp_gui_updatedata.hxx
+++ b/desktop/source/deployment/gui/dp_gui_updatedata.hxx
@@ -34,6 +34,8 @@
#include "rtl/ustring.hxx"
#include "com/sun/star/uno/Reference.hxx"
+#include <boost/shared_ptr.hpp>
+
namespace com { namespace sun { namespace star { namespace deployment {
class XPackageManager;
@@ -46,6 +48,19 @@ namespace com { namespace sun { namespace star { namespace xml { namespace dom {
namespace dp_gui {
+struct UpdateListEntry
+{
+ ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage> m_xPackage;
+ ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager> m_xPackageManager;
+
+ UpdateListEntry( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &xPackage,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > &xPackageManager );
+ ~UpdateListEntry();
+};
+
+typedef ::boost::shared_ptr< UpdateListEntry > TUpdateListEntry;
+
+
struct UpdateData
{
::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > aInstalledPackage;
diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
index c26284a8be..ea05a7394b 100644
--- a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
+++ b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
@@ -229,9 +229,7 @@ public:
Thread(
css::uno::Reference< css::uno::XComponentContext > const & context,
UpdateDialog & dialog,
- rtl::Reference< dp_gui::SelectedPackage > const & selectedPackage,
- css::uno::Sequence< css::uno::Reference<
- css::deployment::XPackageManager > > const & packageManagers);
+ const std::vector< TUpdateListEntry > &vExtensionList);
void stop();
@@ -285,9 +283,7 @@ private:
css::uno::Reference< css::uno::XComponentContext > m_context;
UpdateDialog & m_dialog;
- rtl::Reference< dp_gui::SelectedPackage > m_selectedPackage;
- css::uno::Sequence< css::uno::Reference<
- css::deployment::XPackageManager > > m_packageManagers;
+ std::vector< dp_gui::TUpdateListEntry > m_vExtensionList;
css::uno::Reference< css::deployment::XUpdateInformationProvider >
m_updateInformation;
@@ -299,13 +295,10 @@ private:
UpdateDialog::Thread::Thread(
css::uno::Reference< css::uno::XComponentContext > const & context,
UpdateDialog & dialog,
- rtl::Reference< dp_gui::SelectedPackage > const & selectedPackage,
- css::uno::Sequence< css::uno::Reference<
- css::deployment::XPackageManager > > const & packageManagers):
+ const std::vector< dp_gui::TUpdateListEntry > &vExtensionList):
m_context(context),
m_dialog(dialog),
- m_selectedPackage(selectedPackage),
- m_packageManagers(packageManagers),
+ m_vExtensionList(vExtensionList),
m_updateInformation(
css::deployment::UpdateInformationProvider::create(context)),
m_stop(false)
@@ -336,55 +329,28 @@ UpdateDialog::Thread::Entry::Entry(
UpdateDialog::Thread::~Thread() {}
-void UpdateDialog::Thread::execute() {
- OSL_ASSERT(m_selectedPackage.is() != (m_packageManagers.getLength() != 0));
+void UpdateDialog::Thread::execute()
+{
+ OSL_ASSERT( ! m_vExtensionList.empty() );
Map map;
- if (m_selectedPackage.is()) {
- css::uno::Reference< css::deployment::XPackage > p = m_selectedPackage->getPackage();
- css::uno::Reference< css::deployment::XPackageManager > m= m_selectedPackage->getPackageManager();
+
+ typedef std::vector< TUpdateListEntry >::const_iterator ITER;
+ for ( ITER iIndex = m_vExtensionList.begin(); iIndex < m_vExtensionList.end(); ++iIndex )
+ {
+ css::uno::Reference< css::deployment::XPackage > p = (*iIndex)->m_xPackage;
+ css::uno::Reference< css::deployment::XPackageManager > m = (*iIndex)->m_xPackageManager;
if ( p.is() )
{
- handle(p, m, &map);
- }
- } else {
- for (sal_Int32 i = 0; i < m_packageManagers.getLength(); ++i) {
- css::uno::Reference< css::task::XAbortChannel > abort(
- m_packageManagers[i]->createAbortChannel());
{
- vos::OGuard g(Application::GetSolarMutex());
- if (m_stop) {
+ vos::OGuard g( Application::GetSolarMutex() );
+ if ( m_stop ) {
return;
}
- m_abort = abort;
- }
- css::uno::Sequence<
- css::uno::Reference< css::deployment::XPackage > > ps;
- try {
- ps = m_packageManagers[i]->getDeployedPackages(
- abort,
- css::uno::Reference< css::ucb::XCommandEnvironment >());
- } catch (css::deployment::DeploymentException & e) {
- handleGeneralError(e.Cause);
- continue;
- } catch (css::ucb::CommandFailedException & e) {
- handleGeneralError(e.Reason);
- continue;
- } catch (css::ucb::CommandAbortedException &) {
- return;
- } catch (css::lang::IllegalArgumentException & e) {
- throw css::uno::RuntimeException(e.Message, e.Context);
- }
- for (sal_Int32 j = 0; j < ps.getLength(); ++j) {
- {
- vos::OGuard g(Application::GetSolarMutex());
- if (m_stop) {
- return;
- }
- }
- handle(ps[j], m_packageManagers[i], &map);
}
+ handle( p, m, &map );
}
}
+
if (!map.empty()) {
const rtl::OUString sDefaultURL(dp_misc::getExtensionDefaultUpdateURL());
if (sDefaultURL.getLength())
@@ -597,9 +563,7 @@ bool UpdateDialog::Thread::update(
UpdateDialog::UpdateDialog(
css::uno::Reference< css::uno::XComponentContext > const & context,
Window * parent,
- rtl::Reference< dp_gui::SelectedPackage > const & selectedPackage,
- css::uno::Sequence< css::uno::Reference<
- css::deployment::XPackageManager > > const & packageManagers,
+ const std::vector< dp_gui::TUpdateListEntry > &vExtensionList,
std::vector< dp_gui::UpdateData > * updateData):
ModalDialog(parent,DpGuiResId(RID_DLG_UPDATE)),
m_context(context),
@@ -636,14 +600,12 @@ UpdateDialog::UpdateDialog(
m_updateData(*updateData),
m_thread(
new UpdateDialog::Thread(
- context, *this, selectedPackage,
- packageManagers)),
+ context, *this, vExtensionList)),
m_nFirstLineDelta(0),
m_nOneLineMissing(0)
// TODO: check!
// ,
// m_extensionManagerDialog(extensionManagerDialog)
-
{
OSL_ASSERT(updateData != NULL);
css::uno::Reference< css::awt::XToolkit > toolkit;
@@ -1310,4 +1272,3 @@ IMPL_LINK( UpdateDialog, hyperlink_clicked, svt::FixedHyperlink*, pHyperlink )
return 1;
}
-
diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.hxx b/desktop/source/deployment/gui/dp_gui_updatedialog.hxx
index 8251e910c7..080148189e 100644
--- a/desktop/source/deployment/gui/dp_gui_updatedialog.hxx
+++ b/desktop/source/deployment/gui/dp_gui_updatedialog.hxx
@@ -48,6 +48,7 @@
#include <svtools/fixedhyper.hxx>
#include "descedit.hxx"
+#include "dp_gui_updatedata.hxx"
/// @HTML
@@ -56,18 +57,14 @@ class KeyEvent;
class MouseEvent;
class ResId;
class Window;
+
namespace com { namespace sun { namespace star {
namespace awt { class XThrobber; }
namespace deployment { class XPackageManager; }
namespace uno { class XComponentContext; }
} } }
-namespace dp_gui {
- class SelectedPackage;
- struct UpdateData;
-}
namespace dp_gui {
-
/**
The modal &ldquo;Check for Updates&rdquo; dialog.
*/
@@ -92,13 +89,9 @@ public:
if non-null, check for updates for all managed packages
*/
UpdateDialog(
- com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
- const & context,
+ com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > const & context,
Window * parent,
- rtl::Reference< dp_gui::SelectedPackage > const & selectedPackage,
- com::sun::star::uno::Sequence< com::sun::star::uno::Reference<
- com::sun::star::deployment::XPackageManager > > const &
- packageManagers,
+ const std::vector< dp_gui::TUpdateListEntry > &vExtensionList,
std::vector< dp_gui::UpdateData > * updateData);
~UpdateDialog();
diff --git a/desktop/source/deployment/gui/makefile.mk b/desktop/source/deployment/gui/makefile.mk
index e3211ab7f7..4d563ae159 100644
--- a/desktop/source/deployment/gui/makefile.mk
+++ b/desktop/source/deployment/gui/makefile.mk
@@ -50,6 +50,7 @@ DLLPRE =
SLOFILES = \
$(SLO)$/dp_gui_service.obj \
+ $(SLO)$/dp_gui_extlistbox.obj \
$(SLO)$/dp_gui_dialog2.obj \
$(SLO)$/dp_gui_theextmgr.obj \
$(SLO)$/license_dialog.obj \
diff --git a/desktop/source/deployment/registry/dp_backend.cxx b/desktop/source/deployment/registry/dp_backend.cxx
index 5bdb990803..f37a9d5bfe 100644
--- a/desktop/source/deployment/registry/dp_backend.cxx
+++ b/desktop/source/deployment/registry/dp_backend.cxx
@@ -296,6 +296,7 @@ sal_Bool Package::isBundle() throw (RuntimeException)
return false; // default
}
+//______________________________________________________________________________
::sal_Bool Package::checkPrerequisites(
const css::uno::Reference< css::task::XAbortChannel >&,
const css::uno::Reference< css::ucb::XCommandEnvironment >&,
@@ -308,6 +309,16 @@ sal_Bool Package::isBundle() throw (RuntimeException)
return true;
}
+//______________________________________________________________________________
+::sal_Bool Package::checkDependencies(
+ const css::uno::Reference< css::ucb::XCommandEnvironment >& )
+ throw (css::deployment::DeploymentException,
+ css::ucb::CommandFailedException,
+ css::uno::RuntimeException)
+{
+ return true;
+}
+
//______________________________________________________________________________
Sequence< Reference<deployment::XPackage> > Package::getBundle(
diff --git a/desktop/source/deployment/registry/help/dp_help.src b/desktop/source/deployment/registry/help/dp_help.src
index a3d154c47f..4d1ccfaf36 100644
--- a/desktop/source/deployment/registry/help/dp_help.src
+++ b/desktop/source/deployment/registry/help/dp_help.src
@@ -42,6 +42,6 @@ String RID_STR_HELPPROCESSING_GENERAL_ERROR
String RID_STR_HELPPROCESSING_XMLPARSING_ERROR
{
- Text [ en-US ] = "The extension will not be installed because an error occured in the Help files:\n";
+ Text [ en-US ] = "The extension will not be installed because an error occurred in the Help files:\n";
};
diff --git a/desktop/source/deployment/registry/inc/dp_backend.h b/desktop/source/deployment/registry/inc/dp_backend.h
index 95d56c26ff..5ce311d1dc 100644
--- a/desktop/source/deployment/registry/inc/dp_backend.h
+++ b/desktop/source/deployment/registry/inc/dp_backend.h
@@ -177,6 +177,12 @@ public:
css::ucb::CommandAbortedException,
css::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL checkDependencies(
+ const css::uno::Reference< css::ucb::XCommandEnvironment >& xCmdEnv )
+ throw (css::deployment::DeploymentException,
+ css::ucb::CommandFailedException,
+ css::uno::RuntimeException);
+
virtual void SAL_CALL registerPackage(
css::uno::Reference<css::task::XAbortChannel> const & xAbortChannel,
css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv )
diff --git a/desktop/source/deployment/registry/package/dp_package.cxx b/desktop/source/deployment/registry/package/dp_package.cxx
index 2f6a0091e2..98f80df964 100644
--- a/desktop/source/deployment/registry/package/dp_package.cxx
+++ b/desktop/source/deployment/registry/package/dp_package.cxx
@@ -205,6 +205,12 @@ class BackendImpl : public ImplBaseT
css::ucb::CommandAbortedException,
css::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL checkDependencies(
+ const css::uno::Reference< css::ucb::XCommandEnvironment >& xCmdEnv )
+ throw (css::deployment::DeploymentException,
+ css::ucb::CommandFailedException,
+ css::uno::RuntimeException);
+
virtual beans::Optional<OUString> SAL_CALL getIdentifier()
throw (RuntimeException);
@@ -702,6 +708,22 @@ bool BackendImpl::PackageImpl::checkDependencies(
&& checkLicense(xCmdEnv, *spDescription, bInstalled, aContextName);
}
+::sal_Bool BackendImpl::PackageImpl::checkDependencies(
+ const css::uno::Reference< css::ucb::XCommandEnvironment >& xCmdEnv )
+ throw (css::deployment::DeploymentException,
+ css::ucb::CommandFailedException,
+ css::uno::RuntimeException)
+{
+ std::auto_ptr<ExtensionDescription> spDescription;
+ try {
+ spDescription.reset(
+ new ExtensionDescription( getMyBackend()->getComponentContext(), m_url_expanded, xCmdEnv ));
+ } catch (NoDescriptionException& ) {
+ return sal_True;
+ }
+ return checkDependencies(xCmdEnv, *spDescription);
+}
+
beans::Optional<OUString> BackendImpl::PackageImpl::getIdentifier()
throw (RuntimeException)
{
diff --git a/desktop/source/inc/helpid.hrc b/desktop/source/inc/helpid.hrc
index 86759a456a..6532e1687e 100644
--- a/desktop/source/inc/helpid.hrc
+++ b/desktop/source/inc/helpid.hrc
@@ -66,7 +66,11 @@
#define HID_EXTENSION_MANAGER_LISTBOX_DISABLE (HID_DESKTOP_START + 26)
#define HID_EXTENSION_MANAGER_LISTBOX_REMOVE (HID_DESKTOP_START + 27)
-#define ACT_DESKTOP_HID_END HID_EXTENSION_MANAGER_LISTBOX_REMOVE
+#define HID_EXTENSION_DEPENDENCIES (HID_DESKTOP_START + 28)
+
+#define HID_PACKAGE_MANAGER_UPD_REQ (HID_DESKTOP_START + 29)
+
+#define ACT_DESKTOP_HID_END HID_PACKAGE_MANAGER_UPD_REQ
// check bounds:
#if ACT_DESKTOP_HID_END > HID_DESKTOP_END
diff --git a/desktop/util/hidother.src b/desktop/util/hidother.src
index 52f03c60dd..1f5939b309 100644
--- a/desktop/util/hidother.src
+++ b/desktop/util/hidother.src
@@ -36,6 +36,8 @@ hidspecial HID_PACKAGE_MANAGER_TREELISTBOX { HelpID = HID_PACKAGE_MANAGER_TREELI
hidspecial HID_PACKAGE_MANAGER_PROGRESS { HelpID = HID_PACKAGE_MANAGER_PROGRESS; };
hidspecial HID_PACKAGE_MANAGER_PROGRESS_CANCEL { HelpID = HID_PACKAGE_MANAGER_PROGRESS_CANCEL; };
+hidspecial HID_PACKAGE_MANAGER_UPD_REQ { HelpID = HID_PACKAGE_MANAGER_UPD_REQ; };
+
hidspecial HID_FIRSTSTART_PREV { HelpId = HID_FIRSTSTART_PREV;};
hidspecial HID_FIRSTSTART_NEXT { HelpId = HID_FIRSTSTART_NEXT;};
hidspecial HID_FIRSTSTART_CANCEL { HelpId = HID_FIRSTSTART_CANCEL;};
@@ -45,7 +47,7 @@ hidspecial UID_FIRSTSTART_HELP { HelpId = UID_FIRSTSTART_HELP;};
hidspecial UID_BTN_LICENSE_ACCEPT { HelpId = UID_BTN_LICENSE_ACCEPT;};
hidspecial HID_DEPLOYMENT_GUI_UPDATE { HelpId = HID_DEPLOYMENT_GUI_UPDATE;};
-hidspecial HID_DEPLOYMENT_GUI_UPDATE { HelpId = HID_DEPLOYMENT_GUI_UPDATEINSTALL;};
+hidspecial HID_DEPLOYMENT_GUI_UPDATEINSTALL { HelpId = HID_DEPLOYMENT_GUI_UPDATEINSTALL;};
hidspecial HID_EXTENSION_MANAGER_LISTBOX { HelpId = HID_EXTENSION_MANAGER_LISTBOX; };
hidspecial HID_EXTENSION_MANAGER_LISTBOX_OPTIONS { HelpId = HID_EXTENSION_MANAGER_LISTBOX_OPTIONS; };
diff --git a/desktop/win32/source/extendloaderenvironment.cxx b/desktop/win32/source/extendloaderenvironment.cxx
index 5918dadff8..291d5518dd 100644
--- a/desktop/win32/source/extendloaderenvironment.cxx
+++ b/desktop/win32/source/extendloaderenvironment.cxx
@@ -135,18 +135,21 @@ void extendLoaderEnvironment(WCHAR * binPath, WCHAR * iniDirectory) {
if (GetLastError() != ERROR_FILE_NOT_FOUND) {
fail();
}
+ // This path is only taken by testtool.exe in basis program directory;
+ // its PATH needs to include the brand program directory:
pathEnd = tools::buildPath(
path, iniDirectory, iniDirEnd, MY_STRING(L".."));
if (pathEnd == NULL) {
fail();
}
- exclude1 = true;
- } else {
- padEnd = tools::buildPath(pad, path, pathEnd, MY_STRING(L"\\program"));
+ padEnd = tools::buildPath(
+ pad, path, pathEnd, MY_STRING(L"\\..\\program"));
if (padEnd == NULL) {
fail();
}
exclude1 = contains(env, pad, padEnd);
+ } else {
+ exclude1 = true;
}
WCHAR * pad2 = exclude1 ? pad : padEnd + 1;
pathEnd = tools::buildPath(path, path, pathEnd, MY_STRING(L"\\ure-link"));
diff --git a/desktop/win32/source/guistdio/guistdio.inc b/desktop/win32/source/guistdio/guistdio.inc
index 6ee59c891b..024b456efa 100644
--- a/desktop/win32/source/guistdio/guistdio.inc
+++ b/desktop/win32/source/guistdio/guistdio.inc
@@ -47,10 +47,6 @@
#include <stdio.h>
-//---------------------------------------------------------------------------
-// Thread that reads from child process standard output pipe
-//---------------------------------------------------------------------------
-
#ifdef UNOPKG
DWORD passOutputToConsole(HANDLE readPipe, HANDLE console)
@@ -169,21 +165,76 @@ DWORD WINAPI ErrorThread( LPVOID pParam )
// Thread that writes to child process standard input pipe
//---------------------------------------------------------------------------
#ifdef UNOPKG
+
DWORD WINAPI InputThread( LPVOID pParam )
{
- const DWORD dwBufferSize = 256;
- wchar_t aBuffer[dwBufferSize];
DWORD dwRead = 0;
HANDLE hWritePipe = (HANDLE)pParam;
-
- while (ReadConsoleW( GetStdHandle( STD_INPUT_HANDLE ), &aBuffer, dwBufferSize, &dwRead, NULL ) )
+
+ //We need to read in the complete input until we encounter a new line before
+ //converting to Unicode. This is necessary because the input string can use
+ //characters of one, two, and more bytes. If the last character is not
+ //complete, then it will not be converted properly.
+
+ //Find out how a new line (0xd 0xa) looks like with the used code page.
+ //Characters may have one or multiple bytes and different byte ordering
+ //can be used (little and big endian);
+ int cNewLine = WideCharToMultiByte(
+ GetConsoleCP(), 0, L"\r\n", 2, NULL, 0, NULL, NULL);
+ char * mbBuff = new char[cNewLine];
+ WideCharToMultiByte(
+ GetConsoleCP(), 0, L"\r\n", 2, mbBuff, cNewLine, NULL, NULL);
+
+ const size_t dwBufferSize = 256;
+ char* readBuf = (char*) malloc(dwBufferSize);
+ int readAll = 0;
+ size_t curBufSize = dwBufferSize;
+
+ while ( ReadFile( GetStdHandle( STD_INPUT_HANDLE ),
+ readBuf + readAll,
+ curBufSize - readAll, &dwRead, NULL ) )
{
- BOOL fSuccess;
+ readAll += dwRead;
+ int lastBufSize = curBufSize;
+ //Grow the buffer if necessary
+ if (readAll > curBufSize * 0.7)
+ {
+ curBufSize *= 2;
+ readBuf = (char *) realloc(readBuf, curBufSize);
+ }
+
+ //If the buffer was filled completely then
+ //there could be more input coming. But if we read from the console
+ //and the console input fits exactly in the buffer, then the next
+ //ReadFile would block until the users presses return, etc.
+ //Therefor we check if last character is a new line.
+ //To test this, set dwBufferSize to 4 and enter "no". This should produce
+ //4 bytes with most code pages.
+ if ( readAll == lastBufSize
+ && memcmp(readBuf + lastBufSize - cNewLine, mbBuff, cNewLine) != 0)
+ {
+ //The buffer was completely filled and the last byte(s) are no
+ //new line, so there is more to come.
+ continue;
+ }
+ //Obtain the size of the buffer for the converted string.
+ int sizeWBuf = MultiByteToWideChar(
+ GetConsoleCP(), MB_PRECOMPOSED, readBuf, readAll, NULL, 0);
+
+ wchar_t * wideBuf = new wchar_t[sizeWBuf];
+
+ //Do the conversion.
+ MultiByteToWideChar(
+ GetConsoleCP(), MB_PRECOMPOSED, readBuf, readAll, wideBuf, sizeWBuf);
+
+ BOOL fSuccess;
DWORD dwWritten;
-
- fSuccess = WriteFile( hWritePipe, aBuffer, dwRead * 2, &dwWritten, NULL );
+ fSuccess = WriteFile( hWritePipe, wideBuf, sizeWBuf * 2, &dwWritten, NULL );
+ delete[] wideBuf;
+ readAll = 0;
}
-
+ delete[] mbBuff;
+ free(readBuf);
return 0;
}
#else
diff --git a/desktop/win32/source/rebase/Resource.h b/desktop/win32/source/rebase/Resource.h
new file mode 100644
index 0000000000..03ec1d4eee
--- /dev/null
+++ b/desktop/win32/source/rebase/Resource.h
@@ -0,0 +1,41 @@
+/*************************************************************************
+ *
+ * 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: Resource.h,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.
+ *
+ ************************************************************************/
+
+#ifndef _RESOURCE_H
+#define _RESOURCE_H
+
+#define IDS_APP_TITLE 10
+#define IDS_MSG_OPTIMIZED_FOR_CLIENT 11
+#define IDS_MSG_OPTIMIZED_FOR_SERVER 12
+#define IDS_MSG_NO_INSTALLATION_FOUND 13
+
+#define IDI_REBASEGUI 99
+
+#endif
diff --git a/desktop/win32/source/rebase/makefile.mk b/desktop/win32/source/rebase/makefile.mk
new file mode 100644
index 0000000000..dbab5a5d09
--- /dev/null
+++ b/desktop/win32/source/rebase/makefile.mk
@@ -0,0 +1,93 @@
+#*************************************************************************
+#
+# 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=desktop
+TARGET=rebasegui
+LIBTARGET=NO
+TARGETTYPE=GUI
+UWINAPILIB=
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : settings.mk
+
+# --- Files --------------------------------------------------------
+
+OBJFILES = \
+ $(OBJ)$/rebase.obj \
+ $(OBJ)$/rebasegui.obj
+
+ULFFILES= rebasegui.ulf
+
+.IF "$(WITH_LANG)"!=""
+ULFDIR:=$(COMMONMISC)$/$(TARGET)
+.ELSE # "$(WITH_LANG)"!=""
+ULFDIR:=.
+.ENDIF # "$(WITH_LANG)"!=""
+
+RCFILES= $(RES)$/$(TARGET).rc
+
+# --- Targets ------------------------------------------------------
+
+APP1NOSAL= TRUE
+APP1TARGET= rebaseoo
+
+APP1STDLIBS= $(SHELL32LIB) $(SOLARLIBDIR)$/pathutils-obj.obj
+.IF "$(COM)"=="GCC"
+ APP1STDLIBS+=$(PSDK_HOME)$/lib$/imagehlp.lib
+.ELSE
+ APP1STDLIBS+=imagehlp.lib
+.ENDIF
+
+APP1OBJS= $(OBJ)$/rebase.obj
+
+APP1RPATH= BRAND
+
+APP2NOSAL= TRUE
+APP2TARGET= rebasegui
+APP2STDLIBS= $(SHELL32LIB) $(SOLARLIBDIR)$/pathutils-obj.obj
+
+APP2OBJS= $(OBJ)$/rebasegui.obj
+
+APP2DEF= $(MISC)$/$(TARGET).def
+APP2RPATH= BRAND
+
+APP2RES= $(RES)$/$(TARGET).res
+APP2NOSVRES= $(RES)$/$(TARGET).res
+
+# --- setup --------------------------------------------------------------
+
+.INCLUDE : target.mk
+
+$(RCFILES) : $(ULFDIR)$/rebasegui.ulf makefile.mk rcfooter.txt rcheader.txt rctmpl.txt
+ $(LNGCONVEX) -ulf $(ULFDIR)$/rebasegui.ulf -rc $(RCFILES) -rct rctmpl.txt -rch rcheader.txt -rcf rcfooter.txt
diff --git a/desktop/win32/source/rebase/rcfooter.txt b/desktop/win32/source/rebase/rcfooter.txt
new file mode 100644
index 0000000000..3237729437
--- /dev/null
+++ b/desktop/win32/source/rebase/rcfooter.txt
@@ -0,0 +1,2 @@
+
+// The end
diff --git a/desktop/win32/source/rebase/rcheader.txt b/desktop/win32/source/rebase/rcheader.txt
new file mode 100644
index 0000000000..56afc53779
--- /dev/null
+++ b/desktop/win32/source/rebase/rcheader.txt
@@ -0,0 +1,39 @@
+#if defined(_MSC_VER) && (_MSC_VER < 1500)
+#include <winres.h>
+#else
+#define WINVER 0x0500
+#include <winresrc.h>
+#define IDC_STATIC (-1)
+#endif
+#include "resource.h"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 1,1,1,0
+ PRODUCTVERSION 1,1,1,0
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x9L
+#else
+ FILEFLAGS 0x8L
+#endif
+ FILEOS 0x40004L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
diff --git a/desktop/win32/source/rebase/rctmpl.txt b/desktop/win32/source/rebase/rctmpl.txt
new file mode 100644
index 0000000000..97a2775e9b
--- /dev/null
+++ b/desktop/win32/source/rebase/rctmpl.txt
@@ -0,0 +1,9 @@
+// String Table
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ IDS_APP_TITLE %APP_TITLE%
+ IDS_MSG_OPTIMIZED_FOR_CLIENT %MSG_OPTIMIZED_FOR_CLIENT%
+ IDS_MSG_OPTIMIZED_FOR_SERVER %MSG_OPTIMIZED_FOR_SERVER%
+ IDS_MSG_NO_INSTALLATION_FOUND %MSG_NO_INSTALLATION_FOUND%
+END
diff --git a/desktop/win32/source/rebase/rebase.cxx b/desktop/win32/source/rebase/rebase.cxx
new file mode 100644
index 0000000000..633e74723c
--- /dev/null
+++ b/desktop/win32/source/rebase/rebase.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: md5.cxx,v $
+ * $Revision: 1.8 $
+ *
+ * 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_desktop.hxx"
+#define UNICODE
+#define _UNICODE
+
+#define WIN32_LEAN_AND_MEAN
+#if defined _MSC_VER
+#pragma warning(push, 1)
+#endif
+#include <windows.h>
+#include <shellapi.h>
+#include <imagehlp.h>
+#include <wchar.h>
+#if defined _MSC_VER
+#pragma warning(pop)
+#endif
+
+#include <time.h>
+#include "sal/config.h"
+#include "tools/pathutils.hxx"
+
+#define MY_LENGTH(s) (sizeof (s) / sizeof *(s) - 1)
+#define MY_STRING(s) (s), MY_LENGTH(s)
+
+const int FORMAT_MESSAGE_SIZE = 4096;
+const DWORD PE_Signature = 0x00004550;
+const DWORD BASEVIRTUALADDRESS = 0x10000000;
+
+namespace
+{
+
+bool IsValidHandle( HANDLE handle )
+{
+ return ((NULL != handle) && (INVALID_HANDLE_VALUE != handle));
+}
+
+void fail()
+{
+ LPWSTR buf = NULL;
+ FormatMessageW(
+ FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL,
+ GetLastError(), 0, reinterpret_cast< LPWSTR >(&buf), 0, NULL);
+ MessageBoxW(NULL, buf, NULL, MB_OK | MB_ICONERROR);
+ LocalFree(buf);
+ TerminateProcess(GetCurrentProcess(), 255);
+}
+
+bool rebaseImage( wchar_t* pszFilePath, ULONG nNewImageBase)
+{
+ ULONG ulOldImageSize;
+ ULONG_PTR lpOldImageBase;
+ ULONG ulNewImageSize;
+ ULONG_PTR lpNewImageBase = nNewImageBase;
+ ULONG ulDateTimeStamp = 0;
+ bool bResult(false);
+
+ char cszFilePath[_MAX_PATH+1] = {0};
+ int nResult = WideCharToMultiByte(CP_ACP, 0, pszFilePath, -1, cszFilePath, _MAX_PATH, NULL, NULL);
+
+ if (nResult != 0)
+ {
+ BOOL bResult = ReBaseImage(
+ cszFilePath,
+ "",
+ TRUE,
+ FALSE,
+ FALSE,
+ 0,
+ &ulOldImageSize,
+ &lpOldImageBase,
+ &ulNewImageSize,
+ &lpNewImageBase,
+ ulDateTimeStamp );
+ }
+
+ return bResult;
+}
+
+wchar_t* getBrandPath(wchar_t * path)
+{
+ DWORD n = GetModuleFileNameW(NULL, path, MAX_PATH);
+ if (n == 0 || n >= MAX_PATH) {
+ exit(EXIT_FAILURE);
+ }
+ return tools::filename(path);
+}
+
+void rebaseImagesInFolder( wchar_t* pszFolder, DWORD nNewImageBase )
+{
+ wchar_t szPattern[MAX_PATH];
+ wchar_t *lpLastSlash = wcsrchr( pszFolder, '\\' );
+ if ( lpLastSlash )
+ {
+ size_t len = lpLastSlash - pszFolder + 1;
+ wcsncpy( szPattern, pszFolder, len );
+ wcsncpy( szPattern + len, TEXT("*.dll"), sizeof(szPattern)/sizeof(szPattern[0]) - len );
+ }
+
+ WIN32_FIND_DATA aFindFileData;
+ HANDLE hFind = FindFirstFile( szPattern, &aFindFileData );
+
+ if ( IsValidHandle(hFind) )
+ {
+ BOOL fSuccess = false;
+
+ do
+ {
+ wchar_t szLibFilePath[MAX_PATH];
+ wchar_t *lpLastSlash = wcsrchr( pszFolder, '\\' );
+ if ( lpLastSlash )
+ {
+ size_t len = lpLastSlash - pszFolder + 1;
+ wcsncpy( szLibFilePath, pszFolder, len );
+ wcsncpy( szLibFilePath + len, aFindFileData.cFileName, sizeof(szLibFilePath)/sizeof(szLibFilePath[0]) - len );
+ }
+
+ rebaseImage( szLibFilePath, nNewImageBase );
+ fSuccess = FindNextFile( hFind, &aFindFileData );
+ }
+ while ( fSuccess );
+
+ FindClose( hFind );
+ }
+}
+
+}
+
+extern "C" int APIENTRY WinMain( HINSTANCE, HINSTANCE, LPSTR, int )
+{
+ wchar_t path[MAX_PATH];
+
+ wchar_t * pathEnd = getBrandPath(path);
+
+ if (tools::buildPath(path, path, pathEnd, MY_STRING(L"")) == NULL)
+ fail();
+ rebaseImagesInFolder(path, BASEVIRTUALADDRESS);
+
+ if (tools::buildPath(path, path, pathEnd, MY_STRING(L"..\\basis-link")) == NULL)
+ fail();
+ pathEnd = tools::resolveLink(path);
+
+ if ( pathEnd == NULL )
+ return 0;
+
+ if (tools::buildPath(path, path, pathEnd, MY_STRING(L"\\program\\")) == NULL)
+ fail();
+ rebaseImagesInFolder(path, BASEVIRTUALADDRESS);
+
+ if (tools::buildPath(path, path, pathEnd, MY_STRING(L"\\ure-link")) == NULL)
+ fail();
+ pathEnd = tools::resolveLink(path);
+
+ if ( pathEnd == NULL )
+ return 0;
+
+ if (tools::buildPath(path, path, pathEnd, MY_STRING(L"\\bin\\")) == NULL)
+ fail();
+ rebaseImagesInFolder(path, BASEVIRTUALADDRESS);
+
+ return 0;
+}
diff --git a/desktop/win32/source/rebase/rebasegui.cxx b/desktop/win32/source/rebase/rebasegui.cxx
new file mode 100644
index 0000000000..3cb36cb49b
--- /dev/null
+++ b/desktop/win32/source/rebase/rebasegui.cxx
@@ -0,0 +1,200 @@
+/*************************************************************************
+ *
+ * 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: md5.cxx,v $
+ * $Revision: 1.8 $
+ *
+ * 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_desktop.hxx"
+
+#define UNICODE 1
+#define _UNICODE 1
+
+#ifndef _WINDOWS_
+# define WIN32_LEAN_AND_MEAN
+#if defined _MSC_VER
+#pragma warning(push, 1)
+#endif
+# include <windows.h>
+# include <shellapi.h>
+# include <wchar.h>
+#if defined _MSC_VER
+#pragma warning(pop)
+#endif
+#endif
+
+#include "Resource.h"
+#include <time.h>
+#include "sal/config.h"
+#include "tools/pathutils.hxx"
+
+const DWORD PE_Signature = 0x00004550;
+
+#define MY_LENGTH(s) (sizeof (s) / sizeof *(s) - 1)
+#define MY_STRING(s) (s), MY_LENGTH(s)
+#define MAX_STR_CAPTION 256
+#define MAX_TEXT_LENGTH 1024
+
+static void failPath(wchar_t* pszAppTitle, wchar_t* pszMsg)
+{
+ MessageBoxW(NULL, pszMsg, pszAppTitle, MB_OK | MB_ICONERROR);
+ TerminateProcess(GetCurrentProcess(), 255);
+}
+
+static void fail()
+{
+ LPWSTR buf = NULL;
+ FormatMessageW(
+ FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL,
+ GetLastError(), 0, reinterpret_cast< LPWSTR >(&buf), 0, NULL);
+ MessageBoxW(NULL, buf, NULL, MB_OK | MB_ICONERROR);
+ LocalFree(buf);
+ TerminateProcess(GetCurrentProcess(), 255);
+}
+
+static LPVOID getVirtualBaseAddress( wchar_t* pszFilePath )
+{
+ HANDLE hFile;
+ HANDLE hFileMapping;
+ LPVOID lpFileBase = 0;
+ PIMAGE_DOS_HEADER lpDosHeader;
+ PIMAGE_NT_HEADERS lpNTHeader;
+
+ hFile = CreateFile(pszFilePath,
+ GENERIC_READ, FILE_SHARE_READ, NULL,
+ OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,
+ 0);
+
+ if ( hFile == INVALID_HANDLE_VALUE )
+ {
+ return NULL;
+ }
+
+ hFileMapping = CreateFileMapping(hFile, NULL, PAGE_READONLY, 0, 0, NULL);
+ if ( hFileMapping == 0 )
+ {
+ CloseHandle(hFile);
+ return NULL;
+ }
+
+ lpFileBase = MapViewOfFile(hFileMapping, FILE_MAP_READ, 0, 0, 0);
+ if ( lpFileBase == 0 )
+ {
+ CloseHandle(hFileMapping);
+ CloseHandle(hFile);
+ return NULL;
+ }
+
+ lpDosHeader = (PIMAGE_DOS_HEADER)lpFileBase;
+ if ( lpDosHeader->e_magic == IMAGE_DOS_SIGNATURE )
+ {
+ lpNTHeader = (PIMAGE_NT_HEADERS)((char*)lpDosHeader + lpDosHeader->e_lfanew);
+ if (lpNTHeader->Signature == PE_Signature )
+ lpFileBase = reinterpret_cast<LPVOID>( lpNTHeader->OptionalHeader.ImageBase );
+ }
+
+ UnmapViewOfFile(lpFileBase);
+ CloseHandle(hFileMapping);
+ CloseHandle(hFile);
+
+ return lpFileBase;
+}
+
+static bool checkImageVirtualBaseAddress(wchar_t* pszFilePath, LPVOID lpVBA)
+{
+ LPVOID lpImageVBA = getVirtualBaseAddress(pszFilePath);
+ if ( lpImageVBA == lpVBA )
+ return true;
+ else
+ return false;
+}
+
+static wchar_t* getBrandPath(wchar_t * pszPath)
+{
+ DWORD n = GetModuleFileNameW(NULL, pszPath, MAX_PATH);
+ if (n == 0 || n >= MAX_PATH) {
+ exit(EXIT_FAILURE);
+ }
+ return tools::filename(pszPath);
+}
+
+extern "C" int APIENTRY WinMain( HINSTANCE hInst, HINSTANCE, LPSTR, int )
+{
+ wchar_t* pAppTitle = new wchar_t[ MAX_STR_CAPTION ];
+ pAppTitle[0] = '\0';
+ LoadString( hInst, IDS_APP_TITLE, pAppTitle, MAX_STR_CAPTION );
+
+ wchar_t* pTextServer = new wchar_t[ MAX_TEXT_LENGTH ];
+ pTextServer[0] = '\0';
+ LoadString( hInst, IDS_MSG_OPTIMIZED_FOR_SERVER, pTextServer, MAX_TEXT_LENGTH );
+
+ wchar_t* pTextClient = new wchar_t[ MAX_TEXT_LENGTH ];
+ pTextClient[0] = '\0';
+ LoadString( hInst, IDS_MSG_OPTIMIZED_FOR_CLIENT, pTextClient, MAX_TEXT_LENGTH );
+
+ wchar_t* pTextNoInstallation = new wchar_t[ MAX_TEXT_LENGTH ];
+ pTextNoInstallation[0] = '\0';
+ LoadString( hInst, IDS_MSG_NO_INSTALLATION_FOUND, pTextNoInstallation, MAX_TEXT_LENGTH );
+
+ LPVOID VBA = (void*)0x10000000;
+ wchar_t path[MAX_PATH];
+
+ wchar_t * pathEnd = getBrandPath(path);
+
+ if (tools::buildPath(path, path, pathEnd, MY_STRING(L"libxml2.dll")) == NULL)
+ fail();
+ bool bFast = checkImageVirtualBaseAddress(path, VBA);
+
+ if (tools::buildPath(path, path, pathEnd, MY_STRING(L"..\\basis-link")) == NULL)
+ fail();
+ pathEnd = tools::resolveLink(path);
+
+ if (pathEnd == NULL)
+ failPath(pAppTitle, pTextNoInstallation);
+
+ if (tools::buildPath(path, path, pathEnd, MY_STRING(L"\\program\\vclmi.dll")) == NULL)
+ fail();
+ bFast &= checkImageVirtualBaseAddress(path, VBA);
+
+ if (tools::buildPath(path, path, pathEnd, MY_STRING(L"\\ure-link")) == NULL)
+ fail();
+ pathEnd = tools::resolveLink(path);
+
+ if (pathEnd == NULL)
+ failPath(pAppTitle, pTextNoInstallation);
+
+ if (tools::buildPath(path, path, pathEnd, MY_STRING(L"\\bin\\sal3.dll")) == NULL)
+ fail();
+ bFast &= checkImageVirtualBaseAddress(path, VBA);
+
+ const wchar_t* pOutput = pTextClient;
+ if (!bFast)
+ pOutput = pTextServer;
+
+ MessageBoxW( NULL, pOutput, pAppTitle, MB_OK );
+
+ return 0;
+}
diff --git a/desktop/win32/source/rebase/rebasegui.ulf b/desktop/win32/source/rebase/rebasegui.ulf
new file mode 100644
index 0000000000..ee6b6e828a
--- /dev/null
+++ b/desktop/win32/source/rebase/rebasegui.ulf
@@ -0,0 +1,11 @@
+[%APP_TITLE%]
+en-US = "Installation Status"
+
+[%MSG_OPTIMIZED_FOR_CLIENT%]
+en-US = "Installation is optimized for clients."
+
+[%MSG_OPTIMIZED_FOR_SERVER%]
+en-US = "Installation is optimized for servers."
+
+[%MSG_NO_INSTALLATION_FOUND%]
+en-US = "Cannot find Office installation."
diff --git a/drawinglayer/inc/drawinglayer/attribute/sdrallattribute3d.hxx b/drawinglayer/inc/drawinglayer/attribute/sdrallattribute3d.hxx
index d5b453f9bf..d56d16438b 100644
--- a/drawinglayer/inc/drawinglayer/attribute/sdrallattribute3d.hxx
+++ b/drawinglayer/inc/drawinglayer/attribute/sdrallattribute3d.hxx
@@ -64,11 +64,11 @@ namespace drawinglayer
public:
SdrLineFillShadowAttribute(
- SdrLineAttribute* pLine = 0L,
- SdrFillAttribute* pFill = 0L,
- SdrLineStartEndAttribute* pLineStartEnd = 0L,
- SdrShadowAttribute* pShadow = 0L,
- FillGradientAttribute* pFillFloatTransGradient = 0L);
+ SdrLineAttribute* pLine = 0,
+ SdrFillAttribute* pFill = 0,
+ SdrLineStartEndAttribute* pLineStartEnd = 0,
+ SdrShadowAttribute* pShadow = 0,
+ FillGradientAttribute* pFillFloatTransGradient = 0);
~SdrLineFillShadowAttribute();
// copy constructor and assigment operator
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/chartprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/chartprimitive2d.hxx
index 4ba87926f3..2c91d8d6ab 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/chartprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/chartprimitive2d.hxx
@@ -67,6 +67,8 @@ namespace drawinglayer
// provide unique ID
DeclPrimitrive2DIDBlock()
+
+ virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
};
} // end of namespace primitive2d
} // end of namespace drawinglayer
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx
index 44223c3ac3..25f100121a 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx
@@ -102,6 +102,7 @@
#define PRIMITIVE2D_ID_BORDERLINEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 51)
#define PRIMITIVE2D_ID_POLYPOLYGONMARKERPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 52)
#define PRIMITIVE2D_ID_HITTESTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 53)
+#define PRIMITIVE2D_ID_INVERTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 54)
//////////////////////////////////////////////////////////////////////////////
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/invertprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/invertprimitive2d.hxx
new file mode 100644
index 0000000000..ae7a316e03
--- /dev/null
+++ b/drawinglayer/inc/drawinglayer/primitive2d/invertprimitive2d.hxx
@@ -0,0 +1,63 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: unifiedalphaprimitive2d.hxx,v $
+ *
+ * $Revision: 1.3 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:17 $
+ *
+ * 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 INCLUDED_DRAWINGLAYER_PRIMITIVE2D_INVERTPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_INVERTPRIMITIVE2D_HXX
+
+#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ class InvertPrimitive2D : public GroupPrimitive2D
+ {
+ public:
+ InvertPrimitive2D(const Primitive2DSequence& rChildren);
+
+ // provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_INVERTPRIMITIVE2D_HXX
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/primitivetools2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/primitivetools2d.hxx
new file mode 100644
index 0000000000..0a9c8ecc0d
--- /dev/null
+++ b/drawinglayer/inc/drawinglayer/primitive2d/primitivetools2d.hxx
@@ -0,0 +1,114 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: baseprimitive2d.hxx,v $
+ *
+ * $Revision: 1.8 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:16 $
+ *
+ * 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 INCLUDED_DRAWINGLAYER_PRIMITIVE2D_PRIMITIVE2DTOOLS_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_PRIMITIVE2DTOOLS_HXX
+
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// tooling class for BasePrimitive2D baseed classes which are view-dependent
+// regarding the size of a discrete unit. The implementation of get2DDecomposition
+// guards the buffered local decomposition and ensures that a createLocalDecomposition
+// implementation may use an up-to-date DiscreteUnit accessible using getDiscreteUnit()
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ class DiscreteMetricDependentPrimitive2D : public BasePrimitive2D
+ {
+ private:
+ // the last used fDiscreteUnit definitions for decomposition. Since this
+ // is checked and updated from get2DDecomposition() it will be current and
+ // usable in createLocalDecomposition()
+ double mfDiscreteUnit;
+
+ public:
+ DiscreteMetricDependentPrimitive2D()
+ : BasePrimitive2D(),
+ mfDiscreteUnit(0.0)
+ {
+ }
+
+ // data access
+ double getDiscreteUnit() const { return mfDiscreteUnit; }
+
+ // get local decomposition. Overloaded since this decomposition is view-dependent
+ virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// tooling class for BasePrimitive2D baseed classes which are view-dependent
+// regarding the viewport. The implementation of get2DDecomposition
+// guards the buffered local decomposition and ensures that a createLocalDecomposition
+// implementation may use an up-to-date Viewport accessible using getViewport()
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ class ViewportDependentPrimitive2D : public BasePrimitive2D
+ {
+ private:
+ // the last used Viewport definition for decomposition. Since this
+ // is checked and updated from get2DDecomposition() it will be current and
+ // usable in createLocalDecomposition()
+ basegfx::B2DRange maViewport;
+
+ public:
+ ViewportDependentPrimitive2D()
+ : BasePrimitive2D(),
+ maViewport()
+ {
+ }
+
+ // data access
+ const basegfx::B2DRange& getViewport() const { return maViewport; }
+
+ // get local decomposition. Overloaded since this decomposition is view-dependent
+ virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_PRIMITIVE2DTOOLS_HXX
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/sceneprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/sceneprimitive2d.hxx
index c7170258a9..6fc731db03 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/sceneprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/sceneprimitive2d.hxx
@@ -86,7 +86,7 @@ namespace drawinglayer
// public helpers
// Geometry extractor. Shadow will be added as in createLocalDecomposition, but
// the 3D content is not converted to a bitmap visualisation but to projected 2D gemetry. This
- // helper is useful for Contour extraction.
+ // helper is useful e.g. for Contour extraction or HitTests.
Primitive2DSequence getGeometry2D(const geometry::ViewInformation2D& rViewInformation) const;
// constructor/destructor
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/textlayoutdevice.hxx b/drawinglayer/inc/drawinglayer/primitive2d/textlayoutdevice.hxx
index bbdc3df86c..a8408aba23 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/textlayoutdevice.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/textlayoutdevice.hxx
@@ -41,6 +41,7 @@
#include <tools/poly.hxx>
#include <basegfx/range/b2drange.hxx>
#include <vector>
+#include <com/sun/star/lang/Locale.hpp>
//////////////////////////////////////////////////////////////////////////////
// predefines
@@ -75,8 +76,8 @@ namespace drawinglayer
~TextLayouterDevice();
void setFont(const Font& rFont);
- void setFontAttributes(const FontAttributes& rFontAttributes, const basegfx::B2DHomMatrix& rTransform);
- void setFontAttributes(const FontAttributes& rFontAttributes, double fFontScaleX, double fFontScaleY);
+ void setFontAttributes(const FontAttributes& rFontAttributes, const basegfx::B2DHomMatrix& rTransform, const ::com::sun::star::lang::Locale & rLocale);
+ void setFontAttributes(const FontAttributes& rFontAttributes, double fFontScaleX, double fFontScaleY, const ::com::sun::star::lang::Locale & rLocale);
double getTextHeight() const;
double getOverlineHeight() const;
@@ -97,7 +98,10 @@ namespace drawinglayer
basegfx::B2DPolyPolygonVector&,
const String& rText,
xub_StrLen nIndex,
- xub_StrLen nLength);
+ xub_StrLen nLength,
+ // #i89784# added suppirt for DXArray for justified text
+ const ::std::vector< double >& rDXArray,
+ double fFontScaleWidth);
basegfx::B2DRange getTextBoundRect(
const String& rText,
@@ -119,11 +123,13 @@ namespace drawinglayer
double fFontScaleX,
double fFontScaleY,
double fFontRotation,
+ const ::com::sun::star::lang::Locale & rLocale,
const OutputDevice& rOutDev);
Font getVclFontFromFontAttributes(
const FontAttributes& rFontAttributes,
const basegfx::B2DHomMatrix& rTransform,
+ const ::com::sun::star::lang::Locale & rLocale,
const OutputDevice& rOutDev);
FontAttributes getFontAttributesFromVclFont(basegfx::B2DVector& rSize, const Font& rFont, bool bRTL, bool bBiDiStrong);
diff --git a/drawinglayer/inc/drawinglayer/processor2d/hittestprocessor2d.hxx b/drawinglayer/inc/drawinglayer/processor2d/hittestprocessor2d.hxx
new file mode 100644
index 0000000000..4a0f1b9c29
--- /dev/null
+++ b/drawinglayer/inc/drawinglayer/processor2d/hittestprocessor2d.hxx
@@ -0,0 +1,113 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: contourextractor2d.hxx,v $
+ *
+ * $Revision: 1.3 $
+ *
+ * last change: $Author: aw $ $Date: 2008-06-24 15:30:17 $
+ *
+ * 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 INCLUDED_DRAWINGLAYER_PROCESSOR2D_HITTESTPROCESSOR2D_HXX
+#define INCLUDED_DRAWINGLAYER_PROCESSOR2D_HITTESTPROCESSOR2D_HXX
+
+#include <drawinglayer/processor2d/baseprocessor2d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+
+namespace basegfx { class B2DPolygon; }
+namespace basegfx { class B2DPolyPolygon; }
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace processor2d
+ {
+ class HitTestProcessor2D : public BaseProcessor2D
+ {
+ private:
+ // discrete HitTest position
+ basegfx::B2DPoint maDiscreteHitPosition;
+
+ // discrete HitTolerance
+ double mfDiscreteHitTolerance;
+
+ // bitfield
+ unsigned mbHit : 1;
+ unsigned mbHitToleranceUsed : 1;
+
+ // this flag decides if primitives of type HitTestPrimitive2D
+ // will be taken into account for HitTesting or not. Those primitives
+ // are created for objects which are else completely invisible and normally
+ // their content exists of hairline primitives describing the object's contour
+ unsigned mbUseHitTestPrimitiveContent : 1;
+
+ // flag to concentraze on text hits only
+ unsigned mbHitTextOnly : 1;
+
+ // tooling methods
+ void processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate);
+ bool checkHairlineHitWithTolerance(
+ const basegfx::B2DPolygon& rPolygon,
+ double fDiscreteHitTolerance);
+ bool checkFillHitWithTolerance(
+ const basegfx::B2DPolyPolygon& rPolyPolygon,
+ double fDiscreteHitTolerance);
+
+ public:
+ HitTestProcessor2D(
+ const geometry::ViewInformation2D& rViewInformation,
+ const basegfx::B2DPoint& rLogicHitPosition,
+ double fLogicHitTolerance,
+ bool bHitTextOnly);
+ virtual ~HitTestProcessor2D();
+
+ // data write access
+ void setUseHitTestPrimitiveContent(bool bNew)
+ {
+ if((bool)mbUseHitTestPrimitiveContent != bNew) mbUseHitTestPrimitiveContent = bNew;
+ }
+
+ // data read access
+ const basegfx::B2DPoint& getDiscreteHitPosition() const { return maDiscreteHitPosition; }
+ double getDiscreteHitTolerance() const { return mfDiscreteHitTolerance; }
+ bool getHit() const { return mbHit; }
+ bool getHitToleranceUsed() const { return mbHitToleranceUsed; }
+ bool getUseHitTestPrimitiveContent() const { return mbUseHitTestPrimitiveContent;}
+ bool getHitTextOnly() const { return mbHitTextOnly; }
+ };
+ } // end of namespace processor2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // INCLUDED_DRAWINGLAYER_PROCESSOR2D_HITTESTPROCESSOR2D_HXX
+
+// eof
diff --git a/drawinglayer/inc/drawinglayer/processor2d/linegeometryextractor2d.hxx b/drawinglayer/inc/drawinglayer/processor2d/linegeometryextractor2d.hxx
index ba733bb151..c3ed548333 100644
--- a/drawinglayer/inc/drawinglayer/processor2d/linegeometryextractor2d.hxx
+++ b/drawinglayer/inc/drawinglayer/processor2d/linegeometryextractor2d.hxx
@@ -48,8 +48,8 @@ namespace drawinglayer
class LineGeometryExtractor2D : public BaseProcessor2D
{
private:
- basegfx::B2DPolyPolygon maExtractedHairlines;
- basegfx::B2DPolyPolygon maExtractedLineFills;
+ std::vector< basegfx::B2DPolygon > maExtractedHairlines;
+ std::vector< basegfx::B2DPolyPolygon > maExtractedLineFills;
// bitfield
unsigned mbInLineGeometry : 1;
@@ -61,8 +61,8 @@ namespace drawinglayer
LineGeometryExtractor2D(const geometry::ViewInformation2D& rViewInformation);
virtual ~LineGeometryExtractor2D();
- const basegfx::B2DPolyPolygon& getExtractedHairlines() const { return maExtractedHairlines; }
- const basegfx::B2DPolyPolygon& getExtractedLineFills() const { return maExtractedLineFills; }
+ const std::vector< basegfx::B2DPolygon >& getExtractedHairlines() const { return maExtractedHairlines; }
+ const std::vector< basegfx::B2DPolyPolygon >& getExtractedLineFills() const { return maExtractedLineFills; }
};
} // end of namespace processor2d
} // end of namespace drawinglayer
diff --git a/drawinglayer/inc/drawinglayer/processor2d/textaspolygonextractor2d.hxx b/drawinglayer/inc/drawinglayer/processor2d/textaspolygonextractor2d.hxx
new file mode 100644
index 0000000000..fda1f90cdd
--- /dev/null
+++ b/drawinglayer/inc/drawinglayer/processor2d/textaspolygonextractor2d.hxx
@@ -0,0 +1,108 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: linegeometryextractor2d.hxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: aw $ $Date: 2008-06-24 15:44:27 $
+ *
+ * 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 INCLUDED_DRAWINGLAYER_PROCESSOR2D_TEXTASPOLYGONEXTRACTOR2D_HXX
+#define INCLUDED_DRAWINGLAYER_PROCESSOR2D_TEXTASPOLYGONEXTRACTOR2D_HXX
+
+#include <drawinglayer/processor2d/baseprocessor2d.hxx>
+#include <basegfx/polygon/b2dpolypolygon.hxx>
+#include <basegfx/color/bcolor.hxx>
+#include <basegfx/color/bcolormodifier.hxx>
+#include <vector>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace processor2d
+ {
+ // helper data structure for returning the result
+ struct TextAsPolygonDataNode
+ {
+ private:
+ basegfx::B2DPolyPolygon maB2DPolyPolygon;
+ basegfx::BColor maBColor;
+ bool mbIsFilled;
+
+ public:
+ TextAsPolygonDataNode(
+ const basegfx::B2DPolyPolygon& rB2DPolyPolygon,
+ const basegfx::BColor& rBColor,
+ bool bIsFilled)
+ : maB2DPolyPolygon(rB2DPolyPolygon),
+ maBColor(rBColor),
+ mbIsFilled(bIsFilled)
+ {
+ }
+
+ // data read access
+ const basegfx::B2DPolyPolygon& getB2DPolyPolygon() const { return maB2DPolyPolygon; }
+ const basegfx::BColor& getBColor() const { return maBColor; }
+ bool getIsFilled() const { return mbIsFilled; }
+ };
+
+ // typedef for a vector of that helper data
+ typedef ::std::vector< TextAsPolygonDataNode > TextAsPolygonDataNodeVector;
+
+ class TextAsPolygonExtractor2D : public BaseProcessor2D
+ {
+ private:
+ // extraction target
+ TextAsPolygonDataNodeVector maTarget;
+
+ // the modifiedColorPrimitive stack
+ basegfx::BColorModifierStack maBColorModifierStack;
+
+ // flag if we are in a decomposed text
+ sal_uInt32 mnInText;
+
+ // tooling methods
+ void processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate);
+
+ public:
+ TextAsPolygonExtractor2D(const geometry::ViewInformation2D& rViewInformation);
+ virtual ~TextAsPolygonExtractor2D();
+
+ // data read access
+ const TextAsPolygonDataNodeVector& getTarget() const { return maTarget; }
+ };
+ } // end of namespace processor2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // INCLUDED_DRAWINGLAYER_PROCESSOR2D_TEXTASPOLYGONEXTRACTOR2D_HXX
+
+// eof
diff --git a/drawinglayer/prj/d.lst b/drawinglayer/prj/d.lst
index 213e787e40..0068b32c24 100644
--- a/drawinglayer/prj/d.lst
+++ b/drawinglayer/prj/d.lst
@@ -25,6 +25,7 @@ mkdir: %_DEST%\inc%_EXT%\drawinglayer\primitive2d
..\inc\drawinglayer\primitive2d\groupprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\groupprimitive2d.hxx
..\inc\drawinglayer\primitive2d\helplineprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\helplineprimitive2d.hxx
..\inc\drawinglayer\primitive2d\hittestprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\hittestprimitive2d.hxx
+..\inc\drawinglayer\primitive2d\invertprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\invertprimitive2d.hxx
..\inc\drawinglayer\primitive2d\markerarrayprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\markerarrayprimitive2d.hxx
..\inc\drawinglayer\primitive2d\maskprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\maskprimitive2d.hxx
..\inc\drawinglayer\primitive2d\mediaprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\mediaprimitive2d.hxx
@@ -34,6 +35,7 @@ mkdir: %_DEST%\inc%_EXT%\drawinglayer\primitive2d
..\inc\drawinglayer\primitive2d\pointarrayprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\pointarrayprimitive2d.hxx
..\inc\drawinglayer\primitive2d\polygonprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\polygonprimitive2d.hxx
..\inc\drawinglayer\primitive2d\polypolygonprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\polypolygonprimitive2d.hxx
+..\inc\drawinglayer\primitive2d\primitivetools2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\primitivetools2d.hxx
..\inc\drawinglayer\primitive2d\sceneprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\sceneprimitive2d.hxx
..\inc\drawinglayer\primitive2d\shadowprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\shadowprimitive2d.hxx
..\inc\drawinglayer\primitive2d\structuretagprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\structuretagprimitive2d.hxx
@@ -83,6 +85,8 @@ mkdir: %_DEST%\inc%_EXT%\drawinglayer\processor2d
..\inc\drawinglayer\processor2d\canvasprocessor.hxx %_DEST%\inc%_EXT%\drawinglayer\processor2d\canvasprocessor.hxx
..\inc\drawinglayer\processor2d\contourextractor2d.hxx %_DEST%\inc%_EXT%\drawinglayer\processor2d\contourextractor2d.hxx
..\inc\drawinglayer\processor2d\linegeometryextractor2d.hxx %_DEST%\inc%_EXT%\drawinglayer\processor2d\linegeometryextractor2d.hxx
+..\inc\drawinglayer\processor2d\hittestprocessor2d.hxx %_DEST%\inc%_EXT%\drawinglayer\processor2d\hittestprocessor2d.hxx
+..\inc\drawinglayer\processor2d\textaspolygonextractor2d.hxx %_DEST%\inc%_EXT%\drawinglayer\processor2d\textaspolygonextractor2d.hxx
mkdir: %_DEST%\inc%_EXT%\drawinglayer\processor3d
..\inc\drawinglayer\processor3d\baseprocessor3d.hxx %_DEST%\inc%_EXT%\drawinglayer\processor3d\baseprocessor3d.hxx
diff --git a/drawinglayer/source/attribute/sdrallattribute3d.cxx b/drawinglayer/source/attribute/sdrallattribute3d.cxx
index bd82e676ba..4bc4b642f9 100644
--- a/drawinglayer/source/attribute/sdrallattribute3d.cxx
+++ b/drawinglayer/source/attribute/sdrallattribute3d.cxx
@@ -64,17 +64,15 @@ namespace drawinglayer
{
}
- SdrLineFillShadowAttribute::SdrLineFillShadowAttribute(const SdrLineFillShadowAttribute& rCandidate)
- : mpShadow(0L),
- mpLine(0L),
- mpLineStartEnd(0L),
- mpFill(0L),
- mpFillFloatTransGradient(0L)
+ SdrLineFillShadowAttribute::SdrLineFillShadowAttribute(
+ const SdrLineFillShadowAttribute& rCandidate)
+ : mpShadow(0),
+ mpLine(0),
+ mpLineStartEnd(0),
+ mpFill(0),
+ mpFillFloatTransGradient(0)
{
- if(!(*this == rCandidate))
- {
- *this = rCandidate;
- }
+ *this = rCandidate;
}
SdrLineFillShadowAttribute::~SdrLineFillShadowAttribute()
@@ -91,14 +89,14 @@ namespace drawinglayer
// handle mpShadow
{
// delete local mpShadow if necessary
- if(mpShadow && ((!rCandidate.mpShadow) || (!(*mpShadow == *rCandidate.mpShadow))))
+ if(mpShadow)
{
delete mpShadow;
- mpShadow = 0L;
+ mpShadow = 0;
}
// copy mpShadow if necessary
- if(!mpShadow && rCandidate.mpShadow)
+ if(rCandidate.mpShadow)
{
mpShadow = new SdrShadowAttribute(*rCandidate.mpShadow);
}
@@ -107,14 +105,14 @@ namespace drawinglayer
// handle mpLine
{
// delete local mpLine if necessary
- if(mpLine && ((!rCandidate.mpLine) || (!(*mpLine == *rCandidate.mpLine))))
+ if(mpLine)
{
delete mpLine;
- mpLine = 0L;
+ mpLine = 0;
}
// copy mpLine if necessary
- if(!mpLine && rCandidate.mpLine)
+ if(rCandidate.mpLine)
{
mpLine = new SdrLineAttribute(*rCandidate.mpLine);
}
@@ -123,14 +121,14 @@ namespace drawinglayer
// handle mpLineStartEnd
{
// delete local mpLineStartEnd if necessary
- if(mpLineStartEnd && ((!rCandidate.mpLineStartEnd) || (!(*mpLineStartEnd == *rCandidate.mpLineStartEnd))))
+ if(mpLineStartEnd)
{
delete mpLineStartEnd;
- mpLineStartEnd = 0L;
+ mpLineStartEnd = 0;
}
// copy mpLineStartEnd if necessary
- if(!mpLineStartEnd && rCandidate.mpLineStartEnd)
+ if(rCandidate.mpLineStartEnd)
{
mpLineStartEnd = new SdrLineStartEndAttribute(*rCandidate.mpLineStartEnd);
}
@@ -139,14 +137,14 @@ namespace drawinglayer
// handle mpFill
{
// delete local mpFill if necessary
- if(mpFill && ((!rCandidate.mpFill) || (!(*mpFill == *rCandidate.mpFill))))
+ if(mpFill)
{
delete mpFill;
- mpFill = 0L;
+ mpFill = 0;
}
// copy mpFill if necessary
- if(!mpFill && rCandidate.mpFill)
+ if(rCandidate.mpFill)
{
mpFill = new SdrFillAttribute(*rCandidate.mpFill);
}
@@ -155,14 +153,14 @@ namespace drawinglayer
// handle mpFillFloatTransGradient
{
// delete local mpFillFloatTransGradient if necessary
- if(mpFillFloatTransGradient && ((!rCandidate.mpFillFloatTransGradient) || (!(*mpFillFloatTransGradient == *rCandidate.mpFillFloatTransGradient))))
+ if(mpFillFloatTransGradient)
{
delete mpFillFloatTransGradient;
- mpFillFloatTransGradient = 0L;
+ mpFillFloatTransGradient = 0;
}
// copy mpFillFloatTransGradient if necessary
- if(!mpFillFloatTransGradient && rCandidate.mpFillFloatTransGradient)
+ if(rCandidate.mpFillFloatTransGradient)
{
mpFillFloatTransGradient = new FillGradientAttribute(*rCandidate.mpFillFloatTransGradient);
}
diff --git a/drawinglayer/source/primitive2d/chartprimitive2d.cxx b/drawinglayer/source/primitive2d/chartprimitive2d.cxx
index 1f1b477387..68ca32f41e 100644
--- a/drawinglayer/source/primitive2d/chartprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/chartprimitive2d.cxx
@@ -76,6 +76,13 @@ namespace drawinglayer
// provide unique ID
ImplPrimitrive2DIDBlock(ChartPrimitive2D, PRIMITIVE2D_ID_CHARTPRIMITIVE2D)
+ basegfx::B2DRange ChartPrimitive2D::getB2DRange(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ {
+ basegfx::B2DRange aRetval(0.0, 0.0, 1.0, 1.0);
+ aRetval.transform(getTransformation());
+ return aRetval;
+ }
+
} // end of namespace primitive2d
} // end of namespace drawinglayer
diff --git a/drawinglayer/source/primitive2d/invertprimitive2d.cxx b/drawinglayer/source/primitive2d/invertprimitive2d.cxx
new file mode 100644
index 0000000000..e3292beeb7
--- /dev/null
+++ b/drawinglayer/source/primitive2d/invertprimitive2d.cxx
@@ -0,0 +1,65 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: unifiedalphaprimitive2d.cxx,v $
+ *
+ * $Revision: 1.5 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:20 $
+ *
+ * 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
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_drawinglayer.hxx"
+
+#include <drawinglayer/primitive2d/invertprimitive2d.hxx>
+#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+using namespace com::sun::star;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ InvertPrimitive2D::InvertPrimitive2D(
+ const Primitive2DSequence& rChildren)
+ : GroupPrimitive2D(rChildren)
+ {
+ }
+
+ // provide unique ID
+ ImplPrimitrive2DIDBlock(InvertPrimitive2D, PRIMITIVE2D_ID_INVERTPRIMITIVE2D)
+
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/primitive2d/makefile.mk b/drawinglayer/source/primitive2d/makefile.mk
index b909d0fde9..e10d1ddbcc 100644
--- a/drawinglayer/source/primitive2d/makefile.mk
+++ b/drawinglayer/source/primitive2d/makefile.mk
@@ -62,6 +62,7 @@ SLOFILES= \
$(SLO)$/groupprimitive2d.obj \
$(SLO)$/helplineprimitive2d.obj \
$(SLO)$/hittestprimitive2d.obj \
+ $(SLO)$/invertprimitive2d.obj \
$(SLO)$/markerarrayprimitive2d.obj \
$(SLO)$/pointarrayprimitive2d.obj \
$(SLO)$/maskprimitive2d.obj \
@@ -71,6 +72,7 @@ SLOFILES= \
$(SLO)$/pagepreviewprimitive2d.obj \
$(SLO)$/polypolygonprimitive2d.obj \
$(SLO)$/polygonprimitive2d.obj \
+ $(SLO)$/primitivetools2d.obj \
$(SLO)$/sceneprimitive2d.obj \
$(SLO)$/shadowprimitive2d.obj \
$(SLO)$/structuretagprimitive2d.obj \
diff --git a/drawinglayer/source/primitive2d/polygonprimitive2d.cxx b/drawinglayer/source/primitive2d/polygonprimitive2d.cxx
index 1f4344b042..ad9a23504f 100644
--- a/drawinglayer/source/primitive2d/polygonprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/polygonprimitive2d.cxx
@@ -116,7 +116,7 @@ namespace drawinglayer
const basegfx::B2DVector aDashVector(rViewInformation.getInverseObjectToViewTransformation() * basegfx::B2DVector(getDiscreteDashLength(), 0.0));
const double fLogicDashLength(aDashVector.getX());
- if(fLogicDashLength > 0.0)
+ if(fLogicDashLength > 0.0 && !getRGBColorA().equal(getRGBColorB()))
{
// apply dashing; get line and gap snippets
::std::vector< double > aDash;
@@ -239,17 +239,19 @@ namespace drawinglayer
{
if(getB2DPolygon().count())
{
+ // #i102241# try to simplify before usage
+ const basegfx::B2DPolygon aB2DPolygon(basegfx::tools::simplifyCurveSegments(getB2DPolygon()));
basegfx::B2DPolyPolygon aHairLinePolyPolygon;
if(0.0 == getStrokeAttribute().getFullDotDashLen())
{
// no line dashing, just copy
- aHairLinePolyPolygon.append(getB2DPolygon());
+ aHairLinePolyPolygon.append(aB2DPolygon);
}
else
{
// apply LineStyle
- basegfx::tools::applyLineDashing(getB2DPolygon(), getStrokeAttribute().getDotDashArray(), &aHairLinePolyPolygon, 0, getStrokeAttribute().getFullDotDashLen());
+ basegfx::tools::applyLineDashing(aB2DPolygon, getStrokeAttribute().getDotDashArray(), &aHairLinePolyPolygon, 0, getStrokeAttribute().getFullDotDashLen());
}
const sal_uInt32 nCount(aHairLinePolyPolygon.count());
@@ -263,12 +265,9 @@ namespace drawinglayer
for(sal_uInt32 a(0L); a < nCount; a++)
{
- // AW: New version of createAreaGeometry; now creates bezier polygons
+ // New version of createAreaGeometry; now creates bezier polygons
aAreaPolyPolygon.append(basegfx::tools::createAreaGeometry(
aHairLinePolyPolygon.getB2DPolygon(a), fHalfLineWidth, aLineJoin));
- //const basegfx::B2DPolyPolygon aNewPolyPolygon(basegfx::tools::createAreaGeometryForPolygon(
- // aHairLinePolyPolygon.getB2DPolygon(a), fHalfLineWidth, aLineJoin, fMiterMinimumAngle));
- //aAreaPolyPolygon.append(aNewPolyPolygon);
}
// prepare return value
diff --git a/drawinglayer/source/primitive2d/primitivetools2d.cxx b/drawinglayer/source/primitive2d/primitivetools2d.cxx
new file mode 100644
index 0000000000..d288a697d7
--- /dev/null
+++ b/drawinglayer/source/primitive2d/primitivetools2d.cxx
@@ -0,0 +1,106 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: baseprimitive2d.cxx,v $
+ *
+ * $Revision: 1.6 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:20 $
+ *
+ * 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
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_drawinglayer.hxx"
+
+#include <drawinglayer/primitive2d/primitivetools2d.hxx>
+#include <basegfx/vector/b2dvector.hxx>
+#include <drawinglayer/geometry/viewinformation2d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ Primitive2DSequence DiscreteMetricDependentPrimitive2D::get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const
+ {
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ // get the current DiscreteUnit
+ const double fDiscreteUnit((rViewInformation.getInverseObjectToViewTransformation() * basegfx::B2DVector(1.0, 0.0)).getLength());
+
+ if(getLocalDecomposition().hasElements() && !basegfx::fTools::equal(fDiscreteUnit, getDiscreteUnit()))
+ {
+ // conditions of last local decomposition have changed, delete
+ const_cast< DiscreteMetricDependentPrimitive2D* >(this)->setLocalDecomposition(Primitive2DSequence());
+ }
+
+ if(!getLocalDecomposition().hasElements())
+ {
+ // remember new valid DiscreteUnit
+ const_cast< DiscreteMetricDependentPrimitive2D* >(this)->mfDiscreteUnit = fDiscreteUnit;
+ }
+
+ // call base implementation
+ return BasePrimitive2D::get2DDecomposition(rViewInformation);
+ }
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ Primitive2DSequence ViewportDependentPrimitive2D::get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const
+ {
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ // get the current Viewport
+ const basegfx::B2DRange& rViewport = rViewInformation.getViewport();
+
+ if(getLocalDecomposition().hasElements() && !rViewport.equal(getViewport()))
+ {
+ // conditions of last local decomposition have changed, delete
+ const_cast< ViewportDependentPrimitive2D* >(this)->setLocalDecomposition(Primitive2DSequence());
+ }
+
+ if(!getLocalDecomposition().hasElements())
+ {
+ // remember new valid DiscreteUnit
+ const_cast< ViewportDependentPrimitive2D* >(this)->maViewport = rViewport;
+ }
+
+ // call base implementation
+ return BasePrimitive2D::get2DDecomposition(rViewInformation);
+ }
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
index bf5e5cf390..a50ab8ed05 100644
--- a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
@@ -363,11 +363,13 @@ namespace drawinglayer
basegfx::B2DRange aDiscreteRange;
basegfx::B2DRange aUnitVisibleRange;
bool bNeedNewDecomposition(false);
+ bool bDiscreteSizesAreCalculated(false);
if(getLocalDecomposition().hasElements())
{
basegfx::B2DRange aVisibleDiscreteRange;
calculateDsicreteSizes(rViewInformation, aDiscreteRange, aVisibleDiscreteRange, aUnitVisibleRange);
+ bDiscreteSizesAreCalculated = true;
// display has changed and cannot be reused when resolution did change
if(!basegfx::fTools::equal(aDiscreteRange.getWidth(), mfOldDiscreteSizeX) ||
@@ -395,6 +397,12 @@ namespace drawinglayer
if(!getLocalDecomposition().hasElements())
{
+ if(!bDiscreteSizesAreCalculated)
+ {
+ basegfx::B2DRange aVisibleDiscreteRange;
+ calculateDsicreteSizes(rViewInformation, aDiscreteRange, aVisibleDiscreteRange, aUnitVisibleRange);
+ }
+
// remember last used NewDiscreteSize and NewUnitVisiblePart
ScenePrimitive2D* pThat = const_cast< ScenePrimitive2D* >(this);
pThat->mfOldDiscreteSizeX = aDiscreteRange.getWidth();
diff --git a/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx b/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx
index b397314aee..6a2d66a5d3 100644
--- a/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx
@@ -305,7 +305,7 @@ namespace drawinglayer
// TextLayouterDevice is needed to get metrics for text decorations like
// underline/strikeout/emphasis marks from it. For setup, the font size is needed
- aTextLayouter.setFontAttributes(getFontAttributes(), rDecTrans.getScale().getX(), rDecTrans.getScale().getY());
+ aTextLayouter.setFontAttributes(getFontAttributes(), rDecTrans.getScale().getX(), rDecTrans.getScale().getY(), getLocale());
// get text width
double fTextWidth(0.0);
@@ -526,7 +526,7 @@ namespace drawinglayer
if(bNoDXArray)
{
// ..but only completely when no DXArray
- aTextLayouter.setFontAttributes(getFontAttributes(), rDecTrans.getScale().getX(), rDecTrans.getScale().getY());
+ aTextLayouter.setFontAttributes(getFontAttributes(), rDecTrans.getScale().getX(), rDecTrans.getScale().getY(),getLocale());
}
// do iterate over single words
diff --git a/drawinglayer/source/primitive2d/textlayoutdevice.cxx b/drawinglayer/source/primitive2d/textlayoutdevice.cxx
index 35f62a8c5c..b2fe10d6f9 100644
--- a/drawinglayer/source/primitive2d/textlayoutdevice.cxx
+++ b/drawinglayer/source/primitive2d/textlayoutdevice.cxx
@@ -41,6 +41,7 @@
#include <vcl/virdev.hxx>
#include <vcl/font.hxx>
#include <vcl/metric.hxx>
+#include <i18npool/mslangid.hxx>
#include <drawinglayer/primitive2d/textprimitive2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -165,14 +166,14 @@ namespace drawinglayer
mrDevice.SetFont( rFont );
}
- void TextLayouterDevice::setFontAttributes(const FontAttributes& rFontAttributes, const basegfx::B2DHomMatrix& rTransform)
+ void TextLayouterDevice::setFontAttributes(const FontAttributes& rFontAttributes, const basegfx::B2DHomMatrix& rTransform, const ::com::sun::star::lang::Locale & rLocale)
{
- setFont(getVclFontFromFontAttributes(rFontAttributes, rTransform, mrDevice));
+ setFont(getVclFontFromFontAttributes(rFontAttributes, rTransform, rLocale, mrDevice));
}
- void TextLayouterDevice::setFontAttributes(const FontAttributes& rFontAttributes, double fFontScaleX, double fFontScaleY)
+ void TextLayouterDevice::setFontAttributes(const FontAttributes& rFontAttributes, double fFontScaleX, double fFontScaleY, const ::com::sun::star::lang::Locale & rLocale)
{
- setFont(getVclFontFromFontAttributes(rFontAttributes, fFontScaleX, fFontScaleY, 0.0, mrDevice));
+ setFont(getVclFontFromFontAttributes(rFontAttributes, fFontScaleX, fFontScaleY, 0.0, rLocale, mrDevice));
}
double TextLayouterDevice::getOverlineOffset() const
@@ -239,8 +240,25 @@ namespace drawinglayer
basegfx::B2DPolyPolygonVector& rB2DPolyPolyVector,
const String& rText,
xub_StrLen nIndex,
- xub_StrLen nLength)
+ xub_StrLen nLength,
+ // #i89784# added suppirt for DXArray for justified text
+ const ::std::vector< double >& rDXArray,
+ double fFontScaleWidth)
{
+ std::vector< sal_Int32 > aTransformedDXArray;
+ const sal_uInt32 nDXArraySize(rDXArray.size());
+
+ if(nDXArraySize && basegfx::fTools::more(fFontScaleWidth, 0.0))
+ {
+ OSL_ENSURE(nDXArraySize == nLength, "DXArray size does not correspond to text portion size (!)");
+ aTransformedDXArray.reserve(nDXArraySize);
+
+ for(std::vector< double >::const_iterator aStart(rDXArray.begin()); aStart != rDXArray.end(); aStart++)
+ {
+ aTransformedDXArray.push_back(basegfx::fround((*aStart) * fFontScaleWidth));
+ }
+ }
+
return mrDevice.GetTextOutlines(
rB2DPolyPolyVector,
rText,
@@ -249,7 +267,7 @@ namespace drawinglayer
nLength,
true,
0,
- 0);
+ nDXArraySize ? &(aTransformedDXArray[0]) : 0);
}
basegfx::B2DRange TextLayouterDevice::getTextBoundRect(
@@ -268,12 +286,14 @@ namespace drawinglayer
nIndex,
nLength);
- return basegfx::B2DRange(aRect.Left(), aRect.Top(), aRect.Right(), aRect.Bottom());
- }
- else
- {
- return basegfx::B2DRange();
+ // #i102556# take empty results into account
+ if(!aRect.IsEmpty())
+ {
+ return basegfx::B2DRange(aRect.Left(), aRect.Top(), aRect.Right(), aRect.Bottom());
+ }
}
+
+ return basegfx::B2DRange();
}
} // end of namespace primitive2d
} // end of namespace drawinglayer
@@ -288,6 +308,7 @@ namespace drawinglayer
Font getVclFontFromFontAttributes(
const FontAttributes& rFontAttributes,
const basegfx::B2DHomMatrix& rTransform,
+ const ::com::sun::star::lang::Locale & rLocale,
const OutputDevice& rOutDev)
{
// decompose matrix to have position and size of text
@@ -296,7 +317,7 @@ namespace drawinglayer
rTransform.decompose(aScale, aTranslate, fRotate, fShearX);
- return getVclFontFromFontAttributes(rFontAttributes, aScale.getX(), aScale.getY(), fRotate, rOutDev);
+ return getVclFontFromFontAttributes(rFontAttributes, aScale.getX(), aScale.getY(), fRotate, rLocale, rOutDev);
}
Font getVclFontFromFontAttributes(
@@ -304,6 +325,7 @@ namespace drawinglayer
double fFontScaleX,
double fFontScaleY,
double fFontRotation,
+ const ::com::sun::star::lang::Locale & rLocale,
const OutputDevice& /*rOutDev*/)
{
sal_uInt32 nWidth(basegfx::fround(fabs(fFontScaleX)));
@@ -323,6 +345,7 @@ namespace drawinglayer
aRetval.SetWeight(static_cast<FontWeight>(rFontAttributes.getWeight()));
aRetval.SetItalic(rFontAttributes.getItalic() ? ITALIC_NORMAL : ITALIC_NONE);
aRetval.SetOutline(rFontAttributes.getOutline());
+ aRetval.SetLanguage(MsLangId::convertLocaleToLanguage(rLocale));
#ifdef WIN32
// #100424# use higher precision
diff --git a/drawinglayer/source/primitive2d/textprimitive2d.cxx b/drawinglayer/source/primitive2d/textprimitive2d.cxx
index 79c71a734b..cc64c5a10e 100644
--- a/drawinglayer/source/primitive2d/textprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/textprimitive2d.cxx
@@ -145,17 +145,25 @@ namespace drawinglayer
// prepare textlayoutdevice
TextLayouterDevice aTextLayouter;
- aTextLayouter.setFontAttributes(getFontAttributes(), aFontScale.getX(), aFontScale.getY());
+ aTextLayouter.setFontAttributes(getFontAttributes(), aFontScale.getX(), aFontScale.getY(), getLocale());
#ifdef WIN32
// when under Windows and the font is unequally scaled, need to correct font X-Scaling factor
if(bCorrectScale)
{
- aScale.setX(aScale.getX() * aTextLayouter.getCurrentFontRelation());
+ const double fFontRelation(aTextLayouter.getCurrentFontRelation());
+ aScale.setX(aScale.getX() * fFontRelation);
+ aFontScale.setX(aFontScale.getX() / fFontRelation);
}
#endif
// get the text outlines. No DXArray is given (would contain integers equal to unit vector
// transformed by object's transformation), let VCL do the job
- aTextLayouter.getTextOutlines(rTarget, getText(), getTextPosition(), getTextLength());
+ aTextLayouter.getTextOutlines(
+ rTarget, getText(),
+ getTextPosition(),
+ getTextLength(),
+ // #i89784# added support for DXArray for justified text
+ getDXArray(),
+ aFontScale.getX());
// create primitives for the outlines
const sal_uInt32 nCount(rTarget.size());
@@ -300,30 +308,35 @@ namespace drawinglayer
// prepare textlayoutdevice
TextLayouterDevice aTextLayouter;
- aTextLayouter.setFontAttributes(getFontAttributes(), aFontScale.getX(), aFontScale.getY());
+ aTextLayouter.setFontAttributes(getFontAttributes(), aFontScale.getX(), aFontScale.getY(), getLocale());
// get basic text range
basegfx::B2DRange aNewRange(aTextLayouter.getTextBoundRect(getText(), getTextPosition(), getTextLength()));
-#ifdef WIN32
- // when under Windows and the font is unequally scaled, need to correct font X-Scaling factor
- if(bCorrectScale)
+
+ // #i102556# take empty results into account
+ if(!aNewRange.isEmpty())
{
- aScale.setX(aScale.getX() * aTextLayouter.getCurrentFontRelation());
- }
+#ifdef WIN32
+ // when under Windows and the font is unequally scaled, need to correct font X-Scaling factor
+ if(bCorrectScale)
+ {
+ aScale.setX(aScale.getX() * aTextLayouter.getCurrentFontRelation());
+ }
#endif
- // prepare object transformation for range
- basegfx::B2DHomMatrix aRangeTransformation;
+ // prepare object transformation for range
+ basegfx::B2DHomMatrix aRangeTransformation;
- aRangeTransformation.scale(aScale.getX(), aScale.getY());
- aRangeTransformation.shearX(fShearX);
- aRangeTransformation.rotate(fRotate);
- aRangeTransformation.translate(aTranslate.getX(), aTranslate.getY());
-
- // apply range transformation to it
- aNewRange.transform(aRangeTransformation);
+ aRangeTransformation.scale(aScale.getX(), aScale.getY());
+ aRangeTransformation.shearX(fShearX);
+ aRangeTransformation.rotate(fRotate);
+ aRangeTransformation.translate(aTranslate.getX(), aTranslate.getY());
+
+ // apply range transformation to it
+ aNewRange.transform(aRangeTransformation);
- // assign to buffered value
- const_cast< TextSimplePortionPrimitive2D* >(this)->maB2DRange = aNewRange;
+ // assign to buffered value
+ const_cast< TextSimplePortionPrimitive2D* >(this)->maB2DRange = aNewRange;
+ }
}
}
diff --git a/drawinglayer/source/processor2d/canvasprocessor.cxx b/drawinglayer/source/processor2d/canvasprocessor.cxx
index 4fd65b543d..77cb2b3350 100644
--- a/drawinglayer/source/processor2d/canvasprocessor.cxx
+++ b/drawinglayer/source/processor2d/canvasprocessor.cxx
@@ -2106,7 +2106,10 @@ namespace drawinglayer
mpOutputDevice->Push(PUSH_MAPMODE);
mpOutputDevice->SetMapMode(maOriginalMapMode);
- if(!renderChartPrimitive2D(rChartPrimitive, *mpOutputDevice))
+ if(!renderChartPrimitive2D(
+ rChartPrimitive,
+ *mpOutputDevice,
+ getViewInformation2D()))
{
// fallback to decomposition (MetaFile)
process(rChartPrimitive.get2DDecomposition(getViewInformation2D()));
diff --git a/drawinglayer/source/processor2d/helperchartrenderer.cxx b/drawinglayer/source/processor2d/helperchartrenderer.cxx
index 3d1f6a1afe..383f678e28 100644
--- a/drawinglayer/source/processor2d/helperchartrenderer.cxx
+++ b/drawinglayer/source/processor2d/helperchartrenderer.cxx
@@ -41,6 +41,7 @@
#include <svtools/chartprettypainter.hxx>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <drawinglayer/geometry/viewinformation2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -50,7 +51,10 @@ using namespace com::sun::star;
namespace drawinglayer
{
- bool renderChartPrimitive2D(const primitive2d::ChartPrimitive2D& rChartCandidate, OutputDevice& rOutputDevice)
+ bool renderChartPrimitive2D(
+ const primitive2d::ChartPrimitive2D& rChartCandidate,
+ OutputDevice& rOutputDevice,
+ const geometry::ViewInformation2D& rViewInformation2D)
{
bool bChartRendered(false);
@@ -73,14 +77,74 @@ namespace drawinglayer
if( pPrettyPainter )
{
- // create logic object range
+ // create logic object range; do NOT use ObjectTransformation for this
+ // (rViewInformation2D.getObjectTransformation()), only the logic object
+ // size is wanted
basegfx::B2DRange aObjectRange(0.0, 0.0, 1.0, 1.0);
aObjectRange.transform(rChartCandidate.getTransformation());
const Rectangle aRectangle(
(sal_Int32)aObjectRange.getMinX(), (sal_Int32)aObjectRange.getMinY(),
(sal_Int32)aObjectRange.getMaxX(), (sal_Int32)aObjectRange.getMaxY());
- bChartRendered = pPrettyPainter->DoPaint(&rOutputDevice, aRectangle);
+ // #i101811#
+ if(rViewInformation2D.getObjectTransformation().isIdentity())
+ {
+ // no embedding in another transfromation, just paint with existing
+ // MapMode. This is just a shortcut; using the below code will also
+ // work; it has just a neutral ObjectTransformation
+ bChartRendered = pPrettyPainter->DoPaint(&rOutputDevice, aRectangle);
+ }
+ else
+ {
+ // rViewInformation2D.getObjectTransformation() is used and
+ // needs to be expressed in the MapMode for the PrettyPainter;
+ // else it would call ChartModelHelper::setPageSize(...) with the
+ // changed size what really will change the chart model and leads
+ // to re-layouts and re-formattings
+ const MapMode aOldMapMode(rOutputDevice.GetMapMode());
+ basegfx::B2DVector aVTScale, aScale, aTranslate;
+ double fRotate, fShearX;
+
+ // get basic scaling with current MapMode (aVTScale), containing
+ // mapping for set MapUnit (e.g. for 100th mm, the basic scale is
+ // not 1.0, 1.0). This is needed since this scale is included in
+ // the ObjectToView Transformation and needs to be removed (see
+ // correction below) to re-create a MapMode
+ rOutputDevice.SetMapMode(aOldMapMode.GetMapUnit());
+ rOutputDevice.GetViewTransformation().decompose(aVTScale, aTranslate, fRotate, fShearX);
+
+ // get complete ObjectToView Transformation scale and translate from current
+ // transformation chain (combined view and object transform)
+ rViewInformation2D.getObjectToViewTransformation().decompose(aScale, aTranslate, fRotate, fShearX);
+
+ // assert when shear and/or rotation is used
+ OSL_ENSURE(basegfx::fTools::equalZero(fRotate), "Chart PrettyPrinting with unsupportable rotation (!)");
+ OSL_ENSURE(basegfx::fTools::equalZero(fShearX), "Chart PrettyPrinting with unsupportable shear (!)");
+
+ // clean scale and translate from basic scaling (DPI, etc...)
+ // since this will implicitely be part of the to-be-created MapMode
+ const basegfx::B2DTuple aBasicCleaner(
+ basegfx::fTools::equalZero(aVTScale.getX()) ? 1.0 : 1.0 / aVTScale.getX(),
+ basegfx::fTools::equalZero(aVTScale.getY()) ? 1.0 : 1.0 / aVTScale.getY());
+ aScale *= aBasicCleaner;
+ aTranslate *= aBasicCleaner;
+
+ // for MapMode, take scale out of translation
+ const basegfx::B2DTuple aScaleRemover(
+ basegfx::fTools::equalZero(aScale.getX()) ? 1.0 : 1.0 / aScale.getX(),
+ basegfx::fTools::equalZero(aScale.getY()) ? 1.0 : 1.0 / aScale.getY());
+ aTranslate *= aScaleRemover;
+
+ // build new MapMode
+ const MapMode aNewMapMode(aOldMapMode.GetMapUnit(),
+ Point(basegfx::fround(aTranslate.getX()), basegfx::fround(aTranslate.getY())),
+ Fraction(aScale.getX()), Fraction(aScale.getY()));
+
+ // use, paint, restore
+ rOutputDevice.SetMapMode(aNewMapMode);
+ bChartRendered = pPrettyPainter->DoPaint(&rOutputDevice, aRectangle);
+ rOutputDevice.SetMapMode(aOldMapMode);
+ }
}
}
}
diff --git a/drawinglayer/source/processor2d/helperchartrenderer.hxx b/drawinglayer/source/processor2d/helperchartrenderer.hxx
index de13431c79..e670cccdf2 100644
--- a/drawinglayer/source/processor2d/helperchartrenderer.hxx
+++ b/drawinglayer/source/processor2d/helperchartrenderer.hxx
@@ -43,16 +43,21 @@
class OutputDevice;
-namespace drawinglayer { namespace primitive2d {
- class ChartPrimitive2D;
-}}
+namespace drawinglayer { namespace primitive2d { class ChartPrimitive2D; }}
+namespace drawinglayer { namespace geometry { class ViewInformation2D; }}
//////////////////////////////////////////////////////////////////////////////
// support chart PrettyPrinter usage from primitives
namespace drawinglayer
{
- bool renderChartPrimitive2D(const primitive2d::ChartPrimitive2D& rChartCandidate, OutputDevice& rOutputDevice);
+ // #i101811#
+ // Added current ViewInformation2D to take evtl. changed
+ // ObjectTransformation into account
+ bool renderChartPrimitive2D(
+ const primitive2d::ChartPrimitive2D& rChartCandidate,
+ OutputDevice& rOutputDevice,
+ const geometry::ViewInformation2D& rViewInformation2D);
} // end of namespace drawinglayer
diff --git a/drawinglayer/source/processor2d/hittestprocessor2d.cxx b/drawinglayer/source/processor2d/hittestprocessor2d.cxx
new file mode 100644
index 0000000000..cc71ea19ab
--- /dev/null
+++ b/drawinglayer/source/processor2d/hittestprocessor2d.cxx
@@ -0,0 +1,451 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: contourextractor2d.cxx,v $
+ *
+ * $Revision: 1.6 $
+ *
+ * last change: $Author: aw $ $Date: 2008-06-24 15:31:08 $
+ *
+ * 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
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_drawinglayer.hxx"
+
+#include <drawinglayer/processor2d/hittestprocessor2d.hxx>
+#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
+#include <drawinglayer/primitive2d/transformprimitive2d.hxx>
+#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
+#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
+#include <basegfx/polygon/b2dpolygontools.hxx>
+#include <basegfx/polygon/b2dpolypolygontools.hxx>
+#include <drawinglayer/primitive2d/alphaprimitive2d.hxx>
+#include <drawinglayer/primitive2d/maskprimitive2d.hxx>
+#include <drawinglayer/primitive2d/sceneprimitive2d.hxx>
+#include <drawinglayer/primitive2d/hittestprimitive2d.hxx>
+#include <drawinglayer/primitive2d/pointarrayprimitive2d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace processor2d
+ {
+ HitTestProcessor2D::HitTestProcessor2D(const geometry::ViewInformation2D& rViewInformation,
+ const basegfx::B2DPoint& rLogicHitPosition,
+ double fLogicHitTolerance,
+ bool bHitTextOnly)
+ : BaseProcessor2D(rViewInformation),
+ maDiscreteHitPosition(),
+ mfDiscreteHitTolerance(0.0),
+ mbHit(false),
+ mbHitToleranceUsed(false),
+ mbUseHitTestPrimitiveContent(true),
+ mbHitTextOnly(bHitTextOnly)
+ {
+ // init hit tolerance
+ mfDiscreteHitTolerance = fLogicHitTolerance;
+
+ if(basegfx::fTools::less(mfDiscreteHitTolerance, 0.0))
+ {
+ // ensure input parameter for hit tolerance is >= 0.0
+ mfDiscreteHitTolerance = 0.0;
+ }
+ else if(basegfx::fTools::more(mfDiscreteHitTolerance, 0.0))
+ {
+ // generate discrete hit tolerance
+ mfDiscreteHitTolerance = (getViewInformation2D().getObjectToViewTransformation()
+ * basegfx::B2DVector(mfDiscreteHitTolerance, 0.0)).getLength();
+ }
+
+ // gererate discrete hit position
+ maDiscreteHitPosition = getViewInformation2D().getObjectToViewTransformation() * rLogicHitPosition;
+
+ // check if HitTolerance is used
+ mbHitToleranceUsed = basegfx::fTools::more(getDiscreteHitTolerance(), 0.0);
+ }
+
+ HitTestProcessor2D::~HitTestProcessor2D()
+ {
+ }
+
+ bool HitTestProcessor2D::checkHairlineHitWithTolerance(
+ const basegfx::B2DPolygon& rPolygon,
+ double fDiscreteHitTolerance)
+ {
+ basegfx::B2DPolygon aLocalPolygon(rPolygon);
+ aLocalPolygon.transform(getViewInformation2D().getObjectToViewTransformation());
+
+ // get discrete range
+ basegfx::B2DRange aPolygonRange(aLocalPolygon.getB2DRange());
+
+ if(basegfx::fTools::more(fDiscreteHitTolerance, 0.0))
+ {
+ aPolygonRange.grow(fDiscreteHitTolerance);
+ }
+
+ // do rough range test first
+ if(aPolygonRange.isInside(getDiscreteHitPosition()))
+ {
+ // check if a polygon edge is hit
+ return basegfx::tools::isInEpsilonRange(
+ aLocalPolygon,
+ getDiscreteHitPosition(),
+ fDiscreteHitTolerance);
+ }
+
+ return false;
+ }
+
+ bool HitTestProcessor2D::checkFillHitWithTolerance(
+ const basegfx::B2DPolyPolygon& rPolyPolygon,
+ double fDiscreteHitTolerance)
+ {
+ bool bRetval(false);
+ basegfx::B2DPolyPolygon aLocalPolyPolygon(rPolyPolygon);
+ aLocalPolyPolygon.transform(getViewInformation2D().getObjectToViewTransformation());
+
+ // get discrete range
+ basegfx::B2DRange aPolygonRange(aLocalPolyPolygon.getB2DRange());
+ const bool bDiscreteHitToleranceUsed(basegfx::fTools::more(fDiscreteHitTolerance, 0.0));
+
+ if(bDiscreteHitToleranceUsed)
+ {
+ aPolygonRange.grow(fDiscreteHitTolerance);
+ }
+
+ // do rough range test first
+ if(aPolygonRange.isInside(getDiscreteHitPosition()))
+ {
+ // if a HitTolerance is given, check for polygon edge hit in epsilon first
+ if(bDiscreteHitToleranceUsed &&
+ basegfx::tools::isInEpsilonRange(
+ aLocalPolyPolygon,
+ getDiscreteHitPosition(),
+ fDiscreteHitTolerance))
+ {
+ bRetval = true;
+ }
+
+ // check for hit in filled polyPolygon
+ if(!bRetval && basegfx::tools::isInside(
+ aLocalPolyPolygon,
+ getDiscreteHitPosition(),
+ true))
+ {
+ bRetval = true;
+ }
+ }
+
+ return bRetval;
+ }
+
+ void HitTestProcessor2D::processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate)
+ {
+ if(getHit())
+ {
+ // stop processing as soon as a hit was recognized
+ return;
+ }
+
+ switch(rCandidate.getPrimitiveID())
+ {
+ case PRIMITIVE2D_ID_TRANSFORMPRIMITIVE2D :
+ {
+ // remember current ViewInformation2D
+ const primitive2d::TransformPrimitive2D& rTransformCandidate(static_cast< const primitive2d::TransformPrimitive2D& >(rCandidate));
+ const geometry::ViewInformation2D aLastViewInformation2D(getViewInformation2D());
+
+ // create new local ViewInformation2D containing transformation
+ const geometry::ViewInformation2D aViewInformation2D(
+ getViewInformation2D().getObjectTransformation() * rTransformCandidate.getTransformation(),
+ getViewInformation2D().getViewTransformation(),
+ getViewInformation2D().getViewport(),
+ getViewInformation2D().getVisualizedPage(),
+ getViewInformation2D().getViewTime(),
+ getViewInformation2D().getExtendedInformationSequence());
+ updateViewInformation(aViewInformation2D);
+
+ // proccess child content recursively
+ process(rTransformCandidate.getChildren());
+
+ // restore transformations
+ updateViewInformation(aLastViewInformation2D);
+
+ break;
+ }
+ case PRIMITIVE2D_ID_POLYGONHAIRLINEPRIMITIVE2D :
+ {
+ if(!getHitTextOnly())
+ {
+ // create hairline in discrete coordinates
+ const primitive2d::PolygonHairlinePrimitive2D& rPolygonCandidate(static_cast< const primitive2d::PolygonHairlinePrimitive2D& >(rCandidate));
+
+ // use hairline test
+ mbHit = checkHairlineHitWithTolerance(rPolygonCandidate.getB2DPolygon(), getDiscreteHitTolerance());
+ }
+
+ break;
+ }
+ case PRIMITIVE2D_ID_POLYGONMARKERPRIMITIVE2D :
+ {
+ if(!getHitTextOnly())
+ {
+ // handle marker like hairline; no need to decompose in dashes
+ const primitive2d::PolygonMarkerPrimitive2D& rPolygonCandidate(static_cast< const primitive2d::PolygonMarkerPrimitive2D& >(rCandidate));
+
+ // use hairline test
+ mbHit = checkHairlineHitWithTolerance(rPolygonCandidate.getB2DPolygon(), getDiscreteHitTolerance());
+ }
+
+ break;
+ }
+ case PRIMITIVE2D_ID_POLYGONSTROKEPRIMITIVE2D :
+ {
+ if(!getHitTextOnly())
+ {
+ // handle stroke evtl. directly; no need to decompose to filled polygon outlines
+ const primitive2d::PolygonStrokePrimitive2D& rPolygonCandidate(static_cast< const primitive2d::PolygonStrokePrimitive2D& >(rCandidate));
+ const attribute::LineAttribute& rLineAttribute = rPolygonCandidate.getLineAttribute();
+
+ if(basegfx::fTools::more(rLineAttribute.getWidth(), 0.0))
+ {
+ if(basegfx::B2DLINEJOIN_MITER == rLineAttribute.getLineJoin())
+ {
+ // if line is mitered, use decomposition since mitered line
+ // geometry may use more space than the geometry grown by half line width
+ process(rCandidate.get2DDecomposition(getViewInformation2D()));
+ }
+ else
+ {
+ // for all other B2DLINEJOIN_* do a hairline HitTest with expanded tolerance
+ const basegfx::B2DVector aDiscreteHalfLineVector(getViewInformation2D().getObjectToViewTransformation()
+ * basegfx::B2DVector(rLineAttribute.getWidth() * 0.5, 0.0));
+ mbHit = checkHairlineHitWithTolerance(
+ rPolygonCandidate.getB2DPolygon(),
+ getDiscreteHitTolerance() + aDiscreteHalfLineVector.getLength());
+ }
+ }
+ else
+ {
+ // hairline; fallback to hairline test. Do not decompose
+ // since this may decompose the hairline to dashes
+ mbHit = checkHairlineHitWithTolerance(rPolygonCandidate.getB2DPolygon(), getDiscreteHitTolerance());
+ }
+ }
+
+ break;
+ }
+ case PRIMITIVE2D_ID_POLYGONWAVEPRIMITIVE2D :
+ {
+ if(!getHitTextOnly())
+ {
+ // do not use decompose; just handle like a line with width
+ const primitive2d::PolygonWavePrimitive2D& rPolygonCandidate(static_cast< const primitive2d::PolygonWavePrimitive2D& >(rCandidate));
+ double fLogicHitTolerance(0.0);
+
+ // if WaveHeight, grow by it
+ if(basegfx::fTools::more(rPolygonCandidate.getWaveHeight(), 0.0))
+ {
+ fLogicHitTolerance += rPolygonCandidate.getWaveHeight();
+ }
+
+ // if line width, grow by it
+ if(basegfx::fTools::more(rPolygonCandidate.getLineAttribute().getWidth(), 0.0))
+ {
+ fLogicHitTolerance += rPolygonCandidate.getLineAttribute().getWidth() * 0.5;
+ }
+
+ const basegfx::B2DVector aDiscreteHalfLineVector(getViewInformation2D().getObjectToViewTransformation()
+ * basegfx::B2DVector(fLogicHitTolerance, 0.0));
+
+ mbHit = checkHairlineHitWithTolerance(
+ rPolygonCandidate.getB2DPolygon(),
+ getDiscreteHitTolerance() + aDiscreteHalfLineVector.getLength());
+ }
+
+ break;
+ }
+ case PRIMITIVE2D_ID_POLYPOLYGONCOLORPRIMITIVE2D :
+ {
+ if(!getHitTextOnly())
+ {
+ // create filled polyPolygon in discrete coordinates
+ const primitive2d::PolyPolygonColorPrimitive2D& rPolygonCandidate(static_cast< const primitive2d::PolyPolygonColorPrimitive2D& >(rCandidate));
+
+ // use fill hit test
+ mbHit = checkFillHitWithTolerance(rPolygonCandidate.getB2DPolyPolygon(), getDiscreteHitTolerance());
+ }
+
+ break;
+ }
+ case PRIMITIVE2D_ID_ALPHAPRIMITIVE2D :
+ {
+ // sub-transparence group
+ const primitive2d::AlphaPrimitive2D& rTransCandidate(static_cast< const primitive2d::AlphaPrimitive2D& >(rCandidate));
+
+ // Currently the transparence content is not taken into account; only
+ // the children are recursively checked for hit. This may be refined for
+ // parts where the content is completely transparent if needed.
+ process(rTransCandidate.getChildren());
+
+ break;
+ }
+ case PRIMITIVE2D_ID_MASKPRIMITIVE2D :
+ {
+ // create mask in discrete coordinates; only recursively continue
+ // with content when HitTest position is inside the mask
+ const primitive2d::MaskPrimitive2D& rMaskCandidate(static_cast< const primitive2d::MaskPrimitive2D& >(rCandidate));
+
+ // use fill hit test
+ if(checkFillHitWithTolerance(rMaskCandidate.getMask(), getDiscreteHitTolerance()))
+ {
+ // recursively HitTest children
+ process(rMaskCandidate.getChildren());
+ }
+
+ break;
+ }
+ case PRIMITIVE2D_ID_SCENEPRIMITIVE2D :
+ {
+ if(!getHitTextOnly())
+ {
+ // 2D Scene primitive containing 3D stuff; extract 2D contour in world coordinates
+ // This may be refined later to an own 3D HitTest renderer which processes the 3D
+ // geometry directly
+ const primitive2d::ScenePrimitive2D& rScenePrimitive2DCandidate(static_cast< const primitive2d::ScenePrimitive2D& >(rCandidate));
+ const primitive2d::Primitive2DSequence xExtracted2DSceneGeometry(rScenePrimitive2DCandidate.getGeometry2D(getViewInformation2D()));
+
+ if(xExtracted2DSceneGeometry.hasElements())
+ {
+ // proccess extracted 2D content
+ process(xExtracted2DSceneGeometry);
+ }
+ else
+ {
+ // empty 3D scene; Check for border hit
+ const basegfx::B2DRange aRange(rCandidate.getB2DRange(getViewInformation2D()));
+ basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(aRange));
+
+ mbHit = checkHairlineHitWithTolerance(aOutline, getDiscreteHitTolerance());
+ }
+ }
+
+ break;
+ }
+ case PRIMITIVE2D_ID_WRONGSPELLPRIMITIVE2D :
+ case PRIMITIVE2D_ID_MARKERARRAYPRIMITIVE2D :
+ case PRIMITIVE2D_ID_GRIDPRIMITIVE2D :
+ case PRIMITIVE2D_ID_HELPLINEPRIMITIVE2D :
+ {
+ // ignorable primitives
+ break;
+ }
+ case PRIMITIVE2D_ID_TEXTSIMPLEPORTIONPRIMITIVE2D :
+ case PRIMITIVE2D_ID_TEXTDECORATEDPORTIONPRIMITIVE2D :
+ {
+ // for text use the BoundRect of the primitive itself
+ const basegfx::B2DRange aRange(rCandidate.getB2DRange(getViewInformation2D()));
+ basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(aRange));
+
+ mbHit = checkFillHitWithTolerance(basegfx::B2DPolyPolygon(aOutline), getDiscreteHitTolerance());
+
+ break;
+ }
+ case PRIMITIVE2D_ID_BITMAPPRIMITIVE2D :
+ case PRIMITIVE2D_ID_METAFILEPRIMITIVE2D :
+ case PRIMITIVE2D_ID_CONTROLPRIMITIVE2D :
+ case PRIMITIVE2D_ID_FILLGRADIENTPRIMITIVE2D :
+ case PRIMITIVE2D_ID_FILLHATCHPRIMITIVE2D :
+ case PRIMITIVE2D_ID_PAGEPREVIEWPRIMITIVE2D :
+ {
+ if(!getHitTextOnly())
+ {
+ // Class of primitives for which just the BoundRect of the primitive itself
+ // will be used for HitTest currently.
+ //
+ // This may be refined in the future, e.g:
+ // - For Bitamps, the mask and/or alpha information may be used
+ // - For MetaFiles, the MetaFile content may be used
+ const basegfx::B2DRange aRange(rCandidate.getB2DRange(getViewInformation2D()));
+ basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(aRange));
+
+ mbHit = checkFillHitWithTolerance(basegfx::B2DPolyPolygon(aOutline), getDiscreteHitTolerance());
+ }
+
+ break;
+ }
+ case PRIMITIVE2D_ID_HITTESTPRIMITIVE2D :
+ {
+ // HitTest primitive; the default decomposition would return an empty seqence,
+ // so force this primitive to process it's children directly if the switch is set
+ // (which is the default). Else, ignore invisible content
+ if(getUseHitTestPrimitiveContent())
+ {
+ const primitive2d::HitTestPrimitive2D& rHitTestCandidate(static_cast< const primitive2d::HitTestPrimitive2D& >(rCandidate));
+ process(rHitTestCandidate.getChildren());
+ }
+
+ break;
+ }
+ case PRIMITIVE2D_ID_POINTARRAYPRIMITIVE2D :
+ {
+ if(!getHitTextOnly())
+ {
+ const primitive2d::PointArrayPrimitive2D& rPointArrayCandidate(static_cast< const primitive2d::PointArrayPrimitive2D& >(rCandidate));
+ const std::vector< basegfx::B2DPoint >& rPositions = rPointArrayCandidate.getPositions();
+ const sal_uInt32 nCount(rPositions.size());
+
+ for(sal_uInt32 a(0); !getHit() && a < nCount; a++)
+ {
+ const basegfx::B2DPoint aPosition(getViewInformation2D().getObjectToViewTransformation() * rPositions[a]);
+ const basegfx::B2DVector aDistance(aPosition - getDiscreteHitPosition());
+
+ if(aDistance.getLength() <= getDiscreteHitTolerance())
+ {
+ mbHit = true;
+ }
+ }
+ }
+
+ break;
+ }
+ default :
+ {
+ // process recursively
+ process(rCandidate.get2DDecomposition(getViewInformation2D()));
+
+ break;
+ }
+ }
+ }
+
+ } // end of namespace processor2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/processor2d/linegeometryextractor2d.cxx b/drawinglayer/source/processor2d/linegeometryextractor2d.cxx
index 11fce31788..fc7740eacc 100644
--- a/drawinglayer/source/processor2d/linegeometryextractor2d.cxx
+++ b/drawinglayer/source/processor2d/linegeometryextractor2d.cxx
@@ -86,7 +86,7 @@ namespace drawinglayer
const primitive2d::PolygonHairlinePrimitive2D& rPolygonCandidate(static_cast< const primitive2d::PolygonHairlinePrimitive2D& >(rCandidate));
basegfx::B2DPolygon aLocalPolygon(rPolygonCandidate.getB2DPolygon());
aLocalPolygon.transform(getViewInformation2D().getObjectTransformation());
- maExtractedHairlines.append(aLocalPolygon);
+ maExtractedHairlines.push_back(aLocalPolygon);
}
break;
}
@@ -98,7 +98,7 @@ namespace drawinglayer
const primitive2d::PolyPolygonColorPrimitive2D& rPolygonCandidate(static_cast< const primitive2d::PolyPolygonColorPrimitive2D& >(rCandidate));
basegfx::B2DPolyPolygon aLocalPolyPolygon(rPolygonCandidate.getB2DPolyPolygon());
aLocalPolyPolygon.transform(getViewInformation2D().getObjectTransformation());
- maExtractedLineFills.append(aLocalPolyPolygon);
+ maExtractedLineFills.push_back(aLocalPolyPolygon);
}
break;
}
diff --git a/drawinglayer/source/processor2d/makefile.mk b/drawinglayer/source/processor2d/makefile.mk
index 38dcb42cd4..fcbf2413b6 100644
--- a/drawinglayer/source/processor2d/makefile.mk
+++ b/drawinglayer/source/processor2d/makefile.mk
@@ -57,7 +57,9 @@ SLOFILES= \
$(SLO)$/vclmetafileprocessor2d.obj \
$(SLO)$/contourextractor2d.obj \
$(SLO)$/linegeometryextractor2d.obj \
- $(SLO)$/canvasprocessor.obj
+ $(SLO)$/canvasprocessor.obj \
+ $(SLO)$/hittestprocessor2d.obj \
+ $(SLO)$/textaspolygonextractor2d.obj
# --- Targets ----------------------------------
diff --git a/drawinglayer/source/processor2d/textaspolygonextractor2d.cxx b/drawinglayer/source/processor2d/textaspolygonextractor2d.cxx
new file mode 100644
index 0000000000..2ca8f3ff38
--- /dev/null
+++ b/drawinglayer/source/processor2d/textaspolygonextractor2d.cxx
@@ -0,0 +1,255 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: contourextractor2d.cxx,v $
+ *
+ * $Revision: 1.6 $
+ *
+ * last change: $Author: aw $ $Date: 2008-06-24 15:31:08 $
+ *
+ * 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
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_drawinglayer.hxx"
+
+#include <drawinglayer/processor2d/textaspolygonextractor2d.hxx>
+#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
+#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
+#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
+#include <drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx>
+#include <drawinglayer/primitive2d/transformprimitive2d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace processor2d
+ {
+ void TextAsPolygonExtractor2D::processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate)
+ {
+ switch(rCandidate.getPrimitiveID())
+ {
+ case PRIMITIVE2D_ID_TEXTDECORATEDPORTIONPRIMITIVE2D :
+ {
+ // TextDecoratedPortionPrimitive2D can produce the following primitives
+ // when being decomposed:
+ //
+ // - TextSimplePortionPrimitive2D
+ // - PolygonWavePrimitive2D
+ // - PolygonStrokePrimitive2D
+ // - PolygonStrokePrimitive2D
+ // - PolyPolygonColorPrimitive2D
+ // - PolyPolygonHairlinePrimitive2D
+ // - PolygonHairlinePrimitive2D
+ // - ShadowPrimitive2D
+ // - ModifiedColorPrimitive2D
+ // - TransformPrimitive2D
+ // - TextEffectPrimitive2D
+ // - ModifiedColorPrimitive2D
+ // - TransformPrimitive2D
+ // - GroupPrimitive2D
+
+ // encapsulate with flag and use decomposition
+ mnInText++;
+ process(rCandidate.get2DDecomposition(getViewInformation2D()));
+ mnInText--;
+
+ break;
+ }
+ case PRIMITIVE2D_ID_TEXTSIMPLEPORTIONPRIMITIVE2D :
+ {
+ // TextSimplePortionPrimitive2D can produce the following primitives
+ // when being decomposed:
+ //
+ // - PolyPolygonColorPrimitive2D
+ // - TextEffectPrimitive2D
+ // - ModifiedColorPrimitive2D
+ // - TransformPrimitive2D
+ // - GroupPrimitive2D
+
+ // encapsulate with flag and use decomposition
+ mnInText++;
+ process(rCandidate.get2DDecomposition(getViewInformation2D()));
+ mnInText--;
+
+ break;
+ }
+
+ // as can be seen from the TextSimplePortionPrimitive2D and the
+ // TextDecoratedPortionPrimitive2D, inside of the mnInText marks
+ // the following primitives can occurr containing geometry data
+ // from text decomposition:
+ //
+ // - PolyPolygonColorPrimitive2D
+ // - PolygonHairlinePrimitive2D
+ // - PolyPolygonHairlinePrimitive2D (for convenience)
+ //
+ case PRIMITIVE2D_ID_POLYPOLYGONCOLORPRIMITIVE2D :
+ {
+ if(mnInText)
+ {
+ const primitive2d::PolyPolygonColorPrimitive2D& rPoPoCoCandidate(static_cast< const primitive2d::PolyPolygonColorPrimitive2D& >(rCandidate));
+ basegfx::B2DPolyPolygon aPolyPolygon(rPoPoCoCandidate.getB2DPolyPolygon());
+
+ if(aPolyPolygon.count())
+ {
+ // transform the PolyPolygon
+ aPolyPolygon.transform(getViewInformation2D().getObjectToViewTransformation());
+
+ // get evtl. corrected color
+ const basegfx::BColor aColor(maBColorModifierStack.getModifiedColor(rPoPoCoCandidate.getBColor()));
+
+ // add to result vector
+ maTarget.push_back(TextAsPolygonDataNode(aPolyPolygon, aColor, true));
+ }
+ }
+
+ break;
+ }
+ case PRIMITIVE2D_ID_POLYGONHAIRLINEPRIMITIVE2D :
+ {
+ if(mnInText)
+ {
+ const primitive2d::PolygonHairlinePrimitive2D& rPoHaCandidate(static_cast< const primitive2d::PolygonHairlinePrimitive2D& >(rCandidate));
+ basegfx::B2DPolygon aPolygon(rPoHaCandidate.getB2DPolygon());
+
+ if(aPolygon.count())
+ {
+ // transform the Polygon
+ aPolygon.transform(getViewInformation2D().getObjectToViewTransformation());
+
+ // get evtl. corrected color
+ const basegfx::BColor aColor(maBColorModifierStack.getModifiedColor(rPoHaCandidate.getBColor()));
+
+ // add to result vector
+ maTarget.push_back(TextAsPolygonDataNode(basegfx::B2DPolyPolygon(aPolygon), aColor, false));
+ }
+ }
+
+ break;
+ }
+ case PRIMITIVE2D_ID_POLYPOLYGONHAIRLINEPRIMITIVE2D :
+ {
+ if(mnInText)
+ {
+ const primitive2d::PolyPolygonHairlinePrimitive2D& rPoPoHaCandidate(static_cast< const primitive2d::PolyPolygonHairlinePrimitive2D& >(rCandidate));
+ basegfx::B2DPolyPolygon aPolyPolygon(rPoPoHaCandidate.getB2DPolyPolygon());
+
+ if(aPolyPolygon.count())
+ {
+ // transform the Polygon
+ aPolyPolygon.transform(getViewInformation2D().getObjectToViewTransformation());
+
+ // get evtl. corrected color
+ const basegfx::BColor aColor(maBColorModifierStack.getModifiedColor(rPoPoHaCandidate.getBColor()));
+
+ // add to result vector
+ maTarget.push_back(TextAsPolygonDataNode(aPolyPolygon, aColor, false));
+ }
+ }
+
+ break;
+ }
+
+ // usage of color modification stack is needed
+ case PRIMITIVE2D_ID_MODIFIEDCOLORPRIMITIVE2D :
+ {
+ const primitive2d::ModifiedColorPrimitive2D& rModifiedColorCandidate(static_cast< const primitive2d::ModifiedColorPrimitive2D& >(rCandidate));
+
+ if(rModifiedColorCandidate.getChildren().hasElements())
+ {
+ maBColorModifierStack.push(rModifiedColorCandidate.getColorModifier());
+ process(rModifiedColorCandidate.getChildren());
+ maBColorModifierStack.pop();
+ }
+
+ break;
+ }
+
+ // usage of transformation stack is needed
+ case PRIMITIVE2D_ID_TRANSFORMPRIMITIVE2D :
+ {
+ // remember current transformation and ViewInformation
+ const primitive2d::TransformPrimitive2D& rTransformCandidate(static_cast< const primitive2d::TransformPrimitive2D& >(rCandidate));
+ const geometry::ViewInformation2D aLastViewInformation2D(getViewInformation2D());
+
+ // create new transformations for CurrentTransformation and for local ViewInformation2D
+ const geometry::ViewInformation2D aViewInformation2D(
+ getViewInformation2D().getObjectTransformation() * rTransformCandidate.getTransformation(),
+ getViewInformation2D().getViewTransformation(),
+ getViewInformation2D().getViewport(),
+ getViewInformation2D().getVisualizedPage(),
+ getViewInformation2D().getViewTime(),
+ getViewInformation2D().getExtendedInformationSequence());
+ updateViewInformation(aViewInformation2D);
+
+ // proccess content
+ process(rTransformCandidate.getChildren());
+
+ // restore transformations
+ updateViewInformation(aLastViewInformation2D);
+
+ break;
+ }
+
+ // ignorable primitives
+ case PRIMITIVE2D_ID_SCENEPRIMITIVE2D :
+ case PRIMITIVE2D_ID_WRONGSPELLPRIMITIVE2D :
+ case PRIMITIVE2D_ID_MARKERARRAYPRIMITIVE2D :
+ case PRIMITIVE2D_ID_POINTARRAYPRIMITIVE2D :
+ case PRIMITIVE2D_ID_BITMAPPRIMITIVE2D :
+ case PRIMITIVE2D_ID_METAFILEPRIMITIVE2D :
+ case PRIMITIVE2D_ID_MASKPRIMITIVE2D :
+ {
+ break;
+ }
+
+ default :
+ {
+ // process recursively
+ process(rCandidate.get2DDecomposition(getViewInformation2D()));
+ break;
+ }
+ }
+ }
+
+ TextAsPolygonExtractor2D::TextAsPolygonExtractor2D(const geometry::ViewInformation2D& rViewInformation)
+ : BaseProcessor2D(rViewInformation),
+ maTarget(),
+ maBColorModifierStack(),
+ mnInText(0)
+ {
+ }
+
+ TextAsPolygonExtractor2D::~TextAsPolygonExtractor2D()
+ {
+ }
+ } // end of namespace processor2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index f94001266f..c75e5003cc 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -247,8 +247,8 @@ namespace drawinglayer
if(rB2DPolygon.count() && !mnSvtGraphicStrokeCount)
{
basegfx::BColor aStrokeColor;
- PolyPolygon aStartPolyPolygon;
- PolyPolygon aEndPolyPolygon;
+ basegfx::B2DPolyPolygon aStartArrow;
+ basegfx::B2DPolyPolygon aEndArrow;
if(pColor)
{
@@ -271,11 +271,9 @@ namespace drawinglayer
{
fPolyLength = basegfx::tools::getLength(rB2DPolygon);
- const basegfx::B2DPolyPolygon aStartArrow(basegfx::tools::createAreaGeometryForLineStartEnd(
+ aStartArrow = basegfx::tools::createAreaGeometryForLineStartEnd(
rB2DPolygon, pStart->getB2DPolyPolygon(), true, pStart->getWidth(),
- fPolyLength, pStart->isCentered() ? 0.5 : 0.0, 0));
-
- aStartPolyPolygon = PolyPolygon(aStartArrow);
+ fPolyLength, pStart->isCentered() ? 0.5 : 0.0, 0);
}
if(pEnd && pEnd->isActive())
@@ -285,11 +283,9 @@ namespace drawinglayer
fPolyLength = basegfx::tools::getLength(rB2DPolygon);
}
- const basegfx::B2DPolyPolygon aEndArrow(basegfx::tools::createAreaGeometryForLineStartEnd(
+ aEndArrow = basegfx::tools::createAreaGeometryForLineStartEnd(
rB2DPolygon, pEnd->getB2DPolyPolygon(), false, pEnd->getWidth(),
- fPolyLength, pEnd->isCentered() ? 0.5 : 0.0, 0));
-
- aEndPolyPolygon = PolyPolygon(aEndArrow);
+ fPolyLength, pEnd->isCentered() ? 0.5 : 0.0, 0);
}
}
@@ -341,10 +337,23 @@ namespace drawinglayer
aDashArray = pStrokeAttribute->getDotDashArray();
}
+ // #i101734# apply current object transformation to created geometry.
+ // This is a partial fix. When a object transformation is used which
+ // e.g. contains a scaleX != scaleY, an unproportional scaling would
+ // have to be applied to the evtl. existing fat line. The current
+ // concept of PDF export and SvtGraphicStroke usage does simply not
+ // allow handling such definitions. The only clean way would be to
+ // add the transformation to SvtGraphicStroke and to handle it there
+ basegfx::B2DPolygon aB2DPolygon(rB2DPolygon);
+
+ aB2DPolygon.transform(maCurrentTransformation);
+ aStartArrow.transform(maCurrentTransformation);
+ aEndArrow.transform(maCurrentTransformation);
+
pRetval = new SvtGraphicStroke(
- Polygon(rB2DPolygon),
- aStartPolyPolygon,
- aEndPolyPolygon,
+ Polygon(aB2DPolygon),
+ PolyPolygon(aStartArrow),
+ PolyPolygon(aEndArrow),
mfCurrentUnifiedTransparence,
fLineWidth,
SvtGraphicStroke::capButt,
@@ -1001,7 +1010,68 @@ namespace drawinglayer
adaptLineToFillDrawMode();
impStartSvtGraphicStroke(pSvtGraphicStroke);
- process(rCandidate.get2DDecomposition(getViewInformation2D()));
+
+ // #i101491#
+ // Change default of fat line generation for MetaFiles: Create MetaPolyLineAction
+ // instead of decomposing all geometries when the polygon has more than given amount of
+ // points; else the decomposition will get too expensive quiclky. OTOH
+ // the decomposition provides the better quality e.g. taking edge roundings
+ // into account which will NOT be taken into account with LineInfo-based actions
+ const sal_uInt32 nSubPolygonCount(rStrokePrimitive.getB2DPolygon().count());
+ bool bDone(0 == nSubPolygonCount);
+
+ if(!bDone && nSubPolygonCount > 1000)
+ {
+ // create MetaPolyLineActions, but without LINE_DASH
+ const attribute::LineAttribute& rLine = rStrokePrimitive.getLineAttribute();
+
+ if(basegfx::fTools::more(rLine.getWidth(), 0.0))
+ {
+ const attribute::StrokeAttribute& rStroke = rStrokePrimitive.getStrokeAttribute();
+ basegfx::B2DPolyPolygon aHairLinePolyPolygon;
+
+ if(0.0 == rStroke.getFullDotDashLen())
+ {
+ aHairLinePolyPolygon.append(rStrokePrimitive.getB2DPolygon());
+ }
+ else
+ {
+ basegfx::tools::applyLineDashing(
+ rStrokePrimitive.getB2DPolygon(), rStroke.getDotDashArray(),
+ &aHairLinePolyPolygon, 0, rStroke.getFullDotDashLen());
+ }
+
+ const basegfx::BColor aHairlineColor(maBColorModifierStack.getModifiedColor(rLine.getColor()));
+ mpOutputDevice->SetLineColor(Color(aHairlineColor));
+ mpOutputDevice->SetFillColor();
+
+ aHairLinePolyPolygon.transform(maCurrentTransformation);
+
+ const LineInfo aLineInfo(LINE_SOLID, basegfx::fround(rLine.getWidth()));
+
+ for(sal_uInt32 a(0); a < aHairLinePolyPolygon.count(); a++)
+ {
+ const basegfx::B2DPolygon aCandidate(aHairLinePolyPolygon.getB2DPolygon(a));
+
+ if(aCandidate.count() > 1)
+ {
+ const Polygon aToolsPolygon(aCandidate);
+
+ mrMetaFile.AddAction(new MetaPolyLineAction(aToolsPolygon, aLineInfo));
+ }
+ }
+
+ bDone = true;
+ }
+ }
+
+ if(!bDone)
+ {
+ // use decomposition (creates line geometry as filled polygon
+ // geometry)
+ process(rCandidate.get2DDecomposition(getViewInformation2D()));
+ }
+
impEndSvtGraphicStroke(pSvtGraphicStroke);
// restore DrawMode
@@ -1623,7 +1693,10 @@ namespace drawinglayer
// ChartPrimitive2D
const primitive2d::ChartPrimitive2D& rChartPrimitive = static_cast< const primitive2d::ChartPrimitive2D& >(rCandidate);
- if(!renderChartPrimitive2D(rChartPrimitive, *mpOutputDevice))
+ if(!renderChartPrimitive2D(
+ rChartPrimitive,
+ *mpOutputDevice,
+ getViewInformation2D()))
{
// fallback to decomposition (MetaFile)
process(rChartPrimitive.get2DDecomposition(getViewInformation2D()));
diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index 7e7a909bec..705670c402 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -64,6 +64,7 @@
#include <vcl/hatch.hxx>
#include <tools/diagnose_ex.h>
#include <com/sun/star/awt/PosSize.hpp>
+#include <drawinglayer/primitive2d/invertprimitive2d.hxx>
#include <cstdio>
#include <drawinglayer/primitive2d/backgroundcolorprimitive2d.hxx>
@@ -425,7 +426,10 @@ namespace drawinglayer
mpOutputDevice->Push(PUSH_MAPMODE);
mpOutputDevice->SetMapMode(maOriginalMapMode);
- if(!renderChartPrimitive2D(rChartPrimitive, *mpOutputDevice))
+ if(!renderChartPrimitive2D(
+ rChartPrimitive,
+ *mpOutputDevice,
+ getViewInformation2D()))
{
// fallback to decomposition (MetaFile)
process(rChartPrimitive.get2DDecomposition(getViewInformation2D()));
@@ -532,6 +536,28 @@ namespace drawinglayer
// Action: Ignore here, do nothing.
break;
}
+ case PRIMITIVE2D_ID_INVERTPRIMITIVE2D :
+ {
+ // invert primitive (currently only used for HighContrast fallback for selection in SW and SC).
+ // Set OutDev to XOR
+ mpOutputDevice->Push();
+ mpOutputDevice->SetRasterOp( ROP_XOR );
+
+ // force paint color to white by using ColorModifierStack
+ const basegfx::BColor aColWhite(1.0, 1.0, 1.0);
+ const basegfx::BColorModifier aColorModifier(aColWhite, 0.0, basegfx::BCOLORMODIFYMODE_REPLACE);
+ maBColorModifierStack.push(aColorModifier);
+
+ // process content recursively
+ process(rCandidate.get2DDecomposition(getViewInformation2D()));
+
+ // restore ColorModifierStack
+ maBColorModifierStack.pop();
+
+ // restore OutDev
+ mpOutputDevice->Pop();
+ break;
+ }
default :
{
// process recursively
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx
index 1116eef4c7..7ec07e11c8 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx
@@ -189,6 +189,7 @@ namespace drawinglayer
aScale.getY(),
fRotate,
+ rTextCandidate.getLocale(),
*mpOutputDevice));
if(!basegfx::fTools::equal(aScale.getX(), aScale.getY()))
@@ -209,7 +210,8 @@ namespace drawinglayer
rTextCandidate.getFontAttributes(),
aScale.getX(),
aScale.getY(),
- fRotate,
+ fRotate,
+ rTextCandidate.getLocale(),
*mpOutputDevice);
}
}
@@ -680,6 +682,15 @@ namespace drawinglayer
double fRotate, fShearX;
aLocalTransform.decompose(aScale, aTranslate, fRotate, fShearX);
+ if(basegfx::fTools::less(aScale.getX(), 0.0) && basegfx::fTools::less(aScale.getY(), 0.0))
+ {
+ // #i102175# handle special case: If scale is negative in (x,y) (3rd quadrant), it can
+ // be expressed as rotation by PI. This needs to be done for Metafiles since
+ // these can be rotated, but not really mirrored
+ aScale = basegfx::absolute(aScale);
+ fRotate += F_PI;
+ }
+
// get BoundRect
basegfx::B2DRange aOutlineRange(rMetaCandidate.getB2DRange(getViewInformation2D()));
aOutlineRange.transform(maCurrentTransformation);
@@ -713,8 +724,18 @@ namespace drawinglayer
// rotation
if(!basegfx::fTools::equalZero(fRotate))
{
- double fRotation((fRotate / F_PI180) * -10.0);
- aMetaFile.Rotate((sal_uInt16)(fRotation));
+ // #i103530#
+ // MetaFile::Rotate has no input parameter check, so the parameter needs to be
+ // well-aligned to the old range [0..3600] 10th degrees with inverse orientation
+ sal_Int16 nRotation((sal_Int16)((fRotate / F_PI180) * -10.0));
+
+ while(nRotation < 0)
+ nRotation += 3600;
+
+ while(nRotation >= 3600)
+ nRotation -= 3600;
+
+ aMetaFile.Rotate(nRotation);
}
// Prepare target output size
@@ -1011,6 +1032,8 @@ namespace drawinglayer
void VclProcessor2D::RenderPolygonStrokePrimitive2D(const primitive2d::PolygonStrokePrimitive2D& rPolygonStrokeCandidate)
{
+ // #i101491# method restructured to clearly use the DrawPolyLine
+ // calls starting from a deined line width
const attribute::LineAttribute& rLineAttribute = rPolygonStrokeCandidate.getLineAttribute();
const double fLineWidth(rLineAttribute.getWidth());
bool bDone(false);
@@ -1019,157 +1042,163 @@ namespace drawinglayer
{
const basegfx::B2DVector aDiscreteUnit(maCurrentTransformation * basegfx::B2DVector(fLineWidth, 0.0));
const double fDiscreteLineWidth(aDiscreteUnit.getLength());
- const bool bAntiAliased(getOptionsDrawinglayer().IsAntiAliasing());
- const double fAllowedUpperBound(bAntiAliased ? 3.0 : 2.5);
+ const attribute::StrokeAttribute& rStrokeAttribute = rPolygonStrokeCandidate.getStrokeAttribute();
+ const basegfx::BColor aHairlineColor(maBColorModifierStack.getModifiedColor(rLineAttribute.getColor()));
+ basegfx::B2DPolyPolygon aHairlinePolyPolygon;
- if(basegfx::fTools::lessOrEqual(fDiscreteLineWidth, fAllowedUpperBound))
- {
- // force to hairline
- const attribute::StrokeAttribute& rStrokeAttribute = rPolygonStrokeCandidate.getStrokeAttribute();
- const basegfx::BColor aHairlineColor(maBColorModifierStack.getModifiedColor(rLineAttribute.getColor()));
- basegfx::B2DPolyPolygon aHairlinePolyPolygon;
+ mpOutputDevice->SetLineColor(Color(aHairlineColor));
+ mpOutputDevice->SetFillColor();
- mpOutputDevice->SetLineColor(Color(aHairlineColor));
- mpOutputDevice->SetFillColor();
+ if(0.0 == rStrokeAttribute.getFullDotDashLen())
+ {
+ // no line dashing, just copy
+ aHairlinePolyPolygon.append(rPolygonStrokeCandidate.getB2DPolygon());
+ }
+ else
+ {
+ // else apply LineStyle
+ basegfx::tools::applyLineDashing(rPolygonStrokeCandidate.getB2DPolygon(),
+ rStrokeAttribute.getDotDashArray(),
+ &aHairlinePolyPolygon, 0, rStrokeAttribute.getFullDotDashLen());
+ }
- if(0.0 == rStrokeAttribute.getFullDotDashLen())
- {
- // no line dashing, just copy
- aHairlinePolyPolygon.append(rPolygonStrokeCandidate.getB2DPolygon());
- }
- else
- {
- // else apply LineStyle
- basegfx::tools::applyLineDashing(rPolygonStrokeCandidate.getB2DPolygon(),
- rStrokeAttribute.getDotDashArray(),
- &aHairlinePolyPolygon, 0, rStrokeAttribute.getFullDotDashLen());
- }
+ const sal_uInt32 nCount(aHairlinePolyPolygon.count());
- const sal_uInt32 nCount(aHairlinePolyPolygon.count());
+ if(nCount)
+ {
+ const bool bAntiAliased(getOptionsDrawinglayer().IsAntiAliasing());
+ aHairlinePolyPolygon.transform(maCurrentTransformation);
- if(nCount)
+ for(sal_uInt32 a(0); a < nCount; a++)
{
- aHairlinePolyPolygon.transform(maCurrentTransformation);
+ basegfx::B2DPolygon aCandidate(aHairlinePolyPolygon.getB2DPolygon(a));
if(bAntiAliased)
{
- for(sal_uInt32 a(0); a < nCount; a++)
+ if(basegfx::fTools::lessOrEqual(fDiscreteLineWidth, 1.0))
{
- basegfx::B2DPolygon aCandidate(aHairlinePolyPolygon.getB2DPolygon(a));
+ // line in range ]0.0 .. 1.0[
+ // paint as simple hairline
+ mpOutputDevice->DrawPolyLine(aCandidate, 0.0);
+ bDone = true;
+ }
+ else if(basegfx::fTools::lessOrEqual(fDiscreteLineWidth, 2.0))
+ {
+ // line in range [1.0 .. 2.0[
+ // paint as 2x2 with dynamic line distance
+ basegfx::B2DHomMatrix aMat;
+ const double fDistance(fDiscreteLineWidth - 1.0);
+ const double fHalfDistance(fDistance * 0.5);
+
+ aMat.set(0, 2, -fHalfDistance);
+ aMat.set(1, 2, -fHalfDistance);
+ aCandidate.transform(aMat);
+ mpOutputDevice->DrawPolyLine(aCandidate, 0.0);
+
+ aMat.set(0, 2, fDistance);
+ aMat.set(1, 2, 0.0);
+ aCandidate.transform(aMat);
+ mpOutputDevice->DrawPolyLine(aCandidate, 0.0);
+
+ aMat.set(0, 2, 0.0);
+ aMat.set(1, 2, fDistance);
+ aCandidate.transform(aMat);
+ mpOutputDevice->DrawPolyLine(aCandidate, 0.0);
+
+ aMat.set(0, 2, -fDistance);
+ aMat.set(1, 2, 0.0);
+ aCandidate.transform(aMat);
+ mpOutputDevice->DrawPolyLine(aCandidate, 0.0);
+ bDone = true;
+ }
+ else if(basegfx::fTools::lessOrEqual(fDiscreteLineWidth, 3.0))
+ {
+ // line in range [2.0 .. 3.0]
+ // paint as cross in a 3x3 with dynamic line distance
+ basegfx::B2DHomMatrix aMat;
+ const double fDistance((fDiscreteLineWidth - 1.0) * 0.5);
- if(basegfx::fTools::lessOrEqual(fDiscreteLineWidth, 1.0))
- {
- // line in range ]0.0 .. 1.0[
- // paint as simple hairline
- mpOutputDevice->DrawPolyLine(aCandidate, 0.0);
- }
- else if(basegfx::fTools::lessOrEqual(fDiscreteLineWidth, 2.0))
- {
- // line in range [1.0 .. 2.0[
- // paint as 2x2 with dynamic line distance
- basegfx::B2DHomMatrix aMat;
- const double fDistance(fDiscreteLineWidth - 1.0);
- const double fHalfDistance(fDistance * 0.5);
-
- aMat.set(0, 2, -fHalfDistance);
- aMat.set(1, 2, -fHalfDistance);
- aCandidate.transform(aMat);
- mpOutputDevice->DrawPolyLine(aCandidate, 0.0);
-
- aMat.set(0, 2, fDistance);
- aMat.set(1, 2, 0.0);
- aCandidate.transform(aMat);
- mpOutputDevice->DrawPolyLine(aCandidate, 0.0);
-
- aMat.set(0, 2, 0.0);
- aMat.set(1, 2, fDistance);
- aCandidate.transform(aMat);
- mpOutputDevice->DrawPolyLine(aCandidate, 0.0);
-
- aMat.set(0, 2, -fDistance);
- aMat.set(1, 2, 0.0);
- aCandidate.transform(aMat);
- mpOutputDevice->DrawPolyLine(aCandidate, 0.0);
- }
- else
- {
- // line in range [2.0 .. 3.0]
- // paint as cross in a 3x3 with dynamic line distance
- basegfx::B2DHomMatrix aMat;
- const double fDistance((fDiscreteLineWidth - 1.0) * 0.5);
-
- mpOutputDevice->DrawPolyLine(aCandidate, 0.0);
-
- aMat.set(0, 2, -fDistance);
- aMat.set(1, 2, 0.0);
- aCandidate.transform(aMat);
- mpOutputDevice->DrawPolyLine(aCandidate, 0.0);
+ mpOutputDevice->DrawPolyLine(aCandidate, 0.0);
- aMat.set(0, 2, fDistance);
- aMat.set(1, 2, -fDistance);
- aCandidate.transform(aMat);
- mpOutputDevice->DrawPolyLine(aCandidate, 0.0);
-
- aMat.set(0, 2, fDistance);
- aMat.set(1, 2, fDistance);
- aCandidate.transform(aMat);
- mpOutputDevice->DrawPolyLine(aCandidate, 0.0);
-
- aMat.set(0, 2, -fDistance);
- aMat.set(1, 2, fDistance);
- aCandidate.transform(aMat);
- mpOutputDevice->DrawPolyLine(aCandidate, 0.0);
- }
+ aMat.set(0, 2, -fDistance);
+ aMat.set(1, 2, 0.0);
+ aCandidate.transform(aMat);
+ mpOutputDevice->DrawPolyLine(aCandidate, 0.0);
+
+ aMat.set(0, 2, fDistance);
+ aMat.set(1, 2, -fDistance);
+ aCandidate.transform(aMat);
+ mpOutputDevice->DrawPolyLine(aCandidate, 0.0);
+
+ aMat.set(0, 2, fDistance);
+ aMat.set(1, 2, fDistance);
+ aCandidate.transform(aMat);
+ mpOutputDevice->DrawPolyLine(aCandidate, 0.0);
+
+ aMat.set(0, 2, -fDistance);
+ aMat.set(1, 2, fDistance);
+ aCandidate.transform(aMat);
+ mpOutputDevice->DrawPolyLine(aCandidate, 0.0);
+ bDone = true;
+ }
+ else
+ {
+ // #i101491# line width above 3.0
}
}
else
{
- if(basegfx::fTools::more(fDiscreteLineWidth, 1.5))
+ if(basegfx::fTools::lessOrEqual(fDiscreteLineWidth, 1.5))
+ {
+ // line width below 1.5, draw the basic hairline polygon
+ mpOutputDevice->DrawPolyLine(aCandidate, 0.0);
+ bDone = true;
+ }
+ else if(basegfx::fTools::lessOrEqual(fDiscreteLineWidth, 2.5))
{
// line width is in range ]1.5 .. 2.5], use four hairlines
// drawn in a square
basegfx::B2DHomMatrix aMat;
+ mpOutputDevice->DrawPolyLine(aCandidate, 0.0);
- for(sal_uInt32 a(0); a < nCount; a++)
- {
- basegfx::B2DPolygon aCandidate(aHairlinePolyPolygon.getB2DPolygon(a));
- mpOutputDevice->DrawPolyLine(aCandidate, 0.0);
-
- aMat.set(0, 2, 1.0);
- aMat.set(1, 2, 0.0);
- aCandidate.transform(aMat);
+ aMat.set(0, 2, 1.0);
+ aMat.set(1, 2, 0.0);
+ aCandidate.transform(aMat);
- mpOutputDevice->DrawPolyLine(aCandidate, 0.0);
+ mpOutputDevice->DrawPolyLine(aCandidate, 0.0);
- aMat.set(0, 2, 0.0);
- aMat.set(1, 2, 1.0);
- aCandidate.transform(aMat);
+ aMat.set(0, 2, 0.0);
+ aMat.set(1, 2, 1.0);
+ aCandidate.transform(aMat);
- mpOutputDevice->DrawPolyLine(aCandidate, 0.0);
+ mpOutputDevice->DrawPolyLine(aCandidate, 0.0);
- aMat.set(0, 2, -1.0);
- aMat.set(1, 2, 0.0);
- aCandidate.transform(aMat);
+ aMat.set(0, 2, -1.0);
+ aMat.set(1, 2, 0.0);
+ aCandidate.transform(aMat);
- mpOutputDevice->DrawPolyLine(aCandidate, 0.0);
- }
+ mpOutputDevice->DrawPolyLine(aCandidate, 0.0);
+ bDone = true;
}
else
{
- for(sal_uInt32 a(0); a < nCount; a++)
- {
- // draw the basic hairline polygon
- const basegfx::B2DPolygon aCandidate(aHairlinePolyPolygon.getB2DPolygon(a));
- mpOutputDevice->DrawPolyLine(aCandidate, 0.0);
- }
+ // #i101491# line width is above 2.5
}
}
- }
- bDone = true;
+ if(!bDone && rPolygonStrokeCandidate.getB2DPolygon().count() > 1000)
+ {
+ // #i101491# If the polygon complexity uses more than a given amount, do
+ // use OuputDevice::DrawPolyLine directly; this will avoid buffering all
+ // decompositions in primtives (memory) and fallback to old line painting
+ // for very complex polygons, too
+ mpOutputDevice->DrawPolyLine(aCandidate, fDiscreteLineWidth, rLineAttribute.getLineJoin());
+ bDone = true;
+ }
+ }
}
}
-
+
if(!bDone)
{
// remeber that we enter a PolygonStrokePrimitive2D decomposition,
diff --git a/drawinglayer/source/processor3d/zbufferprocessor3d.cxx b/drawinglayer/source/processor3d/zbufferprocessor3d.cxx
index 36f94a6960..3fd02a4a49 100644
--- a/drawinglayer/source/processor3d/zbufferprocessor3d.cxx
+++ b/drawinglayer/source/processor3d/zbufferprocessor3d.cxx
@@ -141,6 +141,10 @@ namespace
}
aRetval = BitmapEx(aContent, aAlpha);
+
+ // #i101811# set PrefMapMode and PrefSize at newly created Bitmap
+ aRetval.SetPrefMapMode(MAP_100TH_MM);
+ aRetval.SetPrefSize(Size(nWidth, nHeight));
}
return aRetval;
@@ -671,15 +675,25 @@ namespace drawinglayer
{
// step two:
//
- // bring from [0.0 .. 1.0] in X,Y and Z to view cordinates. also:
- // - scale Z to [0.0 .. fMaxZDepth]
- const double fMaxZDepth(double(0x0000ff00));
+ // bring from [0.0 .. 1.0] in X,Y and Z to view cordinates
+ //
+ // #i102611#
+ // also: scale Z to [1.5 .. 65534.5]. Normally, a range of [0.0 .. 65535.0]
+ // could be used, but a 'unused' value is needed, so '0' is used what reduces
+ // the range to [1.0 .. 65535.0]. It has also shown that small numerical errors
+ // (smaller as basegfx::fTools::mfSmallValue, which is 0.000000001) happen.
+ // Instead of checking those by basegfx::fTools methods which would cost
+ // runtime, just add another 0.5 tolerance to the start and end of the Z-Buffer
+ // range, thus resulting in [1.5 .. 65534.5]
+ const double fMaxZDepth(65533.0);
aDeviceToView.translate(-rVisiblePart.getMinX(), -rVisiblePart.getMinY(), 0.0);
if(mnAntiAlialize)
aDeviceToView.scale(fFullViewSizeX * mnAntiAlialize, fFullViewSizeY * mnAntiAlialize, fMaxZDepth);
else
aDeviceToView.scale(fFullViewSizeX, fFullViewSizeY, fMaxZDepth);
+
+ aDeviceToView.translate(0.0, 0.0, 1.5);
}
// update local ViewInformation3D with own DeviceToView
diff --git a/drawinglayer/util/makefile.mk b/drawinglayer/util/makefile.mk
index 3d29625cb0..5356ee0cef 100644
--- a/drawinglayer/util/makefile.mk
+++ b/drawinglayer/util/makefile.mk
@@ -72,6 +72,7 @@ SHL1STDLIBS=\
$(CPPUHELPERLIB) \
$(CPPULIB) \
$(AVMEDIALIB) \
+ $(I18NISOLANGLIB) \
$(COMPHELPERLIB)
SHL1DEF= $(MISC)$/$(SHL1TARGET).def
diff --git a/formula/inc/formula/IFunctionDescription.hxx b/formula/inc/formula/IFunctionDescription.hxx
index 2ed4b705c9..90f736bdc5 100644
--- a/formula/inc/formula/IFunctionDescription.hxx
+++ b/formula/inc/formula/IFunctionDescription.hxx
@@ -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
@@ -143,7 +143,7 @@ namespace formula
virtual bool calculateValue(const String& _sExpression,String& _rResult) = 0;
virtual void switchBack() = 0;
-
+
virtual void clear() = 0;
virtual void deleteFormData() = 0;
virtual void setReferenceInput(const FormEditData* _pData) = 0;
@@ -153,6 +153,7 @@ namespace formula
virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XFormulaParser> getFormulaParser() const = 0;
virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XFormulaOpCodeMapper> getFormulaOpCodeMapper() const = 0;
+ virtual ::com::sun::star::table::CellAddress getReferencePosition() const = 0;
virtual void setDispatcherLock( BOOL bLock ) = 0;
virtual void dispatch(BOOL _bOK,BOOL _bMartixChecked) = 0;
diff --git a/formula/source/ui/dlg/formula.cxx b/formula/source/ui/dlg/formula.cxx
index 86bb6dcd1c..897f53b59b 100644
--- a/formula/source/ui/dlg/formula.cxx
+++ b/formula/source/ui/dlg/formula.cxx
@@ -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
@@ -66,7 +66,7 @@
#include "formula/formulahelper.hxx"
#include "structpg.hxx"
#include "parawin.hxx"
-#include "ModuleHelper.hxx"
+#include "ModuleHelper.hxx"
#include "ForResId.hrc"
#include <com/sun/star/sheet/FormulaToken.hpp>
#include <com/sun/star/sheet/FormulaLanguage.hpp>
@@ -88,7 +88,7 @@ namespace formula
{
sal_Int32 m_nParaCount;
bool m_bIsFunction;
-
+
public:
OFormulaToken(bool _bFunction,sal_Int32 _nParaCount) : m_nParaCount(_nParaCount),m_bIsFunction(_bFunction){}
@@ -110,7 +110,7 @@ namespace formula
void DeleteArgs();
xub_StrLen GetFunctionPos(xub_StrLen nPos);
void ClearAllParas();
-
+
void MakeTree(IStructHelper* _pTree,SvLBoxEntry* pParent,FormulaToken* _pToken,long Count);
void fillTree(IStructHelper* _pTree);
void UpdateTokenArray( const String& rStrExp);
@@ -124,7 +124,7 @@ namespace formula
void UpdateArgInput( USHORT nOffset, USHORT nInput );
void Update();
void Update(const String& _sExp);
-
+
void SaveArg( USHORT nEd );
void UpdateSelection();
@@ -227,7 +227,7 @@ namespace formula
const String aTitle2;
const String aTxtEnd;
const String aTxtOk; // hinter aBtnEnd
- FormulaHelper
+ FormulaHelper
m_aFormulaHelper;
SmartId m_aSmartEditHelpId;
@@ -311,7 +311,7 @@ FormulaDlg_Impl::FormulaDlg_Impl(Dialog* pParent
nArgs (0)
{
pParaWin = new ParaWin( pParent,_pDlg, aGEdit.GetPosPixel());
- aGEdit.Hide();
+ aGEdit.Hide();
pParaWin->Hide();
aFtEditName.Hide();
aEdRef.Hide();
@@ -320,7 +320,7 @@ FormulaDlg_Impl::FormulaDlg_Impl(Dialog* pParent
pMEdit = aMEFormula.GetEdit();
m_aSmartEditHelpId = pMEdit->GetSmartHelpId();
pMEdit->SetSmartUniqueId(m_aSmartEditHelpId);
-
+
bEditFlag=FALSE;
bStructUpdate=TRUE;
Point aPos=aGEdit.GetPosPixel();
@@ -427,7 +427,7 @@ void FormulaDlg_Impl::PreNotify( NotifyEvent& rNEvt )
}
if(nActivWinId!=0)
{
-
+
FormEditData* pData = m_pHelper->getFormEditData();
if (pData && !aTimer.IsActive()) // wird nicht ueber Close zerstoert;
@@ -469,7 +469,7 @@ void FormulaDlg_Impl::DeleteArgs()
::std::vector< ::rtl::OUString>().swap(m_aArguments);
nArgs = 0;
}
-namespace
+namespace
{
// comparing two property instances
struct OpCodeCompare : public ::std::binary_function< sheet::FormulaOpCodeMapEntry, sal_Int32 , bool >
@@ -497,6 +497,7 @@ xub_StrLen FormulaDlg_Impl::GetFunctionPos(xub_StrLen nPos)
if ( m_aTokenList.getLength() )
{
const uno::Reference< sheet::XFormulaParser > xParser(m_pHelper->getFormulaParser());
+ const table::CellAddress aRefPos(m_pHelper->getReferencePosition());
const sheet::FormulaToken* pIter = m_aTokenList.getConstArray();
const sheet::FormulaToken* pEnd = pIter + m_aTokenList.getLength();
@@ -509,7 +510,7 @@ xub_StrLen FormulaDlg_Impl::GetFunctionPos(xub_StrLen nPos)
const sal_Int32 eOp = pIter->OpCode;
uno::Sequence<sheet::FormulaToken> aArgs(1);
aArgs[0] = *pIter;
- const String aString = xParser->printFormula(aArgs);
+ const String aString = xParser->printFormula(aArgs, aRefPos);
const sheet::FormulaToken* pNextToken = pIter + 1;
if(!bUserMatrixFlag && FormulaCompiler::IsMatrixFunction((OpCode)eOp) )
@@ -533,7 +534,7 @@ xub_StrLen FormulaDlg_Impl::GetFunctionPos(xub_StrLen nPos)
if ( pNextToken != pEnd )
{
aArgs[0] = *pNextToken;
- const String a2String = xParser->printFormula(aArgs);
+ const String a2String = xParser->printFormula(aArgs, aRefPos);
const xub_StrLen n3 = aFormString.Search(a2String,nXXX);
if ( n3 < nTokPos )
nTokPos = n3;
@@ -681,7 +682,8 @@ void FormulaDlg_Impl::MakeTree(IStructHelper* _pTree,SvLBoxEntry* pParent,Formul
aArgs[0] = m_aTokenMap.find(pOrigToken)->second;
try
{
- const String aResult = m_pHelper->getFormulaParser()->printFormula(aArgs);
+ const table::CellAddress aRefPos(m_pHelper->getReferencePosition());
+ const String aResult = m_pHelper->getFormulaParser()->printFormula(aArgs, aRefPos);
if ( nParas > 0 )
{
@@ -749,7 +751,8 @@ void FormulaDlg_Impl::UpdateTokenArray( const String& rStrExp)
m_aTokenList.realloc(0);
try
{
- m_aTokenList = m_pHelper->getFormulaParser()->parseFormula(rStrExp);
+ const table::CellAddress aRefPos(m_pHelper->getReferencePosition());
+ m_aTokenList = m_pHelper->getFormulaParser()->parseFormula(rStrExp, aRefPos);
}
catch(const uno::Exception&)
{
@@ -820,7 +823,7 @@ void FormulaDlg_Impl::FillListboxes()
// ResizeArgArr jetzt schon in UpdateFunctionDesc
-
+
m_pHelper->setDispatcherLock( TRUE);// Modal-Modus einschalten
aNewTitle = aTitle1;
@@ -962,12 +965,13 @@ String FormulaDlg_Impl::RepairFormula(const String& aFormula)
if ( m_aTokenList.getLength() )
{
- const String sFormula(m_pHelper->getFormulaParser()->printFormula(m_aTokenList));
+ const table::CellAddress aRefPos(m_pHelper->getReferencePosition());
+ const String sFormula(m_pHelper->getFormulaParser()->printFormula(m_aTokenList, aRefPos));
if ( !sFormula.Len() || sFormula.GetChar(0) != '=' )
aResult += sFormula;
else
aResult = sFormula;
-
+
}
}
catch(const uno::Exception& )
@@ -994,7 +998,7 @@ void FormulaDlg_Impl::DoEnter(BOOL bOk)
m_pHelper->dispatch(bOk,aBtnMatrix.IsChecked());
// Daten loeschen
m_pHelper->deleteFormData();
-
+
// Dialog schliessen
m_pHelper->doClose(bOk);
}
@@ -1060,14 +1064,14 @@ void FormulaDlg_Impl::ResizeArgArr( const IFunctionDescription* pNewFunc )
void FormulaDlg_Impl::UpdateFunctionDesc()
{
FormEditData* pData = m_pHelper->getFormEditData();
- if (!pData)
+ if (!pData)
return;
USHORT nCat = pFuncPage->GetCategory();
- if ( nCat == LISTBOX_ENTRY_NOTFOUND )
+ if ( nCat == LISTBOX_ENTRY_NOTFOUND )
nCat = 0;
pData->SetCatSel( nCat );
USHORT nFunc = pFuncPage->GetFunction();
- if ( nFunc == LISTBOX_ENTRY_NOTFOUND )
+ if ( nFunc == LISTBOX_ENTRY_NOTFOUND )
nFunc = 0;
pData->SetFuncSel( nFunc );
@@ -1150,7 +1154,7 @@ void FormulaDlg_Impl::SetData(xub_StrLen nFStart,xub_StrLen nNextFStart,xub_StrL
if(!bEditFlag)
pMEdit->SetText(m_pHelper->getCurrentFormula());
-
+
m_pHelper->getSelection( PrivStart, PrivEnd);
if(!bEditFlag)
{
@@ -1167,7 +1171,7 @@ void FormulaDlg_Impl::SetData(xub_StrLen nFStart,xub_StrLen nNextFStart,xub_StrL
}
// -----------------------------------------------------------------------------
void FormulaDlg_Impl::EditThisFunc(xub_StrLen nFStart)
-{
+{
FormEditData* pData = m_pHelper->getFormEditData();
if (!pData) return;
@@ -1205,7 +1209,7 @@ void FormulaDlg_Impl::EditThisFunc(xub_StrLen nFStart)
void FormulaDlg_Impl::EditNextFunc( BOOL bForward, xub_StrLen nFStart )
{
FormEditData* pData = m_pHelper->getFormEditData();
- if (!pData)
+ if (!pData)
return;
String aFormula = m_pHelper->getCurrentFormula();
@@ -1324,7 +1328,7 @@ IMPL_LINK( FormulaDlg_Impl, FxHdl, ParaWin*, pPtr )
{
aBtnForward.Enable(TRUE); //@ Damit eine neue Fkt eingegeben werden kann.
aTabCtrl.SetCurPageId(TP_FUNCTION);
-
+
String aUndoStr = m_pHelper->getCurrentFormula(); // bevor unten ein ";" eingefuegt wird
FormEditData* pData = m_pHelper->getFormEditData();
if (!pData) return 0;
@@ -1368,7 +1372,7 @@ IMPL_LINK( FormulaDlg_Impl, ModifyHdl, ParaWin*, pPtr )
IMPL_LINK( FormulaDlg_Impl, FormulaHdl, MultiLineEdit*, EMPTYARG )
{
-
+
FormEditData* pData = m_pHelper->getFormEditData();
if (!pData) return 0;
@@ -1601,6 +1605,7 @@ void FormulaDlg_Impl::Update()
{
FormEditData* pData = m_pHelper->getFormEditData();
const String sExpression = pMEdit->GetText();
+ aOldFormula = String();
UpdateTokenArray(sExpression);
FormulaCursorHdl(&aMEFormula);
CalcStruct(sExpression);
@@ -1951,7 +1956,7 @@ void FormulaModalDialog::SetFocusWin(Window *pWin,ULONG nUniqueId)
long FormulaModalDialog::PreNotify( NotifyEvent& rNEvt )
{
m_pImpl->PreNotify( rNEvt );
-
+
return ModalDialog::PreNotify(rNEvt);
}
diff --git a/fpicker/prj/build.lst b/fpicker/prj/build.lst
index 87084f1b66..434f22660f 100644
--- a/fpicker/prj/build.lst
+++ b/fpicker/prj/build.lst
@@ -3,6 +3,7 @@ fp fpicker\inc nmake - all fp_inc NULL
fp fpicker\source\generic nmake - all fp_generic fp_inc NULL
fp fpicker\source\office nmake - all fp_office fp_inc NULL
fp fpicker\source\unx\gnome nmake - u fp_gnome_filepicker fp_inc NULL
+fp fpicker\source\unx\kde4 nmake - u fp_kde4_filepicker fp_inc NULL
fp fpicker\source\aqua nmake - u fp_macosx_filepicker NULL
fp fpicker\source\win32\filepicker nmake - w fp_win32_filepicker fp_inc NULL
fp fpicker\source\win32\folderpicker nmake - w fp_win32_folderpicker fp_inc NULL
diff --git a/fpicker/prj/d.lst b/fpicker/prj/d.lst
index 05ab72c012..7c4e0bf602 100644
--- a/fpicker/prj/d.lst
+++ b/fpicker/prj/d.lst
@@ -10,4 +10,5 @@ mkdir: %COMMON_DEST%\bin%_EXT%\hid
..\source\win32\filepicker\*.xml %_DEST%\xml%_EXT%\*.xml
..\source\win32\folderpicker\*.xml %_DEST%\xml%_EXT%\*.xml
..\source\unx\gnome\fps-gnome-ucd.txt %_DEST%\bin%_EXT%\fps-gnome-ucd.txt
+..\source\unx\kde4\fps-kde4-ucd.txt %_DEST%\bin%_EXT%\fps-kde4-ucd.txt
..\source\aqua\fps-aqua-ucd.txt %_DEST%\bin%_EXT%\fps-aqua-ucd.txt
diff --git a/fpicker/source/aqua/AquaFilePickerDelegate.hxx b/fpicker/source/aqua/AquaFilePickerDelegate.hxx
index 09c16ce251..717b5d1297 100644
--- a/fpicker/source/aqua/AquaFilePickerDelegate.hxx
+++ b/fpicker/source/aqua/AquaFilePickerDelegate.hxx
@@ -49,11 +49,11 @@ class FilterHelper;
- (void)setFilterHelper:(FilterHelper*)filterHelper;
- (MacOSBOOL)panel:(id)sender shouldShowFilename:(NSString *)filename;
-
- (void)panelSelectionDidChange:(id)sender;
- (void)panel:(id)sender directoryDidChange:(NSString *)path;
- (void)filterSelectedAtIndex:(id)sender;
+- (void)autoextensionChanged:(id)sender;
@end
diff --git a/fpicker/source/aqua/AquaFilePickerDelegate.mm b/fpicker/source/aqua/AquaFilePickerDelegate.mm
index 2bece2d90e..d73e5d82ff 100644
--- a/fpicker/source/aqua/AquaFilePickerDelegate.mm
+++ b/fpicker/source/aqua/AquaFilePickerDelegate.mm
@@ -27,6 +27,8 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
+#include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp>
+#include <com/sun/star/uno/Any.hxx>
#ifndef _SALAQUAFILEPICKER_HXX_
#include "SalAquaFilePicker.hxx"
@@ -59,8 +61,10 @@
- (MacOSBOOL)panel:(id)sender shouldShowFilename:(NSString *)filename
{
- if (filterHelper == NULL)
+ if( filterHelper == NULL )
return true;
+ if( filename == nil )
+ return false;
return filterHelper->filenameMatchesFilter(filename);
}
@@ -104,5 +108,19 @@
filePicker->filterControlChanged();
}
+- (void)autoextensionChanged:(id)sender
+{
+ if (sender == nil) {
+ return;
+ }
+
+ if ([sender class] != [NSButton class]) {
+ return;
+ }
+ uno::Any aValue;
+ aValue <<= ([((NSButton*)sender) state] == NSOnState);
+
+ filePicker->setValue(::com::sun::star::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION, 0, aValue);
+}
-@end \ No newline at end of file
+@end
diff --git a/fpicker/source/aqua/ControlHelper.cxx b/fpicker/source/aqua/ControlHelper.cxx
index 061c41b39f..d289608631 100644
--- a/fpicker/source/aqua/ControlHelper.cxx
+++ b/fpicker/source/aqua/ControlHelper.cxx
@@ -61,7 +61,6 @@ ControlHelper::ControlHelper()
, m_bUserPaneNeeded( false )
, m_bIsUserPaneLaidOut(false)
, m_bIsFilterControlNeeded(false)
-, m_bAutoFilenameExtension(true)
, m_pFilterHelper(NULL)
{
DBG_PRINT_ENTRY(CLASS_NAME, __func__);
@@ -174,12 +173,7 @@ void ControlHelper::enableControl( const sal_Int16 nControlId, const sal_Bool bE
::vos::OGuard aGuard( Application::GetSolarMutex() );
- if (nControlId == ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION) {
- OSL_TRACE(" autoextension checkbox cannot be changed");
- DBG_PRINT_EXIT(CLASS_NAME, __func__);
- return;
- }
- else if (nControlId == ExtendedFilePickerElementIds::CHECKBOX_PREVIEW) {
+ if (nControlId == ExtendedFilePickerElementIds::CHECKBOX_PREVIEW) {
OSL_TRACE(" preview checkbox cannot be changed");
DBG_PRINT_EXIT(CLASS_NAME, __func__);
return;
@@ -268,12 +262,7 @@ void ControlHelper::setValue( sal_Int16 nControlId, sal_Int16 nControlAction, co
::vos::OGuard aGuard( Application::GetSolarMutex() );
- if (nControlId == ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION) {
- /* see comment in the header file */
- //rValue >>= m_bAutoFilenameExtension;
- OSL_TRACE(" value is a bool: %d", m_bAutoFilenameExtension);
- }
- else if (nControlId == ExtendedFilePickerElementIds::CHECKBOX_PREVIEW) {
+ if (nControlId == ExtendedFilePickerElementIds::CHECKBOX_PREVIEW) {
OSL_TRACE(" value for preview is unchangeable");
}
else {
@@ -307,25 +296,19 @@ uno::Any ControlHelper::getValue( sal_Int16 nControlId, sal_Int16 nControlAction
::vos::OGuard aGuard( Application::GetSolarMutex() );
uno::Any aRetval;
- if (nControlId == ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION) {
- aRetval <<= m_bAutoFilenameExtension;
- OSL_TRACE("value is a bool (autoextension): %d", m_bAutoFilenameExtension);
- }
- else {
- NSControl* pControl = getControl( nControlId );
+ NSControl* pControl = getControl( nControlId );
- if( pControl == nil ) {
- OSL_TRACE("get value for unknown control %d", nControlId);
- aRetval <<= sal_True;
- } else {
- if( [pControl class] == [NSPopUpButton class] ) {
- aRetval = HandleGetListValue(pControl, nControlAction);
- } else if( [pControl class] == [NSButton class] ) {
- //NSLog(@"control: %@", [[pControl cell] title]);
- sal_Bool bValue = [(NSButton*)pControl state] == NSOnState ? sal_True : sal_False;
- aRetval <<= bValue;
- OSL_TRACE("value is a bool (checkbox): %d", bValue);
- }
+ if( pControl == nil ) {
+ OSL_TRACE("get value for unknown control %d", nControlId);
+ aRetval <<= sal_True;
+ } else {
+ if( [pControl class] == [NSPopUpButton class] ) {
+ aRetval = HandleGetListValue(pControl, nControlAction);
+ } else if( [pControl class] == [NSButton class] ) {
+ //NSLog(@"control: %@", [[pControl cell] title]);
+ sal_Bool bValue = [(NSButton*)pControl state] == NSOnState ? sal_True : sal_False;
+ aRetval <<= bValue;
+ OSL_TRACE("value is a bool (checkbox): %d", bValue);
}
}
@@ -528,7 +511,7 @@ void ControlHelper::createControls()
}
}
- for (int i = 1; i < TOGGLE_LAST; i++) {
+ for (int i = 0/*#i102102*/; i < TOGGLE_LAST; i++) {
if (true == m_bToggleVisibility[i]) {
m_bUserPaneNeeded = true;
@@ -542,6 +525,11 @@ void ControlHelper::createControls()
[button setState:NSOffState];
+ if (i == AUTOEXTENSION) {
+ [button setTarget:m_pDelegate];
+ [button setAction:@selector(autoextensionChanged:)];
+ }
+
m_pToggles[i] = button;
m_aActiveControls.push_back(m_pToggles[i]);
@@ -790,6 +778,7 @@ case ExtendedFilePickerElementIds::LISTBOX_##elem##_LABEL: \
switch( nControlId )
{
+ MAP_TOGGLE( AUTOEXTENSION );
MAP_TOGGLE( PASSWORD );
MAP_TOGGLE( FILTEROPTIONS );
MAP_TOGGLE( READONLY );
diff --git a/fpicker/source/aqua/ControlHelper.hxx b/fpicker/source/aqua/ControlHelper.hxx
index bce095468e..a3956e3040 100644
--- a/fpicker/source/aqua/ControlHelper.hxx
+++ b/fpicker/source/aqua/ControlHelper.hxx
@@ -127,7 +127,7 @@ public:
}
inline bool isAutoExtensionEnabled() {
- return m_bAutoFilenameExtension;
+ return ([((NSButton*) m_pToggles[AUTOEXTENSION]) state] == NSOnState);
}
private:
@@ -168,16 +168,6 @@ private:
/** indicates if a filter control is needed */
bool m_bIsFilterControlNeeded;
- /*
- * With issue #78852 the GUI option to set automatic filename extension was removed but
- * so far the setting is still in effect and so the value for has to be saved and possibly be restored
- * also.
- * But with issue #FILLME users were starting to get confused on Windows so we decided to have
- * autoextension always on and have it selectable for the user again.
- */
- /** indicates if a filename extension is to automatically be appended to a user entered file name */
- bool m_bAutoFilenameExtension;
-
/** a list with all actively used controls */
::std::list<NSControl*> m_aActiveControls;
diff --git a/fpicker/source/aqua/SalAquaFilePicker.cxx b/fpicker/source/aqua/SalAquaFilePicker.cxx
index 106b3014f8..9e99200325 100644
--- a/fpicker/source/aqua/SalAquaFilePicker.cxx
+++ b/fpicker/source/aqua/SalAquaFilePicker.cxx
@@ -35,7 +35,6 @@
#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
-#include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp>
#include <com/sun/star/ui/dialogs/CommonFilePickerElementIds.hpp>
#include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp>
#include <cppuhelper/interfacecontainer.h>
@@ -357,10 +356,6 @@ uno::Sequence<rtl::OUString> SAL_CALL SalAquaFilePicker::getFiles() throw( uno::
if (nFiles > 1) {
aSelectedFiles[0] = OUString(sDirectoryURL);
}
-
- implsetDisplayDirectory(sDirectoryURL);
-
- OSL_TRACE("dir url: %s", OUStringToOString(sDirectoryURL, RTL_TEXTENCODING_UTF8).getStr());
}
short nSequenceIndex = nFiles > 1 ? nIndex + 1 : nIndex;
@@ -453,12 +448,7 @@ throw( uno::RuntimeException )
m_pControlHelper->setValue(nControlId, nControlAction, rValue);
if (nControlId == ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION && m_nDialogType == NAVIGATIONSERVICES_SAVE) {
- sal_Bool bAutoExtensionOn = sal_False;
- rValue >>= bAutoExtensionOn;
- if (bAutoExtensionOn == sal_True) {
- [m_pDialog setExtensionHidden:bAutoExtensionOn];
- updateSaveFileNameExtension();
- }
+ updateSaveFileNameExtension();
}
DBG_PRINT_EXIT(CLASS_NAME, __func__);
@@ -775,21 +765,30 @@ void SalAquaFilePicker::updateSaveFileNameExtension() {
return;
}
- if (m_pControlHelper->isAutoExtensionEnabled() == false)
- return;
+ // we need to set this here again because initial setting does
+ //[m_pDialog setExtensionHidden:YES];
::vos::OGuard aGuard( Application::GetSolarMutex() );
- ensureFilterHelper();
-
- OUStringList aStringList = m_pFilterHelper->getCurrentFilterSuffixList();
- if( aStringList.empty()) // #i9328#
- return;
-
- rtl::OUString suffix = (*(aStringList.begin())).copy(1);
- NSString *requiredFileType = [NSString stringWithOUString:suffix];
+ if (m_pControlHelper->isAutoExtensionEnabled() == false) {
+ OSL_TRACE("allowing other file types");
+ [m_pDialog setAllowedFileTypes:nil];
+ [m_pDialog setAllowsOtherFileTypes:YES];
+ } else {
+ ensureFilterHelper();
+
+ OUStringList aStringList = m_pFilterHelper->getCurrentFilterSuffixList();
+ if( aStringList.empty()) // #i9328#
+ return;
- [m_pDialog setRequiredFileType:requiredFileType];
+ rtl::OUString suffix = (*(aStringList.begin())).copy(1);
+ NSString *requiredFileType = [NSString stringWithOUString:suffix];
+
+ [m_pDialog setRequiredFileType:requiredFileType];
+
+ OSL_TRACE("disallowing other file types");
+ [m_pDialog setAllowsOtherFileTypes:NO];
+ }
DBG_PRINT_EXIT(CLASS_NAME, __func__);
}
diff --git a/fpicker/source/aqua/SalAquaPicker.cxx b/fpicker/source/aqua/SalAquaPicker.cxx
index 0324a8de11..8face272e4 100644
--- a/fpicker/source/aqua/SalAquaPicker.cxx
+++ b/fpicker/source/aqua/SalAquaPicker.cxx
@@ -48,12 +48,17 @@
#include "CFStringUtilities.hxx"
#include "NSString_OOoAdditions.hxx"
+#ifndef _NSURL_OOOADDITIONS_HXX_
+#include "NSURL_OOoAdditions.hxx"
+#endif
+
#include "SalAquaFilePicker.hxx"
#include <stdio.h>
#pragma mark DEFINES
#define CLASS_NAME "SalAquaPicker"
+#define kSetHideExtensionStateKey @"NSNavLastUserSetHideExtensionButtonState"
//------------------------------------------------------------------------
// namespace directives
@@ -114,8 +119,22 @@ void SAL_CALL SalAquaPicker::implInitialize()
case NAVIGATIONSERVICES_SAVE:
OSL_TRACE("NAVIGATIONSERVICES_SAVE");
m_pDialog = [NSSavePanel savePanel];
- [(NSSavePanel*)m_pDialog setCanSelectHiddenExtension:YES];
- [(NSSavePanel*)m_pDialog setExtensionHidden:NO];
+ [(NSSavePanel*)m_pDialog setCanSelectHiddenExtension:NO]; //changed for issue #102102
+ /* I would have loved to use
+ * [(NSSavePanel*)m_pDialog setExtensionHidden:YES];
+ * here but unfortunately this
+ * a) only works when the dialog is already displayed because it seems to act on the corresponding checkbox (that we don't show but that doesn't matter)
+ * b) Mac OS X saves this setting on an application-based level which means that the last state is always being restored again when the app runs for the next time
+ *
+ * So the only reliable way seems to be using the NSUserDefaults object because that is where that value is stored and
+ * to just overwrite it if it has the wrong value.
+ */
+ NSUserDefaults *pDefaults = [NSUserDefaults standardUserDefaults];
+ NSNumber *pExtn = [pDefaults objectForKey:kSetHideExtensionStateKey];
+ if(pExtn == nil || [pExtn boolValue] == NO) {
+ OSL_TRACE("Hiding extension");
+ [pDefaults setBool:YES forKey:kSetHideExtensionStateKey];
+ }
break;
case NAVIGATIONSERVICES_DIRECTORY:
@@ -188,6 +207,9 @@ int SalAquaPicker::run()
break;
}
+ if (retVal == NSFileHandlingPanelOKButton) {
+ implsetDisplayDirectory([[NSURL fileURLWithPath:[m_pDialog directory]] OUStringForInfo:FULLPATH]);
+ }
DBG_PRINT_EXIT(CLASS_NAME, __func__, retVal);
@@ -217,11 +239,6 @@ void SAL_CALL SalAquaPicker::implsetDisplayDirectory( const rtl::OUString& aDire
if (aDirectory != m_sDisplayDirectory) {
m_sDisplayDirectory = aDirectory;
-
- if (m_pDialog != nil) {
- //NSLog(@"would change now to:%@", [NSString stringWithOUString:aDirectory]);
- // [m_pDialog setDirectory:[NSString stringWithOUString:aDirectory]];
- }
}
DBG_PRINT_EXIT(CLASS_NAME, __func__);
diff --git a/fpicker/source/generic/fpicker.cxx b/fpicker/source/generic/fpicker.cxx
index 838f8cb332..409e582742 100644
--- a/fpicker/source/generic/fpicker.cxx
+++ b/fpicker/source/generic/fpicker.cxx
@@ -60,6 +60,8 @@ static OUString FilePicker_getSystemPickerServiceName()
return OUString (RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.ui.dialogs.GtkFilePicker"));
else if (aDesktopEnvironment.equalsIgnoreAsciiCaseAscii ("kde"))
return OUString (RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.ui.dialogs.KDEFilePicker"));
+ else if (aDesktopEnvironment.equalsIgnoreAsciiCaseAscii ("kde4"))
+ return OUString (RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.ui.dialogs.KDE4FilePicker"));
else if (aDesktopEnvironment.equalsIgnoreAsciiCaseAscii ("macosx"))
return OUString (RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.ui.dialogs.AquaFilePicker"));
else
diff --git a/fpicker/source/unx/kde4/FPServiceInfo.hxx b/fpicker/source/unx/kde4/FPServiceInfo.hxx
new file mode 100644
index 0000000000..59804eaba8
--- /dev/null
+++ b/fpicker/source/unx/kde4/FPServiceInfo.hxx
@@ -0,0 +1,74 @@
+/*************************************************************************
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 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
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#pragma once
+
+// the service names
+#define FILE_PICKER_SERVICE_NAME "com.sun.star.ui.dialogs.KDE4FilePicker"
+
+// the implementation names
+#define FILE_PICKER_IMPL_NAME "com.sun.star.ui.dialogs.KDE4FilePicker"
+
+// the registry key names
+// a key under which this service will be registered,
+// Format: -> "/ImplName/UNO/SERVICES/ServiceName"
+// <Implementation-Name></UNO/SERVICES/><Service-Name>
+#define FILE_PICKER_REGKEY_NAME "/com.sun.star.ui.dialogs.KDE4FilePickerImpl/UNO/SERVICES/com.sun.star.ui.dialogs.KDE4FilePicker"
diff --git a/fpicker/source/unx/kde4/KDE4FPEntry.cxx b/fpicker/source/unx/kde4/KDE4FPEntry.cxx
new file mode 100644
index 0000000000..f6c7b0e691
--- /dev/null
+++ b/fpicker/source/unx/kde4/KDE4FPEntry.cxx
@@ -0,0 +1,136 @@
+/*************************************************************************
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 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
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include <cppuhelper/factory.hxx>
+
+#include <com/sun/star/container/XSet.hpp>
+
+#include <osl/diagnose.h>
+
+#include "KDE4FilePicker.hxx"
+#include "FPServiceInfo.hxx"
+
+using namespace ::rtl;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::registry;
+using namespace ::cppu;
+using ::com::sun::star::ui::dialogs::XFilePicker;
+
+static Reference< XInterface > SAL_CALL createInstance( const Reference< XMultiServiceFactory >& serviceManager )
+{
+ return Reference< XInterface >(static_cast< XFilePicker* >( new KDE4FilePicker( serviceManager ) ) );
+}
+
+// the three uno functions that will be exported
+extern "C"
+{
+ void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** ppEnv )
+ {
+ *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
+ }
+
+ sal_Bool SAL_CALL component_writeInfo( void* pServiceManager, void* pRegistryKey )
+ {
+ sal_Bool bRetVal = sal_True;
+
+ if ( pRegistryKey )
+ {
+ try
+ {
+ Reference< XRegistryKey > pXNewKey( static_cast< XRegistryKey* >( pRegistryKey ) );
+ pXNewKey->createKey( OUString::createFromAscii( FILE_PICKER_REGKEY_NAME ) );
+ }
+ catch( InvalidRegistryException& )
+ {
+ OSL_ENSURE( sal_False, "InvalidRegistryException caught" );
+ bRetVal = sal_False;
+ }
+ }
+
+ return bRetVal;
+ }
+
+ void* SAL_CALL component_getFactory( const sal_Char* pImplName, uno_Interface* pSrvManager, uno_Interface* pRegistryKey )
+ {
+ void* pRet = 0;
+
+ if ( pSrvManager && ( 0 == rtl_str_compare( pImplName, FILE_PICKER_IMPL_NAME ) ) )
+ {
+ Sequence< OUString > aSNS( 1 );
+ aSNS.getArray( )[0] = OUString::createFromAscii( FILE_PICKER_SERVICE_NAME );
+
+ Reference< XSingleServiceFactory > xFactory ( createSingleFactory(
+ reinterpret_cast< XMultiServiceFactory* > ( pSrvManager ),
+ OUString::createFromAscii( pImplName ),
+ createInstance,
+ aSNS ) );
+ if ( xFactory.is() )
+ {
+ xFactory->acquire();
+ pRet = xFactory.get();
+ }
+ }
+
+ return pRet;
+ }
+}
diff --git a/fpicker/source/unx/kde4/KDE4FilePicker.cxx b/fpicker/source/unx/kde4/KDE4FilePicker.cxx
new file mode 100644
index 0000000000..40916c7fa8
--- /dev/null
+++ b/fpicker/source/unx/kde4/KDE4FilePicker.cxx
@@ -0,0 +1,717 @@
+/*************************************************************************
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 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
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): Jan Holesovsky <kendy@openoffice.org>
+ *
+ *
+ ************************************************************************/
+
+//////////////////////////////////////////////////////////////////////////
+// includes
+//////////////////////////////////////////////////////////////////////////
+
+#include <com/sun/star/lang/DisposedException.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <cppuhelper/interfacecontainer.h>
+#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
+#include <com/sun/star/ui/dialogs/CommonFilePickerElementIds.hpp>
+#include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp>
+#include <com/sun/star/ui/dialogs/ControlActions.hpp>
+#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
+
+#include <svtools/svtools.hrc>
+
+#include <vos/mutex.hxx>
+
+#include <vcl/svapp.hxx>
+#include <vcl/sysdata.hxx>
+#include <vcl/syswin.hxx>
+
+#include "KDE4FilePicker.hxx"
+#include "FPServiceInfo.hxx"
+
+/* ********* Hack, but needed because of conflicting types... */
+#define Region QtXRegion
+
+//kde has an enum that uses this...OO does too
+#undef SETTINGS_MOUSE
+
+#include <kfiledialog.h>
+#include <kwindowsystem.h>
+#include <kapplication.h>
+#include <kfilefiltercombo.h>
+
+#include <QWidget>
+#include <QCheckBox>
+#include <QGridLayout>
+
+#undef Region
+
+using namespace ::com::sun::star;
+
+using namespace ::com::sun::star::ui::dialogs;
+using namespace ::com::sun::star::ui::dialogs::TemplateDescription;
+
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::ui::dialogs;
+using namespace ::com::sun::star::ui::dialogs::TemplateDescription;
+using namespace ::com::sun::star::ui::dialogs::ExtendedFilePickerElementIds;
+using namespace ::com::sun::star::ui::dialogs::CommonFilePickerElementIds;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::uno;
+
+//////////////////////////////////////////////////////////////////////////
+// helper functions
+//////////////////////////////////////////////////////////////////////////
+
+namespace
+{
+ // controling event notifications
+ const bool STARTUP_SUSPENDED = true;
+ const bool STARTUP_ALIVE = false;
+
+ uno::Sequence<rtl::OUString> SAL_CALL FilePicker_getSupportedServiceNames()
+ {
+ uno::Sequence<rtl::OUString> aRet(3);
+ aRet[0] = rtl::OUString::createFromAscii("com.sun.star.ui.dialogs.FilePicker");
+ aRet[1] = rtl::OUString::createFromAscii("com.sun.star.ui.dialogs.SystemFilePicker");
+ aRet[2] = rtl::OUString::createFromAscii("com.sun.star.ui.dialogs.KDE4FilePicker");
+ return aRet;
+ }
+}
+
+rtl::OUString toOUString(const QString& s)
+{
+ return rtl::OUString(s.toUtf8().data(), s.length(), RTL_TEXTENCODING_UTF8);
+}
+
+QString toQString(const rtl::OUString& s)
+{
+ return QString::fromUtf16(s.getStr(), s.getLength());
+}
+
+//////////////////////////////////////////////////////////////////////////
+// KDE4FilePicker
+//////////////////////////////////////////////////////////////////////////
+
+KDE4FilePicker::KDE4FilePicker( const uno::Reference<lang::XMultiServiceFactory>& xServiceMgr )
+ : cppu::WeakComponentImplHelper8<
+ XFilterManager,
+ XFilterGroupManager,
+ XFilePickerControlAccess,
+ XFilePickerNotifier,
+// TODO XFilePreview,
+ lang::XInitialization,
+ util::XCancellable,
+ lang::XEventListener,
+ lang::XServiceInfo>( _helperMutex ),
+ m_xServiceMgr( xServiceMgr ),
+ _resMgr( CREATEVERSIONRESMGR( fps_office ) )
+{
+ _extraControls = new QWidget();
+
+ _layout = new QGridLayout(_extraControls);
+
+ _dialog = new KFileDialog(KUrl(""), QString(""), 0, _extraControls);
+ _dialog->setMode(KFile::File | KFile::LocalOnly);
+
+ //default mode
+ _dialog->setOperationMode(KFileDialog::Opening);
+}
+
+KDE4FilePicker::~KDE4FilePicker()
+{
+ delete _resMgr;
+ delete _dialog;
+}
+
+void SAL_CALL KDE4FilePicker::addFilePickerListener( const uno::Reference<XFilePickerListener>& xListener )
+ throw( uno::RuntimeException )
+{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ m_xListener = xListener;
+}
+
+void SAL_CALL KDE4FilePicker::removeFilePickerListener( const uno::Reference<XFilePickerListener>& )
+ throw( uno::RuntimeException )
+{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ m_xListener.clear();
+}
+
+void SAL_CALL KDE4FilePicker::setTitle( const rtl::OUString &title )
+ throw( uno::RuntimeException )
+{
+ _dialog->setCaption(toQString(title));
+}
+
+sal_Int16 SAL_CALL KDE4FilePicker::execute()
+ throw( uno::RuntimeException )
+{
+ //get the window id of the main OO window to set it for the dialog as a parent
+ Window *pParentWin = Application::GetDefDialogParent();
+ if ( pParentWin )
+ {
+ const SystemEnvData* pSysData = ((SystemWindow *)pParentWin)->GetSystemData();
+ if ( pSysData )
+ {
+ KWindowSystem::setMainWindow( _dialog, pSysData->aWindow); // unx only
+ }
+ }
+
+ _dialog->setFilter(_filter);
+ _dialog->exec();
+
+ //nasty hack to get a local qt event loop going to process the dialog
+ //otherwise the dialog returns immediately
+ while (_dialog->isVisible())
+ {
+ kapp->processEvents(QEventLoop::WaitForMoreEvents);
+ }
+
+ //block and wait for user input
+ if (_dialog->result() == KFileDialog::Accepted)
+ {
+ return ExecutableDialogResults::OK;
+ }
+
+ return ExecutableDialogResults::CANCEL;
+}
+
+void SAL_CALL KDE4FilePicker::setMultiSelectionMode( sal_Bool multiSelect )
+ throw( uno::RuntimeException )
+{
+ if (multiSelect)
+ {
+ _dialog->setMode(KFile::Files | KFile::LocalOnly);
+ }
+ else
+ {
+ _dialog->setMode(KFile::File | KFile::LocalOnly);
+ }
+}
+
+void SAL_CALL KDE4FilePicker::setDefaultName( const ::rtl::OUString &name )
+ throw( uno::RuntimeException )
+{
+ const QString url = toQString(name);
+ _dialog->setSelection(url);
+}
+
+void SAL_CALL KDE4FilePicker::setDisplayDirectory( const rtl::OUString &dir )
+ throw( uno::RuntimeException )
+{
+ const QString url = toQString(dir);
+ _dialog->setStartDir(KUrl(url));
+}
+
+rtl::OUString SAL_CALL KDE4FilePicker::getDisplayDirectory()
+ throw( uno::RuntimeException )
+{
+ QString dir = _dialog->baseUrl().url();
+ return toOUString(dir);
+}
+
+uno::Sequence< ::rtl::OUString > SAL_CALL KDE4FilePicker::getFiles()
+ throw( uno::RuntimeException )
+{
+ QStringList files = _dialog->selectedFiles();
+
+ uno::Sequence< ::rtl::OUString > seq(files.size());
+
+ for (int i=0 ; i<files.size() ; ++i)
+ {
+ const QString fileName = "file:" + files[i];
+ seq[i] = toOUString(fileName);
+ }
+
+ return seq;
+}
+
+void SAL_CALL KDE4FilePicker::appendFilter( const ::rtl::OUString &title, const ::rtl::OUString &filter )
+ throw( lang::IllegalArgumentException, uno::RuntimeException )
+{
+ QString t = toQString(title);
+ QString f = toQString(filter);
+
+ if (!_filter.isNull())
+ {
+ _filter.append("\n");
+ }
+
+ //add to hash map for reverse lookup in getCurrentFilter
+ _filters.insert(f, t);
+
+ // '/' meed to be escaped to else they are assumed to be mime types by kfiledialog
+ //see the docs
+ t.replace("/", "\\/");
+
+ _filter.append(QString("%1|%2").arg(f).arg(t));
+}
+
+void SAL_CALL KDE4FilePicker::setCurrentFilter( const rtl::OUString &title )
+ throw( lang::IllegalArgumentException, uno::RuntimeException )
+{
+ QString filter = toQString(title);
+ filter.replace("/", "\\/");
+ _dialog->filterWidget()->setCurrentFilter(filter);
+}
+
+rtl::OUString SAL_CALL KDE4FilePicker::getCurrentFilter()
+ throw( uno::RuntimeException )
+{
+ QString filter = _filters[_dialog->currentFilter()];
+
+ //default if not found
+ if (filter.isNull())
+ {
+ filter = "ODF Text Document (.odt)";
+ }
+
+ return toOUString(filter);
+}
+
+void SAL_CALL KDE4FilePicker::appendFilterGroup( const rtl::OUString&, const uno::Sequence<beans::StringPair>& )
+ throw( lang::IllegalArgumentException, uno::RuntimeException )
+{
+ //TODO
+}
+
+void SAL_CALL KDE4FilePicker::setValue( sal_Int16 controlId, sal_Int16, const uno::Any &value )
+ throw( uno::RuntimeException )
+{
+ QWidget* widget = _customWidgets[controlId];
+
+ if (widget)
+ {
+ switch (controlId)
+ {
+ case ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION:
+ case ExtendedFilePickerElementIds::CHECKBOX_PASSWORD:
+ case ExtendedFilePickerElementIds::CHECKBOX_FILTEROPTIONS:
+ case ExtendedFilePickerElementIds::CHECKBOX_READONLY:
+ case ExtendedFilePickerElementIds::CHECKBOX_LINK:
+ case ExtendedFilePickerElementIds::CHECKBOX_PREVIEW:
+ case ExtendedFilePickerElementIds::CHECKBOX_SELECTION:
+ {
+ QCheckBox* cb = dynamic_cast<QCheckBox*>(widget);
+ cb->setChecked(value.getValue());
+ break;
+ }
+ case ExtendedFilePickerElementIds::PUSHBUTTON_PLAY:
+ case ExtendedFilePickerElementIds::LISTBOX_VERSION:
+ case ExtendedFilePickerElementIds::LISTBOX_TEMPLATE:
+ case ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE:
+ case ExtendedFilePickerElementIds::LISTBOX_VERSION_LABEL:
+ case ExtendedFilePickerElementIds::LISTBOX_TEMPLATE_LABEL:
+ case ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE_LABEL:
+ case ExtendedFilePickerElementIds::LISTBOX_FILTER_SELECTOR:
+ break;
+ }
+ }
+}
+
+uno::Any SAL_CALL KDE4FilePicker::getValue( sal_Int16 controlId, sal_Int16 )
+ throw( uno::RuntimeException )
+{
+ uno::Any res(false);
+
+ QWidget* widget = _customWidgets[controlId];
+
+ if (widget)
+ {
+ switch (controlId)
+ {
+ case ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION:
+ case ExtendedFilePickerElementIds::CHECKBOX_PASSWORD:
+ case ExtendedFilePickerElementIds::CHECKBOX_FILTEROPTIONS:
+ case ExtendedFilePickerElementIds::CHECKBOX_READONLY:
+ case ExtendedFilePickerElementIds::CHECKBOX_LINK:
+ case ExtendedFilePickerElementIds::CHECKBOX_PREVIEW:
+ case ExtendedFilePickerElementIds::CHECKBOX_SELECTION:
+ {
+ QCheckBox* cb = dynamic_cast<QCheckBox*>(widget);
+ res = uno::Any(cb->isChecked());
+ break;
+ }
+ case ExtendedFilePickerElementIds::PUSHBUTTON_PLAY:
+ case ExtendedFilePickerElementIds::LISTBOX_VERSION:
+ case ExtendedFilePickerElementIds::LISTBOX_TEMPLATE:
+ case ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE:
+ case ExtendedFilePickerElementIds::LISTBOX_VERSION_LABEL:
+ case ExtendedFilePickerElementIds::LISTBOX_TEMPLATE_LABEL:
+ case ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE_LABEL:
+ case ExtendedFilePickerElementIds::LISTBOX_FILTER_SELECTOR:
+ break;
+ }
+ }
+
+ return res;
+}
+
+void SAL_CALL KDE4FilePicker::enableControl( sal_Int16 controlId, sal_Bool enable )
+ throw( uno::RuntimeException )
+{
+ QWidget* widget = _customWidgets[controlId];
+
+ if (widget)
+ {
+ widget->setEnabled(enable);
+ }
+}
+
+void SAL_CALL KDE4FilePicker::setLabel( sal_Int16 controlId, const ::rtl::OUString &label )
+ throw( uno::RuntimeException )
+{
+ QWidget* widget = _customWidgets[controlId];
+
+ if (widget)
+ {
+ switch (controlId)
+ {
+ case ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION:
+ case ExtendedFilePickerElementIds::CHECKBOX_PASSWORD:
+ case ExtendedFilePickerElementIds::CHECKBOX_FILTEROPTIONS:
+ case ExtendedFilePickerElementIds::CHECKBOX_READONLY:
+ case ExtendedFilePickerElementIds::CHECKBOX_LINK:
+ case ExtendedFilePickerElementIds::CHECKBOX_PREVIEW:
+ case ExtendedFilePickerElementIds::CHECKBOX_SELECTION:
+ {
+ QCheckBox* cb = dynamic_cast<QCheckBox*>(widget);
+ cb->setText(toQString(label));
+ break;
+ }
+ case ExtendedFilePickerElementIds::PUSHBUTTON_PLAY:
+ case ExtendedFilePickerElementIds::LISTBOX_VERSION:
+ case ExtendedFilePickerElementIds::LISTBOX_TEMPLATE:
+ case ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE:
+ case ExtendedFilePickerElementIds::LISTBOX_VERSION_LABEL:
+ case ExtendedFilePickerElementIds::LISTBOX_TEMPLATE_LABEL:
+ case ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE_LABEL:
+ case ExtendedFilePickerElementIds::LISTBOX_FILTER_SELECTOR:
+ break;
+ }
+ }
+}
+
+rtl::OUString SAL_CALL KDE4FilePicker::getLabel(sal_Int16 controlId)
+ throw ( uno::RuntimeException )
+{
+ QWidget* widget = _customWidgets[controlId];
+ QString label;
+
+ if (widget)
+ {
+ switch (controlId)
+ {
+ case ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION:
+ case ExtendedFilePickerElementIds::CHECKBOX_PASSWORD:
+ case ExtendedFilePickerElementIds::CHECKBOX_FILTEROPTIONS:
+ case ExtendedFilePickerElementIds::CHECKBOX_READONLY:
+ case ExtendedFilePickerElementIds::CHECKBOX_LINK:
+ case ExtendedFilePickerElementIds::CHECKBOX_PREVIEW:
+ case ExtendedFilePickerElementIds::CHECKBOX_SELECTION:
+ {
+ QCheckBox* cb = dynamic_cast<QCheckBox*>(widget);
+ label = cb->text();
+ break;
+ }
+ case ExtendedFilePickerElementIds::PUSHBUTTON_PLAY:
+ case ExtendedFilePickerElementIds::LISTBOX_VERSION:
+ case ExtendedFilePickerElementIds::LISTBOX_TEMPLATE:
+ case ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE:
+ case ExtendedFilePickerElementIds::LISTBOX_VERSION_LABEL:
+ case ExtendedFilePickerElementIds::LISTBOX_TEMPLATE_LABEL:
+ case ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE_LABEL:
+ case ExtendedFilePickerElementIds::LISTBOX_FILTER_SELECTOR:
+ break;
+ }
+ }
+ return toOUString(label);
+}
+
+void KDE4FilePicker::addCustomControl(sal_Int16 controlId)
+{
+ QWidget* widget = 0;
+ sal_Int32 resId = -1;
+
+ switch (controlId)
+ {
+ case ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION:
+ resId = STR_SVT_FILEPICKER_AUTO_EXTENSION;
+ break;
+ case ExtendedFilePickerElementIds::CHECKBOX_PASSWORD:
+ resId = STR_SVT_FILEPICKER_PASSWORD;
+ break;
+ case ExtendedFilePickerElementIds::CHECKBOX_FILTEROPTIONS:
+ resId = STR_SVT_FILEPICKER_FILTER_OPTIONS;
+ break;
+ case ExtendedFilePickerElementIds::CHECKBOX_READONLY:
+ resId = STR_SVT_FILEPICKER_READONLY;
+ break;
+ case ExtendedFilePickerElementIds::CHECKBOX_LINK:
+ resId = STR_SVT_FILEPICKER_INSERT_AS_LINK;
+ break;
+ case ExtendedFilePickerElementIds::CHECKBOX_PREVIEW:
+ resId = STR_SVT_FILEPICKER_SHOW_PREVIEW;
+ break;
+ case ExtendedFilePickerElementIds::CHECKBOX_SELECTION:
+ resId = STR_SVT_FILEPICKER_SELECTION;
+ break;
+ case ExtendedFilePickerElementIds::PUSHBUTTON_PLAY:
+ resId = STR_SVT_FILEPICKER_PLAY;
+ break;
+ case ExtendedFilePickerElementIds::LISTBOX_VERSION:
+ resId = STR_SVT_FILEPICKER_VERSION;
+ break;
+ case ExtendedFilePickerElementIds::LISTBOX_TEMPLATE:
+ resId = STR_SVT_FILEPICKER_TEMPLATES;
+ break;
+ case ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE:
+ resId = STR_SVT_FILEPICKER_IMAGE_TEMPLATE;
+ break;
+ case ExtendedFilePickerElementIds::LISTBOX_VERSION_LABEL:
+ case ExtendedFilePickerElementIds::LISTBOX_TEMPLATE_LABEL:
+ case ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE_LABEL:
+ case ExtendedFilePickerElementIds::LISTBOX_FILTER_SELECTOR:
+ break;
+ }
+
+ switch (controlId)
+ {
+ case ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION:
+ case ExtendedFilePickerElementIds::CHECKBOX_PASSWORD:
+ case ExtendedFilePickerElementIds::CHECKBOX_FILTEROPTIONS:
+ case ExtendedFilePickerElementIds::CHECKBOX_READONLY:
+ case ExtendedFilePickerElementIds::CHECKBOX_LINK:
+ case ExtendedFilePickerElementIds::CHECKBOX_PREVIEW:
+ case ExtendedFilePickerElementIds::CHECKBOX_SELECTION:
+ {
+ QString label;
+
+ if (_resMgr && resId != -1)
+ {
+ rtl::OUString s = String(ResId( resId, *_resMgr ));
+ label = toQString(s);
+ label.replace("~", "&");
+ }
+
+ widget = new QCheckBox(label, _extraControls);
+
+ break;
+ }
+ case ExtendedFilePickerElementIds::PUSHBUTTON_PLAY:
+ case ExtendedFilePickerElementIds::LISTBOX_VERSION:
+ case ExtendedFilePickerElementIds::LISTBOX_TEMPLATE:
+ case ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE:
+ case ExtendedFilePickerElementIds::LISTBOX_VERSION_LABEL:
+ case ExtendedFilePickerElementIds::LISTBOX_TEMPLATE_LABEL:
+ case ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE_LABEL:
+ case ExtendedFilePickerElementIds::LISTBOX_FILTER_SELECTOR:
+ break;
+ }
+
+ if (widget)
+ {
+ _layout->addWidget(widget);
+ _customWidgets.insert(controlId, widget);
+ }
+}
+
+void SAL_CALL KDE4FilePicker::initialize( const uno::Sequence<uno::Any> &args )
+ throw( uno::Exception, uno::RuntimeException )
+{
+ _filter.clear();
+ _filters.clear();
+
+ // parameter checking
+ uno::Any arg;
+ if (args.getLength() == 0)
+ {
+ throw lang::IllegalArgumentException(
+ rtl::OUString::createFromAscii( "no arguments" ),
+ static_cast< XFilePicker* >( this ), 1 );
+ }
+
+ arg = args[0];
+
+ if (( arg.getValueType() != ::getCppuType((sal_Int16*)0)) &&
+ ( arg.getValueType() != ::getCppuType((sal_Int8*)0)))
+ {
+ throw lang::IllegalArgumentException(
+ rtl::OUString::createFromAscii( "invalid argument type" ),
+ static_cast< XFilePicker* >( this ), 1 );
+ }
+
+ sal_Int16 templateId = -1;
+ arg >>= templateId;
+
+ //default is opening
+ KFileDialog::OperationMode operationMode = KFileDialog::Opening;
+
+ switch ( templateId )
+ {
+ case FILEOPEN_SIMPLE:
+ break;
+
+ case FILESAVE_SIMPLE:
+ operationMode = KFileDialog::Saving;
+ break;
+
+ case FILESAVE_AUTOEXTENSION:
+ operationMode = KFileDialog::Saving;
+ addCustomControl( ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION );
+ break;
+
+ case FILESAVE_AUTOEXTENSION_PASSWORD:
+ {
+ operationMode = KFileDialog::Saving;
+ addCustomControl( ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION );
+ addCustomControl( ExtendedFilePickerElementIds::CHECKBOX_PASSWORD );
+ break;
+ }
+ case FILESAVE_AUTOEXTENSION_PASSWORD_FILTEROPTIONS:
+ {
+ operationMode = KFileDialog::Saving;
+ addCustomControl( ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION );
+ addCustomControl( ExtendedFilePickerElementIds::CHECKBOX_PASSWORD );
+ addCustomControl( ExtendedFilePickerElementIds::CHECKBOX_FILTEROPTIONS );
+ break;
+ }
+ case FILESAVE_AUTOEXTENSION_SELECTION:
+ operationMode = KFileDialog::Saving;
+ addCustomControl( ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION );
+ addCustomControl( ExtendedFilePickerElementIds::CHECKBOX_SELECTION );
+ break;
+
+ case FILESAVE_AUTOEXTENSION_TEMPLATE:
+ operationMode = KFileDialog::Saving;
+ addCustomControl( ExtendedFilePickerElementIds::LISTBOX_TEMPLATE );
+ break;
+
+ case FILEOPEN_LINK_PREVIEW_IMAGE_TEMPLATE:
+ addCustomControl( ExtendedFilePickerElementIds::CHECKBOX_LINK );
+ addCustomControl( ExtendedFilePickerElementIds::CHECKBOX_PREVIEW );
+ addCustomControl( ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE );
+ break;
+
+ case FILEOPEN_PLAY:
+ addCustomControl( ExtendedFilePickerElementIds::PUSHBUTTON_PLAY );
+ break;
+
+ case FILEOPEN_READONLY_VERSION:
+ addCustomControl( ExtendedFilePickerElementIds::CHECKBOX_READONLY );
+ addCustomControl( ExtendedFilePickerElementIds::LISTBOX_VERSION );
+ break;
+
+ case FILEOPEN_LINK_PREVIEW:
+ addCustomControl( ExtendedFilePickerElementIds::CHECKBOX_LINK );
+ addCustomControl( ExtendedFilePickerElementIds::CHECKBOX_PREVIEW );
+ break;
+
+ default:
+ throw lang::IllegalArgumentException(
+ rtl::OUString::createFromAscii( "Unknown template" ),
+ static_cast< XFilePicker* >( this ),
+ 1 );
+ }
+
+ _dialog->setOperationMode(operationMode);
+}
+
+void SAL_CALL KDE4FilePicker::cancel()
+ throw ( uno::RuntimeException )
+{
+
+}
+
+void SAL_CALL KDE4FilePicker::disposing( const lang::EventObject &rEvent )
+ throw( uno::RuntimeException )
+{
+ uno::Reference<XFilePickerListener> xFilePickerListener( rEvent.Source, uno::UNO_QUERY );
+
+ if ( xFilePickerListener.is() )
+ {
+ removeFilePickerListener( xFilePickerListener );
+ }
+}
+
+rtl::OUString SAL_CALL KDE4FilePicker::getImplementationName()
+ throw( uno::RuntimeException )
+{
+ return rtl::OUString::createFromAscii( FILE_PICKER_IMPL_NAME );
+}
+
+sal_Bool SAL_CALL KDE4FilePicker::supportsService( const rtl::OUString& ServiceName )
+ throw( uno::RuntimeException )
+{
+ uno::Sequence< ::rtl::OUString > SupportedServicesNames = FilePicker_getSupportedServiceNames();
+
+ for ( sal_Int32 n = SupportedServicesNames.getLength(); n--; )
+ {
+ if ( SupportedServicesNames[n].compareTo( ServiceName ) == 0 )
+ return sal_True;
+ }
+
+ return sal_False;
+}
+
+uno::Sequence< ::rtl::OUString > SAL_CALL KDE4FilePicker::getSupportedServiceNames()
+ throw( uno::RuntimeException )
+{
+ return FilePicker_getSupportedServiceNames();
+}
diff --git a/fpicker/source/unx/kde4/KDE4FilePicker.hxx b/fpicker/source/unx/kde4/KDE4FilePicker.hxx
new file mode 100644
index 0000000000..291e6f7c3a
--- /dev/null
+++ b/fpicker/source/unx/kde4/KDE4FilePicker.hxx
@@ -0,0 +1,205 @@
+/*************************************************************************
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 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
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): Jan Holesovsky <kendy@openoffice.org>
+ *
+ *
+ ************************************************************************/
+
+#pragma once
+
+#include <cppuhelper/compbase8.hxx>
+
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/ui/dialogs/XFilePickerNotifier.hpp>
+#include <com/sun/star/ui/dialogs/XFilterManager.hpp>
+#include <com/sun/star/ui/dialogs/XFilterGroupManager.hpp>
+#include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp>
+//#include <com/sun/star/ui/dialogs/XFilePreview.hpp>
+#include <com/sun/star/util/XCancellable.hpp>
+
+#include <osl/conditn.hxx>
+#include <osl/mutex.hxx>
+
+#include <rtl/ustrbuf.hxx>
+
+#include <QString>
+#include <QHash>
+
+class KFileDialog;
+class QWidget;
+class QLayout;
+
+class ResMgr;
+
+class KDE4FilePicker :
+ public cppu::WeakComponentImplHelper8<
+ ::com::sun::star::ui::dialogs::XFilterManager,
+ ::com::sun::star::ui::dialogs::XFilterGroupManager,
+ ::com::sun::star::ui::dialogs::XFilePickerControlAccess,
+ ::com::sun::star::ui::dialogs::XFilePickerNotifier,
+// TODO ::com::sun::star::ui::dialogs::XFilePreview,
+ ::com::sun::star::lang::XInitialization,
+ ::com::sun::star::util::XCancellable,
+ ::com::sun::star::lang::XEventListener,
+ ::com::sun::star::lang::XServiceInfo >
+{
+protected:
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceMgr; // to instanciate own services
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::ui::dialogs::XFilePickerListener > m_xListener;
+
+ ResMgr *_resMgr;
+
+ //the dialog to display
+ KFileDialog* _dialog;
+
+ osl::Mutex _helperMutex;
+
+ //running filter string to add to dialog
+ QString _filter;
+
+ //filter for reverse lookup of filter text
+ QHash<QString, QString> _filters;
+
+ //mapping of SAL control ID's to created custom controls
+ QHash<sal_Int16, QWidget*> _customWidgets;
+
+ //widget to contain extra custom controls
+ QWidget* _extraControls;
+
+ //layout for extra custom controls
+ QLayout* _layout;
+
+public:
+ KDE4FilePicker( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceMgr );
+ virtual ~KDE4FilePicker();
+
+ // XFilePickerNotifier
+
+ virtual void SAL_CALL addFilePickerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::ui::dialogs::XFilePickerListener >& xListener ) throw( ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL removeFilePickerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::ui::dialogs::XFilePickerListener >& xListener ) throw( ::com::sun::star::uno::RuntimeException );
+
+ // XExecutableDialog functions
+
+ virtual void SAL_CALL setTitle( const ::rtl::OUString &rTitle ) throw( ::com::sun::star::uno::RuntimeException );
+ virtual sal_Int16 SAL_CALL execute() throw( ::com::sun::star::uno::RuntimeException );
+
+ // XFilePicker functions
+
+ virtual void SAL_CALL setMultiSelectionMode( sal_Bool bMode ) throw( ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL setDefaultName( const ::rtl::OUString &rName ) throw( ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL setDisplayDirectory( const ::rtl::OUString &rDirectory ) throw( ::com::sun::star::uno::RuntimeException );
+ virtual ::rtl::OUString SAL_CALL getDisplayDirectory() throw( ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getFiles() throw( ::com::sun::star::uno::RuntimeException );
+
+ // XFilterManager functions
+
+ virtual void SAL_CALL appendFilter( const ::rtl::OUString &rTitle, const ::rtl::OUString &rFilter ) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL setCurrentFilter( const ::rtl::OUString &rTitle ) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException );
+ virtual ::rtl::OUString SAL_CALL getCurrentFilter() throw( ::com::sun::star::uno::RuntimeException );
+
+ // XFilterGroupManager functions
+
+ virtual void SAL_CALL appendFilterGroup( const ::rtl::OUString &rGroupTitle, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > &rFilters ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+
+ // XFilePickerControlAccess functions
+
+ virtual void SAL_CALL setValue( sal_Int16 nControlId, sal_Int16 nControlAction, const ::com::sun::star::uno::Any &rValue ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getValue( sal_Int16 nControlId, sal_Int16 nControlAction ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL enableControl( sal_Int16 nControlId, sal_Bool bEnable ) throw( ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL setLabel( sal_Int16 nControlId, const ::rtl::OUString &rLabel ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getLabel( sal_Int16 nControlId ) throw (::com::sun::star::uno::RuntimeException);
+
+ /* TODO XFilePreview
+
+ virtual ::com::sun::star::uno::Sequence< sal_Int16 > SAL_CALL getSupportedImageFormats( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getTargetColorDepth( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getAvailableWidth( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getAvailableHeight( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setImage( sal_Int16 aImageFormat, const ::com::sun::star::uno::Any &rImage ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL setShowState( sal_Bool bShowState ) throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL getShowState( ) throw (::com::sun::star::uno::RuntimeException);
+ */
+
+ // XInitialization
+
+ virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > &rArguments ) throw( ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException );
+
+ // XCancellable
+
+ virtual void SAL_CALL cancel( ) throw( ::com::sun::star::uno::RuntimeException );
+
+ // XEventListener
+
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject &rEvent ) throw( ::com::sun::star::uno::RuntimeException );
+
+ // XServiceInfo
+
+ virtual ::rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString &rServiceName ) throw( ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException );
+
+private:
+ // prevent copy and assignment
+ KDE4FilePicker( const KDE4FilePicker& );
+ KDE4FilePicker& operator=( const KDE4FilePicker& );
+
+ //add a custom control widget to the file dialog
+ void addCustomControl(sal_Int16 controlId);
+
+};
diff --git a/fpicker/source/unx/kde4/fps-kde4-ucd.txt b/fpicker/source/unx/kde4/fps-kde4-ucd.txt
new file mode 100644
index 0000000000..8ecc4e0a0a
--- /dev/null
+++ b/fpicker/source/unx/kde4/fps-kde4-ucd.txt
@@ -0,0 +1,6 @@
+[ComponentDescriptor]
+ImplementationName=com.sun.star.ui.dialogs.KDE4FilePicker
+ComponentName=fps_kde4.uno.so
+LoaderName=com.sun.star.loader.SharedLibrary
+[SupportedServices]
+com.sun.star.ui.dialogs.KDE4FilePicker
diff --git a/fpicker/source/unx/kde4/fps_kde4.xml b/fpicker/source/unx/kde4/fps_kde4.xml
new file mode 100644
index 0000000000..b250c0531a
--- /dev/null
+++ b/fpicker/source/unx/kde4/fps_kde4.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE module-description PUBLIC "-//StarOffice//DTD ComponentDescription 1.0//EN" "module-description.dtd">
+<module-description xmlns:xlink="http://www.w3.org/1999/xlink">
+ <module-name>fps_kde4</module-name>
+ <component-description>
+ <author> Jan Holesovsky </author>
+ <name> com.sun.star.comp.ui.dialogs.FilePicker </name>
+ <description>
+ The KDE implementation of the FilePicker service.
+ </description>
+ <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
+ <language> c++ </language>
+ <status value="beta"/>
+ <supported-service> com.sun.star.ui.dialogs.FilePicker </supported-service>
+ <service-dependency>...</service-dependency>
+ <type> com.sun.star.ui.dialogs.XExecutableDialog </type>
+ <type> com.sun.star.ui.dialogs.XFilePicker </type>
+ <type> com.sun.star.ui.dialogs.XFilterManager </type>
+ <type> com.sun.star.ui.dialogs.XFilterGroupManager </type>
+ <type> com.sun.star.ui.dialogs.XFilePickerListener </type>
+ <type> com.sun.star.ui.dialogs.ExecutableDialogException </type>
+ <type> com.sun.star.ui.dialogs.XFilePickerNotifier </type>
+ <type> com.sun.star.ui.dialogs.XFilePickerControlAccess </type>
+ <type> com.sun.star.ui.dialogs.XFilePreview </type>
+ <type> com.sun.star.ui.dialogs.ExtendedFilePickerElementIds </type>
+ <type> com.sun.star.ui.dialogs.ExecutableDialogResults </type>
+ <type> com.sun.star.ui.dialogs.FilePickerEvent </type>
+ <type> com.sun.star.ui.dialogs.CommonFilePickerElementIds </type>
+ <type> com.sun.star.ui.dialogs.ListboxControlActions </type>
+ <type> com.sun.star.ui.dialogs.TemplateDescription </type>
+ <type> com.sun.star.ui.dialogs.FilePreviewImageFormats </type>
+ <type> com.sun.star.util.XCancellable </type>
+ <type> com.sun.star.lang.XComponent </type>
+ <type> com.sun.star.lang.XMultiServiceFactory </type>
+ <type> com.sun.star.lang.XSingleServiceFactory </type>
+ <type> com.sun.star.lang.XServiceInfo </type>
+ <type> com.sun.star.lang.XTypeProvider </type>
+ <type> com.sun.star.lang.IllegalArgumentException </type>
+ <type> com.sun.star.uno.TypeClass </type>
+ <type> com.sun.star.uno.XWeak </type>
+ <type> com.sun.star.uno.XAggregation </type>
+ <type> com.sun.star.registry.XRegistryKey </type>
+ <type> com.sun.star.container.XSet </type>
+ </component-description>
+ <project-build-dependency> cppuhelper </project-build-dependency>
+ <project-build-dependency> cppu </project-build-dependency>
+ <project-build-dependency> sal </project-build-dependency>
+ <runtime-module-dependency> cppuhelper </runtime-module-dependency>
+ <runtime-module-dependency> cppu2 </runtime-module-dependency>
+ <runtime-module-dependency> sal2 </runtime-module-dependency>
+</module-description>
diff --git a/fpicker/source/unx/kde4/makefile.mk b/fpicker/source/unx/kde4/makefile.mk
new file mode 100644
index 0000000000..6f9db777bc
--- /dev/null
+++ b/fpicker/source/unx/kde4/makefile.mk
@@ -0,0 +1,117 @@
+#*************************************************************************
+#
+#
+#
+#
+#
+#
+#
+# The Contents of this file are made available subject to the terms of
+# either of the following licenses
+#
+# - GNU Lesser General Public License Version 2.1
+# - Sun Industry Standards Source License Version 1.1
+#
+# Sun Microsystems Inc., October, 2000
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2000 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
+#
+#
+# Sun Industry Standards Source License Version 1.1
+# =================================================
+# The contents of this file are subject to the Sun Industry Standards
+# Source License Version 1.1 (the "License"); You may not use this file
+# except in compliance with the License. You may obtain a copy of the
+# License at http://www.openoffice.org/license.html.
+#
+# Software provided under this License is provided on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+# See the License for the specific provisions governing your rights and
+# obligations concerning the Software.
+#
+# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+#
+# Copyright: 2000 by Sun Microsystems, Inc.
+#
+# All Rights Reserved.
+#
+# Contributor(s): _______________________________________
+#
+#
+#
+#*************************************************************************
+
+PRJ=..$/..$/..
+
+PRJNAME=fpicker
+TARGET=fps_kde4.uno
+LIBTARGET=NO
+ENABLE_EXCEPTIONS=TRUE
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : settings.mk
+DLLPRE=
+
+# ------------------------------------------------------------------
+
+# Currently just KDE is supported...
+.IF "$(GUIBASE)" != "unx" || "$(ENABLE_KDE4)" != "TRUE"
+
+dummy:
+ @echo "Nothing to build. GUIBASE == $(GUIBASE), ENABLE_KDE4 is not set"
+
+.ELSE # we build for KDE
+
+CFLAGS+= $(KDE4_CFLAGS)
+
+# --- Files --------------------------------------------------------
+
+SLOFILES =\
+ $(SLO)$/KDE4FilePicker.obj \
+ $(SLO)$/KDE4FilePicker.moc.obj \
+ $(SLO)$/KDE4FPEntry.obj
+
+SHL1NOCHECK=TRUE
+SHL1TARGET=$(TARGET)
+SHL1STDLIBS=$(CPPULIB)\
+ $(CPPUHELPERLIB)\
+ $(SALLIB)\
+ $(VCLLIB)\
+ $(TOOLSLIB) \
+ $(KDE4_LIBS) -lkio -lkfile
+
+
+SHL1OBJS=$(SLOFILES)
+SHL1DEF=$(MISC)$/$(SHL1TARGET).def
+
+DEF1NAME=$(SHL1TARGET)
+DEF1VERSIONMAP=exports.map
+
+.ENDIF
+
+# --- Targets ------------------------------------------------------
+
+.INCLUDE : target.mk
+
+$(MISC)$/KDE4FilePicker.moc.cxx : KDE4FilePicker.hxx
+ $(MOC4) $< -o $@
diff --git a/fpicker/source/win32/filepicker/FPentry.cxx b/fpicker/source/win32/filepicker/FPentry.cxx
index 90d6a474a5..7d2d9d93fc 100644
--- a/fpicker/source/win32/filepicker/FPentry.cxx
+++ b/fpicker/source/win32/filepicker/FPentry.cxx
@@ -66,9 +66,9 @@ static Reference< XInterface > SAL_CALL createInstance(
const Reference< XMultiServiceFactory >& rServiceManager )
{
Reference< XInterface > xDlg;
- bool bVista = IsWindowsVista();
+ bool bVistaOrNewer = IsWindowsVistaOrNewer();
- if (bVista)
+ if (bVistaOrNewer)
{
fprintf(stdout, "use special (vista) system file picker ...\n");
xDlg.set(
diff --git a/fpicker/source/win32/filepicker/SolarMutex.cxx b/fpicker/source/win32/filepicker/SolarMutex.cxx
new file mode 100644
index 0000000000..3c446f412e
--- /dev/null
+++ b/fpicker/source/win32/filepicker/SolarMutex.cxx
@@ -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: asynceventnotifier.cxx,v $
+ * $Revision: 1.16 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_fpicker.hxx"
+
+#include <vcl/svapp.hxx>
+#include <vos/mutex.hxx>
+#include <osl/thread.hxx>
+
+int ReleaseSolarMutexOnMainThreadContext(unsigned nThreadId)
+{
+ int nAcquireCount = 0;
+ vos::IMutex& rSolarMutex = Application::GetSolarMutex();
+ vos::OThread::TThreadIdentifier nMainThreadId = Application::GetMainThreadIdentifier();
+
+ if ( nMainThreadId == nThreadId )
+ {
+ ::vos::IMutex& rMutex = Application::GetSolarMutex();
+ if ( rMutex.tryToAcquire() )
+ nAcquireCount = Application::ReleaseSolarMutex() - 1;
+ }
+
+ return nAcquireCount;
+}
+
+void AcquireSolarMutex(int nAcquireCount)
+{
+ if ( nAcquireCount )
+ Application::AcquireSolarMutex( nAcquireCount );
+}
diff --git a/fpicker/source/win32/filepicker/SolarMutex.hxx b/fpicker/source/win32/filepicker/SolarMutex.hxx
new file mode 100644
index 0000000000..95dcf13ecc
--- /dev/null
+++ b/fpicker/source/win32/filepicker/SolarMutex.hxx
@@ -0,0 +1,33 @@
+/*************************************************************************
+ *
+ * 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: asynceventnotifier.cxx,v $
+ * $Revision: 1.16 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+int ReleaseSolarMutexOnMainThreadContext(unsigned nThreadId);
+
+void AcquireSolarMutex(int nAcquireCount);
diff --git a/fpicker/source/win32/filepicker/VistaFilePicker.cxx b/fpicker/source/win32/filepicker/VistaFilePicker.cxx
index b5f9d4b3be..a80604c18f 100644
--- a/fpicker/source/win32/filepicker/VistaFilePicker.cxx
+++ b/fpicker/source/win32/filepicker/VistaFilePicker.cxx
@@ -51,6 +51,7 @@
#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
#include <cppuhelper/interfacecontainer.h>
+#include <comphelper/configurationhelper.hxx>
#include <osl/diagnose.h>
#include <osl/mutex.hxx>
#include <osl/file.hxx>
@@ -165,6 +166,7 @@ VistaFilePicker::VistaFilePicker(const css::uno::Reference< css::lang::XMultiSer
, m_rDialog (new VistaFilePickerImpl())
, m_aAsyncExecute (m_rDialog )
, m_nFilePickerThreadId (0 )
+ , m_bInitialized (false )
{
}
@@ -293,9 +295,24 @@ void SAL_CALL VistaFilePicker::setDisplayDirectory(const ::rtl::OUString& sDirec
throw (css::lang::IllegalArgumentException,
css::uno::RuntimeException )
{
+ const ::rtl::OUString aPackage( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Common/"));
+ const ::rtl::OUString aRelPath( RTL_CONSTASCII_USTRINGPARAM("Path/Info"));
+ const ::rtl::OUString aKey( RTL_CONSTASCII_USTRINGPARAM("WorkPathChanged"));
+
+ css::uno::Any aValue = ::comphelper::ConfigurationHelper::readDirectKey(
+ m_xSMGR, aPackage, aRelPath, aKey, ::comphelper::ConfigurationHelper::E_READONLY);
+
+ bool bChanged(false);
+ if (( aValue >>= bChanged ) && bChanged )
+ {
+ ::comphelper::ConfigurationHelper::writeDirectKey(
+ m_xSMGR, aPackage, aRelPath, aKey, css::uno::makeAny(false), ::comphelper::ConfigurationHelper::E_STANDARD);
+ }
+
RequestRef rRequest(new Request());
rRequest->setRequest (VistaFilePickerImpl::E_SET_DIRECTORY);
rRequest->setArgument(PROP_DIRECTORY, sDirectory);
+ rRequest->setArgument(PROP_FORCE, bChanged);
m_aAsyncExecute.triggerRequestThreadAware(rRequest, AsyncRequests::NON_BLOCKED);
}
@@ -345,6 +362,20 @@ css::uno::Sequence< ::rtl::OUString > SAL_CALL VistaFilePicker::getSelectedFiles
::sal_Int16 SAL_CALL VistaFilePicker::execute()
throw(css::uno::RuntimeException)
{
+ bool bInitialized(false);
+ {
+ osl::MutexGuard aGuard(m_aMutex);
+ bInitialized = m_bInitialized;
+ }
+
+ if ( !bInitialized )
+ {
+ sal_Int16 nTemplateDescription = css::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE;
+ css::uno::Sequence < css::uno::Any > aInitArguments(1);
+ aInitArguments[0] <<= nTemplateDescription;
+ initialize(aInitArguments);
+ }
+
RequestRef rRequest(new Request());
rRequest->setRequest (VistaFilePickerImpl::E_SHOW_DIALOG_MODAL);
@@ -640,6 +671,11 @@ void SAL_CALL VistaFilePicker::initialize(const css::uno::Sequence< css::uno::An
if ( ! m_aAsyncExecute.isRunning())
m_aAsyncExecute.create();
m_aAsyncExecute.triggerRequestThreadAware(rRequest, AsyncRequests::NON_BLOCKED);
+
+ {
+ osl::MutexGuard aGuard(m_aMutex);
+ m_bInitialized = true;
+ }
}
//------------------------------------------------------------------------------------
diff --git a/fpicker/source/win32/filepicker/VistaFilePicker.hxx b/fpicker/source/win32/filepicker/VistaFilePicker.hxx
index b398fd17ef..11ef555404 100644
--- a/fpicker/source/win32/filepicker/VistaFilePicker.hxx
+++ b/fpicker/source/win32/filepicker/VistaFilePicker.hxx
@@ -305,6 +305,8 @@ public:
//---------------------------------------------------------------------
oslThreadIdentifier m_nFilePickerThreadId;
+
+ bool m_bInitialized;
};
} // namespace vista
diff --git a/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx b/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx
index a04c611c91..088f0e0326 100644
--- a/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx
+++ b/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx
@@ -40,6 +40,10 @@
#include <comphelper/sequenceasvector.hxx>
#include <osl/file.hxx>
#include <osl/mutex.hxx>
+#ifdef __MINGW32__
+#include <limits.h>
+#endif
+#include "..\misc\WinImplHelper.hxx"
inline bool is_current_process_window(HWND hwnd)
{
@@ -401,7 +405,6 @@ void VistaFilePickerImpl::impl_sta_CreateOpenDialog(const RequestRef& rRequest)
nFlags |= FOS_FILEMUSTEXIST;
nFlags |= FOS_OVERWRITEPROMPT;
nFlags |= FOS_DONTADDTORECENT;
- nFlags |= FOS_ALLOWMULTISELECT;
iDialog->SetOptions ( nFlags );
@@ -462,6 +465,14 @@ static const ::sal_Int32 GROUP_IMAGETEMPLATE = 3;
static const ::sal_Int32 GROUP_CHECKBOXES = 4;
//-------------------------------------------------------------------------------
+static void setLabelToControl(CResourceProvider& rResourceProvider, TFileDialogCustomize iCustom, sal_uInt16 nControlId)
+{
+ ::rtl::OUString aLabel = rResourceProvider.getResString(nControlId);
+ aLabel = SOfficeToWindowsLabel(aLabel);
+ iCustom->SetControlLabel(nControlId, reinterpret_cast<LPCWSTR>(aLabel.getStr()) );
+}
+
+//-------------------------------------------------------------------------------
void VistaFilePickerImpl::impl_sta_enableFeatures(::sal_Int32 nFeatures, ::sal_Int32 nTemplate)
{
GUID aGUID = {};
@@ -536,23 +547,48 @@ void VistaFilePickerImpl::impl_sta_enableFeatures(::sal_Int32 nFeatures, ::sal_I
iCustom->StartVisualGroup (GROUP_CHECKBOXES, L"");
+ sal_uInt16 nControlId(0);
if ((nFeatures & FEATURE_AUTOEXTENSION) == FEATURE_AUTOEXTENSION)
- iCustom->AddCheckButton (css::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION, L"Auto Extension", true);
+ {
+ nControlId = css::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION;
+ iCustom->AddCheckButton (nControlId, L"Auto Extension", true);
+ setLabelToControl(m_ResProvider, iCustom, nControlId);
+ }
if ((nFeatures & FEATURE_PASSWORD) == FEATURE_PASSWORD)
- iCustom->AddCheckButton (css::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_PASSWORD, L"Password", false);
+ {
+ nControlId = css::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_PASSWORD;
+ iCustom->AddCheckButton (nControlId, L"Password", false);
+ setLabelToControl(m_ResProvider, iCustom, nControlId);
+ }
if ((nFeatures & FEATURE_READONLY) == FEATURE_READONLY)
- iCustom->AddCheckButton (css::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_READONLY, L"Readonly", false);
+ {
+ nControlId = css::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_READONLY;
+ iCustom->AddCheckButton (nControlId, L"Readonly", false);
+ setLabelToControl(m_ResProvider, iCustom, nControlId);
+ }
if ((nFeatures & FEATURE_FILTEROPTIONS) == FEATURE_FILTEROPTIONS)
- iCustom->AddCheckButton (css::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_FILTEROPTIONS, L"Filter Options", false);
+ {
+ nControlId = css::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_FILTEROPTIONS;
+ iCustom->AddCheckButton (nControlId, L"Filter Options", false);
+ setLabelToControl(m_ResProvider, iCustom, nControlId);
+ }
if ((nFeatures & FEATURE_LINK) == FEATURE_LINK)
- iCustom->AddCheckButton (css::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_LINK, L"Link", false);
+ {
+ nControlId = css::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_LINK;
+ iCustom->AddCheckButton (nControlId, L"Link", false);
+ setLabelToControl(m_ResProvider, iCustom, nControlId);
+ }
if ((nFeatures & FEATURE_SELECTION) == FEATURE_SELECTION)
- iCustom->AddCheckButton (css::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_SELECTION, L"Selection", false);
+ {
+ nControlId = css::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_SELECTION;
+ iCustom->AddCheckButton (nControlId, L"Selection", false);
+ setLabelToControl(m_ResProvider, iCustom, nControlId);
+ }
/* can be ignored ... new COM dialog supports preview native now !
if ((nFeatures & FEATURE_PREVIEW) == FEATURE_PREVIEW)
@@ -620,8 +656,9 @@ void VistaFilePickerImpl::impl_sta_SetFileName(const RequestRef& rRequest)
void VistaFilePickerImpl::impl_sta_SetDirectory(const RequestRef& rRequest)
{
::rtl::OUString sDirectory = rRequest->getArgumentOrDefault(PROP_DIRECTORY, ::rtl::OUString());
+ bool bForce = rRequest->getArgumentOrDefault(PROP_FORCE, false);
- if( !m_bInExecute )
+ if( !m_bInExecute)
{
// Vista stores last used folders for file dialogs
// so we don't want the application to change the folder
@@ -629,7 +666,6 @@ void VistaFilePickerImpl::impl_sta_SetDirectory(const RequestRef& rRequest)
// Store the requested folder in the mean time and decide later
// what to do
m_sDirectory = sDirectory;
- return;
}
// SYNCHRONIZED->
@@ -647,7 +683,13 @@ void VistaFilePickerImpl::impl_sta_SetDirectory(const RequestRef& rRequest)
if ( FAILED(hResult) )
return;
- iDialog->SetFolder(pFolder);
+ if ( m_bInExecute || bForce )
+ iDialog->SetFolder(pFolder);
+ else
+ {
+ // Use set default folder as Microsoft recommends in the IFileDialog documentation.
+ iDialog->SetDefaultFolder(pFolder);
+ }
}
void VistaFilePickerImpl::impl_sta_GetDirectory(const RequestRef& rRequest)
@@ -815,21 +857,62 @@ void VistaFilePickerImpl::impl_sta_ShowDialogModal(const RequestRef& rRequest)
aLock.clear();
// <- SYNCHRONIZED
+ // we set the directory only if we have a save dialog and a filename
+ // for the other cases, the file dialog remembers its last location
+ // according to its client guid.
if( m_sDirectory.getLength())
{
- // we set the directory only if we have a save dialog and a filename
- // for the other cases, the file dialog remembers its last location
- // according to its client guid.
- if (iSave.is() && m_sFilename.getLength())
+ ComPtr< IShellItem > pFolder;
+ #ifdef __MINGW32__
+ HRESULT hResult = SHCreateItemFromParsingName ( reinterpret_cast<LPCTSTR>(m_sDirectory.getStr()), NULL, IID_IShellItem, (void**)(&pFolder) );
+ #else
+ HRESULT hResult = SHCreateItemFromParsingName ( m_sDirectory, NULL, IID_PPV_ARGS(&pFolder) );
+ #endif
+ if ( SUCCEEDED(hResult) )
{
- ComPtr< IShellItem > pFolder;
- #ifdef __MINGW32__
- HRESULT hResult = SHCreateItemFromParsingName ( reinterpret_cast<LPCTSTR>(m_sDirectory.getStr()), NULL, IID_IShellItem, (void**)(&pFolder) );
- #else
- HRESULT hResult = SHCreateItemFromParsingName ( m_sDirectory, NULL, IID_PPV_ARGS(&pFolder) );
- #endif
- if ( SUCCEEDED(hResult) )
- iDialog->SetFolder(pFolder);
+ if (m_sFilename.getLength())
+ {
+ ::rtl::OUString aFileURL(m_sDirectory);
+ sal_Int32 nIndex = aFileURL.lastIndexOf('/');
+ if (nIndex != aFileURL.getLength()-1)
+ aFileURL += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/"));
+ aFileURL += m_sFilename;
+
+ TFileDialogCustomize iCustom = impl_getCustomizeInterface();
+
+ BOOL bValue = FALSE;
+ HRESULT hResult = iCustom->GetCheckButtonState( css::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION, &bValue);
+ if ( bValue )
+ {
+ ::rtl::OUString aExt;
+ UINT nFileType;
+ hResult = iDialog->GetFileTypeIndex(&nFileType);
+ if ( SUCCEEDED(hResult) )
+ {
+ ::std::vector< COMDLG_FILTERSPEC > lFilters = lcl_buildFilterList(m_lFilters);
+ LPCWSTR lpFilterExt = lFilters[nFileType].pszSpec;
+
+ lpFilterExt = wcsrchr( lpFilterExt, '.' );
+ if ( lpFilterExt )
+ aFileURL += reinterpret_cast<const sal_Unicode*>(lpFilterExt);
+ }
+ }
+
+ // Check existence of file. Set folder only for this special case
+ ::rtl::OUString aSystemPath;
+ osl_getSystemPathFromFileURL( aFileURL.pData, &aSystemPath.pData );
+
+ WIN32_FIND_DATA aFindFileData;
+ HANDLE hFind = FindFirstFile( reinterpret_cast<LPCWSTR>(aSystemPath.getStr()), &aFindFileData );
+ if (hFind != INVALID_HANDLE_VALUE)
+ iDialog->SetFolder(pFolder);
+ else
+ hResult = iDialog->AddPlace(pFolder, FDAP_TOP);
+
+ FindClose( hFind );
+ }
+ else
+ hResult = iDialog->AddPlace(pFolder, FDAP_TOP);
}
}
@@ -1048,7 +1131,7 @@ void VistaFilePickerImpl::impl_sta_SetControlLabel(const RequestRef& rRequest)
}
//-------------------------------------------------------------------------------
-void VistaFilePickerImpl::impl_sta_GetControlLabel(const RequestRef& rRequest)
+void VistaFilePickerImpl::impl_sta_GetControlLabel(const RequestRef& /*rRequest*/)
{
}
diff --git a/fpicker/source/win32/filepicker/VistaFilePickerImpl.hxx b/fpicker/source/win32/filepicker/VistaFilePickerImpl.hxx
index 4a0145a241..6f660ee7ab 100644
--- a/fpicker/source/win32/filepicker/VistaFilePickerImpl.hxx
+++ b/fpicker/source/win32/filepicker/VistaFilePickerImpl.hxx
@@ -42,6 +42,7 @@
#include "FilterContainer.hxx"
#include "VistaFilePickerEventHandler.hxx"
#include "IVistaFilePickerInternalNotify.hxx"
+#include "..\misc\resourceprovider.hxx"
#include <com/sun/star/uno/Sequence.hxx>
@@ -101,6 +102,7 @@ static const ::rtl::OUString PROP_FEATURES = ::rtl::OUString::createF
static const ::rtl::OUString PROP_TEMPLATE_DESCR = ::rtl::OUString::createFromAscii("templatedescription"); // [sal_Int32]
static const ::rtl::OUString PROP_FILTER_TITLE = ::rtl::OUString::createFromAscii("filter_title" ); // [OUString]
static const ::rtl::OUString PROP_FILTER_VALUE = ::rtl::OUString::createFromAscii("filter_value" ); // [OUString]
+static const ::rtl::OUString PROP_FORCE = ::rtl::OUString::createFromAscii("force" ); // [sal_Bool]
static const ::rtl::OUString PROP_CONTROL_ID = ::rtl::OUString::createFromAscii("control_id" ); // [sal_Int16]
static const ::rtl::OUString PROP_CONTROL_ACTION = ::rtl::OUString::createFromAscii("control_action" ); // [sal_Int16]
@@ -334,6 +336,9 @@ class VistaFilePickerImpl : private ::cppu::BaseMutex
//
::rtl::OUString m_sFilename;
+
+ // Resource provider
+ CResourceProvider m_ResProvider;
};
} // namespace vista
diff --git a/fpicker/source/win32/filepicker/asynceventnotifier.cxx b/fpicker/source/win32/filepicker/asynceventnotifier.cxx
index 4afee831cc..ba847f15eb 100644
--- a/fpicker/source/win32/filepicker/asynceventnotifier.cxx
+++ b/fpicker/source/win32/filepicker/asynceventnotifier.cxx
@@ -41,6 +41,7 @@
#include <process.h>
#include <memory>
+#include "SolarMutex.hxx"
//------------------------------------------------
//
@@ -159,7 +160,9 @@ bool SAL_CALL CAsyncEventNotifier::startup(bool bCreateSuspended)
void SAL_CALL CAsyncEventNotifier::shutdown()
{
- OSL_PRECOND(GetCurrentThreadId() != m_ThreadId, "Method called in wrong thread context!");
+ unsigned nThreadId = GetCurrentThreadId();
+
+ OSL_PRECOND(nThreadId != m_ThreadId, "Method called in wrong thread context!");
osl::ResettableMutexGuard aGuard(m_Mutex);
diff --git a/fpicker/source/win32/filepicker/asyncrequests.cxx b/fpicker/source/win32/filepicker/asyncrequests.cxx
index 486d86a554..bc4515c13b 100644
--- a/fpicker/source/win32/filepicker/asyncrequests.cxx
+++ b/fpicker/source/win32/filepicker/asyncrequests.cxx
@@ -30,6 +30,7 @@
#include "asyncrequests.hxx"
#include <vcl/svapp.hxx>
+#include <vos/mutex.hxx>
//-----------------------------------------------------------------------------
// namespace
@@ -53,7 +54,7 @@ void lcl_sleep(::osl::Condition& aCondition ,
{
TimeValue aTime;
aTime.Seconds = (nMilliSeconds / 1000);
- aTime.Nanosec = (nMilliSeconds % 1000);
+ aTime.Nanosec = (nMilliSeconds % 1000) * 1000000;
aCondition.wait(&aTime);
}
@@ -68,6 +69,7 @@ void Request::wait(::sal_Int32 nMilliSeconds)
void Request::waitProcessMessages()
{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
while (!m_aJoiner.check())
Application::Yield();
}
diff --git a/fpicker/source/win32/filepicker/filepickerstate.cxx b/fpicker/source/win32/filepicker/filepickerstate.cxx
index 4fbf9f7d56..dc0858a63a 100644
--- a/fpicker/source/win32/filepicker/filepickerstate.cxx
+++ b/fpicker/source/win32/filepicker/filepickerstate.cxx
@@ -220,6 +220,26 @@ OUString MatchFixBrokenPath(const OUString& path)
return path;
}
+//-----------------------------------------------------------------------------------------
+//
+//-----------------------------------------------------------------------------------------
+static ::rtl::OUString trimTrailingSpaces(const ::rtl::OUString& rString)
+{
+ rtl::OUString aResult(rString);
+
+ sal_Int32 nIndex = rString.lastIndexOf(' ');
+ if (nIndex == rString.getLength()-1)
+ {
+ while (nIndex >= 0 && rString[nIndex] == ' ')
+ nIndex--;
+ if (nIndex >= 0)
+ aResult = rString.copy(0,nIndex+1);
+ else
+ aResult = ::rtl::OUString();
+ }
+ return aResult;
+}
+
Sequence< OUString > SAL_CALL CNonExecuteFilePickerState::getFiles( CFileOpenDialog* aFileOpenDialog )
{
OSL_PRECOND( aFileOpenDialog, "invalid parameter" );
@@ -258,8 +278,9 @@ Sequence< OUString > SAL_CALL CNonExecuteFilePickerState::getFiles( CFileOpenDia
for ( sal_Int32 i = 0; i < lenFileList; i++ )
{
+ aFilePath = trimTrailingSpaces(aFilePathList[i]);
rc = ::osl::FileBase::getFileURLFromSystemPath(
- aFilePathList[i], aFilePathURL );
+ aFilePath, aFilePathURL );
// we do return all or nothing, that means
// in case of failures we destroy the sequence
diff --git a/fpicker/source/win32/filepicker/makefile.mk b/fpicker/source/win32/filepicker/makefile.mk
index c23c08108e..de192879b6 100644
--- a/fpicker/source/win32/filepicker/makefile.mk
+++ b/fpicker/source/win32/filepicker/makefile.mk
@@ -79,7 +79,8 @@ SLOFILES=$(SLO)$/FileOpenDlg.obj\
$(SLO)$/asyncrequests.obj\
$(SLO)$/VistaFilePickerEventHandler.obj\
$(SLO)$/VistaFilePickerImpl.obj\
- $(SLO)$/VistaFilePicker.obj
+ $(SLO)$/VistaFilePicker.obj\
+ $(SLO)$/SolarMutex.obj
# --- Targets ------------------------------------------------------
diff --git a/fpicker/source/win32/folderpicker/MtaFop.cxx b/fpicker/source/win32/folderpicker/MtaFop.cxx
index d4e93303c6..d63ca14d12 100644
--- a/fpicker/source/win32/folderpicker/MtaFop.cxx
+++ b/fpicker/source/win32/folderpicker/MtaFop.cxx
@@ -448,34 +448,22 @@ LPITEMIDLIST SAL_CALL CMtaFolderPicker::getItemIdListFromPath( const rtl::OUStri
if ( !aDirectory.getLength( ) )
return NULL;
- IMallocPtr pIMalloc;
- SHGetMalloc(&pIMalloc);
-
- LPITEMIDLIST lpItemIdList = static_cast<LPITEMIDLIST>(
- pIMalloc->Alloc(sizeof(ITEMIDLIST)));
+ LPITEMIDLIST lpItemIdList(NULL);
- if (lpItemIdList)
- {
- IShellFolderPtr pIShellFolder;
- SHGetDesktopFolder(&pIShellFolder);
+ IShellFolderPtr pIShellFolder;
+ SHGetDesktopFolder(&pIShellFolder);
- if (pIShellFolder.is())
- {
- pIShellFolder->ParseDisplayName(
- NULL,
- NULL,
- reinterpret_cast<LPOLESTR>(const_cast< sal_Unicode* >( aDirectory.getStr( ) )),
- NULL,
- &lpItemIdList,
- NULL );
- }
+ if (pIShellFolder.is())
+ {
+ pIShellFolder->ParseDisplayName(
+ NULL,
+ NULL,
+ reinterpret_cast<LPWSTR>(const_cast< sal_Unicode* >( aDirectory.getStr( ) )),
+ NULL,
+ &lpItemIdList,
+ NULL );
}
- if (pIMalloc.is())
- pIMalloc->Free(lpItemIdList);
-
- lpItemIdList = NULL;
-
return lpItemIdList;
}
diff --git a/fpicker/source/win32/misc/WinImplHelper.cxx b/fpicker/source/win32/misc/WinImplHelper.cxx
index fe14d9567b..8d41da1fb1 100644
--- a/fpicker/source/win32/misc/WinImplHelper.cxx
+++ b/fpicker/source/win32/misc/WinImplHelper.cxx
@@ -69,6 +69,7 @@ const sal_Unicode AMPERSAND_SIGN = L'&';
// Windows 2000 VER_PLATFORM_WIN32_NT 5 0
// Windows XP VER_PLATFORM_WIN32_NT 5 1
// Windows Vista VER_PLATFORM_WIN32_NT 6 0
+// Windows 7 VER_PLATFORM_WIN32_NT 6 1
// Windows 95 VER_PLATFORM_WIN32_WINDOWS 4 0
// Windows 98 VER_PLATFORM_WIN32_WINDOWS 4 10
// Windows ME VER_PLATFORM_WIN32_WINDOWS 4 90
@@ -94,25 +95,47 @@ bool SAL_CALL IsWindowsVersion(unsigned int PlatformId, unsigned int MajorVersio
}
//------------------------------------------------------------
-// determine if we are running under Win2000
+// determine if we are running under Vista or newer OS
//------------------------------------------------------------
-bool SAL_CALL IsWindowsVista()
+bool SAL_CALL IsWindowsVistaOrNewer()
{
- return IsWindowsVersion(VER_PLATFORM_WIN32_NT, 6, 0);
+ OSVERSIONINFO osvi;
+ osvi.dwOSVersionInfoSize = sizeof(osvi);
+
+ if(!GetVersionEx(&osvi))
+ return false;
+
+ bool bRet = (VER_PLATFORM_WIN32_NT == osvi.dwPlatformId) &&
+ (osvi.dwMajorVersion >= 6);
+
+ bRet = bRet &&
+ (osvi.dwMinorVersion >=
+ sal::static_int_cast< unsigned int >(0));
+
+ return bRet;
}
//------------------------------------------------------------
-// determine if we are running under Win2000
+// determine if we are running under Windows 7
//------------------------------------------------------------
-bool SAL_CALL IsWindows2000()
+bool SAL_CALL IsWindows7()
{
- return IsWindowsVersion(VER_PLATFORM_WIN32_NT, 5, 0);
+ return IsWindowsVersion(VER_PLATFORM_WIN32_NT, 6, 1);
}
//------------------------------------------------------------
-//
+// determine if we are running under Windows Vista
+//------------------------------------------------------------
+
+bool SAL_CALL IsWindowsVista()
+{
+ return IsWindowsVersion(VER_PLATFORM_WIN32_NT, 6, 0);
+}
+
+//------------------------------------------------------------
+// determine if we are running under Windows XP
//------------------------------------------------------------
bool SAL_CALL IsWindowsXP()
@@ -121,6 +144,15 @@ bool SAL_CALL IsWindowsXP()
}
//------------------------------------------------------------
+// determine if we are running under Windows 2000
+//------------------------------------------------------------
+
+bool SAL_CALL IsWindows2000()
+{
+ return IsWindowsVersion(VER_PLATFORM_WIN32_NT, 5, 0);
+}
+
+//------------------------------------------------------------
//
//------------------------------------------------------------
diff --git a/fpicker/source/win32/misc/WinImplHelper.hxx b/fpicker/source/win32/misc/WinImplHelper.hxx
index e8b66bdb64..494cbd61e3 100644
--- a/fpicker/source/win32/misc/WinImplHelper.hxx
+++ b/fpicker/source/win32/misc/WinImplHelper.hxx
@@ -53,6 +53,8 @@
// deklarations
//------------------------------------------------------------------------
+bool SAL_CALL IsWindowsVistaOrNewer();
+bool SAL_CALL IsWindows7();
bool SAL_CALL IsWindowsVista();
bool SAL_CALL IsWindows2000();
bool SAL_CALL IsWindowsXP();
diff --git a/framework/inc/helper/mischelper.hxx b/framework/inc/helper/mischelper.hxx
new file mode 100644
index 0000000000..1d9df9caa4
--- /dev/null
+++ b/framework/inc/helper/mischelper.hxx
@@ -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: acceleratorinfo.hxx,v $
+ * $Revision: 1.6 $
+ *
+ * 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 __MISC_HELPER_HXX_
+#define __MISC_HELPER_HXX_
+
+#include <com/sun/star/linguistic2/XLanguageGuessing.hpp>
+
+#include <i18npool/lang.h>
+#include <svtools/languageoptions.hxx>
+
+namespace framework
+{
+
+inline bool IsScriptTypeMatchingToLanguage( sal_Int16 nScriptType, LanguageType nLang )
+{
+ return 0 != (nScriptType & SvtLanguageOptions::GetScriptTypeOfLanguage( nLang ));
+}
+
+
+class LanguageGuessingHelper
+{
+ mutable ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XLanguageGuessing > m_xLanguageGuesser;
+
+public:
+ LanguageGuessingHelper() {}
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XLanguageGuessing > GetGuesser() const;
+};
+
+} // namespace framework
+
+#endif // __MISC_HELPER_HXX_
+
diff --git a/framework/inc/uielement/langselectionmenucontroller.hxx b/framework/inc/uielement/langselectionmenucontroller.hxx
index 9e3449cc33..505706d489 100644
--- a/framework/inc/uielement/langselectionmenucontroller.hxx
+++ b/framework/inc/uielement/langselectionmenucontroller.hxx
@@ -58,6 +58,8 @@
#include <cppuhelper/weak.hxx>
#include <rtl/ustring.hxx>
+#include "helper/mischelper.hxx"
+
namespace framework
{
class LanguageSelectionMenuController : public PopupMenuControllerBase
@@ -97,7 +99,6 @@ namespace framework
};
sal_Bool m_bShowMenu;
- ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XLanguageGuessing > m_xLanguageGuesser;
::rtl::OUString m_aLangStatusCommandURL;
::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > m_xLanguageDispatch;
::rtl::OUString m_aMenuCommandURL_Lang;
@@ -111,6 +112,7 @@ namespace framework
sal_Int16 m_nScriptType;
::rtl::OUString m_aKeyboardLang;
::rtl::OUString m_aGuessedText;
+ LanguageGuessingHelper m_aLangGuessHelper;
void fillPopupMenu( com::sun::star::uno::Reference< com::sun::star::awt::XPopupMenu >& rPopupMenu, const Mode rMode );
};
diff --git a/framework/inc/uielement/langselectionstatusbarcontroller.hxx b/framework/inc/uielement/langselectionstatusbarcontroller.hxx
index 59b993f966..9cba647195 100644
--- a/framework/inc/uielement/langselectionstatusbarcontroller.hxx
+++ b/framework/inc/uielement/langselectionstatusbarcontroller.hxx
@@ -39,6 +39,8 @@
#include <com/sun/star/linguistic2/XLanguageGuessing.hpp>
#include <svtools/statusbarcontroller.hxx>
+#include "helper/mischelper.hxx"
+
// component helper namespace
namespace framework {
@@ -92,7 +94,7 @@ class LangSelectionStatusbarController : public svt::StatusbarController
::rtl::OUString m_aCurLang;
::rtl::OUString m_aKeyboardLang;
::rtl::OUString m_aGuessedText;
- ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XLanguageGuessing > m_xLanguageGuesser;
+ LanguageGuessingHelper m_aLangGuessHelper;
void LangMenu() throw (::com::sun::star::uno::RuntimeException);
};
diff --git a/framework/source/classes/fwktabwindow.cxx b/framework/source/classes/fwktabwindow.cxx
index a294edf2bc..8628744fbc 100644
--- a/framework/source/classes/fwktabwindow.cxx
+++ b/framework/source/classes/fwktabwindow.cxx
@@ -40,6 +40,7 @@
#include <com/sun/star/awt/XContainerWindowProvider.hpp>
#include <com/sun/star/awt/XWindow.hpp>
#include <com/sun/star/awt/XWindowPeer.hpp>
+#include <com/sun/star/awt/XControl.hpp>
#include <com/sun/star/beans/NamedValue.hpp>
#include <com/sun/star/graphic/XGraphic.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -90,7 +91,7 @@ FwkTabPage::FwkTabPage(
const css::uno::Reference< css::awt::XContainerWindowEventHandler >& rEventHdl,
const css::uno::Reference< css::awt::XContainerWindowProvider >& rProvider ) :
- TabPage( pParent, WB_DIALOGCONTROL ),
+ TabPage( pParent, WB_DIALOGCONTROL | WB_TABSTOP | WB_CHILDDLGCTRL ),
m_sPageURL ( rPageURL ),
m_xEventHdl ( rEventHdl ),
@@ -122,6 +123,18 @@ void FwkTabPage::CreateDialog()
m_xWinProvider->createContainerWindow(
m_sPageURL, rtl::OUString(), xParent, xHandler ), uno::UNO_QUERY );
+ uno::Reference< awt::XControl > xPageControl( m_xPage, uno::UNO_QUERY );
+ if ( xPageControl.is() )
+ {
+ uno::Reference< awt::XWindowPeer > xWinPeer( xPageControl->getPeer() );
+ if ( xWinPeer.is() )
+ {
+ Window* pWindow = VCLUnoHelper::GetWindow( xWinPeer );
+ if ( pWindow )
+ pWindow->SetStyle( pWindow->GetStyle() | WB_DIALOGCONTROL | WB_CHILDDLGCTRL );
+ }
+ }
+
CallMethod( INITIALIZE_METHOD );
}
catch ( lang::IllegalArgumentException& )
diff --git a/framework/source/helper/makefile.mk b/framework/source/helper/makefile.mk
index 29db41747e..7a2fc18168 100644
--- a/framework/source/helper/makefile.mk
+++ b/framework/source/helper/makefile.mk
@@ -66,7 +66,8 @@ SLOFILES= $(SLO)$/ocomponentaccess.obj \
$(SLO)$/configimporter.obj \
$(SLO)$/tagwindowasmodified.obj \
$(SLO)$/titlebarupdate.obj \
- $(SLO)$/titlehelper.obj
+ $(SLO)$/titlehelper.obj \
+ $(SLO)$/mischelper.obj
# --- Targets ------------------------------------------------------
diff --git a/framework/source/helper/mischelper.cxx b/framework/source/helper/mischelper.cxx
new file mode 100644
index 0000000000..395d592592
--- /dev/null
+++ b/framework/source/helper/mischelper.cxx
@@ -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: langselectionstatusbarcontroller.cxx,v $
+ * $Revision: 1.6.40.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.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_framework.hxx"
+
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+
+#include <tools/debug.hxx>
+#include <comphelper/processfactory.hxx>
+#include <helper/mischelper.hxx>
+
+
+using namespace ::com::sun::star;
+
+namespace framework
+{
+
+uno::Reference< linguistic2::XLanguageGuessing > LanguageGuessingHelper::GetGuesser() const
+{
+ if (!m_xLanguageGuesser.is())
+ {
+ try
+ {
+ uno::Reference< lang::XMultiServiceFactory > xMgr ( comphelper::getProcessServiceFactory() );
+ if (xMgr.is())
+ {
+ m_xLanguageGuesser = uno::Reference< linguistic2::XLanguageGuessing >(
+ xMgr->createInstance(
+ rtl::OUString::createFromAscii( "com.sun.star.linguistic2.LanguageGuessing" ) ),
+ uno::UNO_QUERY );
+ }
+ }
+ catch (uno::Exception &r)
+ {
+ (void) r;
+ DBG_ASSERT( 0, "failed to get language guessing component" );
+ }
+ }
+ return m_xLanguageGuesser;
+}
+
+} // namespace framework
+
diff --git a/framework/source/services/backingwindow.cxx b/framework/source/services/backingwindow.cxx
index 73fef9e21f..0917a0cd04 100644
--- a/framework/source/services/backingwindow.cxx
+++ b/framework/source/services/backingwindow.cxx
@@ -167,6 +167,10 @@ BackingWindow::BackingWindow( Window* i_pParent ) :
// clean up resource stack
FreeResource();
+ maWelcome.SetPaintTransparent( TRUE );
+ maProduct.SetPaintTransparent( TRUE );
+ EnableChildTransparentMode();
+
SetStyle( GetStyle() | WB_DIALOGCONTROL );
// add some breathing space for the images
@@ -279,9 +283,9 @@ void BackingWindow::initBackground()
}
maWelcome.SetControlForeground( maWelcomeTextColor );
- maWelcome.SetControlBackground( aTextBGColor );
+ maWelcome.SetBackground();
maProduct.SetControlForeground( maWelcomeTextColor );
- maProduct.SetControlBackground( aTextBGColor );
+ maProduct.SetBackground();
maCreateText.SetControlForeground( maLabelTextColor );
maCreateText.SetControlBackground( aTextBGColor );
maWriterText.SetControlForeground( maLabelTextColor );
diff --git a/framework/source/services/frame.cxx b/framework/source/services/frame.cxx
index 74728b4326..6b3231b2b9 100644
--- a/framework/source/services/frame.cxx
+++ b/framework/source/services/frame.cxx
@@ -350,6 +350,15 @@ css::uno::Reference< css::lang::XComponent > SAL_CALL Frame::loadComponentFromUR
css::lang::IllegalArgumentException ,
css::uno::RuntimeException )
{
+ {
+ // If the frame is closed the call might lead to crash even with target "_blank",
+ // so the DisposedException should be thrown in this case
+ // It still looks to be too dangerous to set the transaction for the whole loading process
+ // so the guard is used in scopes to let the standard check be used
+
+ TransactionGuard aTransaction( m_aTransactionManager, E_HARDEXCEPTIONS );
+ }
+
ReadGuard aReadLock(m_aLock);
css::uno::Reference< css::frame::XComponentLoader > xThis(static_cast< css::frame::XComponentLoader* >(this), css::uno::UNO_QUERY);
css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xFactory;
diff --git a/framework/source/uielement/langselectionmenucontroller.cxx b/framework/source/uielement/langselectionmenucontroller.cxx
index ca11f7a208..a18839ea03 100644
--- a/framework/source/uielement/langselectionmenucontroller.cxx
+++ b/framework/source/uielement/langselectionmenucontroller.cxx
@@ -79,6 +79,8 @@
#endif
#include <dispatch/uieventloghelper.hxx>
+#include "helper/mischelper.hxx"
+
//_________________________________________________________________________________________________________________
// Defines
//_________________________________________________________________________________________________________________
@@ -106,17 +108,6 @@ LanguageSelectionMenuController::LanguageSelectionMenuController( const ::com::s
PopupMenuControllerBase( xServiceManager ),
m_bShowMenu( sal_True )
{
- if (!m_xLanguageGuesser.is())
- {
- uno::Reference< lang::XMultiServiceFactory > xMgr ( comphelper::getProcessServiceFactory() );
- if (xMgr.is())
- {
- m_xLanguageGuesser = uno::Reference< linguistic2::XLanguageGuessing >(
- xMgr->createInstance(
- rtl::OUString::createFromAscii( "com.sun.star.linguistic2.LanguageGuessing" ) ),
- uno::UNO_QUERY );
- }
- }
}
LanguageSelectionMenuController::~LanguageSelectionMenuController()
@@ -301,12 +292,6 @@ void SAL_CALL LanguageSelectionMenuController::setPopupMenu( const Reference< cs
}
}
-//match ScriptType
-bool lcl_checkScriptType(sal_Int16 nScriptType,LanguageType nLang)
-{
- return 0 != (nScriptType & SvtLanguageOptions::GetScriptTypeOfLanguage( nLang ));
-}
-
void LanguageSelectionMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& rPopupMenu , const Mode eMode )
{
VCLXPopupMenu* pVCLPopupMenu = (VCLXPopupMenu *)VCLXMenu::GetImplementation( rPopupMenu );
@@ -358,7 +343,7 @@ void LanguageSelectionMenuController::fillPopupMenu( Reference< css::awt::XPopup
LanguageType rSystemLanguage = rAllSettings.GetLanguage();
if(rSystemLanguage!=LANGUAGE_DONTKNOW)
{
- if (lcl_checkScriptType(m_nScriptType,rSystemLanguage ))
+ if (IsScriptTypeMatchingToLanguage(m_nScriptType,rSystemLanguage ))
LangItems[::rtl::OUString(aLangTable.GetString(rSystemLanguage))]=::rtl::OUString(aLangTable.GetString(rSystemLanguage));
}
@@ -366,24 +351,25 @@ void LanguageSelectionMenuController::fillPopupMenu( Reference< css::awt::XPopup
LanguageType rUILanguage = rAllSettings.GetUILanguage();
if(rUILanguage!=LANGUAGE_DONTKNOW)
{
- if (lcl_checkScriptType(m_nScriptType, rUILanguage ))
+ if (IsScriptTypeMatchingToLanguage(m_nScriptType, rUILanguage ))
LangItems[::rtl::OUString(aLangTable.GetString(rUILanguage))]=::rtl::OUString(aLangTable.GetString(rUILanguage));
}
//4--guessed language
- if (m_xLanguageGuesser.is() && m_aGuessedText.getLength() > 0)
+ uno::Reference< linguistic2::XLanguageGuessing > xLangGuesser( m_aLangGuessHelper.GetGuesser() );
+ if (xLangGuesser.is() && m_aGuessedText.getLength() > 0)
{
- ::com::sun::star::lang::Locale aLocale(m_xLanguageGuesser->guessPrimaryLanguage( m_aGuessedText, 0, m_aGuessedText.getLength()) );
+ ::com::sun::star::lang::Locale aLocale(xLangGuesser->guessPrimaryLanguage( m_aGuessedText, 0, m_aGuessedText.getLength()) );
LanguageType nLang = MsLangId::convertLocaleToLanguageWithFallback( aLocale );
- if ((nLang != LANGUAGE_DONTKNOW) && (nLang != LANGUAGE_NONE) && (nLang != LANGUAGE_SYSTEM)
- && (lcl_checkScriptType( m_nScriptType, nLang )))
+ if (nLang != LANGUAGE_DONTKNOW && nLang != LANGUAGE_NONE && nLang != LANGUAGE_SYSTEM
+ && IsScriptTypeMatchingToLanguage( m_nScriptType, nLang ))
LangItems[aLangTable.GetString(nLang)]=aLangTable.GetString(nLang);
}
//5--keyboard language
if(m_aKeyboardLang!=::rtl::OUString::createFromAscii(""))
{
- if (lcl_checkScriptType(m_nScriptType, aLanguageTable.GetType(m_aKeyboardLang)))
+ if (IsScriptTypeMatchingToLanguage(m_nScriptType, aLanguageTable.GetType(m_aKeyboardLang)))
LangItems[m_aKeyboardLang] = m_aKeyboardLang;
}
@@ -417,7 +403,7 @@ void LanguageSelectionMenuController::fillPopupMenu( Reference< css::awt::XPopup
if (LangItems.size()==7)
break;
const Locale& rLocale=rLocales[i];
- if(lcl_checkScriptType(m_nScriptType, aLanguageTable.GetType(rLocale.Language)))
+ if(IsScriptTypeMatchingToLanguage(m_nScriptType, aLanguageTable.GetType(rLocale.Language)))
LangItems[::rtl::OUString(rLocale.Language)]=::rtl::OUString(rLocale.Language);
}
}
diff --git a/framework/source/uielement/langselectionstatusbarcontroller.cxx b/framework/source/uielement/langselectionstatusbarcontroller.cxx
index 041e92f986..b49f9bf16c 100644
--- a/framework/source/uielement/langselectionstatusbarcontroller.cxx
+++ b/framework/source/uielement/langselectionstatusbarcontroller.cxx
@@ -75,6 +75,8 @@
#include <com/sun/star/linguistic2/XLanguageGuessing.hpp>
#include <dispatch/uieventloghelper.hxx>
+#include "helper/mischelper.hxx"
+
using namespace ::cppu;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -99,17 +101,6 @@ LangSelectionStatusbarController::LangSelectionStatusbarController( const uno::R
m_bShowMenu( sal_True ),
m_nScriptType( 7 )
{
- if (!m_xLanguageGuesser.is())
- {
- uno::Reference< lang::XMultiServiceFactory > xMgr ( comphelper::getProcessServiceFactory() );
- if (xMgr.is())
- {
- m_xLanguageGuesser = uno::Reference< linguistic2::XLanguageGuessing >(
- xMgr->createInstance(
- rtl::OUString::createFromAscii( "com.sun.star.linguistic2.LanguageGuessing" ) ),
- uno::UNO_QUERY );
- }
- }
}
// XInterface
@@ -183,12 +174,6 @@ throw (::com::sun::star::uno::RuntimeException)
return sal_False;
}
-//match ScriptType
-bool checkScriptType( sal_Int16 nScriptType, LanguageType nLang )
-{
- return 0 != ( nScriptType & SvtLanguageOptions::GetScriptTypeOfLanguage( nLang ));
-}
-
void LangSelectionStatusbarController::LangMenu()throw (::com::sun::star::uno::RuntimeException)
{
if (!m_bShowMenu)
@@ -215,7 +200,7 @@ void LangSelectionStatusbarController::LangMenu()throw (::com::sun::star::uno::R
LanguageType rSystemLanguage = rAllSettings.GetLanguage();
if( rSystemLanguage != LANGUAGE_DONTKNOW )
{
- if ( checkScriptType( m_nScriptType, rSystemLanguage ))
+ if ( IsScriptTypeMatchingToLanguage( m_nScriptType, rSystemLanguage ))
LangItems.insert( ::rtl::OUString( aLangTable.GetString( rSystemLanguage )) );
}
@@ -223,24 +208,25 @@ void LangSelectionStatusbarController::LangMenu()throw (::com::sun::star::uno::R
LanguageType rUILanguage = rAllSettings.GetUILanguage();
if( rUILanguage != LANGUAGE_DONTKNOW )
{
- if ( checkScriptType( m_nScriptType, rUILanguage ))
+ if ( IsScriptTypeMatchingToLanguage( m_nScriptType, rUILanguage ))
LangItems.insert( ::rtl::OUString( aLangTable.GetString( rUILanguage )) );
}
//4--guessed language
- if ( m_xLanguageGuesser.is() && m_aGuessedText.getLength() > 0)
+ uno::Reference< linguistic2::XLanguageGuessing > xLangGuesser( m_aLangGuessHelper.GetGuesser() );
+ if ( xLangGuesser.is() && m_aGuessedText.getLength() > 0)
{
- ::com::sun::star::lang::Locale aLocale(m_xLanguageGuesser->guessPrimaryLanguage( m_aGuessedText, 0, m_aGuessedText.getLength()) );
+ ::com::sun::star::lang::Locale aLocale(xLangGuesser->guessPrimaryLanguage( m_aGuessedText, 0, m_aGuessedText.getLength()) );
LanguageType nLang = MsLangId::convertLocaleToLanguageWithFallback( aLocale );
- if (( nLang != LANGUAGE_DONTKNOW ) && ( nLang != LANGUAGE_NONE ) && (nLang != LANGUAGE_SYSTEM)
- && ( checkScriptType( m_nScriptType, nLang )))
+ if (nLang != LANGUAGE_DONTKNOW && nLang != LANGUAGE_NONE && nLang != LANGUAGE_SYSTEM
+ && IsScriptTypeMatchingToLanguage( m_nScriptType, nLang ))
LangItems.insert( aLangTable.GetString( nLang ));
}
//5--keyboard language
if( m_aKeyboardLang != ::rtl::OUString::createFromAscii( "" ))
{
- if ( checkScriptType( m_nScriptType, aLanguageTable.GetType( m_aKeyboardLang )))
+ if ( IsScriptTypeMatchingToLanguage( m_nScriptType, aLanguageTable.GetType( m_aKeyboardLang )))
LangItems.insert( m_aKeyboardLang );
}
@@ -274,7 +260,7 @@ void LangSelectionStatusbarController::LangMenu()throw (::com::sun::star::uno::R
if ( LangItems.size() == 7 )
break;
const Locale& rLocale=rLocales[i];
- if( checkScriptType( m_nScriptType, aLangTable.GetType( rLocale.Language )))
+ if( IsScriptTypeMatchingToLanguage( m_nScriptType, aLangTable.GetType( rLocale.Language )))
LangItems.insert( ::rtl::OUString( rLocale.Language ) );
}
}
diff --git a/framework/source/uielement/togglebuttontoolbarcontroller.cxx b/framework/source/uielement/togglebuttontoolbarcontroller.cxx
index 7757a0e30b..d8a1682499 100644
--- a/framework/source/uielement/togglebuttontoolbarcontroller.cxx
+++ b/framework/source/uielement/togglebuttontoolbarcontroller.cxx
@@ -246,7 +246,6 @@ void ToggleButtonToolbarController::executeControlCommand( const ::com::sun::sta
< m_aDropdownMenuList.size() ) )
{
m_aCurrentSelection = m_aDropdownMenuList[nPos];
- m_pToolbar->SetItemText( m_nID, m_aCurrentSelection );
// send notification
uno::Sequence< beans::NamedValue > aInfo( 1 );
@@ -353,7 +352,6 @@ IMPL_LINK( ToggleButtonToolbarController, MenuSelectHdl, Menu *, pMenu )
if ( nItemId > 0 && nItemId <= m_aDropdownMenuList.size() )
{
m_aCurrentSelection = m_aDropdownMenuList[nItemId-1];
- m_pToolbar->SetItemText( m_nID, m_aCurrentSelection );
execute( 0 );
}
diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx
index b5c1dd8273..d6d9ff3c76 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -336,11 +336,21 @@ void ToolBarManager::Destroy()
delete static_cast< AddonsParams* >( m_pToolBar->GetItemData( nItemId ));
}
- /* #i99167# removed change for i93173 since there is some weird crash
+ /* #i99167# removed change for i93173 since there is some weird crash */
// #i93173# delete toolbar lazily as we can still be in one of its handlers
m_pToolBar->doLazyDelete();
- */
- delete m_pToolBar;
+
+ Link aEmpty;
+ m_pToolBar->SetSelectHdl( aEmpty );
+ m_pToolBar->SetActivateHdl( aEmpty );
+ m_pToolBar->SetDeactivateHdl( aEmpty );
+ m_pToolBar->SetClickHdl( aEmpty );
+ m_pToolBar->SetDropdownClickHdl( aEmpty );
+ m_pToolBar->SetDoubleClickHdl( aEmpty );
+ m_pToolBar->SetStateChangedHdl( aEmpty );
+ m_pToolBar->SetDataChangedHdl( aEmpty );
+
+// delete m_pToolBar;
m_pToolBar = 0;
}
diff --git a/framework/util/makefile.mk b/framework/util/makefile.mk
index cb788809b0..94409ace99 100644
--- a/framework/util/makefile.mk
+++ b/framework/util/makefile.mk
@@ -272,6 +272,7 @@ SHL4OBJS= \
$(SLO)$/menubarwrapper.obj \
$(SLO)$/menudispatcher.obj \
$(SLO)$/menumanager.obj \
+ $(SLO)$/mischelper.obj \
$(SLO)$/moduleacceleratorconfiguration.obj \
$(SLO)$/moduleimagemanager.obj \
$(SLO)$/modulemanager.obj \
diff --git a/linguistic/source/gciterator.cxx b/linguistic/source/gciterator.cxx
index 4f555aeef8..94caf22eec 100644
--- a/linguistic/source/gciterator.cxx
+++ b/linguistic/source/gciterator.cxx
@@ -191,7 +191,7 @@ static sal_Int32 lcl_SkipWhiteSpaces( const OUString &rText, sal_Int32 nStartPos
static sal_Int32 lcl_BacktraceWhiteSpaces( const OUString &rText, sal_Int32 nStartPos )
{
- // note having nStartPos point right behind the string is OK since that one
+ // note: having nStartPos point right behind the string is OK since that one
// is a correct end-of-sentence position to be returned from a grammar checker...
const sal_Int32 nLen = rText.getLength();
@@ -215,14 +215,16 @@ static sal_Int32 lcl_BacktraceWhiteSpaces( const OUString &rText, sal_Int32 nSta
sal_Int32 nPosBefore = nStartPos - 1;
const sal_Unicode *pStart = rText.getStr();
if (0 <= nPosBefore && nPosBefore < nLen && lcl_IsWhiteSpace( pStart[ nPosBefore ] ))
- nStartPos = nPosBefore;
- if (0 <= nStartPos && nStartPos < nLen)
{
- const sal_Unicode *pText = rText.getStr() + nStartPos;
- while (pText > pStart && lcl_IsWhiteSpace( *pText ))
- --pText;
- // now add 1 since we wnat to point to the first char after the last char in the sentence...
- nRes = pText - pStart + 1;
+ nStartPos = nPosBefore;
+ if (0 <= nStartPos && nStartPos < nLen)
+ {
+ const sal_Unicode *pText = rText.getStr() + nStartPos;
+ while (pText > pStart && lcl_IsWhiteSpace( *pText ))
+ --pText;
+ // now add 1 since we want to point to the first char after the last char in the sentence...
+ nRes = pText - pStart + 1;
+ }
}
DBG_ASSERT( 0 <= nRes && nRes <= nLen, "lcl_BacktraceWhiteSpaces return value out of range" );
@@ -577,6 +579,7 @@ void GrammarCheckingIterator::DequeueAndCheck()
sal_Int32 nStartPos = aFPEntryItem.m_nStartIndex;
sal_Int32 nSuggestedEnd = GetSuggestedEndOfSentence( aCurTxt, nStartPos, aCurLocale );
+ DBG_ASSERT( nSuggestedEnd > nStartPos, "nSuggestedEndOfSentencePos calculation failed?" );
linguistic2::ProofreadingResult aRes;
@@ -586,6 +589,15 @@ void GrammarCheckingIterator::DequeueAndCheck()
aGuard.clear();
uno::Sequence< beans::PropertyValue > aEmptyProps;
aRes = xGC->doProofreading( aCurDocId, aCurTxt, aCurLocale, nStartPos, nSuggestedEnd, aEmptyProps );
+
+ //!! work-around to prevent looping if the grammar checker
+ //!! failed to properly identify the sentence end
+ if (aRes.nBehindEndOfSentencePosition <= nStartPos)
+ {
+ DBG_ASSERT( 0, "!! Grammarchecker failed to provide end of sentence !!" );
+ aRes.nBehindEndOfSentencePosition = nSuggestedEnd;
+ }
+
aRes.xFlatParagraph = xFlatPara;
aRes.nStartOfSentencePosition = nStartPos;
}
@@ -718,6 +730,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
::osl::ClearableGuard< ::osl::Mutex > aGuard( MyMutex::get() );
aDocId = GetOrCreateDocId( xComponent );
nSuggestedEndOfSentencePos = GetSuggestedEndOfSentence( rText, nStartPos, aCurLocale );
+ DBG_ASSERT( nSuggestedEndOfSentencePos > nStartPos, "nSuggestedEndOfSentencePos calculation failed?" );
xGC = GetGrammarChecker( aCurLocale );
}
@@ -727,6 +740,15 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
{
uno::Sequence< beans::PropertyValue > aEmptyProps;
aTmpRes = xGC->doProofreading( aDocId, rText, aCurLocale, nStartPos, nSuggestedEndOfSentencePos, aEmptyProps );
+
+ //!! work-around to prevent looping if the grammar checker
+ //!! failed to properly identify the sentence end
+ if (aTmpRes.nBehindEndOfSentencePosition <= nStartPos)
+ {
+ DBG_ASSERT( 0, "!! Grammarchecker failed to provide end of sentence !!" );
+ aTmpRes.nBehindEndOfSentencePosition = nSuggestedEndOfSentencePos;
+ }
+
aTmpRes.xFlatParagraph = xFlatPara;
aTmpRes.nStartOfSentencePosition = nStartPos;
nEndPos = aTmpRes.nBehindEndOfSentencePosition;
diff --git a/officecfg/prj/build.lst b/officecfg/prj/build.lst
index b128b44751..dba837c643 100644
--- a/officecfg/prj/build.lst
+++ b/officecfg/prj/build.lst
@@ -1,17 +1,18 @@
oc officecfg : l10n soltools solenv LIBXSLT:libxslt NULL
-oc officecfg usr30073 - none NULL
-oc officecfg usr1 - all oc_mkout NULL
-oc officecfg\registry\schema nmake - all oc_reg_schema NULL
-oc officecfg\registry nmake - all oc_reg NULL
-oc officecfg\registry\schema\org\openoffice nmake - all oc_reg_schema_ooo NULL
-oc officecfg\registry\schema\org\openoffice\Office nmake - all oc_reg_schema_ooo_office NULL
-oc officecfg\registry\schema\org\openoffice\Office\UI nmake - all oc_reg_schema_ooo_office_ui NULL
-oc officecfg\registry\schema\org\openoffice\Office\OOoImprovement nmake - all oc_reg_schema_ooo_office_oooimprovement NULL
-oc officecfg\registry\schema\org\openoffice\TypeDetection nmake - all oc_reg_schema_ooo_td NULL
-oc officecfg\registry\schema\org\openoffice\ucb nmake - all oc_reg_schema_ooo_ucb NULL
-oc officecfg\registry\data\org\openoffice nmake - all oc_reg_data_ooo oc_reg NULL
-oc officecfg\registry\data\org\openoffice\Office nmake - all oc_reg_data_ooo_office oc_reg NULL
-oc officecfg\registry\data\org\openoffice\Office\UI nmake - all oc_reg_data_ooo_office_ui oc_reg NULL
-oc officecfg\registry\data\org\openoffice\TypeDetection nmake - all oc_reg_data_ooo_td oc_reg NULL
-oc officecfg\registry\data\org\openoffice\ucb nmake - all oc_reg_data_ooo_ucb oc_reg NULL
-oc officecfg\util nmake - all oc_util oc_reg_schema oc_reg_schema_ooo oc_reg_schema_ooo_office oc_reg_schema_ooo_office_ui oc_reg_schema_ooo_office_oooimprovement oc_reg_schema_ooo_td oc_reg_schema_ooo_ucb oc_reg_data_ooo oc_reg_data_ooo_office oc_reg_data_ooo_office_ui oc_reg_data_ooo_td oc_reg_data_ooo_ucb NULL
+oc officecfg usr30073 - none NULL
+oc officecfg usr1 - all oc_mkout NULL
+oc officecfg\registry\schema nmake - all oc_reg_schema NULL
+oc officecfg\registry nmake - all oc_reg NULL
+oc officecfg\registry\schema\org\openoffice nmake - all oc_reg_schema_ooo NULL
+oc officecfg\registry\schema\org\openoffice\Office nmake - all oc_reg_schema_ooo_office NULL
+oc officecfg\registry\schema\org\openoffice\Office\UI nmake - all oc_reg_schema_ooo_office_ui NULL
+oc officecfg\registry\schema\org\openoffice\Office\DataAccess nmake - all oc_reg_schema_ooo_office_dataaccess NULL
+oc officecfg\registry\schema\org\openoffice\Office\OOoImprovement nmake - all oc_reg_schema_ooo_office_oooimprovement NULL
+oc officecfg\registry\schema\org\openoffice\TypeDetection nmake - all oc_reg_schema_ooo_td NULL
+oc officecfg\registry\schema\org\openoffice\ucb nmake - all oc_reg_schema_ooo_ucb NULL
+oc officecfg\registry\data\org\openoffice nmake - all oc_reg_data_ooo oc_reg NULL
+oc officecfg\registry\data\org\openoffice\Office nmake - all oc_reg_data_ooo_office oc_reg NULL
+oc officecfg\registry\data\org\openoffice\Office\UI nmake - all oc_reg_data_ooo_office_ui oc_reg NULL
+oc officecfg\registry\data\org\openoffice\TypeDetection nmake - all oc_reg_data_ooo_td oc_reg NULL
+oc officecfg\registry\data\org\openoffice\ucb nmake - all oc_reg_data_ooo_ucb oc_reg NULL
+oc officecfg\util nmake - all oc_util oc_reg_schema oc_reg_schema_ooo oc_reg_schema_ooo_office oc_reg_schema_ooo_office_ui oc_reg_schema_ooo_office_dataaccess oc_reg_schema_ooo_office_oooimprovement oc_reg_schema_ooo_td oc_reg_schema_ooo_ucb oc_reg_data_ooo oc_reg_data_ooo_office oc_reg_data_ooo_office_ui oc_reg_data_ooo_td oc_reg_data_ooo_ucb NULL
diff --git a/officecfg/prj/d.lst b/officecfg/prj/d.lst
index d36f186606..66ba41abd6 100644
--- a/officecfg/prj/d.lst
+++ b/officecfg/prj/d.lst
@@ -4,6 +4,7 @@ mkdir: %_DEST%\xml%_EXT%\registry\schema\org
mkdir: %_DEST%\xml%_EXT%\registry\schema\org\openoffice
mkdir: %_DEST%\xml%_EXT%\registry\schema\org\openoffice\Office
mkdir: %_DEST%\xml%_EXT%\registry\schema\org\openoffice\Office\UI
+mkdir: %_DEST%\xml%_EXT%\registry\schema\org\openoffice\Office\DataAccess
mkdir: %_DEST%\xml%_EXT%\registry\schema\org\openoffice\Office\OOoImprovement
mkdir: %_DEST%\xml%_EXT%\registry\schema\org\openoffice\ucb
mkdir: %_DEST%\xml%_EXT%\registry\schema\org\openoffice\TypeDetection
@@ -11,6 +12,7 @@ mkdir: %_DEST%\xml%_EXT%\registry\schema\org\openoffice\TypeDetection
..\%__SRC%\misc\registry\schema\org\openoffice\*.xcs %_DEST%\xml%_EXT%\registry\schema\org\openoffice
..\%__SRC%\misc\registry\schema\org\openoffice\Office\*.xcs %_DEST%\xml%_EXT%\registry\schema\org\openoffice\Office
..\%__SRC%\misc\registry\schema\org\openoffice\Office\UI\*.xcs %_DEST%\xml%_EXT%\registry\schema\org\openoffice\Office\UI
+..\%__SRC%\misc\registry\schema\org\openoffice\Office\DataAccess\*.xcs %_DEST%\xml%_EXT%\registry\schema\org\openoffice\Office\DataAccess
..\%__SRC%\misc\registry\schema\org\openoffice\Office\OOoImprovement\*.xcs %_DEST%\xml%_EXT%\registry\schema\org\openoffice\Office\OOoImprovement
..\%__SRC%\misc\registry\schema\org\openoffice\ucb\*.xcs %_DEST%\xml%_EXT%\registry\schema\org\openoffice\ucb
..\%__SRC%\misc\registry\schema\org\openoffice\TypeDetection\*.xcs %_DEST%\xml%_EXT%\registry\schema\org\openoffice\TypeDetection
@@ -20,6 +22,7 @@ mkdir: %_DEST%\xml%_EXT%\registry\data\org
mkdir: %_DEST%\xml%_EXT%\registry\data\org\openoffice
mkdir: %_DEST%\xml%_EXT%\registry\data\org\openoffice\Office
mkdir: %_DEST%\xml%_EXT%\registry\data\org\openoffice\Office\UI
+mkdir: %_DEST%\xml%_EXT%\registry\data\org\openoffice\Office\DataAccess
mkdir: %_DEST%\xml%_EXT%\registry\data\org\openoffice\Office\OOoImprovement
mkdir: %_DEST%\xml%_EXT%\registry\data\org\openoffice\ucb
mkdir: %_DEST%\xml%_EXT%\registry\data\org\openoffice\TypeDetection
@@ -32,6 +35,7 @@ mkdir: %_DEST%\xml%_EXT%\registry\data\org\openoffice\TypeDetection
..\%__SRC%\misc\registry\data\org\openoffice\*.xcu %_DEST%\xml%_EXT%\registry\data\org\openoffice
..\%__SRC%\misc\registry\data\org\openoffice\Office\*.xcu %_DEST%\xml%_EXT%\registry\data\org\openoffice\Office
..\%__SRC%\misc\registry\data\org\openoffice\Office\UI\*.xcu %_DEST%\xml%_EXT%\registry\data\org\openoffice\Office\UI
+..\%__SRC%\misc\registry\data\org\openoffice\Office\DataAccess\*.xcu %_DEST%\xml%_EXT%\registry\data\org\openoffice\Office\DataAccess
..\%__SRC%\misc\registry\data\org\openoffice\ucb\*.xcu %_DEST%\xml%_EXT%\registry\data\org\openoffice\ucb
..\%__SRC%\misc\registry\data\org\openoffice\TypeDetection\*.xcu %_DEST%\xml%_EXT%\registry\data\org\openoffice\TypeDetection
diff --git a/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu b/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu
index bec89fce02..6858c2a9ef 100644
--- a/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu
@@ -2852,6 +2852,11 @@
<value xml:lang="de">.uno:Underline</value>
</prop>
</node>
+ <node oor:name="V_SHIFT_MOD1_MOD2" oor:op="replace">
+ <prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
+ <value xml:lang="en-US">.uno:PasteUnformatted</value>
+ </prop>
+ </node>
<node oor:name="V_SHIFT_MOD1" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:PasteSpecial</value>
@@ -4683,6 +4688,11 @@
<value xml:lang="de">.uno:Underline</value>
</prop>
</node>
+ <node oor:name="V_SHIFT_MOD1_MOD2" oor:op="replace">
+ <prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
+ <value xml:lang="en-US">.uno:PasteUnformatted</value>
+ </prop>
+ </node>
<node oor:name="V_SHIFT_MOD1" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:PasteSpecial</value>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu
index 46abbb8aa3..104fb10683 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu
@@ -1925,7 +1925,12 @@
<value>1</value>
</prop>
</node>
- <node oor:name=".uno:InsertColumns" oor:op="replace">
+ <node oor:name=".uno:InsertRowDialog" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">~Rows...</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:InsertColumns" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="de">Spalte einfügen</value>
<value xml:lang="en-US">Insert Column</value>
@@ -1934,7 +1939,12 @@
<value>1</value>
</prop>
</node>
- <node oor:name=".uno:DeleteRows" oor:op="replace">
+ <node oor:name=".uno:InsertColumnDialog" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">~Columns...</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:DeleteRows" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="de">Zeile löschen</value>
<value xml:lang="en-US">Delete Row</value>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
index 9fd1976adc..55365975b7 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
@@ -1039,6 +1039,11 @@
<value>1</value>
</prop>
</node>
+ <node oor:name=".uno:PasteUnformatted" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Paste Unformatted Text</value>
+ </prop>
+ </node>
<node oor:name=".uno:PasteSpecial" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Paste ~Special...</value>
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index 52045f4f9e..e621853056 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -1184,6 +1184,42 @@ Dymamic border coloring means that when the mouse is hovered over a control, and
</info>
<value>45000</value>
</prop>
+ <prop oor:name="TransparentSelection" oor:type="xs:boolean">
+ <info>
+ <author>AW</author>
+ <desc>
+ This switch defines if the selections in the applications (text or cells) are visualized using
+ inverse (XOR) when set to false (the old selection method, also used when in HighContrast mode)
+ or a transparent overlay selection using the system's selection color.
+ </desc>
+ <label>This switch defines if for text/cell selections the old inverse or the new transparent selection is to be used.</label>
+ </info>
+ <value>true</value>
+ </prop>
+ <prop oor:name="TransparentSelectionPercent" oor:type="xs:short">
+ <info>
+ <author>AW</author>
+ <desc>
+ Specifies the degree of transparence to be used when transparent selection is used. The value is a percent
+ value. Since neither no transparence nor complete transparence makes sense, the value is limited to a range
+ of 10% - 90%. If the given value is outside this range, it is cropped to it.
+ </desc>
+ <label>Specifies the percent of transparence to use if transparent selection is used.</label>
+ </info>
+ <value>75</value>
+ </prop>
+ <prop oor:name="SelectionMaximumLuminancePercent" oor:type="xs:short">
+ <info>
+ <author>AW</author>
+ <desc>
+ Specifies the maximum allowed luminance the system's selection color may have. When the color
+ fetched from the system is brighter (luminacne is bigger), it will be scaled to a luminance
+ of exactly this given value.
+ </desc>
+ <label>Specifies the maximum allowed luminance for the system's selection color.</label>
+ </info>
+ <value>70</value>
+ </prop>
</group>
<group oor:name="AutoCorrect">
<info>
@@ -1455,6 +1491,18 @@ Dymamic border coloring means that when the mouse is hovered over a control, and
<author>MBA</author>
<desc>Contains the current and default path settings used by the Office.</desc>
</info>
+ <group oor:name="Info">
+ <info>
+ <author>CD</author>
+ <desc>Contains various properties information purpose only.</desc>
+ </info>
+ <prop oor:name="WorkPathChanged" oor:type="xs:boolean">
+ <info>
+ <desc>A flag which is set by the tools options dialog whenever a user changed the work path.</desc>
+ </info>
+ <value>true</value>
+ </prop>
+ </group>
<group oor:name="Current">
<info>
<author>MBA</author>
@@ -2334,6 +2382,13 @@ Dymamic border coloring means that when the mouse is hovered over a control, and
</info>
<value>true</value>
</prop>
+ <prop oor:name="ShowOfficeUpdateDialog" oor:type="xs:boolean">
+ <info>
+ <author>MAV</author>
+ <desc>Specifies whether the office update dialog should be shown in case the loaded document has newer ODF version than the maximal supported one.</desc>
+ </info>
+ <value>true</value>
+ </prop>
</group>
<group oor:name="Security">
<info>
diff --git a/officecfg/registry/schema/org/openoffice/Office/DataAccess/Drivers.xcs b/officecfg/registry/schema/org/openoffice/Office/DataAccess/Drivers.xcs
new file mode 100644
index 0000000000..d0b54e7149
--- /dev/null
+++ b/officecfg/registry/schema/org/openoffice/Office/DataAccess/Drivers.xcs
@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--***********************************************************************
+ *
+ * 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: DataAccess.xcs,v $
+ * $Revision: 1.43 $
+ *
+ * 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.
+ *
+ ************************************************************************ -->
+<!DOCTYPE oor:component-schema SYSTEM "../../../../../component-schema.dtd">
+<oor:component-schema xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" oor:name="Drivers" oor:package="org.openoffice.Office.DataAccess" xml:lang="en-US">
+ <info>
+ <desc>Contains the installed OpenOffice.org Base database drivers.</desc>
+ </info>
+ <templates>
+ <group oor:name="Property">
+ <info>
+ <desc>Describes a property of a driver.</desc>
+ </info>
+ <prop oor:name="Value" oor:type="oor:any" oor:localized="true">
+ <info>
+ <desc>Describes the value.</desc>
+ </info>
+ </prop>
+ </group>
+ <group oor:name="Feature">
+ <info>
+ <desc>Describes a feature a driver supports.</desc>
+ </info>
+ <prop oor:name="Value" oor:type="xs:boolean" oor:localized="true">
+ <info>
+ <desc>The feature value.</desc>
+ </info>
+ </prop>
+ </group>
+ <group oor:name="URLPattern">
+ <info>
+ <desc>Specifies a database driver.</desc>
+ </info>
+ <prop oor:name="ParentURLPattern" oor:type="xs:string">
+ <info>
+ <desc>Specifies the URL pattern of the parent which settings should be used if not present.</desc>
+ </info>
+ </prop>
+ <prop oor:name="Driver" oor:type="xs:string">
+ <info>
+ <desc>Specifies the factory name of the database driver.</desc>
+ </info>
+ </prop>
+ <prop oor:name="DriverTypeDisplayName" oor:type="xs:string" oor:localized="true">
+ <info>
+ <desc>Specifies the UI name of the database driver.</desc>
+ </info>
+ </prop>
+ <set oor:name="Properties" oor:node-type="Property">
+ <info>
+ <desc>Defines a list of all properties which are different from default.</desc>
+ </info>
+ </set>
+ <set oor:name="Features" oor:node-type="Feature">
+ <info>
+ <desc>Defines a list of all properties which are different from default.</desc>
+ </info>
+ </set>
+ <set oor:name="MetaData" oor:node-type="Property">
+ <info>
+ <desc>Defines a list of all meta data properties which the database application should supports.</desc>
+ </info>
+ </set>
+ </group>
+ </templates>
+ <component>
+ <set oor:name="Installed" oor:node-type="URLPattern">
+ <info>
+ <desc>Contains a list of URLs supported by installed database drivers.</desc>
+ </info>
+ </set>
+ </component>
+</oor:component-schema>
diff --git a/officecfg/registry/schema/org/openoffice/Office/DataAccess/makefile.mk b/officecfg/registry/schema/org/openoffice/Office/DataAccess/makefile.mk
new file mode 100644
index 0000000000..906bbe5108
--- /dev/null
+++ b/officecfg/registry/schema/org/openoffice/Office/DataAccess/makefile.mk
@@ -0,0 +1,46 @@
+#*************************************************************************
+#
+# 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.
+#
+#*************************************************************************
+PRJ=..$/..$/..$/..$/..$/..
+
+PRJNAME=officecfg
+TARGET=schema_ooODataAccess
+PACKAGE=org.openoffice.Office.DataAccess
+
+.INCLUDE : settings.mk
+.INCLUDE : $(PRJ)$/util$/makefile.pmk
+
+# --- Targets ------------------------------------------------------
+
+XCSFILES= \
+ Drivers.xcs
+
+.INCLUDE : target.mk
+
diff --git a/officecfg/registry/schema/org/openoffice/Office/ExtendedColorScheme.xcs b/officecfg/registry/schema/org/openoffice/Office/ExtendedColorScheme.xcs
index 4f44ec04de..7105c0be5d 100644
--- a/officecfg/registry/schema/org/openoffice/Office/ExtendedColorScheme.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/ExtendedColorScheme.xcs
@@ -64,7 +64,7 @@
<info>
<desc>Specifies the UI name for the color or group name of the component.</desc>
</info>
- <prop oor:name="DisplayName" oor:type="xs:string">
+ <prop oor:name="DisplayName" oor:type="xs:string" oor:localized="true">
<info>
<desc>Specifies the localized name that is used when presenting the entry to the user.</desc>
</info>
@@ -74,7 +74,7 @@
<info>
<desc>Specifies the ui strings for the component.</desc>
</info>
- <prop oor:name="DisplayName" oor:type="xs:string">
+ <prop oor:name="DisplayName" oor:type="xs:string" oor:localized="true">
<info>
<desc>Specifies the localized name that is used when presenting the entry to the user.</desc>
</info>
diff --git a/officecfg/registry/schema/org/openoffice/Setup.xcs b/officecfg/registry/schema/org/openoffice/Setup.xcs
index 7572879528..ad6b4d9ce4 100644
--- a/officecfg/registry/schema/org/openoffice/Setup.xcs
+++ b/officecfg/registry/schema/org/openoffice/Setup.xcs
@@ -352,6 +352,13 @@
</info>
<value>false</value>
</prop>
+ <prop oor:name="LastCompatibilityCheckID" oor:type="xs:string">
+ <info>
+ <author>DV</author>
+ <desc>The build ID of the office. On startup the office will compare this ID with the current build id to decide if the extensions dependencies need to be checked.</desc>
+ </info>
+ <value>not checked</value>
+ </prop>
<set oor:name="Factories" oor:node-type="Factory">
<info>
<author>AS</author>
diff --git a/readlicense_oo/docs/readme/readme.xrm b/readlicense_oo/docs/readme/readme.xrm
index b595911b2a..60c1267482 100755
--- a/readlicense_oo/docs/readme/readme.xrm
+++ b/readlicense_oo/docs/readme/readme.xrm
@@ -158,7 +158,34 @@
<Text id="DLLA3" xml:lang="en-US"></Text>
</Paragraph>
- <Paragraph id="StartupProblemsHeader" style="H3" os="all">
+ <Section id="BerkeleyDB">
+ <Paragraph id="BDB1" style="H2">
+ <Text id="BDB11" xml:lang="en-US">Extension Database Incompatibility</Text>
+ </Paragraph>
+ </Section>
+
+ <Paragraph id="BDB2">
+ <Text id="BDB2a" xml:lang="en-US">The Berkeley database engine has been upgraded in this version of ${PRODUCTNAME}. The database engine
+ upgrade introduces an incompatibility with user data for installed extensions for ${PRODUCTNAME} versions prior to 3.2 that may
+ require your action if you downgrade your version of ${PRODUCTNAME}.
+ </Text>
+ </Paragraph>
+
+ <Paragraph id="BDB3">
+ <Text id="BDB3a" xml:lang="en-US">This version of ${PRODUCTNAME} will convert your extension database to the new Berkeley
+ database format when extensions are installed or removed. After this conversion, the database can no longer be read
+ by earlier versions of ${PRODUCTNAME}. Downgrading to an earlier version may result in a dysfunctional installation.
+ </Text>
+ </Paragraph>
+
+ <Paragraph id="BDB4">
+ <Text id="BDB4a" xml:lang="en-US">If you downgrade to an earlier version of ${PRODUCTNAME}, you must remove the user
+ data directory {user data}/uno_packages, for example ~/.openoffice.org/3/user/uno_packages, and reinstall all extensions.
+ </Text>
+ </Paragraph>
+
+
+ <Paragraph id="StartupProblemsHeader" style="H2" os="all">
<Text id="naso" xml:lang="en-US">Problems During Program Startup</Text>
</Paragraph>
@@ -223,7 +250,7 @@
<Section id="Scroll">
- <Paragraph id="F1a" style="H3" gui="WNT">
+ <Paragraph id="F1a" style="H2" gui="WNT">
<Text id="naso" xml:lang="en-US">ALPS/Synaptics notebook touchpads in Windows</Text>
</Paragraph>
@@ -249,7 +276,7 @@
<Section id="NetscapeAdressBook">
- <Paragraph id="AdressBookHeader" style="H3" os="SOLARIS">
+ <Paragraph id="AdressBookHeader" style="H2" os="SOLARIS">
<Text id="sdfsd32asrc" xml:lang="en-US">Mozilla Address Book Driver</Text>
</Paragraph>
@@ -260,7 +287,7 @@
<Section id="Keyboard">
- <Paragraph id="abc2" style="H3">
+ <Paragraph id="abc2" style="H2">
<Text id="awe1" xml:lang="en-US">Shortcut Keys</Text>
</Paragraph>
@@ -308,7 +335,7 @@
<Section id="FileLocking">
- <Paragraph id="G1" style="H3" gui="UNX">
+ <Paragraph id="G1" style="H2" gui="UNX">
<Text id="gfh6w" xml:lang="en-US">File Locking</Text>
</Paragraph>
@@ -323,7 +350,7 @@
<Section id="Mapi">
- <Paragraph id="G1a" style="H3" gui="WNT">
+ <Paragraph id="G1a" style="H2" gui="WNT">
<Text id="gfh6w" xml:lang="en-US">Problems When Sending Documents as E-mails From ${PRODUCTNAME}</Text>
</Paragraph>
diff --git a/sfx2/inc/sfx2/DocumentMetadataAccess.hxx b/sfx2/inc/sfx2/DocumentMetadataAccess.hxx
new file mode 100644
index 0000000000..1f0d3d38e4
--- /dev/null
+++ b/sfx2/inc/sfx2/DocumentMetadataAccess.hxx
@@ -0,0 +1,218 @@
+/*************************************************************************
+ *
+ * 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: DocumentMetadataAccess.hxx,v $
+ * $Revision: 1.1.2.6 $
+ *
+ * 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 _SFX_DOCUMENTMETADATAACCESS_HXX_
+#define _SFX_DOCUMENTMETADATAACCESS_HXX_
+
+#include <sal/config.h>
+
+#include <sfx2/dllapi.h>
+
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/rdf/XDocumentMetadataAccess.hpp>
+#include <com/sun/star/rdf/XRepositorySupplier.hpp>
+
+#include <cppuhelper/implbase1.hxx>
+
+#include <boost/utility.hpp>
+
+#include <memory>
+
+
+/** Implementation of the interface com.sun.star.rdf.XDocumentMetadataAccess
+
+ This is not a service only because it needs some kind of XML ID registry
+ from the document, and i do not like defining an API for that.
+ Also, the implementation does _no_ locking, so make sure access is
+ protected externally.
+
+ @author mst
+ */
+
+namespace com { namespace sun { namespace star { namespace embed {
+ class XStorage;
+} } } }
+
+namespace sfx2 {
+
+
+/** create a base URI for loading metadata from an ODF (sub)document.
+
+ @param i_xContext component context
+ @param i_xStorage storage for the document; FileSystemStorage is allowed
+ @param i_rPkgURI the URI for the package
+ @param i_rSubDocument (optional) path of the subdocument in package
+
+ @return a base URI suitable for XDocumentMetadataAccess::loadFromStorage
+ */
+::com::sun::star::uno::Reference< ::com::sun::star::rdf::XURI> SFX2_DLLPUBLIC
+createBaseURI(
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>
+ const & i_xContext,
+ ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage>
+ const & i_xStorage,
+ ::rtl::OUString const & i_rPkgURI,
+ ::rtl::OUString const & i_rSubDocument = ::rtl::OUString());
+
+
+class IXmlIdRegistrySupplier;
+struct DocumentMetadataAccess_Impl;
+
+
+class SFX2_DLLPUBLIC DocumentMetadataAccess :
+ private boost::noncopyable,
+ public ::cppu::WeakImplHelper1<
+ ::com::sun::star::rdf::XDocumentMetadataAccess>
+{
+public:
+ explicit DocumentMetadataAccess(::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XComponentContext > const & i_xContext,
+ IXmlIdRegistrySupplier const & i_rRegistrySupplier,
+ ::rtl::OUString const & i_rBaseURI);
+ // N.B.: in contrast to previous, this constructor does _not_ initialize!
+ // caller must immediately call loadFromStorage/Medium!
+ explicit DocumentMetadataAccess(::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XComponentContext > const & i_xContext,
+ IXmlIdRegistrySupplier const & i_rRegistrySupplier);
+ virtual ~DocumentMetadataAccess();
+
+ // ::com::sun::star::rdf::XNode:
+ virtual ::rtl::OUString SAL_CALL getStringValue()
+ throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::rdf::XURI:
+ virtual ::rtl::OUString SAL_CALL getNamespace()
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getLocalName()
+ throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::rdf::XRepositorySupplier:
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::rdf::XRepository > SAL_CALL getRDFRepository()
+ throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::rdf::XDocumentMetadataAccess:
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::rdf::XMetadatable > SAL_CALL
+ getElementByMetadataReference(
+ const ::com::sun::star::beans::StringPair & i_rReference)
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::rdf::XMetadatable > SAL_CALL
+ getElementByURI(const ::com::sun::star::uno::Reference<
+ ::com::sun::star::rdf::XURI > & i_xURI)
+ throw (::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::lang::IllegalArgumentException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference<
+ ::com::sun::star::rdf::XURI > > SAL_CALL getMetadataGraphsWithType(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::rdf::XURI > & i_xType)
+ throw (::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::lang::IllegalArgumentException);
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::rdf::XURI> SAL_CALL
+ addMetadataFile(const ::rtl::OUString & i_rFileName,
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::uno::Reference< ::com::sun::star::rdf::XURI >
+ > & i_rTypes)
+ throw (::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::container::ElementExistException);
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::rdf::XURI> SAL_CALL
+ importMetadataFile(::sal_Int16 i_Format,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::io::XInputStream > & i_xInStream,
+ const ::rtl::OUString & i_rFileName,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::rdf::XURI > & i_xBaseURI,
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::uno::Reference< ::com::sun::star::rdf::XURI >
+ > & i_rTypes)
+ throw (::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::datatransfer::UnsupportedFlavorException,
+ ::com::sun::star::container::ElementExistException,
+ ::com::sun::star::rdf::ParseException,
+ ::com::sun::star::io::IOException);
+ virtual void SAL_CALL removeMetadataFile(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::rdf::XURI > & i_xGraphName)
+ throw (::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::container::NoSuchElementException);
+ virtual void SAL_CALL addContentOrStylesFile(
+ const ::rtl::OUString & i_rFileName)
+ throw (::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::container::ElementExistException);
+ virtual void SAL_CALL removeContentOrStylesFile(
+ const ::rtl::OUString & i_rFileName)
+ throw (::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::container::NoSuchElementException);
+
+ virtual void SAL_CALL loadMetadataFromStorage(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::embed::XStorage > & i_xStorage,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::rdf::XURI > & i_xBaseURI,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::task::XInteractionHandler> & i_xHandler)
+ throw (::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::lang::WrappedTargetException);
+ virtual void SAL_CALL storeMetadataToStorage(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::embed::XStorage > & i_xStorage)
+ throw (::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::lang::WrappedTargetException);
+ virtual void SAL_CALL loadMetadataFromMedium(
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::beans::PropertyValue > & i_rMedium)
+ throw (::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::lang::WrappedTargetException);
+ virtual void SAL_CALL storeMetadataToMedium(
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::beans::PropertyValue > & i_rMedium)
+ throw (::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::lang::WrappedTargetException);
+
+private:
+ std::auto_ptr<DocumentMetadataAccess_Impl> m_pImpl;
+};
+
+} // namespace sfx2
+
+#endif // _SFX_DOCUMENTMETADATAACCESS_HXX_
+
diff --git a/sfx2/inc/sfx2/Metadatable.hxx b/sfx2/inc/sfx2/Metadatable.hxx
new file mode 100644
index 0000000000..d96e6c030d
--- /dev/null
+++ b/sfx2/inc/sfx2/Metadatable.hxx
@@ -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: SwMetadatable.hxx,v $
+ * $Revision: 1.1.2.6 $
+ *
+ * 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 METADATABLE_HXX
+#define METADATABLE_HXX
+
+#include <sal/config.h>
+
+#include <sfx2/dllapi.h>
+
+#include <cppuhelper/implbase1.hxx>
+#include <com/sun/star/rdf/XMetadatable.hpp>
+
+#include <boost/utility.hpp>
+#include <boost/shared_ptr.hpp>
+
+
+namespace com { namespace sun { namespace star {
+ namespace frame { class XModel; }
+} } }
+
+namespace sfx2 {
+ class IXmlIdRegistry;
+}
+
+namespace sfx2 {
+
+class XmlIdRegistry;
+class MetadatableUndo;
+
+
+// XML ID handling ---------------------------------------------------
+
+
+/// create a sfx2::XmlIdRegistryDocument or a sfx2::XmlIdRegistryClipboard
+SFX2_DLLPUBLIC ::sfx2::IXmlIdRegistry *
+createXmlIdRegistry(const bool i_DocIsClipboard);
+
+
+/** base class for core objects that may have xml:id.
+
+ <p>The interface of this class consists of 3 parts:
+ <ul><li>implementations that are used by the <type>MetadatableMixin</type>
+ below</li>
+ <li>hooks to be called by the sw core whenever actions that are
+ relevant to the uniqueness of xml:ids are taken (copying,
+ splitting, merging, deletion, undo, etc.)</li>
+ <li>abstract methods that are called by the implementation of the
+ previous hooks</li></ul>
+ </p>
+ */
+class SFX2_DLLPUBLIC Metadatable : private boost::noncopyable
+{
+
+public:
+ Metadatable() : m_pReg(0) {}
+
+ // destructor calls RemoveMetadataReference
+ virtual ~Metadatable();
+
+ // for MetadatableMixin ----------------------------------------------
+
+ ::com::sun::star::beans::StringPair GetMetadataReference() const;
+ void SetMetadataReference(
+ const ::com::sun::star::beans::StringPair & i_rReference);
+ void EnsureMetadataReference();
+
+ // hooks -------------------------------------------------------------
+
+ // called from dtor!
+ void RemoveMetadataReference();
+
+ /** register this as a copy of i_rSource */
+ void RegisterAsCopyOf(Metadatable const & i_rSource,
+ const bool i_bCopyPrecedesSource = false);
+
+ /** create an Undo Metadatable, which remembers this' reference */
+ ::boost::shared_ptr<MetadatableUndo> CreateUndo(
+ const bool i_isDelete = false);
+
+ /** restore this from Undo Metadatable */
+ void RestoreMetadata(::boost::shared_ptr<MetadatableUndo> const& i_pUndo);
+
+ /** merge this and i_rOther into this */
+ void JoinMetadatable(Metadatable const & i_rOther,
+ const bool i_isMergedEmpty, const bool i_isOtherEmpty);
+
+ // abstract methods --------------------------------------------------
+
+ /** get the registry from the SwDoc */
+ virtual ::sfx2::IXmlIdRegistry& GetRegistry() = 0;
+
+ /** is this in a clipboard document? */
+ virtual bool IsInClipboard() const = 0;
+
+ /** is this in undo array? */
+ virtual bool IsInUndo() const = 0;
+
+ /** which stream is this in? true: content.xml; false: styles.xml */
+ virtual bool IsInContent() const = 0;
+
+ /** create XMetadatable from this.
+ note: if IsInUndo or IsInClipboard return true,
+ MakeUnoObject <em>must not</em> be called!
+ */
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::rdf::XMetadatable > MakeUnoObject() = 0;
+
+private:
+ friend class MetadatableClipboard;
+ friend class MetadatableUndo;
+
+ // note that Reg may be a XmlIdRegistryDocument or a XmlIdRegistryClipboard
+ XmlIdRegistry* m_pReg; // null => no XmlId
+};
+
+
+/** base class for UNO objects that implement <type>XMetadatable</type>.
+
+ <p>An instance of this base class is associated with an instance of
+ <type>Metadatable</type>.</p>
+ */
+class SFX2_DLLPUBLIC MetadatableMixin :
+ public ::cppu::WeakImplHelper1<
+ ::com::sun::star::rdf::XMetadatable>
+{
+
+public:
+ MetadatableMixin() {};
+
+ virtual ~MetadatableMixin() {}
+
+ // ::com::sun::star::rdf::XNode:
+ virtual ::rtl::OUString SAL_CALL getStringValue()
+ throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::rdf::XURI:
+ virtual ::rtl::OUString SAL_CALL getLocalName()
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getNamespace()
+ throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::rdf::XMetadatable:
+ virtual ::com::sun::star::beans::StringPair SAL_CALL getMetadataReference()
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setMetadataReference(
+ const ::com::sun::star::beans::StringPair & i_rReference)
+ throw (::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::lang::IllegalArgumentException);
+ virtual void SAL_CALL ensureMetadataReference()
+ throw (::com::sun::star::uno::RuntimeException);
+
+protected:
+ /// get the core object corresponding to this UNO object.
+ virtual Metadatable * GetCoreObject() = 0;
+ /// get the <type>XModel</type> for the document
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >
+ GetModel() = 0;
+
+};
+
+} // namespace sfx2
+
+#endif // METADATABLE_HXX
diff --git a/sfx2/inc/sfx2/XmlIdRegistry.hxx b/sfx2/inc/sfx2/XmlIdRegistry.hxx
new file mode 100644
index 0000000000..0ae6fbb751
--- /dev/null
+++ b/sfx2/inc/sfx2/XmlIdRegistry.hxx
@@ -0,0 +1,101 @@
+/*************************************************************************
+ *
+ * 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: XmlIdRegistry.hxx,v $
+ * $Revision: 1.1.2.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 _SFX_XMLIDREGISTRY_HXX_
+#define _SFX_XMLIDREGISTRY_HXX_
+
+#include <sal/config.h>
+
+#include <sfx2/dllapi.h>
+
+#include <com/sun/star/beans/StringPair.hpp>
+
+
+namespace com { namespace sun { namespace star { namespace rdf {
+ class XMetadatable;
+} } } }
+
+namespace sfx2 {
+
+// XML ID utilities --------------------------------------------------
+
+/** is i_rIdref a valid NCName ? */
+bool SFX2_DLLPUBLIC isValidNCName(::rtl::OUString const & i_rIdref);
+
+extern inline bool
+isValidXmlId(::rtl::OUString const & i_rStreamName,
+ ::rtl::OUString const & i_rIdref)
+{
+ return isValidNCName(i_rIdref) &&
+ (i_rStreamName.equalsAscii("content.xml") ||
+ i_rStreamName.equalsAscii("styles.xml"));
+}
+
+
+// XML ID handling ---------------------------------------------------
+
+/** interface for getElementByMetadataReference;
+ for use by sfx2::DocumentMetadataAccess
+ */
+class SFX2_DLLPUBLIC IXmlIdRegistry
+{
+
+public:
+ virtual ~IXmlIdRegistry() { }
+
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::rdf::XMetadatable > SAL_CALL
+ GetElementByMetadataReference(
+ const ::com::sun::star::beans::StringPair & i_rXmlId) const = 0;
+
+};
+
+/** supplier interface for the registry.
+
+ This indirection is unfortunately necessary, because the SwDocShell
+ is not always connected to a SwDoc, so we cannot guarantee that a
+ registry given to a SfxBaseModel/DocumentMetadataAccess remains valid;
+ it has to be retrieved from this supplier interface on access.
+ */
+class SFX2_DLLPUBLIC IXmlIdRegistrySupplier
+{
+
+public:
+ virtual ~IXmlIdRegistrySupplier() { }
+
+ /** override this if you have a XmlIdRegistry. */
+ virtual const IXmlIdRegistry* GetXmlIdRegistry() const { return 0; }
+
+};
+
+} // namespace sfx2
+
+#endif // _SFX_XMLIDREGISTRY_HXX_
+
diff --git a/sfx2/inc/sfx2/app.hxx b/sfx2/inc/sfx2/app.hxx
index 4968b7a9a3..39dde5cdc6 100644
--- a/sfx2/inc/sfx2/app.hxx
+++ b/sfx2/inc/sfx2/app.hxx
@@ -262,6 +262,7 @@ public:
BOOL bActivate,
BOOL bForbidVisible = FALSE,
const String* pPostStr = 0);
+ void ResetLastDir();
//#if 0 // _SOLAR__PRIVATE
SAL_DLLPRIVATE static SfxApplication* Is_Impl() { return pApp;}
diff --git a/sfx2/inc/sfx2/dinfdlg.hxx b/sfx2/inc/sfx2/dinfdlg.hxx
index 67fb4bcbb0..e33a3f89a9 100644
--- a/sfx2/inc/sfx2/dinfdlg.hxx
+++ b/sfx2/inc/sfx2/dinfdlg.hxx
@@ -50,9 +50,6 @@
#include "tabdlg.hxx"
namespace com { namespace sun { namespace star {
- namespace beans {
- class XPropertyContainer;
- }
namespace document {
class XDocumentProperties;
}
@@ -75,7 +72,7 @@ private:
::com::sun::star::util::DateTime m_CreationDate;
::rtl::OUString m_ModifiedBy;
::com::sun::star::util::DateTime m_ModificationDate;
- String m_PrintedBy;
+ ::rtl::OUString m_PrintedBy;
::com::sun::star::util::DateTime m_PrintDate;
sal_Int16 m_EditingCycles;
sal_Int32 m_EditingDuration;
@@ -83,11 +80,9 @@ private:
::rtl::OUString m_Keywords;
::rtl::OUString m_Subject;
::rtl::OUString m_Title;
- ::rtl::OUString m_UserDefinedFieldTitles[4];
- ::rtl::OUString m_UserDefinedFieldValues[4];
- sal_Bool bHasTemplate;
- sal_Bool bDeleteUserData;
- sal_Bool bIsUseUserData;
+ sal_Bool m_bHasTemplate;
+ sal_Bool m_bDeleteUserData;
+ sal_Bool m_bUseUserData;
std::vector< CustomProperty* > m_aCustomProperties;
public:
@@ -101,9 +96,10 @@ public:
virtual ~SfxDocumentInfoItem();
/// update i_xDocProps with the data in this object
- void updateDocumentInfo(
+ void UpdateDocumentInfo(
const ::com::sun::star::uno::Reference<
- ::com::sun::star::document::XDocumentProperties> & i_xDocProps)
+ ::com::sun::star::document::XDocumentProperties> & i_xDocProps,
+ bool i_bDoNotUpdateUserDefined = false)
const;
sal_Bool isAutoloadEnabled() const { return m_isAutoloadEnabled; }
@@ -151,25 +147,21 @@ public:
void setSubject(::rtl::OUString i_val) { m_Subject = i_val; }
::rtl::OUString getTitle() const { return m_Title; }
void setTitle(::rtl::OUString i_val) { m_Title = i_val; }
- ::rtl::OUString getUserDefinedFieldTitle(size_t i_ix) const;
- void setUserDefinedFieldTitle(size_t i_ix, ::rtl::OUString i_val);
- ::rtl::OUString getUserDefinedFieldValue(size_t i_ix) const;
- void setUserDefinedFieldValue(size_t i_ix, ::rtl::OUString i_val);
/// reset user-specific data (author, modified-by, ...)
void resetUserData(const ::rtl::OUString & i_rAuthor);
- void SetTemplate( BOOL b ) { bHasTemplate = b; }
- FASTBOOL HasTemplate() const { return bHasTemplate; }
- void SetDeleteUserData( BOOL bSet );
- void SetUseUserData( BOOL bSet );
- BOOL IsDeleteUserData() const;
- BOOL IsUseUserData() const;
+ void SetTemplate( sal_Bool b ) { m_bHasTemplate = b; }
+ sal_Bool HasTemplate() const { return m_bHasTemplate; }
+ void SetDeleteUserData( sal_Bool bSet );
+ void SetUseUserData( sal_Bool bSet );
+ sal_Bool IsDeleteUserData() const;
+ sal_Bool IsUseUserData() const;
std::vector< CustomProperty* > GetCustomProperties() const;
- void ClearCustomProperties();
- void AddCustomProperty( const ::rtl::OUString& sName,
- const com::sun::star::uno::Any& rValue );
+ void ClearCustomProperties();
+ void AddCustomProperty( const ::rtl::OUString& sName,
+ const com::sun::star::uno::Any& rValue );
virtual SfxPoolItem* Clone( SfxItemPool* pPool = NULL ) const;
virtual int operator==( const SfxPoolItem& ) const;
@@ -262,41 +254,6 @@ public:
static SfxTabPage* Create( Window* pParent, const SfxItemSet& );
};
-// class SfxDocumentUserPage ---------------------------------------------
-
-class SfxDocumentUserPage : public SfxTabPage
-{
-private:
- BOOL bLabelModified;
-
- FixedText aInfo1Ft;
- Edit aInfo1Ed;
- FixedText aInfo2Ft;
- Edit aInfo2Ed;
- FixedText aInfo3Ft;
- Edit aInfo3Ed;
- FixedText aInfo4Ft;
- Edit aInfo4Ed;
- PushButton aEditLabelBtn;
- SfxDocumentInfoItem* pInfoItem;
-
-#if _SOLAR__PRIVATE
- DECL_LINK( EditLabelHdl, PushButton * );
-
- String GetLabelText_Impl( FixedText* pLabel );
- void SetLabelText_Impl( FixedText* pLabel, const String& rNewLabel );
-#endif
-
-protected:
- SfxDocumentUserPage( Window* pParent, const SfxItemSet& );
-
- virtual BOOL FillItemSet( SfxItemSet& );
- virtual void Reset( const SfxItemSet& );
-
-public:
- static SfxTabPage* Create( Window* pParent, const SfxItemSet& );
-};
-
// class SfxInternetPage -------------------------------------------------
class TargetList;
diff --git a/sfx2/inc/sfx2/docfile.hxx b/sfx2/inc/sfx2/docfile.hxx
index feba3e0aef..c92891acd5 100644
--- a/sfx2/inc/sfx2/docfile.hxx
+++ b/sfx2/inc/sfx2/docfile.hxx
@@ -183,7 +183,8 @@ public:
#endif
void CheckFileDate( const ::com::sun::star::util::DateTime& aInitDate );
- ::com::sun::star::util::DateTime GetInitFileDate();
+ sal_Bool DocNeedsFileDateCheck();
+ ::com::sun::star::util::DateTime GetInitFileDate( sal_Bool bIgnoreOldValue );
::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContent > GetContent() const;
const String& GetPhysicalName() const;
diff --git a/sfx2/inc/sfx2/filedlghelper.hxx b/sfx2/inc/sfx2/filedlghelper.hxx
index cccf27acf5..ba4032bbb5 100644
--- a/sfx2/inc/sfx2/filedlghelper.hxx
+++ b/sfx2/inc/sfx2/filedlghelper.hxx
@@ -229,8 +229,16 @@ public:
void SetTitle( const String& rNewTitle );
String GetPath() const;
+ /** @deprected: Don't use this method to retrieve the selected files
+ There are file picker which can provide multiple selected file which belong
+ to different folders. As this method always provides the root folder for all selected
+ files this cannot work.
+ */
::com::sun::star::uno::Sequence< ::rtl::OUString > GetMPath() const;
-
+
+ /** Provides the selected files with full path information */
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > GetSelectedFiles() const;
+
void AddFilter( const String& rFilterName, const String& rExtension );
void SetCurrentFilter( const String& rFilter );
diff --git a/sfx2/inc/sfx2/msg.hxx b/sfx2/inc/sfx2/msg.hxx
index 08b445d05d..4dd824e2fd 100644
--- a/sfx2/inc/sfx2/msg.hxx
+++ b/sfx2/inc/sfx2/msg.hxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: msg.hxx,v $
- * $Revision: 1.4 $
+ * $Revision: 1.4.82.2 $
*
* This file is part of OpenOffice.org.
*
@@ -155,11 +155,17 @@ SFX_DECL_TYPE(5);
SFX_DECL_TYPE(6);
SFX_DECL_TYPE(7);
SFX_DECL_TYPE(8);
+SFX_DECL_TYPE(10); // for SfxDocInfoItem
SFX_DECL_TYPE(11);
+SFX_DECL_TYPE(13); // for SwAddPrinterItem, Sd...
SFX_DECL_TYPE(14);
-SFX_DECL_TYPE(17); // fuer SvxAddressItem, SvxSearchItem
-SFX_DECL_TYPE(18); // fuer SfxDocInfoItem
+SFX_DECL_TYPE(16); // for SwDocDisplayItem
+SFX_DECL_TYPE(17); // for SvxAddressItem
+SFX_DECL_TYPE(18); // for SvxSearchItem
+
+// all SfxTypes must be in this header
+#undef SFX_DECL_TYPE
#define SFX_SLOT_ARG( aShellClass, id, GroupId, ExecMethodPtr, StateMethodPtr, Flags, ItemClass, nArg0, nArgs, Name, Prop ) \
{ id, GroupId, id, Flags | Prop, \
diff --git a/sfx2/inc/sfx2/objsh.hxx b/sfx2/inc/sfx2/objsh.hxx
index b6d25edec8..3c2c0f2d7e 100644
--- a/sfx2/inc/sfx2/objsh.hxx
+++ b/sfx2/inc/sfx2/objsh.hxx
@@ -63,6 +63,7 @@
#include <sot/storage.hxx>
#include <rsc/rscsfx.hxx>
+#include <sfx2/XmlIdRegistry.hxx>
#include <sfx2/shell.hxx>
#include <comphelper/embeddedobjectcontainer.hxx>
#include <com/sun/star/frame/XModel.hpp>
@@ -207,11 +208,13 @@ enum SfxTitleQuery
class SfxToolBoxConfig;
struct TransferableObjectDescriptor;
-class SFX2_DLLPUBLIC SfxObjectShell: public SfxShell, virtual public SotObject, public ::comphelper::IEmbeddedHelper
+class SFX2_DLLPUBLIC SfxObjectShell :
+ public SfxShell, virtual public SotObject,
+ public ::comphelper::IEmbeddedHelper, public ::sfx2::IXmlIdRegistrySupplier
{
friend struct ModifyBlocker_Impl;
-public:
+private:
struct SfxObjectShell_Impl* pImp; // interne Daten
SfxMedium * pMedium; // Beschreibung der Datei bzw. des Storage, in dem sich das Objekt befindet
@@ -524,6 +527,7 @@ public:
//determine the position of the "Automatic" filter in the stylist
void SetAutoStyleFilterIndex(sal_uInt16 nSet);
+ sal_uInt16 GetAutoStyleFilterIndex();
virtual sal_Bool HasBasic() const;
BasicManager* GetBasicManager() const;
com::sun::star::uno::Reference< com::sun::star::script::XLibraryContainer >
diff --git a/sfx2/inc/sfx2/passwd.hxx b/sfx2/inc/sfx2/passwd.hxx
index 9125d57985..2cc5ba1133 100644
--- a/sfx2/inc/sfx2/passwd.hxx
+++ b/sfx2/inc/sfx2/passwd.hxx
@@ -81,6 +81,7 @@ public:
String GetConfirm() const { return maConfirmED.GetText(); }
void SetMinLen( USHORT Len );
+ void SetMaxLen( USHORT Len );
void SetEditHelpId( ULONG nId ) { maPasswordED.SetHelpId( nId ); }
void ShowExtras( USHORT nExtras ) { mnExtras = nExtras; }
diff --git a/sfx2/inc/sfx2/sfx.hrc b/sfx2/inc/sfx2/sfx.hrc
index b77545ac04..385a2d889c 100644
--- a/sfx2/inc/sfx2/sfx.hrc
+++ b/sfx2/inc/sfx2/sfx.hrc
@@ -367,14 +367,6 @@
#define MID_DOCINFO_KEYWORDS 0x17
#define MID_DOCINFO_SUBJECT 0x1b
#define MID_DOCINFO_TITLE 0x1d
-#define MID_DOCINFO_FIELD1TITLE 0x20
-#define MID_DOCINFO_FIELD2TITLE 0x21
-#define MID_DOCINFO_FIELD3TITLE 0x22
-#define MID_DOCINFO_FIELD4TITLE 0x23
-#define MID_DOCINFO_FIELD1 0x24
-#define MID_DOCINFO_FIELD2 0x25
-#define MID_DOCINFO_FIELD3 0x26
-#define MID_DOCINFO_FIELD4 0x27
#define MID_DOCINFO_AUTOLOADENABLED 0x2d
#define MID_DOCINFO_AUTOLOADURL 0x2e
#define MID_DOCINFO_AUTOLOADSECS 0x2f
diff --git a/sfx2/inc/sfx2/sfxbasemodel.hxx b/sfx2/inc/sfx2/sfxbasemodel.hxx
index 76fbe3abc2..175e8afb74 100644
--- a/sfx2/inc/sfx2/sfxbasemodel.hxx
+++ b/sfx2/inc/sfx2/sfxbasemodel.hxx
@@ -47,6 +47,9 @@
#include <com/sun/star/document/XDocumentInfo.hpp>
#include <com/sun/star/document/XDocumentInfoSupplier.hpp>
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
+
+#include <com/sun/star/rdf/XDocumentMetadataAccess.hpp>
+
#include <com/sun/star/document/XEventBroadcaster.hpp>
#include <com/sun/star/document/XEventListener.hpp>
#include <com/sun/star/document/XEventsSupplier.hpp>
@@ -79,13 +82,12 @@
#include <com/sun/star/uno/Reference.hxx>
#include <com/sun/star/uno/Any.hxx>
#include <cppuhelper/weak.hxx>
+#include <cppuhelper/basemutex.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <com/sun/star/script/XStarBasicAccess.hpp>
#include <osl/mutex.hxx>
-#ifndef _LINK_HXX_
#include <tools/link.hxx>
-#endif
#include <com/sun/star/document/XViewDataSupplier.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
@@ -93,9 +95,9 @@
#include <com/sun/star/task/XInteractionHandler.hpp>
//________________________________________________________________________________________________________
-#if ! defined(INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_28)
-#define INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_28
-#define COMPHELPER_IMPLBASE_INTERFACE_NUMBER 28
+#if ! defined(INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_29)
+#define INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_29
+#define COMPHELPER_IMPLBASE_INTERFACE_NUMBER 29
#include <comphelper/implbase_var.hxx>
#endif
@@ -204,11 +206,6 @@ struct IMPL_SfxBaseModel_DataContainer ; // impl. struct to hold member of clas
// class declarations
//________________________________________________________________________________________________________
-struct IMPL_SfxBaseModel_MutexContainer
-{
- MUTEX m_aMutex ;
-} ;
-
/**_______________________________________________________________________________________________________
@short -
@@ -217,7 +214,8 @@ struct IMPL_SfxBaseModel_MutexContainer
@implements XChild
XComponent
XDocumentInfoSupplier
- XDocumentPropertiesSupplier
+ document::XDocumentPropertiesSupplier
+ rdf::XDocumentMetadataAccess
XEventListener
XModel
XModifiable2
@@ -230,13 +228,14 @@ struct IMPL_SfxBaseModel_MutexContainer
XCloseable
XCloseBroadcaster
- @base IMPL_MutexContainer
+ @base cppu::BaseMutex
SfxListener
*/
-typedef ::comphelper::WeakImplHelper28 < XCHILD
+typedef ::comphelper::WeakImplHelper29 < XCHILD
, XDOCUMENTINFOSUPPLIER
, ::com::sun::star::document::XDocumentPropertiesSupplier
+ , ::com::sun::star::rdf::XDocumentMetadataAccess
, XEVENTBROADCASTER
, XEVENTLISTENER
, XEVENTSSUPPLIER
@@ -264,8 +263,8 @@ typedef ::comphelper::WeakImplHelper28 < XCHILD
, XUNTITLEDNUMBERS
> SfxBaseModel_Base;
-class SFX2_DLLPUBLIC SfxBaseModel : public SfxBaseModel_Base
- , public IMPL_SfxBaseModel_MutexContainer
+class SFX2_DLLPUBLIC SfxBaseModel : protected ::cppu::BaseMutex
+ , public SfxBaseModel_Base
, public SfxListener
{
@@ -731,22 +730,22 @@ public:
//____________________________________________________________________________________________________
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL getControllers()
throw (css::uno::RuntimeException);
-
+
virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getAvailableViewControllerNames()
throw (css::uno::RuntimeException);
-
+
virtual css::uno::Reference< css::frame::XController2 > SAL_CALL createDefaultViewController(const css::uno::Reference< css::frame::XFrame >& Frame )
throw (css::uno::RuntimeException ,
css::lang::IllegalArgumentException,
css::uno::Exception );
-
+
virtual css::uno::Reference< css::frame::XController2 > SAL_CALL createViewController(const ::rtl::OUString& ViewName ,
const css::uno::Sequence< css::beans::PropertyValue >& Arguments ,
const css::uno::Reference< css::frame::XFrame >& Frame )
throw (css::uno::RuntimeException ,
css::lang::IllegalArgumentException,
css::uno::Exception );
-
+
//____________________________________________________________________________________________________
// XModifiable2
//____________________________________________________________________________________________________
@@ -1249,46 +1248,154 @@ public:
// css.frame.XModule
virtual void SAL_CALL setIdentifier(const ::rtl::OUString& sIdentifier)
throw (css::uno::RuntimeException);
-
+
// css.frame.XModule
virtual ::rtl::OUString SAL_CALL getIdentifier()
throw (css::uno::RuntimeException);
-
+
// css.frame.XTitle
virtual ::rtl::OUString SAL_CALL getTitle()
throw (css::uno::RuntimeException);
-
+
// css.frame.XTitle
virtual void SAL_CALL setTitle( const ::rtl::OUString& sTitle )
- throw (css::uno::RuntimeException);
-
+ throw (css::uno::RuntimeException);
+
// css.frame.XTitleChangeBroadcaster
virtual void SAL_CALL addTitleChangeListener( const css::uno::Reference< css::frame::XTitleChangeListener >& xListener )
throw (css::uno::RuntimeException);
-
+
// css.frame.XTitleChangeBroadcaster
virtual void SAL_CALL removeTitleChangeListener( const css::uno::Reference< css::frame::XTitleChangeListener >& xListener )
throw (css::uno::RuntimeException);
-
+
// css.frame.XUntitledNumbers
virtual ::sal_Int32 SAL_CALL leaseNumber( const css::uno::Reference< css::uno::XInterface >& xComponent )
throw (css::lang::IllegalArgumentException,
css::uno::RuntimeException );
-
+
// css.frame.XUntitledNumbers
virtual void SAL_CALL releaseNumber( ::sal_Int32 nNumber )
throw (css::lang::IllegalArgumentException,
css::uno::RuntimeException );
-
+
// css.frame.XUntitledNumbers
virtual void SAL_CALL releaseNumberForComponent( const css::uno::Reference< css::uno::XInterface >& xComponent )
throw (css::lang::IllegalArgumentException,
css::uno::RuntimeException );
-
+
// css.frame.XUntitledNumbers
virtual ::rtl::OUString SAL_CALL getUntitledPrefix()
throw (css::uno::RuntimeException);
-
+
+ //____________________________________________________________________________________________________
+
+ // ::com::sun::star::rdf::XNode:
+ virtual ::rtl::OUString SAL_CALL getStringValue()
+ throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::rdf::XURI:
+ virtual ::rtl::OUString SAL_CALL getNamespace()
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getLocalName()
+ throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::rdf::XRepositorySupplier:
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::rdf::XRepository > SAL_CALL getRDFRepository()
+ throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::rdf::XDocumentMetadataAccess:
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::rdf::XMetadatable > SAL_CALL
+ getElementByMetadataReference(
+ const ::com::sun::star::beans::StringPair & i_rReference)
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::rdf::XMetadatable > SAL_CALL
+ getElementByURI(const ::com::sun::star::uno::Reference<
+ ::com::sun::star::rdf::XURI > & i_xURI)
+ throw (::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::lang::IllegalArgumentException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference<
+ ::com::sun::star::rdf::XURI > > SAL_CALL getMetadataGraphsWithType(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::rdf::XURI > & i_xType)
+ throw (::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::lang::IllegalArgumentException);
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::rdf::XURI> SAL_CALL
+ addMetadataFile(const ::rtl::OUString & i_rFileName,
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::uno::Reference< ::com::sun::star::rdf::XURI >
+ > & i_rTypes)
+ throw (::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::container::ElementExistException);
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::rdf::XURI> SAL_CALL
+ importMetadataFile(::sal_Int16 i_Format,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::io::XInputStream > & i_xInStream,
+ const ::rtl::OUString & i_rFileName,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::rdf::XURI > & i_xBaseURI,
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::uno::Reference< ::com::sun::star::rdf::XURI >
+ > & i_rTypes)
+ throw (::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::datatransfer::UnsupportedFlavorException,
+ ::com::sun::star::container::ElementExistException,
+ ::com::sun::star::rdf::ParseException,
+ ::com::sun::star::io::IOException);
+ virtual void SAL_CALL removeMetadataFile(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::rdf::XURI > & i_xGraphName)
+ throw (::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::container::NoSuchElementException);
+ virtual void SAL_CALL addContentOrStylesFile(
+ const ::rtl::OUString & i_rFileName)
+ throw (::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::container::ElementExistException);
+ virtual void SAL_CALL removeContentOrStylesFile(
+ const ::rtl::OUString & i_rFileName)
+ throw (::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::container::NoSuchElementException);
+
+ virtual void SAL_CALL loadMetadataFromStorage(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::embed::XStorage > & i_xStorage,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::rdf::XURI > & i_xBaseURI,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::task::XInteractionHandler> & i_xHandler)
+ throw (::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::lang::WrappedTargetException);
+ virtual void SAL_CALL storeMetadataToStorage(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::embed::XStorage > & i_xStorage)
+ throw (::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::lang::WrappedTargetException);
+ virtual void SAL_CALL loadMetadataFromMedium(
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::beans::PropertyValue > & i_rMedium)
+ throw (::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::lang::WrappedTargetException);
+ virtual void SAL_CALL storeMetadataToMedium(
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::beans::PropertyValue > & i_rMedium)
+ throw (::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::lang::WrappedTargetException);
+
+
//____________________________________________________________________________________________________
// SfxListener
//____________________________________________________________________________________________________
@@ -1370,6 +1477,7 @@ public:
/** returns true if someone added a XEventListener to this XEventBroadcaster */
sal_Bool hasEventListeners() const;
+
protected:
/* returns a unique id for the model that is valid as long as the document
@@ -1412,7 +1520,7 @@ private:
SAL_DLLPRIVATE css::uno::Reference< css::frame::XTitle > impl_getTitleHelper ();
SAL_DLLPRIVATE css::uno::Reference< css::frame::XUntitledNumbers > impl_getUntitledHelper ();
-
+
//________________________________________________________________________________________________________
// private variables and methods
//________________________________________________________________________________________________________
diff --git a/sfx2/inc/sfx2/sfxsids.hrc b/sfx2/inc/sfx2/sfxsids.hrc
index 3e95514dfb..6a937d2af9 100644
--- a/sfx2/inc/sfx2/sfxsids.hrc
+++ b/sfx2/inc/sfx2/sfxsids.hrc
@@ -143,6 +143,7 @@
#define SID_CURRENTTIME (SID_SFX_START + 311)
#define SID_CURRENTDATE (SID_SFX_START + 312)
#define SID_VERSION_VISIBLE (SID_SFX_START + 313)
+#define SID_PASTE_UNFORMATTED (SID_SFX_START + 314)
#define SID_PRINTER_NOTFOUND_WARN (SID_SFX_START + 320)
#define SID_PRINTER_USETHREAD (SID_SFX_START + 321)
#define SID_PRINTER_NAME (SID_SFX_START + 322)
diff --git a/sfx2/prj/build.lst b/sfx2/prj/build.lst
index fc6984c17a..89e618e8fc 100644
--- a/sfx2/prj/build.lst
+++ b/sfx2/prj/build.lst
@@ -1,4 +1,4 @@
-sf sfx2 : l10n idl basic xmlscript framework shell setup_native sax SYSTRAY_GTK:libegg NULL
+sf sfx2 : l10n idl basic xmlscript framework shell setup_native sax SYSTRAY_GTK:libegg LIBXML2:libxml2 NULL
sf sfx2 usr1 - all sf_mkout NULL
sf sfx2\inc nmake - all sf_inc NULL
sf sfx2\prj get - all sf_prj NULL
diff --git a/sfx2/prj/d.lst b/sfx2/prj/d.lst
index 03ae35e5c3..77acce9a7b 100644
--- a/sfx2/prj/d.lst
+++ b/sfx2/prj/d.lst
@@ -128,3 +128,6 @@ mkdir: %_DEST%\inc%_EXT%\sfx2
..\inc\sfx2\layout-tabdlg.hxx %_DEST%\inc%_EXT%\sfx2\layout-tabdlg.hxx
..\inc\sfx2\layout-post.hxx %_DEST%\inc%_EXT%\sfx2\layout-post.hxx
..\inc\sfx2\layout-pre.hxx %_DEST%\inc%_EXT%\sfx2\layout-pre.hxx
+..\inc\sfx2\XmlIdRegistry.hxx %_DEST%\inc%_EXT%\sfx2\XmlIdRegistry.hxx
+..\inc\sfx2\DocumentMetadataAccess.hxx %_DEST%\inc%_EXT%\sfx2\DocumentMetadataAccess.hxx
+..\inc\sfx2\Metadatable.hxx %_DEST%\inc%_EXT%\sfx2\Metadatable.hxx
diff --git a/sfx2/qa/complex/DocumentMetadataAccessTest.java b/sfx2/qa/complex/DocumentMetadataAccessTest.java
new file mode 100644
index 0000000000..86848ac4bf
--- /dev/null
+++ b/sfx2/qa/complex/DocumentMetadataAccessTest.java
@@ -0,0 +1,1270 @@
+/*************************************************************************
+ * 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: DocumentMetadataAccessTest.java,v $
+ *
+ * $Revision: 1.1.2.9 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ ************************************************************************/
+
+package complex.framework;
+
+import complexlib.ComplexTestCase;
+import helper.StreamSimulator;
+
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XComponentContext;
+import com.sun.star.uno.Any;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XInitialization;
+import com.sun.star.lang.XServiceInfo;
+import com.sun.star.lang.IllegalArgumentException;
+import com.sun.star.lang.WrappedTargetException;
+import com.sun.star.lang.WrappedTargetRuntimeException;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.beans.StringPair;
+import com.sun.star.container.XEnumerationAccess;
+import com.sun.star.container.XEnumeration;
+import com.sun.star.container.ElementExistException;
+import com.sun.star.container.NoSuchElementException;
+import com.sun.star.io.XInputStream;
+import com.sun.star.io.XOutputStream;
+import com.sun.star.util.XCloseable;
+import com.sun.star.frame.XStorable;
+import com.sun.star.frame.XLoadable;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.text.XTextRange;
+import com.sun.star.text.XText;
+import com.sun.star.rdf.*;
+
+/**
+ * Test case for interface com.sun.star.rdf.XDocumentMetadataAccess
+ * Currently, this service is implemented in
+ * sfx2/source/doc/DocumentMetadataAccess.cxx
+ *
+ * Actually, this is not a service, so we need to create a document and
+ * go from there...
+ *
+ * @author mst
+ */
+public class DocumentMetadataAccessTest extends ComplexTestCase
+{
+ XMultiServiceFactory xMSF;
+ XComponentContext xContext;
+ String tempDir;
+
+ String nsRDF = "http://www.w3.org/1999/02/22-rdf-syntax-ns#";
+ String nsRDFS = "http://www.w3.org/2000/01/rdf-schema#";
+ String nsPkg="http://docs.oasis-open.org/opendocument/meta/package/common#";
+ String nsODF ="http://docs.oasis-open.org/opendocument/meta/package/odf#";
+
+ XURI foo;
+ XURI bar;
+ XURI baz;
+
+ static XURI rdf_type;
+ static XURI rdfs_label;
+ static XURI pkg_Document;
+ static XURI pkg_hasPart;
+ static XURI pkg_MetadataFile;
+ static XURI odf_ContentFile;
+ static XURI odf_StylesFile;
+ static XURI odf_Element;
+ static XBlankNode blank1;
+ static XBlankNode blank2;
+ static XBlankNode blank3;
+ static XBlankNode blank4;
+ static String manifestPath = "manifest.rdf";
+ static String contentPath = "content.xml";
+ static String stylesPath = "styles.xml";
+ static String fooPath = "foo.rdf";
+ static String fooBarPath = "meta/foo/bar.rdf";
+
+ XRepository xRep;
+ XRepositorySupplier xRS;
+ XDocumentMetadataAccess xDMA;
+
+ public String[] getTestMethodNames ()
+ {
+ return new String[] { "check", "checkRDFa" };
+ }
+
+ public void before()
+ {
+ try {
+
+ xMSF = (XMultiServiceFactory) param.getMSF();
+ assure("could not create MultiServiceFactory.", xMSF != null);
+ XPropertySet xPropertySet = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, xMSF);
+ Object defaultCtx = xPropertySet.getPropertyValue("DefaultContext");
+ xContext = (XComponentContext)
+ UnoRuntime.queryInterface(XComponentContext.class, defaultCtx);
+ assure("could not get component context.", xContext != null);
+
+ tempDir = util.utils.getOfficeTemp/*Dir*/(xMSF);
+ log.println("tempdir: " + tempDir);
+
+ foo = URI.create(xContext, "uri:foo");
+ assure("foo", null != foo);
+ bar = URI.create(xContext, "uri:bar");
+ assure("bar", null != bar);
+ baz = URI.create(xContext, "uri:baz");
+ assure("baz", null != baz);
+
+ blank1 = BlankNode.create(xContext, "_:1");
+ assure("blank1", null != blank1);
+ blank2 = BlankNode.create(xContext, "_:2");
+ assure("blank2", null != blank2);
+ blank3 = BlankNode.create(xContext, "_:3");
+ assure("blank3", null != blank3);
+ blank4 = BlankNode.create(xContext, "_:4");
+ assure("blank4", null != blank4);
+ rdf_type = URI.createKnown(xContext, URIs.RDF_TYPE);
+ assure("rdf_type", null != rdf_type);
+ rdfs_label = URI.createKnown(xContext, URIs.RDFS_LABEL);
+ assure("rdfs_label", null != rdfs_label);
+ pkg_Document = URI.createKnown(xContext, URIs.PKG_DOCUMENT);
+ assure("pkg_Document", null != pkg_Document);
+ pkg_hasPart = URI.createKnown(xContext, URIs.PKG_HASPART);
+ assure("pkg_hasPart", null != pkg_hasPart);
+ pkg_MetadataFile = URI.createKnown(xContext, URIs.PKG_METADATAFILE);
+ assure("pkg_MetadataFile", null != pkg_MetadataFile);
+ odf_ContentFile = URI.createKnown(xContext, URIs.ODF_CONTENTFILE);
+ assure("odf_ContentFile", null != odf_ContentFile);
+ odf_StylesFile = URI.createKnown(xContext, URIs.ODF_STYLESFILE);
+ assure("odf_StylesFile", null != odf_StylesFile);
+ odf_Element = URI.createKnown(xContext, URIs.ODF_ELEMENT);
+ assure("odf_Element", null != odf_Element);
+
+ } catch (Exception e) {
+ report(e);
+ }
+ }
+
+ public void after()
+ {
+ xRep = null;
+ xRS = null;
+ xDMA = null;
+ }
+
+ public void check()
+ {
+ XComponent xComp = null;
+ XComponent xComp2 = null;
+ try {
+ XEnumeration xStmtsEnum;
+ XNamedGraph xManifest;
+
+ log.println("Creating document with Repository...");
+
+ // we cannot create a XDMA directly, we must create
+ // a document and get it from there :(
+ // create document
+ PropertyValue[] loadProps = new PropertyValue[1];
+ loadProps[0] = new PropertyValue();
+ loadProps[0].Name = "Hidden";
+ loadProps[0].Value = new Boolean(true);
+ xComp = util.DesktopTools.openNewDoc(xMSF, "swriter", loadProps);
+ XTextDocument xText = (XTextDocument) UnoRuntime.queryInterface(
+ XTextDocument.class, xComp);
+
+ XRepositorySupplier xRS = (XRepositorySupplier)
+ UnoRuntime.queryInterface(XRepositorySupplier.class, xComp);
+ assure("xRS null", null != xRS);
+ XDocumentMetadataAccess xDMA = (XDocumentMetadataAccess)
+ UnoRuntime.queryInterface(XDocumentMetadataAccess.class, xRS);
+ assure("xDMA null", null != xDMA);
+ xRep = xRS.getRDFRepository();
+ assure("xRep null", null != xRep);
+
+ log.println("...done");
+
+ log.println("Checking that new repository is initialized...");
+
+ XURI xBaseURI = (XURI) xDMA;
+ String baseURI = xBaseURI.getStringValue();
+ assure("new: baseURI",
+ null != xBaseURI && !xBaseURI.getStringValue().equals(""));
+
+ assure("new: # graphs", 1 == xRep.getGraphNames().length);
+ XURI manifest = URI.createNS(xContext, xBaseURI.getStringValue(),
+ manifestPath);
+ xManifest = xRep.getGraph(manifest);
+ assure("new: manifest graph", null != xManifest);
+
+ Statement[] manifestStmts = getManifestStmts(xBaseURI);
+ xStmtsEnum = xRep.getStatements(null, null, null);
+ assure("new: manifest graph", eq(xStmtsEnum, manifestStmts));
+
+ log.println("...done");
+
+ log.println("Checking some invalid args...");
+
+ String content = "behold, for i am the content.";
+ XTextRange xTR = new TestRange(content);
+ XMetadatable xM = (XMetadatable) xTR;
+
+ try {
+ xDMA.getElementByURI(null);
+ assure("getElementByURI: null allowed", false);
+ } catch (IllegalArgumentException e) {
+ // ignore
+ }
+ try {
+ xDMA.getMetadataGraphsWithType(null);
+ assure("getMetadataGraphsWithType: null URI allowed", false);
+ } catch (IllegalArgumentException e) {
+ // ignore
+ }
+ try {
+ xDMA.addMetadataFile("", new XURI[0]);
+ assure("addMetadataFile: empty filename allowed", false);
+ } catch (IllegalArgumentException e) {
+ // ignore
+ }
+ try {
+ xDMA.addMetadataFile("/foo", new XURI[0]);
+ assure("addMetadataFile: absolute filename allowed", false);
+ } catch (IllegalArgumentException e) {
+ // ignore
+ }
+ try {
+ xDMA.addMetadataFile("fo\"o", new XURI[0]);
+ assure("addMetadataFile: invalid filename allowed", false);
+ } catch (IllegalArgumentException e) {
+ // ignore
+ }
+ try {
+ xDMA.addMetadataFile("../foo", new XURI[0]);
+ assure("addMetadataFile: filename with .. allowed", false);
+ } catch (IllegalArgumentException e) {
+ // ignore
+ }
+ try {
+ xDMA.addMetadataFile("foo/../../bar", new XURI[0]);
+ assure("addMetadataFile: filename with nest .. allowed", false);
+ } catch (IllegalArgumentException e) {
+ // ignore
+ }
+ try {
+ xDMA.addMetadataFile("foo/././bar", new XURI[0]);
+ assure("addMetadataFile: filename with nest . allowed", false);
+ } catch (IllegalArgumentException e) {
+ // ignore
+ }
+ try {
+ xDMA.addMetadataFile("content.xml", new XURI[0]);
+ assure("addMetadataFile: content.xml allowed", false);
+ } catch (IllegalArgumentException e) {
+ // ignore
+ }
+ try {
+ xDMA.addMetadataFile("styles.xml", new XURI[0]);
+ assure("addMetadataFile: styles.xml allowed", false);
+ } catch (IllegalArgumentException e) {
+ // ignore
+ }
+ try {
+ xDMA.addMetadataFile("meta.xml", new XURI[0]);
+ assure("addMetadataFile: meta.xml allowed", false);
+ } catch (IllegalArgumentException e) {
+ // ignore
+ }
+ try {
+ xDMA.addMetadataFile("settings.xml", new XURI[0]);
+ assure("addMetadataFile: settings.xml allowed", false);
+ } catch (IllegalArgumentException e) {
+ // ignore
+ }
+ try {
+ xDMA.importMetadataFile(FileFormat.RDF_XML, null, "foo",
+ foo, new XURI[0]);
+ assure("importMetadataFile: null stream allowed", false);
+ } catch (IllegalArgumentException e) {
+ // ignore
+ }
+ try {
+ XInputStream xFooIn =
+ new StreamSimulator(tempDir + "empty.rdf", true, param);
+ xDMA.importMetadataFile(FileFormat.RDF_XML, xFooIn, "",
+ foo, new XURI[0]);
+ assure("importMetadataFile: empty filename allowed", false);
+ } catch (IllegalArgumentException e) {
+ // ignore
+ }
+ try {
+ XInputStream xFooIn =
+ new StreamSimulator(tempDir + "empty.rdf", true, param);
+ xDMA.importMetadataFile(FileFormat.RDF_XML, xFooIn, "meta.xml",
+ foo, new XURI[0]);
+ assure("importMetadataFile: meta.xml filename allowed", false);
+ } catch (IllegalArgumentException e) {
+ // ignore
+ }
+ try {
+ XInputStream xFooIn =
+ new StreamSimulator(tempDir + "empty.rdf", true, param);
+ xDMA.importMetadataFile(FileFormat.RDF_XML,
+ xFooIn, "foo", null, new XURI[0]);
+ assure("importMetadataFile: null base URI allowed", false);
+ } catch (IllegalArgumentException e) {
+ // ignore
+ }
+ try {
+ XInputStream xFooIn =
+ new StreamSimulator(tempDir + "empty.rdf", true, param);
+ xDMA.importMetadataFile(FileFormat.RDF_XML,
+ xFooIn, "foo", rdf_type, new XURI[0]);
+ assure("importMetadataFile: non-absolute base URI allowed",
+ false);
+ } catch (IllegalArgumentException e) {
+ // ignore
+ }
+ try {
+ xDMA.removeMetadataFile(null);
+ assure("removeMetadataFile: null URI allowed", false);
+ } catch (IllegalArgumentException e) {
+ // ignore
+ }
+ try {
+ xDMA.addContentOrStylesFile("");
+ assure("addContentOrStylesFile: empty filename allowed",
+ false);
+ } catch (IllegalArgumentException e) {
+ // ignore
+ }
+ try {
+ xDMA.addContentOrStylesFile("/content.xml");
+ assure("addContentOrStylesFile: absolute filename allowed",
+ false);
+ } catch (IllegalArgumentException e) {
+ // ignore
+ }
+ try {
+ xDMA.addContentOrStylesFile("foo.rdf");
+ assure("addContentOrStylesFile: invalid filename allowed",
+ false);
+ } catch (IllegalArgumentException e) {
+ // ignore
+ }
+ try {
+ xDMA.removeContentOrStylesFile("");
+ assure("removeContentOrStylesFile: empty filename allowed",
+ false);
+ } catch (IllegalArgumentException e) {
+ // ignore
+ }
+ try {
+ xDMA.loadMetadataFromStorage(null, foo, null);
+ assure("loadMetadataFromStorage: null storage allowed", false);
+ } catch (IllegalArgumentException e) {
+ // ignore
+ }
+ try {
+ xDMA.storeMetadataToStorage(null/*, base*/);
+ assure("storeMetadataToStorage: null storage allowed", false);
+ } catch (IllegalArgumentException e) {
+ // ignore
+ }
+ try {
+ xDMA.loadMetadataFromMedium(new PropertyValue[0]);
+ assure("loadMetadataFromMedium: empty medium allowed", false);
+ } catch (IllegalArgumentException e) {
+ // ignore
+ }
+ try {
+ xDMA.storeMetadataToMedium(new PropertyValue[0]);
+ assure("storeMetadataToMedium: empty medium allowed", false);
+ } catch (IllegalArgumentException e) {
+ // ignore
+ }
+
+ log.println("...done");
+
+ log.println("Checking file addition/removal...");
+
+ xDMA.removeContentOrStylesFile(contentPath);
+ xStmtsEnum = xManifest.getStatements(null, null, null);
+ assure("removeContentOrStylesFile (content)",
+ eq(xStmtsEnum, new Statement[] {
+ manifestStmts[0], manifestStmts[2], manifestStmts[4]
+ }));
+
+ xDMA.addContentOrStylesFile(contentPath);
+ xStmtsEnum = xManifest.getStatements(null, null, null);
+ assure("addContentOrStylesFile (content)",
+ eq(xStmtsEnum, manifestStmts));
+
+ xDMA.removeContentOrStylesFile(stylesPath);
+ xStmtsEnum = xManifest.getStatements(null, null, null);
+ assure("removeContentOrStylesFile (styles)",
+ eq(xStmtsEnum, new Statement[] {
+ manifestStmts[0], manifestStmts[1], manifestStmts[3]
+ }));
+
+ xDMA.addContentOrStylesFile(stylesPath);
+ xStmtsEnum = xManifest.getStatements(null, null, null);
+ assure("addContentOrStylesFile (styles)",
+ eq(xStmtsEnum, manifestStmts));
+
+ XURI xFoo = URI.createNS(xContext, xBaseURI.getStringValue(),
+ fooPath);
+ Statement xM_BaseHaspartFoo =
+ new Statement(xBaseURI, pkg_hasPart, xFoo, manifest);
+ Statement xM_FooTypeMetadata =
+ new Statement(xFoo, rdf_type, pkg_MetadataFile, manifest);
+ Statement xM_FooTypeBar =
+ new Statement(xFoo, rdf_type, bar, manifest);
+ xDMA.addMetadataFile(fooPath, new XURI[] { bar });
+ xStmtsEnum = xManifest.getStatements(null, null, null);
+ assure("addMetadataFile",
+ eq(xStmtsEnum, merge(manifestStmts, new Statement[] {
+ xM_BaseHaspartFoo, xM_FooTypeMetadata, xM_FooTypeBar
+ })));
+
+ XURI[] graphsBar = xDMA.getMetadataGraphsWithType(bar);
+ assure("getMetadataGraphsWithType",
+ graphsBar.length == 1 && eq(graphsBar[0], xFoo));
+
+
+ xDMA.removeMetadataFile(xFoo);
+ xStmtsEnum = xManifest.getStatements(null, null, null);
+ assure("removeMetadataFile",
+ eq(xStmtsEnum, manifestStmts));
+
+ log.println("...done");
+
+ log.println("Checking mapping...");
+
+ XEnumerationAccess xTextEnum = (XEnumerationAccess)
+ UnoRuntime.queryInterface(XEnumerationAccess.class,
+ xText.getText());
+ Object o = xTextEnum.createEnumeration().nextElement();
+ XMetadatable xMeta1 = (XMetadatable) UnoRuntime.queryInterface(
+ XMetadatable.class, o);
+
+ XURI uri;
+ XMetadatable xMeta;
+ xMeta = xDMA.getElementByURI(xMeta1);
+ assure("getElementByURI: null", null != xMeta);
+ String XmlId = xMeta.getMetadataReference().Second;
+ String XmlId1 = xMeta1.getMetadataReference().Second;
+ assure("getElementByURI: no xml id", !XmlId.equals(""));
+ assure("getElementByURI: different xml id", XmlId.equals(XmlId1));
+
+ log.println("...done");
+
+ log.println("Checking storing and loading...");
+
+ XURI xFoobar = URI.createNS(xContext, xBaseURI.getStringValue(),
+ fooBarPath);
+ Statement[] metadataStmts = getMetadataFileStmts(xBaseURI,
+ fooBarPath);
+ xDMA.addMetadataFile(fooBarPath, new XURI[0]);
+ xStmtsEnum = xRep.getStatements(null, null, null);
+ assure("addMetadataFile",
+ eq(xStmtsEnum, merge(manifestStmts, metadataStmts )));
+
+ Statement xFoobar_FooBarFoo =
+ new Statement(foo, bar, foo, xFoobar);
+ xRep.getGraph(xFoobar).addStatement(foo, bar, foo);
+ xStmtsEnum = xRep.getStatements(null, null, null);
+ assure("addStatement",
+ eq(xStmtsEnum, merge(manifestStmts, merge(metadataStmts,
+ new Statement[] { xFoobar_FooBarFoo }))));
+
+ PropertyValue noMDNoContentFile = new PropertyValue();
+ noMDNoContentFile.Name = "URL";
+ noMDNoContentFile.Value = util.utils.getFullTestURL("CUSTOM.odt");
+ PropertyValue noMDFile = new PropertyValue();
+ noMDFile.Name = "URL";
+ noMDFile.Value = util.utils.getFullTestURL("TEST.odt");
+ PropertyValue file = new PropertyValue();
+ file.Name = "URL";
+ file.Value = tempDir + "TESTDMA.odt";
+ /*
+ PropertyValue baseURL = new PropertyValue();
+ baseURL.Name = "DocumentBaseURL";
+ baseURL.Value = tempDir + "TMP.odt";
+ */
+ PropertyValue mimetype = new PropertyValue();
+ mimetype.Name = "MediaType";
+ mimetype.Value = "application/vnd.oasis.opendocument.text";
+ PropertyValue[] argsEmptyNoContent = { mimetype, noMDNoContentFile};
+ PropertyValue[] argsEmpty = { mimetype, noMDFile };
+ PropertyValue[] args = { mimetype, file };
+
+ xStmtsEnum = xRep.getStatements(null, null, null);
+ XURI[] graphs = xRep.getGraphNames();
+
+ xDMA.storeMetadataToMedium(args);
+
+ // this should re-init
+ xDMA.loadMetadataFromMedium(argsEmptyNoContent);
+ xRep = xRS.getRDFRepository();
+ assure("xRep null", null != xRep);
+ assure("baseURI still tdoc?",
+ !baseURI.equals(xDMA.getStringValue()));
+ Statement[] manifestStmts2 = getManifestStmts((XURI) xDMA);
+ xStmtsEnum = xRep.getStatements(null, null, null);
+ // there is no content or styles file in here, so we have just
+ // the package stmt
+ assure("loadMetadataFromMedium (no metadata, no content)",
+ eq(xStmtsEnum, new Statement[] { manifestStmts2[0] }));
+
+ // this should re-init
+ xDMA.loadMetadataFromMedium(argsEmpty);
+ xRep = xRS.getRDFRepository();
+ assure("xRep null", null != xRep);
+ assure("baseURI still tdoc?",
+ !baseURI.equals(xDMA.getStringValue()));
+ Statement[] manifestStmts3 = getManifestStmts((XURI) xDMA);
+
+ xStmtsEnum = xRep.getStatements(null, null, null);
+ assure("loadMetadataFromMedium (no metadata)",
+ eq(xStmtsEnum, manifestStmts3));
+
+ xDMA.loadMetadataFromMedium(args);
+ xRep = xRS.getRDFRepository();
+ assure("xRep null", null != xRep);
+ Statement[] manifestStmts4 = getManifestStmts((XURI) xDMA);
+ Statement[] metadataStmts4 = getMetadataFileStmts((XURI) xDMA,
+ fooBarPath);
+
+ xStmtsEnum = xRep.getStatements(null, null, null);
+ assure("some graph(s) not reloaded",
+ graphs.length == xRep.getGraphNames().length);
+
+ XURI xFoobar4 = URI.createNS(xContext, xDMA.getStringValue(),
+ fooBarPath);
+ Statement xFoobar_FooBarFoo4 =
+ new Statement(foo, bar, foo, xFoobar4);
+ assure("loadMetadataFromMedium (re-load)",
+ eq(xStmtsEnum, merge(manifestStmts4, merge(metadataStmts4,
+ new Statement[] { xFoobar_FooBarFoo4 }))));
+
+ log.println("...done");
+
+ log.println("Checking storing and loading via model...");
+
+ String f = tempDir + "TESTPARA.odt";
+
+ XStorable xStor = (XStorable) UnoRuntime.queryInterface(
+ XStorable.class, xRS);
+
+ xStor.storeToURL(f, new PropertyValue[0]);
+
+ xComp2 = util.DesktopTools.loadDoc(xMSF, f, loadProps);
+
+ XDocumentMetadataAccess xDMA2 = (XDocumentMetadataAccess)
+ UnoRuntime.queryInterface(XDocumentMetadataAccess.class,
+ xComp2);
+ assure("xDMA2 null", null != xDMA2);
+
+ XRepositorySupplier xRS2 = (XRepositorySupplier)
+ UnoRuntime.queryInterface(XRepositorySupplier.class, xComp2);
+ assure("xRS2 null", null != xRS2);
+
+ XRepository xRep2 = xRS2.getRDFRepository();
+ assure("xRep2 null", null != xRep2);
+
+ Statement[] manifestStmts5 = getManifestStmts((XURI) xDMA2);
+ Statement[] metadataStmts5 = getMetadataFileStmts((XURI) xDMA2,
+ fooBarPath);
+ XURI xFoobar5 = URI.createNS(xContext, xDMA2.getStringValue(),
+ fooBarPath);
+ Statement xFoobar_FooBarFoo5 =
+ new Statement(foo, bar, foo, xFoobar5);
+ xStmtsEnum = xRep.getStatements(null, null, null);
+ XEnumeration xStmtsEnum2 = xRep2.getStatements(null, null, null);
+ assure("load: repository differs",
+ eq(xStmtsEnum2, merge(manifestStmts5, merge(metadataStmts5,
+ new Statement[] { xFoobar_FooBarFoo5 }))));
+
+ log.println("...done");
+
+ } catch (Exception e) {
+ report(e);
+ } finally {
+ close(xComp);
+ close(xComp2);
+ }
+ }
+
+ public void checkRDFa()
+ {
+ XComponent xComp = null;
+ String file;
+ try {
+ file = util.utils.getFullTestURL("TESTRDFA.odt");
+ xComp = loadRDFa(file);
+ if (xComp != null)
+ {
+ file = tempDir + "TESTRDFA.odt";
+ storeRDFa(xComp, file);
+ close(xComp);
+ xComp = loadRDFa(file);
+ }
+ } finally {
+ close(xComp);
+ }
+ }
+
+ public void storeRDFa(XComponent xComp, String file)
+ {
+ try {
+
+ log.println("Storing test document...");
+
+ XStorable xStor = (XStorable) UnoRuntime.queryInterface(
+ XStorable.class, xComp);
+
+ xStor.storeToURL(file, new PropertyValue[0]);
+
+ log.println("...done");
+
+ } catch (Exception e) {
+ report(e);
+ }
+ }
+
+ public XComponent loadRDFa(String file)
+ {
+ XComponent xComp = null;
+ try {
+
+ log.println("Loading test document...");
+
+ PropertyValue[] loadProps = new PropertyValue[1];
+ loadProps[0] = new PropertyValue();
+ loadProps[0].Name = "Hidden";
+ loadProps[0].Value = new Boolean(true);
+
+
+
+ xComp = util.DesktopTools.loadDoc(xMSF, file, loadProps);
+
+ XRepositorySupplier xRS = (XRepositorySupplier)
+ UnoRuntime.queryInterface(XRepositorySupplier.class, xComp);
+ assure("xRS null", null != xRS);
+
+ XDocumentRepository xRep = (XDocumentRepository)
+ UnoRuntime.queryInterface(XDocumentRepository.class,
+ xRS.getRDFRepository());
+ assure("xRep null", null != xRep);
+
+ XTextDocument xTextDoc = (XTextDocument)
+ UnoRuntime.queryInterface(XTextDocument.class, xComp);
+
+ XText xText = xTextDoc.getText();
+
+ XEnumerationAccess xEA = (XEnumerationAccess)
+ UnoRuntime.queryInterface(XEnumerationAccess.class, xText);
+ XEnumeration xEnum = xEA.createEnumeration();
+
+ log.println("...done");
+
+ log.println("Checking RDFa in loaded test document...");
+
+ XMetadatable xPara;
+ Statement[] stmts;
+
+ Statement x_FooBarLit1 = new Statement(foo, bar, mkLit("1"), null);
+ xPara = (XMetadatable) UnoRuntime.queryInterface(
+ XMetadatable.class, xEnum.nextElement());
+ stmts = xRep.getStatementRDFa(xPara);
+ assure("RDFa: 1",
+ eq(stmts, new Statement[] {
+ x_FooBarLit1
+ }));
+
+ Statement x_FooBarLit2 = new Statement(foo, bar, mkLit("2"), null);
+ xPara = (XMetadatable) UnoRuntime.queryInterface(
+ XMetadatable.class, xEnum.nextElement());
+ stmts = xRep.getStatementRDFa(xPara);
+ assure("RDFa: 2",
+ eq(stmts, new Statement[] {
+ x_FooBarLit2
+ }));
+
+ Statement x_BlankBarLit3 =
+ new Statement(blank1, bar, mkLit("3"), null);
+ xPara = (XMetadatable) UnoRuntime.queryInterface(
+ XMetadatable.class, xEnum.nextElement());
+ stmts = xRep.getStatementRDFa(xPara);
+ assure("RDFa: 3",
+ eq(stmts, new Statement[] {
+ x_BlankBarLit3
+ }));
+ XBlankNode b3 = (XBlankNode) UnoRuntime.queryInterface(
+ XBlankNode.class, stmts[0].Subject);
+
+ Statement x_BlankBarLit4 =
+ new Statement(blank2, bar, mkLit("4"), null);
+ xPara = (XMetadatable) UnoRuntime.queryInterface(
+ XMetadatable.class, xEnum.nextElement());
+ stmts = xRep.getStatementRDFa(xPara);
+ assure("RDFa: 4",
+ eq(stmts, new Statement[] {
+ x_BlankBarLit4
+ }));
+ XBlankNode b4 = (XBlankNode) UnoRuntime.queryInterface(
+ XBlankNode.class, stmts[0].Subject);
+
+ Statement x_BlankBarLit5 =
+ new Statement(blank1, bar, mkLit("5"), null);
+ xPara = (XMetadatable) UnoRuntime.queryInterface(
+ XMetadatable.class, xEnum.nextElement());
+ stmts = xRep.getStatementRDFa(xPara);
+ assure("RDFa: 5",
+ eq(stmts, new Statement[] {
+ x_BlankBarLit5
+ }));
+ XBlankNode b5 = (XBlankNode) UnoRuntime.queryInterface(
+ XBlankNode.class, stmts[0].Subject);
+
+ assure("RDFa: 3 != 4",
+ !b3.getStringValue().equals(b4.getStringValue()));
+ assure("RDFa: 3 == 5",
+ b3.getStringValue().equals(b5.getStringValue()));
+
+ Statement x_FooBarLit6 = new Statement(foo, bar, mkLit("6"), null);
+ Statement x_FooBazLit6 = new Statement(foo, baz, mkLit("6"), null);
+ xPara = (XMetadatable) UnoRuntime.queryInterface(
+ XMetadatable.class, xEnum.nextElement());
+ stmts = xRep.getStatementRDFa(xPara);
+ assure("RDFa: 6",
+ eq(stmts, new Statement[] {
+ x_FooBarLit6, x_FooBazLit6
+ }));
+
+ Statement x_FooBarLit7 = new Statement(foo, bar, mkLit("7"), null);
+ Statement x_FooBazLit7 = new Statement(foo, baz, mkLit("7"), null);
+ Statement x_FooFooLit7 = new Statement(foo, foo, mkLit("7"), null);
+ xPara = (XMetadatable) UnoRuntime.queryInterface(
+ XMetadatable.class, xEnum.nextElement());
+ stmts = xRep.getStatementRDFa(xPara);
+ assure("RDFa: 7",
+ eq(stmts, new Statement[] {
+ x_FooBarLit7, x_FooBazLit7, x_FooFooLit7
+ }));
+
+ XNode lit = mkLit("a fooish bar");
+ XNode lit_type= mkLit("a fooish bar", bar);
+ Statement x_FooBarLit = new Statement(foo, bar, lit, null);
+ Statement x_FooBarLittype = new Statement(foo, bar, lit_type, null);
+
+ Statement x_FooLabelLit8 =
+ new Statement(foo, rdfs_label, mkLit("8"), null);
+ xPara = (XMetadatable) UnoRuntime.queryInterface(
+ XMetadatable.class, xEnum.nextElement());
+ stmts = xRep.getStatementRDFa(xPara);
+ assure("RDFa: 8",
+ eq(stmts, new Statement[] {
+ x_FooBarLit, x_FooLabelLit8
+ }));
+
+ Statement x_FooLabelLit9 =
+ new Statement(foo, rdfs_label, mkLit("9"), null);
+ xPara = (XMetadatable) UnoRuntime.queryInterface(
+ XMetadatable.class, xEnum.nextElement());
+ stmts = xRep.getStatementRDFa(xPara);
+ assure("RDFa: 9",
+ eq(stmts, new Statement[] {
+ x_FooBarLit, x_FooLabelLit9
+ }));
+
+ Statement x_FooLabelLit10 =
+ new Statement(foo, rdfs_label, mkLit("10"), null);
+ xPara = (XMetadatable) UnoRuntime.queryInterface(
+ XMetadatable.class, xEnum.nextElement());
+ stmts = xRep.getStatementRDFa(xPara);
+ assure("RDFa: 10",
+ eq(stmts, new Statement[] {
+ x_FooBarLittype, x_FooLabelLit10
+ }));
+
+ Statement x_FooBarLit11
+ = new Statement(foo, bar, mkLit("11", bar), null);
+ xPara = (XMetadatable) UnoRuntime.queryInterface(
+ XMetadatable.class, xEnum.nextElement());
+ stmts = xRep.getStatementRDFa(xPara);
+ assure("RDFa: 11",
+ eq(stmts, new Statement[] {
+ x_FooBarLit11
+ }));
+
+ XURI xFile = URI.createNS(xContext, file, "/" + contentPath);
+ Statement x_FileBarLit12 =
+ new Statement(xFile, bar, mkLit("12"), null);
+ xPara = (XMetadatable) UnoRuntime.queryInterface(
+ XMetadatable.class, xEnum.nextElement());
+ stmts = xRep.getStatementRDFa(xPara);
+ assure("RDFa: 12",
+ eq(stmts, new Statement[] {
+ x_FileBarLit12
+ }));
+
+ Statement x_FooLabelLit13 =
+ new Statement(foo, rdfs_label, mkLit("13"), null);
+ xPara = (XMetadatable) UnoRuntime.queryInterface(
+ XMetadatable.class, xEnum.nextElement());
+ stmts = xRep.getStatementRDFa(xPara);
+ assure("RDFa: 13",
+ eq(stmts, new Statement[] {
+ x_FooBarLit, x_FooLabelLit13
+ }));
+
+ Statement x_FooLabelLit14 =
+ new Statement(foo, rdfs_label, mkLit("14"), null);
+ xPara = (XMetadatable) UnoRuntime.queryInterface(
+ XMetadatable.class, xEnum.nextElement());
+ stmts = xRep.getStatementRDFa(xPara);
+ assure("RDFa: 14",
+ eq(stmts, new Statement[] {
+ x_FooBarLit, x_FooLabelLit14
+ }));
+
+ xPara = (XMetadatable) UnoRuntime.queryInterface(
+ XMetadatable.class, xEnum.nextElement());
+ stmts = xRep.getStatementRDFa(xPara);
+ assure("RDFa: 15", eq(stmts, new Statement[] { } ));
+
+ xPara = (XMetadatable) UnoRuntime.queryInterface(
+ XMetadatable.class, xEnum.nextElement());
+ stmts = xRep.getStatementRDFa(xPara);
+ assure("RDFa: 16", eq(stmts, new Statement[] { } ));
+
+ xPara = (XMetadatable) UnoRuntime.queryInterface(
+ XMetadatable.class, xEnum.nextElement());
+ stmts = xRep.getStatementRDFa(xPara);
+ assure("RDFa: 17", eq(stmts, new Statement[] { } ));
+
+ xPara = (XMetadatable) UnoRuntime.queryInterface(
+ XMetadatable.class, xEnum.nextElement());
+ stmts = xRep.getStatementRDFa(xPara);
+ assure("RDFa: 18", eq(stmts, new Statement[] { } ));
+
+ xPara = (XMetadatable) UnoRuntime.queryInterface(
+ XMetadatable.class, xEnum.nextElement());
+ stmts = xRep.getStatementRDFa(xPara);
+ assure("RDFa: 19", eq(stmts, new Statement[] { } ));
+
+ xPara = (XMetadatable) UnoRuntime.queryInterface(
+ XMetadatable.class, xEnum.nextElement());
+ stmts = xRep.getStatementRDFa(xPara);
+ assure("RDFa: 20", eq(stmts, new Statement[] { } ));
+
+ xPara = (XMetadatable) UnoRuntime.queryInterface(
+ XMetadatable.class, xEnum.nextElement());
+ stmts = xRep.getStatementRDFa(xPara);
+ assure("RDFa: 21", eq(stmts, new Statement[] { } ));
+
+ log.println("...done");
+
+ } catch (Exception e) {
+ report(e);
+ close(xComp);
+ }
+ return xComp;
+ }
+
+
+// utilities -------------------------------------------------------------
+
+ public void report2(Exception e)
+ {
+ if (e instanceof WrappedTargetException)
+ {
+ log.println("Cause:");
+ Exception cause = (Exception)
+ (((WrappedTargetException)e).TargetException);
+ log.println(cause.toString());
+ report2(cause);
+ } else if (e instanceof WrappedTargetRuntimeException) {
+ log.println("Cause:");
+ Exception cause = (Exception)
+ (((WrappedTargetRuntimeException)e).TargetException);
+ log.println(cause.toString());
+ report2(cause);
+ }
+ }
+
+ public void report(Exception e) {
+ log.println("Exception occurred:");
+ e.printStackTrace((java.io.PrintWriter) log);
+ report2(e);
+ failed();
+ }
+
+ static void close(XComponent i_comp)
+ {
+ try {
+ XCloseable xClos = (XCloseable) UnoRuntime.queryInterface(
+ XCloseable.class, i_comp);
+ if (xClos != null) xClos.close(true);
+ } catch (Exception e) {
+ }
+ }
+
+ XLiteral mkLit(String i_content)
+ {
+ return Literal.create(xContext, i_content);
+ }
+
+ XLiteral mkLit(String i_content, XURI i_uri)
+ {
+ return Literal.createWithType(xContext, i_content, i_uri);
+ }
+
+ static Statement[] merge(Statement[] i_A1, Statement[] i_A2)
+ {
+ // bah, java sucks...
+ Statement[] ret = new Statement[i_A1.length + i_A2.length];
+ for (int i = 0; i < i_A1.length; ++i) {
+ ret[i] = i_A1[i];
+ }
+ for (int i = 0; i < i_A2.length; ++i) {
+ ret[i+i_A1.length] = i_A2[i];
+ }
+ return ret;
+ }
+
+ public static String toS(XNode n) {
+ if (null == n) return "< null >";
+ return n.getStringValue();
+ }
+
+ static boolean isBlank(XNode i_node)
+ {
+ XBlankNode blank = (XBlankNode) UnoRuntime.queryInterface(
+ XBlankNode.class, i_node);
+ return blank != null;
+ }
+
+/*
+ static class Statement implements XStatement
+ {
+ XResource m_Subject;
+ XResource m_Predicate;
+ XNode m_Object;
+ XURI m_Graph;
+
+ Statement(XResource i_Subject, XResource i_Predicate, XNode i_Object,
+ XURI i_Graph)
+ {
+ m_Subject = i_Subject;
+ m_Predicate = i_Predicate;
+ m_Object = i_Object;
+ m_Graph = i_Graph;
+ }
+
+ public XResource getSubject() { return m_Subject; }
+ public XResource getPredicate() { return m_Predicate; }
+ public XNode getObject() { return m_Object; }
+ public XURI getGraph() { return m_Graph; }
+ }
+*/
+
+ static Statement[] toSeq(XEnumeration i_Enum) throws Exception
+ {
+ java.util.Collection c = new java.util.Vector();
+ while (i_Enum.hasMoreElements()) {
+ Statement s = (Statement) i_Enum.nextElement();
+//log.println("toSeq: " + s.getSubject().getStringValue() + " " + s.getPredicate().getStringValue() + " " + s.getObject().getStringValue() + ".");
+ c.add(s);
+ }
+// return (Statement[]) c.toArray();
+ // java sucks
+ Object[] arr = c.toArray();
+ Statement[] ret = new Statement[arr.length];
+ for (int i = 0; i < arr.length; ++i) {
+ ret[i] = (Statement) arr[i];
+ }
+ return ret;
+ }
+
+ static XNode[][] toSeqs(XEnumeration i_Enum) throws Exception
+ {
+ java.util.Collection c = new java.util.Vector();
+ while (i_Enum.hasMoreElements()) {
+ XNode[] s = (XNode[]) i_Enum.nextElement();
+ c.add(s);
+ }
+// return (XNode[][]) c.toArray();
+ Object[] arr = c.toArray();
+ XNode[][] ret = new XNode[arr.length][];
+ for (int i = 0; i < arr.length; ++i) {
+ ret[i] = (XNode[]) arr[i];
+ }
+ return ret;
+ }
+
+ static class BindingComp implements java.util.Comparator
+ {
+ public int compare(Object i_Left, Object i_Right)
+ {
+ XNode[] left = (XNode[]) i_Left;
+ XNode[] right = (XNode[]) i_Right;
+ if (left.length != right.length) throw new RuntimeException();
+ for (int i = 0; i < left.length; ++i) {
+ int eq = (left[i].getStringValue().compareTo(
+ right[i].getStringValue()));
+ if (eq != 0) return eq;
+ }
+ return 0;
+ }
+ }
+
+ static class StmtComp implements java.util.Comparator
+ {
+ public int compare(Object i_Left, Object i_Right)
+ {
+ int eq;
+ Statement left = (Statement) i_Left;
+ Statement right = (Statement) i_Right;
+ if ((eq = cmp(left.Graph, right.Graph )) != 0) return eq;
+ if ((eq = cmp(left.Subject, right.Subject )) != 0) return eq;
+ if ((eq = cmp(left.Predicate, right.Predicate)) != 0) return eq;
+ if ((eq = cmp(left.Object, right.Object )) != 0) return eq;
+ return 0;
+ }
+
+ public int cmp(XNode i_Left, XNode i_Right)
+ {
+ if (isBlank(i_Left)) {
+ return isBlank(i_Right) ? 0 : 1;
+ } else {
+ if (isBlank(i_Right)) {
+ return -1;
+ } else {
+ return toS(i_Left).compareTo(toS(i_Right));
+ }
+ }
+ }
+ }
+
+ static boolean eq(Statement i_Left, Statement i_Right)
+ {
+ XURI lG = i_Left.Graph;
+ XURI rG = i_Right.Graph;
+ if (!eq(lG, rG)) {
+ log.println("Graphs differ: " + toS(lG) + " != " + toS(rG));
+ return false;
+ }
+ if (!eq(i_Left.Subject, i_Right.Subject)) {
+ log.println("Subjects differ: " +
+ i_Left.Subject.getStringValue() + " != " +
+ i_Right.Subject.getStringValue());
+ return false;
+ }
+ if (!eq(i_Left.Predicate, i_Right.Predicate)) {
+ log.println("Predicates differ: " +
+ i_Left.Predicate.getStringValue() + " != " +
+ i_Right.Predicate.getStringValue());
+ return false;
+ }
+ if (!eq(i_Left.Object, i_Right.Object)) {
+ log.println("Objects differ: " +
+ i_Left.Object.getStringValue() + " != " +
+ i_Right.Object.getStringValue());
+ return false;
+ }
+ return true;
+ }
+
+ static boolean eq(Statement[] i_Result, Statement[] i_Expected)
+ {
+ if (i_Result.length != i_Expected.length) {
+ log.println("eq: different lengths: " + i_Result.length + " " +
+ i_Expected.length);
+ return false;
+ }
+ Statement[] expected = (Statement[])
+ java.util.Arrays.asList(i_Expected).toArray();
+ java.util.Arrays.sort(i_Result, new StmtComp());
+ java.util.Arrays.sort(expected, new StmtComp());
+ for (int i = 0; i < expected.length; ++i) {
+ if (!eq(i_Result[i], expected[i])) return false;
+ }
+ return true;
+ }
+
+ static boolean eq(XEnumeration i_Enum, Statement[] i_Expected)
+ throws Exception
+ {
+ Statement[] current = toSeq(i_Enum);
+ return eq(current, i_Expected);
+ }
+
+ static boolean eq(XNode i_Left, XNode i_Right)
+ {
+ if (i_Left == null) {
+ return (i_Right == null);
+ } else {
+ return (i_Right != null) &&
+ (i_Left.getStringValue().equals(i_Right.getStringValue())
+ // FIXME: hack: blank nodes considered equal
+ || (isBlank(i_Left) && isBlank(i_Right)));
+ }
+ }
+
+ static boolean eq(XQuerySelectResult i_Result,
+ String[] i_Vars, XNode[][] i_Bindings) throws Exception
+ {
+ String[] vars = (String[]) i_Result.getBindingNames();
+ XEnumeration iter = (XEnumeration) i_Result;
+ XNode[][] bindings = toSeqs(iter);
+ if (vars.length != i_Vars.length) {
+ log.println("var lengths differ");
+ return false;
+ }
+ if (bindings.length != i_Bindings.length) {
+ log.println("binding lengths differ: " + i_Bindings.length +
+ " vs " + bindings.length );
+ return false;
+ }
+ java.util.Arrays.sort(bindings, new BindingComp());
+ java.util.Arrays.sort(i_Bindings, new BindingComp());
+ for (int i = 0; i < i_Bindings.length; ++i) {
+ if (i_Bindings[i].length != i_Vars.length) {
+ log.println("TEST ERROR!");
+ throw new Exception();
+ }
+ if (bindings[i].length != i_Vars.length) {
+ log.println("binding length and var length differ");
+ return false;
+ }
+ for (int j = 0; j < i_Vars.length; ++j) {
+ if (!eq(bindings[i][j], i_Bindings[i][j])) {
+ log.println("bindings differ: " +
+ toS(bindings[i][j]) + " != " + toS(i_Bindings[i][j]));
+ return false;
+ }
+ }
+ }
+ for (int i = 0; i < i_Vars.length; ++i) {
+ if (!vars[i].equals(i_Vars[i])) {
+ log.println("variable names differ: " +
+ vars[i] + " != " + i_Vars[i]);
+ return false;
+ }
+ }
+ return true;
+ }
+
+ static boolean eq(StringPair i_Left, StringPair i_Right)
+ {
+ return ((i_Left.First).equals(i_Right.First)) &&
+ ((i_Left.Second).equals(i_Right.Second));
+ }
+
+ static String mkNamespace(String i_prefix, String i_namespace)
+ {
+ return "PREFIX " + i_prefix + ": <" + i_namespace + ">\n";
+ }
+
+ static String mkNss()
+ {
+ String namespaces = mkNamespace("rdf",
+ "http://www.w3.org/1999/02/22-rdf-syntax-ns#");
+ namespaces += mkNamespace("pkg",
+ "http://docs.oasis-open.org/opendocument/meta/package/common#");
+ namespaces += mkNamespace("odf",
+ "http://docs.oasis-open.org/opendocument/meta/package/odf#");
+ return namespaces;
+ }
+
+ Statement[] getManifestStmts(XURI xBaseURI) throws Exception
+ {
+ XURI xManifest = URI.createNS(xContext, xBaseURI.getStringValue(),
+ manifestPath);
+ XURI xContent = URI.createNS(xContext, xBaseURI.getStringValue(),
+ contentPath);
+ XURI xStyles = URI.createNS(xContext, xBaseURI.getStringValue(),
+ stylesPath);
+ Statement xM_BaseTypeDoc =
+ new Statement(xBaseURI, rdf_type, pkg_Document, xManifest);
+ Statement xM_BaseHaspartContent =
+ new Statement(xBaseURI, pkg_hasPart, xContent, xManifest);
+ Statement xM_BaseHaspartStyles =
+ new Statement(xBaseURI, pkg_hasPart, xStyles, xManifest);
+ Statement xM_ContentTypeContent =
+ new Statement(xContent, rdf_type, odf_ContentFile, xManifest);
+ Statement xM_StylesTypeStyles =
+ new Statement(xStyles, rdf_type, odf_StylesFile, xManifest);
+ return new Statement[] {
+ xM_BaseTypeDoc, xM_BaseHaspartContent, xM_BaseHaspartStyles,
+ xM_ContentTypeContent, xM_StylesTypeStyles
+ };
+ }
+
+ Statement[] getMetadataFileStmts(XURI xBaseURI, String Path)
+ throws Exception
+ {
+ XURI xManifest = URI.createNS(xContext, xBaseURI.getStringValue(),
+ manifestPath);
+ XURI xGraph = URI.createNS(xContext, xBaseURI.getStringValue(), Path);
+ Statement xM_BaseHaspartGraph =
+ new Statement(xBaseURI, pkg_hasPart, xGraph, xManifest);
+ Statement xM_GraphTypeMetadata =
+ new Statement(xGraph, rdf_type, pkg_MetadataFile, xManifest);
+ return new Statement[] { xM_BaseHaspartGraph, xM_GraphTypeMetadata };
+ }
+
+ class TestRange implements XTextRange, XMetadatable, XServiceInfo
+ {
+ String m_Stream;
+ String m_XmlId;
+ String m_Text;
+ TestRange(String i_Str) { m_Text = i_Str; }
+
+ public String getStringValue() { return ""; }
+ public String getNamespace() { return ""; }
+ public String getLocalName() { return ""; }
+
+ public StringPair getMetadataReference()
+ { return new StringPair(m_Stream, m_XmlId); }
+ public void setMetadataReference(StringPair i_Ref)
+ throws IllegalArgumentException
+ { m_Stream = (String)i_Ref.First; m_XmlId = (String)i_Ref.Second; }
+ public void ensureMetadataReference()
+ { m_Stream = "content.xml"; m_XmlId = "42"; }
+
+ public String getImplementationName() { return null; }
+ public String[] getSupportedServiceNames() { return null; }
+ public boolean supportsService(String i_Svc)
+ { return i_Svc.equals("com.sun.star.text.Paragraph"); }
+
+ public XText getText() { return null; }
+ public XTextRange getStart() { return null; }
+ public XTextRange getEnd() { return null; }
+ public String getString() { return m_Text; }
+ public void setString(String i_Str) { m_Text = i_Str; }
+ }
+}
+
diff --git a/sfx2/qa/complex/makefile.mk b/sfx2/qa/complex/makefile.mk
index 102c641f27..5c0006df9e 100644
--- a/sfx2/qa/complex/makefile.mk
+++ b/sfx2/qa/complex/makefile.mk
@@ -42,7 +42,9 @@ PACKAGE = complex$/framework
JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar
JAVAFILES = CheckGlobalEventBroadcaster_writer1.java \
- DocumentMetaData.java
+ DocumentMetaData.java \
+ DocumentMetadataAccessTest.java
+
JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class)
SUBDIRS = DocHelper
diff --git a/sfx2/qa/complex/testdocuments/TESTRDFA.odt b/sfx2/qa/complex/testdocuments/TESTRDFA.odt
new file mode 100644
index 0000000000..d59739142d
--- /dev/null
+++ b/sfx2/qa/complex/testdocuments/TESTRDFA.odt
Binary files differ
diff --git a/sfx2/qa/complex/tests.sce b/sfx2/qa/complex/tests.sce
index e95f6db884..c38852927e 100644
--- a/sfx2/qa/complex/tests.sce
+++ b/sfx2/qa/complex/tests.sce
@@ -1,2 +1,3 @@
-o complex.framework.DocumentMetaData
+-o complex.framework.DocumentMetadataAccessTest
#-o complex.framework.CheckGlobalEventBroadcaster_writer1
diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi
index b8597d853d..32db454b17 100644
--- a/sfx2/sdi/sfx.sdi
+++ b/sfx2/sdi/sfx.sdi
@@ -8777,3 +8777,29 @@ SfxBoolItem DockingWindow9 SID_DOCKWIN_9
ToolBoxConfig = FALSE,
GroupId = GID_APPLICATION;
]
+
+//--------------------------------------------------------------------------
+SfxInt16Item PasteUnformatted SID_PASTE_UNFORMATTED
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Volatile,
+ FastCall = TRUE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ Asynchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_EDIT;
+]
+
diff --git a/sfx2/sdi/sfxslots.sdi b/sfx2/sdi/sfxslots.sdi
index f09db42591..7e851ae414 100644
--- a/sfx2/sdi/sfxslots.sdi
+++ b/sfx2/sdi/sfxslots.sdi
@@ -88,14 +88,6 @@ TypeLibFile( "sfxslots.tlb" )
INT32 AutoReloadTime MID_DOCINFO_AUTOLOADSECS;
String AutoReloadURL MID_DOCINFO_AUTOLOADURL;
String AutoReloadFrame MID_DOCINFO_DEFAULTTARGET;
- String Field1Title MID_DOCINFO_FIELD1TITLE;
- String Field2Title MID_DOCINFO_FIELD2TITLE;
- String Field3Title MID_DOCINFO_FIELD3TITLE;
- String Field4Title MID_DOCINFO_FIELD4TITLE;
- String Field1 MID_DOCINFO_FIELD1;
- String Field2 MID_DOCINFO_FIELD2;
- String Field3 MID_DOCINFO_FIELD3;
- String Field4 MID_DOCINFO_FIELD4;
};
item DocInfo SfxDocumentInfoItem;
diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx
index 0aa9af65a9..8cce7a41f0 100644
--- a/sfx2/source/appl/app.cxx
+++ b/sfx2/source/appl/app.cxx
@@ -460,6 +460,14 @@ void SfxApplication::SetLastDir_Impl
//--------------------------------------------------------------------
+void SfxApplication::ResetLastDir()
+{
+ String aEmpty;
+ pAppData_Impl->aLastDir = aEmpty;
+}
+
+//--------------------------------------------------------------------
+
SfxDispatcher* SfxApplication::GetDispatcher_Impl()
{
return pAppData_Impl->pViewFrame? pAppData_Impl->pViewFrame->GetDispatcher(): pAppData_Impl->pAppDispat;
diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx
index 7fe2e15a30..ae8f0e6abe 100644
--- a/sfx2/source/appl/childwin.cxx
+++ b/sfx2/source/appl/childwin.cxx
@@ -807,6 +807,9 @@ sal_Bool SfxChildWindow::QueryClose()
bAllow = xCtrl->suspend( sal_True );
}
+ if ( bAllow )
+ bAllow = !GetWindow()->IsInModalMode();
+
return bAllow;
}
diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx
index f9d458ed85..f9b2777852 100644
--- a/sfx2/source/appl/sfxhelp.cxx
+++ b/sfx2/source/appl/sfxhelp.cxx
@@ -193,7 +193,10 @@ sal_Bool GetHelpAnchor_Impl( const String& _rURL, String& _rAnchor )
sal_Bool bRet = sal_False;
::rtl::OUString sAnchor;
- ULONG nSolarCount = Application::ReleaseSolarMutex();
+ // --> OD 2009-07-01 #159496#
+ // do not release solar mutex due to crash regarding accessibility
+// ULONG nSolarCount = Application::ReleaseSolarMutex();
+ // <--
try
{
::ucbhelper::Content aCnt( INetURLObject( _rURL ).GetMainURL( INetURLObject::NO_DECODE ),
@@ -215,7 +218,9 @@ sal_Bool GetHelpAnchor_Impl( const String& _rURL, String& _rAnchor )
catch( ::com::sun::star::uno::Exception& )
{
}
- Application::AcquireSolarMutex( nSolarCount );
+ // --> OD 2009-07-01 #159496#
+// Application::AcquireSolarMutex( nSolarCount );
+ // <--
return bRet;
}
diff --git a/sfx2/source/appl/shutdownicon.cxx b/sfx2/source/appl/shutdownicon.cxx
index 3acd732095..693af2d0c0 100644
--- a/sfx2/source/appl/shutdownicon.cxx
+++ b/sfx2/source/appl/shutdownicon.cxx
@@ -495,8 +495,12 @@ IMPL_STATIC_LINK( ShutdownIcon, DialogClosedHdl_Impl, FileDialogHelper*, EMPTYAR
}
#ifdef WNT
- LeaveModalMode();
+ // #103346 Destroy dialog to prevent problems with custom controls
+ delete pThis->m_pFileDlg;
+ pThis->m_pFileDlg = NULL;
#endif
+
+ LeaveModalMode();
return 0;
}
diff --git a/sfx2/source/bastyp/progress.cxx b/sfx2/source/bastyp/progress.cxx
index 2b74482051..092dc73cf0 100644
--- a/sfx2/source/bastyp/progress.cxx
+++ b/sfx2/source/bastyp/progress.cxx
@@ -117,7 +117,7 @@ struct SfxProgress_Impl : public SfxCancellable
#define aTypeLibInfo aProgressTypeLibImpl
//========================================================================
-#if (_MSC_VER < 1300)
+#if defined(_MSC_VER) && (_MSC_VER < 1300)
inline ULONG Get10ThSec()
{
#if defined (MSC) && defined (WIN)
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index b57cdd9ff5..11e9fd3d77 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -765,6 +765,8 @@ void SAL_CALL SfxDispatchController_Impl::dispatch( const ::com::sun::star::util
sal_Bool bFailure = sal_False;
const SfxPoolItem* pItem = NULL;
SfxShell* pShell( 0 );
+ // #i102619# Retrieve metric from shell before execution - the shell could be destroyed after execution
+ SfxMapUnit eMapUnit( SFX_MAPUNIT_100TH_MM );
if ( pDispatcher->GetBindings() )
{
if ( !pDispatcher->IsLocked( GetId() ) )
@@ -783,6 +785,7 @@ void SAL_CALL SfxDispatchController_Impl::dispatch( const ::com::sun::star::util
lNewArgs[nIndex].Value = makeAny( SfxDispatchController_Impl::getSlaveCommand( aDispatchURL ));
}
+ eMapUnit = GetCoreMetric( pShell->GetPool(), GetId() );
SfxAllItemSet aSet( pShell->GetPool() );
TransformParameters( GetId(), lNewArgs, aSet, pSlot );
if ( aSet.Count() )
@@ -811,6 +814,7 @@ void SAL_CALL SfxDispatchController_Impl::dispatch( const ::com::sun::star::util
}
else
{
+ eMapUnit = GetCoreMetric( SFX_APP()->GetPool(), GetId() );
// AppDispatcher
SfxAllItemSet aSet( SFX_APP()->GetPool() );
TransformParameters( GetId(), lNewArgs, aSet );
@@ -850,13 +854,6 @@ void SAL_CALL SfxDispatchController_Impl::dispatch( const ::com::sun::star::util
aEvent.Source = (::com::sun::star::frame::XDispatch*) pDispatch;
if ( bSuccess && pItem && !pItem->ISA(SfxVoidItem) )
{
- // Retrieve metric from pool to have correct sub ID when calling QueryValue
- SfxMapUnit eMapUnit( SFX_MAPUNIT_100TH_MM );
- if ( pShell )
- eMapUnit = GetCoreMetric( pShell->GetPool(), GetId() );
- else
- eMapUnit = GetCoreMetric( SFX_APP()->GetPool(), GetId() );
-
USHORT nSubId( 0 );
if ( eMapUnit == SFX_MAPUNIT_TWIP )
nSubId |= CONVERT_TWIPS;
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index c160bbb8e7..d3839f7986 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -223,9 +223,9 @@ SfxDocumentInfoItem::SfxDocumentInfoItem()
, m_Keywords()
, m_Subject()
, m_Title()
- , bHasTemplate( sal_True )
- , bDeleteUserData( sal_False )
- , bIsUseUserData( sal_True )
+ , m_bHasTemplate( sal_True )
+ , m_bDeleteUserData( sal_False )
+ , m_bUseUserData( sal_True )
{
}
@@ -253,9 +253,9 @@ SfxDocumentInfoItem::SfxDocumentInfoItem( const String& rFile,
i_xDocProps->getKeywords()) )
, m_Subject( i_xDocProps->getSubject() )
, m_Title( i_xDocProps->getTitle() )
- , bHasTemplate( TRUE )
- , bDeleteUserData( sal_False )
- , bIsUseUserData( bIs )
+ , m_bHasTemplate( sal_True )
+ , m_bDeleteUserData( sal_False )
+ , m_bUseUserData( bIs )
{
try
{
@@ -302,15 +302,10 @@ SfxDocumentInfoItem::SfxDocumentInfoItem( const SfxDocumentInfoItem& rItem )
, m_Keywords( rItem.getKeywords() )
, m_Subject( rItem.getSubject() )
, m_Title( rItem.getTitle() )
- , bHasTemplate( rItem.bHasTemplate )
- , bDeleteUserData( rItem.bDeleteUserData )
- , bIsUseUserData( rItem.bIsUseUserData )
+ , m_bHasTemplate( rItem.m_bHasTemplate )
+ , m_bDeleteUserData( rItem.m_bDeleteUserData )
+ , m_bUseUserData( rItem.m_bUseUserData )
{
- for (size_t i = 0; i < 4; ++i) {
- m_UserDefinedFieldTitles[i] = rItem.getUserDefinedFieldTitle(i);
- m_UserDefinedFieldValues[i] = rItem.getUserDefinedFieldValue(i);
- }
-
for ( sal_uInt32 i = 0; i < rItem.m_aCustomProperties.size(); i++ )
{
CustomProperty* pProp = new CustomProperty( rItem.m_aCustomProperties[i]->m_sName,
@@ -384,8 +379,9 @@ void SfxDocumentInfoItem::resetUserData(const ::rtl::OUString & i_rAuthor)
//------------------------------------------------------------------------
-void SfxDocumentInfoItem::updateDocumentInfo(
- const uno::Reference<document::XDocumentProperties>& i_xDocProps) const
+void SfxDocumentInfoItem::UpdateDocumentInfo(
+ const uno::Reference<document::XDocumentProperties>& i_xDocProps,
+ bool i_bDoNotUpdateUserDefined) const
{
if (isAutoloadEnabled()) {
i_xDocProps->setAutoloadSecs(getAutoloadDelay());
@@ -410,6 +406,15 @@ void SfxDocumentInfoItem::updateDocumentInfo(
i_xDocProps->setSubject(getSubject());
i_xDocProps->setTitle(getTitle());
+ // this is necessary in case of replaying a recorded macro:
+ // in this case, the macro may contain the 4 old user-defined DocumentInfo
+ // fields, but not any of the DocumentInfo properties;
+ // as a consequence, most of the UserDefined properties of the
+ // DocumentProperties would be summarily deleted here, which does not
+ // seem like a good idea.
+ if (i_bDoNotUpdateUserDefined)
+ return;
+
try
{
Reference< beans::XPropertyContainer > xContainer = i_xDocProps->getUserDefinedProperties();
@@ -442,24 +447,24 @@ void SfxDocumentInfoItem::updateDocumentInfo(
//------------------------------------------------------------------------
-BOOL SfxDocumentInfoItem::IsDeleteUserData() const
+sal_Bool SfxDocumentInfoItem::IsDeleteUserData() const
{
- return bDeleteUserData;
+ return m_bDeleteUserData;
}
-void SfxDocumentInfoItem::SetDeleteUserData( BOOL bSet )
+void SfxDocumentInfoItem::SetDeleteUserData( sal_Bool bSet )
{
- bDeleteUserData = bSet;
+ m_bDeleteUserData = bSet;
}
-BOOL SfxDocumentInfoItem::IsUseUserData() const
+sal_Bool SfxDocumentInfoItem::IsUseUserData() const
{
- return bIsUseUserData;
+ return m_bUseUserData;
}
-void SfxDocumentInfoItem::SetUseUserData( BOOL bSet )
+void SfxDocumentInfoItem::SetUseUserData( sal_Bool bSet )
{
- bIsUseUserData = bSet;
+ m_bUseUserData = bSet;
}
std::vector< CustomProperty* > SfxDocumentInfoItem::GetCustomProperties() const
@@ -488,38 +493,11 @@ void SfxDocumentInfoItem::AddCustomProperty( const ::rtl::OUString& sName, const
m_aCustomProperties.push_back( pProp );
}
-::rtl::OUString SfxDocumentInfoItem::getUserDefinedFieldTitle(size_t i_ix) const
-{
- DBG_ASSERT(i_ix < 4, "SfxDocumentInfoItem: invalid index");
- return m_UserDefinedFieldTitles[i_ix];
-}
-
-::rtl::OUString SfxDocumentInfoItem::getUserDefinedFieldValue(size_t i_ix) const
-{
- DBG_ASSERT(i_ix < 4, "SfxDocumentInfoItem: invalid index");
- return m_UserDefinedFieldValues[i_ix];
-}
-
-void SfxDocumentInfoItem::setUserDefinedFieldTitle(size_t i_ix,
- ::rtl::OUString i_val)
-{
- DBG_ASSERT(i_ix < 4, "SfxDocumentInfoItem: invalid index");
- m_UserDefinedFieldTitles[i_ix] = i_val;
-}
-
-void SfxDocumentInfoItem::setUserDefinedFieldValue(size_t i_ix,
- ::rtl::OUString i_val)
-{
- DBG_ASSERT(i_ix < 4, "SfxDocumentInfoItem: invalid index");
- m_UserDefinedFieldValues[i_ix] = i_val;
-}
-
sal_Bool SfxDocumentInfoItem::QueryValue( Any& rVal, BYTE nMemberId ) const
{
String aValue;
sal_Int32 nValue = 0;
sal_Bool bValue = sal_False;
- BOOL bField = FALSE;
BOOL bIsInt = FALSE;
BOOL bIsString = FALSE;
nMemberId &= ~CONVERT_TWIPS;
@@ -562,43 +540,6 @@ sal_Bool SfxDocumentInfoItem::QueryValue( Any& rVal, BYTE nMemberId ) const
bIsString = TRUE;
aValue = getTitle();
break;
- case MID_DOCINFO_FIELD1:
- case MID_DOCINFO_FIELD2:
- case MID_DOCINFO_FIELD3:
- case MID_DOCINFO_FIELD4:
- bField = TRUE;
- // no break here
- case MID_DOCINFO_FIELD1TITLE:
- case MID_DOCINFO_FIELD2TITLE:
- case MID_DOCINFO_FIELD3TITLE:
- case MID_DOCINFO_FIELD4TITLE:
- {
- bIsString = TRUE;
- USHORT nSub = MID_DOCINFO_FIELD1TITLE;
- if ( bField )
- {
- nSub = MID_DOCINFO_FIELD1;
- }
- if ( bField )
- {
- DBG_ASSERT( nMemberId == MID_DOCINFO_FIELD1 ||
- nMemberId == MID_DOCINFO_FIELD2 ||
- nMemberId == MID_DOCINFO_FIELD3 ||
- nMemberId == MID_DOCINFO_FIELD4,
- "SfxDocumentInfoItem:Anpassungsfehler" );
- aValue = getUserDefinedFieldValue( nMemberId - nSub );
- }
- else
- {
- DBG_ASSERT( nMemberId == MID_DOCINFO_FIELD1TITLE ||
- nMemberId == MID_DOCINFO_FIELD2TITLE ||
- nMemberId == MID_DOCINFO_FIELD3TITLE ||
- nMemberId == MID_DOCINFO_FIELD4TITLE,
- "SfxDocumentInfoItem:Anpassungsfehler" );
- aValue = getUserDefinedFieldTitle( nMemberId - nSub );
- }
- break;
- }
default:
DBG_ERROR("Wrong MemberId!");
return sal_False;
@@ -673,28 +614,6 @@ sal_Bool SfxDocumentInfoItem::PutValue( const Any& rVal, BYTE nMemberId )
if ( bRet )
setTitle(aValue);
break;
- case MID_DOCINFO_FIELD1TITLE:
- case MID_DOCINFO_FIELD2TITLE:
- case MID_DOCINFO_FIELD3TITLE:
- case MID_DOCINFO_FIELD4TITLE:
- {
- bRet = (rVal >>= aValue);
- if ( bRet )
- setUserDefinedFieldTitle(
- nMemberId - MID_DOCINFO_FIELD1TITLE, String(aValue));
- break;
- }
- case MID_DOCINFO_FIELD1:
- case MID_DOCINFO_FIELD2:
- case MID_DOCINFO_FIELD3:
- case MID_DOCINFO_FIELD4:
- {
- bRet = (rVal >>= aValue);
- if ( bRet )
- setUserDefinedFieldValue(
- nMemberId - MID_DOCINFO_FIELD1, String(aValue));
- break;
- }
default:
DBG_ERROR("Wrong MemberId!");
return sal_False;
@@ -1178,7 +1097,7 @@ void SfxDocumentPage::Reset( const SfxItemSet& rSet )
aFileValFt.SetText( aURL.GetPartBeforeLastName() );
// handle access data
- BOOL bIsUseUserData = pInfoItem->IsUseUserData();
+ sal_Bool m_bUseUserData = pInfoItem->IsUseUserData();
LocaleDataWrapper aLocaleWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() );
aCreateValFt.SetText( ConvertDateTime_Impl( pInfoItem->getAuthor(),
pInfoItem->getCreationDate(), aLocaleWrapper ) );
@@ -1193,7 +1112,7 @@ void SfxDocumentPage::Reset( const SfxItemSet& rSet )
aPrintValFt.SetText( ConvertDateTime_Impl( pInfoItem->getPrintedBy(),
aTime, aLocaleWrapper ) );
const long nTime = pInfoItem->getEditingDuration();
- if( bIsUseUserData )
+ if ( m_bUseUserData )
{
const Time aT( nTime/3600, (nTime%3600)/60, nTime%60 );
aTimeLogValFt.SetText( aLocaleWrapper.getDuration( aT ) );
@@ -1201,7 +1120,7 @@ void SfxDocumentPage::Reset( const SfxItemSet& rSet )
pInfoItem->getEditingCycles() ) );
}
- TriState eState = (TriState)bIsUseUserData;
+ TriState eState = (TriState)m_bUseUserData;
if ( STATE_DONTKNOW == eState )
aUseUserDataCB.EnableTriState( TRUE );
@@ -1558,192 +1477,6 @@ int SfxInternetPage::DeactivatePage( SfxItemSet* /*pSet*/ )
//------------------------------------------------------------------------
-SfxDocumentUserPage::SfxDocumentUserPage( Window* pParent,
- const SfxItemSet& rItemSet ) :
-
- SfxTabPage( pParent, SfxResId( TP_DOCINFOUSER ), rItemSet ),
-
- bLabelModified ( FALSE ),
- aInfo1Ft ( this, SfxResId( FT_INFO1 ) ),
- aInfo1Ed ( this, SfxResId( ED_INFO1 ) ),
- aInfo2Ft ( this, SfxResId( FT_INFO2 ) ),
- aInfo2Ed ( this, SfxResId( ED_INFO2 ) ),
- aInfo3Ft ( this, SfxResId( FT_INFO3 ) ),
- aInfo3Ed ( this, SfxResId( ED_INFO3 ) ),
- aInfo4Ft ( this, SfxResId( FT_INFO4 ) ),
- aInfo4Ed ( this, SfxResId( ED_INFO4 ) ),
- aEditLabelBtn ( this, SfxResId( BTN_EDITLABEL ) ),
-
- pInfoItem ( NULL )
-
-{
- FreeResource();
- //increase button width in case of long labels
- Size aButtonSize = aEditLabelBtn.GetOutputSizePixel();
- sal_Int32 nTextWidth = aEditLabelBtn.GetTextWidth(aEditLabelBtn.GetText());
- //add some additional space
- sal_Int32 nDiff = nTextWidth + 4 - aButtonSize.Width();
- if( nDiff > 0)
- {
- Point aPos(aEditLabelBtn.GetPosPixel());
- aPos.X() -= nDiff;
- aButtonSize.Width() += nDiff;
- aEditLabelBtn.SetPosSizePixel(aPos, aButtonSize);
- }
-
- aEditLabelBtn.SetClickHdl( LINK( this, SfxDocumentUserPage, EditLabelHdl ) );
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SfxDocumentUserPage, EditLabelHdl, PushButton *, pPushButton )
-{
- (void)pPushButton; //unused
- SfxDocInfoEditDlg* pDlg = new SfxDocInfoEditDlg( this );
- pDlg->SetText1( GetLabelText_Impl( &aInfo1Ft ) );
- pDlg->SetText2( GetLabelText_Impl( &aInfo2Ft ) );
- pDlg->SetText3( GetLabelText_Impl( &aInfo3Ft ) );
- pDlg->SetText4( GetLabelText_Impl( &aInfo4Ft ) );
-
- if ( RET_OK == pDlg->Execute() )
- {
- SetLabelText_Impl( &aInfo1Ft, pDlg->GetText1() );
- SetLabelText_Impl( &aInfo2Ft, pDlg->GetText2() );
- SetLabelText_Impl( &aInfo3Ft, pDlg->GetText3() );
- SetLabelText_Impl( &aInfo4Ft, pDlg->GetText4() );
- bLabelModified = TRUE;
- }
- delete pDlg;
- return 0;
-}
-
-//------------------------------------------------------------------------
-
-String SfxDocumentUserPage::GetLabelText_Impl( FixedText* pLabel )
-{
- DBG_ASSERT( pLabel, "SfxDocumentUserPage::SetLabelText_Impl(): invalid label" );
- String aLabel = pLabel->GetText();
- aLabel.Erase( 0, aLabel.Search( ' ' ) + 1 );
- return aLabel;
-}
-
-//------------------------------------------------------------------------
-
-void SfxDocumentUserPage::SetLabelText_Impl( FixedText* pLabel, const String& rNewLabel )
-{
- String aLabel( '~' );
- sal_Int32 nNumber = 0;
- if ( &aInfo1Ft == pLabel )
- nNumber = 1;
- else if ( &aInfo2Ft == pLabel )
- nNumber = 2;
- else if ( &aInfo3Ft == pLabel )
- nNumber = 3;
- else if ( &aInfo4Ft == pLabel )
- nNumber = 4;
- DBG_ASSERT( nNumber > 0, "SfxDocumentUserPage::SetLabelText_Impl(): wrong label" );
- aLabel += String::CreateFromInt32( nNumber );
- aLabel += String( DEFINE_CONST_UNICODE(": ") );
- aLabel += rNewLabel;
- DBG_ASSERT( pLabel, "SfxDocumentUserPage::SetLabelText_Impl(): invalid label" );
- pLabel->SetText( aLabel );
-}
-
-//------------------------------------------------------------------------
-
-SfxTabPage* SfxDocumentUserPage::Create( Window* pParent, const SfxItemSet& rItemSet )
-{
- return new SfxDocumentUserPage(pParent, rItemSet);
-}
-
-//------------------------------------------------------------------------
-
-BOOL SfxDocumentUserPage::FillItemSet( SfxItemSet& rSet )
-{
- const BOOL bMod = bLabelModified ||
- aInfo1Ed.IsModified() || aInfo2Ed.IsModified() ||
- aInfo3Ed.IsModified() || aInfo4Ed.IsModified();
- if ( !bMod )
- return FALSE;
-
- const SfxPoolItem* pItem = NULL;
- SfxDocumentInfoItem* pInfo = NULL;
- SfxTabDialog* pDlg = GetTabDialog();
- const SfxItemSet* pExSet = NULL;
-
- if ( pDlg )
- pExSet = pDlg->GetExampleSet();
-
- if ( pExSet && SFX_ITEM_SET != pExSet->GetItemState( SID_DOCINFO, TRUE, &pItem ) )
- pInfo = pInfoItem;
- else if ( pItem )
- pInfo = new SfxDocumentInfoItem( *(const SfxDocumentInfoItem*)pItem );
-
- if ( !pInfo )
- {
- DBG_ERRORFILE( "SfxDocumentUserPage::FillItemSet(): no item found" );
- return FALSE;
- }
-
- if ( bLabelModified || aInfo1Ed.IsModified() )
- {
- XubString aTitle = GetLabelText_Impl( &aInfo1Ft );
- pInfo->setUserDefinedFieldTitle( 0, aTitle );
- pInfo->setUserDefinedFieldValue( 0, aInfo1Ed.GetText() );
- }
- if ( bLabelModified || aInfo2Ed.IsModified() )
- {
- XubString aTitle = GetLabelText_Impl( &aInfo2Ft );
- pInfo->setUserDefinedFieldTitle( 1, aTitle );
- pInfo->setUserDefinedFieldValue( 1, aInfo2Ed.GetText() );
- }
- if ( bLabelModified || aInfo3Ed.IsModified() )
- {
- XubString aTitle = GetLabelText_Impl( &aInfo3Ft );
- pInfo->setUserDefinedFieldTitle( 2, aTitle );
- pInfo->setUserDefinedFieldValue( 2, aInfo3Ed.GetText() );
- }
- if ( bLabelModified || aInfo4Ed.IsModified() )
- {
- XubString aTitle = GetLabelText_Impl( &aInfo4Ft );
- pInfo->setUserDefinedFieldTitle( 3, aTitle );
- pInfo->setUserDefinedFieldValue( 3, aInfo4Ed.GetText() );
- }
- rSet.Put( *pInfo );
- if ( pInfo != pInfoItem )
- delete pInfo;
- return bMod;
-}
-
-//------------------------------------------------------------------------
-
-void SfxDocumentUserPage::Reset(const SfxItemSet &rSet)
-{
- pInfoItem = &(SfxDocumentInfoItem&)rSet.Get( SID_DOCINFO );
-
- SetLabelText_Impl( &aInfo1Ft, pInfoItem->getUserDefinedFieldTitle(0) );
- aInfo1Ed.SetText( pInfoItem->getUserDefinedFieldValue(0) );
- SetLabelText_Impl( &aInfo2Ft, pInfoItem->getUserDefinedFieldTitle(1) );
- aInfo2Ed.SetText( pInfoItem->getUserDefinedFieldValue(1) );
- SetLabelText_Impl( &aInfo3Ft, pInfoItem->getUserDefinedFieldTitle(2) );
- aInfo3Ed.SetText( pInfoItem->getUserDefinedFieldValue(2) );
- SetLabelText_Impl( &aInfo4Ft, pInfoItem->getUserDefinedFieldTitle(3) );
- aInfo4Ed.SetText( pInfoItem->getUserDefinedFieldValue(3) );
- bLabelModified = FALSE;
-
- SFX_ITEMSET_ARG( &rSet, pROItem, SfxBoolItem, SID_DOC_READONLY, FALSE );
- if ( pROItem && pROItem->GetValue() )
- {
- aInfo1Ed.SetReadOnly( TRUE );
- aInfo2Ed.SetReadOnly( TRUE );
- aInfo3Ed.SetReadOnly( TRUE );
- aInfo4Ed.SetReadOnly( TRUE );
- aEditLabelBtn.Disable();
- }
-}
-
-//------------------------------------------------------------------------
-
SfxDocumentInfoDialog::SfxDocumentInfoDialog( Window* pParent,
const SfxItemSet& rItemSet ) :
diff --git a/sfx2/source/dialog/dockwin.cxx b/sfx2/source/dialog/dockwin.cxx
index ce0f5a4cc1..b10283c849 100644
--- a/sfx2/source/dialog/dockwin.cxx
+++ b/sfx2/source/dialog/dockwin.cxx
@@ -236,6 +236,7 @@ SfxDockingWrapper::SfxDockingWrapper( Window* pParentWnd ,
}
Window* pContentWindow = VCLUnoHelper::GetWindow(xWindow);
+ pContentWindow->SetStyle( pContentWindow->GetStyle() | WB_DIALOGCONTROL | WB_CHILDDLGCTRL );
pTitleDockWindow->SetWrappedWindow(pContentWindow);
}
diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx
index f8d7cc4958..adb6b581c6 100644
--- a/sfx2/source/dialog/filedlghelper.cxx
+++ b/sfx2/source/dialog/filedlghelper.cxx
@@ -87,6 +87,7 @@
#endif
#include <svtools/pickerhelper.hxx>
#include <svtools/docpasswdrequest.hxx>
+#include <svtools/docmspasswdrequest.hxx>
#include <ucbhelper/content.hxx>
#include <ucbhelper/commandenvironment.hxx>
#include <comphelper/storagehelper.hxx>
@@ -556,13 +557,34 @@ void FileDialogHelper_Impl::updateSelectionBox()
}
// ------------------------------------------------------------------------
+struct CheckMSPasswordCapability
+{
+ sal_Bool operator() ( const String rFilterName )
+ {
+ return rFilterName.EqualsAscii("MS Word 97");
+ }
+};
+
+// ------------------------------------------------------------------------
struct CheckPasswordCapability
{
sal_Bool operator() ( const SfxFilter* _pFilter )
{
- return _pFilter && _pFilter->IsOwnFormat()
- && _pFilter->UsesStorage()
- && ( SOFFICE_FILEFORMAT_60 <= _pFilter->GetVersion() );
+ if (!_pFilter)
+ return false;
+
+#if 0 // to be enabled in the future
+ if (_pFilter->GetFilterName().EqualsAscii("MS Excel 97"))
+ // For now, we eanble password protection for Excel 97 as a
+ // special case. If we start having more filters supporting
+ // export encryption with password, we should probably switch to
+ // using a filter flag instead.
+ return true;
+#endif
+
+ return ( _pFilter->IsOwnFormat() && _pFilter->UsesStorage()
+ && ( SOFFICE_FILEFORMAT_60 <= _pFilter->GetVersion() ) )
+ || CheckMSPasswordCapability()( _pFilter->GetFilterName() );
}
};
@@ -1347,6 +1369,7 @@ sal_Int16 FileDialogHelper_Impl::implDoExecute()
//On MacOSX the native file picker has to run in the primordial thread because of drawing issues
//On Linux the native gtk file picker, when backed by gnome-vfs2, needs to be run in the same
//primordial thread as the ucb gnome-vfs2 provider was initialized in.
+/*
#ifdef WNT
if ( mbSystemPicker )
{
@@ -1360,9 +1383,18 @@ sal_Int16 FileDialogHelper_Impl::implDoExecute()
}
else
#endif
+*/
{
try
{
+#ifdef WNT
+ if ( mbSystemPicker )
+ {
+ OReleaseSolarMutex aSolarMutex;
+ nRet = mxFileDlg->execute();
+ }
+ else
+#endif
nRet = mxFileDlg->execute();
}
catch( const Exception& )
@@ -1633,20 +1665,36 @@ ErrCode FileDialogHelper_Impl::execute( SvStringsDtor*& rpURLList,
sal_Bool bPassWord = sal_False;
if ( ( aValue >>= bPassWord ) && bPassWord )
{
- // ask for the password
+ // ask for a password
uno::Reference < ::com::sun::star::task::XInteractionHandler > xInteractionHandler( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString::createFromAscii("com.sun.star.comp.uui.UUIInteractionHandler")), UNO_QUERY );
if( xInteractionHandler.is() )
{
- RequestDocumentPassword* pPasswordRequest = new RequestDocumentPassword(
- ::com::sun::star::task::PasswordRequestMode_PASSWORD_CREATE, *(rpURLList->GetObject(0)) );
-
- uno::Reference< com::sun::star::task::XInteractionRequest > rRequest( pPasswordRequest );
- xInteractionHandler->handle( rRequest );
- if ( pPasswordRequest->isPassword() )
- rpSet->Put( SfxStringItem( SID_PASSWORD, pPasswordRequest->getPassword() ) );
+ // TODO: find out a way to set the 1-15 char limits on MS Excel 97 filter.
+ if ( CheckMSPasswordCapability()( rFilter ) )
+ {
+ RequestMSDocumentPassword* pMSPasswordRequest = new RequestMSDocumentPassword(
+ ::com::sun::star::task::PasswordRequestMode_PASSWORD_CREATE, *(rpURLList->GetObject(0)) );
+
+ uno::Reference< com::sun::star::task::XInteractionRequest > rRequest( pMSPasswordRequest );
+ xInteractionHandler->handle( rRequest );
+ if ( pMSPasswordRequest->isPassword() )
+ rpSet->Put( SfxStringItem( SID_PASSWORD, pMSPasswordRequest->getPassword() ) );
+ else
+ return ERRCODE_ABORT;
+ }
else
- return ERRCODE_ABORT;
+ {
+ RequestDocumentPassword* pPasswordRequest = new RequestDocumentPassword(
+ ::com::sun::star::task::PasswordRequestMode_PASSWORD_CREATE, *(rpURLList->GetObject(0)) );
+
+ uno::Reference< com::sun::star::task::XInteractionRequest > rRequest( pPasswordRequest );
+ xInteractionHandler->handle( rRequest );
+ if ( pPasswordRequest->isPassword() )
+ rpSet->Put( SfxStringItem( SID_PASSWORD, pPasswordRequest->getPassword() ) );
+ else
+ return ERRCODE_ABORT;
+ }
}
}
}
@@ -2570,6 +2618,46 @@ Sequence < OUString > FileDialogHelper::GetMPath() const
}
// ------------------------------------------------------------------------
+Sequence< ::rtl::OUString > FileDialogHelper::GetSelectedFiles() const
+{
+ // a) the new way (optional!)
+ uno::Sequence< ::rtl::OUString > aResultSeq;
+ uno::Reference< XFilePicker2 > xPickNew(mpImp->mxFileDlg, UNO_QUERY);
+ if (xPickNew.is())
+ {
+ aResultSeq = xPickNew->getSelectedFiles();
+ }
+ // b) the olde way ... non optional.
+ else
+ {
+ uno::Reference< XFilePicker > xPickOld(mpImp->mxFileDlg, UNO_QUERY_THROW);
+ Sequence< OUString > lFiles = xPickOld->getFiles();
+ ::sal_Int32 nFiles = lFiles.getLength();
+ if ( nFiles > 1 )
+ {
+ aResultSeq = Sequence< ::rtl::OUString >( nFiles-1 );
+
+ INetURLObject aPath( lFiles[0] );
+ aPath.setFinalSlash();
+
+ for (::sal_Int32 i = 1; i < nFiles; i++)
+ {
+ if (i == 1)
+ aPath.Append( lFiles[i] );
+ else
+ aPath.setName( lFiles[i] );
+
+ aResultSeq[i-1] = ::rtl::OUString(aPath.GetMainURL( INetURLObject::NO_DECODE ));
+ }
+ }
+ else
+ aResultSeq = lFiles;
+ }
+
+ return aResultSeq;
+}
+
+// ------------------------------------------------------------------------
String FileDialogHelper::GetDisplayDirectory() const
{
return mpImp->getPath();
diff --git a/sfx2/source/dialog/passwd.cxx b/sfx2/source/dialog/passwd.cxx
index ca7aa40f05..628258eb13 100644
--- a/sfx2/source/dialog/passwd.cxx
+++ b/sfx2/source/dialog/passwd.cxx
@@ -112,6 +112,15 @@ void SfxPasswordDialog::SetMinLen( USHORT nLen )
// -----------------------------------------------------------------------
+void SfxPasswordDialog::SetMaxLen( USHORT nLen )
+{
+ maPasswordED.SetMaxTextLen( nLen );
+ maConfirmED.SetMaxTextLen( nLen );
+ EditModifyHdl( NULL );
+}
+
+// -----------------------------------------------------------------------
+
short SfxPasswordDialog::Execute()
{
if ( mnExtras < SHOWEXTRAS_ALL )
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index df4b8bfecb..2cc7b52d25 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -79,7 +79,6 @@
#include "imgmgr.hxx"
#include "helpid.hrc"
#include "appdata.hxx"
-#include "objshimp.hxx"
#include <sfx2/viewfrm.hxx>
#include <comphelper/configurationhelper.hxx>
@@ -103,8 +102,8 @@ using namespace ::com::sun::star::uno;
static USHORT nLastItemId = USHRT_MAX;
-// filter box has maximum 7 entries visible
-#define MAX_FILTER_ENTRIES 7
+// filter box has maximum 12 entries visible
+#define MAX_FILTER_ENTRIES 12
//=========================================================================
@@ -883,7 +882,7 @@ void SfxCommonTemplateDialog_Impl::ReadResource()
nActFilter = pCurObjShell ? static_cast< USHORT >( LoadFactoryStyleFilter( pCurObjShell ) ) : 0xFFFF;
if ( pCurObjShell && 0xFFFF == nActFilter )
- nActFilter = pCurObjShell->pImp->nStyleFilter;
+ nActFilter = pCurObjShell->GetAutoStyleFilterIndex();
// Einfuegen in die Toolbox
// umgekehrte Reihenfolge, da immer vorne eingefuegt wird.
@@ -1300,7 +1299,7 @@ void SfxCommonTemplateDialog_Impl::UpdateStyles_Impl(USHORT nFlags) // Flags
if(pTreeBox)
aFilterLb.SelectEntry(String(SfxResId(STR_STYLE_FILTER_HIERARCHICAL)));
- // show maximum seven entries
+ // show maximum 12 entries
aFilterLb.SetDropDownLineCount( MAX_FILTER_ENTRIES );
aFilterLb.SetUpdateMode(TRUE);
}
@@ -1504,7 +1503,7 @@ void SfxCommonTemplateDialog_Impl::Update_Impl()
CheckItem( nActFamily, TRUE );
nActFilter = static_cast< USHORT >( LoadFactoryStyleFilter( pDocShell ) );
if ( 0xFFFF == nActFilter )
- nActFilter = pDocShell->pImp->nStyleFilter;
+ nActFilter = pDocShell->GetAutoStyleFilterIndex();
nAppFilter = pItem->GetValue();
if(!pTreeBox)
@@ -1674,7 +1673,7 @@ void SfxCommonTemplateDialog_Impl::FilterSelect(
SfxObjectShell *pDocShell = pViewFrame->GetObjectShell();
if (pDocShell)
{
- pDocShell->Get_Impl()->nStyleFilter = nActFilter;
+ pDocShell->SetAutoStyleFilterIndex(nActFilter);
SaveFactoryStyleFilter( pDocShell, nActFilter );
}
@@ -1885,8 +1884,8 @@ void SfxCommonTemplateDialog_Impl::ActionSelect(USHORT nEntry)
pStyleSheetPool->SetSearchMask( eFam, SFXSTYLEBIT_USERDEF );
SfxNewStyleDlg *pDlg =
- // FloatingWindow must not be parent of a modal dialog
- new SfxNewStyleDlg(SFX_APP()->GetTopWindow(), *pStyleSheetPool);
+ // why? : FloatingWindow must not be parent of a modal dialog
+ new SfxNewStyleDlg(pWindow, *pStyleSheetPool);
if(RET_OK == pDlg->Execute())
{
pStyleSheetPool->SetSearchMask(eFam, nFilter);
diff --git a/sfx2/source/doc/DocumentMetadataAccess.cxx b/sfx2/source/doc/DocumentMetadataAccess.cxx
new file mode 100644
index 0000000000..112183a4ef
--- /dev/null
+++ b/sfx2/source/doc/DocumentMetadataAccess.cxx
@@ -0,0 +1,1414 @@
+/*************************************************************************
+ *
+ * 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: DocumentMetadataAccess.cxx,v $
+ * $Revision: 1.1.2.9 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "precompiled_sfx2.hxx"
+
+#include <sfx2/DocumentMetadataAccess.hxx>
+
+#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/embed/ElementModes.hpp>
+#include <com/sun/star/embed/XStorage.hpp>
+#include <com/sun/star/embed/XTransactedObject.hpp>
+#include <com/sun/star/task/ErrorCodeIOException.hpp>
+#include <com/sun/star/ucb/InteractiveAugmentedIOException.hpp>
+#include <com/sun/star/rdf/FileFormat.hpp>
+#include <com/sun/star/rdf/URIs.hpp>
+#include <com/sun/star/rdf/Statement.hpp>
+#include <com/sun/star/rdf/Literal.hpp>
+#include <com/sun/star/rdf/URI.hpp>
+#include <com/sun/star/rdf/Repository.hpp>
+
+#include <rtl/uuid.h>
+#include <rtl/ustrbuf.hxx>
+
+#include <comphelper/interaction.hxx>
+#include <comphelper/makesequence.hxx>
+#include <comphelper/mediadescriptor.hxx>
+#include <comphelper/sequenceasvector.hxx>
+#include <comphelper/storagehelper.hxx>
+
+#include <sfx2/docfile.hxx>
+#include <sfx2/XmlIdRegistry.hxx>
+
+#include <libxml/tree.h> // for xmlValidateNCName
+
+#include <boost/bind.hpp>
+#include <boost/shared_array.hpp>
+#include <boost/tuple/tuple.hpp>
+
+#include <vector>
+#include <set>
+#include <map>
+#include <functional>
+#include <algorithm>
+
+#include <unotools/ucbhelper.hxx>
+#include <com/sun/star/uri/XUriReference.hpp>
+#include <com/sun/star/uri/XUriReferenceFactory.hpp>
+#include <com/sun/star/uri/XVndSunStarPkgUrlReferenceFactory.hpp>
+
+
+/*
+ Note: in the context of this implementation, all rdf.QueryExceptions and
+ rdf.RepositoryExceptions are RuntimeExceptions, and will be reported as such.
+
+ This implementation assumes that it is only used with ODF documents, not mere
+ ODF packages. In other words, we enforce that metadata files must not be
+ called reserved names.
+ */
+
+using namespace ::com::sun::star;
+
+namespace sfx2 {
+
+
+bool isValidNCName(::rtl::OUString const & i_rIdref)
+{
+ const ::rtl::OString id(
+ ::rtl::OUStringToOString(i_rIdref, RTL_TEXTENCODING_UTF8) );
+ return !(xmlValidateNCName(
+ reinterpret_cast<const unsigned char*>(id.getStr()), 0));
+}
+
+////////////////////////////////////////////////////////////////////////////
+
+static const char s_content [] = "content.xml";
+static const char s_styles [] = "styles.xml";
+static const char s_meta [] = "meta.xml";
+static const char s_settings[] = "settings.xml";
+static const char s_manifest[] = "manifest.rdf";
+static const char s_rdfxml [] = "application/rdf+xml";
+static const char s_odfmime [] = "application/vnd.oasis.opendocument.";
+
+////////////////////////////////////////////////////////////////////////////
+
+static bool isContentFile(::rtl::OUString const & i_rPath)
+{
+ return i_rPath.equalsAscii(s_content);
+}
+
+static bool isStylesFile (::rtl::OUString const & i_rPath)
+{
+ return i_rPath.equalsAscii(s_styles);
+}
+
+static bool isReservedFile(::rtl::OUString const & i_rPath)
+{
+ return isContentFile(i_rPath)
+ || isStylesFile(i_rPath)
+ || i_rPath.equalsAscii(s_meta)
+ || i_rPath.equalsAscii(s_settings);
+}
+
+////////////////////////////////////////////////////////////////////////////
+
+uno::Reference<rdf::XURI> createBaseURI(
+ uno::Reference<uno::XComponentContext> const & i_xContext,
+ uno::Reference<embed::XStorage> const & i_xStorage,
+ ::rtl::OUString const & i_rPkgURI, ::rtl::OUString const & i_rSubDocument)
+{
+ if (!i_xContext.is() || !i_xStorage.is() || !i_rPkgURI.getLength()) {
+ throw uno::RuntimeException();
+ }
+
+ const uno::Reference<lang::XMultiComponentFactory> xServiceFactory(
+ i_xContext->getServiceManager(), uno::UNO_SET_THROW);
+ const uno::Reference<uri::XUriReferenceFactory> xUriFactory(
+ xServiceFactory->createInstanceWithContext(
+ ::rtl::OUString::createFromAscii(
+ "com.sun.star.uri.UriReferenceFactory"), i_xContext),
+ uno::UNO_QUERY_THROW);
+ uno::Reference< uri::XUriReference > xBaseURI;
+
+ const uno::Reference< uri::XUriReference > xPkgURI(
+ xUriFactory->parse(i_rPkgURI), uno::UNO_SET_THROW );
+ xPkgURI->clearFragment();
+ // need to know whether the storage is a FileSystemStorage
+ // XServiceInfo would be better, but it is not implemented
+// if ( i_rPkgURI.getLength() && ::utl::UCBContentHelper::IsFolder(i_rPkgURI) )
+ if (true) {
+ xBaseURI.set( xPkgURI, uno::UNO_SET_THROW );
+#if 0
+ } else {
+ const uno::Reference<uri::XVndSunStarPkgUrlReferenceFactory>
+ xPkgUriFactory( xServiceFactory->createInstanceWithContext(
+ ::rtl::OUString::createFromAscii(
+ "com.sun.star.uri.VndSunStarPkgUrlReferenceFactory"),
+ i_xContext),
+ uno::UNO_QUERY_THROW);
+ xBaseURI.set( xPkgUriFactory->createVndSunStarPkgUrlReference(xPkgURI),
+ uno::UNO_SET_THROW );
+#endif
+ }
+ ::rtl::OUStringBuffer buf;
+ if (!xBaseURI->getUriReference().endsWithAsciiL("/", 1))
+ {
+ const sal_Int32 count( xBaseURI->getPathSegmentCount() );
+ if (count > 0)
+ {
+ const ::rtl::OUString last( xBaseURI->getPathSegment(count - 1) );
+ buf.append(last);
+ }
+ buf.append(static_cast<sal_Unicode>('/'));
+ }
+ if (i_rSubDocument.getLength())
+ {
+ buf.append(i_rSubDocument);
+ buf.append(static_cast<sal_Unicode>('/'));
+ }
+ const ::rtl::OUString Path(buf.makeStringAndClear());
+ if (Path.getLength())
+ {
+ const uno::Reference< uri::XUriReference > xPathURI(
+ xUriFactory->parse(Path), uno::UNO_SET_THROW );
+ xBaseURI.set(
+ xUriFactory->makeAbsolute(xBaseURI, xPathURI,
+ true, uri::RelativeUriExcessParentSegments_ERROR),
+ uno::UNO_SET_THROW);
+ }
+
+ return rdf::URI::create(i_xContext, xBaseURI->getUriReference());
+}
+
+////////////////////////////////////////////////////////////////////////////
+
+struct DocumentMetadataAccess_Impl
+{
+ // note: these are all initialized in constructor, and loadFromStorage
+ const uno::Reference<uno::XComponentContext> m_xContext;
+ const IXmlIdRegistrySupplier & m_rXmlIdRegistrySupplier;
+ uno::Reference<rdf::XURI> m_xBaseURI;
+ uno::Reference<rdf::XRepository> m_xRepository;
+ uno::Reference<rdf::XNamedGraph> m_xManifest;
+ DocumentMetadataAccess_Impl(
+ uno::Reference<uno::XComponentContext> const& i_xContext,
+ IXmlIdRegistrySupplier const & i_rRegistrySupplier)
+ : m_xContext(i_xContext)
+ , m_rXmlIdRegistrySupplier(i_rRegistrySupplier)
+ , m_xBaseURI()
+ , m_xRepository()
+ , m_xManifest()
+ {
+ OSL_ENSURE(m_xContext.is(), "context null");
+ }
+};
+
+// this is... a hack.
+template<sal_Int16 Constant>
+/*static*/ uno::Reference<rdf::XURI>
+getURI(uno::Reference< uno::XComponentContext > const & i_xContext)
+{
+ static uno::Reference< rdf::XURI > xURI(
+ rdf::URI::createKnown(i_xContext, Constant), uno::UNO_QUERY_THROW);
+ return xURI;
+}
+
+
+/** would storing the file to a XStorage succeed? */
+static bool isFileNameValid(const ::rtl::OUString & i_rFileName)
+{
+ if (i_rFileName.getLength() <= 0) return false;
+ if (i_rFileName[0] == '/') return false; // no absolute paths!
+ sal_Int32 idx(0);
+ do {
+ const ::rtl::OUString segment(
+ i_rFileName.getToken(0, static_cast<sal_Unicode> ('/'), idx) );
+ if (!segment.getLength() || // no empty segments
+ segment.equalsAscii(".") || // no . segments
+ segment.equalsAscii("..") || // no .. segments
+ !::comphelper::OStorageHelper::IsValidZipEntryFileName(
+ segment, sal_False)) // no invalid characters
+ return false;
+ } while (idx >= 0);
+ return true;
+}
+
+/** split a uri hierarchy into first segment and rest */
+static bool
+splitPath(::rtl::OUString const & i_rPath,
+ ::rtl::OUString & o_rDir, ::rtl::OUString& o_rRest)
+{
+ const sal_Int32 idx(i_rPath.indexOf(static_cast<sal_Unicode>('/')));
+ if (idx < 0 || idx >= i_rPath.getLength()) {
+ o_rDir = ::rtl::OUString();
+ o_rRest = i_rPath;
+ return true;
+ } else if (idx == 0 || idx == i_rPath.getLength() - 1) {
+ // input must not start or end with '/'
+ return false;
+ } else {
+ o_rDir = (i_rPath.copy(0, idx));
+ o_rRest = (i_rPath.copy(idx+1));
+ return true;
+ }
+}
+
+static bool
+splitXmlId(::rtl::OUString const & i_XmlId,
+ ::rtl::OUString & o_StreamName, ::rtl::OUString& o_Idref )
+{
+ const sal_Int32 idx(i_XmlId.indexOf(static_cast<sal_Unicode>('#')));
+ if ((idx <= 0) || (idx >= i_XmlId.getLength() - 1)) {
+ return false;
+ } else {
+ o_StreamName = (i_XmlId.copy(0, idx));
+ o_Idref = (i_XmlId.copy(idx+1));
+ return isValidXmlId(o_StreamName, o_Idref);
+ }
+}
+
+////////////////////////////////////////////////////////////////////////////
+
+static uno::Reference<rdf::XURI>
+getURIForStream(struct DocumentMetadataAccess_Impl& i_rImpl,
+ ::rtl::OUString const& i_rPath)
+{
+ const uno::Reference<rdf::XURI> xURI(
+ rdf::URI::createNS( i_rImpl.m_xContext,
+ i_rImpl.m_xBaseURI->getStringValue(), i_rPath),
+ uno::UNO_SET_THROW);
+ return xURI;
+}
+
+/** add statements declaring i_xResource to be a file of type i_xType with
+ path i_rPath to manifest, with optional additional types i_pTypes */
+static void
+addFile(struct DocumentMetadataAccess_Impl & i_rImpl,
+ uno::Reference<rdf::XURI> const& i_xType,
+ ::rtl::OUString const & i_rPath,
+ const uno::Sequence < uno::Reference< rdf::XURI > > * i_pTypes = 0)
+{
+ try {
+ const uno::Reference<rdf::XURI> xURI( getURIForStream(
+ i_rImpl, i_rPath) );
+
+ i_rImpl.m_xManifest->addStatement(i_rImpl.m_xBaseURI.get(),
+ getURI<rdf::URIs::PKG_HASPART>(i_rImpl.m_xContext),
+ xURI.get());
+ i_rImpl.m_xManifest->addStatement(xURI.get(),
+ getURI<rdf::URIs::RDF_TYPE>(i_rImpl.m_xContext),
+ i_xType.get());
+ if (i_pTypes) {
+ for (sal_Int32 i = 0; i < i_pTypes->getLength(); ++i) {
+ i_rImpl.m_xManifest->addStatement(xURI.get(),
+ getURI<rdf::URIs::RDF_TYPE>(i_rImpl.m_xContext),
+ (*i_pTypes)[i].get());
+ }
+ }
+ } catch (uno::RuntimeException &) {
+ throw;
+ } catch (uno::Exception & e) {
+ throw lang::WrappedTargetRuntimeException(
+ ::rtl::OUString::createFromAscii(
+ "addFile: exception"), /*this*/0, uno::makeAny(e));
+ }
+}
+
+/** add content.xml or styles.xml to manifest */
+static bool
+addContentOrStylesFileImpl(struct DocumentMetadataAccess_Impl & i_rImpl,
+ const ::rtl::OUString & i_rPath)
+{
+ uno::Reference<rdf::XURI> xType;
+ if (isContentFile(i_rPath)) {
+ xType.set(getURI<rdf::URIs::ODF_CONTENTFILE>(i_rImpl.m_xContext));
+ } else if (isStylesFile(i_rPath)) {
+ xType.set(getURI<rdf::URIs::ODF_STYLESFILE>(i_rImpl.m_xContext));
+ } else {
+ return false;
+ }
+ addFile(i_rImpl, xType.get(), i_rPath);
+ return true;
+}
+
+/** add metadata file to manifest */
+static void
+addMetadataFileImpl(struct DocumentMetadataAccess_Impl & i_rImpl,
+ const ::rtl::OUString & i_rPath,
+ const uno::Sequence < uno::Reference< rdf::XURI > > & i_rTypes)
+{
+ addFile(i_rImpl,
+ getURI<rdf::URIs::PKG_METADATAFILE>(i_rImpl.m_xContext),
+ i_rPath, &i_rTypes);
+}
+
+/** remove a file from the manifest */
+static void
+removeFile(struct DocumentMetadataAccess_Impl & i_rImpl,
+ uno::Reference<rdf::XURI> const& i_xPart)
+{
+ if (!i_xPart.is()) throw uno::RuntimeException();
+ try {
+ i_rImpl.m_xManifest->removeStatements(i_rImpl.m_xBaseURI.get(),
+ getURI<rdf::URIs::PKG_HASPART>(i_rImpl.m_xContext),
+ i_xPart.get());
+ i_rImpl.m_xManifest->removeStatements(i_xPart.get(),
+ getURI<rdf::URIs::RDF_TYPE>(i_rImpl.m_xContext), 0);
+ } catch (uno::RuntimeException &) {
+ throw;
+ } catch (uno::Exception & e) {
+ throw lang::WrappedTargetRuntimeException(
+ ::rtl::OUString::createFromAscii("removeFile: exception"),
+ 0, uno::makeAny(e));
+ }
+}
+
+static ::std::vector< uno::Reference< rdf::XURI > >
+getAllParts(struct DocumentMetadataAccess_Impl & i_rImpl)
+{
+ ::std::vector< uno::Reference< rdf::XURI > > ret;
+ try {
+ const uno::Reference<container::XEnumeration> xEnum(
+ i_rImpl.m_xManifest->getStatements( i_rImpl.m_xBaseURI.get(),
+ getURI<rdf::URIs::PKG_HASPART>(i_rImpl.m_xContext), 0),
+ uno::UNO_SET_THROW);
+ while (xEnum->hasMoreElements()) {
+ rdf::Statement stmt;
+ if (!(xEnum->nextElement() >>= stmt)) {
+ throw uno::RuntimeException();
+ }
+ const uno::Reference<rdf::XURI> xPart(stmt.Object,
+ uno::UNO_QUERY);
+ if (!xPart.is()) continue;
+ ret.push_back(xPart);
+ }
+ return ret;
+ } catch (uno::RuntimeException &) {
+ throw;
+ } catch (uno::Exception & e) {
+ throw lang::WrappedTargetRuntimeException(
+ ::rtl::OUString::createFromAscii("getAllParts: exception"),
+ 0, uno::makeAny(e));
+ }
+}
+
+static bool
+isPartOfType(struct DocumentMetadataAccess_Impl & i_rImpl,
+ uno::Reference<rdf::XURI> const & i_xPart,
+ uno::Reference<rdf::XURI> const & i_xType)
+{
+ if (!i_xPart.is() || !i_xType.is()) throw uno::RuntimeException();
+ try {
+ const uno::Reference<container::XEnumeration> xEnum(
+ i_rImpl.m_xManifest->getStatements(i_xPart.get(),
+ getURI<rdf::URIs::RDF_TYPE>(i_rImpl.m_xContext),
+ i_xType.get()),
+ uno::UNO_SET_THROW);
+ return (xEnum->hasMoreElements());
+ } catch (uno::RuntimeException &) {
+ throw;
+ } catch (uno::Exception & e) {
+ throw lang::WrappedTargetRuntimeException(
+ ::rtl::OUString::createFromAscii("isPartOfType: exception"),
+ 0, uno::makeAny(e));
+ }
+}
+
+////////////////////////////////////////////////////////////////////////////
+
+static ucb::InteractiveAugmentedIOException
+mkException( ::rtl::OUString const & i_rMessage,
+ ucb::IOErrorCode const i_ErrorCode,
+ ::rtl::OUString const & i_rUri, ::rtl::OUString const & i_rResource)
+{
+ ucb::InteractiveAugmentedIOException iaioe;
+ iaioe.Message = i_rMessage;
+ iaioe.Classification = task::InteractionClassification_ERROR;
+ iaioe.Code = i_ErrorCode;
+
+ const beans::PropertyValue uriProp(::rtl::OUString::createFromAscii("Uri"),
+ -1, uno::makeAny(i_rUri), static_cast<beans::PropertyState>(0));
+ const beans::PropertyValue rnProp(
+ ::rtl::OUString::createFromAscii("ResourceName"),
+ -1, uno::makeAny(i_rResource), static_cast<beans::PropertyState>(0));
+ iaioe.Arguments = ::comphelper::makeSequence(
+ uno::makeAny(uriProp), uno::makeAny(rnProp));
+ return iaioe;
+}
+
+/** error handling policy.
+ <p>If a handler is given, ask it how to proceed:
+ <ul><li>(default:) cancel import, raise exception</li>
+ <li>ignore the error and continue</li>
+ <li>retry the action that led to the error</li></ul></p>
+ N.B.: must not be called before DMA is fully initalized!
+ @returns true iff caller should retry
+ */
+static bool
+handleError( ucb::InteractiveAugmentedIOException const & i_rException,
+ const uno::Reference<task::XInteractionHandler> & i_xHandler)
+{
+ if (!i_xHandler.is()) {
+ throw lang::WrappedTargetException(::rtl::OUString::createFromAscii(
+ "DocumentMetadataAccess::loadMetadataFromStorage: exception"),
+ /* *this*/ 0, uno::makeAny(i_rException));
+ }
+
+ ::rtl::Reference< ::comphelper::OInteractionRequest > pRequest(
+ new ::comphelper::OInteractionRequest(uno::makeAny(i_rException)) );
+ ::rtl::Reference< ::comphelper::OInteractionRetry > pRetry(
+ new ::comphelper::OInteractionRetry );
+ ::rtl::Reference< ::comphelper::OInteractionApprove > pApprove(
+ new ::comphelper::OInteractionApprove );
+ ::rtl::Reference< ::comphelper::OInteractionAbort > pAbort(
+ new ::comphelper::OInteractionAbort );
+ /* this does not seem to work
+ if (i_rException.Code != ucb::IOErrorCode_WRONG_FORMAT) {
+ pRequest->addContinuation( pRetry.get() );
+ }
+ */
+ pRequest->addContinuation( pApprove.get() );
+ pRequest->addContinuation( pAbort.get() );
+ // actually call the handler
+ i_xHandler->handle( pRequest.get() );
+ if (pRetry->wasSelected()) {
+ return true;
+ } else if (pApprove->wasSelected()) {
+ return false;
+ } else {
+ OSL_ENSURE(pAbort->wasSelected(), "no continuation selected?");
+ throw lang::WrappedTargetException(::rtl::OUString::createFromAscii(
+ "DocumentMetadataAccess::loadMetadataFromStorage: exception"),
+ /* *this*/ 0, uno::makeAny(i_rException));
+ }
+}
+
+/** check if storage has content.xml/styles.xml;
+ e.g. ODB files seem to only have content.xml */
+static void
+collectFilesFromStorage(uno::Reference<embed::XStorage> const& i_xStorage,
+ ::rtl::OUString i_Path,
+ std::set< ::rtl::OUString > & o_rFiles)
+{
+ static ::rtl::OUString content(::rtl::OUString::createFromAscii(s_content));
+ static ::rtl::OUString styles (::rtl::OUString::createFromAscii(s_styles ));
+ try {
+ if (i_xStorage->hasByName(content) &&
+ i_xStorage->isStreamElement(content))
+ {
+ o_rFiles.insert(i_Path + content);
+ }
+ if (i_xStorage->hasByName(styles) &&
+ i_xStorage->isStreamElement(styles))
+ {
+ o_rFiles.insert(i_Path + styles);
+ }
+ } catch (uno::Exception &) {
+ OSL_TRACE("collectFilesFromStorage: exception?");
+ }
+}
+
+/** import a metadata file into repository */
+static void
+readStream(struct DocumentMetadataAccess_Impl & i_rImpl,
+ uno::Reference< embed::XStorage > const & i_xStorage,
+ ::rtl::OUString const & i_rPath,
+ ::rtl::OUString const & i_rBaseURI)
+{
+ ::rtl::OUString dir;
+ ::rtl::OUString rest;
+ try {
+ if (!splitPath(i_rPath, dir, rest)) throw uno::RuntimeException();
+ if (dir.equalsAscii("")) {
+ if (i_xStorage->isStreamElement(i_rPath)) {
+ const uno::Reference<io::XStream> xStream(
+ i_xStorage->openStreamElement(i_rPath,
+ embed::ElementModes::READ), uno::UNO_SET_THROW);
+ const uno::Reference<io::XInputStream> xInStream(
+ xStream->getInputStream(), uno::UNO_SET_THROW );
+ const uno::Reference<rdf::XURI> xBaseURI(
+ rdf::URI::create(i_rImpl.m_xContext, i_rBaseURI));
+ const uno::Reference<rdf::XURI> xURI(
+ rdf::URI::createNS(i_rImpl.m_xContext,
+ i_rBaseURI, i_rPath));
+ i_rImpl.m_xRepository->importGraph(rdf::FileFormat::RDF_XML,
+ xInStream, xURI, xBaseURI);
+ } else {
+ throw mkException(::rtl::OUString::createFromAscii(
+ "readStream: is not a stream"),
+ ucb::IOErrorCode_NO_FILE, i_rBaseURI + i_rPath, i_rPath);
+ }
+ } else {
+ if (i_xStorage->isStorageElement(dir)) {
+ const uno::Reference<embed::XStorage> xDir(
+ i_xStorage->openStorageElement(dir,
+ embed::ElementModes::READ));
+ const uno::Reference< beans::XPropertySet > xDirProps(xDir,
+ uno::UNO_QUERY_THROW);
+ try {
+ ::rtl::OUString mimeType;
+ xDirProps->getPropertyValue(
+ ::comphelper::MediaDescriptor::PROP_MEDIATYPE() )
+ >>= mimeType;
+ if (mimeType.matchAsciiL(s_odfmime, sizeof(s_odfmime) - 1))
+ {
+ OSL_TRACE("readStream: "
+ "refusing to recurse into embedded document");
+ return;
+ }
+ } catch (uno::Exception &) { }
+ ::rtl::OUStringBuffer buf(i_rBaseURI);
+ buf.append(dir).append(static_cast<sal_Unicode>('/'));
+ readStream(i_rImpl, xDir, rest, buf.makeStringAndClear() );
+ } else {
+ throw mkException(::rtl::OUString::createFromAscii(
+ "readStream: is not a directory"),
+ ucb::IOErrorCode_NO_DIRECTORY, i_rBaseURI + dir, dir);
+ }
+ }
+ } catch (container::NoSuchElementException & e) {
+ throw mkException(e.Message, ucb::IOErrorCode_NOT_EXISTING_PATH,
+ i_rBaseURI + i_rPath, i_rPath);
+ } catch (io::IOException & e) {
+ throw mkException(e.Message, ucb::IOErrorCode_CANT_READ,
+ i_rBaseURI + i_rPath, i_rPath);
+ } catch (rdf::ParseException & e) {
+ throw mkException(e.Message, ucb::IOErrorCode_WRONG_FORMAT,
+ i_rBaseURI + i_rPath, i_rPath);
+ }
+}
+
+/** import a metadata file into repository */
+static void
+importFile(struct DocumentMetadataAccess_Impl & i_rImpl,
+ uno::Reference<embed::XStorage> const & i_xStorage,
+ ::rtl::OUString const & i_rBaseURI,
+ uno::Reference<task::XInteractionHandler> const & i_xHandler,
+ ::rtl::OUString i_rPath)
+{
+retry:
+ try {
+ readStream(i_rImpl, i_xStorage, i_rPath, i_rBaseURI);
+ } catch (ucb::InteractiveAugmentedIOException & e) {
+ if (handleError(e, i_xHandler)) goto retry;
+ } catch (uno::RuntimeException &) {
+ throw;
+ } catch (uno::Exception & e) {
+ throw lang::WrappedTargetRuntimeException(
+ ::rtl::OUString::createFromAscii("importFile: exception"),
+ 0, uno::makeAny(e));
+ }
+}
+
+/** actually write a metadata file to the storage */
+static void
+exportStream(struct DocumentMetadataAccess_Impl & i_rImpl,
+ uno::Reference< embed::XStorage > const & i_xStorage,
+ uno::Reference<rdf::XURI> const & i_xGraphName,
+ ::rtl::OUString const & i_rFileName,
+ ::rtl::OUString const & i_rBaseURI)
+{
+ const uno::Reference<io::XStream> xStream(
+ i_xStorage->openStreamElement(i_rFileName,
+ embed::ElementModes::WRITE | embed::ElementModes::TRUNCATE),
+ uno::UNO_SET_THROW);
+ const uno::Reference< beans::XPropertySet > xStreamProps(xStream,
+ uno::UNO_QUERY);
+ if (xStreamProps.is()) { // this is NOT supported in FileSystemStorage
+ xStreamProps->setPropertyValue(
+ ::rtl::OUString::createFromAscii("MediaType"),
+ uno::makeAny(::rtl::OUString::createFromAscii(s_rdfxml)));
+ }
+ const uno::Reference<io::XOutputStream> xOutStream(
+ xStream->getOutputStream(), uno::UNO_SET_THROW );
+ const uno::Reference<rdf::XURI> xBaseURI(
+ rdf::URI::create(i_rImpl.m_xContext, i_rBaseURI));
+ i_rImpl.m_xRepository->exportGraph(rdf::FileFormat::RDF_XML,
+ xOutStream, i_xGraphName, xBaseURI);
+}
+
+/** write a metadata file to the storage */
+static void
+writeStream(struct DocumentMetadataAccess_Impl & i_rImpl,
+ uno::Reference< embed::XStorage > const & i_xStorage,
+ uno::Reference<rdf::XURI> const & i_xGraphName,
+ ::rtl::OUString const & i_rPath,
+ ::rtl::OUString const & i_rBaseURI)
+{
+ ::rtl::OUString dir;
+ ::rtl::OUString rest;
+ if (!splitPath(i_rPath, dir, rest)) throw uno::RuntimeException();
+ try {
+ if (dir.equalsAscii("")) {
+ exportStream(i_rImpl, i_xStorage, i_xGraphName, i_rPath,
+ i_rBaseURI);
+ } else {
+ const uno::Reference<embed::XStorage> xDir(
+ i_xStorage->openStorageElement(dir,
+ embed::ElementModes::WRITE));
+ const uno::Reference< beans::XPropertySet > xDirProps(xDir,
+ uno::UNO_QUERY_THROW);
+ try {
+ ::rtl::OUString mimeType;
+ xDirProps->getPropertyValue(
+ ::comphelper::MediaDescriptor::PROP_MEDIATYPE() )
+ >>= mimeType;
+ if (mimeType.matchAsciiL(s_odfmime, sizeof(s_odfmime) - 1)) {
+ OSL_TRACE("writeStream: "
+ "refusing to recurse into embedded document");
+ return;
+ }
+ } catch (uno::Exception &) { }
+ ::rtl::OUStringBuffer buf(i_rBaseURI);
+ buf.append(dir).append(static_cast<sal_Unicode>('/'));
+ writeStream(i_rImpl, xDir, i_xGraphName, rest,
+ buf.makeStringAndClear());
+ }
+ const uno::Reference<embed::XTransactedObject> xTransaction(
+ i_xStorage, uno::UNO_QUERY);
+ if (xTransaction.is()) {
+ xTransaction->commit();
+ }
+ } catch (uno::RuntimeException &) {
+ throw;
+ } catch (io::IOException &) {
+ throw;
+ }
+}
+
+static void
+initLoading(struct DocumentMetadataAccess_Impl & i_rImpl,
+ const uno::Reference< embed::XStorage > & i_xStorage,
+ const uno::Reference<rdf::XURI> & i_xBaseURI,
+ const uno::Reference<task::XInteractionHandler> & i_xHandler)
+{
+retry:
+ // clear old data
+ i_rImpl.m_xManifest.clear();
+ // init BaseURI
+ i_rImpl.m_xBaseURI = i_xBaseURI;
+
+ // create repository
+ i_rImpl.m_xRepository.clear();
+ i_rImpl.m_xRepository.set(rdf::Repository::create(i_rImpl.m_xContext),
+ uno::UNO_SET_THROW);
+
+ const ::rtl::OUString manifest (
+ ::rtl::OUString::createFromAscii(s_manifest));
+ const ::rtl::OUString baseURI( i_xBaseURI->getStringValue() );
+ // try to delay raising errors until after initialization is done
+ uno::Any rterr;
+ ucb::InteractiveAugmentedIOException iaioe;
+ bool err(false);
+
+ const uno::Reference <rdf::XURI> xManifest(
+ getURIForStream(i_rImpl, manifest));
+ try {
+ readStream(i_rImpl, i_xStorage, manifest, baseURI);
+ } catch (ucb::InteractiveAugmentedIOException & e) {
+ // no manifest.rdf: this is not an error in ODF < 1.2
+ if (!(ucb::IOErrorCode_NOT_EXISTING_PATH == e.Code)) {
+ iaioe = e;
+ err = true;
+ }
+ } catch (uno::Exception & e) {
+ rterr <<= e;
+ }
+
+ // init manifest graph
+ const uno::Reference<rdf::XNamedGraph> xManifestGraph(
+ i_rImpl.m_xRepository->getGraph(xManifest));
+ i_rImpl.m_xManifest.set(xManifestGraph.is() ? xManifestGraph :
+ i_rImpl.m_xRepository->createGraph(xManifest), uno::UNO_SET_THROW);
+ const uno::Reference<container::XEnumeration> xEnum(
+ i_rImpl.m_xManifest->getStatements(0,
+ getURI<rdf::URIs::RDF_TYPE>(i_rImpl.m_xContext),
+ getURI<rdf::URIs::PKG_DOCUMENT>(i_rImpl.m_xContext).get()));
+
+ // document statement
+ i_rImpl.m_xManifest->addStatement(i_rImpl.m_xBaseURI.get(),
+ getURI<rdf::URIs::RDF_TYPE>(i_rImpl.m_xContext),
+ getURI<rdf::URIs::PKG_DOCUMENT>(i_rImpl.m_xContext).get());
+
+ OSL_ENSURE(i_rImpl.m_xBaseURI.is(), "base URI is null");
+ OSL_ENSURE(i_rImpl.m_xRepository.is(), "repository is null");
+ OSL_ENSURE(i_rImpl.m_xManifest.is(), "manifest is null");
+
+ if (rterr.hasValue()) {
+ throw lang::WrappedTargetRuntimeException(
+ ::rtl::OUString::createFromAscii(
+ "DocumentMetadataAccess::loadMetadataFromStorage: "
+ "exception"), 0, rterr);
+ }
+
+ if (err) {
+ if (handleError(iaioe, i_xHandler)) goto retry;
+ }
+}
+
+/** init Impl struct */
+static void init(struct DocumentMetadataAccess_Impl & i_rImpl)
+{
+ try {
+
+ i_rImpl.m_xManifest.set(i_rImpl.m_xRepository->createGraph(
+ getURIForStream(i_rImpl,
+ ::rtl::OUString::createFromAscii(s_manifest))),
+ uno::UNO_SET_THROW);
+
+ // insert the document statement
+ i_rImpl.m_xManifest->addStatement(i_rImpl.m_xBaseURI.get(),
+ getURI<rdf::URIs::RDF_TYPE>(i_rImpl.m_xContext),
+ getURI<rdf::URIs::PKG_DOCUMENT>(i_rImpl.m_xContext).get());
+ } catch (uno::Exception & e) {
+ throw lang::WrappedTargetRuntimeException(
+ ::rtl::OUString::createFromAscii("init: unexpected exception"), 0,
+ uno::makeAny(e));
+ }
+
+ // add top-level content files
+ if (!addContentOrStylesFileImpl(i_rImpl,
+ ::rtl::OUString::createFromAscii(s_content))) {
+ throw uno::RuntimeException();
+ }
+ if (!addContentOrStylesFileImpl(i_rImpl,
+ ::rtl::OUString::createFromAscii(s_styles))) {
+ throw uno::RuntimeException();
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////////
+
+DocumentMetadataAccess::DocumentMetadataAccess(
+ uno::Reference< uno::XComponentContext > const & i_xContext,
+ const IXmlIdRegistrySupplier & i_rRegistrySupplier)
+ : m_pImpl(new DocumentMetadataAccess_Impl(i_xContext, i_rRegistrySupplier))
+{
+ // no initalization: must call loadFrom...
+}
+
+DocumentMetadataAccess::DocumentMetadataAccess(
+ uno::Reference< uno::XComponentContext > const & i_xContext,
+ const IXmlIdRegistrySupplier & i_rRegistrySupplier,
+ ::rtl::OUString const & i_rURI)
+ : m_pImpl(new DocumentMetadataAccess_Impl(i_xContext, i_rRegistrySupplier))
+{
+ OSL_ENSURE(i_rURI.getLength(), "DMA::DMA: no URI given!");
+ OSL_ENSURE(i_rURI.endsWithAsciiL("/", 1), "DMA::DMA: URI without / given!");
+ if (!i_rURI.endsWithAsciiL("/", 1)) throw uno::RuntimeException();
+ m_pImpl->m_xBaseURI.set(rdf::URI::create(m_pImpl->m_xContext, i_rURI));
+ m_pImpl->m_xRepository.set(rdf::Repository::create(m_pImpl->m_xContext),
+ uno::UNO_SET_THROW);
+
+ // init repository
+ init(*m_pImpl);
+
+ OSL_ENSURE(m_pImpl->m_xBaseURI.is(), "base URI is null");
+ OSL_ENSURE(m_pImpl->m_xRepository.is(), "repository is null");
+ OSL_ENSURE(m_pImpl->m_xManifest.is(), "manifest is null");
+}
+
+DocumentMetadataAccess::~DocumentMetadataAccess()
+{
+}
+
+
+// ::com::sun::star::rdf::XRepositorySupplier:
+uno::Reference< rdf::XRepository > SAL_CALL
+DocumentMetadataAccess::getRDFRepository() throw (uno::RuntimeException)
+{
+ OSL_ENSURE(m_pImpl->m_xRepository.is(), "repository not initialized");
+ return m_pImpl->m_xRepository;
+}
+
+// ::com::sun::star::rdf::XNode:
+::rtl::OUString SAL_CALL
+DocumentMetadataAccess::getStringValue() throw (uno::RuntimeException)
+{
+ return m_pImpl->m_xBaseURI->getStringValue();
+}
+
+// ::com::sun::star::rdf::XURI:
+::rtl::OUString SAL_CALL
+DocumentMetadataAccess::getNamespace() throw (uno::RuntimeException)
+{
+ return m_pImpl->m_xBaseURI->getNamespace();
+}
+
+::rtl::OUString SAL_CALL
+DocumentMetadataAccess::getLocalName() throw (uno::RuntimeException)
+{
+ return m_pImpl->m_xBaseURI->getLocalName();
+}
+
+// ::com::sun::star::rdf::XDocumentMetadataAccess:
+uno::Reference< rdf::XMetadatable > SAL_CALL
+DocumentMetadataAccess::getElementByMetadataReference(
+ const ::com::sun::star::beans::StringPair & i_rReference)
+throw (uno::RuntimeException)
+{
+ const IXmlIdRegistry * pReg(
+ m_pImpl->m_rXmlIdRegistrySupplier.GetXmlIdRegistry() );
+ if (!pReg) {
+ throw uno::RuntimeException(::rtl::OUString::createFromAscii(
+ "DocumentMetadataAccess::getElementByXmlId: no registry"), *this);
+ }
+ return pReg->GetElementByMetadataReference(i_rReference);
+}
+
+uno::Reference< rdf::XMetadatable > SAL_CALL
+DocumentMetadataAccess::getElementByURI(
+ const uno::Reference< rdf::XURI > & i_xURI )
+throw (uno::RuntimeException, lang::IllegalArgumentException)
+{
+ if (!i_xURI.is()) {
+ throw lang::IllegalArgumentException(::rtl::OUString::createFromAscii(
+ "DocumentMetadataAccess::getElementByURI: URI is null"), *this, 0);
+ }
+
+ const ::rtl::OUString baseURI( m_pImpl->m_xBaseURI->getStringValue() );
+ const ::rtl::OUString name( i_xURI->getStringValue() );
+ if (!name.match(baseURI)) {
+ return 0;
+ }
+ const ::rtl::OUString relName( name.copy(baseURI.getLength()) );
+ ::rtl::OUString path;
+ ::rtl::OUString idref;
+ if (!splitXmlId(relName, path, idref)) {
+ return 0;
+ }
+
+ return getElementByMetadataReference( beans::StringPair(path, idref) );
+}
+
+
+uno::Sequence< uno::Reference< rdf::XURI > > SAL_CALL
+DocumentMetadataAccess::getMetadataGraphsWithType(
+ const uno::Reference<rdf::XURI> & i_xType)
+throw (uno::RuntimeException, lang::IllegalArgumentException)
+{
+ if (!i_xType.is()) {
+ throw lang::IllegalArgumentException(::rtl::OUString::createFromAscii(
+ "DocumentMetadataAccess::getMetadataGraphsWithType: "
+ "type is null"), *this, 0);
+ }
+
+ ::comphelper::SequenceAsVector< uno::Reference< rdf::XURI > > ret;
+ const ::std::vector< uno::Reference< rdf::XURI > > parts(
+ getAllParts(*m_pImpl) );
+ ::std::remove_copy_if(parts.begin(), parts.end(),
+ ::std::back_inserter(ret),
+ ::boost::bind(
+ ::std::logical_not<bool>(),
+ ::boost::bind(&isPartOfType, ::boost::ref(*m_pImpl), _1, i_xType) ));
+ return ret.getAsConstList();
+}
+
+uno::Reference<rdf::XURI> SAL_CALL
+DocumentMetadataAccess::addMetadataFile(const ::rtl::OUString & i_rFileName,
+ const uno::Sequence < uno::Reference< rdf::XURI > > & i_rTypes)
+throw (uno::RuntimeException, lang::IllegalArgumentException,
+ container::ElementExistException)
+{
+ if (!isFileNameValid(i_rFileName)) {
+ throw lang::IllegalArgumentException(::rtl::OUString::createFromAscii(
+ "DocumentMetadataAccess::addMetadataFile: invalid FileName"),
+ *this, 0);
+ }
+ if (isReservedFile(i_rFileName)) {
+ throw lang::IllegalArgumentException(::rtl::OUString::createFromAscii(
+ "DocumentMetadataAccess::addMetadataFile:"
+ "invalid FileName: reserved"), *this, 0);
+ }
+ for (sal_Int32 i = 0; i < i_rTypes.getLength(); ++i) {
+ if (!i_rTypes[i].is()) {
+ throw lang::IllegalArgumentException(
+ ::rtl::OUString::createFromAscii(
+ "DocumentMetadataAccess::addMetadataFile: "
+ "null type"), *this, 2);
+ }
+ }
+
+ const uno::Reference<rdf::XURI> xGraphName(
+ getURIForStream(*m_pImpl, i_rFileName) );
+
+ try {
+ m_pImpl->m_xRepository->createGraph(xGraphName);
+ } catch (rdf::RepositoryException & e) {
+ throw lang::WrappedTargetRuntimeException(
+ ::rtl::OUString::createFromAscii(
+ "DocumentMetadataAccess::addMetadataFile: exception"),
+ *this, uno::makeAny(e));
+ // note: all other exceptions are propagated
+ }
+
+ addMetadataFileImpl(*m_pImpl, i_rFileName, i_rTypes);
+ return xGraphName;
+}
+
+uno::Reference<rdf::XURI> SAL_CALL
+DocumentMetadataAccess::importMetadataFile(::sal_Int16 i_Format,
+ const uno::Reference< io::XInputStream > & i_xInStream,
+ const ::rtl::OUString & i_rFileName,
+ const uno::Reference< rdf::XURI > & i_xBaseURI,
+ const uno::Sequence < uno::Reference< rdf::XURI > > & i_rTypes)
+throw (uno::RuntimeException, lang::IllegalArgumentException,
+ datatransfer::UnsupportedFlavorException,
+ container::ElementExistException, rdf::ParseException, io::IOException)
+{
+ if (!isFileNameValid(i_rFileName)) {
+ throw lang::IllegalArgumentException(::rtl::OUString::createFromAscii(
+ "DocumentMetadataAccess::importMetadataFile: invalid FileName"),
+ *this, 0);
+ }
+ if (isReservedFile(i_rFileName)) {
+ throw lang::IllegalArgumentException(::rtl::OUString::createFromAscii(
+ "DocumentMetadataAccess::importMetadataFile:"
+ "invalid FileName: reserved"), *this, 0);
+ }
+ for (sal_Int32 i = 0; i < i_rTypes.getLength(); ++i) {
+ if (!i_rTypes[i].is()) {
+ throw lang::IllegalArgumentException(
+ ::rtl::OUString::createFromAscii(
+ "DocumentMetadataAccess::importMetadataFile: null type"),
+ *this, 5);
+ }
+ }
+
+ const uno::Reference<rdf::XURI> xGraphName(
+ getURIForStream(*m_pImpl, i_rFileName) );
+
+ try {
+ m_pImpl->m_xRepository->importGraph(
+ i_Format, i_xInStream, xGraphName, i_xBaseURI);
+ } catch (rdf::RepositoryException & e) {
+ throw lang::WrappedTargetRuntimeException(
+ ::rtl::OUString::createFromAscii(
+ "DocumentMetadataAccess::importMetadataFile: "
+ "RepositoryException"), *this, uno::makeAny(e));
+ // note: all other exceptions are propagated
+ }
+
+ // add to manifest
+ addMetadataFileImpl(*m_pImpl, i_rFileName, i_rTypes);
+ return xGraphName;
+}
+
+void SAL_CALL
+DocumentMetadataAccess::removeMetadataFile(
+ const uno::Reference< rdf::XURI > & i_xGraphName)
+throw (uno::RuntimeException, lang::IllegalArgumentException,
+ container::NoSuchElementException)
+{
+ try {
+ m_pImpl->m_xRepository->destroyGraph(i_xGraphName);
+ } catch (rdf::RepositoryException & e) {
+ throw lang::WrappedTargetRuntimeException(
+ ::rtl::OUString::createFromAscii(
+ "DocumentMetadataAccess::removeMetadataFile: "
+ "RepositoryException"), *this, uno::makeAny(e));
+ // note: all other exceptions are propagated
+ }
+
+ // remove file from manifest
+ removeFile(*m_pImpl, i_xGraphName.get());
+}
+
+void SAL_CALL
+DocumentMetadataAccess::addContentOrStylesFile(
+ const ::rtl::OUString & i_rFileName)
+throw (uno::RuntimeException, lang::IllegalArgumentException,
+ container::ElementExistException)
+{
+ if (!isFileNameValid(i_rFileName)) {
+ throw lang::IllegalArgumentException(::rtl::OUString::createFromAscii(
+ "DocumentMetadataAccess::addContentOrStylesFile: "
+ "invalid FileName"), *this, 0);
+ }
+
+ if (!addContentOrStylesFileImpl(*m_pImpl, i_rFileName)) {
+ throw lang::IllegalArgumentException(::rtl::OUString::createFromAscii(
+ "DocumentMetadataAccess::addContentOrStylesFile: "
+ "invalid FileName: must end with content.xml or styles.xml"),
+ *this, 0);
+ }
+}
+
+void SAL_CALL
+DocumentMetadataAccess::removeContentOrStylesFile(
+ const ::rtl::OUString & i_rFileName)
+throw (uno::RuntimeException, lang::IllegalArgumentException,
+ container::NoSuchElementException)
+{
+ if (!isFileNameValid(i_rFileName)) {
+ throw lang::IllegalArgumentException(::rtl::OUString::createFromAscii(
+ "DocumentMetadataAccess::removeContentOrStylesFile: "
+ "invalid FileName"), *this, 0);
+ }
+
+ try {
+ const uno::Reference<rdf::XURI> xPart(
+ getURIForStream(*m_pImpl, i_rFileName) );
+ const uno::Reference<container::XEnumeration> xEnum(
+ m_pImpl->m_xManifest->getStatements( m_pImpl->m_xBaseURI.get(),
+ getURI<rdf::URIs::PKG_HASPART>(m_pImpl->m_xContext),
+ xPart.get()),
+ uno::UNO_SET_THROW);
+ if (!xEnum->hasMoreElements()) {
+ throw container::NoSuchElementException(
+ ::rtl::OUString::createFromAscii(
+ "DocumentMetadataAccess::removeContentOrStylesFile: "
+ "cannot find stream in manifest graph: ") + i_rFileName,
+ *this);
+ }
+
+ // remove file from manifest
+ removeFile(*m_pImpl, xPart);
+
+ } catch (uno::RuntimeException &) {
+ throw;
+ } catch (uno::Exception & e) {
+ throw lang::WrappedTargetRuntimeException(
+ ::rtl::OUString::createFromAscii(
+ "DocumentMetadataAccess::removeContentOrStylesFile: exception"),
+ *this, uno::makeAny(e));
+ }
+}
+
+void SAL_CALL DocumentMetadataAccess::loadMetadataFromStorage(
+ const uno::Reference< embed::XStorage > & i_xStorage,
+ const uno::Reference<rdf::XURI> & i_xBaseURI,
+ const uno::Reference<task::XInteractionHandler> & i_xHandler)
+throw (uno::RuntimeException, lang::IllegalArgumentException,
+ lang::WrappedTargetException)
+{
+ if (!i_xStorage.is()) {
+ throw lang::IllegalArgumentException(::rtl::OUString::createFromAscii(
+ "DocumentMetadataAccess::loadMetadataFromStorage: "
+ "storage is null"), *this, 0);
+ }
+ if (!i_xBaseURI.is()) {
+ throw lang::IllegalArgumentException(::rtl::OUString::createFromAscii(
+ "DocumentMetadataAccess::loadMetadataFromStorage: "
+ "base URI is null"), *this, 1);
+ }
+ const ::rtl::OUString baseURI( i_xBaseURI->getStringValue());
+ if (baseURI.indexOf('#') >= 0) {
+ throw lang::IllegalArgumentException(::rtl::OUString::createFromAscii(
+ "DocumentMetadataAccess::loadMetadataFromStorage: "
+ "base URI not absolute"), *this, 1);
+ }
+ if (!baseURI.getLength() || !baseURI.endsWithAsciiL("/", 1)) {
+ throw lang::IllegalArgumentException(::rtl::OUString::createFromAscii(
+ "DocumentMetadataAccess::loadMetadataFromStorage: "
+ "base URI does not end with slash"), *this, 1);
+ }
+
+ initLoading(*m_pImpl, i_xStorage, i_xBaseURI, i_xHandler);
+
+ std::set< ::rtl::OUString > StgFiles;
+ collectFilesFromStorage(i_xStorage,
+ ::rtl::OUString::createFromAscii(""), StgFiles);
+
+ std::vector< ::rtl::OUString > MfstMetadataFiles;
+
+ try {
+ const ::std::vector< uno::Reference< rdf::XURI > > parts(
+ getAllParts(*m_pImpl) );
+ const uno::Reference<rdf::XURI> xContentFile(
+ getURI<rdf::URIs::ODF_CONTENTFILE>(m_pImpl->m_xContext));
+ const uno::Reference<rdf::XURI> xStylesFile(
+ getURI<rdf::URIs::ODF_STYLESFILE>(m_pImpl->m_xContext));
+ const uno::Reference<rdf::XURI> xMetadataFile(
+ getURI<rdf::URIs::PKG_METADATAFILE>(m_pImpl->m_xContext));
+ const sal_Int32 len( baseURI.getLength() );
+ const ::rtl::OUString manifest (
+ ::rtl::OUString::createFromAscii(s_manifest));
+ for (::std::vector< uno::Reference< rdf::XURI > >::const_iterator it
+ = parts.begin();
+ it != parts.end(); ++it) {
+ const ::rtl::OUString name((*it)->getStringValue());
+ if (!name.match(baseURI)) {
+ OSL_TRACE("loadMetadataFromStorage: graph not in document: %s",
+ ::rtl::OUStringToOString(name, RTL_TEXTENCODING_UTF8)
+ .getStr());
+ continue;
+ }
+ const ::rtl::OUString relName( name.copy(len) );
+ if (relName == manifest) {
+ OSL_TRACE("loadMetadataFromStorage: "
+ "found ourselves a recursive manifest!");
+ continue;
+ }
+ // remove found items from StgFiles
+ StgFiles.erase(relName);
+ if (isContentFile(relName)) {
+ if (!isPartOfType(*m_pImpl, *it, xContentFile)) {
+ const uno::Reference <rdf::XURI> xName(
+ getURIForStream(*m_pImpl, relName) );
+ // add missing type statement
+ m_pImpl->m_xManifest->addStatement(xName.get(),
+ getURI<rdf::URIs::RDF_TYPE>(m_pImpl->m_xContext),
+ xContentFile.get());
+ }
+ } else if (isStylesFile(relName)) {
+ if (!isPartOfType(*m_pImpl, *it, xStylesFile)) {
+ const uno::Reference <rdf::XURI> xName(
+ getURIForStream(*m_pImpl, relName) );
+ // add missing type statement
+ m_pImpl->m_xManifest->addStatement(xName.get(),
+ getURI<rdf::URIs::RDF_TYPE>(m_pImpl->m_xContext),
+ xStylesFile.get());
+ }
+ } else if (isReservedFile(relName)) {
+ OSL_TRACE("loadMetadataFromStorage: "
+ "reserved file name in manifest");
+ } else {
+ if (isPartOfType(*m_pImpl, *it, xMetadataFile)) {
+ MfstMetadataFiles.push_back(relName);
+ }
+ // do not add statement for MetadataFile; it could be
+ // something else! just ignore it...
+ }
+ }
+ } catch (uno::RuntimeException &) {
+ throw;
+ } catch (uno::Exception & e) {
+ throw lang::WrappedTargetRuntimeException(
+ ::rtl::OUString::createFromAscii(
+ "DocumentMetadataAccess::loadMetadataFromStorage: "
+ "exception"), *this, uno::makeAny(e));
+ }
+
+ std::for_each(StgFiles.begin(), StgFiles.end(),
+ boost::bind(addContentOrStylesFileImpl, boost::ref(*m_pImpl), _1));
+
+ std::for_each(MfstMetadataFiles.begin(), MfstMetadataFiles.end(),
+ boost::bind(importFile, boost::ref(*m_pImpl),
+ i_xStorage, baseURI, i_xHandler, _1));
+}
+
+void SAL_CALL DocumentMetadataAccess::storeMetadataToStorage(
+ const uno::Reference< embed::XStorage > & i_xStorage)
+throw (uno::RuntimeException, lang::IllegalArgumentException,
+ lang::WrappedTargetException)
+{
+ if (!i_xStorage.is()) {
+ throw lang::IllegalArgumentException(::rtl::OUString::createFromAscii(
+ "DocumentMetadataAccess::storeMetadataToStorage: "
+ "storage is null"), *this, 0);
+ }
+
+ // export manifest
+ const ::rtl::OUString manifest (
+ ::rtl::OUString::createFromAscii(s_manifest));
+ const uno::Reference <rdf::XURI> xManifest(
+ getURIForStream(*m_pImpl, manifest) );
+ const ::rtl::OUString baseURI( m_pImpl->m_xBaseURI->getStringValue() );
+ try {
+ writeStream(*m_pImpl, i_xStorage, xManifest, manifest, baseURI);
+ } catch (uno::RuntimeException &) {
+ throw;
+ } catch (io::IOException & e) {
+ throw lang::WrappedTargetException( ::rtl::OUString::createFromAscii(
+ "storeMetadataToStorage: IO exception"), *this, uno::makeAny(e));
+ } catch (uno::Exception & e) {
+ throw lang::WrappedTargetRuntimeException(
+ ::rtl::OUString::createFromAscii(
+ "storeMetadataToStorage: exception"), *this, uno::makeAny(e));
+ }
+
+ // export metadata streams
+ try {
+ const uno::Sequence<uno::Reference<rdf::XURI> > graphs(
+ m_pImpl->m_xRepository->getGraphNames());
+ const sal_Int32 len( baseURI.getLength() );
+ for (sal_Int32 i = 0; i < graphs.getLength(); ++i) {
+ const uno::Reference<rdf::XURI> xName(graphs[i]);
+ const ::rtl::OUString name(xName->getStringValue());
+ if (!name.match(baseURI)) {
+ OSL_TRACE("storeMetadataToStorage: graph not in document: %s",
+ ::rtl::OUStringToOString(name, RTL_TEXTENCODING_UTF8)
+ .getStr());
+ continue;
+ }
+ const ::rtl::OUString relName( name.copy(len) );
+ if (relName == manifest) {
+ continue;
+ }
+ if (!isFileNameValid(relName) || isReservedFile(relName)) {
+ OSL_TRACE("storeMetadataToStorage: invalid file name: %s",
+ ::rtl::OUStringToOString(relName, RTL_TEXTENCODING_UTF8)
+ .getStr());
+ continue;
+ }
+ try {
+ writeStream(*m_pImpl, i_xStorage, xName, relName, baseURI);
+ } catch (uno::RuntimeException &) {
+ throw;
+ } catch (io::IOException & e) {
+ throw lang::WrappedTargetException(
+ ::rtl::OUString::createFromAscii(
+ "storeMetadataToStorage: IO exception"),
+ *this, uno::makeAny(e));
+ } catch (uno::Exception & e) {
+ throw lang::WrappedTargetRuntimeException(
+ ::rtl::OUString::createFromAscii(
+ "storeMetadataToStorage: exception"),
+ *this, uno::makeAny(e));
+ }
+ }
+ } catch (rdf::RepositoryException & e) {
+ throw lang::WrappedTargetRuntimeException(
+ ::rtl::OUString::createFromAscii(
+ "storeMetadataToStorage: exception"), *this, uno::makeAny(e));
+ }
+}
+
+void SAL_CALL
+DocumentMetadataAccess::loadMetadataFromMedium(
+ const uno::Sequence< beans::PropertyValue > & i_rMedium)
+throw (uno::RuntimeException, lang::IllegalArgumentException,
+ lang::WrappedTargetException)
+{
+ uno::Reference<io::XInputStream> xIn;
+ ::comphelper::MediaDescriptor md(i_rMedium);
+ ::rtl::OUString URL;
+ md[ ::comphelper::MediaDescriptor::PROP_URL() ] >>= URL;
+ ::rtl::OUString BaseURL;
+ md[ ::comphelper::MediaDescriptor::PROP_DOCUMENTBASEURL() ] >>= BaseURL;
+ if (md.addInputStream()) {
+ md[ ::comphelper::MediaDescriptor::PROP_INPUTSTREAM() ] >>= xIn;
+ }
+ if (!xIn.is() && URL.equalsAscii("")) {
+ throw lang::IllegalArgumentException(::rtl::OUString::createFromAscii(
+ "DocumentMetadataAccess::loadMetadataFromMedium: "
+ "inalid medium: no URL, no input stream"), *this, 0);
+ }
+ uno::Reference<embed::XStorage> xStorage;
+ try {
+ const uno::Reference<lang::XMultiServiceFactory> xMsf (
+ m_pImpl->m_xContext->getServiceManager(), uno::UNO_QUERY_THROW);
+ if (xIn.is()) {
+ xStorage = ::comphelper::OStorageHelper::GetStorageFromInputStream(
+ xIn, xMsf);
+ } else { // fallback to url
+ xStorage = ::comphelper::OStorageHelper::GetStorageFromURL2(
+ URL, embed::ElementModes::READ, xMsf);
+ }
+ } catch (uno::RuntimeException &) {
+ throw;
+ } catch (io::IOException &) {
+ throw;
+ } catch (uno::Exception & e) {
+ throw lang::WrappedTargetException(
+ ::rtl::OUString::createFromAscii(
+ "DocumentMetadataAccess::loadMetadataFromMedium: "
+ "exception"), *this, uno::makeAny(e));
+ }
+ if (!xStorage.is()) {
+ throw uno::RuntimeException(::rtl::OUString::createFromAscii(
+ "DocumentMetadataAccess::loadMetadataFromMedium: "
+ "cannot get Storage"), *this);
+ }
+ uno::Reference<rdf::XURI> xBaseURI;
+ try {
+ xBaseURI = createBaseURI(m_pImpl->m_xContext, xStorage, BaseURL);
+ } catch (uno::Exception &) {
+ // fall back to URL
+ try {
+ xBaseURI = createBaseURI(m_pImpl->m_xContext, xStorage, URL);
+ } catch (uno::Exception &) {
+ OSL_ENSURE(false, "cannot create base URI");
+ }
+ }
+ uno::Reference<task::XInteractionHandler> xIH;
+ md[ ::comphelper::MediaDescriptor::PROP_INTERACTIONHANDLER() ] >>= xIH;
+ loadMetadataFromStorage(xStorage, xBaseURI, xIH);
+}
+
+void SAL_CALL
+DocumentMetadataAccess::storeMetadataToMedium(
+ const uno::Sequence< beans::PropertyValue > & i_rMedium)
+throw (uno::RuntimeException, lang::IllegalArgumentException,
+ lang::WrappedTargetException)
+{
+ ::comphelper::MediaDescriptor md(i_rMedium);
+ ::rtl::OUString URL;
+ md[ ::comphelper::MediaDescriptor::PROP_URL() ] >>= URL;
+ if (URL.equalsAscii("")) {
+ throw lang::IllegalArgumentException(::rtl::OUString::createFromAscii(
+ "DocumentMetadataAccess::storeMetadataToMedium: "
+ "invalid medium: no URL"), *this, 0);
+ }
+
+ SfxMedium aMedium(i_rMedium);
+ uno::Reference<embed::XStorage> xStorage(aMedium.GetOutputStorage());
+
+ bool sfx(false);
+ if (xStorage.is()) {
+ sfx = true;
+ } else {
+ const uno::Reference<lang::XMultiServiceFactory> xMsf (
+ m_pImpl->m_xContext->getServiceManager(), uno::UNO_QUERY_THROW);
+ xStorage = ::comphelper::OStorageHelper::GetStorageFromURL2(
+ URL, embed::ElementModes::WRITE, xMsf);
+ }
+
+ if (!xStorage.is()) {
+ throw uno::RuntimeException(::rtl::OUString::createFromAscii(
+ "DocumentMetadataAccess::storeMetadataToMedium: "
+ "cannot get Storage"), *this);
+ }
+ // set MIME type of the storage
+ ::comphelper::MediaDescriptor::const_iterator iter
+ = md.find(::comphelper::MediaDescriptor::PROP_MEDIATYPE());
+ if (iter != md.end()) {
+ uno::Reference< beans::XPropertySet > xProps(xStorage,
+ uno::UNO_QUERY_THROW);
+ try {
+ // this is NOT supported in FileSystemStorage
+ xProps->setPropertyValue(
+ ::comphelper::MediaDescriptor::PROP_MEDIATYPE(),
+ iter->second);
+ } catch (uno::Exception &) { }
+ }
+ storeMetadataToStorage(xStorage);
+
+ if (sfx) {
+ const sal_Bool bOk = aMedium.Commit();
+ aMedium.Close();
+ if ( !bOk ) {
+ sal_uInt32 nError = aMedium.GetError();
+ if ( nError == ERRCODE_NONE ) {
+ nError = ERRCODE_IO_GENERAL;
+ }
+ task::ErrorCodeIOException ex( ::rtl::OUString(),
+ uno::Reference< uno::XInterface >(), nError);
+ throw lang::WrappedTargetException(::rtl::OUString(), *this,
+ uno::makeAny(ex));
+ }
+ }
+}
+
+} // namespace sfx2
+
diff --git a/sfx2/source/doc/Metadatable.cxx b/sfx2/source/doc/Metadatable.cxx
new file mode 100644
index 0000000000..433b2512df
--- /dev/null
+++ b/sfx2/source/doc/Metadatable.cxx
@@ -0,0 +1,1860 @@
+/*************************************************************************
+ *
+ * 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: SwMetadatable.cxx,v $
+ * $Revision: 1.1.2.8 $
+ *
+ * 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_sfx2.hxx"
+
+#include <sfx2/Metadatable.hxx>
+#include <sfx2/XmlIdRegistry.hxx>
+
+#include <vos/mutex.hxx>
+#include <vcl/svapp.hxx> // solarmutex
+
+#include <boost/bind.hpp>
+
+#include <memory>
+#include <hash_map>
+#include <list>
+#include <algorithm>
+#if OSL_DEBUG_LEVEL > 0
+#include <typeinfo>
+#endif
+
+
+/** XML ID handling.
+
+ There is an abstract base class <type>XmlIdRegistry</type>, with
+ 2 subclasses <type>XmlIdRegistryDocument</type> for "normal" documents,
+ and <type>XmlIdRegistryClipboard</type> for clipboard documents.
+ These classes are responsible for managing XML IDs for all elements
+ of the model. Only the implementation of the <type>Metadatable</type>
+ base class needs to know the registries, so they are not in the header.
+
+ The handling of XML IDs differs between clipboard and non-clipboard
+ documents in several aspects. Most importantly, non-clipboard documents
+ can have several elements associated with one XML ID.
+ This is necessary because of the weird undo implementation:
+ deleting a text node moves the deleted node to the undo array, but
+ executing undo will then create a <em>copy</em> of that node in the
+ document array. These 2 nodes must have the same XML ID, because
+ we cannot know whether the user will do a redo next, or something else.
+
+ Because we need to have a mechanism for several objects per XML ID anyway,
+ we use that also to enable some usability features:
+ The document registry has a list of Metadatables per XML ID.
+ This list is sorted by priority, i.e., the first element has highest
+ priority. When inserting copies, care must be taken that they are inserted
+ at the right position: either before or after the source.
+ This is done by <method>Metadatable::RegisterAsCopyOf</method>.
+ When a text node is split, then both resulting text nodes are inserted
+ into the list. If the user then deletes one text node, the other one
+ will have the XML ID.
+ Also, when a Metadatable is copied to the clipboard and then pasted,
+ the copy is inserted into the list. If the user then deletes the source,
+ the XML ID is not lost.
+ The goal is that it should be hard to lose an XML ID by accident, which
+ is especially important as long as we do not have an UI that displays them.
+
+ There are two subclasses of <type>Metadatable</type>:
+ <ul><li><type>MetadatableClipboard</type>: for copies in the clipboard</li>
+ <li><type>MetadatableUndo</type>: for undo, because a Metadatable
+ may be destroyed on delete and a new one created on undo.</li></ul>
+ These serve only to track the position in an XML ID list in a document
+ registry, so that future actions can insert objects at the right position.
+ Unfortunately, inserting dummy objects seems to be necessary:
+ <ul><li>it is not sufficent to just remember the saved id, because then
+ the relative priorities might change when executing the undo</li>
+ <li>it is not sufficient to record the position as an integer, because
+ if we delete a text node and then undo, the node will be copied(!),
+ and we will have one more node in the list.<li>
+ <li>it is not sufficient to record the pointer of the previous/next
+ Metadatable, because if we delete a text node, undo, and then
+ do something to clear the redo array, the original text node is
+ destroyed, and is replaced by the copy created by undo</li></ul>
+
+ If content from a non-clipboard document is copied into a clipboard
+ document, a dummy <type>MetadatableClipboard</type> is inserted into the
+ non-clipboard document registry in order to track the position of the
+ source element. When the clipboard content is pasted back into the source
+ document, this dummy object is used to associate the pasted element with
+ that same XML ID.
+
+ If a <type>Metadatable</type> is deleted or merged,
+ <method>Metadatable::CreateUndo</method> is called, and returns a
+ <type>MetadatableUndo<type> instance, which can be used to undo the action
+ by passing it to <method>Metadatable::RestoreMetadata</method>.
+
+ @author mst
+ */
+
+
+using namespace ::com::sun::star;
+
+using ::sfx2::isValidXmlId;
+
+
+namespace sfx2 {
+
+static const char s_content [] = "content.xml";
+static const char s_styles [] = "styles.xml";
+static const char s_prefix [] = "id"; // prefix for generated xml:id
+
+static bool isContentFile(::rtl::OUString const & i_rPath)
+{
+ return i_rPath.equalsAscii(s_content);
+}
+
+static bool isStylesFile (::rtl::OUString const & i_rPath)
+{
+ return i_rPath.equalsAscii(s_styles);
+}
+
+
+//=============================================================================
+// XML ID handling ---------------------------------------------------
+
+/** handles registration of XMetadatable.
+
+ This class is responsible for guaranteeing that XMetadatable objects
+ always have XML IDs that are unique within a stream.
+
+ This is an abstract base class; see subclasses XmlIdRegistryDocument and
+ XmlIdRegistryClipboard.
+
+ @see SwDoc::GetXmlIdRegistry
+ @see SwDocShell::GetXmlIdRegistry
+ */
+class XmlIdRegistry : public sfx2::IXmlIdRegistry
+{
+
+public:
+ XmlIdRegistry();
+
+ virtual ~XmlIdRegistry();
+
+ /** get the ODF element with the given metadata reference. */
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::rdf::XMetadatable > SAL_CALL
+ GetElementByMetadataReference(
+ const ::com::sun::star::beans::StringPair & i_rReference) const;
+
+ /** register an ODF element at a newly generated, unique metadata reference.
+
+ <p>
+ Find a fresh XML ID, and register it for the element.
+ The generated ID does not occur in any stream of the document.
+ </p>
+ */
+ virtual void RegisterMetadatableAndCreateID(Metadatable& i_xObject) = 0;
+
+ /** try to register an ODF element at a given XML ID, or update its
+ registation to a different XML ID.
+
+ <p>
+ If the given new metadata reference is not already occupied in the
+ document, unregister the element at its old metadata reference if
+ it has one, and register the new metadata reference for the element.
+ Note that this method only ensures that XML IDs are unique per stream,
+ so using the same XML ID in both content.xml and styles.xml is allowed.
+ </p>
+
+ @returns
+ true iff the element has successfully been registered
+ */
+ virtual bool TryRegisterMetadatable(Metadatable& i_xObject,
+ ::rtl::OUString const& i_rStreamName, ::rtl::OUString const& i_rIdref)
+ = 0;
+
+ /** unregister an ODF element.
+
+ <p>
+ Unregister the element at its metadata reference.
+ Does not remove the metadata reference from the element.
+ </p>
+
+ @see RemoveXmlIdForElement
+ */
+ virtual void UnregisterMetadatable(Metadatable const&) = 0;
+
+ /** get the metadata reference for the given element. */
+ ::com::sun::star::beans::StringPair
+ GetXmlIdForElement(Metadatable const&) const;
+
+ /** remove the metadata reference for the given element. */
+ virtual void RemoveXmlIdForElement(Metadatable const&) = 0;
+
+protected:
+
+ virtual bool LookupXmlId(const Metadatable& i_xObject,
+ ::rtl::OUString & o_rStream, ::rtl::OUString & o_rIdref) const = 0;
+
+ virtual Metadatable* LookupElement(const ::rtl::OUString & i_rStreamName,
+ const ::rtl::OUString & i_rIdref) const = 0;
+};
+
+// XmlIdRegistryDocument ---------------------------------------------
+
+/** non-clipboard documents */
+class XmlIdRegistryDocument : public XmlIdRegistry
+{
+
+public:
+ XmlIdRegistryDocument();
+
+ virtual ~XmlIdRegistryDocument();
+
+ virtual void RegisterMetadatableAndCreateID(Metadatable& i_xObject);
+
+ virtual bool TryRegisterMetadatable(Metadatable& i_xObject,
+ ::rtl::OUString const& i_rStreamName, ::rtl::OUString const& i_rIdref);
+
+ virtual void UnregisterMetadatable(Metadatable const&);
+
+ virtual void RemoveXmlIdForElement(Metadatable const&);
+
+ /** register i_rCopy as a copy of i_rSource,
+ with precedence iff i_bCopyPrecedesSource is true */
+ void RegisterCopy(Metadatable const& i_rSource, Metadatable & i_rCopy,
+ const bool i_bCopyPrecedesSource);
+
+ /** create a Undo Metadatable for i_rObject. */
+ ::boost::shared_ptr<MetadatableUndo> CreateUndo(
+ Metadatable const& i_rObject);
+
+ /** merge i_rMerged and i_rOther into i_rMerged. */
+ void JoinMetadatables(Metadatable & i_rMerged, Metadatable const& i_rOther);
+
+ // unfortunately public, Metadatable::RegisterAsCopyOf needs this
+ virtual bool LookupXmlId(const Metadatable& i_xObject,
+ ::rtl::OUString & o_rStream, ::rtl::OUString & o_rIdref) const;
+
+private:
+
+ virtual Metadatable* LookupElement(const ::rtl::OUString & i_rStreamName,
+ const ::rtl::OUString & i_rIdref) const;
+
+ struct XmlIdRegistry_Impl;
+ ::std::auto_ptr<XmlIdRegistry_Impl> m_pImpl;
+};
+
+// MetadatableUndo ---------------------------------------------------
+
+/** the horrible Undo Metadatable: is inserted into lists to track position */
+class MetadatableUndo : public Metadatable
+{
+ /// as determined by the stream of the source in original document
+ const bool m_isInContent;
+public:
+ MetadatableUndo(const bool i_isInContent)
+ : m_isInContent(i_isInContent) { }
+ virtual ::sfx2::XmlIdRegistry& GetRegistry()
+ {
+ // N.B. for Undo, m_pReg is initialized by registering this as copy in
+ // CreateUndo; it is never cleared
+ OSL_ENSURE(m_pReg, "no m_pReg in MetadatableUndo ?");
+ return *m_pReg;
+ }
+ virtual bool IsInClipboard() const { return false; }
+ virtual bool IsInUndo() const { return true; }
+ virtual bool IsInContent() const { return m_isInContent; }
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::rdf::XMetadatable > MakeUnoObject()
+ { OSL_ENSURE(false, "MetadatableUndo::MakeUnoObject"); throw; }
+};
+
+// MetadatableClipboard ----------------------------------------------
+
+/** the horrible Clipboard Metadatable: inserted into lists to track position */
+class MetadatableClipboard : public Metadatable
+{
+ /// as determined by the stream of the source in original document
+ const bool m_isInContent;
+public:
+ MetadatableClipboard(const bool i_isInContent)
+ : m_isInContent(i_isInContent) { }
+ virtual ::sfx2::XmlIdRegistry& GetRegistry()
+ {
+ // N.B. for Clipboard, m_pReg is initialized by registering this as copy in
+ // RegisterAsCopyOf; it is only cleared by OriginNoLongerInBusinessAnymore
+ OSL_ENSURE(m_pReg, "no m_pReg in MetadatableClipboard ?");
+ return *m_pReg;
+ }
+ virtual bool IsInClipboard() const { return true; }
+ virtual bool IsInUndo() const { return false; }
+ virtual bool IsInContent() const { return m_isInContent; }
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::rdf::XMetadatable > MakeUnoObject()
+ { OSL_ENSURE(false, "MetadatableClipboard::MakeUnoObject"); throw; }
+ void OriginNoLongerInBusinessAnymore() { m_pReg = 0; }
+};
+
+// XmlIdRegistryClipboard --------------------------------------------
+
+class XmlIdRegistryClipboard : public XmlIdRegistry
+{
+
+public:
+ XmlIdRegistryClipboard();
+ virtual ~XmlIdRegistryClipboard();
+
+ virtual void RegisterMetadatableAndCreateID(Metadatable& i_xObject);
+
+ virtual bool TryRegisterMetadatable(Metadatable& i_xObject,
+ ::rtl::OUString const& i_rStreamName, ::rtl::OUString const& i_rIdref);
+
+ virtual void UnregisterMetadatable(Metadatable const&);
+
+ virtual void RemoveXmlIdForElement(Metadatable const&);
+
+ /** register i_rCopy as a copy of i_rSource */
+ MetadatableClipboard & RegisterCopyClipboard(Metadatable & i_rCopy,
+ beans::StringPair const & i_rReference,
+ const bool i_isLatent);
+
+ /** get the Metadatable that links i_rObject to its origin registry */
+ MetadatableClipboard const* SourceLink(Metadatable const& i_rObject);
+
+private:
+ virtual bool LookupXmlId(const Metadatable& i_xObject,
+ ::rtl::OUString & o_rStream, ::rtl::OUString & o_rIdref) const;
+
+ virtual Metadatable* LookupElement(const ::rtl::OUString & i_rStreamName,
+ const ::rtl::OUString & i_rIdref) const;
+
+ /** create a Clipboard Metadatable for i_rObject. */
+ ::boost::shared_ptr<MetadatableClipboard> CreateClipboard(
+ const bool i_isInContent);
+
+ struct XmlIdRegistry_Impl;
+ ::std::auto_ptr<XmlIdRegistry_Impl> m_pImpl;
+};
+
+
+//=============================================================================
+// XmlIdRegistry
+
+::sfx2::IXmlIdRegistry * createXmlIdRegistry(const bool i_DocIsClipboard)
+{
+ return i_DocIsClipboard
+ ? static_cast<XmlIdRegistry*>( new XmlIdRegistryClipboard )
+ : static_cast<XmlIdRegistry*>( new XmlIdRegistryDocument );
+}
+
+XmlIdRegistry::XmlIdRegistry()
+{
+}
+
+XmlIdRegistry::~XmlIdRegistry()
+{
+}
+
+::com::sun::star::uno::Reference< ::com::sun::star::rdf::XMetadatable > SAL_CALL
+XmlIdRegistry::GetElementByMetadataReference(
+ const beans::StringPair & i_rReference) const
+{
+ Metadatable* pObject( LookupElement(i_rReference.First,
+ i_rReference.Second) );
+ return pObject ? pObject->MakeUnoObject() : 0;
+}
+
+beans::StringPair
+XmlIdRegistry::GetXmlIdForElement(const Metadatable& i_rObject) const
+{
+ ::rtl::OUString path;
+ ::rtl::OUString idref;
+ if (LookupXmlId(i_rObject, path, idref))
+ {
+ if (LookupElement(path, idref) == &i_rObject)
+ {
+ return beans::StringPair(path, idref);
+ }
+ }
+ return beans::StringPair();
+}
+
+
+/// generate unique xml:id
+template< typename T >
+/*static*/ ::rtl::OUString create_id(const
+ ::std::hash_map< ::rtl::OUString, T, ::rtl::OUStringHash > & i_rXmlIdMap)
+{
+ const ::rtl::OUString prefix( ::rtl::OUString::createFromAscii(s_prefix) );
+ typename ::std::hash_map< ::rtl::OUString, T, ::rtl::OUStringHash >
+ ::const_iterator iter;
+ ::rtl::OUString id;
+ do
+ {
+ const int n( rand() );
+ id = prefix + ::rtl::OUString::valueOf(static_cast<sal_Int64>(n));
+ iter = i_rXmlIdMap.find(id);
+ }
+ while (iter != i_rXmlIdMap.end());
+ return id;
+}
+
+//=============================================================================
+// Document XML ID Registry (_Impl)
+
+/// element list
+typedef ::std::list< Metadatable* > XmlIdList_t;
+
+/// Idref -> (content.xml element list, styles.xml element list)
+typedef ::std::hash_map< ::rtl::OUString,
+ ::std::pair< XmlIdList_t, XmlIdList_t >, ::rtl::OUStringHash > XmlIdMap_t;
+
+/// pointer hash template
+template<typename T> struct PtrHash
+{
+ size_t operator() (T const * i_pT) const
+ {
+ return reinterpret_cast<size_t>(i_pT);
+ }
+};
+
+/// element -> (stream name, idref)
+typedef ::std::hash_map< const Metadatable*,
+ ::std::pair< ::rtl::OUString, ::rtl::OUString>, PtrHash<Metadatable> >
+ XmlIdReverseMap_t;
+
+struct XmlIdRegistryDocument::XmlIdRegistry_Impl
+{
+ XmlIdRegistry_Impl()
+ : m_XmlIdMap(), m_XmlIdReverseMap() { }
+
+ bool TryInsertMetadatable(Metadatable& i_xObject,
+ const ::rtl::OUString & i_rStream, const ::rtl::OUString & i_rIdref);
+
+ bool LookupXmlId(const Metadatable& i_xObject,
+ ::rtl::OUString & o_rStream, ::rtl::OUString & o_rIdref) const;
+
+ Metadatable* LookupElement(const ::rtl::OUString & i_rStreamName,
+ const ::rtl::OUString & i_rIdref) const;
+
+ const XmlIdList_t * LookupElementList(
+ const ::rtl::OUString & i_rStreamName,
+ const ::rtl::OUString & i_rIdref) const;
+
+ XmlIdList_t * LookupElementList(
+ const ::rtl::OUString & i_rStreamName,
+ const ::rtl::OUString & i_rIdref)
+ {
+ return const_cast<XmlIdList_t*>(
+ const_cast<const XmlIdRegistry_Impl*>(this)
+ ->LookupElementList(i_rStreamName, i_rIdref));
+ }
+
+ XmlIdMap_t m_XmlIdMap;
+ XmlIdReverseMap_t m_XmlIdReverseMap;
+};
+
+// -------------------------------------------------------------------
+
+static void
+rmIter(XmlIdMap_t & i_rXmlIdMap, XmlIdMap_t::iterator const& i_rIter,
+ ::rtl::OUString const & i_rStream, Metadatable const& i_rObject)
+{
+ if (i_rIter != i_rXmlIdMap.end())
+ {
+ XmlIdList_t & rList( isContentFile(i_rStream)
+ ? i_rIter->second.first : i_rIter->second.second );
+ rList.remove(&const_cast<Metadatable&>(i_rObject));
+ if (i_rIter->second.first.empty() && i_rIter->second.second.empty())
+ {
+ i_rXmlIdMap.erase(i_rIter);
+ }
+ }
+}
+
+// -------------------------------------------------------------------
+
+const XmlIdList_t *
+XmlIdRegistryDocument::XmlIdRegistry_Impl::LookupElementList(
+ const ::rtl::OUString & i_rStreamName,
+ const ::rtl::OUString & i_rIdref) const
+{
+ const XmlIdMap_t::const_iterator iter( m_XmlIdMap.find(i_rIdref) );
+ if (iter != m_XmlIdMap.end())
+ {
+ OSL_ENSURE(!iter->second.first.empty() || !iter->second.second.empty(),
+ "null entry in m_XmlIdMap");
+ return (isContentFile(i_rStreamName))
+ ? &iter->second.first
+ : &iter->second.second;
+ }
+ else
+ {
+ return 0;
+ }
+}
+
+Metadatable*
+XmlIdRegistryDocument::XmlIdRegistry_Impl::LookupElement(
+ const ::rtl::OUString & i_rStreamName,
+ const ::rtl::OUString & i_rIdref) const
+{
+ if (!isValidXmlId(i_rStreamName, i_rIdref))
+ {
+ throw lang::IllegalArgumentException(::rtl::OUString::createFromAscii(
+ "illegal XmlId"), 0, 0);
+ }
+
+ const XmlIdList_t * pList( LookupElementList(i_rStreamName, i_rIdref) );
+ if (pList)
+ {
+ const XmlIdList_t::const_iterator iter(
+ ::std::find_if(pList->begin(), pList->end(),
+ ::boost::bind(
+ ::std::logical_not<bool>(),
+ ::boost::bind(
+ ::std::logical_or<bool>(),
+ ::boost::bind( &Metadatable::IsInUndo, _1 ),
+ ::boost::bind( &Metadatable::IsInClipboard, _1 )
+ ) ) ) );
+ if (iter != pList->end())
+ {
+ return *iter;
+ }
+ }
+ return 0;
+}
+
+bool
+XmlIdRegistryDocument::XmlIdRegistry_Impl::LookupXmlId(
+ const Metadatable& i_rObject,
+ ::rtl::OUString & o_rStream, ::rtl::OUString & o_rIdref) const
+{
+ const XmlIdReverseMap_t::const_iterator iter(
+ m_XmlIdReverseMap.find(&i_rObject) );
+ if (iter != m_XmlIdReverseMap.end())
+ {
+ OSL_ENSURE(!iter->second.first.equalsAscii(""),
+ "null stream in m_XmlIdReverseMap");
+ OSL_ENSURE(!iter->second.second.equalsAscii(""),
+ "null id in m_XmlIdReverseMap");
+ o_rStream = iter->second.first;
+ o_rIdref = iter->second.second;
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+}
+
+bool
+XmlIdRegistryDocument::XmlIdRegistry_Impl::TryInsertMetadatable(
+ Metadatable & i_rObject,
+ const ::rtl::OUString & i_rStreamName, const ::rtl::OUString & i_rIdref)
+{
+ const bool bContent( isContentFile(i_rStreamName) );
+ OSL_ENSURE(isContentFile(i_rStreamName) || isStylesFile(i_rStreamName),
+ "invalid stream");
+
+ XmlIdList_t * pList( LookupElementList(i_rStreamName, i_rIdref) );
+ if (pList)
+ {
+ if (pList->empty())
+ {
+ pList->push_back( &i_rObject );
+ return true;
+ }
+ else
+ {
+ // this is only called from TryRegister now, so check
+ // if all elements in the list are deleted (in undo) or
+ // placeholders, then "steal" the id from them
+ if ( pList->end() == ::std::find_if(pList->begin(), pList->end(),
+ ::boost::bind(
+ ::std::logical_not<bool>(),
+ ::boost::bind(
+ ::std::logical_or<bool>(),
+ ::boost::bind( &Metadatable::IsInUndo, _1 ),
+ ::boost::bind( &Metadatable::IsInClipboard, _1 )
+ ) ) ) )
+ {
+// ??? this is not undoable
+// pList->clear();
+// pList->push_back( &i_rObject );
+ pList->push_front( &i_rObject );
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ }
+ else
+ {
+ m_XmlIdMap.insert(::std::make_pair(i_rIdref, bContent
+ ? ::std::make_pair( XmlIdList_t( 1, &i_rObject ), XmlIdList_t() )
+ : ::std::make_pair( XmlIdList_t(), XmlIdList_t( 1, &i_rObject ) )));
+ return true;
+ }
+}
+
+//=============================================================================
+// Document XML ID Registry
+
+
+XmlIdRegistryDocument::XmlIdRegistryDocument()
+ : m_pImpl( new XmlIdRegistry_Impl )
+{
+}
+
+static void
+removeLink(Metadatable* i_pObject)
+{
+ OSL_ENSURE(i_pObject, "null in list ???");
+ if (!i_pObject) return;
+ if (i_pObject->IsInClipboard())
+ {
+ MetadatableClipboard* pLink(
+ dynamic_cast<MetadatableClipboard*>( i_pObject ) );
+ OSL_ENSURE(pLink, "IsInClipboard, but no MetadatableClipboard ?");
+ if (pLink)
+ {
+ pLink->OriginNoLongerInBusinessAnymore();
+ }
+ }
+}
+
+XmlIdRegistryDocument::~XmlIdRegistryDocument()
+{
+ // notify all list elements that are actually in the clipboard
+ for (XmlIdMap_t::iterator iter(m_pImpl->m_XmlIdMap.begin());
+ iter != m_pImpl->m_XmlIdMap.end(); ++iter)
+ {
+ ::std::for_each(iter->second.first.begin(), iter->second.first.end(),
+ removeLink);
+ ::std::for_each(iter->second.second.begin(), iter->second.second.end(),
+ removeLink);
+ }
+}
+
+bool
+XmlIdRegistryDocument::LookupXmlId(
+ const Metadatable& i_rObject,
+ ::rtl::OUString & o_rStream, ::rtl::OUString & o_rIdref) const
+{
+ return m_pImpl->LookupXmlId(i_rObject, o_rStream, o_rIdref);
+}
+
+Metadatable*
+XmlIdRegistryDocument::LookupElement(
+ const ::rtl::OUString & i_rStreamName,
+ const ::rtl::OUString & i_rIdref) const
+{
+ return m_pImpl->LookupElement(i_rStreamName, i_rIdref);
+}
+
+bool
+XmlIdRegistryDocument::TryRegisterMetadatable(Metadatable & i_rObject,
+ ::rtl::OUString const& i_rStreamName, ::rtl::OUString const& i_rIdref)
+{
+ OSL_TRACE("TryRegisterMetadatable: %p (%s#%s)\n", &i_rObject,
+ ::rtl::OUStringToOString(i_rStreamName, RTL_TEXTENCODING_UTF8).getStr(),
+ ::rtl::OUStringToOString(i_rIdref, RTL_TEXTENCODING_UTF8).getStr());
+
+ OSL_ENSURE(!dynamic_cast<MetadatableUndo*>(&i_rObject),
+ "TryRegisterMetadatable called for MetadatableUndo?");
+ OSL_ENSURE(!dynamic_cast<MetadatableClipboard*>(&i_rObject),
+ "TryRegisterMetadatable called for MetadatableClipboard?");
+
+ if (!isValidXmlId(i_rStreamName, i_rIdref))
+ {
+ throw lang::IllegalArgumentException(::rtl::OUString::createFromAscii(
+ "illegal XmlId"), 0, 0);
+ }
+ if (i_rObject.IsInContent()
+ ? !isContentFile(i_rStreamName)
+ : !isStylesFile(i_rStreamName))
+ {
+ throw lang::IllegalArgumentException(::rtl::OUString::createFromAscii(
+ "illegal XmlId: wrong stream"), 0, 0);
+ }
+
+ ::rtl::OUString old_path;
+ ::rtl::OUString old_idref;
+ m_pImpl->LookupXmlId(i_rObject, old_path, old_idref);
+ if (old_path == i_rStreamName && old_idref == i_rIdref)
+ {
+ return (m_pImpl->LookupElement(old_path, old_idref) == &i_rObject);
+ }
+ XmlIdMap_t::iterator old_id( m_pImpl->m_XmlIdMap.end() );
+ if (!old_idref.equalsAscii(""))
+ {
+ old_id = m_pImpl->m_XmlIdMap.find(old_idref);
+ OSL_ENSURE(old_id != m_pImpl->m_XmlIdMap.end(), "old id not found");
+ }
+ if (m_pImpl->TryInsertMetadatable(i_rObject, i_rStreamName, i_rIdref))
+ {
+ rmIter(m_pImpl->m_XmlIdMap, old_id, old_path, i_rObject);
+ m_pImpl->m_XmlIdReverseMap[&i_rObject] =
+ ::std::make_pair(i_rStreamName, i_rIdref);
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+}
+
+void
+XmlIdRegistryDocument::RegisterMetadatableAndCreateID(Metadatable & i_rObject)
+{
+ OSL_TRACE("RegisterMetadatableAndCreateID: %p\n", &i_rObject);
+
+ OSL_ENSURE(!dynamic_cast<MetadatableUndo*>(&i_rObject),
+ "RegisterMetadatableAndCreateID called for MetadatableUndo?");
+ OSL_ENSURE(!dynamic_cast<MetadatableClipboard*>(&i_rObject),
+ "RegisterMetadatableAndCreateID called for MetadatableClipboard?");
+
+ const bool isInContent( i_rObject.IsInContent() );
+ const ::rtl::OUString stream( ::rtl::OUString::createFromAscii(
+ isInContent ? s_content : s_styles ) );
+ // check if we have a latent xmlid, and if yes, remove it
+ ::rtl::OUString old_path;
+ ::rtl::OUString old_idref;
+ m_pImpl->LookupXmlId(i_rObject, old_path, old_idref);
+
+ XmlIdMap_t::iterator old_id( m_pImpl->m_XmlIdMap.end() );
+ if (!old_idref.equalsAscii(""))
+ {
+ old_id = m_pImpl->m_XmlIdMap.find(old_idref);
+ OSL_ENSURE(old_id != m_pImpl->m_XmlIdMap.end(), "old id not found");
+ if (m_pImpl->LookupElement(old_path, old_idref) == &i_rObject)
+ {
+ return;
+ }
+ else
+ {
+ // remove latent xmlid
+ rmIter(m_pImpl->m_XmlIdMap, old_id, old_path, i_rObject);
+ }
+ }
+
+ // create id
+ const ::rtl::OUString id( create_id(m_pImpl->m_XmlIdMap) );
+ OSL_ENSURE(m_pImpl->m_XmlIdMap.find(id) == m_pImpl->m_XmlIdMap.end(),
+ "created id is in use");
+ m_pImpl->m_XmlIdMap.insert(::std::make_pair(id, isInContent
+ ? ::std::make_pair( XmlIdList_t( 1, &i_rObject ), XmlIdList_t() )
+ : ::std::make_pair( XmlIdList_t(), XmlIdList_t( 1, &i_rObject ) )));
+ m_pImpl->m_XmlIdReverseMap[&i_rObject] = ::std::make_pair(stream, id);
+}
+
+void XmlIdRegistryDocument::UnregisterMetadatable(const Metadatable& i_rObject)
+{
+ OSL_TRACE("UnregisterMetadatable: %p\n", &i_rObject);
+
+ ::rtl::OUString path;
+ ::rtl::OUString idref;
+ if (!m_pImpl->LookupXmlId(i_rObject, path, idref))
+ {
+ OSL_ENSURE(false, "unregister: no xml id?");
+ return;
+ }
+ const XmlIdMap_t::iterator iter( m_pImpl->m_XmlIdMap.find(idref) );
+ if (iter != m_pImpl->m_XmlIdMap.end())
+ {
+ rmIter(m_pImpl->m_XmlIdMap, iter, path, i_rObject);
+ }
+}
+
+void XmlIdRegistryDocument::RemoveXmlIdForElement(const Metadatable& i_rObject)
+{
+ OSL_TRACE("RemoveXmlIdForElement: %p\n", &i_rObject);
+
+ const XmlIdReverseMap_t::iterator iter(
+ m_pImpl->m_XmlIdReverseMap.find(&i_rObject) );
+ if (iter != m_pImpl->m_XmlIdReverseMap.end())
+ {
+ OSL_ENSURE(!iter->second.second.equalsAscii(""),
+ "null id in m_XmlIdReverseMap");
+ m_pImpl->m_XmlIdReverseMap.erase(iter);
+ }
+}
+
+// -------------------------------------------------------------------
+
+void XmlIdRegistryDocument::RegisterCopy(Metadatable const& i_rSource,
+ Metadatable & i_rCopy, const bool i_bCopyPrecedesSource)
+{
+ OSL_TRACE("RegisterCopy: %p -> %p (%d)\n",
+ &i_rSource, &i_rCopy, i_bCopyPrecedesSource);
+
+ // potential sources: clipboard, undo array, splitNode
+ // assumption: stream change can only happen via clipboard, and is handled
+ // by Metadatable::RegisterAsCopyOf
+ OSL_ENSURE(i_rSource.IsInUndo() || i_rCopy.IsInUndo() ||
+ (i_rSource.IsInContent() == i_rCopy.IsInContent()),
+ "RegisterCopy: not in same stream?");
+
+ ::rtl::OUString path;
+ ::rtl::OUString idref;
+ if (!m_pImpl->LookupXmlId( i_rSource, path, idref ))
+ {
+ OSL_ENSURE(false, "no xml id?");
+ return;
+ }
+ XmlIdList_t * pList ( m_pImpl->LookupElementList(path, idref) );
+ OSL_ENSURE( ::std::find( pList->begin(), pList->end(), &i_rCopy )
+ == pList->end(), "copy already registered???");
+ XmlIdList_t::iterator srcpos(
+ ::std::find( pList->begin(), pList->end(), &i_rSource ) );
+ OSL_ENSURE(srcpos != pList->end(), "source not in list???");
+ if (srcpos == pList->end())
+ {
+ return;
+ }
+ if (i_bCopyPrecedesSource)
+ {
+ pList->insert( srcpos, &i_rCopy );
+ }
+ else
+ {
+ // for undo push_back does not work! must insert right after source
+ pList->insert( ++srcpos, &i_rCopy );
+ }
+ m_pImpl->m_XmlIdReverseMap.insert(::std::make_pair(&i_rCopy,
+ ::std::make_pair(path, idref)));
+}
+
+::boost::shared_ptr<MetadatableUndo>
+XmlIdRegistryDocument::CreateUndo(Metadatable const& i_rObject)
+{
+ OSL_TRACE("CreateUndo: %p\n", &i_rObject);
+
+ return ::boost::shared_ptr<MetadatableUndo>(
+ new MetadatableUndo(i_rObject.IsInContent()) );
+}
+
+/*
+i_rMerged is both a source and the target node of the merge
+i_rOther is the other source, and will be deleted after the merge
+
+dimensions: none|latent|actual empty|nonempty
+i_rMerged(1) i_rOther(2) result
+ *|empty *|empty => 1|2 (arbitrary)
+ *|empty *|nonempty => 2
+ *|nonempty *|empty => 1
+ none|nonempty none|nonempty => none
+ none|nonempty latent|nonempty => 2
+latent|nonempty none|nonempty => 1
+latent|nonempty latent|nonempty => 1|2
+ *|nonempty actual|nonempty => 2
+actual|nonempty *|nonempty => 1
+actual|nonempty actual|nonempty => 1|2
+*/
+void
+XmlIdRegistryDocument::JoinMetadatables(
+ Metadatable & i_rMerged, Metadatable const & i_rOther)
+{
+ OSL_TRACE("JoinMetadatables: %p <- %p\n", &i_rMerged, &i_rOther);
+
+ bool mergedOwnsRef;
+ ::rtl::OUString path;
+ ::rtl::OUString idref;
+ if (m_pImpl->LookupXmlId(i_rMerged, path, idref))
+ {
+ mergedOwnsRef = (m_pImpl->LookupElement(path, idref) == &i_rMerged);
+ }
+ else
+ {
+ OSL_ENSURE(false, "JoinMetadatables: no xmlid?");
+ return;
+ }
+ if (!mergedOwnsRef)
+ {
+ i_rMerged.RemoveMetadataReference();
+ i_rMerged.RegisterAsCopyOf(i_rOther, true);
+ return;
+ }
+ // other cases: merged has actual ref and is nonempty,
+ // other has latent/actual ref and is nonempty: other loses => nothing to do
+}
+
+
+//=============================================================================
+// Clipboard XML ID Registry (_Impl)
+
+struct RMapEntry
+{
+ RMapEntry() : m_pLink() { }
+ RMapEntry(::rtl::OUString const& i_rStream,
+ ::rtl::OUString const& i_rXmlId,
+ ::boost::shared_ptr<MetadatableClipboard> const& i_pLink
+ = ::boost::shared_ptr<MetadatableClipboard>())
+ : m_Stream(i_rStream), m_XmlId(i_rXmlId), m_pLink(i_pLink)
+ {}
+ ::rtl::OUString m_Stream;
+ ::rtl::OUString m_XmlId;
+ // this would have been an auto_ptr, if only that would have compiled...
+ ::boost::shared_ptr<MetadatableClipboard> m_pLink;
+};
+
+/// element -> (stream name, idref, source)
+typedef ::std::hash_map< const Metadatable*,
+ struct RMapEntry,
+ PtrHash<Metadatable> >
+ ClipboardXmlIdReverseMap_t;
+
+/// Idref -> (content.xml element, styles.xml element)
+typedef ::std::hash_map< ::rtl::OUString,
+ ::std::pair< Metadatable*, Metadatable* >, ::rtl::OUStringHash >
+ ClipboardXmlIdMap_t;
+
+struct XmlIdRegistryClipboard::XmlIdRegistry_Impl
+{
+ XmlIdRegistry_Impl()
+ : m_XmlIdMap(), m_XmlIdReverseMap() { }
+
+ bool TryInsertMetadatable(Metadatable& i_xObject,
+ const ::rtl::OUString & i_rStream, const ::rtl::OUString & i_rIdref);
+
+ bool LookupXmlId(const Metadatable& i_xObject,
+ ::rtl::OUString & o_rStream, ::rtl::OUString & o_rIdref,
+ MetadatableClipboard const* &o_rpLink) const;
+
+ Metadatable* LookupElement(const ::rtl::OUString & i_rStreamName,
+ const ::rtl::OUString & i_rIdref) const;
+
+ Metadatable* const* LookupEntry(const ::rtl::OUString & i_rStreamName,
+ const ::rtl::OUString & i_rIdref) const;
+
+ Metadatable* * LookupEntry(const ::rtl::OUString & i_rStreamName,
+ const ::rtl::OUString & i_rIdref)
+ {
+ return const_cast<Metadatable**>(
+ const_cast<const XmlIdRegistry_Impl*>(this)
+ ->LookupEntry(i_rStreamName, i_rIdref));
+ }
+
+ ClipboardXmlIdMap_t m_XmlIdMap;
+ ClipboardXmlIdReverseMap_t m_XmlIdReverseMap;
+};
+
+// -------------------------------------------------------------------
+
+static void
+rmIter(ClipboardXmlIdMap_t & i_rXmlIdMap,
+ ClipboardXmlIdMap_t::iterator const& i_rIter,
+ ::rtl::OUString const & i_rStream, Metadatable const& i_rObject)
+{
+ if (i_rIter != i_rXmlIdMap.end())
+ {
+ Metadatable *& rMeta = isContentFile(i_rStream)
+ ? i_rIter->second.first : i_rIter->second.second;
+ if (rMeta == &i_rObject)
+ {
+ rMeta = 0;
+ }
+ if (!i_rIter->second.first && !i_rIter->second.second)
+ {
+ i_rXmlIdMap.erase(i_rIter);
+ }
+ }
+}
+
+// -------------------------------------------------------------------
+
+Metadatable* const*
+XmlIdRegistryClipboard::XmlIdRegistry_Impl::LookupEntry(
+ const ::rtl::OUString & i_rStreamName,
+ const ::rtl::OUString & i_rIdref) const
+{
+ if (!isValidXmlId(i_rStreamName, i_rIdref))
+ {
+ throw lang::IllegalArgumentException(::rtl::OUString::createFromAscii(
+ "illegal XmlId"), 0, 0);
+ }
+
+ const ClipboardXmlIdMap_t::const_iterator iter( m_XmlIdMap.find(i_rIdref) );
+ if (iter != m_XmlIdMap.end())
+ {
+ OSL_ENSURE(iter->second.first || iter->second.second,
+ "null entry in m_XmlIdMap");
+ return (isContentFile(i_rStreamName))
+ ? &iter->second.first
+ : &iter->second.second;
+ }
+ else
+ {
+ return 0;
+ }
+}
+
+Metadatable*
+XmlIdRegistryClipboard::XmlIdRegistry_Impl::LookupElement(
+ const ::rtl::OUString & i_rStreamName,
+ const ::rtl::OUString & i_rIdref) const
+{
+ Metadatable * const * ppEntry = LookupEntry(i_rStreamName, i_rIdref);
+ return ppEntry ? *ppEntry : 0;
+}
+
+bool
+XmlIdRegistryClipboard::XmlIdRegistry_Impl::LookupXmlId(
+ const Metadatable& i_rObject,
+ ::rtl::OUString & o_rStream, ::rtl::OUString & o_rIdref,
+ MetadatableClipboard const* &o_rpLink) const
+{
+ const ClipboardXmlIdReverseMap_t::const_iterator iter(
+ m_XmlIdReverseMap.find(&i_rObject) );
+ if (iter != m_XmlIdReverseMap.end())
+ {
+ OSL_ENSURE(!iter->second.m_Stream.equalsAscii(""),
+ "null stream in m_XmlIdReverseMap");
+ OSL_ENSURE(!iter->second.m_XmlId.equalsAscii(""),
+ "null id in m_XmlIdReverseMap");
+ o_rStream = iter->second.m_Stream;
+ o_rIdref = iter->second.m_XmlId;
+ o_rpLink = iter->second.m_pLink.get();
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+}
+
+bool
+XmlIdRegistryClipboard::XmlIdRegistry_Impl::TryInsertMetadatable(
+ Metadatable & i_rObject,
+ const ::rtl::OUString & i_rStreamName, const ::rtl::OUString & i_rIdref)
+{
+ bool bContent( isContentFile(i_rStreamName) );
+ OSL_ENSURE(isContentFile(i_rStreamName) || isStylesFile(i_rStreamName),
+ "invalid stream");
+
+ //wntmsci12 won't parse this:
+// Metadatable ** ppEntry( LookupEntry(i_rStreamName, i_rIdref) );
+ Metadatable ** ppEntry = LookupEntry(i_rStreamName, i_rIdref);
+ if (ppEntry)
+ {
+ if (*ppEntry)
+ {
+ return false;
+ }
+ else
+ {
+ *ppEntry = &i_rObject;
+ return true;
+ }
+ }
+ else
+ {
+ m_XmlIdMap.insert(::std::make_pair(i_rIdref, bContent
+ ? ::std::make_pair( &i_rObject, static_cast<Metadatable*>(0) )
+ : ::std::make_pair( static_cast<Metadatable*>(0), &i_rObject )));
+ return true;
+ }
+}
+
+//=============================================================================
+// Clipboard XML ID Registry
+
+
+XmlIdRegistryClipboard::XmlIdRegistryClipboard()
+ : m_pImpl( new XmlIdRegistry_Impl )
+{
+}
+
+XmlIdRegistryClipboard::~XmlIdRegistryClipboard()
+{
+}
+
+bool
+XmlIdRegistryClipboard::LookupXmlId(
+ const Metadatable& i_rObject,
+ ::rtl::OUString & o_rStream, ::rtl::OUString & o_rIdref) const
+{
+ const MetadatableClipboard * pLink;
+ return m_pImpl->LookupXmlId(i_rObject, o_rStream, o_rIdref, pLink);
+}
+
+Metadatable*
+XmlIdRegistryClipboard::LookupElement(
+ const ::rtl::OUString & i_rStreamName,
+ const ::rtl::OUString & i_rIdref) const
+{
+ return m_pImpl->LookupElement(i_rStreamName, i_rIdref);
+}
+
+bool
+XmlIdRegistryClipboard::TryRegisterMetadatable(Metadatable & i_rObject,
+ ::rtl::OUString const& i_rStreamName, ::rtl::OUString const& i_rIdref)
+{
+ OSL_TRACE("TryRegisterMetadatable: %p (%s#%s)\n", &i_rObject,
+ ::rtl::OUStringToOString(i_rStreamName, RTL_TEXTENCODING_UTF8).getStr(),
+ ::rtl::OUStringToOString(i_rIdref, RTL_TEXTENCODING_UTF8).getStr());
+
+ OSL_ENSURE(!dynamic_cast<MetadatableUndo*>(&i_rObject),
+ "TryRegisterMetadatable called for MetadatableUndo?");
+ OSL_ENSURE(!dynamic_cast<MetadatableClipboard*>(&i_rObject),
+ "TryRegisterMetadatable called for MetadatableClipboard?");
+
+ if (!isValidXmlId(i_rStreamName, i_rIdref))
+ {
+ throw lang::IllegalArgumentException(::rtl::OUString::createFromAscii(
+ "illegal XmlId"), 0, 0);
+ }
+ if (i_rObject.IsInContent()
+ ? !isContentFile(i_rStreamName)
+ : !isStylesFile(i_rStreamName))
+ {
+ throw lang::IllegalArgumentException(::rtl::OUString::createFromAscii(
+ "illegal XmlId: wrong stream"), 0, 0);
+ }
+
+ ::rtl::OUString old_path;
+ ::rtl::OUString old_idref;
+ const MetadatableClipboard * pLink;
+ m_pImpl->LookupXmlId(i_rObject, old_path, old_idref, pLink);
+ if (old_path == i_rStreamName && old_idref == i_rIdref)
+ {
+ return (m_pImpl->LookupElement(old_path, old_idref) == &i_rObject);
+ }
+ ClipboardXmlIdMap_t::iterator old_id( m_pImpl->m_XmlIdMap.end() );
+ if (!old_idref.equalsAscii(""))
+ {
+ old_id = m_pImpl->m_XmlIdMap.find(old_idref);
+ OSL_ENSURE(old_id != m_pImpl->m_XmlIdMap.end(), "old id not found");
+ }
+ if (m_pImpl->TryInsertMetadatable(i_rObject, i_rStreamName, i_rIdref))
+ {
+ rmIter(m_pImpl->m_XmlIdMap, old_id, old_path, i_rObject);
+ m_pImpl->m_XmlIdReverseMap[&i_rObject] =
+ RMapEntry(i_rStreamName, i_rIdref);
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+}
+
+void
+XmlIdRegistryClipboard::RegisterMetadatableAndCreateID(Metadatable & i_rObject)
+{
+ OSL_TRACE("RegisterMetadatableAndCreateID: %p\n", &i_rObject);
+
+ OSL_ENSURE(!dynamic_cast<MetadatableUndo*>(&i_rObject),
+ "RegisterMetadatableAndCreateID called for MetadatableUndo?");
+ OSL_ENSURE(!dynamic_cast<MetadatableClipboard*>(&i_rObject),
+ "RegisterMetadatableAndCreateID called for MetadatableClipboard?");
+
+ bool isInContent( i_rObject.IsInContent() );
+ ::rtl::OUString stream( ::rtl::OUString::createFromAscii(
+ isInContent ? s_content : s_styles ) );
+
+ ::rtl::OUString old_path;
+ ::rtl::OUString old_idref;
+ LookupXmlId(i_rObject, old_path, old_idref);
+ if (!old_idref.equalsAscii("") &&
+ (m_pImpl->LookupElement(old_path, old_idref) == &i_rObject))
+ {
+ return;
+ }
+
+ // create id
+ const ::rtl::OUString id( create_id(m_pImpl->m_XmlIdMap) );
+ OSL_ENSURE(m_pImpl->m_XmlIdMap.find(id) == m_pImpl->m_XmlIdMap.end(),
+ "created id is in use");
+ m_pImpl->m_XmlIdMap.insert(::std::make_pair(id, isInContent
+ ? ::std::make_pair( &i_rObject, static_cast<Metadatable*>(0) )
+ : ::std::make_pair( static_cast<Metadatable*>(0), &i_rObject )));
+ // N.B.: if i_rObject had a latent XmlId, then we implicitly delete the
+ // MetadatableClipboard and thus the latent XmlId here
+ m_pImpl->m_XmlIdReverseMap[&i_rObject] = RMapEntry(stream, id);
+}
+
+void XmlIdRegistryClipboard::UnregisterMetadatable(const Metadatable& i_rObject)
+{
+ OSL_TRACE("UnregisterMetadatable: %p\n", &i_rObject);
+
+ ::rtl::OUString path;
+ ::rtl::OUString idref;
+ const MetadatableClipboard * pLink;
+ if (!m_pImpl->LookupXmlId(i_rObject, path, idref, pLink))
+ {
+ OSL_ENSURE(false, "unregister: no xml id?");
+ return;
+ }
+ const ClipboardXmlIdMap_t::iterator iter( m_pImpl->m_XmlIdMap.find(idref) );
+ if (iter != m_pImpl->m_XmlIdMap.end())
+ {
+ rmIter(m_pImpl->m_XmlIdMap, iter, path, i_rObject);
+ }
+}
+
+
+void XmlIdRegistryClipboard::RemoveXmlIdForElement(const Metadatable& i_rObject)
+{
+ OSL_TRACE("RemoveXmlIdForElement: %p\n", &i_rObject);
+
+ ClipboardXmlIdReverseMap_t::iterator iter(
+ m_pImpl->m_XmlIdReverseMap.find(&i_rObject) );
+ if (iter != m_pImpl->m_XmlIdReverseMap.end())
+ {
+ OSL_ENSURE(!iter->second.m_XmlId.equalsAscii(""),
+ "null id in m_XmlIdReverseMap");
+ m_pImpl->m_XmlIdReverseMap.erase(iter);
+ }
+}
+
+// -------------------------------------------------------------------
+
+::boost::shared_ptr<MetadatableClipboard>
+XmlIdRegistryClipboard::CreateClipboard(const bool i_isInContent)
+{
+ OSL_TRACE("CreateClipboard: \n");
+
+ return ::boost::shared_ptr<MetadatableClipboard>(
+ new MetadatableClipboard(i_isInContent) );
+}
+
+MetadatableClipboard &
+XmlIdRegistryClipboard::RegisterCopyClipboard(Metadatable & i_rCopy,
+ beans::StringPair const & i_rReference,
+ const bool i_isLatent)
+{
+ OSL_TRACE("RegisterCopyClipboard: %p -> "/*"%p"*/"(%s#%s) (%d)\n",
+ /*&i_rSource,*/ &i_rCopy,
+ ::rtl::OUStringToOString(i_rReference.First,
+ RTL_TEXTENCODING_UTF8).getStr(),
+ ::rtl::OUStringToOString(i_rReference.Second,
+ RTL_TEXTENCODING_UTF8).getStr(),
+ i_isLatent);
+
+ // N.B.: when copying to the clipboard, the selection is always inserted
+ // into the body, even if the source is a header/footer!
+ // so we do not check whether the stream is right in this function
+
+ if (!isValidXmlId(i_rReference.First, i_rReference.Second))
+ {
+ throw lang::IllegalArgumentException(::rtl::OUString::createFromAscii(
+ "illegal XmlId"), 0, 0);
+ }
+
+ if (!i_isLatent)
+ {
+ // this should succeed assuming clipboard has a single source document
+ const bool success( m_pImpl->TryInsertMetadatable(i_rCopy,
+ i_rReference.First, i_rReference.Second) );
+ OSL_ENSURE(success, "RegisterCopyClipboard: TryInsert failed?");
+ (void) success;
+ }
+ const ::boost::shared_ptr<MetadatableClipboard> pLink(
+ CreateClipboard( isContentFile(i_rReference.First)) );
+ m_pImpl->m_XmlIdReverseMap.insert(::std::make_pair(&i_rCopy,
+ RMapEntry(i_rReference.First, i_rReference.Second, pLink)));
+ return *pLink.get();
+}
+
+MetadatableClipboard const*
+XmlIdRegistryClipboard::SourceLink(Metadatable const& i_rObject)
+{
+ ::rtl::OUString path;
+ ::rtl::OUString idref;
+ const MetadatableClipboard * pLink( 0 );
+ m_pImpl->LookupXmlId(i_rObject, path, idref, pLink);
+ return pLink;
+}
+
+
+//=============================================================================
+// Metadatable mixin
+
+
+Metadatable::~Metadatable()
+{
+ RemoveMetadataReference();
+}
+
+void Metadatable::RemoveMetadataReference()
+{
+ try
+ {
+ if (m_pReg)
+ {
+ m_pReg->UnregisterMetadatable( *this );
+ m_pReg->RemoveXmlIdForElement( *this );
+ m_pReg = 0;
+ }
+ }
+ catch (uno::Exception &)
+ {
+ OSL_ENSURE(false, "Metadatable::RemoveMetadataReference: exception");
+ }
+}
+
+// ::com::sun::star::rdf::XMetadatable:
+beans::StringPair
+Metadatable::GetMetadataReference() const
+{
+ if (m_pReg)
+ {
+ return m_pReg->GetXmlIdForElement(*this);
+ }
+ return beans::StringPair();
+}
+
+void
+Metadatable::SetMetadataReference(
+ const ::com::sun::star::beans::StringPair & i_rReference)
+{
+ if (i_rReference.Second.equalsAscii(""))
+ {
+ RemoveMetadataReference();
+ }
+ else
+ {
+ ::rtl::OUString streamName( i_rReference.First );
+ if (streamName.equalsAscii(""))
+ {
+ // handle empty stream name as auto-detect.
+ // necessary for importing flat file format.
+ streamName = ::rtl::OUString::createFromAscii(
+ IsInContent() ? s_content : s_styles );
+ }
+ XmlIdRegistry & rReg( dynamic_cast<XmlIdRegistry&>( GetRegistry() ) );
+ if (rReg.TryRegisterMetadatable(*this, streamName, i_rReference.Second))
+ {
+ m_pReg = &rReg;
+ }
+ else
+ {
+ throw lang::IllegalArgumentException(
+ ::rtl::OUString::createFromAscii("Metadatable::"
+ "SetMetadataReference: argument is invalid"), /*this*/0, 0);
+ }
+ }
+}
+
+void Metadatable::EnsureMetadataReference()
+{
+ XmlIdRegistry& rReg(
+ m_pReg ? *m_pReg : dynamic_cast<XmlIdRegistry&>( GetRegistry() ) );
+ rReg.RegisterMetadatableAndCreateID( *this );
+ m_pReg = &rReg;
+}
+
+const ::sfx2::IXmlIdRegistry& GetRegistryConst(Metadatable const& i_rObject)
+{
+ return const_cast< Metadatable& >( i_rObject ).GetRegistry();
+}
+
+void
+Metadatable::RegisterAsCopyOf(Metadatable const & i_rSource,
+ const bool i_bCopyPrecedesSource)
+{
+ OSL_ENSURE(typeid(*this) == typeid(i_rSource)
+ || typeid(i_rSource) == typeid(MetadatableUndo)
+ || typeid(*this) == typeid(MetadatableUndo)
+ || typeid(i_rSource) == typeid(MetadatableClipboard)
+ || typeid(*this) == typeid(MetadatableClipboard),
+ "RegisterAsCopyOf element with different class?");
+ OSL_ENSURE(!this->m_pReg, "RegisterAsCopyOf called on element with XmlId?");
+
+ if (this->m_pReg)
+ {
+ RemoveMetadataReference();
+ }
+
+ try
+ {
+ if (i_rSource.m_pReg)
+ {
+ XmlIdRegistry & rReg(
+ dynamic_cast<XmlIdRegistry&>( GetRegistry() ) );
+ if (i_rSource.m_pReg == &rReg)
+ {
+ OSL_ENSURE(!IsInClipboard(),
+ "RegisterAsCopy: both in clipboard?");
+ if (!IsInClipboard())
+ {
+ XmlIdRegistryDocument & rRegDoc(
+ dynamic_cast<XmlIdRegistryDocument&>( rReg ) );
+ rRegDoc.RegisterCopy(i_rSource, *this,
+ i_bCopyPrecedesSource);
+ this->m_pReg = &rRegDoc;
+ }
+ return;
+ }
+ // source is in different document
+ XmlIdRegistryDocument * pRegDoc(
+ dynamic_cast<XmlIdRegistryDocument *>(&rReg) );
+ XmlIdRegistryClipboard * pRegClp(
+ dynamic_cast<XmlIdRegistryClipboard*>(&rReg) );
+
+ if (pRegClp)
+ {
+ beans::StringPair SourceRef(
+ i_rSource.m_pReg->GetXmlIdForElement(i_rSource) );
+ bool isLatent( SourceRef.Second.equalsAscii("") );
+ XmlIdRegistryDocument * pSourceRegDoc(
+ dynamic_cast<XmlIdRegistryDocument*>(i_rSource.m_pReg) );
+ OSL_ENSURE(pSourceRegDoc, "RegisterAsCopyOf: 2 clipboards?");
+ if (!pSourceRegDoc) return;
+ // this is a copy _to_ the clipboard
+ if (isLatent)
+ {
+ pSourceRegDoc->LookupXmlId(i_rSource,
+ SourceRef.First, SourceRef.Second);
+ }
+ Metadatable & rLink(
+ pRegClp->RegisterCopyClipboard(*this, SourceRef, isLatent));
+ this->m_pReg = pRegClp;
+ // register as copy in the non-clipboard registry
+ pSourceRegDoc->RegisterCopy(i_rSource, rLink,
+ false); // i_bCopyPrecedesSource);
+ rLink.m_pReg = pSourceRegDoc;
+ }
+ else if (pRegDoc)
+ {
+ XmlIdRegistryClipboard * pSourceRegClp(
+ dynamic_cast<XmlIdRegistryClipboard*>(i_rSource.m_pReg) );
+ OSL_ENSURE(pSourceRegClp,
+ "RegisterAsCopyOf: 2 non-clipboards?");
+ if (!pSourceRegClp) return;
+ const MetadatableClipboard * pLink(
+ pSourceRegClp->SourceLink(i_rSource) );
+ // may happen if src got its id via UNO call
+ if (!pLink) return;
+ // only register copy if clipboard content is from this SwDoc!
+ if (pLink && (&GetRegistryConst(*pLink) == pRegDoc))
+ {
+ // this is a copy _from_ the clipboard; check if the
+ // element is still in the same stream
+ // N.B.: we check the stream of pLink, not of i_rSource!
+ bool srcInContent( pLink->IsInContent() );
+ bool tgtInContent( this->IsInContent() );
+ if (srcInContent == tgtInContent)
+ {
+ pRegDoc->RegisterCopy(*pLink, *this,
+ true); // i_bCopyPrecedesSource);
+ this->m_pReg = pRegDoc;
+ }
+ // otherwise: stream change! do not register!
+ }
+ }
+ else
+ {
+ OSL_ENSURE(false, "neither RegDoc nor RegClp cannot happen");
+ }
+#if 0
+ {
+ //FIXME: do we need this at all???
+ XmlIdRegistryDocument & rRegDoc(
+ dynamic_cast<XmlIdRegistryDocument&>( rReg ) );
+ {
+ if (rRegDoc.TryRegisterMetadatable(*this, SourceRef))
+ {
+ this->m_pReg = &rRegDoc;
+ }
+ }
+ }
+#endif
+ }
+ }
+ catch (uno::Exception &)
+ {
+ OSL_ENSURE(false, "Metadatable::RegisterAsCopyOf: exception");
+ }
+}
+
+::boost::shared_ptr<MetadatableUndo> Metadatable::CreateUndo(
+ const bool i_isDelete)
+{
+ OSL_ENSURE(!IsInUndo(), "CreateUndo called for object in undo?");
+ OSL_ENSURE(!IsInClipboard(), "CreateUndo called for object in clipboard?");
+ try
+ {
+ if (!IsInClipboard() && !IsInUndo() && m_pReg)
+ {
+ XmlIdRegistryDocument * pRegDoc(
+ dynamic_cast<XmlIdRegistryDocument*>( m_pReg ) );
+ ::boost::shared_ptr<MetadatableUndo> pUndo(
+ pRegDoc->CreateUndo(*this) );
+ pRegDoc->RegisterCopy(*this, *pUndo, false);
+ pUndo->m_pReg = pRegDoc;
+
+ if (i_isDelete)
+ {
+ RemoveMetadataReference();
+ }
+ return pUndo;
+ }
+ }
+ catch (uno::Exception &)
+ {
+ OSL_ENSURE(false, "Metadatable::CreateUndo: exception");
+ }
+ return ::boost::shared_ptr<MetadatableUndo>();
+}
+
+void Metadatable::RestoreMetadata(
+ ::boost::shared_ptr<MetadatableUndo> const& i_pUndo)
+{
+ OSL_ENSURE(!IsInUndo(), "RestoreMetadata called for object in undo?");
+ OSL_ENSURE(!IsInClipboard(),
+ "RestoreMetadata called for object in clipboard?");
+ if (IsInClipboard() || IsInUndo()) return;
+ RemoveMetadataReference();
+ if (i_pUndo)
+ {
+ this->RegisterAsCopyOf(*i_pUndo, true);
+ }
+}
+
+void
+Metadatable::JoinMetadatable(Metadatable const & i_rOther,
+ const bool i_isMergedEmpty, const bool i_isOtherEmpty)
+{
+ OSL_ENSURE(!IsInUndo(), "JoinMetadatables called for object in undo?");
+ OSL_ENSURE(!IsInClipboard(),
+ "JoinMetadatables called for object in clipboard?");
+ if (IsInClipboard() || IsInUndo()) return;
+
+ if (i_isOtherEmpty && !i_isMergedEmpty)
+ {
+ // other is empty, thus loses => nothing to do
+ return;
+ }
+ if (i_isMergedEmpty && !i_isOtherEmpty)
+ {
+ this->RemoveMetadataReference();
+ this->RegisterAsCopyOf(i_rOther, true);
+ return;
+ }
+
+ if (!i_rOther.m_pReg)
+ {
+ // other doesn't have xmlid, thus loses => nothing to do
+ return;
+ }
+ if (!m_pReg)
+ {
+ this->RegisterAsCopyOf(i_rOther, true);
+ // assumption: i_rOther will be deleted, so don't unregister it here
+ return;
+ }
+ try
+ {
+ XmlIdRegistryDocument * pRegDoc(
+ dynamic_cast<XmlIdRegistryDocument*>( m_pReg ) );
+ OSL_ENSURE(pRegDoc, "JoinMetadatable: no pRegDoc?");
+ if (pRegDoc)
+ {
+ pRegDoc->JoinMetadatables(*this, i_rOther);
+ }
+ }
+ catch (uno::Exception &)
+ {
+ OSL_ENSURE(false, "Metadatable::JoinMetadatable: exception");
+ }
+}
+
+
+//=============================================================================
+// XMetadatable mixin
+
+// ::com::sun::star::rdf::XNode:
+::rtl::OUString SAL_CALL MetadatableMixin::getStringValue()
+ throw (::com::sun::star::uno::RuntimeException)
+{
+ return getNamespace() + getLocalName();
+}
+
+// ::com::sun::star::rdf::XURI:
+::rtl::OUString SAL_CALL MetadatableMixin::getLocalName()
+ throw (::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ beans::StringPair mdref( getMetadataReference() );
+ if (!mdref.Second.getLength())
+ {
+ ensureMetadataReference(); // N.B.: side effect!
+ mdref = getMetadataReference();
+ }
+ ::rtl::OUStringBuffer buf;
+ buf.append(mdref.First);
+ buf.append(static_cast<sal_Unicode>('#'));
+ buf.append(mdref.Second);
+ return buf.makeStringAndClear();
+}
+
+::rtl::OUString SAL_CALL MetadatableMixin::getNamespace()
+ throw (::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ const uno::Reference< frame::XModel > xModel( GetModel() );
+ const uno::Reference< rdf::XURI > xDMA( xModel, uno::UNO_QUERY_THROW );
+ return xDMA->getStringValue();
+}
+
+// ::com::sun::star::rdf::XMetadatable:
+beans::StringPair SAL_CALL
+MetadatableMixin::getMetadataReference()
+throw (uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ Metadatable* pObject( GetCoreObject() );
+ if (pObject)
+ {
+ return pObject->GetMetadataReference();
+ }
+ else
+ {
+ throw uno::RuntimeException();
+ }
+}
+
+void SAL_CALL
+MetadatableMixin::setMetadataReference(
+ const beans::StringPair & i_rReference)
+throw (uno::RuntimeException, lang::IllegalArgumentException)
+{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ Metadatable* pObject( GetCoreObject() );
+ if (pObject)
+ {
+ return pObject->SetMetadataReference(i_rReference);
+ }
+ else
+ {
+ throw uno::RuntimeException();
+ }
+}
+
+void SAL_CALL MetadatableMixin::ensureMetadataReference()
+throw (uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ Metadatable* pObject( GetCoreObject() );
+ if (pObject)
+ {
+ return pObject->EnsureMetadataReference();
+ }
+ else
+ {
+ throw uno::RuntimeException();
+ }
+}
+
+} // namespace sfx2
+
+
+//=============================================================================
+
+#if OSL_DEBUG_LEVEL > 1
+
+static ::sfx2::XmlIdRegistryDocument s_Reg;
+static ::sfx2::XmlIdRegistryClipboard s_RegClip;
+
+class MockMetadatable : public ::sfx2::Metadatable
+{
+public:
+ MockMetadatable(bool i_isInClip = false) :
+ m_bInClipboard(i_isInClip), m_bInUndo(false), m_bInContent(true) {}
+ bool m_bInClipboard;
+ bool m_bInUndo;
+ bool m_bInContent;
+ virtual bool IsInClipboard() const { return m_bInClipboard; }
+ virtual bool IsInUndo() const { return m_bInUndo; }
+ virtual bool IsInContent() const { return m_bInContent; }
+ virtual ::sfx2::XmlIdRegistry& GetRegistry() { return m_bInClipboard ? static_cast< ::sfx2::XmlIdRegistry&>(s_RegClip) : static_cast< ::sfx2::XmlIdRegistry&>(s_Reg); }
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::rdf::XMetadatable > MakeUnoObject() { return 0; }
+};
+
+bool operator==(beans::StringPair p1, beans::StringPair p2)
+{
+ return p1.First == p2.First && p1.Second == p2.Second;
+}
+
+void test()
+{
+ OSL_TRACE("SwMetadatable test(): start\n");
+ MockMetadatable m1;
+ MockMetadatable m2;
+ MockMetadatable m3;
+ MockMetadatable m4;
+ MockMetadatable m5;
+ ::rtl::OUString empty;
+ ::rtl::OUString content( ::rtl::OUString::createFromAscii("content.xml") );
+ ::rtl::OUString styles ( ::rtl::OUString::createFromAscii("styles.xml") );
+ ::rtl::OUString sid1( ::rtl::OUString::createFromAscii("id1") );
+ ::rtl::OUString sid2( ::rtl::OUString::createFromAscii("id2") );
+ ::rtl::OUString sid3( ::rtl::OUString::createFromAscii("id3") );
+ ::rtl::OUString sid4( ::rtl::OUString::createFromAscii("id4") );
+ beans::StringPair id1(content, sid1);
+ beans::StringPair id2(content, sid2);
+ beans::StringPair id3(content, sid3);
+ beans::StringPair id4(styles, sid4);
+ beans::StringPair id3e(empty, sid3);
+ beans::StringPair id4e(empty, sid4);
+ m1.SetMetadataReference(id1);
+ OSL_ENSURE(m1.GetMetadataReference() == id1, "set failed");
+ try {
+ m2.SetMetadataReference(id1);
+ OSL_ENSURE(false, "set duplicate succeeded");
+ } catch (lang::IllegalArgumentException) { }
+ m1.SetMetadataReference(id1);
+ OSL_ENSURE(m1.GetMetadataReference() == id1, "set failed (existing)");
+ m1.EnsureMetadataReference();
+ OSL_ENSURE(m1.GetMetadataReference() == id1, "ensure failed (existing)");
+
+ m2.EnsureMetadataReference();
+ beans::StringPair m2id(m2.GetMetadataReference());
+ OSL_ENSURE(m2id.Second.getLength(), "ensure failed");
+ m2.EnsureMetadataReference();
+ OSL_ENSURE(m2.GetMetadataReference() == m2id, "ensure failed (idempotent)");
+
+ m1.m_bInUndo = true;
+ OSL_ENSURE(!m1.GetMetadataReference().Second.getLength(), "move to undo failed");
+
+ m1.m_bInUndo = false;
+ OSL_ENSURE(m1.GetMetadataReference() == id1, "move from undo failed");
+
+ m1.m_bInUndo = true;
+ try {
+ m2.SetMetadataReference(id1); // steal!
+ } catch (lang::IllegalArgumentException &) {
+ OSL_ENSURE(false, "set duplicate to undo failed");
+ }
+ m1.m_bInUndo = false;
+ OSL_ENSURE(!m1.GetMetadataReference().Second.getLength(), "move from undo: duplicate");
+
+ m3.RegisterAsCopyOf(m2);
+ OSL_ENSURE(m2.GetMetadataReference() == id1, "copy: source");
+ OSL_ENSURE(!m3.GetMetadataReference().Second.getLength(), "copy: duplicate");
+ m4.RegisterAsCopyOf(m3);
+ OSL_ENSURE(m2.GetMetadataReference() == id1, "copy: source");
+ OSL_ENSURE(!m3.GetMetadataReference().Second.getLength(), "copy: duplicate");
+ OSL_ENSURE(!m4.GetMetadataReference().Second.getLength(), "copy: duplicate");
+ m2.m_bInUndo = true;
+ OSL_ENSURE(m3.GetMetadataReference() == id1, "duplicate to undo");
+ OSL_ENSURE(!m2.GetMetadataReference().Second.getLength(), "duplicate to undo");
+ m2.m_bInUndo = false;
+ OSL_ENSURE(m2.GetMetadataReference() == id1, "duplicate from undo");
+ OSL_ENSURE(!m3.GetMetadataReference().Second.getLength(), "duplicate from undo");
+
+ m4.EnsureMetadataReference(); // new!
+ beans::StringPair m4id(m4.GetMetadataReference());
+ OSL_ENSURE(m4id.Second.getLength() && !(m4id == id1), "ensure on duplicate");
+
+ MockMetadatable mc1(true); // in clipboard
+ MockMetadatable mc2(true);
+ MockMetadatable mc3(true);
+ MockMetadatable mc4(true);
+ MockMetadatable m2p;
+ MockMetadatable m3p;
+
+ mc1.SetMetadataReference(id2);
+ OSL_ENSURE(mc1.GetMetadataReference() == id2, "set failed");
+ try {
+ mc2.SetMetadataReference(id2);
+ OSL_ENSURE(false, "set duplicate succeeded");
+ } catch (lang::IllegalArgumentException) { }
+ mc1.SetMetadataReference(id2);
+ OSL_ENSURE(mc1.GetMetadataReference() == id2, "set failed (existing)");
+ mc1.EnsureMetadataReference();
+ OSL_ENSURE(mc1.GetMetadataReference() == id2, "ensure failed (existing)");
+ mc2.EnsureMetadataReference();
+ beans::StringPair mc2id(mc2.GetMetadataReference());
+ OSL_ENSURE(mc2id.Second.getLength(), "ensure failed");
+ mc2.EnsureMetadataReference();
+ OSL_ENSURE(mc2.GetMetadataReference() == mc2id, "ensure failed (idempotent)");
+ mc2.RemoveMetadataReference();
+ OSL_ENSURE(!mc2.GetMetadataReference().Second.getLength(), "remove failed");
+
+ // set up mc2 as copy of m2 and mc3 as copy of m3
+ mc3.RegisterAsCopyOf(m3);
+ OSL_ENSURE(!mc3.GetMetadataReference().Second.getLength() , "copy to clipboard (latent)");
+ mc2.RegisterAsCopyOf(m2);
+ OSL_ENSURE(mc2.GetMetadataReference() == id1, "copy to clipboard (non-latent)");
+ // paste mc2 to m2p and mc3 to m3p
+ m2p.RegisterAsCopyOf(mc2);
+ OSL_ENSURE(!m2p.GetMetadataReference().Second.getLength() , "paste from clipboard (non-latent)");
+ m3p.RegisterAsCopyOf(mc3);
+ OSL_ENSURE(!m3p.GetMetadataReference().Second.getLength() , "paste from clipboard (latent)");
+ // delete m2, m2p, m3
+ m2.RemoveMetadataReference();
+ OSL_ENSURE(!m2.GetMetadataReference().Second.getLength(), "remove failed");
+ OSL_ENSURE(m2p.GetMetadataReference() == id1, "paste-remove (non-latent)");
+ m2p.RemoveMetadataReference();
+ OSL_ENSURE(!m2p.GetMetadataReference().Second.getLength(), "remove failed");
+ OSL_ENSURE(m3.GetMetadataReference() == id1, "paste-remove2 (non-latent)");
+ m3.RemoveMetadataReference();
+ OSL_ENSURE(!m3.GetMetadataReference().Second.getLength(), "remove failed");
+ OSL_ENSURE(m3p.GetMetadataReference() == id1, "paste-remove (latent)");
+ // delete mc2
+ mc2.SetMetadataReference(beans::StringPair());
+ OSL_ENSURE(!mc3.GetMetadataReference().Second.getLength() , "in clipboard becomes non-latent");
+ // paste mc2
+ m2p.RegisterAsCopyOf(mc2);
+ OSL_ENSURE(!m2p.GetMetadataReference().Second.getLength(), "remove-paste");
+ OSL_ENSURE(m3p.GetMetadataReference() == id1, "remove-paste (stolen)");
+
+ // auto-detect stream
+ m5.SetMetadataReference(id3e);
+ OSL_ENSURE(m5.GetMetadataReference() == id3, "auto-detect (content)");
+ m5.m_bInContent = false;
+ m5.SetMetadataReference(id4e);
+ OSL_ENSURE(m5.GetMetadataReference() == id4, "auto-detect (styles)");
+
+ OSL_TRACE("sfx2::Metadatable test(): finished\n");
+}
+
+struct Test { Test() { test(); } };
+static Test s_test;
+
+
+#include <stdio.h>
+
+static void dump(sfx2::XmlIdList_t * pList)
+#ifdef GCC
+__attribute__ ((unused))
+#endif
+;
+static void dump(sfx2::XmlIdList_t * pList)
+{
+ fprintf(stderr, "\nXmlIdList(%p): ", pList);
+ for (sfx2::XmlIdList_t::iterator i = pList->begin(); i != pList->end(); ++i)
+ {
+ fprintf(stderr, "%p ", *i);
+ }
+ fprintf(stderr, "\n");
+}
+
+#endif
+
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 7ff1ade4e2..e0314ea11e 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -568,7 +568,7 @@ long SfxMedium::GetFileVersion() const
//------------------------------------------------------------------
void SfxMedium::CheckFileDate( const util::DateTime& aInitDate )
{
- GetInitFileDate();
+ GetInitFileDate( sal_True );
if ( pImp->m_aDateTime.Seconds != aInitDate.Seconds
|| pImp->m_aDateTime.Minutes != aInitDate.Minutes
|| pImp->m_aDateTime.Hours != aInitDate.Hours
@@ -576,40 +576,43 @@ void SfxMedium::CheckFileDate( const util::DateTime& aInitDate )
|| pImp->m_aDateTime.Month != aInitDate.Month
|| pImp->m_aDateTime.Year != aInitDate.Year )
{
- if ( !IsSystemFileLockingUsed() )
- {
- uno::Reference< task::XInteractionHandler > xHandler = GetInteractionHandler();
+ uno::Reference< task::XInteractionHandler > xHandler = GetInteractionHandler();
- if ( xHandler.is() )
+ if ( xHandler.is() )
+ {
+ try
{
- try
- {
- ::rtl::Reference< ::ucbhelper::InteractionRequest > xInteractionRequestImpl = new ::ucbhelper::InteractionRequest( uno::makeAny(
- document::ChangedByOthersRequest() ) );
- uno::Sequence< uno::Reference< task::XInteractionContinuation > > aContinuations( 3 );
- aContinuations[0] = new ::ucbhelper::InteractionAbort( xInteractionRequestImpl.get() );
- aContinuations[1] = new ::ucbhelper::InteractionApprove( xInteractionRequestImpl.get() );
- xInteractionRequestImpl->setContinuations( aContinuations );
+ ::rtl::Reference< ::ucbhelper::InteractionRequest > xInteractionRequestImpl = new ::ucbhelper::InteractionRequest( uno::makeAny(
+ document::ChangedByOthersRequest() ) );
+ uno::Sequence< uno::Reference< task::XInteractionContinuation > > aContinuations( 3 );
+ aContinuations[0] = new ::ucbhelper::InteractionAbort( xInteractionRequestImpl.get() );
+ aContinuations[1] = new ::ucbhelper::InteractionApprove( xInteractionRequestImpl.get() );
+ xInteractionRequestImpl->setContinuations( aContinuations );
- xHandler->handle( xInteractionRequestImpl.get() );
+ xHandler->handle( xInteractionRequestImpl.get() );
- ::rtl::Reference< ::ucbhelper::InteractionContinuation > xSelected = xInteractionRequestImpl->getSelection();
- if ( uno::Reference< task::XInteractionAbort >( xSelected.get(), uno::UNO_QUERY ).is() )
- {
- SetError( ERRCODE_ABORT, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
- }
+ ::rtl::Reference< ::ucbhelper::InteractionContinuation > xSelected = xInteractionRequestImpl->getSelection();
+ if ( uno::Reference< task::XInteractionAbort >( xSelected.get(), uno::UNO_QUERY ).is() )
+ {
+ SetError( ERRCODE_ABORT, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
}
- catch ( uno::Exception& )
- {}
- }
- }
+ }
+ catch ( uno::Exception& )
+ {}
+ }
}
}
//------------------------------------------------------------------
-util::DateTime SfxMedium::GetInitFileDate()
+sal_Bool SfxMedium::DocNeedsFileDateCheck()
{
- if ( !pImp->m_bGotDateTime && GetContent().is() )
+ return ( !IsReadOnly() && ::utl::LocalFileHelper::IsLocalFile( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ) ) );
+}
+
+//------------------------------------------------------------------
+util::DateTime SfxMedium::GetInitFileDate( sal_Bool bIgnoreOldValue )
+{
+ if ( ( bIgnoreOldValue || !pImp->m_bGotDateTime ) && GetContent().is() )
{
try
{
@@ -866,11 +869,8 @@ sal_Bool SfxMedium::Commit()
sal_Bool bResult = ( GetError() == SVSTREAM_OK );
- if ( bResult )
- {
- pImp->m_bGotDateTime = sal_False;
- GetInitFileDate();
- }
+ if ( bResult && DocNeedsFileDateCheck() )
+ GetInitFileDate( sal_True );
// remove truncation mode from the flags
nStorOpenMode &= (~STREAM_TRUNC);
@@ -1400,6 +1400,10 @@ sal_Bool SfxMedium::LockOrigFileOnDemand( sal_Bool bLoading, sal_Bool bNoUI )
GetItemSet()->Put( SfxBoolItem( SID_DOC_READONLY, sal_True ) );
}
+ // when the file is locked, get the current file date
+ if ( bResult && DocNeedsFileDateCheck() )
+ GetInitFileDate( sal_True );
+
return bResult;
}
@@ -2662,8 +2666,6 @@ void SfxMedium::GetMedium_Impl()
pInStream = utl::UcbStreamHelper::CreateStream( pImp->xInputStream );
}
- GetInitFileDate();
-
pImp->bDownloadDone = sal_True;
pImp->aDoneLink.ClearPendingCall();
pImp->aDoneLink.Call( (void*) GetError() );
@@ -3305,6 +3307,7 @@ SfxMedium::SfxMedium( const ::com::sun::star::uno::Sequence< ::com::sun::star::b
// that must be copied here
SFX_ITEMSET_ARG( pSet, pFileNameItem, SfxStringItem, SID_FILE_NAME, FALSE );
+ if (!pFileNameItem) throw uno::RuntimeException();
::rtl::OUString aNewTempFileURL = SfxMedium::CreateTempCopyWithExt( pFileNameItem->GetValue() );
if ( aNewTempFileURL.getLength() )
{
@@ -3326,6 +3329,7 @@ SfxMedium::SfxMedium( const ::com::sun::star::uno::Sequence< ::com::sun::star::b
bReadOnly = TRUE;
SFX_ITEMSET_ARG( pSet, pFileNameItem, SfxStringItem, SID_FILE_NAME, FALSE );
+ if (!pFileNameItem) throw uno::RuntimeException();
aLogicName = pFileNameItem->GetValue();
nStorOpenMode = bReadOnly ? SFX_STREAM_READONLY : SFX_STREAM_READWRITE;
bDirect = FALSE;
diff --git a/sfx2/source/doc/docinsert.cxx b/sfx2/source/doc/docinsert.cxx
index ad6335d840..5e2f3776d8 100644
--- a/sfx2/source/doc/docinsert.cxx
+++ b/sfx2/source/doc/docinsert.cxx
@@ -177,33 +177,17 @@ void impl_FillURLList( sfx2::FileDialogHelper* _pFileDlg, SvStringsDtor*& _rpURL
{
DBG_ASSERT( _pFileDlg, "DocumentInserter::fillURLList(): invalid file dialog" );
DBG_ASSERT( !_rpURLList, "DocumentInserter::fillURLList(): URLList already exists" );
- Sequence < ::rtl::OUString > aPathSeq = _pFileDlg->GetMPath();
+ Sequence < ::rtl::OUString > aPathSeq = _pFileDlg->GetSelectedFiles();
if ( aPathSeq.getLength() )
{
_rpURLList = new SvStringsDtor;
- if ( aPathSeq.getLength() == 1 )
+ for ( USHORT i = 0; i < aPathSeq.getLength(); ++i )
{
- ::rtl::OUString sFileURL( aPathSeq[0] );
- String* pURL = new String( sFileURL );
- _rpURLList->Insert( pURL, 0 );
- }
- else
- {
- INetURLObject aPathObj( aPathSeq[0] );
- aPathObj.setFinalSlash();
-
- for ( USHORT i = 1; i < aPathSeq.getLength(); ++i )
- {
- if ( i == 1 )
- aPathObj.Append( aPathSeq[i] );
- else
- aPathObj.setName( aPathSeq[i] );
-
- String* pURL = new String( aPathObj.GetMainURL( INetURLObject::NO_DECODE ) );
- _rpURLList->Insert( pURL, _rpURLList->Count() );
- }
+ INetURLObject aPathObj( aPathSeq[i] );
+ String* pURL = new String( aPathObj.GetMainURL( INetURLObject::NO_DECODE ) );
+ _rpURLList->Insert( pURL, _rpURLList->Count() );
}
}
}
diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx
index 6b07a22361..c61060c11b 100644
--- a/sfx2/source/doc/doctemplates.cxx
+++ b/sfx2/source/doc/doctemplates.cxx
@@ -2064,7 +2064,7 @@ sal_Bool SfxDocTplService_Impl::addTemplate( const OUString& rGroupName,
Content aResultContent;
if ( Content::create( aNewTemplateTargetURL, xEnv, aResultContent ) )
{
- ::rtl::OUString aPropertyName( RTL_CONSTASCII_USTRINGPARAM( "IsReadonly" ) );
+ ::rtl::OUString aPropertyName( RTL_CONSTASCII_USTRINGPARAM( "IsReadOnly" ) );
uno::Any aProperty;
sal_Bool bReadOnly = sal_False;
if ( getProperty( aResultContent, aPropertyName, aProperty ) && ( aProperty >>= bReadOnly ) && bReadOnly )
diff --git a/sfx2/source/doc/makefile.mk b/sfx2/source/doc/makefile.mk
index b46ee5aa30..4c893288eb 100644
--- a/sfx2/source/doc/makefile.mk
+++ b/sfx2/source/doc/makefile.mk
@@ -40,6 +40,10 @@ ENABLE_EXCEPTIONS=TRUE
.INCLUDE : settings.mk
.INCLUDE : $(PRJ)$/util$/makefile.pmk
+.IF "$(SYSTEM_LIBXML)" == "YES"
+CFLAGS+=-DSYSTEM_LIBXML $(LIBXML_CFLAGS)
+.ENDIF
+
# --- Files --------------------------------------------------------
SRS1NAME=$(TARGET)
@@ -80,10 +84,13 @@ SLOFILES = \
$(SLO)$/docinsert.obj \
$(SLO)$/docmacromode.obj \
$(SLO)$/SfxDocumentMetaData.obj \
+ $(SLO)$/DocumentMetadataAccess.obj \
+ $(SLO)$/Metadatable.obj \
$(SLO)$/sfxmodelfactory.obj \
$(SLO)$/docstoragemodifylistener.obj \
$(SLO)$/querytemplate.obj
+
# --- Tagets -------------------------------------------------------
.INCLUDE : target.mk
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index 88b3ab70b5..3b03a9d4ff 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -84,6 +84,7 @@
#include <comphelper/processfactory.hxx>
#include <comphelper/componentcontext.hxx>
+#include <comphelper/configurationhelper.hxx>
#include <com/sun/star/security/XDocumentDigitalSignatures.hpp>
#include <com/sun/star/frame/XModel.hpp>
@@ -2251,6 +2252,33 @@ sal_Bool SfxObjectShell::UseInteractionToHandleError(
return bResult;
}
+sal_Bool SfxObjectShell_Impl::NeedsOfficeUpdateDialog()
+{
+ // if the configuration is not available for any reason, the default behavior is to show the message
+ sal_Bool bResult = sal_True;
+
+ try
+ {
+ uno::Reference< lang::XMultiServiceFactory > xServiceManager( ::comphelper::getProcessServiceFactory(), uno::UNO_SET_THROW );
+ uno::Reference< uno::XInterface > xCommonConfig(
+ ::comphelper::ConfigurationHelper::openConfig(
+ xServiceManager,
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.Common" ) ),
+ ::comphelper::ConfigurationHelper::E_STANDARD ),
+ uno::UNO_SET_THROW );
+
+ ::comphelper::ConfigurationHelper::readRelativeKey(
+ xCommonConfig,
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Load/" ) ),
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ShowOfficeUpdateDialog" ) ) ) >>= bResult;
+ }
+ catch( uno::Exception& )
+ {
+ }
+
+ return bResult;
+}
+
sal_Int16 SfxObjectShell_Impl::getCurrentMacroExecMode() const
{
sal_Int16 nImposedExecMode( MacroExecMode::NEVER_EXECUTE );
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index d65dc992e1..69c130c173 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -415,7 +415,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
if ( pDocInfItem )
{
// parameter, e.g. from replayed macro
- pDocInfItem->updateDocumentInfo(getDocProperties());
+ pDocInfItem->UpdateDocumentInfo(getDocProperties(), true);
SetUseUserData( pDocInfItem->IsUseUserData() );
}
else
@@ -478,7 +478,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
if ( pDocInfoItem )
{
// user has done some changes to DocumentInfo
- pDocInfoItem->updateDocumentInfo(getDocProperties());
+ pDocInfoItem->UpdateDocumentInfo(getDocProperties());
SetUseUserData( ((const SfxDocumentInfoItem *)pDocInfoItem)->IsUseUserData() );
// add data from dialog for possible recording purposes
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 6c5c543622..0c240d0e9c 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -621,6 +621,7 @@ sal_Bool SfxObjectShell::DoLoad( SfxMedium *pMed )
else
aBaseURL = pMed->GetBaseURL();
}
+ pMed->GetItemSet()->Put( SfxStringItem( SID_DOC_BASEURL, aBaseURL ) );
pImp->nLoadedFlags = 0;
pImp->bModelInitialized = sal_False;
@@ -827,37 +828,28 @@ sal_Bool SfxObjectShell::DoLoad( SfxMedium *pMed )
}
}
- uno::Reference< XInteractionHandler > xHandler( pMedium->GetInteractionHandler() );
- if ( xHandler.is() && !SFX_APP()->Get_Impl()->bODFVersionWarningLater )
+ if ( pMedium->HasStorage_Impl() )
{
- // scan the generator string (within meta.xml)
- uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
- GetModel(), uno::UNO_QUERY_THROW);
- uno::Reference<document::XDocumentProperties> xDocProps
- = xDPS->getDocumentProperties();
- if ( xDocProps.is() )
+ uno::Reference< XInteractionHandler > xHandler( pMedium->GetInteractionHandler() );
+ if ( xHandler.is() && !SFX_APP()->Get_Impl()->bODFVersionWarningLater )
{
- uno::Reference<beans::XPropertySet> xUserDefinedProps(
- xDocProps->getUserDefinedProperties(), uno::UNO_QUERY_THROW);
- uno::Any aAny;
+ uno::Reference<beans::XPropertySet> xStorageProps( pMedium->GetStorage(), uno::UNO_QUERY_THROW );
+ ::rtl::OUString sVersion;
try
{
- aAny = xUserDefinedProps->getPropertyValue(
- DEFINE_CONST_UNICODE("ODFVersion"));
+ xStorageProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Version" ) ) ) >>= sVersion;
}
catch( const uno::Exception& )
{
// Custom Property "ODFVersion" does not exist
}
- ::rtl::OUString sVersion;
- if ( (aAny >>= sVersion) && sVersion.getLength() )
+ if ( sVersion.getLength() )
{
double nVersion = sVersion.toDouble();
- if ( nVersion > 1.20001 )
+ if ( nVersion > 1.20001 && SfxObjectShell_Impl::NeedsOfficeUpdateDialog() )
// ODF version greater than 1.2 - added some decimal places to be safe against floating point conversion errors (hack)
{
-
::rtl::OUString sDocumentURL( pMedium->GetOrigURL() );
::rtl::OUString aSystemFileURL;
if ( osl::FileBase::getSystemPathFromFileURL( sDocumentURL, aSystemFileURL ) == osl::FileBase::E_None )
@@ -1138,7 +1130,12 @@ sal_Bool SfxObjectShell::SaveTo_Impl
*/
{
- RTL_LOGFILE_CONTEXT( aLog, "sfx2 (mv76033) SfxObjectShell::SaveTo_Impl" );
+ RTL_LOGFILE_PRODUCT_CONTEXT( aLog, "PERFORMANCE SfxObjectShell::SaveTo_Impl" );
+ if( RTL_LOGFILE_HASLOGFILE() )
+ {
+ ByteString aString( rMedium.GetName(), RTL_TEXTENCODING_ASCII_US );
+ RTL_LOGFILE_PRODUCT_CONTEXT_TRACE1( aLog, "saving \"%s\"", aString.GetBuffer() );
+ }
AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Begin" ) ) );
@@ -1227,7 +1224,8 @@ sal_Bool SfxObjectShell::SaveTo_Impl
bStoreToSameLocation = sal_True;
AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Save" ) ) );
- rMedium.CheckFileDate( pMedium->GetInitFileDate() );
+ if ( pMedium->DocNeedsFileDateCheck() )
+ rMedium.CheckFileDate( pMedium->GetInitFileDate( sal_False ) );
if ( bCopyTo && GetCreateMode() != SFX_CREATE_MODE_EMBEDDED )
{
@@ -2083,10 +2081,17 @@ sal_Bool SfxObjectShell::DoSaveCompleted( SfxMedium* pNewMed )
InvalidateName();
SetModified(sal_False); // nur bei gesetztem Medium zur"ucksetzen
Broadcast( SfxSimpleHint(SFX_HINT_MODECHANGED) );
+
+ // this is the end of the saving process, it is possible that the file was changed
+ // between medium commit and this step ( attributes change and so on )
+ // so get the file date again
+ if ( pNewMed->DocNeedsFileDateCheck() )
+ pNewMed->GetInitFileDate( sal_True );
}
}
pMedium->ClearBackup_Impl();
+ pMedium->LockOrigFileOnDemand( sal_True, sal_False );
return bOk;
}
@@ -3106,6 +3111,13 @@ void SfxObjectShell::SetSecurityOptOpenReadOnly( sal_Bool _b )
sal_Bool SfxObjectShell::LoadOwnFormat( SfxMedium& rMedium )
{
+ RTL_LOGFILE_PRODUCT_CONTEXT( aLog, "PERFORMANCE SfxObjectShell::LoadOwnFormat" );
+ if( RTL_LOGFILE_HASLOGFILE() )
+ {
+ ByteString aString( rMedium.GetName(), RTL_TEXTENCODING_ASCII_US );
+ RTL_LOGFILE_PRODUCT_CONTEXT_TRACE1( aLog, "loading \"%s\"", aString.GetBuffer() );
+ }
+
uno::Reference< embed::XStorage > xStorage = rMedium.GetStorage();
if ( xStorage.is() )
{
diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx
index 2b236e46df..2d1a452a02 100644
--- a/sfx2/source/doc/objxtor.cxx
+++ b/sfx2/source/doc/objxtor.cxx
@@ -722,11 +722,11 @@ namespace
{
static BasicManager* lcl_getBasicManagerForDocument( const SfxObjectShell& _rDocument )
{
- if ( !_rDocument.pImp->m_bNoBasicCapabilities )
+ if ( !_rDocument.Get_Impl()->m_bNoBasicCapabilities )
{
- if ( !_rDocument.pImp->bBasicInitialized )
+ if ( !_rDocument.Get_Impl()->bBasicInitialized )
const_cast< SfxObjectShell& >( _rDocument ).InitBasicManager_Impl();
- return _rDocument.pImp->pBasicManager->get();
+ return _rDocument.Get_Impl()->pBasicManager->get();
}
// assume we do not have Basic ourself, but we can refer to another
@@ -794,9 +794,13 @@ namespace
try
{
Reference< XStorageBasedDocument > xStorageDoc( _rxDocument, UNO_QUERY );
+ const Reference< XComponentContext > xContext(
+ ::comphelper::getProcessComponentContext() );
_rxContainer.set ( _bScript
- ? DocumentScriptLibraryContainer::create( comphelper_getProcessComponentContext(), xStorageDoc )
- : DocumentDialogLibraryContainer::create( comphelper_getProcessComponentContext(), xStorageDoc )
+ ? DocumentScriptLibraryContainer::create(
+ xContext, xStorageDoc )
+ : DocumentDialogLibraryContainer::create(
+ xContext, xStorageDoc )
, UNO_QUERY_THROW );
}
catch( const Exception& )
@@ -1065,6 +1069,12 @@ void SfxObjectShell::SetAutoStyleFilterIndex(sal_uInt16 nSet)
pImp->nStyleFilter = nSet;
}
+sal_uInt16 SfxObjectShell::GetAutoStyleFilterIndex()
+{
+ return pImp->nStyleFilter;
+}
+
+
void SfxObjectShell::SetCurrentComponent( const Reference< XInterface >& _rxComponent )
{
if ( _rxComponent.get() == s_xCurrentComponent.get().get() )
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index a0aea4d739..e0472349d8 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -66,6 +66,7 @@
#include <com/sun/star/embed/ElementModes.hpp>
#include <com/sun/star/embed/Aspects.hpp>
#include <com/sun/star/document/XDocumentProperties.hpp>
+#include <com/sun/star/frame/XTransientDocumentsDocumentContentFactory.hpp>
#include <comphelper/enumhelper.hxx> // can be removed when this is a "real" service
#include <cppuhelper/interfacecontainer.hxx>
@@ -124,6 +125,8 @@
#include "brokenpackageint.hxx"
#include "graphhelp.hxx"
#include <sfx2/msgpool.hxx>
+#include <sfx2/DocumentMetadataAccess.hxx>
+
#include <sfxresid.hxx>
//________________________________________________________________________________________________________
@@ -135,13 +138,14 @@ static const ::rtl::OUString SERVICENAME_DESKTOP = ::rtl::OUString::createFromAs
//________________________________________________________________________________________________________
namespace css = ::com::sun::star;
-using namespace com::sun::star;
+using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
//________________________________________________________________________________________________________
// impl. declarations
//________________________________________________________________________________________________________
+
struct IMPL_SfxBaseModel_DataContainer : public ::sfx2::IModifiableDocument
{
// counter for SfxBaseModel instances created.
@@ -172,6 +176,8 @@ struct IMPL_SfxBaseModel_DataContainer : public ::sfx2::IModifiableDocument
::rtl::OUString m_sModuleIdentifier;
css::uno::Reference< css::frame::XTitle > m_xTitleHelper;
css::uno::Reference< css::frame::XUntitledNumbers > m_xNumberedControllers;
+ uno::Reference< rdf::XDocumentMetadataAccess> m_xDocumentMetadata;
+
IMPL_SfxBaseModel_DataContainer( ::osl::Mutex& rMutex, SfxObjectShell* pObjectShell )
: m_pObjectShell ( pObjectShell )
@@ -184,6 +190,7 @@ struct IMPL_SfxBaseModel_DataContainer : public ::sfx2::IModifiableDocument
, m_pStorageModifyListen ( NULL )
, m_xTitleHelper ()
, m_xNumberedControllers ()
+ , m_xDocumentMetadata () // lazy
{
// increase global instance counter.
++g_nInstanceCounter;
@@ -201,6 +208,58 @@ struct IMPL_SfxBaseModel_DataContainer : public ::sfx2::IModifiableDocument
if ( m_pObjectShell.Is() && !m_pObjectShell->IsModified() )
m_pObjectShell->SetModified( sal_True );
}
+
+ uno::Reference<rdf::XDocumentMetadataAccess> GetDMA()
+ {
+ if (!m_xDocumentMetadata.is())
+ {
+ OSL_ENSURE(m_pObjectShell, "GetDMA: no object shell?");
+ if (!m_pObjectShell)
+ {
+ return 0;
+ }
+
+ const uno::Reference<uno::XComponentContext> xContext(
+ ::comphelper::getProcessComponentContext());
+ ::rtl::OUString uri;
+ const uno::Reference<frame::XModel> xModel(
+ m_pObjectShell->GetModel());
+ const uno::Reference<lang::XMultiComponentFactory> xMsf(
+ xContext->getServiceManager());
+ const uno::Reference<frame::
+ XTransientDocumentsDocumentContentFactory> xTDDCF(
+ xMsf->createInstanceWithContext(
+ ::rtl::OUString::createFromAscii( "com.sun.star.frame."
+ "TransientDocumentsDocumentContentFactory"),
+ xContext),
+ uno::UNO_QUERY_THROW);
+ const uno::Reference<ucb::XContent> xContent(
+ xTDDCF->createDocumentContent(xModel) );
+ OSL_ENSURE(xContent.is(), "GetDMA: cannot create DocumentContent");
+ if (!xContent.is())
+ {
+ return 0;
+ }
+ uri = xContent->getIdentifier()->getContentIdentifier();
+ OSL_ENSURE(uri.getLength(), "GetDMA: empty uri?");
+ if (uri.getLength() && !uri.endsWithAsciiL("/", 1))
+ {
+ uri = uri + ::rtl::OUString::createFromAscii("/");
+ }
+
+ m_xDocumentMetadata = new ::sfx2::DocumentMetadataAccess(
+ xContext, *m_pObjectShell, uri);
+ }
+ return m_xDocumentMetadata;
+ }
+
+ uno::Reference<rdf::XDocumentMetadataAccess> CreateDMAUninitialized()
+ {
+ return (m_pObjectShell)
+ ? new ::sfx2::DocumentMetadataAccess(
+ ::comphelper::getProcessComponentContext(), *m_pObjectShell)
+ : 0;
+ }
};
// static member initialization.
@@ -417,9 +476,9 @@ SfxSaveGuard::~SfxSaveGuard()
//________________________________________________________________________________________________________
DBG_NAME(sfx2_SfxBaseModel)
SfxBaseModel::SfxBaseModel( SfxObjectShell *pObjectShell )
-: IMPL_SfxBaseModel_MutexContainer()
+: BaseMutex()
, m_pData( new IMPL_SfxBaseModel_DataContainer( m_aMutex, pObjectShell ) )
-, m_bSupportEmbeddedScripts( pObjectShell && pObjectShell->pImp ? !pObjectShell->pImp->m_bNoBasicCapabilities : false )
+, m_bSupportEmbeddedScripts( pObjectShell && pObjectShell->Get_Impl() ? !pObjectShell->Get_Impl()->m_bNoBasicCapabilities : false )
{
DBG_CTOR(sfx2_SfxBaseModel,NULL);
if ( pObjectShell != NULL )
@@ -686,10 +745,9 @@ void SAL_CALL SfxBaseModel::dispose() throw(::com::sun::star::uno::RuntimeExcept
m_pData->m_xDocumentInfo = 0;
}
- if ( m_pData->m_xDocumentProperties.is() )
- {
- m_pData->m_xDocumentProperties = 0;
- }
+ m_pData->m_xDocumentProperties.clear();
+
+ m_pData->m_xDocumentMetadata.clear();
EndListening( *m_pData->m_pObjectShell );
@@ -1449,7 +1507,7 @@ sal_Bool SAL_CALL SfxBaseModel::hasLocation() throw(::com::sun::star::uno::Runti
else
return ::rtl::OUString(m_pData->m_pObjectShell->GetMedium()->GetName());
}
-
+
return m_pData->m_sURL;
}
@@ -2427,7 +2485,7 @@ void SfxBaseModel::Notify( SfxBroadcaster& rBC ,
else if ( SFX_EVENT_SAVEASDOCDONE == pNamedHint->GetEventId() )
{
m_pData->m_sURL = m_pData->m_pObjectShell->GetMedium()->GetName();
-
+
SfxItemSet *pSet = m_pData->m_pObjectShell->GetMedium()->GetItemSet();
::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aArgs;
::rtl::OUString aTitle = m_pData->m_pObjectShell->GetTitle();
@@ -3606,19 +3664,19 @@ css::uno::Reference< css::frame::XTitle > SfxBaseModel::impl_getTitleHelper ()
if ( impl_isDisposed() )
return css::uno::Reference< css::frame::XTitle >();
-
+
if ( ! m_pData->m_xTitleHelper.is ())
{
css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory ();
css::uno::Reference< css::frame::XUntitledNumbers > xDesktop(xSMGR->createInstance(SERVICENAME_DESKTOP), css::uno::UNO_QUERY_THROW);
css::uno::Reference< css::frame::XModel > xThis (static_cast< css::frame::XModel* >(this), css::uno::UNO_QUERY_THROW);
-
+
::framework::TitleHelper* pHelper = new ::framework::TitleHelper(xSMGR);
m_pData->m_xTitleHelper = css::uno::Reference< css::frame::XTitle >(static_cast< ::cppu::OWeakObject* >(pHelper), css::uno::UNO_QUERY_THROW);
pHelper->setOwner (xThis );
pHelper->connectWithUntitledNumbers (xDesktop);
}
-
+
return m_pData->m_xTitleHelper;
}
@@ -3629,18 +3687,18 @@ css::uno::Reference< css::frame::XUntitledNumbers > SfxBaseModel::impl_getUntitl
if ( impl_isDisposed() )
return css::uno::Reference< css::frame::XUntitledNumbers >();
-
+
if ( ! m_pData->m_xNumberedControllers.is ())
{
css::uno::Reference< css::frame::XModel > xThis (static_cast< css::frame::XModel* >(this), css::uno::UNO_QUERY_THROW);
::comphelper::NumberedCollection* pHelper = new ::comphelper::NumberedCollection();
-
+
m_pData->m_xNumberedControllers = css::uno::Reference< css::frame::XUntitledNumbers >(static_cast< ::cppu::OWeakObject* >(pHelper), css::uno::UNO_QUERY_THROW);
-
+
pHelper->setOwner (xThis);
pHelper->setUntitledPrefix (::rtl::OUString::createFromAscii(" : "));
}
-
+
return m_pData->m_xNumberedControllers;
}
@@ -3654,7 +3712,7 @@ css::uno::Reference< css::frame::XUntitledNumbers > SfxBaseModel::impl_getUntitl
if ( impl_isDisposed() )
return ::rtl::OUString();
-
+
::rtl::OUString aResult = impl_getTitleHelper()->getTitle ();
if ( m_pData->m_pObjectShell )
{
@@ -3688,7 +3746,7 @@ void SAL_CALL SfxBaseModel::setTitle( const ::rtl::OUString& sTitle )
if ( impl_isDisposed() )
return;
-
+
impl_getTitleHelper()->setTitle (sTitle);
}
@@ -3702,12 +3760,12 @@ void SAL_CALL SfxBaseModel::addTitleChangeListener( const css::uno::Reference< c
if ( impl_isDisposed() )
return;
-
+
css::uno::Reference< css::frame::XTitleChangeBroadcaster > xBroadcaster(impl_getTitleHelper(), css::uno::UNO_QUERY);
if (xBroadcaster.is ())
xBroadcaster->addTitleChangeListener (xListener);
}
-
+
//=============================================================================
// css.frame.XTitleChangeBroadcaster
void SAL_CALL SfxBaseModel::removeTitleChangeListener( const css::uno::Reference< css::frame::XTitleChangeListener >& xListener )
@@ -3718,7 +3776,7 @@ void SAL_CALL SfxBaseModel::removeTitleChangeListener( const css::uno::Reference
if ( impl_isDisposed() )
return;
-
+
css::uno::Reference< css::frame::XTitleChangeBroadcaster > xBroadcaster(impl_getTitleHelper(), css::uno::UNO_QUERY);
if (xBroadcaster.is ())
xBroadcaster->removeTitleChangeListener (xListener);
@@ -3734,10 +3792,10 @@ void SAL_CALL SfxBaseModel::removeTitleChangeListener( const css::uno::Reference
::vos::OGuard aGuard( Application::GetSolarMutex() );
if ( impl_isDisposed() )
return css::frame::UntitledNumbersConst::INVALID_NUMBER;
-
+
return impl_getUntitledHelper ()->leaseNumber (xComponent);
}
-
+
//=============================================================================
// css.frame.XUntitledNumbers
void SAL_CALL SfxBaseModel::releaseNumber( ::sal_Int32 nNumber )
@@ -3748,10 +3806,10 @@ void SAL_CALL SfxBaseModel::releaseNumber( ::sal_Int32 nNumber )
::vos::OGuard aGuard( Application::GetSolarMutex() );
if ( impl_isDisposed() )
return;
-
+
impl_getUntitledHelper ()->releaseNumber (nNumber);
}
-
+
//=============================================================================
// css.frame.XUntitledNumbers
void SAL_CALL SfxBaseModel::releaseNumberForComponent( const css::uno::Reference< css::uno::XInterface >& xComponent )
@@ -3762,7 +3820,7 @@ void SAL_CALL SfxBaseModel::releaseNumberForComponent( const css::uno::Reference
::vos::OGuard aGuard( Application::GetSolarMutex() );
if ( impl_isDisposed() )
return;
-
+
impl_getUntitledHelper ()->releaseNumberForComponent (xComponent);
}
@@ -3775,7 +3833,7 @@ void SAL_CALL SfxBaseModel::releaseNumberForComponent( const css::uno::Reference
::vos::OGuard aGuard( Application::GetSolarMutex() );
if ( impl_isDisposed() )
return ::rtl::OUString ();
-
+
return impl_getUntitledHelper ()->getUntitledPrefix ();
}
@@ -3829,3 +3887,325 @@ css::uno::Reference< css::frame::XController2 > SAL_CALL SfxBaseModel::createVie
{
return css::uno::Reference< css::frame::XController2 >();
}
+
+//=============================================================================
+// RDF DocumentMetadataAccess
+
+// ::com::sun::star::rdf::XRepositorySupplier:
+uno::Reference< rdf::XRepository > SAL_CALL
+SfxBaseModel::getRDFRepository() throw (uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ if ( impl_isDisposed() )
+ throw lang::DisposedException();
+
+ const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA());
+ if (!xDMA.is()) {
+ throw uno::RuntimeException( ::rtl::OUString::createFromAscii(
+ "model has no document metadata"), *this );
+ }
+
+ return xDMA->getRDFRepository();
+}
+
+// ::com::sun::star::rdf::XNode:
+::rtl::OUString SAL_CALL
+SfxBaseModel::getStringValue() throw (uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ if ( impl_isDisposed() )
+ throw lang::DisposedException();
+
+ const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA());
+ if (!xDMA.is()) {
+ throw uno::RuntimeException( ::rtl::OUString::createFromAscii(
+ "model has no document metadata"), *this );
+ }
+
+ return xDMA->getStringValue();
+}
+
+// ::com::sun::star::rdf::XURI:
+::rtl::OUString SAL_CALL
+SfxBaseModel::getNamespace() throw (uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ if ( impl_isDisposed() )
+ throw lang::DisposedException();
+
+ const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA());
+ if (!xDMA.is()) {
+ throw uno::RuntimeException( ::rtl::OUString::createFromAscii(
+ "model has no document metadata"), *this );
+ }
+
+ return xDMA->getNamespace();
+}
+
+::rtl::OUString SAL_CALL
+SfxBaseModel::getLocalName() throw (uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ if ( impl_isDisposed() )
+ throw lang::DisposedException();
+
+ const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA());
+ if (!xDMA.is()) {
+ throw uno::RuntimeException( ::rtl::OUString::createFromAscii(
+ "model has no document metadata"), *this );
+ }
+
+ return xDMA->getLocalName();
+}
+
+// ::com::sun::star::rdf::XDocumentMetadataAccess:
+uno::Reference< rdf::XMetadatable > SAL_CALL
+SfxBaseModel::getElementByMetadataReference(
+ const ::com::sun::star::beans::StringPair & i_rReference)
+throw (uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ if ( impl_isDisposed() )
+ throw lang::DisposedException();
+
+ const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA());
+ if (!xDMA.is()) {
+ throw uno::RuntimeException( ::rtl::OUString::createFromAscii(
+ "model has no document metadata"), *this );
+ }
+
+ return xDMA->getElementByMetadataReference(i_rReference);
+}
+
+uno::Reference< rdf::XMetadatable > SAL_CALL
+SfxBaseModel::getElementByURI(const uno::Reference< rdf::XURI > & i_xURI)
+throw (uno::RuntimeException, lang::IllegalArgumentException)
+{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ if ( impl_isDisposed() )
+ throw lang::DisposedException();
+
+ const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA());
+ if (!xDMA.is()) {
+ throw uno::RuntimeException( ::rtl::OUString::createFromAscii(
+ "model has no document metadata"), *this );
+ }
+
+ return xDMA->getElementByURI(i_xURI);
+}
+
+uno::Sequence< uno::Reference< rdf::XURI > > SAL_CALL
+SfxBaseModel::getMetadataGraphsWithType(
+ const uno::Reference<rdf::XURI> & i_xType)
+throw (uno::RuntimeException, lang::IllegalArgumentException)
+{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ if ( impl_isDisposed() )
+ throw lang::DisposedException();
+
+ const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA());
+ if (!xDMA.is()) {
+ throw uno::RuntimeException( ::rtl::OUString::createFromAscii(
+ "model has no document metadata"), *this );
+ }
+
+ return xDMA->getMetadataGraphsWithType(i_xType);
+}
+
+uno::Reference<rdf::XURI> SAL_CALL
+SfxBaseModel::addMetadataFile(const ::rtl::OUString & i_rFileName,
+ const uno::Sequence < uno::Reference< rdf::XURI > > & i_rTypes)
+throw (uno::RuntimeException, lang::IllegalArgumentException,
+ container::ElementExistException)
+{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ if ( impl_isDisposed() )
+ throw lang::DisposedException();
+
+ const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA());
+ if (!xDMA.is()) {
+ throw uno::RuntimeException( ::rtl::OUString::createFromAscii(
+ "model has no document metadata"), *this );
+ }
+
+ return xDMA->addMetadataFile(i_rFileName, i_rTypes);
+}
+
+uno::Reference<rdf::XURI> SAL_CALL
+SfxBaseModel::importMetadataFile(::sal_Int16 i_Format,
+ const uno::Reference< io::XInputStream > & i_xInStream,
+ const ::rtl::OUString & i_rFileName,
+ const uno::Reference< rdf::XURI > & i_xBaseURI,
+ const uno::Sequence < uno::Reference< rdf::XURI > > & i_rTypes)
+throw (uno::RuntimeException, lang::IllegalArgumentException,
+ datatransfer::UnsupportedFlavorException,
+ container::ElementExistException, rdf::ParseException, io::IOException)
+{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ if ( impl_isDisposed() )
+ throw lang::DisposedException();
+
+ const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA());
+ if (!xDMA.is()) {
+ throw uno::RuntimeException( ::rtl::OUString::createFromAscii(
+ "model has no document metadata"), *this );
+ }
+
+ return xDMA->importMetadataFile(i_Format,
+ i_xInStream, i_rFileName, i_xBaseURI, i_rTypes);
+}
+
+void SAL_CALL
+SfxBaseModel::removeMetadataFile(
+ const uno::Reference< rdf::XURI > & i_xGraphName)
+throw (uno::RuntimeException, lang::IllegalArgumentException,
+ container::NoSuchElementException)
+{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ if ( impl_isDisposed() )
+ throw lang::DisposedException();
+
+ const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA());
+ if (!xDMA.is()) {
+ throw uno::RuntimeException( ::rtl::OUString::createFromAscii(
+ "model has no document metadata"), *this );
+ }
+
+ return xDMA->removeMetadataFile(i_xGraphName);
+}
+
+void SAL_CALL
+SfxBaseModel::addContentOrStylesFile(const ::rtl::OUString & i_rFileName)
+throw (uno::RuntimeException, lang::IllegalArgumentException,
+ container::ElementExistException)
+{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ if ( impl_isDisposed() )
+ throw lang::DisposedException();
+
+ const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA());
+ if (!xDMA.is()) {
+ throw uno::RuntimeException( ::rtl::OUString::createFromAscii(
+ "model has no document metadata"), *this );
+ }
+
+ return xDMA->addContentOrStylesFile(i_rFileName);
+}
+
+void SAL_CALL
+SfxBaseModel::removeContentOrStylesFile(const ::rtl::OUString & i_rFileName)
+throw (uno::RuntimeException, lang::IllegalArgumentException,
+ container::NoSuchElementException)
+{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ if ( impl_isDisposed() )
+ throw lang::DisposedException();
+
+ const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA());
+ if (!xDMA.is()) {
+ throw uno::RuntimeException( ::rtl::OUString::createFromAscii(
+ "model has no document metadata"), *this );
+ }
+
+ return xDMA->removeContentOrStylesFile(i_rFileName);
+}
+
+void SAL_CALL
+SfxBaseModel::loadMetadataFromStorage(
+ uno::Reference< embed::XStorage > const & i_xStorage,
+ uno::Reference<rdf::XURI> const & i_xBaseURI,
+ uno::Reference<task::XInteractionHandler> const & i_xHandler)
+throw (uno::RuntimeException, lang::IllegalArgumentException,
+ lang::WrappedTargetException)
+{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ if ( impl_isDisposed() )
+ throw lang::DisposedException();
+
+ const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(
+ m_pData->CreateDMAUninitialized());
+ if (!xDMA.is()) {
+ throw uno::RuntimeException( ::rtl::OUString::createFromAscii(
+ "model has no document metadata"), *this );
+ }
+
+ try {
+ xDMA->loadMetadataFromStorage(i_xStorage, i_xBaseURI, i_xHandler);
+ } catch (lang::IllegalArgumentException &) {
+ throw; // not initialized
+ } catch (uno::Exception &) {
+ // UGLY: if it's a RuntimeException, we can't be sure DMA is initialzed
+ m_pData->m_xDocumentMetadata = xDMA;
+ throw;
+ }
+ m_pData->m_xDocumentMetadata = xDMA;
+
+}
+
+void SAL_CALL
+SfxBaseModel::storeMetadataToStorage(
+ uno::Reference< embed::XStorage > const & i_xStorage)
+throw (uno::RuntimeException, lang::IllegalArgumentException,
+ lang::WrappedTargetException)
+{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ if ( impl_isDisposed() )
+ throw lang::DisposedException();
+
+ const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA());
+ if (!xDMA.is()) {
+ throw uno::RuntimeException( ::rtl::OUString::createFromAscii(
+ "model has no document metadata"), *this );
+ }
+
+ return xDMA->storeMetadataToStorage(i_xStorage);
+}
+
+void SAL_CALL
+SfxBaseModel::loadMetadataFromMedium(
+ const uno::Sequence< beans::PropertyValue > & i_rMedium)
+throw (uno::RuntimeException, lang::IllegalArgumentException,
+ lang::WrappedTargetException)
+{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ if ( impl_isDisposed() )
+ throw lang::DisposedException();
+
+ const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(
+ m_pData->CreateDMAUninitialized());
+ if (!xDMA.is()) {
+ throw uno::RuntimeException( ::rtl::OUString::createFromAscii(
+ "model has no document metadata"), *this );
+ }
+
+ try {
+ xDMA->loadMetadataFromMedium(i_rMedium);
+ } catch (lang::IllegalArgumentException &) {
+ throw; // not initialized
+ } catch (uno::Exception &) {
+ // UGLY: if it's a RuntimeException, we can't be sure DMA is initialzed
+ m_pData->m_xDocumentMetadata = xDMA;
+ throw;
+ }
+ m_pData->m_xDocumentMetadata = xDMA;
+}
+
+void SAL_CALL
+SfxBaseModel::storeMetadataToMedium(
+ const uno::Sequence< beans::PropertyValue > & i_rMedium)
+throw (uno::RuntimeException, lang::IllegalArgumentException,
+ lang::WrappedTargetException)
+{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ if ( impl_isDisposed() )
+ throw lang::DisposedException();
+
+ const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA());
+ if (!xDMA.is()) {
+ throw uno::RuntimeException( ::rtl::OUString::createFromAscii(
+ "model has no document metadata"), *this );
+ }
+
+ return xDMA->storeMetadataToMedium(i_rMedium);
+}
+
diff --git a/sfx2/source/inc/objshimp.hxx b/sfx2/source/inc/objshimp.hxx
index cf8aedb954..77d8cae84b 100644
--- a/sfx2/source/inc/objshimp.hxx
+++ b/sfx2/source/inc/objshimp.hxx
@@ -174,6 +174,8 @@ struct SfxObjectShell_Impl : public ::sfx2::IMacroDocumentAccess
SfxObjectShell_Impl( SfxObjectShell& _rDocShell );
virtual ~SfxObjectShell_Impl();
+ static sal_Bool NeedsOfficeUpdateDialog();
+
// IMacroDocumentAccess overridables
virtual sal_Int16 getCurrentMacroExecMode() const;
virtual sal_Bool setCurrentMacroExecMode( sal_uInt16 nMacroMode );
diff --git a/sfx2/source/toolbox/tbxitem.cxx b/sfx2/source/toolbox/tbxitem.cxx
index f0ebaf48aa..f0efa2da90 100644
--- a/sfx2/source/toolbox/tbxitem.cxx
+++ b/sfx2/source/toolbox/tbxitem.cxx
@@ -1029,6 +1029,25 @@ void SfxToolBoxControl::Select( USHORT nModifier )
void SfxToolBoxControl::Select( BOOL /*bMod1*/ )
{
+ if(::comphelper::UiEventsLogger::isEnabled()) //#i88653# #i102805#
+ {
+ ::rtl::OUString sAppName;
+ try
+ {
+ static ::rtl::OUString our_aModuleManagerName = ::rtl::OUString::createFromAscii("com.sun.star.frame.ModuleManager");
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceManager =
+ ::comphelper::getProcessServiceFactory();
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModuleManager > xModuleManager(
+ xServiceManager->createInstance(our_aModuleManagerName)
+ , ::com::sun::star::uno::UNO_QUERY_THROW);
+ sAppName = xModuleManager->identify(m_xFrame);
+ } catch(::com::sun::star::uno::Exception&) {}
+ Sequence<PropertyValue> vSource;
+ ::comphelper::UiEventsLogger::appendDispatchOrigin(vSource, sAppName, ::rtl::OUString::createFromAscii("SfxToolBoxControl"));
+ URL aURL;
+ aURL.Complete = m_aCommandURL;
+ ::comphelper::UiEventsLogger::logDispatch(aURL, vSource);
+ }
svt::ToolboxController::execute( pImpl->nSelectModifier );
}
diff --git a/sfx2/util/makefile.mk b/sfx2/util/makefile.mk
index cfed0a838f..5ee6e64dac 100644
--- a/sfx2/util/makefile.mk
+++ b/sfx2/util/makefile.mk
@@ -98,7 +98,9 @@ SHL1STDLIBS+=\
$(CPPULIB) \
$(VOSLIB) \
$(SALLIB) \
- $(SJLIB)
+ $(SJLIB) \
+ $(LIBXML2LIB) \
+
.IF "$(GUI)"=="WNT"
diff --git a/shell/inc/internal/basereader.hxx b/shell/inc/internal/basereader.hxx
index 358c71fd56..1c0ec1ad15 100644
--- a/shell/inc/internal/basereader.hxx
+++ b/shell/inc/internal/basereader.hxx
@@ -50,6 +50,8 @@ public:
protected: // protected because its only an implementation relevant class
CBaseReader( const std::string& DocumentName );
+ CBaseReader( void* stream, zlib_filefunc_def* fa );
+
virtual void start_document();
virtual void end_document();
diff --git a/shell/inc/internal/contentreader.hxx b/shell/inc/internal/contentreader.hxx
index 7389ed80e6..37a0a474f6 100644
--- a/shell/inc/internal/contentreader.hxx
+++ b/shell/inc/internal/contentreader.hxx
@@ -43,6 +43,9 @@ public:
//CContentReader( const std::string& DocumentName );
CContentReader( const std::string& DocumentName, LocaleSet_t const & DocumentLocale );
+ CContentReader( void* stream, LocaleSet_t const & DocumentLocale, zlib_filefunc_def* fa );
+
+
/** Get the chunkbuffer.
@return
diff --git a/shell/inc/internal/metainforeader.hxx b/shell/inc/internal/metainforeader.hxx
index f12671c93f..3a494cd34b 100644
--- a/shell/inc/internal/metainforeader.hxx
+++ b/shell/inc/internal/metainforeader.hxx
@@ -45,6 +45,9 @@ public:
virtual ~CMetaInfoReader();
CMetaInfoReader( const std::string& DocumentName );
+
+ CMetaInfoReader( void* stream, zlib_filefunc_def* fa);
+
/** check if the Tag is in the target meta.xml file.
@param TagName
diff --git a/shell/inc/internal/propsheets.hxx b/shell/inc/internal/propsheets.hxx
index f380d15430..ec3457522c 100644
--- a/shell/inc/internal/propsheets.hxx
+++ b/shell/inc/internal/propsheets.hxx
@@ -92,7 +92,6 @@ private:
private:
long m_RefCnt;
char m_szFileName[MAX_PATH];
- std::auto_ptr<CMetaInfoReader> m_pMetaInfo;
};
#endif
diff --git a/shell/inc/internal/types.hxx b/shell/inc/internal/types.hxx
index c8686b2e49..7de20446f7 100644
--- a/shell/inc/internal/types.hxx
+++ b/shell/inc/internal/types.hxx
@@ -36,6 +36,9 @@
#include <utility>
#include <vector>
#include <stack>
+#include <external/zlib/zlib.h>
+#include <external/zlib/ioapi.h>
+
typedef std::vector<std::wstring> StringList_t;
diff --git a/shell/inc/internal/zipfile.hxx b/shell/inc/internal/zipfile.hxx
index 28405b71f1..5efbcdf130 100644
--- a/shell/inc/internal/zipfile.hxx
+++ b/shell/inc/internal/zipfile.hxx
@@ -35,7 +35,9 @@
#define _WINDOWS
#endif
-#include <external/zlib/unzip.h>
+
+#include <external/zlib/unzip.h>
+
#include <string>
#include <vector>
@@ -68,6 +70,9 @@ public:
AccessViolationException if read access to the file is denied
*/
static bool IsZipFile(const std::string& FileName);
+
+ static bool IsZipFile(void* stream);
+
/** Returns wheter the version of the specified zip file may be uncompressed with the
currently used zlib version or not
@@ -86,7 +91,8 @@ public:
*/
static bool IsValidZipFileVersionNumber(const std::string& FileName);
-
+ static bool IsValidZipFileVersionNumber(void* stream);
+
public:
/** Constructs a zip file from a zip file
@@ -102,6 +108,9 @@ public:
with the used zlib version
*/
ZipFile(const std::string& FileName);
+
+ ZipFile(void* stream, zlib_filefunc_def* fa);
+
/** Destroys a zip file
*/
diff --git a/shell/prj/build.lst b/shell/prj/build.lst
index 01077cbcb8..7a2e91f973 100644
--- a/shell/prj/build.lst
+++ b/shell/prj/build.lst
@@ -31,6 +31,7 @@ sl shell\source\backends\wininetbe nmake - w sl_backends_w
sl shell\source\backends\macbe nmake - u sl_backends_macbe sl_inc NULL
sl shell\source\backends\gconfbe nmake - u sl_backends_gconfbe sl_inc NULL
sl shell\source\backends\kdebe nmake - u sl_backends_kdebe sl_inc NULL
+sl shell\source\backends\kde4be nmake - u sl_backends_kde4be sl_inc NULL
sl shell\source\backends\desktopbe nmake - u sl_backends_desktopbe sl_inc NULL
sl shell\source\win32\shlxthandler\ooofilt nmake - w sl_win32_shlxthandler_ooofilt sl_all_zipfile.w sl_all_ooofilereader.w sl_win32_shlxthandler_util.w sl_all sl_inc NULL
sl shell\source\win32\shlxthandler\ooofilt\proxy nmake - w sl_win32_ooofiltproxy sl_inc NULL
diff --git a/shell/source/all/makefile.mk b/shell/source/all/makefile.mk
index 3695abae79..623aad6d69 100755
--- a/shell/source/all/makefile.mk
+++ b/shell/source/all/makefile.mk
@@ -35,6 +35,7 @@ PRJNAME=shell
TARGET=xmlparser
ENABLE_EXCEPTIONS=TRUE
+
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
@@ -61,6 +62,7 @@ CFLAGS+=-DSYSTEM_EXPAT
.ENDIF
SLOFILES=$(SLO)$/xml_parser.obj
+
.IF "$(BUILD_X64)"!=""
SLOFILES_X64=$(SLO_X64)$/xml_parser.obj
.ENDIF # "$(BUILD_X64)"!=""
diff --git a/shell/source/all/ooofilereader/basereader.cxx b/shell/source/all/ooofilereader/basereader.cxx
index b92f208022..d8d95c3e89 100644
--- a/shell/source/all/ooofilereader/basereader.cxx
+++ b/shell/source/all/ooofilereader/basereader.cxx
@@ -50,6 +50,15 @@ m_ZipFile( DocumentName )
//
//------------------------------
+CBaseReader::CBaseReader(void * sw, zlib_filefunc_def* fa):
+m_ZipFile( sw , fa )
+{
+}
+
+//------------------------------
+//
+//------------------------------
+
CBaseReader::~CBaseReader()
{
}
diff --git a/shell/source/all/ooofilereader/contentreader.cxx b/shell/source/all/ooofilereader/contentreader.cxx
index 03febefc35..138663bf36 100644
--- a/shell/source/all/ooofilereader/contentreader.cxx
+++ b/shell/source/all/ooofilereader/contentreader.cxx
@@ -61,6 +61,29 @@ CBaseReader( DocumentName )
}
}
+CContentReader::CContentReader( void* stream, LocaleSet_t const & DocumentLocale, zlib_filefunc_def* fa ) :
+CBaseReader( stream, fa )
+{
+try
+ {
+ m_DefaultLocale = DocumentLocale;
+ Initialize( DOC_CONTENT_NAME );
+ }
+ catch(xml_parser_exception&
+ #if OSL_DEBUG_LEVEL > 0
+ ex
+ #endif
+ )
+ {
+ ENSURE(false, ex.what());
+ }
+ catch(...)
+ {
+ ENSURE(false, "Unknown error");
+ }
+}
+
+
/** destructor.
*/
diff --git a/shell/source/all/ooofilereader/makefile.mk b/shell/source/all/ooofilereader/makefile.mk
index 1e9788cf3f..b893db45d8 100644
--- a/shell/source/all/ooofilereader/makefile.mk
+++ b/shell/source/all/ooofilereader/makefile.mk
@@ -35,6 +35,7 @@ TARGET=ooofilereader
LIBTARGET=NO
ENABLE_EXCEPTIONS=TRUE
+
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
@@ -65,7 +66,7 @@ LIB1TARGET=$(SLB)$/$(TARGET).lib
LIB1OBJFILES=$(SLOFILES)
LIB1FILES=$(SLB)$/zipfile.lib\
$(SLB)$/xmlparser.lib
-
+
.IF "$(BUILD_X64)"!=""
SLOFILES_X64=$(SLO_X64)$/basereader.obj\
$(SLO_X64)$/metainforeader.obj\
diff --git a/shell/source/all/ooofilereader/metainforeader.cxx b/shell/source/all/ooofilereader/metainforeader.cxx
index eba0487b04..e179d9ab14 100644
--- a/shell/source/all/ooofilereader/metainforeader.cxx
+++ b/shell/source/all/ooofilereader/metainforeader.cxx
@@ -80,6 +80,48 @@ CBaseReader( DocumentName )
}
}
+CMetaInfoReader::CMetaInfoReader( void* stream, zlib_filefunc_def* fa) :
+CBaseReader( stream, fa)
+{
+try
+ {
+ m_pKeywords_Builder = new CKeywordsTag( );
+ m_pSimple_Builder = new CSimpleTag( );
+ m_pDummy_Builder = new CDummyTag( );
+
+ //retrieve all infomation that is useful
+ m_AllMetaInfo[META_INFO_AUTHOR] = EMPTY_XML_TAG;
+ m_AllMetaInfo[META_INFO_TITLE] = EMPTY_XML_TAG;
+ m_AllMetaInfo[META_INFO_SUBJECT] = EMPTY_XML_TAG;
+ m_AllMetaInfo[META_INFO_KEYWORDS] = EMPTY_XML_TAG;
+ m_AllMetaInfo[META_INFO_DESCRIPTION] = EMPTY_XML_TAG;
+ m_AllMetaInfo[META_INFO_DOCUMENT_STATISTIC] = EMPTY_XML_TAG;
+
+ m_AllMetaInfo[META_INFO_GENERATOR] = EMPTY_XML_TAG;
+ m_AllMetaInfo[META_INFO_CREATION] = EMPTY_XML_TAG;
+ m_AllMetaInfo[META_INFO_CREATOR] = EMPTY_XML_TAG;
+ m_AllMetaInfo[META_INFO_MODIFIED] = EMPTY_XML_TAG;
+ m_AllMetaInfo[META_INFO_LANGUAGE] = EMPTY_XML_TAG;
+ m_AllMetaInfo[META_INFO_DOCUMENT_NUMBER] = EMPTY_XML_TAG;
+ m_AllMetaInfo[META_INFO_EDITING_TIME] = EMPTY_XML_TAG;
+
+ Initialize( META_CONTENT_NAME );
+ }
+ catch(xml_parser_exception&
+ #if OSL_DEBUG_LEVEL > 0
+ ex
+ #endif
+ )
+ {
+ ENSURE(false, ex.what());
+ }
+ catch(...)
+ {
+ ENSURE(false, "Unknown error");
+ }
+
+}
+
/** destructor.
*/
diff --git a/shell/source/all/zipfile/makefile.mk b/shell/source/all/zipfile/makefile.mk
index a7f9c95b95..9f294ce7aa 100644
--- a/shell/source/all/zipfile/makefile.mk
+++ b/shell/source/all/zipfile/makefile.mk
@@ -33,6 +33,9 @@ PRJ=..$/..$/..
PRJNAME=shell
TARGET=zipfile
ENABLE_EXCEPTIONS=TRUE
+EXTERNAL_WARNINGS_NOT_ERRORS := TRUE
+
+
# --- Settings -----------------------------------------------------
@@ -45,8 +48,8 @@ SLOFILES=$(SLO)$/zipfile.obj\
$(SLO)$/zipexcptn.obj
SLOFILES_X64=$(SLO_X64)$/zipfile.obj\
- $(SLO_X64)$/zipexcptn.obj
-
+ $(SLO_X64)$/zipexcptn.obj
+
# --- Targets ------------------------------------------------------
.INCLUDE : set_wntx64.mk
diff --git a/shell/source/all/zipfile/zipfile.cxx b/shell/source/all/zipfile/zipfile.cxx
index 2491524621..d5b6ef6e06 100644
--- a/shell/source/all/zipfile/zipfile.cxx
+++ b/shell/source/all/zipfile/zipfile.cxx
@@ -79,6 +79,12 @@ bool ZipFile::IsZipFile(const std::string& /*FileName*/)
return true;
}
+bool ZipFile::IsZipFile(void* /*stream*/)
+{
+ return true;
+}
+
+
/** Returns wheter the version of the specified zip file may be uncompressed with the
currently used zlib version or not
@@ -99,6 +105,12 @@ bool ZipFile::IsValidZipFileVersionNumber(const std::string& /*FileName*/)
return true;
}
+bool ZipFile::IsValidZipFileVersionNumber(void* /* stream*/)
+{
+ return true;
+}
+
+
/** Constructs a zip file from a zip file
@precond The given parameter must be a string with length > 0
@@ -119,6 +131,16 @@ ZipFile::ZipFile(const std::string& FileName)
throw IOException(-1);
}
+ZipFile::ZipFile(void* stream, zlib_filefunc_def* fa)
+{
+ fa->opaque = stream;
+ m_uzFile = unzOpen2((const char *)NULL, fa);
+
+ if (0 == m_uzFile)
+ throw IOException(-1);
+}
+
+
/** Destroys a zip file
*/
ZipFile::~ZipFile()
diff --git a/shell/source/backends/kde4be/exports.map b/shell/source/backends/kde4be/exports.map
new file mode 100644
index 0000000000..ba501f9ae0
--- /dev/null
+++ b/shell/source/backends/kde4be/exports.map
@@ -0,0 +1,10 @@
+UDK_3_0_0 {
+ global:
+ GetVersionInfo;
+ component_getImplementationEnvironment;
+ component_getFactory;
+ component_writeInfo;
+
+ local:
+ *;
+};
diff --git a/shell/source/backends/kde4be/kde4backend.cxx b/shell/source/backends/kde4be/kde4backend.cxx
new file mode 100644
index 0000000000..3e0fadd682
--- /dev/null
+++ b/shell/source/backends/kde4be/kde4backend.cxx
@@ -0,0 +1,158 @@
+/*************************************************************************
+ *
+ * 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: kde4backend.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.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_shell.hxx"
+
+#include "kde4backend.hxx"
+#include "kde4commonlayer.hxx"
+#include "kde4inetlayer.hxx"
+#include "kde4vcllayer.hxx"
+#include "kde4pathslayer.hxx"
+
+//------------------------------------------------------------------------------
+
+KDEBackend* KDEBackend::mInstance= 0;
+
+KDEBackend* KDEBackend::createInstance(const uno::Reference<uno::XComponentContext>& xContext)
+{
+ if (mInstance == 0)
+ {
+ mInstance = new KDEBackend (xContext);
+ }
+
+ return mInstance;
+}
+
+//------------------------------------------------------------------------------
+
+KDEBackend::KDEBackend(const uno::Reference<uno::XComponentContext>& xContext)
+ throw (backend::BackendAccessException)
+ : BackendBase(mMutex), m_xContext(xContext)
+{
+}
+
+//------------------------------------------------------------------------------
+
+KDEBackend::~KDEBackend(void)
+{
+}
+
+//------------------------------------------------------------------------------
+
+uno::Reference<backend::XLayer> SAL_CALL KDEBackend::getLayer(
+ const rtl::OUString& aComponent, const rtl::OUString& /* aTimestamp */)
+ throw (backend::BackendAccessException, lang::IllegalArgumentException)
+{
+ uno::Reference<backend::XLayer> xLayer;
+
+ if( aComponent.equalsAscii("org.openoffice.Office.Common" ) )
+ {
+ xLayer = new KDECommonLayer(m_xContext);
+ }
+ else if( aComponent.equalsAscii("org.openoffice.Inet" ) )
+ {
+ xLayer = new KDEInetLayer(m_xContext);
+ }
+ else if( aComponent.equalsAscii("org.openoffice.VCL" ) )
+ {
+ xLayer = new KDEVCLLayer(m_xContext);
+ }
+ else if( aComponent.equalsAscii("org.openoffice.Office.Paths" ) )
+ {
+ xLayer = new KDEPathsLayer(m_xContext);
+ }
+
+ return xLayer;
+}
+
+//------------------------------------------------------------------------------
+
+uno::Reference<backend::XUpdatableLayer> SAL_CALL
+KDEBackend::getUpdatableLayer(const rtl::OUString& /* aComponent */)
+ throw (backend::BackendAccessException,lang::NoSupportException,
+ lang::IllegalArgumentException)
+{
+ throw lang::NoSupportException( rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("KDEBackend: No Update Operation allowed, Read Only access") ),
+ *this) ;
+}
+
+//------------------------------------------------------------------------------
+
+rtl::OUString SAL_CALL KDEBackend::getBackendName(void)
+{
+ return rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.configuration.backend.KDE4Backend") );
+}
+
+//------------------------------------------------------------------------------
+
+rtl::OUString SAL_CALL KDEBackend::getImplementationName(void)
+ throw (uno::RuntimeException)
+{
+ return getBackendName() ;
+}
+
+//------------------------------------------------------------------------------
+
+uno::Sequence<rtl::OUString> SAL_CALL KDEBackend::getBackendServiceNames(void)
+{
+ uno::Sequence<rtl::OUString> aServices(1) ;
+ aServices[0] = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.backend.KDE4Backend")) ;
+
+ return aServices ;
+}
+
+//------------------------------------------------------------------------------
+
+sal_Bool SAL_CALL KDEBackend::supportsService(const rtl::OUString& aServiceName)
+ throw (uno::RuntimeException)
+{
+ uno::Sequence< rtl::OUString > const svc = getBackendServiceNames();
+
+ for(sal_Int32 i = 0; i < svc.getLength(); ++i )
+ if(svc[i] == aServiceName)
+ return true;
+
+ return false;
+}
+
+//------------------------------------------------------------------------------
+
+uno::Sequence<rtl::OUString>
+SAL_CALL KDEBackend::getSupportedServiceNames(void)
+ throw (uno::RuntimeException)
+{
+ return getBackendServiceNames() ;
+}
+
+// ---------------------------------------------------------------------------------------
diff --git a/shell/source/backends/kde4be/kde4backend.hxx b/shell/source/backends/kde4be/kde4backend.hxx
new file mode 100644
index 0000000000..95f66f325a
--- /dev/null
+++ b/shell/source/backends/kde4be/kde4backend.hxx
@@ -0,0 +1,123 @@
+/*************************************************************************
+ *
+ * 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: kde4backend.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.
+ *
+ ************************************************************************/
+
+#pragma once
+
+#include <com/sun/star/configuration/backend/XSingleLayerStratum.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/configuration/InvalidBootstrapFileException.hpp>
+#include <com/sun/star/configuration/backend/CannotConnectException.hpp>
+#include <cppuhelper/compbase2.hxx>
+
+#ifndef INCLUDED_MAP
+#include <map>
+#define INCLUDED_MAP
+#endif
+
+namespace css = com::sun::star ;
+namespace uno = css::uno ;
+namespace lang = css::lang ;
+namespace backend = css::configuration::backend ;
+
+
+//------------------------------------------------------------------------------
+typedef cppu::WeakComponentImplHelper2<backend::XSingleLayerStratum,
+ lang::XServiceInfo> BackendBase ;
+
+/**
+ Implements the SingleLayerStratum service for KDE access.
+ */
+class KDEBackend : public BackendBase {
+ public :
+
+ static KDEBackend* createInstance(const uno::Reference<uno::XComponentContext>& xContext);
+
+ // XServiceInfo
+ virtual rtl::OUString SAL_CALL getImplementationName( )
+ throw (uno::RuntimeException) ;
+
+ virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& aServiceName )
+ throw (uno::RuntimeException) ;
+
+ virtual uno::Sequence<rtl::OUString> SAL_CALL getSupportedServiceNames( )
+ throw (uno::RuntimeException) ;
+
+ /**
+ Provides the implementation name.
+
+ @return implementation name
+ */
+ static rtl::OUString SAL_CALL getBackendName(void) ;
+
+ /**
+ Provides the supported services names
+
+ @return service names
+ */
+ static uno::Sequence<rtl::OUString> SAL_CALL getBackendServiceNames(void) ;
+
+ //XSingleLayerStratum
+ virtual uno::Reference<backend::XLayer> SAL_CALL
+ getLayer( const rtl::OUString& aLayerId, const rtl::OUString& aTimestamp )
+ throw (backend::BackendAccessException, lang::IllegalArgumentException) ;
+
+ virtual uno::Reference<backend::XUpdatableLayer> SAL_CALL
+ getUpdatableLayer( const rtl::OUString& aLayerId )
+ throw (backend::BackendAccessException, lang::NoSupportException,
+ lang::IllegalArgumentException) ;
+
+ protected:
+ /**
+ Service constructor from a service factory.
+
+ @param xContext component context
+ */
+ KDEBackend(const uno::Reference<uno::XComponentContext>& xContext)
+ throw (backend::BackendAccessException);
+
+ /** Destructor */
+ ~KDEBackend(void) ;
+
+ private:
+
+ /** Build KDE/OO mapping table */
+ void initializeMappingTable ();
+
+
+ /** The component context */
+ uno::Reference<uno::XComponentContext> m_xContext;
+
+ /** Mutex for reOOurces protection */
+ osl::Mutex mMutex ;
+
+ static KDEBackend* mInstance;
+};
diff --git a/shell/source/backends/kde4be/kde4be.xml b/shell/source/backends/kde4be/kde4be.xml
new file mode 100644
index 0000000000..93961672e5
--- /dev/null
+++ b/shell/source/backends/kde4be/kde4be.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE module-description PUBLIC "-//StarOffice//DTD ComponentDescription 1.0//EN" "module-description.dtd">
+<module-description xmlns:xlink="http://www.w3.org/1999/xlink">
+ <module-name>kde4be</module-name>
+ <component-description>
+ <author> Éric Bischoff </author>
+ <name>com.sun.star.comp.configuration.backend.KDE4Backend</name>
+ <description> The KDE4 configuration backend </description>
+ <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
+ <language>c++</language>
+ <status value="beta"/>
+ <supported-service>com.sun.star.comp.configuration.backend.KDE4Backend</supported-service>
+ <service-dependency>...</service-dependency>
+ <type>com.sun.star.configuration.backend.XBackendChangesListener</type>
+ <type>com.sun.star.configuration.backend.XBackendChangesNotifier</type>
+ <type>com.sun.star.configuration.backend.XLayerHandler</type>
+ <type>com.sun.star.configuration.backend.XSingleLayerStratum</type>
+ <type>com.sun.star.lang.XMultiComponentFactory</type>
+ <type>com.sun.star.lang.XServiceInfo</type>
+ <type>com.sun.star.lang.XSingleComponentFactory</type>
+ <type>com.sun.star.lang.XTypeProvider</type>
+ <type>com.sun.star.uno.TypeClass</type>
+ <type>com.sun.star.uno.XAggregation</type>
+ <type>com.sun.star.uno.XComponentContext</type>
+ <type>com.sun.star.uno.XCurrentContext</type>
+ <type>com.sun.star.uno.XWeak</type>
+ <type>com.sun.star.registry.XRegistryKey</type>
+ </component-description>
+ <project-build-dependency>cppuhelper</project-build-dependency>
+ <project-build-dependency>cppu</project-build-dependency>
+ <project-build-dependency>sal</project-build-dependency>
+ <runtime-module-dependency>cppuhelper3$(COM)</runtime-module-dependency>
+ <runtime-module-dependency>cppu3</runtime-module-dependency>
+ <runtime-module-dependency>sal3</runtime-module-dependency>
+</module-description>
diff --git a/shell/source/backends/kde4be/kde4be1-ucd.txt b/shell/source/backends/kde4be/kde4be1-ucd.txt
new file mode 100644
index 0000000000..9671199b26
--- /dev/null
+++ b/shell/source/backends/kde4be/kde4be1-ucd.txt
@@ -0,0 +1,6 @@
+[ComponentDescriptor]
+ImplementationName=com.sun.star.comp.configuration.backend.KDE4Backend
+ComponentName=kde4be1.uno.so
+LoaderName=com.sun.star.loader.SharedLibrary
+[SupportedServices]
+com.sun.star.configuration.backend.KDE4Backend
diff --git a/shell/source/backends/kde4be/kde4becdef.cxx b/shell/source/backends/kde4be/kde4becdef.cxx
new file mode 100644
index 0000000000..277e3910b7
--- /dev/null
+++ b/shell/source/backends/kde4be/kde4becdef.cxx
@@ -0,0 +1,143 @@
+/*************************************************************************
+ *
+ * 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: kde4becdef.cxx,v $
+ * $Revision: 1.8 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_shell.hxx"
+#include "kde4backend.hxx"
+
+#include <kapplication.h>
+
+#include <cppuhelper/implementationentry.hxx>
+
+#include <com/sun/star/registry/XRegistryKey.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+
+#include "uno/current_context.hxx"
+
+namespace css = com::sun::star ;
+namespace uno = css::uno ;
+namespace lang = css::lang ;
+namespace backend = css::configuration::backend ;
+
+//==============================================================================
+
+static uno::Reference<uno::XInterface> SAL_CALL createKDEBackend(const uno::Reference<uno::XComponentContext>& xContext)
+{
+ try {
+ uno::Reference< uno::XCurrentContext > xCurrentContext(uno::getCurrentContext());
+
+ if (xCurrentContext.is())
+ {
+ uno::Any aValue = xCurrentContext->getValueByName(
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "system.desktop-environment" ) ) );
+
+ rtl::OUString aDesktopEnvironment;
+ if ( (aValue >>= aDesktopEnvironment) && (aDesktopEnvironment.equalsAscii("KDE")) && (KApplication::kApplication() != NULL) )
+ return * KDEBackend::createInstance(xContext);
+ }
+
+ return uno::Reference<uno::XInterface>();
+
+ } catch (uno::RuntimeException e) {
+ return uno::Reference<uno::XInterface>();
+ }
+
+}
+
+//==============================================================================
+
+static const cppu::ImplementationEntry kImplementations_entries[] =
+{
+ {
+ createKDEBackend,
+ KDEBackend::getBackendName,
+ KDEBackend::getBackendServiceNames,
+ cppu::createSingleComponentFactory,
+ NULL,
+ 0
+ },
+ { NULL, NULL, NULL, NULL, NULL, 0 }
+} ;
+//------------------------------------------------------------------------------
+
+extern "C" void SAL_CALL component_getImplementationEnvironment(
+ const sal_Char **aEnvTypeName,
+ uno_Environment **) {
+ *aEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ;
+}
+
+//------------------------------------------------------------------------------
+
+extern "C" sal_Bool SAL_CALL component_writeInfo(void *,
+ void *pRegistryKey) {
+
+ using namespace ::com::sun::star::registry;
+ if (pRegistryKey)
+ {
+ try
+ {
+ uno::Reference< XRegistryKey > xImplKey = static_cast< XRegistryKey* >( pRegistryKey )->createKey(
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) + KDEBackend::getBackendName()
+ );
+
+ // Register associated service names
+ uno::Reference< XRegistryKey > xServicesKey = xImplKey->createKey(
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES") )
+ );
+
+ uno::Sequence<rtl::OUString> sServiceNames = KDEBackend::getBackendServiceNames();
+ for (sal_Int32 i = 0 ; i < sServiceNames.getLength() ; ++ i)
+ xServicesKey->createKey(sServiceNames[i]);
+
+ return sal_True;
+ }
+
+ catch( InvalidRegistryException& )
+ {
+ OSL_ENSURE(sal_False, "InvalidRegistryException caught");
+ }
+ }
+
+ return sal_False;
+}
+
+//------------------------------------------------------------------------------
+
+extern "C" void *component_getFactory(const sal_Char *aImplementationName,
+ void *aServiceManager,
+ void *aRegistryKey) {
+
+ return cppu::component_getFactoryHelper(
+ aImplementationName,
+ aServiceManager,
+ aRegistryKey,
+ kImplementations_entries) ;
+}
+//------------------------------------------------------------------------------
diff --git a/shell/source/backends/kde4be/kde4commonlayer.cxx b/shell/source/backends/kde4be/kde4commonlayer.cxx
new file mode 100644
index 0000000000..6e718cbddb
--- /dev/null
+++ b/shell/source/backends/kde4be/kde4commonlayer.cxx
@@ -0,0 +1,157 @@
+/*************************************************************************
+ *
+ * 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: kde4commonlayer.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.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_shell.hxx"
+
+#include "kde4commonlayer.hxx"
+
+#include <kemailsettings.h>
+#include <kglobalsettings.h>
+
+#include <QFont>
+
+#include <com/sun/star/configuration/backend/PropertyInfo.hpp>
+#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
+#include <com/sun/star/uno/Sequence.hxx>
+
+#define SPACE ' '
+
+//==============================================================================
+
+KDECommonLayer::KDECommonLayer(const uno::Reference<uno::XComponentContext>& xContext)
+{
+ //Create instance of LayerContentDescriber Service
+ rtl::OUString const k_sLayerDescriberService(RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.comp.configuration.backend.LayerDescriber"));
+
+ typedef uno::Reference<backend::XLayerContentDescriber> LayerDescriber;
+ uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager();
+ if( xServiceManager.is() )
+ {
+ m_xLayerContentDescriber = LayerDescriber::query(
+ xServiceManager->createInstanceWithContext(k_sLayerDescriberService, xContext));
+ }
+ else
+ {
+ OSL_TRACE("Could not retrieve ServiceManager");
+ }
+}
+
+//------------------------------------------------------------------------------
+
+void SAL_CALL KDECommonLayer::readData( const uno::Reference<backend::XLayerHandler>& xHandler)
+ throw ( backend::MalformedDataException, lang::NullPointerException,
+ lang::WrappedTargetException, uno::RuntimeException)
+{
+ if( ! m_xLayerContentDescriber.is() )
+ {
+ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
+ "Could not create com.sun.star.configuration.backend.LayerContentDescriber Service"
+ ) ), static_cast < backend::XLayer * > (this) );
+ }
+
+ uno::Sequence<backend::PropertyInfo> aPropInfoList(3);
+ sal_Int32 nProperties = 0;
+
+ // Email client settings
+ KEMailSettings aEmailSettings;
+ QString aClientProgram;
+ ::rtl::OUString sClientProgram;
+
+ aClientProgram = aEmailSettings.getSetting( KEMailSettings::ClientProgram );
+ if ( aClientProgram.isEmpty() )
+ aClientProgram = "kmail";
+ else
+ aClientProgram = aClientProgram.section(SPACE, 0, 0);
+ sClientProgram = (const sal_Unicode *) aClientProgram.utf16();
+
+ aPropInfoList[nProperties].Name = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Office.Common/ExternalMailer/Program") );
+ aPropInfoList[nProperties].Type = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "string" ) );
+ aPropInfoList[nProperties].Protected = sal_False;
+ aPropInfoList[nProperties++].Value = uno::makeAny( sClientProgram );
+
+ // Source code font settings
+ QFont aFixedFont;
+ QString aFontName;
+ :: rtl::OUString sFontName;
+ short nFontHeight;
+
+ aFixedFont = KGlobalSettings::fixedFont();
+ aFontName = aFixedFont.family();
+ sFontName = (const sal_Unicode *) aFontName.utf16();
+ nFontHeight = aFixedFont.pointSize();
+
+ aPropInfoList[nProperties].Name = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Office.Common/Font/SourceViewFont/FontName") );
+ aPropInfoList[nProperties].Type = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "string" ) );
+ aPropInfoList[nProperties].Protected = sal_False;
+ aPropInfoList[nProperties++].Value = uno::makeAny( sFontName );
+
+ aPropInfoList[nProperties].Name = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Office.Common/Font/SourceViewFont/FontHeight") );
+ aPropInfoList[nProperties].Type = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "short" ) );
+ aPropInfoList[nProperties].Protected = sal_False;
+ aPropInfoList[nProperties++].Value = uno::makeAny( nFontHeight );
+
+ if( nProperties > 0 )
+ {
+ aPropInfoList.realloc(nProperties);
+ m_xLayerContentDescriber->describeLayer(xHandler, aPropInfoList);
+ }
+}
+
+//------------------------------------------------------------------------------
+
+rtl::OUString SAL_CALL KDECommonLayer::getTimestamp(void)
+ throw (uno::RuntimeException)
+{
+ // Return the value as timestamp to avoid regenerating the binary cache
+ // on each office launch.
+
+ KEMailSettings aEmailSettings;
+ QString aClientProgram = aEmailSettings.getSetting( KEMailSettings::ClientProgram );
+ aClientProgram = aClientProgram.section(SPACE, 0, 0);
+
+ QString aFixedFont = KGlobalSettings::fixedFont().toString();
+
+ ::rtl::OUString sTimeStamp,
+ sep( RTL_CONSTASCII_USTRINGPARAM( "$" ) );
+
+ sTimeStamp = (const sal_Unicode *) aClientProgram.utf16();
+ sTimeStamp += sep;
+ sTimeStamp += (const sal_Unicode *) aFixedFont.utf16();
+
+ return sTimeStamp;
+}
diff --git a/shell/source/backends/kde4be/kde4commonlayer.hxx b/shell/source/backends/kde4be/kde4commonlayer.hxx
new file mode 100644
index 0000000000..d37bab8627
--- /dev/null
+++ b/shell/source/backends/kde4be/kde4commonlayer.hxx
@@ -0,0 +1,51 @@
+#pragma once
+
+#include "kde4backend.hxx"
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/configuration/backend/XLayer.hpp>
+#include <com/sun/star/configuration/backend/BackendAccessException.hpp>
+#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
+#include <com/sun/star/util/XTimeStamped.hpp>
+#include <cppuhelper/implbase2.hxx>
+
+namespace css = com::sun::star ;
+namespace uno = css::uno ;
+namespace lang = css::lang ;
+namespace backend = css::configuration::backend ;
+namespace util = css::util ;
+
+/**
+ Implementation of the XLayer interface for the KDE values mapped into
+ the org.openoffice.Office.Common configuration component.
+ */
+class KDECommonLayer : public cppu::WeakImplHelper2<backend::XLayer, util::XTimeStamped>
+{
+public :
+ /**
+ Constructor given the component context
+
+ @param xContext The component context
+ */
+
+ KDECommonLayer(const uno::Reference<uno::XComponentContext>& xContext);
+
+ // XLayer
+ virtual void SAL_CALL readData(
+ const uno::Reference<backend::XLayerHandler>& xHandler)
+ throw ( backend::MalformedDataException,
+ lang::NullPointerException,
+ lang::WrappedTargetException,
+ uno::RuntimeException) ;
+
+ // XTimeStamped
+ virtual rtl::OUString SAL_CALL getTimestamp(void)
+ throw (uno::RuntimeException);
+
+ protected:
+
+ /** Destructor */
+ ~KDECommonLayer(void) {}
+
+ private :
+ uno::Reference<backend::XLayerContentDescriber> m_xLayerContentDescriber ;
+};
diff --git a/shell/source/backends/kde4be/kde4inetlayer.cxx b/shell/source/backends/kde4be/kde4inetlayer.cxx
new file mode 100644
index 0000000000..968121b025
--- /dev/null
+++ b/shell/source/backends/kde4be/kde4inetlayer.cxx
@@ -0,0 +1,255 @@
+/*************************************************************************
+ *
+ * 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: kde4inetlayer.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.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_shell.hxx"
+
+#include <kprotocolmanager.h>
+
+#include "kde4inetlayer.hxx"
+#include <com/sun/star/configuration/backend/PropertyInfo.hpp>
+#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
+#include <com/sun/star/uno/Sequence.hxx>
+
+#define COMMA ','
+#define SEMI_COLON ';'
+
+//==============================================================================
+
+KDEInetLayer::KDEInetLayer(const uno::Reference<uno::XComponentContext>& xContext)
+{
+ //Create instance of LayerContentDescriber Service
+ rtl::OUString const k_sLayerDescriberService(RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.comp.configuration.backend.LayerDescriber"));
+
+ typedef uno::Reference<backend::XLayerContentDescriber> LayerDescriber;
+ uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager();
+ if( xServiceManager.is() )
+ {
+ m_xLayerContentDescriber = LayerDescriber::query(
+ xServiceManager->createInstanceWithContext(k_sLayerDescriberService, xContext));
+ }
+ else
+ {
+ OSL_TRACE("Could not retrieve ServiceManager");
+ }
+}
+
+//------------------------------------------------------------------------------
+
+void SAL_CALL KDEInetLayer::readData( const uno::Reference<backend::XLayerHandler>& xHandler)
+ throw ( backend::MalformedDataException, lang::NullPointerException,
+ lang::WrappedTargetException, uno::RuntimeException)
+{
+ if( ! m_xLayerContentDescriber.is() )
+ {
+ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
+ "Could not create com.sun.star.configuration.backend.LayerContentDescriber Service"
+ ) ), static_cast < backend::XLayer * > (this) );
+ }
+
+ uno::Sequence<backend::PropertyInfo> aPropInfoList(8);
+ sal_Int32 nProperties = 0;
+
+ switch ( KProtocolManager::proxyType() )
+ {
+ case KProtocolManager::ManualProxy: // Proxies are manually configured
+ setProxy(aPropInfoList, nProperties, 1,
+ KProtocolManager::noProxyFor(),
+ KProtocolManager::proxyFor( "HTTP" ),
+ KProtocolManager::proxyFor( "FTP" ),
+ KProtocolManager::proxyFor( "HTTPS" ));
+ break;
+ case KProtocolManager::PACProxy: // A proxy configuration URL has been given
+ case KProtocolManager::WPADProxy: // A proxy should be automatically discovered
+ case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables
+// In such cases, the proxy address is not stored in KDE, but determined dynamically.
+// The proxy address may depend on the requested address, on the time of the day, on the speed of the wind...
+// The best we can do here is to ask the current value for a given address.
+ setProxy(aPropInfoList, nProperties, 1,
+ KProtocolManager::noProxyFor(),
+ KProtocolManager::proxyForUrl( KUrl("http://www.openoffice.org") ),
+ KProtocolManager::proxyForUrl( KUrl("ftp://ftp.openoffice.org") ),
+ KProtocolManager::proxyForUrl( KUrl("https://www.openoffice.org") ));
+ break;
+ default: // No proxy is used
+ setProxy(aPropInfoList, nProperties, 0);
+ }
+
+ if ( nProperties > 0 )
+ {
+ aPropInfoList.realloc(nProperties);
+ m_xLayerContentDescriber->describeLayer(xHandler, aPropInfoList);
+ }
+}
+
+//------------------------------------------------------------------------------
+
+rtl::OUString SAL_CALL KDEInetLayer::getTimestamp(void)
+ throw (uno::RuntimeException)
+{
+ // Return the value as timestamp to avoid regenerating the binary cache
+ // on each office launch.
+
+ QString aProxyType, aNoProxyFor, aHTTPProxy, aHTTPSProxy, aFTPProxy;
+
+ switch ( KProtocolManager::proxyType() )
+ {
+ case KProtocolManager::ManualProxy:
+ aProxyType = '1';
+ aNoProxyFor = KProtocolManager::noProxyFor();
+ aHTTPProxy = KProtocolManager::proxyFor( "HTTP" );
+ aHTTPProxy = KProtocolManager::proxyFor( "HTTPS" );
+ aFTPProxy = KProtocolManager::proxyFor( "FTP" );
+ break;
+ case KProtocolManager::PACProxy:
+ case KProtocolManager::WPADProxy:
+ case KProtocolManager::EnvVarProxy:
+ aProxyType = '1';
+ aNoProxyFor = KProtocolManager::noProxyFor();
+ aHTTPProxy = KProtocolManager::proxyForUrl( KUrl("http://www.openoffice.org") );
+ aHTTPSProxy = KProtocolManager::proxyForUrl( KUrl("https://www.openoffice.org") );
+ aFTPProxy = KProtocolManager::proxyForUrl( KUrl("ftp://ftp.openoffice.org") );
+ break;
+ default:
+ aProxyType = '0';
+ }
+
+ ::rtl::OUString sTimeStamp,
+ sep( RTL_CONSTASCII_USTRINGPARAM( "$" ) );
+
+ sTimeStamp = (const sal_Unicode *) aProxyType.utf16();
+ sTimeStamp += sep;
+ sTimeStamp += (const sal_Unicode *) aNoProxyFor.utf16();
+ sTimeStamp += sep;
+ sTimeStamp += (const sal_Unicode *) aHTTPProxy.utf16();
+ sTimeStamp += sep;
+ sTimeStamp += (const sal_Unicode *) aHTTPSProxy.utf16();
+ sTimeStamp += sep;
+ sTimeStamp += (const sal_Unicode *) aFTPProxy.utf16();
+
+ return sTimeStamp;
+}
+
+//------------------------------------------------------------------------------
+
+void SAL_CALL KDEInetLayer::setProxy
+ (uno::Sequence<backend::PropertyInfo> &aPropInfoList, sal_Int32 &nProperties,
+ int nProxyType, const QString &aNoProxy, const QString &aHTTPProxy, const QString &aFTPProxy, const QString &aHTTPSProxy ) const
+{
+ aPropInfoList[nProperties].Name = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetProxyType") );
+ aPropInfoList[nProperties].Type = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "int" ) );
+ aPropInfoList[nProperties].Protected = sal_False;
+ aPropInfoList[nProperties++].Value = uno::makeAny( (sal_Int32) nProxyType );
+
+ if (nProxyType == 0) return;
+
+ if ( !aNoProxy.isEmpty() )
+ {
+ QString aNoProxyFor(aNoProxy);
+ ::rtl::OUString sNoProxyFor;
+
+ aNoProxyFor = aNoProxyFor.replace( COMMA, SEMI_COLON );
+ sNoProxyFor = (const sal_Unicode *) aNoProxyFor.utf16();
+
+ aPropInfoList[nProperties].Name = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetNoProxy") );
+ aPropInfoList[nProperties].Type = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "string" ) );
+ aPropInfoList[nProperties].Protected = sal_False;
+ aPropInfoList[nProperties++].Value = uno::makeAny( sNoProxyFor );
+ }
+
+ if ( !aHTTPProxy.isEmpty() )
+ {
+ KUrl aProxy(aHTTPProxy);
+ ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().utf16();
+ sal_Int32 nPort = aProxy.port();
+
+ aPropInfoList[nProperties].Name = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPProxyName") );
+ aPropInfoList[nProperties].Type = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "string" ) );
+ aPropInfoList[nProperties].Protected = sal_False;
+ aPropInfoList[nProperties++].Value = uno::makeAny( sProxy );
+
+ aPropInfoList[nProperties].Name = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPProxyPort") );
+ aPropInfoList[nProperties].Type = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "int" ) );
+ aPropInfoList[nProperties].Protected = sal_False;
+ aPropInfoList[nProperties++].Value = uno::makeAny( nPort );
+ }
+
+ if ( !aHTTPSProxy.isEmpty() )
+ {
+ KUrl aProxy(aHTTPSProxy);
+ ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().utf16();
+ sal_Int32 nPort = aProxy.port();
+
+ aPropInfoList[nProperties].Name = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPSProxyName") );
+ aPropInfoList[nProperties].Type = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "string" ) );
+ aPropInfoList[nProperties].Protected = sal_False;
+ aPropInfoList[nProperties++].Value = uno::makeAny( sProxy );
+
+ aPropInfoList[nProperties].Name = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPSProxyPort") );
+ aPropInfoList[nProperties].Type = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "int" ) );
+ aPropInfoList[nProperties].Protected = sal_False;
+ aPropInfoList[nProperties++].Value = uno::makeAny( nPort );
+ }
+
+ if ( !aFTPProxy.isEmpty() )
+ {
+ KUrl aProxy(aFTPProxy);
+ ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().utf16();
+ sal_Int32 nPort = aProxy.port();
+
+ aPropInfoList[nProperties].Name = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetFTPProxyName") );
+ aPropInfoList[nProperties].Type = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "string" ) );
+ aPropInfoList[nProperties].Protected = sal_False;
+ aPropInfoList[nProperties++].Value = uno::makeAny( sProxy );
+
+ aPropInfoList[nProperties].Name = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetFTPProxyPort") );
+ aPropInfoList[nProperties].Type = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "int" ) );
+ aPropInfoList[nProperties].Protected = sal_False;
+ aPropInfoList[nProperties++].Value = uno::makeAny( nPort );
+ }
+}
+
diff --git a/shell/source/backends/kde4be/kde4inetlayer.hxx b/shell/source/backends/kde4be/kde4inetlayer.hxx
new file mode 100644
index 0000000000..1724628f9f
--- /dev/null
+++ b/shell/source/backends/kde4be/kde4inetlayer.hxx
@@ -0,0 +1,59 @@
+#pragma once
+
+#include <QString>
+
+#include "kde4backend.hxx"
+
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/configuration/backend/XLayer.hpp>
+#include <com/sun/star/configuration/backend/BackendAccessException.hpp>
+#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
+#include <com/sun/star/util/XTimeStamped.hpp>
+#include <cppuhelper/implbase2.hxx>
+
+namespace css = com::sun::star ;
+namespace uno = css::uno ;
+namespace lang = css::lang ;
+namespace backend = css::configuration::backend ;
+namespace util = css::util ;
+
+/**
+ Implementation of the XLayer interface for the KDE values mapped into
+ the org.openoffice.Inet configuration component.
+ */
+class KDEInetLayer : public cppu::WeakImplHelper2<backend::XLayer, util::XTimeStamped>
+{
+public :
+ /**
+ Constructor given the component context
+
+ @param xContext The component context
+ */
+
+ KDEInetLayer(const uno::Reference<uno::XComponentContext>& xContext);
+
+ // XLayer
+ virtual void SAL_CALL readData(
+ const uno::Reference<backend::XLayerHandler>& xHandler)
+ throw ( backend::MalformedDataException,
+ lang::NullPointerException,
+ lang::WrappedTargetException,
+ uno::RuntimeException) ;
+
+ // XTimeStamped
+ virtual rtl::OUString SAL_CALL getTimestamp(void)
+ throw (uno::RuntimeException);
+
+ protected:
+
+ /** Destructor */
+ ~KDEInetLayer(void) {}
+
+private :
+ uno::Reference<backend::XLayerContentDescriber> m_xLayerContentDescriber ;
+
+ void SAL_CALL setProxy
+ (uno::Sequence<backend::PropertyInfo> &aPropInfoList, sal_Int32 &nProperties,
+ int nProxyType, const QString &aNoProxyfor = QString(),
+ const QString &aHTTPProxy = QString(), const QString &aFTPProxy = QString(), const QString &aHTTPSProxy = QString()) const;
+};
diff --git a/shell/source/backends/kde4be/kde4pathslayer.cxx b/shell/source/backends/kde4be/kde4pathslayer.cxx
new file mode 100644
index 0000000000..079179062c
--- /dev/null
+++ b/shell/source/backends/kde4be/kde4pathslayer.cxx
@@ -0,0 +1,124 @@
+/*************************************************************************
+ *
+ * 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: kde4pathslayer.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.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_shell.hxx"
+
+#include "kde4pathslayer.hxx"
+
+#include <QString>
+#include <kglobalsettings.h>
+
+#include <com/sun/star/configuration/backend/PropertyInfo.hpp>
+#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
+
+#include <osl/security.hxx>
+#include <osl/file.hxx>
+#include <com/sun/star/uno/Sequence.hxx>
+
+#define SPACE ' '
+
+//==============================================================================
+
+KDEPathsLayer::KDEPathsLayer(const uno::Reference<uno::XComponentContext>& xContext)
+{
+ //Create instance of LayerContentDescriber Service
+ rtl::OUString const k_sLayerDescriberService(RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.comp.configuration.backend.LayerDescriber"));
+
+ typedef uno::Reference<backend::XLayerContentDescriber> LayerDescriber;
+ uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager();
+ if( xServiceManager.is() )
+ {
+ m_xLayerContentDescriber = LayerDescriber::query(
+ xServiceManager->createInstanceWithContext(k_sLayerDescriberService, xContext));
+ }
+ else
+ {
+ OSL_TRACE("Could not retrieve ServiceManager");
+ }
+}
+
+//------------------------------------------------------------------------------
+
+void SAL_CALL KDEPathsLayer::readData( const uno::Reference<backend::XLayerHandler>& xHandler)
+ throw ( backend::MalformedDataException, lang::NullPointerException,
+ lang::WrappedTargetException, uno::RuntimeException)
+{
+ if( ! m_xLayerContentDescriber.is() )
+ {
+ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
+ "Could not create com.sun.star.configuration.backend.LayerContentDescriber Service"
+ ) ), static_cast < backend::XLayer * > (this) );
+ }
+
+ uno::Sequence<backend::PropertyInfo> aPropInfoList(1);
+ sal_Int32 nProperties = 0;
+
+ QString aDocumentsDir( KGlobalSettings::documentPath() );
+ rtl::OUString sDocumentsDir;
+ rtl::OUString sDocumentsURL;
+ if ( aDocumentsDir.endsWith(QChar('/')) )
+ aDocumentsDir.truncate ( aDocumentsDir.length() - 1 );
+ sDocumentsDir = (const sal_Unicode *) aDocumentsDir.utf16();
+ osl_getFileURLFromSystemPath( sDocumentsDir.pData, &sDocumentsURL.pData );
+
+ aPropInfoList[nProperties].Name = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Office.Paths/Variables/Work") );
+ aPropInfoList[nProperties].Type = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "string" ) );
+ aPropInfoList[nProperties].Protected = sal_False;
+ aPropInfoList[nProperties++].Value = uno::makeAny( sDocumentsURL );
+
+ if( nProperties > 0 )
+ {
+ aPropInfoList.realloc(nProperties);
+ m_xLayerContentDescriber->describeLayer(xHandler, aPropInfoList);
+ }
+}
+
+//------------------------------------------------------------------------------
+
+rtl::OUString SAL_CALL KDEPathsLayer::getTimestamp(void)
+ throw (uno::RuntimeException)
+{
+ // Return the value as timestamp to avoid regenerating the binary cache
+ // on each office launch.
+
+ ::rtl::OUString sTimeStamp,
+ sep( RTL_CONSTASCII_USTRINGPARAM( "$" ) );
+
+ QString aDocumentsDir;
+ aDocumentsDir = KGlobalSettings::documentPath();
+
+ sTimeStamp += (const sal_Unicode *) aDocumentsDir.utf16();
+
+ return sTimeStamp;
+}
diff --git a/shell/source/backends/kde4be/kde4pathslayer.hxx b/shell/source/backends/kde4be/kde4pathslayer.hxx
new file mode 100644
index 0000000000..e3fc4dcadc
--- /dev/null
+++ b/shell/source/backends/kde4be/kde4pathslayer.hxx
@@ -0,0 +1,82 @@
+/*************************************************************************
+ *
+ * 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: kde4pathslayer.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.
+ *
+ ************************************************************************/
+
+#pragma once
+
+#include "kde4backend.hxx"
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/configuration/backend/XLayer.hpp>
+#include <com/sun/star/configuration/backend/BackendAccessException.hpp>
+#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
+#include <com/sun/star/util/XTimeStamped.hpp>
+
+#include <cppuhelper/implbase2.hxx>
+
+namespace css = com::sun::star ;
+namespace uno = css::uno ;
+namespace lang = css::lang ;
+namespace backend = css::configuration::backend ;
+namespace util = css::util ;
+
+/**
+ Implementation of the XLayer interface for the KDE values mapped into
+ the org.openoffice.Office.Paths configuration component.
+ */
+class KDEPathsLayer : public cppu::WeakImplHelper2<backend::XLayer, util::XTimeStamped>
+{
+public :
+ /**
+ Constructor given the component context
+
+ @param xContext The component context
+ */
+
+ KDEPathsLayer(const uno::Reference<uno::XComponentContext>& xContext);
+
+ // XLayer
+ virtual void SAL_CALL readData(
+ const uno::Reference<backend::XLayerHandler>& xHandler)
+ throw ( backend::MalformedDataException,
+ lang::NullPointerException,
+ lang::WrappedTargetException,
+ uno::RuntimeException) ;
+
+ // XTimeStamped
+ virtual rtl::OUString SAL_CALL getTimestamp(void)
+ throw (uno::RuntimeException);
+
+ protected:
+
+ /** Destructor */
+ ~KDEPathsLayer(void) {}
+
+ private :
+ uno::Reference<backend::XLayerContentDescriber> m_xLayerContentDescriber ;
+};
diff --git a/shell/source/backends/kde4be/kde4vcllayer.cxx b/shell/source/backends/kde4be/kde4vcllayer.cxx
new file mode 100644
index 0000000000..2705cb64e9
--- /dev/null
+++ b/shell/source/backends/kde4be/kde4vcllayer.cxx
@@ -0,0 +1,115 @@
+/*************************************************************************
+ *
+ * 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: kde4vcllayer.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.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_shell.hxx"
+
+#include "kde4vcllayer.hxx"
+
+#include <com/sun/star/configuration/backend/PropertyInfo.hpp>
+#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
+#include <com/sun/star/uno/Sequence.hxx>
+
+//==============================================================================
+
+KDEVCLLayer::KDEVCLLayer(const uno::Reference<uno::XComponentContext>& xContext)
+{
+ //Create instance of LayerContentDescriber Service
+ rtl::OUString const k_sLayerDescriberService(RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.comp.configuration.backend.LayerDescriber"));
+
+ typedef uno::Reference<backend::XLayerContentDescriber> LayerDescriber;
+ uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager();
+ if( xServiceManager.is() )
+ {
+ m_xLayerContentDescriber = LayerDescriber::query(
+ xServiceManager->createInstanceWithContext(k_sLayerDescriberService, xContext));
+ }
+ else
+ {
+ OSL_TRACE("Could not retrieve ServiceManager");
+ }
+}
+
+//------------------------------------------------------------------------------
+
+void SAL_CALL KDEVCLLayer::readData( const uno::Reference<backend::XLayerHandler>& xHandler)
+ throw ( backend::MalformedDataException, lang::NullPointerException,
+ lang::WrappedTargetException, uno::RuntimeException)
+{
+ if( ! m_xLayerContentDescriber.is() )
+ {
+ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
+ "Could not create com.sun.star.configuration.backend.LayerContentDescriber Service"
+ ) ), static_cast < backend::XLayer * > (this) );
+ }
+
+ uno::Sequence<backend::PropertyInfo> aPropInfoList(1);
+
+/*
+ Commenting out, does not make much sense without an accessibility bridge
+===========================================================================
+#if defined(QT_ACCESSIBILITY_SUPPORT)
+// Accessibility tools under Qt for UNIX are available starting with Qt 4.0
+ int nVersionMajor = 0;
+ const char *q = qVersion(); // "3.1.0" for example
+ while ('0' <= *q && *q <= '9')
+ nVersionMajor = nVersionMajor * 10 + *q++ - '0';
+ sal_Bool ATToolSupport = (sal_Bool) (nVersionMajor >= 4);
+#else
+ sal_Bool ATToolSupport = sal_False;
+#endif
+===========================================================================
+ End of commented out section
+*/ sal_Bool ATToolSupport = sal_False;
+
+ aPropInfoList[0].Name = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.VCL/Settings/Accessibility/EnableATToolSupport") );
+ aPropInfoList[0].Type = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "string" ) );
+ aPropInfoList[0].Protected = sal_False;
+ aPropInfoList[0].Value = uno::makeAny( rtl::OUString::valueOf( ATToolSupport ) );
+
+ m_xLayerContentDescriber->describeLayer(xHandler, aPropInfoList);
+}
+
+//------------------------------------------------------------------------------
+
+rtl::OUString SAL_CALL KDEVCLLayer::getTimestamp(void)
+ throw (uno::RuntimeException)
+{
+ // Return the value as timestamp to avoid regenerating the binary cache
+ // on each office launch.
+
+ ::rtl::OUString sTimeStamp(
+ RTL_CONSTASCII_USTRINGPARAM( "FALSE" ) );
+
+ return sTimeStamp;
+}
diff --git a/shell/source/backends/kde4be/kde4vcllayer.hxx b/shell/source/backends/kde4be/kde4vcllayer.hxx
new file mode 100644
index 0000000000..aeed4e668a
--- /dev/null
+++ b/shell/source/backends/kde4be/kde4vcllayer.hxx
@@ -0,0 +1,53 @@
+#pragma once
+
+#include "kde4backend.hxx"
+
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/configuration/backend/XLayer.hpp>
+#include <com/sun/star/configuration/backend/BackendAccessException.hpp>
+#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
+#include <com/sun/star/util/XTimeStamped.hpp>
+
+#include <cppuhelper/implbase2.hxx>
+
+namespace css = com::sun::star ;
+namespace uno = css::uno ;
+namespace lang = css::lang ;
+namespace backend = css::configuration::backend ;
+namespace util = css::util ;
+
+/**
+ Implementation of the XLayer interface for the KDE values mapped into
+ the org.openoffice.VCL configuration component.
+ */
+class KDEVCLLayer : public cppu::WeakImplHelper2<backend::XLayer, util::XTimeStamped>
+{
+public :
+ /**
+ Constructor given the component context
+
+ @param xContext The component context
+ */
+
+ KDEVCLLayer(const uno::Reference<uno::XComponentContext>& xContext);
+
+ // XLayer
+ virtual void SAL_CALL readData(
+ const uno::Reference<backend::XLayerHandler>& xHandler)
+ throw ( backend::MalformedDataException,
+ lang::NullPointerException,
+ lang::WrappedTargetException,
+ uno::RuntimeException) ;
+
+ // XTimeStamped
+ virtual rtl::OUString SAL_CALL getTimestamp(void)
+ throw (uno::RuntimeException);
+
+ protected:
+
+ /** Destructor */
+ ~KDEVCLLayer(void) {}
+
+ private :
+ uno::Reference<backend::XLayerContentDescriber> m_xLayerContentDescriber ;
+};
diff --git a/shell/source/backends/kde4be/makefile.mk b/shell/source/backends/kde4be/makefile.mk
new file mode 100644
index 0000000000..6f92762e5a
--- /dev/null
+++ b/shell/source/backends/kde4be/makefile.mk
@@ -0,0 +1,94 @@
+#*************************************************************************
+#
+# 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.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.
+#
+#*************************************************************************
+PRJ=..$/..$/..
+
+PRJNAME=shell
+TARGET=kde4be
+
+LIBTARGET=NO
+ENABLE_EXCEPTIONS=TRUE
+
+COMP1TYPELIST=$(TARGET)
+COMPRDB=$(SOLARBINDIR)$/types.rdb
+UNOUCROUT=$(OUT)$/inc$/$(TARGET)
+INCPRE=$(UNOUCROUT)
+
+# --- Settings ---
+
+.INCLUDE : settings.mk
+
+# For some of the included external KDE headers, GCC complains about shadowed
+# symbols in instantiated template code only at the end of a compilation unit,
+# so the only solution is to disable that warning here:
+.IF "$(COM)" == "GCC"
+CFLAGSCXX+=-Wno-shadow
+.ENDIF
+
+UNIXTEXT=$(MISC)/$(TARGET)1-ucd.txt
+
+# no "lib" prefix
+DLLPRE =
+
+.IF "$(ENABLE_KDE4)" == "TRUE"
+
+CFLAGS+=$(KDE4_CFLAGS)
+
+# --- Files ---
+
+SLOFILES=\
+ $(SLO)$/kde4backend.obj \
+ $(SLO)$/kde4commonlayer.obj \
+ $(SLO)$/kde4inetlayer.obj \
+ $(SLO)$/kde4vcllayer.obj \
+ $(SLO)$/kde4pathslayer.obj \
+ $(SLO)$/kde4becdef.obj
+
+SHL1NOCHECK=TRUE
+SHL1TARGET=$(TARGET)1.uno
+SHL1OBJS=$(SLOFILES)
+SHL1DEF=$(MISC)$/$(SHL1TARGET).def
+
+SHL1IMPLIB=i$(SHL1TARGET)
+SHL1STDLIBS= \
+ $(CPPUHELPERLIB) \
+ $(CPPULIB) \
+ $(SALLIB) \
+ $(KDE4_LIBS) -lkio
+
+SHL1VERSIONMAP=exports.map
+SHL1DEF=$(MISC)$/$(SHL1TARGET).def
+DEF1NAME=$(SHL1TARGET)
+
+.ENDIF
+
+# --- Targets ---
+
+.INCLUDE : target.mk
diff --git a/shell/source/unix/misc/makefile.mk b/shell/source/unix/misc/makefile.mk
index ba2ed56b83..8a5ee36622 100644
--- a/shell/source/unix/misc/makefile.mk
+++ b/shell/source/unix/misc/makefile.mk
@@ -72,7 +72,7 @@ APP1TARGET = gnome-open-url.bin
APP1OBJS = \
$(OBJ)$/gnome-open-url.obj
APP1LIBS =
-.IF "$(OS)"!="FREEBSD"
+.IF "$(OS)"!="FREEBSD" && "$(OS)"!="NETBSD"
APP1STDLIBS=-ldl
.ENDIF
diff --git a/shell/source/win32/shlxthandler/ooofilt/makefile.mk b/shell/source/win32/shlxthandler/ooofilt/makefile.mk
index 74ecf35ac5..22127bc8dd 100644
--- a/shell/source/win32/shlxthandler/ooofilt/makefile.mk
+++ b/shell/source/win32/shlxthandler/ooofilt/makefile.mk
@@ -36,6 +36,13 @@ LIBTARGET=NO
ENABLE_EXCEPTIONS=TRUE
USE_DEFFILE=TRUE
+# Do not use the dynamic STLport library.
+# NO_DEFAULT_STL=YES
+
+# Do not use the uwinapi library
+UWINAPILIB=
+
+
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
@@ -43,11 +50,10 @@ USE_DEFFILE=TRUE
CFLAGS+=-DISOLATION_AWARE_ENABLED -DWIN32_LEAN_AND_MEAN -DXML_UNICODE -D_NTSDK -DUNICODE -D_UNICODE -D_WIN32_WINNT=0x0501
CFLAGS+=-wd4710 -wd4711 -wd4514 -wd4619 -wd4217 -wd4820
CDEFS+=-D_WIN32_IE=0x501
+# SCPCDEFS+=-D_STLP_USE_STATIC_LIB
# --- Files --------------------------------------------------------
-#UWINAPILIB=
-
SLOFILES=$(SLO)$/ooofilt.obj\
$(SLO)$/propspec.obj
@@ -71,10 +77,12 @@ SHL1STDLIBS+=$(OLE32LIB)\
$(SHELL32LIB)\
$(KERNEL32LIB)\
$(OLDNAMESLIB)
-
+
+# $(LIBSTLPORTST)
+
SHL1LIBS+=$(SLB)$/util.lib\
$(SLB)$/ooofilereader.lib
-
+
SHL1DEPN=
SHL1OBJS=$(SLOFILES)
SHL1DEF=$(MISC)$/$(SHL1TARGET).def
diff --git a/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx b/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx
index 9d9ac04ee8..f907306e99 100644
--- a/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx
+++ b/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx
@@ -46,7 +46,7 @@
//--------------------------------------------------------------------------
#include "internal/contentreader.hxx"
#include "internal/metainforeader.hxx"
-#include "internal/utilities.hxx"
+//#include "internal/utilities.hxx"
#include "internal/registry.hxx"
#include "internal/fileextensions.hxx"
@@ -78,6 +78,8 @@
#include <ntquery.h>
#include "assert.h"
#include "ooofilt.hxx"
+#include <objidl.h>
+#include <stdio.h>
#include "propspec.hxx"
#ifdef __MINGW32__
#include <algorithm>
@@ -117,7 +119,9 @@ COooFilter::COooFilter() :
m_fEof(FALSE),
m_ChunkPosition(0),
m_cAttributes(0),
- m_pAttributes(0)
+ m_pAttributes(0),
+ m_pStream(NULL)
+
{
InterlockedIncrement( &g_lInstances );
}
@@ -172,6 +176,8 @@ SCODE STDMETHODCALLTYPE COooFilter::QueryInterface(
pUnkTemp = (IUnknown *)(IPersistFile *)this;
else if ( IID_IPersist == riid )
pUnkTemp = (IUnknown *)(IPersist *)(IPersistFile *)this;
+ else if (IID_IPersistStream == riid)
+ pUnkTemp = (IUnknown *)(IPersistStream *)this;
else if ( IID_IUnknown == riid )
pUnkTemp = (IUnknown *)(IPersist *)(IPersistFile *)this;
else
@@ -713,6 +719,101 @@ SCODE STDMETHODCALLTYPE COooFilter::SaveCompleted(LPCWSTR /*pszFileName*/)
// File is opened read-only, so "save" is always finished
return S_OK;
}
+
+//M-------------------------------------------------------------------------
+//
+// Method: COooFilter::Load (IPersistStream::Load)
+//
+// Summary: Initializes an object from the stream where it was previously saved
+//
+// Arguments: pStm
+// [in] Pointer to stream from which object should be loaded
+//
+//
+// Returns: S_OK
+// E_OUTOFMEMORY
+// E_FAIL
+//
+//
+//--------------------------------------------------------------------------
+SCODE STDMETHODCALLTYPE COooFilter::Load(IStream *pStm)
+{
+
+ // These next few lines work around the "Seek pointer" bug found on Vista.
+
+ char buf[20];
+ unsigned long count;
+ HRESULT hr;
+ ULARGE_INTEGER NewPosition;
+ LARGE_INTEGER Move;
+ Move.QuadPart = 0;
+ hr = pStm->Seek (Move, STREAM_SEEK_SET, &NewPosition);
+ hr = pStm->Read (buf, 20, &count);
+
+ zlib_filefunc_def z_filefunc;
+ fill_stream_filefunc (&z_filefunc);
+ z_filefunc.opaque = (void*)pStm;
+
+ m_pStream = pStm;
+
+ try
+ {
+ if (m_pMetaInfoReader)
+ delete m_pMetaInfoReader;
+ m_pMetaInfoReader = new CMetaInfoReader((void*)m_pStream, &z_filefunc);
+
+ if (m_pContentReader)
+ delete m_pContentReader;
+ m_pContentReader = new CContentReader((void*)m_pStream, m_pMetaInfoReader->getDefaultLocale(), &z_filefunc);
+ }
+ catch (const std::exception&)
+ {
+ return E_FAIL;
+ }
+ return S_OK;
+}
+
+//M-------------------------------------------------------------------------
+//
+// Method: COooFilter::GetSizeMax (IPersistStream::GetSizeMax)
+//
+// Summary: Returns the size in bytes of the stream neede to save the object.
+//
+// Arguments: pcbSize
+// [out] Pointer to a 64 bit unsigned int indicating the size needed
+//
+// Returns: E_NOTIMPL
+//
+//
+//--------------------------------------------------------------------------
+SCODE STDMETHODCALLTYPE COooFilter::GetSizeMax(ULARGE_INTEGER * /*pcbSize*/)
+{
+ //
+ return E_NOTIMPL;
+}
+
+//M-------------------------------------------------------------------------
+//
+// Method: COooFilter::Save (IPersistStream::Save)
+//
+// Summary: Save object to specified stream
+//
+// Arguments: pStm
+// [in] Pointer to stream
+//
+// fClearDirty
+// [in] Indicates whether to clear dirty flag
+//
+// Returns: E_NOTIMPL
+//
+//
+//--------------------------------------------------------------------------
+SCODE STDMETHODCALLTYPE COooFilter::Save(IStream * /*pStm*/, BOOL )
+{
+ //
+ return E_NOTIMPL;
+}
+
//M-------------------------------------------------------------------------
//
// Method: COooFilter::GetCurFile (IPersistFile::GetCurFile)
@@ -1142,8 +1243,18 @@ namespace /* private */
std::string ClsidEntry_Persist = CLSID_GUID_ENTRY;
SubstitutePlaceholder(ClsidEntry_Persist, GUID_PLACEHOLDER, ClsidToString(PersistentGuid));
+
if (!SetRegistryKey(HKEY_CLASSES_ROOT, ClsidEntry_Persist.c_str(), "", "OpenOffice.org Persistent Handler"))
return E_FAIL;
+
+ // Add missing entry
+ std::string ClsidEntry_Persist_Entry = CLSID_PERSIST_ENTRY;
+ SubstitutePlaceholder(ClsidEntry_Persist_Entry,
+ GUID_PLACEHOLDER,
+ ClsidToString(PersistentGuid));
+
+ if (!SetRegistryKey(HKEY_CLASSES_ROOT, ClsidEntry_Persist_Entry.c_str(), "", ClsidToString(PersistentGuid).c_str()));
+
std::string ClsidEntry_Persist_Addin = CLSID_GUID_PERSIST_ADDIN_ENTRY;
SubstitutePlaceholder(ClsidEntry_Persist_Addin,
@@ -1393,3 +1504,100 @@ STDAPI DllUnregisterServer()
*/
return S_OK;
}
+
+extern "C" {
+
+ // IStream callback
+ voidpf ZCALLBACK cb_sopen (voidpf opaque, const char* filename, int mode) {
+ return opaque;
+ }
+
+ uLong ZCALLBACK cb_sread (voidpf opaque, voidpf stream, void* buf, uLong size) {
+ unsigned long newsize;
+ HRESULT hr;
+
+ hr = ((IStream *)stream)->Read (buf, size, &newsize);
+ if (hr == S_OK){
+ return (unsigned long)newsize;
+ }
+ else {
+ return (uLong)0;
+ }
+ }
+
+ long ZCALLBACK cb_sseek (voidpf opaque, voidpf stream, uLong offset, int origin) {
+ // IStream::Seek parameters
+ HRESULT hr;
+ LARGE_INTEGER Move;
+ DWORD dwOrigin;
+ Move.QuadPart = (__int64)offset;
+
+ switch (origin) {
+ case SEEK_CUR:
+ dwOrigin = STREAM_SEEK_CUR;
+ break;
+ case SEEK_END:
+ dwOrigin = STREAM_SEEK_END;
+ break;
+ case SEEK_SET:
+ dwOrigin = STREAM_SEEK_SET;
+ break;
+ default:
+ return -1;
+ }
+
+ hr = ((IStream*)stream)->Seek (Move, dwOrigin, NULL);
+ if (hr == S_OK){
+ return 0;
+ }
+ else {
+ return -1;
+ }
+ }
+
+ long ZCALLBACK cb_stell (voidpf opaque, voidpf stream) {
+ // IStream::Seek parameters
+ HRESULT hr;
+ LARGE_INTEGER Move;
+ ULARGE_INTEGER NewPosition;
+ Move.QuadPart = 0;
+ NewPosition.QuadPart = 0;
+
+ hr = ((IStream*)stream)->Seek (Move, STREAM_SEEK_CUR, &NewPosition);
+ if (hr == S_OK){
+ return (long) NewPosition.QuadPart;
+ }
+ else {
+ return -1;
+ }
+ }
+
+ int ZCALLBACK cb_sclose (voidpf opaque, voidpf stream) {
+ return 0;
+ }
+
+ int ZCALLBACK cb_serror (voidpf opaque, voidpf stream) {
+ return 0; //RJK - for now
+ }
+
+ uLong ZCALLBACK cb_swrite (voidpf opaque, voidpf stream, const void* buf, uLong size) {
+ HRESULT hr;
+ unsigned long writecount;
+ hr = ((IStream*)stream)->Write (buf, size, &writecount);
+ if (hr == S_OK)
+ return (unsigned int)writecount;
+ else
+ return (uLong)0;
+ }
+
+ void fill_stream_filefunc (zlib_filefunc_def* pzlib_filefunc_def) {
+ pzlib_filefunc_def->zopen_file = cb_sopen;
+ pzlib_filefunc_def->zread_file = cb_sread;
+ pzlib_filefunc_def->zwrite_file = cb_swrite;
+ pzlib_filefunc_def->ztell_file = cb_stell;
+ pzlib_filefunc_def->zseek_file = cb_sseek;
+ pzlib_filefunc_def->zclose_file = cb_sclose;
+ pzlib_filefunc_def->zerror_file = cb_serror;
+ }
+}
+
diff --git a/shell/source/win32/shlxthandler/ooofilt/ooofilt.hxx b/shell/source/win32/shlxthandler/ooofilt/ooofilt.hxx
index 92df63cd26..f63a9942f5 100644
--- a/shell/source/win32/shlxthandler/ooofilt/ooofilt.hxx
+++ b/shell/source/win32/shlxthandler/ooofilt/ooofilt.hxx
@@ -96,8 +96,7 @@ enum FilterState
FilteringContent, // Filtering the content property
FilteringProperty // Filtering the pseudo property
};
-
-class COooFilter : public IFilter, public IPersistFile
+class COooFilter : public IFilter, public IPersistFile, public IPersistStream
{
public:
// From IUnknown
@@ -144,6 +143,18 @@ public:
virtual SCODE STDMETHODCALLTYPE GetCurFile(
LPWSTR * ppszFileName);
+ // From IPersistStream
+ virtual SCODE STDMETHODCALLTYPE Load(
+ IStream *pStm);
+
+ virtual SCODE STDMETHODCALLTYPE Save(
+ IStream *pStm,
+ BOOL fClearDirty);
+
+ virtual SCODE STDMETHODCALLTYPE GetSizeMax(
+ ULARGE_INTEGER *pcbSize);
+
+
private:
friend class COooFilterCF;
@@ -166,6 +177,8 @@ private:
ULONG m_ChunkPosition; // Chunk pointer to specify the current Chunk;
ULONG m_cAttributes; // Count of attributes
CFullPropSpec * m_pAttributes; // Attributes to filter
+ IStream * m_pStream;
+
};
//C-------------------------------------------------------------------------
@@ -207,6 +220,22 @@ private:
long m_lRefs; // Reference count
};
+extern "C" {
+
+ voidpf ZCALLBACK cb_sopen OF((voidpf opaque, const char * filename, int mode));
+ uLong ZCALLBACK cb_sread OF((voidpf opaque, voidpf stream, void* vuf, uLong size));
+ uLong ZCALLBACK cb_swrite OF((voidpf opaque, voidpf stream, const void* buf, uLong size));
+ long ZCALLBACK cb_stell OF((voidpf opaque, voidpf stream));
+ long ZCALLBACK cb_sseek OF((voidpf opaque, voidpf stream, uLong offset, int origin));
+ int ZCALLBACK cb_sclose OF((voidpf opaque, voidpf stream));
+ int ZCALLBACK cb_serror OF((voidpf opaque, voidpf stream));
+
+ void fill_stream_filefunc (zlib_filefunc_def* pzlib_filefunc_def);
+
+}
+
+
+
diff --git a/shell/source/win32/shlxthandler/ooofilt/proxy/ooofiltproxy.cxx b/shell/source/win32/shlxthandler/ooofilt/proxy/ooofiltproxy.cxx
index 8f61181317..b3bbe22964 100644
--- a/shell/source/win32/shlxthandler/ooofilt/proxy/ooofiltproxy.cxx
+++ b/shell/source/win32/shlxthandler/ooofilt/proxy/ooofiltproxy.cxx
@@ -147,7 +147,6 @@ extern "C" HRESULT __stdcall DllCanUnloadNow()
extern "C" HRESULT __stdcall DllRegisterServer()
{
Init();
-
if (Forward_DllRegisterServer)
return Forward_DllRegisterServer();
else
diff --git a/shell/source/win32/shlxthandler/propsheets/propsheets.cxx b/shell/source/win32/shlxthandler/propsheets/propsheets.cxx
index 7638c09690..c901c7be42 100644
--- a/shell/source/win32/shlxthandler/propsheets/propsheets.cxx
+++ b/shell/source/win32/shlxthandler/propsheets/propsheets.cxx
@@ -177,15 +177,7 @@ HRESULT STDMETHODCALLTYPE CPropertySheet::Initialize(
HRESULT STDMETHODCALLTYPE CPropertySheet::AddPages(LPFNADDPROPSHEETPAGE lpfnAddPage, LPARAM lParam)
{
- try
- {
- m_pMetaInfo = std::auto_ptr<CMetaInfoReader>(new CMetaInfoReader(m_szFileName));
- }
- catch (const std::exception&)
- {
- return E_FAIL;
- }
-
+
PROPSHEETPAGE psp;
// add the summary property page
@@ -236,7 +228,7 @@ HRESULT STDMETHODCALLTYPE CPropertySheet::AddPages(LPFNADDPROPSHEETPAGE lpfnAddP
else
DestroyPropertySheetPage(hPage);
}
-
+
// always return success else
// no property sheet will be
// displayed at all
@@ -316,15 +308,18 @@ BOOL CALLBACK CPropertySheet::PropPageStatisticsProc(HWND hwnd, UINT uiMsg, WPAR
//##################################
void CPropertySheet::InitPropPageSummary(HWND hwnd, LPPROPSHEETPAGE /*lppsp*/)
-{
- SetWindowText(GetDlgItem(hwnd,IDC_TITLE), m_pMetaInfo->getTagData( META_INFO_TITLE ).c_str() );
- SetWindowText(GetDlgItem(hwnd,IDC_AUTHOR), m_pMetaInfo->getTagData( META_INFO_AUTHOR ).c_str() );
- SetWindowText(GetDlgItem(hwnd,IDC_SUBJECT), m_pMetaInfo->getTagData( META_INFO_SUBJECT ).c_str() );
- SetWindowText(GetDlgItem(hwnd,IDC_KEYWORDS), m_pMetaInfo->getTagData( META_INFO_KEYWORDS ).c_str() );
+{
+
+ CMetaInfoReader metaInfo(m_szFileName);
+
+ SetWindowText(GetDlgItem(hwnd,IDC_TITLE), metaInfo.getTagData( META_INFO_TITLE ).c_str() );
+ SetWindowText(GetDlgItem(hwnd,IDC_AUTHOR), metaInfo.getTagData( META_INFO_AUTHOR ).c_str() );
+ SetWindowText(GetDlgItem(hwnd,IDC_SUBJECT), metaInfo.getTagData( META_INFO_SUBJECT ).c_str() );
+ SetWindowText(GetDlgItem(hwnd,IDC_KEYWORDS), metaInfo.getTagData( META_INFO_KEYWORDS ).c_str() );
// comments read from meta.xml use "\n" for return, but this will not displayable in Edit control, add
// "\r" before "\n" to form "\r\n" in order to display return in Edit control.
- std::wstring tempStr = m_pMetaInfo->getTagData( META_INFO_DESCRIPTION ).c_str();
+ std::wstring tempStr = metaInfo.getTagData( META_INFO_DESCRIPTION ).c_str();
std::wstring::size_type itor = tempStr.find ( L"\n" , 0 );
while (itor != std::wstring::npos)
{
@@ -332,14 +327,18 @@ void CPropertySheet::InitPropPageSummary(HWND hwnd, LPPROPSHEETPAGE /*lppsp*/)
itor = tempStr.find(L"\n", itor + 2);
}
SetWindowText(GetDlgItem(hwnd,IDC_COMMENTS), tempStr.c_str());
+
}
//---------------------------------
/**
*/
void CPropertySheet::InitPropPageStatistics(HWND hwnd, LPPROPSHEETPAGE /*lppsp*/)
-{
- document_statistic_reader_ptr doc_stat_reader = create_document_statistic_reader(m_szFileName, m_pMetaInfo.get());
+{
+
+ CMetaInfoReader metaInfo(m_szFileName);
+
+ document_statistic_reader_ptr doc_stat_reader = create_document_statistic_reader(m_szFileName, &metaInfo);
statistic_group_list_t sgl;
doc_stat_reader->read(&sgl);
@@ -350,6 +349,7 @@ void CPropertySheet::InitPropPageStatistics(HWND hwnd, LPPROPSHEETPAGE /*lppsp*/
GetResString(IDS_PROPERTY_VALUE));
lv_builder->build(sgl);
+
}
diff --git a/shell/source/win32/shlxthandler/util/makefile.mk b/shell/source/win32/shlxthandler/util/makefile.mk
index f5d912c4b1..c0bec9c36d 100644
--- a/shell/source/win32/shlxthandler/util/makefile.mk
+++ b/shell/source/win32/shlxthandler/util/makefile.mk
@@ -35,6 +35,7 @@ TARGET=util
#LIBTARGET=NO
ENABLE_EXCEPTIONS=TRUE
+
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
diff --git a/shell/source/win32/shlxthandler/util/utilities.cxx b/shell/source/win32/shlxthandler/util/utilities.cxx
index 7c5e0b892e..d76e0c9df7 100644
--- a/shell/source/win32/shlxthandler/util/utilities.cxx
+++ b/shell/source/win32/shlxthandler/util/utilities.cxx
@@ -586,5 +586,4 @@ LCID LocaleSetToLCID( const LocaleSet_t & Locale )
return GetSystemDefaultLCID(); //System Default Locale
return MAKELCID( MAKELANGID( usPrimaryLang, usSubLang ), SORT_DEFAULT );
-
}
diff --git a/shell/source/win32/simplemail/smplmailclient.cxx b/shell/source/win32/simplemail/smplmailclient.cxx
index cc168a75a1..ffdc8d4f5d 100644
--- a/shell/source/win32/simplemail/smplmailclient.cxx
+++ b/shell/source/win32/simplemail/smplmailclient.cxx
@@ -32,7 +32,7 @@
#include "precompiled_shell.hxx"
#include <osl/diagnose.h>
#include <osl/process.h>
-#include <osl/module.hxx>
+#include <rtl/bootstrap.hxx>
#include "smplmailclient.hxx"
#include "smplmailmsg.hxx"
#include <com/sun/star/system/SimpleMailClientFlags.hpp>
@@ -112,12 +112,10 @@ namespace /* private */
if (senddocUrl.getLength() == 0)
{
- rtl::OUString baseUrl;
- if (!osl::Module::getUrlFromAddress(reinterpret_cast<oslGenericFunction>(getSenddocUrl), baseUrl))
- return rtl::OUString();
-
- senddocUrl = baseUrl.copy(0, baseUrl.lastIndexOf('/') + 1);
- senddocUrl += rtl::OUString::createFromAscii("senddoc.exe");
+ senddocUrl = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "$OOO_BASE_DIR/program/senddoc.exe"));
+ rtl::Bootstrap::expandMacros(senddocUrl); //TODO: detect failure
}
return senddocUrl;
}
diff --git a/svx/inc/AccessibleSelectionBase.hxx b/svx/inc/AccessibleSelectionBase.hxx
index 9fb01ce1e3..f2b06e1a57 100644
--- a/svx/inc/AccessibleSelectionBase.hxx
+++ b/svx/inc/AccessibleSelectionBase.hxx
@@ -34,85 +34,9 @@
#include <comphelper/accessibleselectionhelper.hxx>
#include "svx/svxdllapi.h"
-namespace accessibility
+namespace accessibility
{
-/** @descr
- This base class provides a base implementation of the
- <type>XAccessibleSelection</type> interface.
- The following methods have to be implemented if this
- class is used:
-
- <method>implGetMutex</method>,
- <method>implGetAccessibleContext</method>,
- <method>implIsSelected</method>,
- <method>implSelect</method>,
-*/
- class SVX_DLLPUBLIC AccessibleSelectionBase : public ::comphelper::OCommonAccessibleSelection,
- public ::com::sun::star::accessibility::XAccessibleSelection
- {
- protected:
-
- virtual ::osl::Mutex& implGetMutex() = 0;
-
- public:
-
- // XAccessibleSelection - default implementations
- virtual void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL clearAccessibleSelection( ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL selectAllAccessibleChildren( ) throw (::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount( ) throw (::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL deselectAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
-
- public:
-
- AccessibleSelectionBase();
- virtual ~AccessibleSelectionBase();
- };
-
-}
-
-#endif // _SVX_ACCESSIBILITY_ACCESSIBLE_SELECTION_BASE_HXX
-/*************************************************************************
- *
- * 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: AccessibleSelectionBase.hxx,v $
- * $Revision: 1.6 $
- *
- * 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 _SVX_ACCESSIBILITY_ACCESSIBLE_SELECTION_BASE_HXX
-#define _SVX_ACCESSIBILITY_ACCESSIBLE_SELECTION_BASE_HXX
-
-#include <comphelper/accessibleselectionhelper.hxx>
-#include "svx/svxdllapi.h"
-
-namespace accessibility
-{
-/** @descr
+/** @descr
This base class provides a base implementation of the
<type>XAccessibleSelection</type> interface.
The following methods have to be implemented if this
diff --git a/svx/inc/AccessibleStaticTextBase.hxx b/svx/inc/AccessibleStaticTextBase.hxx
index bc204a3ff1..2a9fdab114 100644
--- a/svx/inc/AccessibleStaticTextBase.hxx
+++ b/svx/inc/AccessibleStaticTextBase.hxx
@@ -44,6 +44,7 @@
class SvxEditSource;
+class SvxEditViewForwarder;
namespace accessibility
{
@@ -266,6 +267,9 @@ namespace accessibility
protected:
Rectangle GetParagraphBoundingBox() const;
+ sal_Int32 GetParagraphCount() const;
+ sal_Int32 GetParagraphIndex() const;
+ sal_Int32 GetLineCount( sal_Int32 nParagraph ) const;
private:
diff --git a/svx/inc/ActionDescriptionProvider.hxx b/svx/inc/ActionDescriptionProvider.hxx
index c638e7005d..68f48ca1b2 100644
--- a/svx/inc/ActionDescriptionProvider.hxx
+++ b/svx/inc/ActionDescriptionProvider.hxx
@@ -66,71 +66,3 @@ public:
};
#endif
-/*************************************************************************
- *
- * 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: ActionDescriptionProvider.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 _SVX_ACTIONDESCRIPTIONPROVIDER_HXX
-#define _SVX_ACTIONDESCRIPTIONPROVIDER_HXX
-
-#include "svx/svxdllapi.h"
-
-// header for class OUString
-#include <rtl/ustring.hxx>
-
-//-----------------------------------------------------------------------------
-/** This class provides localized descriptions for some basic actions done with objects.
-The strings are intended to be provided to the user e.g. as description for undo actions in the menu.
-The name of the object acted on and the type of action needs to be given as input parameter.
-*/
-
-class SVX_DLLPUBLIC ActionDescriptionProvider
-{
-public:
- enum ActionType
- {
- INSERT
- , DELETE
- , CUT
- , MOVE
- , RESIZE
- , ROTATE
- , TRANSFORM
- , FORMAT
- , MOVE_TOTOP
- , MOVE_TOBOTTOM
- , POS_SIZE
- };
-
-public:
- static ::rtl::OUString createDescription( ActionType eActionType
- , const ::rtl::OUString& rObjectName );
-};
-
-#endif
diff --git a/svx/inc/EnhancedCustomShapeFunctionParser.hxx b/svx/inc/EnhancedCustomShapeFunctionParser.hxx
index 997024ff6f..cdfa4dadad 100755
--- a/svx/inc/EnhancedCustomShapeFunctionParser.hxx
+++ b/svx/inc/EnhancedCustomShapeFunctionParser.hxx
@@ -32,14 +32,14 @@
#define _ENHANCEDCUSTOMSHAPEFUNCTIONPARSER_HXX
#include <sal/config.h>
-#ifndef BOOST_SHARED_PTR_HPP_INCLUDED
#include <boost/shared_ptr.hpp>
-#endif
#include "EnhancedCustomShapeFunctionParser.hxx"
#include <com/sun/star/drawing/EnhancedCustomShapeParameter.hpp>
#include <com/sun/star/drawing/EnhancedCustomShapeParameterType.hpp>
#include <vector>
+#include <svx/svxdllapi.h>
+
struct EnhancedCustomShapeEquation
{
sal_Int32 nOperation;
@@ -97,7 +97,7 @@ enum ExpressionFunct
#define EXPRESSION_FLAG_SUMANGLE_MODE 1
-void FillEquationParameter( const com::sun::star::drawing::EnhancedCustomShapeParameter&, const sal_Int32, EnhancedCustomShapeEquation& );
+SVX_DLLPUBLIC void FillEquationParameter( const com::sun::star::drawing::EnhancedCustomShapeParameter&, const sal_Int32, EnhancedCustomShapeEquation& );
class ExpressionNode
{
@@ -200,7 +200,7 @@ public:
@return the generated function object.
*/
- static ExpressionNodeSharedPtr parseFunction( const ::rtl::OUString& rFunction, const EnhancedCustomShape2d& rCustoShape );
+ SVX_DLLPUBLIC static ExpressionNodeSharedPtr parseFunction( const ::rtl::OUString& rFunction, const EnhancedCustomShape2d& rCustoShape );
private:
// disabled constructor/destructor, since this is
diff --git a/svx/inc/accessibility.hrc b/svx/inc/accessibility.hrc
index 018f12f327..8909545e61 100644
--- a/svx/inc/accessibility.hrc
+++ b/svx/inc/accessibility.hrc
@@ -80,102 +80,6 @@
// text paragraphs and bullets
#define RID_SVXSTR_A11Y_TEXTHELPER_START (RID_SVXSTR_ACCESSIBILITY_START + 70)
-#define RID_SVXSTR_A11Y_PARAGRAPH_DESCRIPTION (RID_SVXSTR_A11Y_TEXTHELPER_START + 0)
-#define RID_SVXSTR_A11Y_PARAGRAPH_NAME (RID_SVXSTR_A11Y_TEXTHELPER_START + 1)
-#define RID_SVXSTR_A11Y_IMAGEBULLET_DESCRIPTION (RID_SVXSTR_A11Y_TEXTHELPER_START + 2)
-#define RID_SVXSTR_A11Y_IMAGEBULLET_NAME (RID_SVXSTR_A11Y_TEXTHELPER_START + 3)
-
-// SvxShowCharSetAcc
-#define RID_SVXSTR_CHARACTER_SELECTION (RID_SVXSTR_ACCESSIBILITY_START + 80)
-#define RID_SVXSTR_CHARACTER_CODE (RID_SVXSTR_ACCESSIBILITY_START + 81)
-#define RID_SVXSTR_CHAR_SEL_DESC (RID_SVXSTR_ACCESSIBILITY_START + 82)
-
-#endif
-
-/*************************************************************************
- *
- * 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: accessibility.hrc,v $
- * $Revision: 1.10 $
- *
- * 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 _SVX_ACCESSIBILITY_HRC
-#define _SVX_ACCESSIBILITY_HRC
-
-#include <svx/dialogs.hrc>
-
-#define RID_SVXSTR_A11Y_3D_MATERIAL_COLOR (RID_SVXSTR_ACCESSIBILITY_START + 1)
-#define RID_SVXSTR_A11Y_TEXT_COLOR (RID_SVXSTR_ACCESSIBILITY_START + 2)
-#define RID_SVXSTR_A11Y_BACKGROUND_COLOR (RID_SVXSTR_ACCESSIBILITY_START + 3)
-#define RID_SVXSTR_A11Y_FILLSTYLE_NONE (RID_SVXSTR_ACCESSIBILITY_START + 4)
-#define RID_SVXSTR_A11Y_FILLSTYLE_SOLID (RID_SVXSTR_ACCESSIBILITY_START + 5)
-#define RID_SVXSTR_A11Y_FILLSTYLE_HATCH (RID_SVXSTR_ACCESSIBILITY_START + 6)
-#define RID_SVXSTR_A11Y_FILLSTYLE_GRADIENT (RID_SVXSTR_ACCESSIBILITY_START + 7)
-#define RID_SVXSTR_A11Y_FILLSTYLE_BITMAP (RID_SVXSTR_ACCESSIBILITY_START + 8)
-#define RID_SVXSTR_A11Y_WITH (RID_SVXSTR_ACCESSIBILITY_START + 9)
-#define RID_SVXSTR_A11Y_STYLE (RID_SVXSTR_ACCESSIBILITY_START + 10)
-#define RID_SVXSTR_A11Y_AND (RID_SVXSTR_ACCESSIBILITY_START + 11)
-
-
-// SvxRectCtl & childs
-#define RID_SVXSTR_RECTCTL_ACC_START (RID_SVXSTR_ACCESSIBILITY_START + 20)
-#define RID_SVXSTR_RECTCTL_ACC_CORN_NAME (RID_SVXSTR_RECTCTL_ACC_START + 0)
-#define RID_SVXSTR_RECTCTL_ACC_CORN_DESCR (RID_SVXSTR_RECTCTL_ACC_START + 1)
-#define RID_SVXSTR_RECTCTL_ACC_ANGL_NAME (RID_SVXSTR_RECTCTL_ACC_START + 2)
-#define RID_SVXSTR_RECTCTL_ACC_ANGL_DESCR (RID_SVXSTR_RECTCTL_ACC_START + 3)
-
-#define RID_SVXSTR_RECTCTL_ACC_CHLD_LT (RID_SVXSTR_RECTCTL_ACC_START + 4)
-#define RID_SVXSTR_RECTCTL_ACC_CHLD_MT (RID_SVXSTR_RECTCTL_ACC_START + 5)
-#define RID_SVXSTR_RECTCTL_ACC_CHLD_RT (RID_SVXSTR_RECTCTL_ACC_START + 6)
-#define RID_SVXSTR_RECTCTL_ACC_CHLD_LM (RID_SVXSTR_RECTCTL_ACC_START + 7)
-#define RID_SVXSTR_RECTCTL_ACC_CHLD_MM (RID_SVXSTR_RECTCTL_ACC_START + 8)
-#define RID_SVXSTR_RECTCTL_ACC_CHLD_RM (RID_SVXSTR_RECTCTL_ACC_START + 9)
-#define RID_SVXSTR_RECTCTL_ACC_CHLD_LB (RID_SVXSTR_RECTCTL_ACC_START + 10)
-#define RID_SVXSTR_RECTCTL_ACC_CHLD_MB (RID_SVXSTR_RECTCTL_ACC_START + 11)
-#define RID_SVXSTR_RECTCTL_ACC_CHLD_RB (RID_SVXSTR_RECTCTL_ACC_START + 12)
-
-#define RID_SVXSTR_RECTCTL_ACC_CHLD_A000 (RID_SVXSTR_RECTCTL_ACC_START + 13)
-#define RID_SVXSTR_RECTCTL_ACC_CHLD_A045 (RID_SVXSTR_RECTCTL_ACC_START + 14)
-#define RID_SVXSTR_RECTCTL_ACC_CHLD_A090 (RID_SVXSTR_RECTCTL_ACC_START + 15)
-#define RID_SVXSTR_RECTCTL_ACC_CHLD_A135 (RID_SVXSTR_RECTCTL_ACC_START + 16)
-#define RID_SVXSTR_RECTCTL_ACC_CHLD_A180 (RID_SVXSTR_RECTCTL_ACC_START + 17)
-#define RID_SVXSTR_RECTCTL_ACC_CHLD_A225 (RID_SVXSTR_RECTCTL_ACC_START + 18)
-#define RID_SVXSTR_RECTCTL_ACC_CHLD_A270 (RID_SVXSTR_RECTCTL_ACC_START + 19)
-#define RID_SVXSTR_RECTCTL_ACC_CHLD_A315 (RID_SVXSTR_RECTCTL_ACC_START + 20)
-#define RID_SVXSTR_RECTCTL_ACC_END (RID_SVXSTR_RECTCTL_ACC_START + 21)
-
-// SvxGraphCtrlAccessibleContext
-#define RID_SVXSTR_GRAPHCTRL_ACC_START (RID_SVXSTR_RECTCTL_ACC_END)
-#define RID_SVXSTR_GRAPHCTRL_ACC_NAME (RID_SVXSTR_GRAPHCTRL_ACC_START + 0)
-#define RID_SVXSTR_GRAPHCTRL_ACC_DESCRIPTION (RID_SVXSTR_GRAPHCTRL_ACC_START + 1)
-
-// text paragraphs and bullets
-#define RID_SVXSTR_A11Y_TEXTHELPER_START (RID_SVXSTR_ACCESSIBILITY_START + 70)
-#define RID_SVXSTR_A11Y_PARAGRAPH_DESCRIPTION (RID_SVXSTR_A11Y_TEXTHELPER_START + 0)
-#define RID_SVXSTR_A11Y_PARAGRAPH_NAME (RID_SVXSTR_A11Y_TEXTHELPER_START + 1)
#define RID_SVXSTR_A11Y_IMAGEBULLET_DESCRIPTION (RID_SVXSTR_A11Y_TEXTHELPER_START + 2)
#define RID_SVXSTR_A11Y_IMAGEBULLET_NAME (RID_SVXSTR_A11Y_TEXTHELPER_START + 3)
diff --git a/svx/inc/acorrcfg.hxx b/svx/inc/acorrcfg.hxx
index 18471483e2..2c34f0ed12 100644
--- a/svx/inc/acorrcfg.hxx
+++ b/svx/inc/acorrcfg.hxx
@@ -42,16 +42,16 @@ class SvxAutoCorrCfg;
class SVX_DLLPUBLIC SvxBaseAutoCorrCfg : public utl::ConfigItem
{
SvxAutoCorrCfg& rParent;
- com::sun::star::uno::Sequence<rtl::OUString> GetPropertyNames();
+ com::sun::star::uno::Sequence<rtl::OUString> GetPropertyNames();
public:
SvxBaseAutoCorrCfg(SvxAutoCorrCfg& rParent);
~SvxBaseAutoCorrCfg();
- void Load(sal_Bool bInit);
- virtual void Commit();
- virtual void Notify( const com::sun::star::uno::Sequence<rtl::OUString>& aPropertyNames);
- void SetModified() {ConfigItem::SetModified();}
+ void Load(sal_Bool bInit);
+ virtual void Commit();
+ virtual void Notify( const com::sun::star::uno::Sequence<rtl::OUString>& aPropertyNames);
+ void SetModified() {ConfigItem::SetModified();}
};
/* -----------------------------12.10.00 11:40--------------------------------
@@ -59,16 +59,16 @@ public:
class SVX_DLLPUBLIC SvxSwAutoCorrCfg : public utl::ConfigItem
{
SvxAutoCorrCfg& rParent;
- com::sun::star::uno::Sequence<rtl::OUString> GetPropertyNames();
+ com::sun::star::uno::Sequence<rtl::OUString> GetPropertyNames();
public:
SvxSwAutoCorrCfg(SvxAutoCorrCfg& rParent);
~SvxSwAutoCorrCfg();
- void Load(sal_Bool bInit);
- virtual void Commit();
- virtual void Notify( const com::sun::star::uno::Sequence<rtl::OUString>& aPropertyNames);
- void SetModified() {ConfigItem::SetModified();}
+ void Load(sal_Bool bInit);
+ virtual void Commit();
+ virtual void Notify( const com::sun::star::uno::Sequence<rtl::OUString>& aPropertyNames);
+ void SetModified() {ConfigItem::SetModified();}
};
/*--------------------------------------------------------------------
Beschreibung: Konfiguration fuer Auto Correction
@@ -78,22 +78,22 @@ class SVX_DLLPUBLIC SvxAutoCorrCfg
friend class SvxBaseAutoCorrCfg;
friend class SvxSwAutoCorrCfg;
- SvxAutoCorrect* pAutoCorrect;
+ SvxAutoCorrect* pAutoCorrect;
- SvxBaseAutoCorrCfg aBaseConfig;
- SvxSwAutoCorrCfg aSwConfig;
+ SvxBaseAutoCorrCfg aBaseConfig;
+ SvxSwAutoCorrCfg aSwConfig;
// Flags f"ur Autotext:
- sal_Bool bFileRel;
- sal_Bool bNetRel;
+ sal_Bool bFileRel;
+ sal_Bool bNetRel;
// Tiphilfe f"ur Autotext w"ahrend der Eingabe
- sal_Bool bAutoTextTip;
- sal_Bool bAutoTextPreview;
- sal_Bool bAutoFmtByInput;
+ sal_Bool bAutoTextTip;
+ sal_Bool bAutoTextPreview;
+ sal_Bool bAutoFmtByInput;
sal_Bool bSearchInAllCategories;
public:
- void SetModified()
+ void SetModified()
{
aBaseConfig.SetModified();
aSwConfig.SetModified();
@@ -104,171 +104,33 @@ public:
aSwConfig.Commit();
}
- SvxAutoCorrect* GetAutoCorrect() { return pAutoCorrect; }
- const SvxAutoCorrect* GetAutoCorrect() const { return pAutoCorrect; }
+ SvxAutoCorrect* GetAutoCorrect() { return pAutoCorrect; }
+ const SvxAutoCorrect* GetAutoCorrect() const { return pAutoCorrect; }
// der Pointer geht in den Besitz des ConfigItems!
void SetAutoCorrect( SvxAutoCorrect* );
- sal_Bool IsAutoFmtByInput() const { return bAutoFmtByInput; }
+ sal_Bool IsAutoFmtByInput() const { return bAutoFmtByInput; }
void SetAutoFmtByInput( sal_Bool bSet ) { bAutoFmtByInput = bSet;aSwConfig.SetModified();}
- sal_Bool IsSaveRelFile() const { return bFileRel; }
- void SetSaveRelFile( sal_Bool bSet ) { bFileRel = bSet; aSwConfig.SetModified(); }
+ sal_Bool IsSaveRelFile() const { return bFileRel; }
+ void SetSaveRelFile( sal_Bool bSet ) { bFileRel = bSet; aSwConfig.SetModified(); }
- sal_Bool IsSaveRelNet() const { return bNetRel; }
- void SetSaveRelNet( sal_Bool bSet ) { bNetRel = bSet; aSwConfig.SetModified();}
+ sal_Bool IsSaveRelNet() const { return bNetRel; }
+ void SetSaveRelNet( sal_Bool bSet ) { bNetRel = bSet; aSwConfig.SetModified();}
sal_Bool IsAutoTextPreview() const {return bAutoTextPreview;}
- void SetAutoTextPreview(sal_Bool bSet) {bAutoTextPreview = bSet; aSwConfig.SetModified();}
+ void SetAutoTextPreview(sal_Bool bSet) {bAutoTextPreview = bSet; aSwConfig.SetModified();}
- sal_Bool IsAutoTextTip() const { return bAutoTextTip; }
- void SetAutoTextTip(sal_Bool bSet ) { bAutoTextTip = bSet;aSwConfig.SetModified();}
+ sal_Bool IsAutoTextTip() const { return bAutoTextTip; }
+ void SetAutoTextTip(sal_Bool bSet ) { bAutoTextTip = bSet;aSwConfig.SetModified();}
sal_Bool IsSearchInAllCategories() const { return bSearchInAllCategories;}
void SetSearchInAllCategories(sal_Bool bSet ) { bSearchInAllCategories = bSet; aSwConfig.SetModified(); }
SvxAutoCorrCfg();
virtual ~SvxAutoCorrCfg();
- static SvxAutoCorrCfg* Get();
+ static SvxAutoCorrCfg* Get();
};
#endif
-
-/*************************************************************************
- *
- * 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: acorrcfg.hxx,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.
- *
- ************************************************************************/
-#ifndef _SVXACCFG_HXX
-#define _SVXACCFG_HXX
-
-// include ---------------------------------------------------------------
-
-#include "svx/svxdllapi.h"
-#include <unotools/configitem.hxx>
-/* -----------------------------12.10.00 11:40--------------------------------
-
- ---------------------------------------------------------------------------*/
-class SvxAutoCorrect;
-class SvxAutoCorrCfg;
-class SVX_DLLPUBLIC SvxBaseAutoCorrCfg : public utl::ConfigItem
-{
- SvxAutoCorrCfg& rParent;
- com::sun::star::uno::Sequence<rtl::OUString> GetPropertyNames();
-
-public:
- SvxBaseAutoCorrCfg(SvxAutoCorrCfg& rParent);
- ~SvxBaseAutoCorrCfg();
-
- void Load(sal_Bool bInit);
- virtual void Commit();
- virtual void Notify( const com::sun::star::uno::Sequence<rtl::OUString>& aPropertyNames);
- void SetModified() {ConfigItem::SetModified();}
-};
-/* -----------------------------12.10.00 11:40--------------------------------
-
- ---------------------------------------------------------------------------*/
-class SVX_DLLPUBLIC SvxSwAutoCorrCfg : public utl::ConfigItem
-{
- SvxAutoCorrCfg& rParent;
- com::sun::star::uno::Sequence<rtl::OUString> GetPropertyNames();
-
-public:
- SvxSwAutoCorrCfg(SvxAutoCorrCfg& rParent);
- ~SvxSwAutoCorrCfg();
-
- void Load(sal_Bool bInit);
- virtual void Commit();
- virtual void Notify( const com::sun::star::uno::Sequence<rtl::OUString>& aPropertyNames);
- void SetModified() {ConfigItem::SetModified();}
-};
-/*--------------------------------------------------------------------
- Beschreibung: Konfiguration fuer Auto Correction
- --------------------------------------------------------------------*/
-class SVX_DLLPUBLIC SvxAutoCorrCfg
-{
- friend class SvxBaseAutoCorrCfg;
- friend class SvxSwAutoCorrCfg;
-
- SvxAutoCorrect* pAutoCorrect;
-
- SvxBaseAutoCorrCfg aBaseConfig;
- SvxSwAutoCorrCfg aSwConfig;
-
- // Flags f"ur Autotext:
- sal_Bool bFileRel;
- sal_Bool bNetRel;
- // Tiphilfe f"ur Autotext w"ahrend der Eingabe
- sal_Bool bAutoTextTip;
- sal_Bool bAutoTextPreview;
- sal_Bool bAutoFmtByInput;
- sal_Bool bSearchInAllCategories;
-
-public:
- void SetModified()
- {
- aBaseConfig.SetModified();
- aSwConfig.SetModified();
- }
- void Commit()
- {
- aBaseConfig.Commit();
- aSwConfig.Commit();
- }
-
- SvxAutoCorrect* GetAutoCorrect() { return pAutoCorrect; }
- const SvxAutoCorrect* GetAutoCorrect() const { return pAutoCorrect; }
- // der Pointer geht in den Besitz des ConfigItems!
- void SetAutoCorrect( SvxAutoCorrect* );
-
- sal_Bool IsAutoFmtByInput() const { return bAutoFmtByInput; }
- void SetAutoFmtByInput( sal_Bool bSet ) { bAutoFmtByInput = bSet;aSwConfig.SetModified();}
-
- sal_Bool IsSaveRelFile() const { return bFileRel; }
- void SetSaveRelFile( sal_Bool bSet ) { bFileRel = bSet; aSwConfig.SetModified(); }
-
- sal_Bool IsSaveRelNet() const { return bNetRel; }
- void SetSaveRelNet( sal_Bool bSet ) { bNetRel = bSet; aSwConfig.SetModified();}
-
- sal_Bool IsAutoTextPreview() const {return bAutoTextPreview;}
- void SetAutoTextPreview(sal_Bool bSet) {bAutoTextPreview = bSet; aSwConfig.SetModified();}
-
- sal_Bool IsAutoTextTip() const { return bAutoTextTip; }
- void SetAutoTextTip(sal_Bool bSet ) { bAutoTextTip = bSet;aSwConfig.SetModified();}
-
- sal_Bool IsSearchInAllCategories() const { return bSearchInAllCategories;}
- void SetSearchInAllCategories(sal_Bool bSet ) { bSearchInAllCategories = bSet; aSwConfig.SetModified(); }
-
- SvxAutoCorrCfg();
- virtual ~SvxAutoCorrCfg();
- static SvxAutoCorrCfg* Get();
-};
-
-
-#endif
-
diff --git a/svx/inc/anchorid.hxx b/svx/inc/anchorid.hxx
index b0cfa9b9d7..d518a7b2da 100644
--- a/svx/inc/anchorid.hxx
+++ b/svx/inc/anchorid.hxx
@@ -33,60 +33,13 @@
enum SvxAnchorIds
{
- SVX_OBJ_AT_CNTNT = 0x01, //Absatzgebundener Rahmen
- SVX_OBJ_IN_CNTNT = 0x02, //Zeichengebundener Rahmen
- SVX_OBJ_PAGE = 0x04, //Seitengebundener Rahmen
- SVX_OBJ_AT_FLY = 0x08 //Rahmengebundener Rahmen
-// SVX_OBJ_AUTO_CNTNT = 0x10 //Automatisch positionierter, absatzgebundener Rahmen
+ SVX_OBJ_AT_CNTNT = 0x01, //Absatzgebundener Rahmen
+ SVX_OBJ_IN_CNTNT = 0x02, //Zeichengebundener Rahmen
+ SVX_OBJ_PAGE = 0x04, //Seitengebundener Rahmen
+ SVX_OBJ_AT_FLY = 0x08 //Rahmengebundener Rahmen
+// SVX_OBJ_AUTO_CNTNT = 0x10 //Automatisch positionierter, absatzgebundener Rahmen
};
#endif
-
-/*************************************************************************
- *
- * 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: anchorid.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 _SVX_ANCHORID_HXX
-#define _SVX_ANCHORID_HXX
-
-
-enum SvxAnchorIds
-{
- SVX_OBJ_AT_CNTNT = 0x01, //Absatzgebundener Rahmen
- SVX_OBJ_IN_CNTNT = 0x02, //Zeichengebundener Rahmen
- SVX_OBJ_PAGE = 0x04, //Seitengebundener Rahmen
- SVX_OBJ_AT_FLY = 0x08 //Rahmengebundener Rahmen
-// SVX_OBJ_AUTO_CNTNT = 0x10 //Automatisch positionierter, absatzgebundener Rahmen
-};
-
-
-
-#endif
-
diff --git a/svx/inc/asiancfg.hxx b/svx/inc/asiancfg.hxx
index 841b8f72db..b9cc3abd31 100644
--- a/svx/inc/asiancfg.hxx
+++ b/svx/inc/asiancfg.hxx
@@ -48,99 +48,25 @@ public:
SvxAsianConfig(sal_Bool bEnableNotify = sal_True);
virtual ~SvxAsianConfig();
- void Load();
- virtual void Commit();
- virtual void Notify( const com::sun::star::uno::Sequence<rtl::OUString>& aPropertyNames);
+ void Load();
+ virtual void Commit();
+ virtual void Notify( const com::sun::star::uno::Sequence<rtl::OUString>& aPropertyNames);
- sal_Bool IsKerningWesternTextOnly() const;
- void SetKerningWesternTextOnly(sal_Bool bSet);
+ sal_Bool IsKerningWesternTextOnly() const;
+ void SetKerningWesternTextOnly(sal_Bool bSet);
- sal_Int16 GetCharDistanceCompression() const;
- void SetCharDistanceCompression(sal_Int16 nSet);
+ sal_Int16 GetCharDistanceCompression() const;
+ void SetCharDistanceCompression(sal_Int16 nSet);
com::sun::star::uno::Sequence<com::sun::star::lang::Locale>
GetStartEndCharLocales();
- sal_Bool GetStartEndChars( const com::sun::star::lang::Locale& rLocale,
+ sal_Bool GetStartEndChars( const com::sun::star::lang::Locale& rLocale,
rtl::OUString& rStartChars,
rtl::OUString& rEndChars );
- void SetStartEndChars( const com::sun::star::lang::Locale& rLocale,
+ void SetStartEndChars( const com::sun::star::lang::Locale& rLocale,
const rtl::OUString* pStartChars,
const rtl::OUString* pEndChars );
};
#endif
-
-/*************************************************************************
- *
- * 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: asiancfg.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 _SVX_ASIANCFG_HXX
-#define _SVX_ASIANCFG_HXX
-
-#include <unotools/configitem.hxx>
-#include <com/sun/star/uno/Sequence.h>
-#include "svx/svxdllapi.h"
-
-namespace com{namespace sun{namespace star{
-namespace lang{
- struct Locale;
-}}}}
-//-----------------------------------------------------------------------------
-struct SvxAsianConfig_Impl;
-class SVX_DLLPUBLIC SvxAsianConfig : public utl::ConfigItem
-{
- SvxAsianConfig_Impl* pImpl;
-
-public:
- SvxAsianConfig(sal_Bool bEnableNotify = sal_True);
- virtual ~SvxAsianConfig();
-
- void Load();
- virtual void Commit();
- virtual void Notify( const com::sun::star::uno::Sequence<rtl::OUString>& aPropertyNames);
-
- sal_Bool IsKerningWesternTextOnly() const;
- void SetKerningWesternTextOnly(sal_Bool bSet);
-
- sal_Int16 GetCharDistanceCompression() const;
- void SetCharDistanceCompression(sal_Int16 nSet);
-
- com::sun::star::uno::Sequence<com::sun::star::lang::Locale>
- GetStartEndCharLocales();
-
- sal_Bool GetStartEndChars( const com::sun::star::lang::Locale& rLocale,
- rtl::OUString& rStartChars,
- rtl::OUString& rEndChars );
- void SetStartEndChars( const com::sun::star::lang::Locale& rLocale,
- const rtl::OUString* pStartChars,
- const rtl::OUString* pEndChars );
-};
-
-#endif
-
diff --git a/svx/inc/bolnitem.hxx b/svx/inc/bolnitem.hxx
index d91ecf49c3..9a05a6910e 100644
--- a/svx/inc/bolnitem.hxx
+++ b/svx/inc/bolnitem.hxx
@@ -59,116 +59,28 @@ public:
~SvxLineItem();
SvxLineItem &operator=( const SvxLineItem& rLine );
- virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const;
- virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 );
- virtual int operator==( const SfxPoolItem& ) const;
+ virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const;
+ virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 );
+ virtual int operator==( const SfxPoolItem& ) const;
virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
SfxMapUnit eCoreMetric,
SfxMapUnit ePresMetric,
String &rText, const IntlWrapper * = 0 ) const;
- virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
- virtual SfxPoolItem* Create(SvStream &, USHORT) const;
- virtual SvStream& Store(SvStream &, USHORT nItemVersion ) const;
- virtual int ScaleMetrics( long nMult, long nDiv );
- virtual int HasMetrics() const;
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, USHORT) const;
+ virtual SvStream& Store(SvStream &, USHORT nItemVersion ) const;
+ virtual int ScaleMetrics( long nMult, long nDiv );
+ virtual int HasMetrics() const;
- const SvxBorderLine* GetLine () const { return pLine; }
- void SetLine ( const SvxBorderLine *pNew );
+ const SvxBorderLine* GetLine () const { return pLine; }
+ void SetLine ( const SvxBorderLine *pNew );
private:
- SvxBorderLine* pLine;
+ SvxBorderLine* pLine;
};
#endif
-
-/*************************************************************************
- *
- * 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: bolnitem.hxx,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.
- *
- ************************************************************************/
-#ifndef _SVX_BOLNITEM_HXX
-#define _SVX_BOLNITEM_HXX
-
-// include ---------------------------------------------------------------
-
-
-
-#include <svtools/poolitem.hxx>
-#include "svx/svxdllapi.h"
-
-
-
-// class SvxLineItem -----------------------------------------------------
-
-
-/*
-[Beschreibung]
-Dieses Item transportiert eine SvxBorderLine.
-*/
-
-class SvxBorderLine;
-
-class SVX_DLLPUBLIC SvxLineItem : public SfxPoolItem
-{
-public:
- TYPEINFO();
-
- SvxLineItem( const USHORT nId );
- SvxLineItem( const SvxLineItem& rCpy );
- ~SvxLineItem();
- SvxLineItem &operator=( const SvxLineItem& rLine );
-
- virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const;
- virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 );
- virtual int operator==( const SfxPoolItem& ) const;
- virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
- SfxMapUnit eCoreMetric,
- SfxMapUnit ePresMetric,
- String &rText, const IntlWrapper * = 0 ) const;
-
- virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
- virtual SfxPoolItem* Create(SvStream &, USHORT) const;
- virtual SvStream& Store(SvStream &, USHORT nItemVersion ) const;
- virtual int ScaleMetrics( long nMult, long nDiv );
- virtual int HasMetrics() const;
-
- const SvxBorderLine* GetLine () const { return pLine; }
- void SetLine ( const SvxBorderLine *pNew );
-
-private:
- SvxBorderLine* pLine;
-};
-
-
-
-
-#endif
-
diff --git a/svx/inc/bulitem.hxx b/svx/inc/bulitem.hxx
index 91faf19d88..4f2b665408 100644
--- a/svx/inc/bulitem.hxx
+++ b/svx/inc/bulitem.hxx
@@ -38,34 +38,34 @@
// define ----------------------------------------------------------------
// Styles
-#define BS_ABC_BIG 0
-#define BS_ABC_SMALL 1
-#define BS_ROMAN_BIG 2
-#define BS_ROMAN_SMALL 3
-#define BS_123 4
-#define BS_NONE 5
-#define BS_BULLET 6
-#define BS_BMP 128
+#define BS_ABC_BIG 0
+#define BS_ABC_SMALL 1
+#define BS_ROMAN_BIG 2
+#define BS_ROMAN_SMALL 3
+#define BS_123 4
+#define BS_NONE 5
+#define BS_BULLET 6
+#define BS_BMP 128
// Justification
-#define BJ_HLEFT 0x01
-#define BJ_HRIGHT 0x02
-#define BJ_HCENTER 0x04
-#define BJ_VTOP 0x08
-#define BJ_VBOTTOM 0x10
-#define BJ_VCENTER 0x20
+#define BJ_HLEFT 0x01
+#define BJ_HRIGHT 0x02
+#define BJ_HCENTER 0x04
+#define BJ_VTOP 0x08
+#define BJ_VBOTTOM 0x10
+#define BJ_VCENTER 0x20
// Valid-Bits
// Erstmal nur die Werte, die vom Dialog geaendert werden...
-#define VALID_FONTCOLOR 0x0001
-#define VALID_FONTNAME 0x0002
-#define VALID_SYMBOL 0x0004
-#define VALID_BITMAP 0x0008
-#define VALID_SCALE 0x0010
-#define VALID_START 0x0020
-#define VALID_STYLE 0x0040
-#define VALID_PREVTEXT 0x0080
-#define VALID_FOLLOWTEXT 0x0100
+#define VALID_FONTCOLOR 0x0001
+#define VALID_FONTNAME 0x0002
+#define VALID_SYMBOL 0x0004
+#define VALID_BITMAP 0x0008
+#define VALID_SCALE 0x0010
+#define VALID_START 0x0020
+#define VALID_STYLE 0x0040
+#define VALID_PREVTEXT 0x0080
+#define VALID_FOLLOWTEXT 0x0100
#include <svtools/poolitem.hxx>
#include <vcl/font.hxx>
#include <goodies/grfmgr.hxx>
@@ -74,21 +74,21 @@
class SVX_DLLPUBLIC SvxBulletItem : public SfxPoolItem
{
- Font aFont;
+ Font aFont;
GraphicObject* pGraphicObject;
- String aPrevText;
- String aFollowText;
- USHORT nStart;
- USHORT nStyle;
- long nWidth;
- USHORT nScale;
- sal_Unicode cSymbol;
- BYTE nJustify;
- USHORT nValidMask; // Nur temporaer fuer GetAttribs/SetAttribs, wegen des grossen Bullets
+ String aPrevText;
+ String aFollowText;
+ USHORT nStart;
+ USHORT nStyle;
+ long nWidth;
+ USHORT nScale;
+ sal_Unicode cSymbol;
+ BYTE nJustify;
+ USHORT nValidMask; // Nur temporaer fuer GetAttribs/SetAttribs, wegen des grossen Bullets
#ifdef _SVX_BULITEM_CXX
- void SetDefaultFont_Impl();
- void SetDefaults_Impl();
+ void SetDefaultFont_Impl();
+ void SetDefaults_Impl();
#endif
public:
@@ -107,222 +107,57 @@ public:
virtual SfxPoolItem* Create( SvStream&, USHORT nVersion ) const;
virtual SvStream& Store( SvStream & , USHORT nItemVersion ) const;
- String GetFullText() const;
- sal_Unicode GetSymbol() const { return cSymbol; }
- String GetPrevText() const { return aPrevText; }
- String GetFollowText() const { return aFollowText; }
+ String GetFullText() const;
+ sal_Unicode GetSymbol() const { return cSymbol; }
+ String GetPrevText() const { return aPrevText; }
+ String GetFollowText() const { return aFollowText; }
- USHORT GetStart() const { return nStart; }
- long GetWidth() const { return nWidth; }
- USHORT GetStyle() const { return nStyle; }
- BYTE GetJustification() const { return nJustify; }
- Font GetFont() const { return aFont; }
- USHORT GetScale() const { return nScale; }
-
- Bitmap GetBitmap() const;
- void SetBitmap( const Bitmap& rBmp );
+ USHORT GetStart() const { return nStart; }
+ long GetWidth() const { return nWidth; }
+ USHORT GetStyle() const { return nStyle; }
+ BYTE GetJustification() const { return nJustify; }
+ Font GetFont() const { return aFont; }
+ USHORT GetScale() const { return nScale; }
- const GraphicObject& GetGraphicObject() const;
- void SetGraphicObject( const GraphicObject& rGraphicObject );
-
- void SetSymbol( sal_Unicode c) { cSymbol = c; }
- void SetPrevText( const String& rStr) { aPrevText = rStr;}
- void SetFollowText(const String& rStr) { aFollowText=rStr;}
-
- void SetStart( USHORT nNew ) { nStart = nNew; }
- void SetWidth( long nNew ) { nWidth = nNew; }
- void SetStyle( USHORT nNew ) { nStyle = nNew; }
- void SetJustification( BYTE nNew ) { nJustify = nNew; }
- void SetFont( const Font& rNew) { aFont = rNew; }
- void SetScale( USHORT nNew ) { nScale = nNew; }
-
- virtual USHORT GetVersion(USHORT nFileVersion) const;
- virtual int operator==( const SfxPoolItem& ) const;
- virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
- SfxMapUnit eCoreMetric,
- SfxMapUnit ePresMetric,
- String &rText, const IntlWrapper * = 0 ) const;
-
- static void StoreFont( SvStream&, const Font& );
- static Font CreateFont( SvStream&, USHORT nVer );
-
- USHORT& GetValidMask() { return nValidMask; }
- USHORT GetValidMask() const { return nValidMask; }
- USHORT IsValid( USHORT nFlag ) const { return nValidMask & nFlag; }
- void SetValid( USHORT nFlag, BOOL bValid )
- {
- if ( bValid )
- nValidMask |= nFlag;
- else
- nValidMask &= ~nFlag;
- }
- void CopyValidProperties( const SvxBulletItem& rCopyFrom );
-};
-
-
-#endif
-
-/*************************************************************************
- *
- * 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: bulitem.hxx,v $
- * $Revision: 1.6 $
- *
- * 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 _SVX_BULITEM_HXX
-#define _SVX_BULITEM_HXX
-
-// include ---------------------------------------------------------------
-
-#include "svx/svxdllapi.h"
-
-
-// define ----------------------------------------------------------------
-
-// Styles
-#define BS_ABC_BIG 0
-#define BS_ABC_SMALL 1
-#define BS_ROMAN_BIG 2
-#define BS_ROMAN_SMALL 3
-#define BS_123 4
-#define BS_NONE 5
-#define BS_BULLET 6
-#define BS_BMP 128
-
-// Justification
-#define BJ_HLEFT 0x01
-#define BJ_HRIGHT 0x02
-#define BJ_HCENTER 0x04
-#define BJ_VTOP 0x08
-#define BJ_VBOTTOM 0x10
-#define BJ_VCENTER 0x20
-
-// Valid-Bits
-// Erstmal nur die Werte, die vom Dialog geaendert werden...
-#define VALID_FONTCOLOR 0x0001
-#define VALID_FONTNAME 0x0002
-#define VALID_SYMBOL 0x0004
-#define VALID_BITMAP 0x0008
-#define VALID_SCALE 0x0010
-#define VALID_START 0x0020
-#define VALID_STYLE 0x0040
-#define VALID_PREVTEXT 0x0080
-#define VALID_FOLLOWTEXT 0x0100
-#include <svtools/poolitem.hxx>
-#include <vcl/font.hxx>
-#include <goodies/grfmgr.hxx>
-
-// class SvxBulletItem ---------------------------------------------------
-
-class SVX_DLLPUBLIC SvxBulletItem : public SfxPoolItem
-{
- Font aFont;
- GraphicObject* pGraphicObject;
- String aPrevText;
- String aFollowText;
- USHORT nStart;
- USHORT nStyle;
- long nWidth;
- USHORT nScale;
- sal_Unicode cSymbol;
- BYTE nJustify;
- USHORT nValidMask; // Nur temporaer fuer GetAttribs/SetAttribs, wegen des grossen Bullets
-
-#ifdef _SVX_BULITEM_CXX
- void SetDefaultFont_Impl();
- void SetDefaults_Impl();
-#endif
-
-public:
- TYPEINFO();
-
- SvxBulletItem( USHORT nWhich = 0 );
- SvxBulletItem( BYTE nStyle, const Font& rFont, USHORT nStart = 0, USHORT nWhich = 0 );
- SvxBulletItem( const Font& rFont, sal_Unicode cSymbol, USHORT nWhich=0 );
- SvxBulletItem( const Bitmap&, USHORT nWhich = 0 );
- SvxBulletItem( const GraphicObject&, USHORT nWhich = 0 );
- SvxBulletItem( SvStream& rStrm, USHORT nWhich = 0 );
- SvxBulletItem( const SvxBulletItem& );
- ~SvxBulletItem();
-
- virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
- virtual SfxPoolItem* Create( SvStream&, USHORT nVersion ) const;
- virtual SvStream& Store( SvStream & , USHORT nItemVersion ) const;
-
- String GetFullText() const;
- sal_Unicode GetSymbol() const { return cSymbol; }
- String GetPrevText() const { return aPrevText; }
- String GetFollowText() const { return aFollowText; }
-
- USHORT GetStart() const { return nStart; }
- long GetWidth() const { return nWidth; }
- USHORT GetStyle() const { return nStyle; }
- BYTE GetJustification() const { return nJustify; }
- Font GetFont() const { return aFont; }
- USHORT GetScale() const { return nScale; }
-
- Bitmap GetBitmap() const;
- void SetBitmap( const Bitmap& rBmp );
+ Bitmap GetBitmap() const;
+ void SetBitmap( const Bitmap& rBmp );
const GraphicObject& GetGraphicObject() const;
- void SetGraphicObject( const GraphicObject& rGraphicObject );
+ void SetGraphicObject( const GraphicObject& rGraphicObject );
- void SetSymbol( sal_Unicode c) { cSymbol = c; }
- void SetPrevText( const String& rStr) { aPrevText = rStr;}
- void SetFollowText(const String& rStr) { aFollowText=rStr;}
+ void SetSymbol( sal_Unicode c) { cSymbol = c; }
+ void SetPrevText( const String& rStr) { aPrevText = rStr;}
+ void SetFollowText(const String& rStr) { aFollowText=rStr;}
- void SetStart( USHORT nNew ) { nStart = nNew; }
- void SetWidth( long nNew ) { nWidth = nNew; }
- void SetStyle( USHORT nNew ) { nStyle = nNew; }
- void SetJustification( BYTE nNew ) { nJustify = nNew; }
- void SetFont( const Font& rNew) { aFont = rNew; }
- void SetScale( USHORT nNew ) { nScale = nNew; }
+ void SetStart( USHORT nNew ) { nStart = nNew; }
+ void SetWidth( long nNew ) { nWidth = nNew; }
+ void SetStyle( USHORT nNew ) { nStyle = nNew; }
+ void SetJustification( BYTE nNew ) { nJustify = nNew; }
+ void SetFont( const Font& rNew) { aFont = rNew; }
+ void SetScale( USHORT nNew ) { nScale = nNew; }
- virtual USHORT GetVersion(USHORT nFileVersion) const;
- virtual int operator==( const SfxPoolItem& ) const;
+ virtual USHORT GetVersion(USHORT nFileVersion) const;
+ virtual int operator==( const SfxPoolItem& ) const;
virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
SfxMapUnit eCoreMetric,
SfxMapUnit ePresMetric,
String &rText, const IntlWrapper * = 0 ) const;
- static void StoreFont( SvStream&, const Font& );
- static Font CreateFont( SvStream&, USHORT nVer );
+ static void StoreFont( SvStream&, const Font& );
+ static Font CreateFont( SvStream&, USHORT nVer );
- USHORT& GetValidMask() { return nValidMask; }
- USHORT GetValidMask() const { return nValidMask; }
- USHORT IsValid( USHORT nFlag ) const { return nValidMask & nFlag; }
- void SetValid( USHORT nFlag, BOOL bValid )
+ USHORT& GetValidMask() { return nValidMask; }
+ USHORT GetValidMask() const { return nValidMask; }
+ USHORT IsValid( USHORT nFlag ) const { return nValidMask & nFlag; }
+ void SetValid( USHORT nFlag, BOOL bValid )
{
if ( bValid )
nValidMask |= nFlag;
else
nValidMask &= ~nFlag;
}
- void CopyValidProperties( const SvxBulletItem& rCopyFrom );
+ void CopyValidProperties( const SvxBulletItem& rCopyFrom );
};
#endif
-
diff --git a/svx/inc/charhiddenitem.hxx b/svx/inc/charhiddenitem.hxx
index c092990440..1cff33a509 100644
--- a/svx/inc/charhiddenitem.hxx
+++ b/svx/inc/charhiddenitem.hxx
@@ -62,71 +62,3 @@ public:
};
#endif
-
-
-/*************************************************************************
- *
- * 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: charhiddenitem.hxx,v $
- * $Revision: 1.6 $
- *
- * 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 _SVX_CHARHIDDENITEM_HXX
-#define _SVX_CHARHIDDENITEM_HXX
-
-// include ---------------------------------------------------------------
-
-#include <svtools/poolitem.hxx>
-#include <svtools/eitem.hxx>
-#include "svx/svxdllapi.h"
-
-// class SvxCharHiddenItem -------------------------------------------------
-/*
- [Description]
- This item marks text as hidden
-*/
-
-class SVX_DLLPUBLIC SvxCharHiddenItem : public SfxBoolItem
-{
-public:
- TYPEINFO();
-
- SvxCharHiddenItem( const BOOL bHidden /*= FALSE*/, const USHORT nId );
-
- virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
- virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
- SfxMapUnit eCoreMetric,
- SfxMapUnit ePresMetric,
- String &rText, const IntlWrapper * = 0 ) const;
-
- inline SvxCharHiddenItem& operator=(const SvxCharHiddenItem& rHidden) {
- SetValue(rHidden.GetValue());
- return *this;
- }
-};
-
-#endif
-
-
diff --git a/svx/inc/edtspell.hxx b/svx/inc/edtspell.hxx
index f7b642cb05..f2d0717e39 100644
--- a/svx/inc/edtspell.hxx
+++ b/svx/inc/edtspell.hxx
@@ -133,6 +133,9 @@ public:
void MarkWrongsInvalid();
WrongList* Clone() const;
+
+ // #i102062#
+ bool operator==(const WrongList& rCompare) const;
};
inline void WrongList::InsertWrong( const WrongRange& rWrong, USHORT nPos )
diff --git a/svx/inc/fontitem.hxx b/svx/inc/fontitem.hxx
index 7b15547daa..82efbf7dbe 100644
--- a/svx/inc/fontitem.hxx
+++ b/svx/inc/fontitem.hxx
@@ -111,7 +111,7 @@ public:
return *this;
}
- static void EnableStoreUnicodeNames( BOOL bEnable ) { bEnableStoreUnicodeNames = bEnable; }
+ static void EnableStoreUnicodeNames( BOOL bEnable );
};
diff --git a/svx/inc/gallery1.hxx b/svx/inc/gallery1.hxx
index 68f3a27a1e..6c508c2311 100644
--- a/svx/inc/gallery1.hxx
+++ b/svx/inc/gallery1.hxx
@@ -144,7 +144,7 @@ private:
void ImplLoadImports();
void ImplWriteImportList();
- GalleryThemeEntry* ImplGetThemeEntry( const String& rThemeName );
+ SVX_DLLPUBLIC GalleryThemeEntry* ImplGetThemeEntry( const String& rThemeName );
GalleryThemeEntry* ImplGetThemeEntry( ULONG nThemeId );
GalleryImportThemeEntry* ImplGetImportThemeEntry( const String& rImportName );
@@ -168,7 +168,7 @@ public:
SVX_DLLPUBLIC BOOL CreateTheme( const String& rThemeName, UINT32 nNumFrom = 0 );
BOOL CreateImportTheme( const INetURLObject& rURL, const String& rFileName );
BOOL RenameTheme( const String& rOldName, const String& rNewName );
- BOOL RemoveTheme( const String& rThemeName );
+ SVX_DLLPUBLIC BOOL RemoveTheme( const String& rThemeName );
SVX_DLLPUBLIC GalleryTheme* AcquireTheme( const String& rThemeName, SfxListener& rListener );
SVX_DLLPUBLIC void ReleaseTheme( GalleryTheme* pTheme, SfxListener& rListener );
diff --git a/svx/inc/galobj.hxx b/svx/inc/galobj.hxx
index b65e1c0a80..f01a9f0da8 100644
--- a/svx/inc/galobj.hxx
+++ b/svx/inc/galobj.hxx
@@ -122,8 +122,8 @@ public:
BOOL IsValid() const { return bIsValid; }
BOOL IsThumbBitmap() const { return bIsThumbBmp; }
- const String GetTitle() const;
- void SetTitle( const String& rTitle );
+ SVX_DLLPUBLIC const String GetTitle() const;
+ SVX_DLLPUBLIC void SetTitle( const String& rTitle );
friend SvStream& operator<<( SvStream& rOut, const SgaObject& rObj );
friend SvStream& operator>>( SvStream& rIn, SgaObject& rObj );
diff --git a/svx/inc/galtheme.hxx b/svx/inc/galtheme.hxx
index 0deef6233c..2ff2d26d60 100644
--- a/svx/inc/galtheme.hxx
+++ b/svx/inc/galtheme.hxx
@@ -107,12 +107,12 @@ private:
BOOL bAbortActualize;
void ImplCreateSvDrawStorage();
- SgaObject* ImplReadSgaObject( GalleryObject* pEntry );
+ SVX_DLLPUBLIC SgaObject* ImplReadSgaObject( GalleryObject* pEntry );
BOOL ImplWriteSgaObject( const SgaObject& rObj, ULONG nPos, GalleryObject* pExistentEntry );
void ImplRead();
void ImplWrite();
const GalleryObject* ImplGetGalleryObject( ULONG nPos ) const { return aObjectList.GetObject( nPos ); }
- const GalleryObject* ImplGetGalleryObject( const INetURLObject& rURL );
+ SVX_DLLPUBLIC const GalleryObject* ImplGetGalleryObject( const INetURLObject& rURL );
ULONG ImplGetGalleryObjectPos( const GalleryObject* pObj ) const { return aObjectList.GetPos( pObj ); }
INetURLObject ImplGetURL( const GalleryObject* pObject ) const;
INetURLObject ImplCreateUniqueURL( SgaObjKind eObjKind, ULONG nFormat = CVT_UNKNOWN );
@@ -129,11 +129,11 @@ public:
ULONG GetObjectCount() const { return aObjectList.Count(); }
- SgaObject* AcquireObject( ULONG nPos );
- void ReleaseObject( SgaObject* pObj );
+ SVX_DLLPUBLIC SgaObject* AcquireObject( ULONG nPos );
+ SVX_DLLPUBLIC void ReleaseObject( SgaObject* pObj );
- BOOL InsertObject( const SgaObject& rObj, ULONG nPos = LIST_APPEND );
- BOOL RemoveObject( ULONG nPos );
+ SVX_DLLPUBLIC BOOL InsertObject( const SgaObject& rObj, ULONG nPos = LIST_APPEND );
+ SVX_DLLPUBLIC BOOL RemoveObject( ULONG nPos );
BOOL ChangeObjectPos( ULONG nOldPos, ULONG nNewPos );
const String& GetName() const { return IsImported() ? aImportName : pThm->GetThemeName(); }
@@ -194,11 +194,11 @@ public:
BOOL GetThumb( ULONG nPos, Bitmap& rBmp, BOOL bProgress = FALSE );
- BOOL GetGraphic( ULONG nPos, Graphic& rGraphic, BOOL bProgress = FALSE );
- BOOL InsertGraphic( const Graphic& rGraphic, ULONG nInsertPos = LIST_APPEND );
+ SVX_DLLPUBLIC BOOL GetGraphic( ULONG nPos, Graphic& rGraphic, BOOL bProgress = FALSE );
+ SVX_DLLPUBLIC BOOL InsertGraphic( const Graphic& rGraphic, ULONG nInsertPos = LIST_APPEND );
- BOOL GetModel( ULONG nPos, SdrModel& rModel, BOOL bProgress = FALSE );
- BOOL InsertModel( const FmFormModel& rModel, ULONG nInsertPos = LIST_APPEND );
+ SVX_DLLPUBLIC BOOL GetModel( ULONG nPos, SdrModel& rModel, BOOL bProgress = FALSE );
+ SVX_DLLPUBLIC BOOL InsertModel( const FmFormModel& rModel, ULONG nInsertPos = LIST_APPEND );
BOOL GetModelStream( ULONG nPos, SotStorageStreamRef& rModelStreamRef, BOOL bProgress = FALSE );
BOOL InsertModelStream( const SotStorageStreamRef& rModelStream, ULONG nInsertPos = LIST_APPEND );
diff --git a/svx/inc/mscodec.hxx b/svx/inc/mscodec.hxx
index 66dcf5d3a6..b80a778f1c 100644
--- a/svx/inc/mscodec.hxx
+++ b/svx/inc/mscodec.hxx
@@ -235,6 +235,36 @@ public:
*/
bool InitCipher( sal_uInt32 nCounter );
+ /** Creates an MD5 digest of salt digest. */
+ bool CreateSaltDigest(
+ const sal_uInt8 nSaltData[16], sal_uInt8 nSaltDigest[16] );
+
+ /** Encodes a block of memory.
+
+ @see rtl_cipher_encode()
+
+ @precond
+ The codec must be initialized with InitKey() before this function
+ can be used. The destination buffer must be able to take all
+ unencoded data from the source buffer (usually this means it must be
+ as long as or longer than the source buffer).
+
+ @param pData
+ Unencrypted source data block.
+ @param nDatLen
+ Size of the passed source data block.
+ @param pBuffer
+ Destination buffer for the encrypted data.
+ @param nBufLen
+ Size of the destination buffer.
+
+ @return
+ true = Encoding was successful (no error occured).
+ */
+ bool Encode(
+ const void* pData, sal_Size nDatLen,
+ sal_uInt8* pBuffer, sal_Size nBufLen );
+
/** Decodes a block of memory.
@see rtl_cipher_decode()
@@ -275,6 +305,27 @@ public:
*/
bool Skip( sal_Size nDatLen );
+ /** Gets salt data and salt digest.
+
+ @precond
+ The codec must be initialized with InitKey() before this function
+ can be used.
+
+ @param pSalt
+ Salt, a random number.
+ @param pSaltData
+ Salt data block generated from the salt.
+ @param pSaltDigest
+ Salt digest generated from the salt.
+ */
+ void GetEncryptKey (
+ const sal_uInt8 pSalt[16],
+ sal_uInt8 pSaltData[16],
+ sal_uInt8 pSaltDigest[16]);
+
+private:
+ void GetDigestFromSalt( const sal_uInt8 pSaltData[16], sal_uInt8 pDigest[16] );
+
private:
SVX_DLLPRIVATE MSCodec_Std97( const MSCodec_Std97& );
SVX_DLLPRIVATE MSCodec_Std97& operator=( const MSCodec_Std97& );
diff --git a/svx/inc/optgenrl.hrc b/svx/inc/optgenrl.hrc
index 815649479b..a0d06878a9 100644
--- a/svx/inc/optgenrl.hrc
+++ b/svx/inc/optgenrl.hrc
@@ -74,7 +74,7 @@
#define LINEH 12
#define FLINEH 8
#define LEFT 12
-#define MID 96
+#define MID 100
#define RIGHT 248
#define TOP 10
#define LINE(y) (14+y*15)
diff --git a/svx/inc/svdglob.hxx b/svx/inc/svdglob.hxx
index 8bdca80dcd..46029ac3a0 100644
--- a/svx/inc/svdglob.hxx
+++ b/svx/inc/svdglob.hxx
@@ -33,11 +33,11 @@
#include <tools/contnr.hxx>
-#ifndef _RESID_HXX //autogen
#include <tools/resid.hxx>
-#endif
#include <tools/string.hxx>
+#include <svx/svxdllapi.h>
+
//************************************************************
// Vorausdeklarationen
//************************************************************
@@ -64,7 +64,7 @@ public:
// IDs von SDR_StringCacheBegin (256) bis
// SDR_StringCacheEnd (weiss ich grad' nicht).
// Hierzu siehe auch SvdStr.Hrc
-String ImpGetResStr(sal_uInt16 nResID);
+SVX_DLLPUBLIC String ImpGetResStr(sal_uInt16 nResID);
////////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/svx/inc/svdstr.hrc b/svx/inc/svdstr.hrc
index 68a1eec5ee..8bf727b7f1 100644
--- a/svx/inc/svdstr.hrc
+++ b/svx/inc/svdstr.hrc
@@ -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
@@ -324,7 +324,13 @@
#define STR_UndoNewLayer (STR_UndoBegin +13)
#define STR_UndoDelLayer (STR_UndoBegin +14)
#define STR_UndoMovLayer (STR_UndoBegin +15)
-#define STR_UndoEnd (STR_UndoMovLayer)
+
+// --> OD 2009-07-09 #i73249#
+#define STR_UndoObjName (STR_UndoBegin +16)
+#define STR_UndoObjTitle (STR_UndoBegin +17)
+#define STR_UndoObjDescription (STR_UndoBegin +18)
+// <--
+#define STR_UndoEnd (STR_UndoObjDescription)
#define STR_LayerBegin (STR_UndoEnd+1)
diff --git a/svx/inc/svx/AccessibleContextBase.hxx b/svx/inc/svx/AccessibleContextBase.hxx
index 6177164b93..552942f7bc 100644
--- a/svx/inc/svx/AccessibleContextBase.hxx
+++ b/svx/inc/svx/AccessibleContextBase.hxx
@@ -1,37 +1,5 @@
/*************************************************************************
*
-<<<<<<< AccessibleContextBase.hxx
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: AccessibleContextBase.hxx,v $
- *
- * $Revision: 1.4 $
- *
- * last change: $Author: rt $ $Date: 2008-07-07 14:27:26 $
- *
- * 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
-=======
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2008 by Sun Microsystems, Inc.
@@ -57,7 +25,6 @@
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
->>>>>>> 1.3
*
************************************************************************/
diff --git a/svx/inc/svx/AccessibleControlShape.hxx b/svx/inc/svx/AccessibleControlShape.hxx
index cf76e64ed4..93e6c89e82 100644
--- a/svx/inc/svx/AccessibleControlShape.hxx
+++ b/svx/inc/svx/AccessibleControlShape.hxx
@@ -31,13 +31,9 @@
#ifndef _SVX_ACCESSIBILITY_ACCESSIBLE_CONTROL_SHAPE_HXX
#define _SVX_ACCESSIBILITY_ACCESSIBLE_CONTROL_SHAPE_HXX
-#ifndef _SVX_ACCESSIBILITY_ACCESSIBLE_SHAPE_MANAGER_HXX
#include <svx/AccessibleShape.hxx>
-#endif
-#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLE_ACTION_HPP_
#include <com/sun/star/accessibility/XAccessibleAction.hpp>
-#endif
#include <com/sun/star/accessibility/XAccessibleEventListener.hpp>
#include <com/sun/star/util/XModeChangeBroadcaster.hpp>
#include <com/sun/star/container/XContainerListener.hpp>
diff --git a/svx/inc/svx/AccessibleShape.hxx b/svx/inc/svx/AccessibleShape.hxx
index 33c173f1f4..b176c7c942 100755
--- a/svx/inc/svx/AccessibleShape.hxx
+++ b/svx/inc/svx/AccessibleShape.hxx
@@ -1,37 +1,5 @@
/*************************************************************************
*
-<<<<<<< AccessibleShape.hxx
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: AccessibleShape.hxx,v $
- *
- * $Revision: 1.4 $
- *
- * last change: $Author: rt $ $Date: 2008-07-07 14:28: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
-=======
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2008 by Sun Microsystems, Inc.
@@ -57,7 +25,6 @@
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
->>>>>>> 1.3
*
************************************************************************/
diff --git a/svx/inc/svx/dialogs.hrc b/svx/inc/svx/dialogs.hrc
index aa8c6674d5..de1fd8e671 100644
--- a/svx/inc/svx/dialogs.hrc
+++ b/svx/inc/svx/dialogs.hrc
@@ -251,8 +251,10 @@
// ResId fuer FontSubstitution
#define RID_SVX_FONT_SUBSTITUTION (RID_SVX_START + 18)
+// insert row&col dialog
+#define DLG_INS_ROW_COL (RID_SVX_START + 156)
+
//InetDlg
-//#define RID_SVXDLG_INTERNET (RID_SVX_START + 156)
#define RID_SVXPAGE_INET_MAIL (RID_SVX_START + 155)
#define RID_SVXPAGE_INET_PROXY (RID_SVX_START + 157)
#define RID_SVXPAGE_INET_CACHE (RID_SVX_START + 158)
diff --git a/svx/inc/svx/editeng.hxx b/svx/inc/svx/editeng.hxx
index 7f7cfea42b..d117950382 100644
--- a/svx/inc/svx/editeng.hxx
+++ b/svx/inc/svx/editeng.hxx
@@ -219,6 +219,8 @@ public:
USHORT GetLineCount( USHORT nParagraph ) const;
xub_StrLen GetLineLen( USHORT nParagraph, USHORT nLine ) const;
+ void GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT nParagraph, USHORT nLine ) const;
+ USHORT GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const;
sal_uInt32 GetLineHeight( USHORT nParagraph, USHORT nLine = 0 );
USHORT GetFirstLineOffset( USHORT nParagraph );
ParagraphInfos GetParagraphInfos( USHORT nPara );
diff --git a/svx/inc/svx/editobj.hxx b/svx/inc/svx/editobj.hxx
index 42ca4c6093..90a13b7114 100644
--- a/svx/inc/svx/editobj.hxx
+++ b/svx/inc/svx/editobj.hxx
@@ -121,6 +121,9 @@ public:
virtual void ChangeStyleSheetName( SfxStyleFamily eFamily, const XubString& rOldName, const XubString& rNewName );
bool operator==( const EditTextObject& rCompare ) const;
+
+ // #i102062#
+ bool isWrongListEqual(const EditTextObject& rCompare) const;
};
#endif // _EDITOBJ_HXX
diff --git a/svx/inc/svx/emphitem.hxx b/svx/inc/svx/emphitem.hxx
index 21c256053c..f7aab6ba52 100644
--- a/svx/inc/svx/emphitem.hxx
+++ b/svx/inc/svx/emphitem.hxx
@@ -28,7 +28,7 @@
*
************************************************************************/
#ifndef _SVX_EMPHITEM_HXX
-#define _SVX_EMPTITEM_HXX
+#define _SVX_EMPHITEM_HXX
// include ---------------------------------------------------------------
diff --git a/svx/inc/svx/escherex.hxx b/svx/inc/svx/escherex.hxx
index 4bb34498ed..d021a13466 100644
--- a/svx/inc/svx/escherex.hxx
+++ b/svx/inc/svx/escherex.hxx
@@ -304,6 +304,8 @@
#define ESCHER_ShpInst_ActionButtonMovie 200
#define ESCHER_ShpInst_HostControl 201
#define ESCHER_ShpInst_TextBox 202
+
+#define ESCHER_ShpInst_COUNT 203
#define ESCHER_ShpInst_Max 0x0FFF
#define ESCHER_ShpInst_Nil ESCHER_ShpInst_Max
@@ -960,10 +962,35 @@ namespace com { namespace sun { namespace star {
struct Gradient;
}
namespace drawing {
+ struct EnhancedCustomShapeAdjustmentValue;
class XShape;
}
}}}
+struct SVX_DLLPUBLIC EscherConnectorListEntry
+{
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > mXConnector;
+ ::com::sun::star::awt::Point maPointA;
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > mXConnectToA;
+ ::com::sun::star::awt::Point maPointB;
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > mXConnectToB;
+
+ sal_uInt32 GetConnectorRule( sal_Bool bFirst );
+
+ EscherConnectorListEntry( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rC,
+ const ::com::sun::star::awt::Point& rPA,
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rSA ,
+ const ::com::sun::star::awt::Point& rPB,
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rSB ) :
+ mXConnector ( rC ),
+ maPointA ( rPA ),
+ mXConnectToA( rSA ),
+ maPointB ( rPB ),
+ mXConnectToB( rSB ) {}
+
+ sal_uInt32 GetClosestPoint( const Polygon& rPoly, const ::com::sun::star::awt::Point& rP );
+};
+
struct SVX_DLLPUBLIC EscherExContainer
{
sal_uInt32 nContPos;
@@ -1108,8 +1135,19 @@ public:
#define ESCHER_CREATEPOLYGON_POLYLINE 2
#define ESCHER_CREATEPOLYGON_POLYPOLYGON 4
-struct EscherPropSortStruct;
class GraphicAttr;
+class SdrObjCustomShape;
+
+struct EscherPropSortStruct
+{
+ sal_uInt8* pBuf;
+ sal_uInt32 nPropSize;
+ sal_uInt32 nPropValue;
+ sal_uInt16 nPropId;
+};
+
+typedef std::vector< EscherPropSortStruct > EscherProperties;
+
class SVX_DLLPUBLIC EscherPropertyContainer
{
EscherGraphicProvider* pGraphicProvider;
@@ -1154,6 +1192,10 @@ class SVX_DLLPUBLIC EscherPropertyContainer
sal_uInt8* pProp, sal_uInt32 nPropSize );
sal_Bool GetOpt( sal_uInt16 nPropertyID, sal_uInt32& rPropValue ) const;
+
+ sal_Bool GetOpt( sal_uInt16 nPropertyID, EscherPropSortStruct& rPropValue ) const;
+
+ EscherProperties GetOpts() const;
void Commit( SvStream& rSt, sal_uInt16 nVersion = 3, sal_uInt16 nRecType = ESCHER_OPT );
@@ -1202,6 +1244,14 @@ class SVX_DLLPUBLIC EscherPropertyContainer
static PolyPolygon GetPolyPolygon( const ::com::sun::star::uno::Any& rSource );
static MSO_SPT GetCustomShapeType( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape, sal_uInt32& nMirrorFlags );
static MSO_SPT GetCustomShapeType( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape, sal_uInt32& nMirrorFlags, rtl::OUString& rShapeType );
+
+ // helper functions which are also used in ooxml export
+ static sal_Bool GetLineArrow( const sal_Bool bLineStart,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
+ ESCHER_LineEnd& reLineEnd, sal_Int32& rnArrowLength, sal_Int32& rnArrowWidth );
+ static sal_Bool IsDefaultObject( SdrObjCustomShape* pCustoShape );
+ static void LookForPolarHandles( const MSO_SPT eShapeType, sal_Int32& nAdjustmentsWhichNeedsToBeConverted );
+ static sal_Bool GetAdjustmentValue( const com::sun::star::drawing::EnhancedCustomShapeAdjustmentValue & rkProp, sal_Int32 nIndex, sal_Int32 nAdjustmentsWhichNeedsToBeConverted, sal_Int32& nValue );
};
// ---------------------------------------------------------------------------------------------
@@ -1338,7 +1388,7 @@ class SVX_DLLPUBLIC EscherEx : public EscherPersistTable, public EscherGraphicPr
BOOL mbOleEmf; // OLE is EMF instead of WMF
- BOOL DoSeek( UINT32 nKey );
+ virtual BOOL DoSeek( UINT32 nKey );
public:
@@ -1349,7 +1399,7 @@ class SVX_DLLPUBLIC EscherEx : public EscherPersistTable, public EscherGraphicPr
/// Wenn pPicStreamMergeBSE angegeben ist, werden die BLIPs
/// aus diesem Stream in die MsofbtBSE Records des EscherStream
/// gemerged, wie es fuer Excel (und Word?) benoetigt wird.
- void Flush( SvStream* pPicStreamMergeBSE = NULL );
+ virtual void Flush( SvStream* pPicStreamMergeBSE = NULL );
virtual ~EscherEx();
@@ -1360,13 +1410,13 @@ class SVX_DLLPUBLIC EscherEx : public EscherPersistTable, public EscherGraphicPr
void InsertPersistOffset( UINT32 nKey, UINT32 nOffset ); // Es wird nicht geprueft, ob sich jener schluessel schon in der PersistantTable befindet
BOOL SeekToPersistOffset( UINT32 nKey );
- BOOL InsertAtPersistOffset( UINT32 nKey, UINT32 nValue );// nValue wird im Stream an entrsprechender Stelle eingefuegt(overwrite modus), ohne dass sich die
+ virtual BOOL InsertAtPersistOffset( UINT32 nKey, UINT32 nValue );// nValue wird im Stream an entrsprechender Stelle eingefuegt(overwrite modus), ohne dass sich die
// aktuelle StreamPosition aendert
SvStream& GetStream() const { return *mpOutStrm; }
ULONG GetStreamPos() const { return mpOutStrm->Tell(); }
- BOOL SeekBehindRecHeader( UINT16 nRecType ); // der stream muss vor einem gueltigen Record Header oder Atom stehen
+ virtual BOOL SeekBehindRecHeader( UINT16 nRecType ); // der stream muss vor einem gueltigen Record Header oder Atom stehen
// features beim erzeugen folgender Container:
//
@@ -1378,23 +1428,26 @@ class SVX_DLLPUBLIC EscherEx : public EscherPersistTable, public EscherGraphicPr
virtual void OpenContainer( UINT16 nEscherContainer, int nRecInstance = 0 );
virtual void CloseContainer();
- void BeginAtom();
- void EndAtom( UINT16 nRecType, int nRecVersion = 0, int nRecInstance = 0 );
- void AddAtom( UINT32 nAtomSitze, UINT16 nRecType, int nRecVersion = 0, int nRecInstance = 0 );
- void AddClientAnchor( const Rectangle& rRectangle );
+ virtual void BeginAtom();
+ virtual void EndAtom( UINT16 nRecType, int nRecVersion = 0, int nRecInstance = 0 );
+ virtual void AddAtom( UINT32 nAtomSitze, UINT16 nRecType, int nRecVersion = 0, int nRecInstance = 0 );
+ virtual void AddChildAnchor( const Rectangle& rRectangle );
+ virtual void AddClientAnchor( const Rectangle& rRectangle );
- UINT32 EnterGroup( const String& rShapeName, const Rectangle* pBoundRect = 0 );
+ virtual UINT32 EnterGroup( const String& rShapeName, const Rectangle* pBoundRect = 0 );
UINT32 EnterGroup( const Rectangle* pBoundRect = NULL );
UINT32 GetGroupLevel() const { return mnGroupLevel; };
- BOOL SetGroupSnapRect( UINT32 nGroupLevel, const Rectangle& rRect );
- BOOL SetGroupLogicRect( UINT32 nGroupLevel, const Rectangle& rRect );
- void LeaveGroup();
+ virtual BOOL SetGroupSnapRect( UINT32 nGroupLevel, const Rectangle& rRect );
+ virtual BOOL SetGroupLogicRect( UINT32 nGroupLevel, const Rectangle& rRect );
+ virtual void LeaveGroup();
// ein ESCHER_Sp wird geschrieben ( Ein ESCHER_DgContainer muss dazu geoeffnet sein !!)
- void AddShape( UINT32 nShpInstance, UINT32 nFlagIds, UINT32 nShapeID = 0 );
+ virtual void AddShape( UINT32 nShpInstance, UINT32 nFlagIds, UINT32 nShapeID = 0 );
// reserviert eine ShapeId
UINT32 GetShapeID();
+ virtual void Commit( EscherPropertyContainer& rProps, const Rectangle& rRect );
+
UINT32 GetColor( const UINT32 nColor, BOOL bSwap = TRUE );
UINT32 GetColor( const Color& rColor, BOOL bSwap = TRUE );
diff --git a/svx/inc/svx/fntctrl.hxx b/svx/inc/svx/fntctrl.hxx
index 955d871973..31422c88b1 100644
--- a/svx/inc/svx/fntctrl.hxx
+++ b/svx/inc/svx/fntctrl.hxx
@@ -71,6 +71,7 @@ public:
SvxFont& GetCJKFont();
SvxFont& GetCTLFont();
void SetColor( const Color& rColor );
+ void ResetColor();
void SetBackColor( const Color& rColor );
void UseResourceText( BOOL bUse = TRUE );
void Paint( const Rectangle& );
diff --git a/svx/inc/svx/framelink.hxx b/svx/inc/svx/framelink.hxx
index e6263606b8..2bf5138d42 100644
--- a/svx/inc/svx/framelink.hxx
+++ b/svx/inc/svx/framelink.hxx
@@ -325,7 +325,7 @@ inline double GetVerDiagAngle( const Rectangle& rRect )
@param fAngle
Inner (right) angle between diagonal and horizontal frame border.
*/
-long GetTLDiagOffset( long nVerOffs, long nDiagOffs, double fAngle );
+SVX_DLLPUBLIC long GetTLDiagOffset( long nVerOffs, long nDiagOffs, double fAngle );
/** Returns an X coordinate for a diagonal frame border in the specified height.
@@ -434,7 +434,7 @@ long GetTRDiagOffset( long nVerOffs, long nDiagOffs, double fAngle );
True, if rLBorder and rRBorder can be drawn in one step without
interruption at their connection point.
*/
-bool CheckFrameBorderConnectable(
+SVX_DLLPUBLIC bool CheckFrameBorderConnectable(
const Style& rLBorder, /// Style of the left frame border to connect.
const Style& rRBorder, /// Style of the right frame border to connect.
@@ -486,7 +486,7 @@ bool CheckFrameBorderConnectable(
| \ / |
rLFromB \ / rRFromB
*/
-void DrawHorFrameBorder(
+SVX_DLLPUBLIC void DrawHorFrameBorder(
OutputDevice& rDev, /// The output device used to draw the frame border.
const Point& rLPos, /// Reference point for left end of the processed frame border.
@@ -603,7 +603,7 @@ void SVX_DLLPUBLIC DrawHorFrameBorder(
rBFromB
|
*/
-void DrawVerFrameBorder(
+SVX_DLLPUBLIC void DrawVerFrameBorder(
OutputDevice& rDev, /// The output device used to draw the frame border.
const Point& rTPos, /// Reference point for top end of the processed frame border.
@@ -698,7 +698,7 @@ void SVX_DLLPUBLIC DrawVerFrameBorderSlanted(
The function preserves all settings of the passed output device.
*/
-void DrawDiagFrameBorders(
+SVX_DLLPUBLIC void DrawDiagFrameBorders(
OutputDevice& rDev, /// The output device used to draw the frame border.
const Rectangle& rRect, /// Rectangle for both diagonal frame borders.
diff --git a/svx/inc/svx/msdffimp.hxx b/svx/inc/svx/msdffimp.hxx
index 4feaead917..bc40b396ec 100644
--- a/svx/inc/svx/msdffimp.hxx
+++ b/svx/inc/svx/msdffimp.hxx
@@ -36,9 +36,7 @@
#include <tools/solar.h> // UINTXX
#include <svtools/svarray.hxx>
-#ifndef _SV_COLOR_HXX //autogen
#include <tools/color.hxx>
-#endif
#include <tools/gen.hxx>
#include <tools/table.hxx>
#include <svx/msdffdef.hxx>
@@ -48,7 +46,7 @@
#include <map>
#include <com/sun/star/beans/XPropertySet.hpp>
-#include "svx/svxdllapi.h"
+#include <svx/svxdllapi.h>
#include <sot/storage.hxx>
diff --git a/svx/inc/svx/msocximex.hxx b/svx/inc/svx/msocximex.hxx
index 251ab5b366..c9b7b817cd 100644
--- a/svx/inc/svx/msocximex.hxx
+++ b/svx/inc/svx/msocximex.hxx
@@ -230,7 +230,7 @@ class SVX_DLLPUBLIC OCX_Control
{
public:
OCX_Control(UniString sN, OCX_Control* parent = NULL ) : nWidth( 0 ), nHeight( 0 ), mnLeft(0), mnTop(0),
- mnStep(0), mnBackColor(0x8000000FL), mnForeColor(0), mnTabPos(0), sName(sN), pDocSh(0),
+ mnStep(0), mnBackColor(0x8000000FL), mnForeColor(0), mnTabPos(0), mbVisible(true), sName(sN), pDocSh(0),
bSetInDialog(FALSE), mpParent( parent ) {}
sal_Bool FullRead(SotStorageStream *pS)
{
@@ -287,6 +287,7 @@ public:
sal_Int32 mnBackColor;
sal_Int32 mnForeColor;
sal_uInt16 mnTabPos;
+ bool mbVisible;
UniString sName;
UniString msToolTip;
OCX_FontData aFontData;
@@ -483,7 +484,7 @@ public:
};
struct ContainerRecord
{
- ContainerRecord():nTop(0), nLeft(0), nSubStorageId(0), nSubStreamLen(0), nTabPos(0), nTypeIdent(0) {}
+ ContainerRecord():nTop(0), nLeft(0), nSubStorageId(0), nSubStreamLen(0), nTabPos(0), nTypeIdent(0), bVisible( true ) {}
::rtl::OUString cName;
::rtl::OUString controlTip;
@@ -494,6 +495,7 @@ struct ContainerRecord
sal_uInt32 nSubStreamLen;
sal_uInt16 nTabPos;
sal_uInt16 nTypeIdent;
+ bool bVisible;
};
typedef std::vector<OCX_Control*>::iterator CtrlIterator;
diff --git a/svx/inc/svx/obj3d.hxx b/svx/inc/svx/obj3d.hxx
index 136e3d77ea..229d8bcf19 100644
--- a/svx/inc/svx/obj3d.hxx
+++ b/svx/inc/svx/obj3d.hxx
@@ -92,8 +92,8 @@ class E3dObjList : public SdrObjList
public:
TYPEINFO();
E3dObjList(SdrModel* pNewModel = 0, SdrPage* pNewPage = 0, E3dObjList* pNewUpList = 0);
- E3dObjList(const E3dObjList& rSrcList);
- virtual ~E3dObjList();
+ SVX_DLLPUBLIC E3dObjList(const E3dObjList& rSrcList);
+ SVX_DLLPUBLIC virtual ~E3dObjList();
virtual void NbcInsertObject(SdrObject* pObj, ULONG nPos=CONTAINER_APPEND, const SdrInsertReason* pReason=NULL);
virtual void InsertObject(SdrObject* pObj, ULONG nPos=CONTAINER_APPEND, const SdrInsertReason* pReason=NULL);
@@ -308,9 +308,6 @@ public :
virtual UINT16 GetObjIdentifier() const;
virtual void RecalcSnapRect();
- // Hittest, wird an Geometrie weitergegeben
- virtual SdrObject* CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const;
-
// Parameter Geometrieerzeugung setzen/lesen
BOOL GetCreateNormals() const { return bCreateNormals; }
void SetCreateNormals(BOOL bNew);
diff --git a/svx/inc/svx/outlobj.hxx b/svx/inc/svx/outlobj.hxx
index f99a95aedb..470f173d41 100644
--- a/svx/inc/svx/outlobj.hxx
+++ b/svx/inc/svx/outlobj.hxx
@@ -67,6 +67,9 @@ public:
bool operator==(const OutlinerParaObject& rCandidate) const;
bool operator!=(const OutlinerParaObject& rCandidate) const { return !operator==(rCandidate); }
+ // #i102062#
+ bool isWrongListEqual(const OutlinerParaObject& rCompare) const;
+
// outliner mode access
sal_uInt16 GetOutlinerMode() const;
void SetOutlinerMode(sal_uInt16 nNew);
diff --git a/svx/inc/svx/sdasaitm.hxx b/svx/inc/svx/sdasaitm.hxx
index 42289cd5cb..163172c1da 100644
--- a/svx/inc/svx/sdasaitm.hxx
+++ b/svx/inc/svx/sdasaitm.hxx
@@ -54,9 +54,9 @@ class SdrCustomShapeAdjustmentItem : public SfxPoolItem
public :
TYPEINFO();
- SdrCustomShapeAdjustmentItem();
+ SVX_DLLPUBLIC SdrCustomShapeAdjustmentItem();
SdrCustomShapeAdjustmentItem( SvStream& rIn, sal_uInt16 nVersion );
- ~SdrCustomShapeAdjustmentItem();
+ SVX_DLLPUBLIC ~SdrCustomShapeAdjustmentItem();
virtual int operator==( const SfxPoolItem& ) const;
virtual SfxItemPresentation GetPresentation(SfxItemPresentation ePresentation,
@@ -76,8 +76,8 @@ class SdrCustomShapeAdjustmentItem : public SfxPoolItem
#endif
sal_uInt32 GetCount() const { return aAdjustmentValueList.Count(); };
- const SdrCustomShapeAdjustmentValue& GetValue( sal_uInt32 nIndex ) const;
- void SetValue( sal_uInt32 nIndex,
+ SVX_DLLPUBLIC const SdrCustomShapeAdjustmentValue& GetValue( sal_uInt32 nIndex ) const;
+ SVX_DLLPUBLIC void SetValue( sal_uInt32 nIndex,
const SdrCustomShapeAdjustmentValue& rVal );
};
diff --git a/svx/inc/svx/sdgcpitm.hxx b/svx/inc/svx/sdgcpitm.hxx
index d38df10226..680b5d495b 100644
--- a/svx/inc/svx/sdgcpitm.hxx
+++ b/svx/inc/svx/sdgcpitm.hxx
@@ -38,7 +38,7 @@
// SdrGrafCropItem -
//------------------
-class SdrGrafCropItem : public SvxGrfCrop
+class SVX_DLLPUBLIC SdrGrafCropItem : public SvxGrfCrop
{
public:
diff --git a/svx/inc/svx/sdr/animation/objectanimator.hxx b/svx/inc/svx/sdr/animation/objectanimator.hxx
index a4b2867e5d..a618d846ef 100644
--- a/svx/inc/svx/sdr/animation/objectanimator.hxx
+++ b/svx/inc/svx/sdr/animation/objectanimator.hxx
@@ -48,7 +48,7 @@ namespace sdr
public:
// basic constructor and destructor
primitiveAnimator();
- virtual ~primitiveAnimator();
+ SVX_DLLPUBLIC virtual ~primitiveAnimator();
};
} // end of namespace animation
} // end of namespace sdr
diff --git a/svx/inc/svx/sdr/animation/scheduler.hxx b/svx/inc/svx/sdr/animation/scheduler.hxx
index ea6c7d37cc..7c927ec590 100644
--- a/svx/inc/svx/sdr/animation/scheduler.hxx
+++ b/svx/inc/svx/sdr/animation/scheduler.hxx
@@ -33,6 +33,7 @@
#include <sal/types.h>
#include <vcl/timer.hxx>
+#include <svx/svxdllapi.h>
//////////////////////////////////////////////////////////////////////////////
// event class
@@ -52,7 +53,7 @@ namespace sdr
public:
// constructor/destructor
Event(sal_uInt32 nTime);
- virtual ~Event();
+ SVX_DLLPUBLIC virtual ~Event();
// access to mpNext
Event* GetNext() const;
@@ -83,7 +84,7 @@ namespace sdr
public:
// constructor/destructor
EventList();
- virtual ~EventList();
+ SVX_DLLPUBLIC virtual ~EventList();
// insert/remove time dependent
void Insert(Event* pNew);
@@ -123,10 +124,10 @@ namespace sdr
public:
// constructor/destructor
Scheduler();
- virtual ~Scheduler();
+ SVX_DLLPUBLIC virtual ~Scheduler();
// From baseclass Timer, the timeout call
- virtual void Timeout();
+ SVX_DLLPUBLIC virtual void Timeout();
// get time
sal_uInt32 GetTime();
diff --git a/svx/inc/svx/sdr/attribute/sdrallattribute.hxx b/svx/inc/svx/sdr/attribute/sdrallattribute.hxx
index d264a0d2c5..092c0e224a 100644
--- a/svx/inc/svx/sdr/attribute/sdrallattribute.hxx
+++ b/svx/inc/svx/sdr/attribute/sdrallattribute.hxx
@@ -32,6 +32,8 @@
#ifndef _SDR_ATTRIBUTE_SDRALLATTRIBUTE_HXX
#define _SDR_ATTRIBUTE_SDRALLATTRIBUTE_HXX
+#include <sal/types.h>
+
//////////////////////////////////////////////////////////////////////////////
// predefines
@@ -57,7 +59,9 @@ namespace drawinglayer
SdrTextAttribute* mpTextAttribute; // text and text attributes (if used)
public:
- SdrShadowTextAttribute(SdrShadowAttribute* pShadow = 0L, SdrTextAttribute* pTextAttribute = 0L);
+ SdrShadowTextAttribute(
+ SdrShadowAttribute* pShadow = 0,
+ SdrTextAttribute* pTextAttribute = 0);
~SdrShadowTextAttribute();
// copy constructor and assigment operator
@@ -68,7 +72,7 @@ namespace drawinglayer
bool operator==(const SdrShadowTextAttribute& rCandidate) const;
// bool access
- bool isVisible() const { return (0L != mpTextAttribute); }
+ bool isVisible() const { return (0 != mpTextAttribute); }
// data access
const SdrShadowAttribute* getShadow() const { return mpShadow; }
@@ -91,7 +95,10 @@ namespace drawinglayer
SdrTextAttribute* mpTextAttribute; // text and text attributes (if used)
public:
- SdrFillTextAttribute(SdrFillAttribute* pFill = 0L, FillGradientAttribute* pFillFloatTransGradient = 0L, SdrTextAttribute* pTextAttribute = 0L);
+ SdrFillTextAttribute(
+ SdrFillAttribute* pFill = 0,
+ FillGradientAttribute* pFillFloatTransGradient = 0,
+ SdrTextAttribute* pTextAttribute = 0);
~SdrFillTextAttribute();
// copy constructor and assigment operator
@@ -126,8 +133,10 @@ namespace drawinglayer
public:
SdrLineShadowTextAttribute(
- SdrLineAttribute* pLine = 0L, SdrLineStartEndAttribute* pLineStartEnd = 0L,
- SdrShadowAttribute* pShadow = 0L, SdrTextAttribute* pTextAttribute = 0L);
+ SdrLineAttribute* pLine = 0,
+ SdrLineStartEndAttribute* pLineStartEnd = 0,
+ SdrShadowAttribute* pShadow = 0,
+ SdrTextAttribute* pTextAttribute = 0);
~SdrLineShadowTextAttribute();
// copy constructor and assigment operator
@@ -161,8 +170,12 @@ namespace drawinglayer
public:
SdrLineFillShadowTextAttribute(
- SdrLineAttribute* pLine = 0L, SdrFillAttribute* pFill = 0L, SdrLineStartEndAttribute* pLineStartEnd = 0L,
- SdrShadowAttribute* pShadow = 0L, FillGradientAttribute* pFillFloatTransGradient = 0L, SdrTextAttribute* pTextAttribute = 0L);
+ SdrLineAttribute* pLine = 0,
+ SdrFillAttribute* pFill = 0,
+ SdrLineStartEndAttribute* pLineStartEnd = 0,
+ SdrShadowAttribute* pShadow = 0,
+ FillGradientAttribute* pFillFloatTransGradient = 0,
+ SdrTextAttribute* pTextAttribute = 0);
~SdrLineFillShadowTextAttribute();
// copy constructor and assigment operator
diff --git a/svx/inc/svx/sdr/attribute/sdrformtextattribute.hxx b/svx/inc/svx/sdr/attribute/sdrformtextattribute.hxx
new file mode 100644
index 0000000000..aa417b4451
--- /dev/null
+++ b/svx/inc/svx/sdr/attribute/sdrformtextattribute.hxx
@@ -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: sdrtextattribute.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * 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 _SDR_ATTRIBUTE_SDRFORMTEXTATTRIBUTE_HXX
+#define _SDR_ATTRIBUTE_SDRFORMTEXTATTRIBUTE_HXX
+
+#include <sal/types.h>
+#include <svx/xenum.hxx>
+#include <tools/color.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+class SfxItemSet;
+namespace drawinglayer { namespace attribute { class SdrFormTextOutlineAttribute; }}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class SdrFormTextAttribute
+ {
+ private:
+ // FormText (FontWork) Attributes
+ sal_Int32 mnFormTextDistance; // distance from line in upright direction
+ sal_Int32 mnFormTextStart; // shift from polygon start
+ sal_Int32 mnFormTextShdwXVal; // shadow distance or 10th degrees
+ sal_Int32 mnFormTextShdwYVal; // shadow distance or scaling
+ sal_uInt16 mnFormTextShdwTransp; // shadow transparence
+ XFormTextStyle meFormTextStyle; // on/off and char orientation
+ XFormTextAdjust meFormTextAdjust; // adjustment (left/right/center) and scale
+ XFormTextShadow meFormTextShadow; // shadow mode
+ Color maFormTextShdwColor; // shadow color
+
+ // outline attributes; used when getFormTextOutline() is true and (for
+ // shadow) when getFormTextShadow() != XFTSHADOW_NONE
+ SdrFormTextOutlineAttribute* mpOutline;
+ SdrFormTextOutlineAttribute* mpShadowOutline;
+
+ // bitfield
+ unsigned mbFormTextMirror : 1; // change orientation
+ unsigned mbFormTextOutline : 1; // show contour of objects
+
+ public:
+ SdrFormTextAttribute(const SfxItemSet& rSet);
+ ~SdrFormTextAttribute();
+
+ // copy constructor and assigment operator
+ SdrFormTextAttribute(const SdrFormTextAttribute& rCandidate);
+ SdrFormTextAttribute& operator=(const SdrFormTextAttribute& rCandidate);
+
+ // compare operator
+ bool operator==(const SdrFormTextAttribute& rCandidate) const;
+
+ // data access
+ sal_Int32 getFormTextDistance() const { return mnFormTextDistance; }
+ sal_Int32 getFormTextStart() const { return mnFormTextStart; }
+ sal_Int32 getFormTextShdwXVal() const { return mnFormTextShdwXVal; }
+ sal_Int32 getFormTextShdwYVal() const { return mnFormTextShdwYVal; }
+ sal_uInt16 getFormTextShdwTransp() const { return mnFormTextShdwTransp; }
+ XFormTextStyle getFormTextStyle() const { return meFormTextStyle; }
+ XFormTextAdjust getFormTextAdjust() const { return meFormTextAdjust; }
+ XFormTextShadow getFormTextShadow() const { return meFormTextShadow; }
+ Color getFormTextShdwColor() const { return maFormTextShdwColor; }
+
+ const SdrFormTextOutlineAttribute* getOutline() const { return mpOutline; }
+ const SdrFormTextOutlineAttribute* getShadowOutline() const { return mpShadowOutline; }
+
+ bool getFormTextMirror() const { return mbFormTextMirror; }
+ bool getFormTextOutline() const { return mbFormTextOutline; }
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // _SDR_ATTRIBUTE_SDRFORMTEXTATTRIBUTE_HXX
+
+// eof
diff --git a/svx/inc/svx/sdr/attribute/sdrformtextoutlineattribute.hxx b/svx/inc/svx/sdr/attribute/sdrformtextoutlineattribute.hxx
new file mode 100644
index 0000000000..c8c80ceb02
--- /dev/null
+++ b/svx/inc/svx/sdr/attribute/sdrformtextoutlineattribute.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: sdrtextattribute.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * 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 _SDR_ATTRIBUTE_SDRFORMTEXTOUTLINEATTRIBUTE_HXX
+#define _SDR_ATTRIBUTE_SDRFORMTEXTOUTLINEATTRIBUTE_HXX
+
+#include <sal/types.h>
+#include <drawinglayer/attribute/lineattribute.hxx>
+#include <drawinglayer/attribute/strokeattribute.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class SdrFormTextOutlineAttribute
+ {
+ private:
+ // one set of attributes for FormText (FontWork) outline visualisation
+ LineAttribute maLineAttribute;
+ StrokeAttribute maStrokeAttribute;
+ sal_uInt8 mnTransparence;
+
+ public:
+ SdrFormTextOutlineAttribute(
+ const LineAttribute& rLineAttribute,
+ const StrokeAttribute& rStrokeAttribute,
+ sal_uInt8 nTransparence);
+
+ // compare operator
+ bool operator==(const SdrFormTextOutlineAttribute& rCandidate) const;
+
+ // data read access
+ const LineAttribute& getLineAttribute() const { return maLineAttribute; }
+ const StrokeAttribute getStrokeAttribute() const { return maStrokeAttribute; }
+ sal_uInt8 getTransparence() const { return mnTransparence; }
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // _SDR_ATTRIBUTE_SDRFORMTEXTOUTLINEATTRIBUTE_HXX
+
+// eof
diff --git a/svx/inc/svx/sdr/attribute/sdrtextattribute.hxx b/svx/inc/svx/sdr/attribute/sdrtextattribute.hxx
index 6193488113..48d3cb135d 100644
--- a/svx/inc/svx/sdr/attribute/sdrtextattribute.hxx
+++ b/svx/inc/svx/sdr/attribute/sdrtextattribute.hxx
@@ -32,18 +32,15 @@
#ifndef _SDR_ATTRIBUTE_SDRTEXTATTRIBUTE_HXX
#define _SDR_ATTRIBUTE_SDRTEXTATTRIBUTE_HXX
-#include <svx/xenum.hxx>
#include <sal/types.h>
-#include <svx/sdr/primitive2d/sdrtextprimitive2d.hxx>
+#include <svx/xenum.hxx>
+#include <svx/outlobj.hxx>
//////////////////////////////////////////////////////////////////////////////
// predefines
class SdrText;
-class OutlinerParaObject;
-
-namespace drawinglayer { namespace animation {
- class AnimationEntryList;
-}}
+namespace drawinglayer { namespace animation { class AnimationEntryList; }}
+namespace drawinglayer { namespace attribute { class SdrFormTextAttribute; }}
//////////////////////////////////////////////////////////////////////////////
@@ -53,15 +50,24 @@ namespace drawinglayer
{
class SdrTextAttribute
{
- const SdrText& mrSdrText;
- const OutlinerParaObject maOutlinerParaObject;
- XFormTextStyle meFormTextStyle;
+ private:
+ // all-text attributes. The SdrText itself and a copy
+ // of te OPO
+ const SdrText* mpSdrText;
+ OutlinerParaObject maOutlinerParaObject;
+
+ // Set when it's a FormText; contains all FormText attributes
+ SdrFormTextAttribute* mpSdrFormTextAttribute;
+ // text distances
sal_Int32 maTextLeftDistance;
sal_Int32 maTextUpperDistance;
sal_Int32 maTextRightDistance;
sal_Int32 maTextLowerDistance;
+ // #i101556# use versioning from text attributes to detect changes
+ sal_uInt32 maPropertiesVersion;
+
// bitfield
unsigned mbContour : 1;
unsigned mbFitToSize : 1;
@@ -85,23 +91,30 @@ namespace drawinglayer
bool bBlink,
bool bScroll,
bool bInEditMode);
+ ~SdrTextAttribute();
+
+ // copy constructor and assigment operator
+ SdrTextAttribute(const SdrTextAttribute& rCandidate);
+ SdrTextAttribute& operator=(const SdrTextAttribute& rCandidate);
+
+ // compare operator
bool operator==(const SdrTextAttribute& rCandidate) const;
// data access
- const SdrText& getSdrText() const { return mrSdrText; }
+ const SdrText& getSdrText() const { return *mpSdrText; }
const OutlinerParaObject& getOutlinerParaObject() const { return maOutlinerParaObject; }
bool isContour() const { return mbContour; }
- bool isFontwork() const { return (XFT_NONE != meFormTextStyle); }
bool isFitToSize() const { return mbFitToSize; }
bool isHideContour() const { return mbHideContour; }
bool isBlink() const { return mbBlink; }
bool isScroll() const { return mbScroll; }
bool isInEditMode() const { return mbInEditMode; }
- XFormTextStyle getFormTextStyle() const { return meFormTextStyle; }
+ const SdrFormTextAttribute* getSdrFormTextAttribute() const { return mpSdrFormTextAttribute; }
sal_Int32 getTextLeftDistance() const { return maTextLeftDistance; }
sal_Int32 getTextUpperDistance() const { return maTextUpperDistance; }
sal_Int32 getTextRightDistance() const { return maTextRightDistance; }
sal_Int32 getTextLowerDistance() const { return maTextLowerDistance; }
+ sal_uInt32 getPropertiesVersion() const { return maPropertiesVersion; }
// animation timing generation
void getBlinkTextTiming(drawinglayer::animation::AnimationEntryList& rAnimList) const;
diff --git a/svx/inc/svx/sdr/contact/viewcontactofgraphic.hxx b/svx/inc/svx/sdr/contact/viewcontactofgraphic.hxx
index f977de554d..322b55b69a 100644
--- a/svx/inc/svx/sdr/contact/viewcontactofgraphic.hxx
+++ b/svx/inc/svx/sdr/contact/viewcontactofgraphic.hxx
@@ -38,6 +38,8 @@
// predeclarations
class SdrGrafObj;
+namespace drawinglayer { namespace attribute { class SdrLineFillShadowTextAttribute; }}
+class GraphicAttr;
//////////////////////////////////////////////////////////////////////////////
@@ -47,6 +49,16 @@ namespace sdr
{
class ViewContactOfGraphic : public ViewContactOfTextObj
{
+ private:
+ // helpers for constructing various primitive visualisations in various states
+ drawinglayer::primitive2d::Primitive2DSequence createVIP2DSForPresObj(
+ const basegfx::B2DHomMatrix& rObjectMatrix,
+ const drawinglayer::attribute::SdrLineFillShadowTextAttribute& rAttribute,
+ const GraphicAttr& rLocalGrafInfo) const;
+ drawinglayer::primitive2d::Primitive2DSequence createVIP2DSForDraft(
+ const basegfx::B2DHomMatrix& rObjectMatrix,
+ const drawinglayer::attribute::SdrLineFillShadowTextAttribute& rAttribute) const;
+
protected:
// Create a Object-Specific ViewObjectContact, set ViewContact and
// ObjectContact. Always needs to return something.
@@ -63,6 +75,13 @@ namespace sdr
ViewContactOfGraphic(SdrGrafObj& rGrafObj);
virtual ~ViewContactOfGraphic();
+ // #i102380#
+ void flushGraphicObjects();
+
+ // helpers for viusualisation state
+ bool visualisationUsesPresObj() const;
+ bool visualisationUsesDraft() const;
+
protected:
// This method is responsible for creating the graphical visualisation data
// ONLY based on model data
diff --git a/svx/inc/svx/sdr/contact/viewcontactofsdrole2obj.hxx b/svx/inc/svx/sdr/contact/viewcontactofsdrole2obj.hxx
index 0283aeff83..630187b323 100644
--- a/svx/inc/svx/sdr/contact/viewcontactofsdrole2obj.hxx
+++ b/svx/inc/svx/sdr/contact/viewcontactofsdrole2obj.hxx
@@ -64,15 +64,15 @@ namespace sdr
ViewContactOfSdrOle2Obj(SdrOle2Obj& rOle2Obj);
virtual ~ViewContactOfSdrOle2Obj();
- // helper for creating a OLE sequence for this object for a specified Graphic. This is locally
- // used from createViewIndependentPrimitive2DSequence and also allows the VOC which knows about
- // HighContrast mode to easily do the same with the HighContrast OLE metafile. It also allows
- // to give a hint for scaling down the content what is needed for EmptyPresObjs
- drawinglayer::primitive2d::Primitive2DSequence createPrimitive2DSequenceWithGivenGraphic(const Graphic& rOLEGraphic, bool bScaleContent) const;
+ // helper for creating a OLE sequence for this object. It takes care od attributes, needed
+ // scaling (e.g. for EmptyPresObj's), the correct graphic and other stuff. It is used from
+ // createViewIndependentPrimitive2DSequence with false, and with evtl. HighContrast true
+ // from the VOC which knows that
+ drawinglayer::primitive2d::Primitive2DSequence createPrimitive2DSequenceWithParameters(bool bHighContrast) const;
protected:
// This method is responsible for creating the graphical visualisation data
- // ONLY based on model data
+ // ONLY based on model data, just wraps to call createPrimitive2DSequenceWithParameters(false)
virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const;
};
} // end of namespace contact
diff --git a/svx/inc/svx/sdr/contact/viewobjectcontactofunocontrol.hxx b/svx/inc/svx/sdr/contact/viewobjectcontactofunocontrol.hxx
index 5b7103e55c..b505756352 100644
--- a/svx/inc/svx/sdr/contact/viewobjectcontactofunocontrol.hxx
+++ b/svx/inc/svx/sdr/contact/viewobjectcontactofunocontrol.hxx
@@ -89,18 +89,6 @@ namespace sdr { namespace contact {
*/
void setControlDesignMode( bool _bDesignMode ) const;
- /** determines whether the instance belongs to a given OutputDevice
- @precond
- The instance knows the device it belongs to, or can determine it.
- If this is not the case, you will notice an assertion, and the method will
- return false.
- */
- bool belongsToDevice( const OutputDevice* _pDevice ) const;
-
- /** positions the control for subsequent paint operations
- */
- void positionControlForPaint( const DisplayInfo& _rDisplayInfo ) const;
-
/** callback from impl class to react on changes of properties form the XControlModel
*/
void propertyChange();
@@ -165,6 +153,8 @@ namespace sdr { namespace contact {
UnoControlPrintOrPreviewContact(); // never implemented
UnoControlPrintOrPreviewContact( const UnoControlPrintOrPreviewContact& ); // never implemented
UnoControlPrintOrPreviewContact& operator=( const UnoControlPrintOrPreviewContact& ); // never implemented
+
+ virtual drawinglayer::primitive2d::Primitive2DSequence createPrimitive2DSequence(const DisplayInfo& rDisplayInfo ) const;
};
//====================================================================
diff --git a/svx/inc/svx/sdr/overlay/overlayanimatedbitmapex.hxx b/svx/inc/svx/sdr/overlay/overlayanimatedbitmapex.hxx
index f0321d2936..f6603d2c4d 100644
--- a/svx/inc/svx/sdr/overlay/overlayanimatedbitmapex.hxx
+++ b/svx/inc/svx/sdr/overlay/overlayanimatedbitmapex.hxx
@@ -60,11 +60,8 @@ namespace sdr
// Flag to remember which state to draw. Inited with sal_False (0)
unsigned mbOverlayState : 1;
- // Draw geometry
- virtual void drawGeometry(OutputDevice& rOutputDevice);
-
- // Create the BaseRange. This method needs to calculate maBaseRange.
- virtual void createBaseRange(OutputDevice& rOutputDevice);
+ // geometry creation for OverlayObject
+ virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence();
// #i53216# check blink time value range (currently 25 < mnBlinkTime < 10000)
void impCheckBlinkTimeValueRange();
@@ -100,11 +97,6 @@ namespace sdr
// execute event from base class ::sdr::animation::Event. Default
// implementation does nothing and does not create a new event.
virtual void Trigger(sal_uInt32 nTime);
-
- // Zoom has changed. If the objects logical size
- // depends on the MapMode of the used OutputDevice, use this call
- // to invalidate the range in logical coordinates.
- virtual void zoomHasChanged();
};
} // end of namespace overlay
} // end of namespace sdr
diff --git a/svx/inc/svx/sdr/overlay/overlaybitmap.hxx b/svx/inc/svx/sdr/overlay/overlaybitmap.hxx
deleted file mode 100644
index 25d6980976..0000000000
--- a/svx/inc/svx/sdr/overlay/overlaybitmap.hxx
+++ /dev/null
@@ -1,94 +0,0 @@
-/*************************************************************************
- *
- * 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: overlaybitmap.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 _SDR_OVERLAY_OVERLAYBITMAP_HXX
-#define _SDR_OVERLAY_OVERLAYBITMAP_HXX
-
-#include <svx/sdr/overlay/overlayobject.hxx>
-#include <vcl/bitmap.hxx>
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace sdr
-{
- namespace overlay
- {
- class OverlayBitmap : public OverlayObjectWithBasePosition
- {
- protected:
- // the Bitmap itself
- Bitmap maBitmap;
-
- // position of the basePosition inside the Bitmap, in pixels
- sal_uInt16 mnCenterX;
- sal_uInt16 mnCenterY;
-
- // bitfield
- // shall the BaseColor be used to create transparence?
- unsigned mbUseTransparenceColor : 1;
-
- // Draw geometry
- virtual void drawGeometry(OutputDevice& rOutputDevice);
-
- // Create the BaseRange. This method needs to calculate maBaseRange.
- virtual void createBaseRange(OutputDevice& rOutputDevice);
-
- public:
- OverlayBitmap(
- const basegfx::B2DPoint& rBasePos,
- const Bitmap& rBitmap,
- sal_uInt16 nCenX = 0, sal_uInt16 nCenY = 0,
- sal_Bool bUseTransCol = sal_False,
- Color aTransColor = Color(COL_WHITE));
- virtual ~OverlayBitmap();
-
- const Bitmap& getBitmap() const { return maBitmap; }
- void setBitmap(const Bitmap& rNew);
-
- sal_Bool isTransparenceUsed() const { return mbUseTransparenceColor; }
- void setTransparenceUsed(sal_Bool bNew);
-
- sal_uInt16 getCenterX() const { return mnCenterX; }
- sal_uInt16 getCenterY() const { return mnCenterY; }
- void setCenterXY(sal_uInt16 nNewX, sal_uInt16 nNewY);
-
- // Zoom has changed. If the objects logical size
- // depends on the MapMode of the used OutputDevice, use this call
- // to invalidate the range in logical coordinates.
- virtual void zoomHasChanged();
- };
- } // end of namespace overlay
-} // end of namespace sdr
-
-//////////////////////////////////////////////////////////////////////////////
-
-#endif //_SDR_OVERLAY_OVERLAYBITMAP_HXX
-
-// eof
diff --git a/svx/inc/svx/sdr/overlay/overlaybitmapex.hxx b/svx/inc/svx/sdr/overlay/overlaybitmapex.hxx
index 8d006c5dc4..531890c6c0 100644
--- a/svx/inc/svx/sdr/overlay/overlaybitmapex.hxx
+++ b/svx/inc/svx/sdr/overlay/overlaybitmapex.hxx
@@ -50,11 +50,7 @@ namespace sdr
sal_uInt16 mnCenterX;
sal_uInt16 mnCenterY;
- // Draw geometry
- virtual void drawGeometry(OutputDevice& rOutputDevice);
-
- // Create the BaseRange. This method needs to calculate maBaseRange.
- virtual void createBaseRange(OutputDevice& rOutputDevice);
+ virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence();
public:
OverlayBitmapEx(
@@ -69,11 +65,6 @@ namespace sdr
sal_uInt16 getCenterX() const { return mnCenterX; }
sal_uInt16 getCenterY() const { return mnCenterY; }
void setCenterXY(sal_uInt16 nNewX, sal_uInt16 nNewY);
-
- // Zoom has changed. If the objects logical size
- // depends on the MapMode of the used OutputDevice, use this call
- // to invalidate the range in logical coordinates.
- virtual void zoomHasChanged();
};
} // end of namespace overlay
} // end of namespace sdr
diff --git a/svx/inc/svx/sdr/overlay/overlaycrosshair.hxx b/svx/inc/svx/sdr/overlay/overlaycrosshair.hxx
index 75f8182558..5a9f2286f0 100644
--- a/svx/inc/svx/sdr/overlay/overlaycrosshair.hxx
+++ b/svx/inc/svx/sdr/overlay/overlaycrosshair.hxx
@@ -42,39 +42,15 @@ namespace sdr
class OverlayCrosshairStriped : public OverlayObjectWithBasePosition
{
protected:
- // Draw geometry
- virtual void drawGeometry(OutputDevice& rOutputDevice);
-
- // Create the BaseRange. This method needs to calculate maBaseRange.
- virtual void createBaseRange(OutputDevice& rOutputDevice);
+ // geometry creation for OverlayObject
+ virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence();
public:
OverlayCrosshairStriped(const basegfx::B2DPoint& rBasePos);
virtual ~OverlayCrosshairStriped();
- // Hittest with logical coordinates
- virtual sal_Bool isHit(const basegfx::B2DPoint& rPos, double fTol = 0.0) const;
- };
- } // end of namespace overlay
-} // end of namespace sdr
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace sdr
-{
- namespace overlay
- {
- class OverlayCrosshair : public OverlayCrosshairStriped
- {
- protected:
- // Draw geometry
- virtual void drawGeometry(OutputDevice& rOutputDevice);
-
- public:
- OverlayCrosshair(
- const basegfx::B2DPoint& rBasePos,
- Color aLineColor = Color(COL_BLACK));
- virtual ~OverlayCrosshair();
+ // react on stripe definition change
+ virtual void stripeDefinitionHasChanged();
};
} // end of namespace overlay
} // end of namespace sdr
diff --git a/svx/inc/svx/sdr/overlay/overlayhatchrect.hxx b/svx/inc/svx/sdr/overlay/overlayhatchrect.hxx
index a34eaf781e..497d7c1b89 100644
--- a/svx/inc/svx/sdr/overlay/overlayhatchrect.hxx
+++ b/svx/inc/svx/sdr/overlay/overlayhatchrect.hxx
@@ -47,38 +47,30 @@ namespace sdr
{
// geometric definitions
basegfx::B2DPoint maSecondPosition;
- const double mfDiscreteWidth;
+ const double mfDiscreteGrow;
+ const double mfDiscreteShrink;
const double mfHatchRotation;
const double mfRotation;
- // helper to create visualisation geometry from above values
- basegfx::B2DPolyPolygon getGeometry(OutputDevice& rOutputDevice);
-
- // Draw geometry
- virtual void drawGeometry(OutputDevice& rOutputDevice);
-
- // Create the BaseRange. This method needs to calculate maBaseRange.
- virtual void createBaseRange(OutputDevice& rOutputDevice);
+ // geometry creation for OverlayObject
+ virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence();
public:
OverlayHatchRect(
const basegfx::B2DPoint& rBasePosition,
const basegfx::B2DPoint& rSecondPosition,
const Color& rHatchColor,
- double fDiscreteWidth,
+ double fDiscreteGrow,
+ double fDiscreteShrink,
double fHatchRotation,
double fRotation);
const basegfx::B2DPoint& getSecondPosition() const { return maSecondPosition; }
void setSecondPosition(const basegfx::B2DPoint&);
- // Zoom has changed. If the objects logical size
- // depends on the MapMode of the used OutputDevice, use this call
- // to invalidate the range in logical coordinates.
- virtual void zoomHasChanged();
-
// data read access
- double getDiscreteWidth() const { return mfDiscreteWidth; }
+ double getDiscreteGrow() const { return mfDiscreteGrow; }
+ double getDiscreteShrink() const { return mfDiscreteShrink; }
double getHatchRotation() const { return mfHatchRotation; }
double getRotation() const { return mfRotation; }
};
diff --git a/svx/inc/svx/sdr/overlay/overlayhelpline.hxx b/svx/inc/svx/sdr/overlay/overlayhelpline.hxx
index f171a39a67..b51a91621b 100644
--- a/svx/inc/svx/sdr/overlay/overlayhelpline.hxx
+++ b/svx/inc/svx/sdr/overlay/overlayhelpline.hxx
@@ -46,11 +46,8 @@ namespace sdr
// remember HelpLineKind
SdrHelpLineKind meKind;
- // Draw geometry
- virtual void drawGeometry(OutputDevice& rOutputDevice);
-
- // Create the BaseRange. This method needs to calculate maBaseRange.
- virtual void createBaseRange(OutputDevice& rOutputDevice);
+ // geometry creation for OverlayObject
+ virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence();
public:
OverlayHelplineStriped(
@@ -58,30 +55,11 @@ namespace sdr
SdrHelpLineKind eNewKind = SDRHELPLINE_POINT);
virtual ~OverlayHelplineStriped();
- // Hittest with logical coordinates
- virtual sal_Bool isHit(const basegfx::B2DPoint& rPos, double fTol = 0.0) const;
- };
- } // end of namespace overlay
-} // end of namespace sdr
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace sdr
-{
- namespace overlay
- {
- class OverlayHelpline : public OverlayHelplineStriped
- {
- protected:
- // Draw geometry
- virtual void drawGeometry(OutputDevice& rOutputDevice);
+ // dat read access
+ SdrHelpLineKind getKind() const { return meKind; }
- public:
- OverlayHelpline(
- const basegfx::B2DPoint& rBasePos,
- Color aLineColor = Color(COL_BLACK),
- SdrHelpLineKind eNewKind = SDRHELPLINE_POINT);
- virtual ~OverlayHelpline();
+ // react on stripe definition change
+ virtual void stripeDefinitionHasChanged();
};
} // end of namespace overlay
} // end of namespace sdr
diff --git a/svx/inc/svx/sdr/overlay/overlayline.hxx b/svx/inc/svx/sdr/overlay/overlayline.hxx
index b8aa0056bd..314589c47c 100644
--- a/svx/inc/svx/sdr/overlay/overlayline.hxx
+++ b/svx/inc/svx/sdr/overlay/overlayline.hxx
@@ -45,11 +45,8 @@ namespace sdr
// second position in pixel
basegfx::B2DPoint maSecondPosition;
- // Draw geometry
- virtual void drawGeometry(OutputDevice& rOutputDevice);
-
- // Create the BaseRange. This method needs to calculate maBaseRange.
- virtual void createBaseRange(OutputDevice& rOutputDevice);
+ // geometry creation for OverlayObject
+ virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence();
public:
OverlayLineStriped(
@@ -61,33 +58,8 @@ namespace sdr
const basegfx::B2DPoint& getSecondPosition() const { return maSecondPosition; }
void setSecondPosition(const basegfx::B2DPoint& rNew);
- // Hittest with logical coordinates
- virtual sal_Bool isHit(const basegfx::B2DPoint& rPos, double fTol = 0.0) const;
-
- // transform object coordinates. Needs to transform maSecondPosition.
- virtual void transform(const basegfx::B2DHomMatrix& rMatrix);
- };
- } // end of namespace overlay
-} // end of namespace sdr
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace sdr
-{
- namespace overlay
- {
- class OverlayLine : public OverlayLineStriped
- {
- protected:
- // Draw geometry
- virtual void drawGeometry(OutputDevice& rOutputDevice);
-
- public:
- OverlayLine(
- const basegfx::B2DPoint& rBasePos,
- const basegfx::B2DPoint& rSecondPos,
- Color aLineColor = Color(COL_BLACK));
- virtual ~OverlayLine();
+ // react on stripe definition change
+ virtual void stripeDefinitionHasChanged();
};
} // end of namespace overlay
} // end of namespace sdr
diff --git a/svx/inc/svx/sdr/overlay/overlaymanager.hxx b/svx/inc/svx/sdr/overlay/overlaymanager.hxx
index 9b22f9b46f..1ca348a244 100644
--- a/svx/inc/svx/sdr/overlay/overlaymanager.hxx
+++ b/svx/inc/svx/sdr/overlay/overlaymanager.hxx
@@ -38,7 +38,6 @@
#include <tools/color.hxx>
#include "svx/svxdllapi.h"
#include <svtools/optionsdrawinglayer.hxx>
-#include <boost/shared_ptr.hpp>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <drawinglayer/geometry/viewinformation2d.hxx>
@@ -68,14 +67,9 @@ namespace sdr
// the OutputDevice to work on, set on construction and not to be changed
OutputDevice& rmOutputDevice;
- // start, end and number of the double linked list of OverlayObjects
- // managed by this manager
- OverlayObject* mpOverlayObjectStart;
- OverlayObject* mpOverlayObjectEnd;
-
- // MapMode for MapMode change watching
- MapMode maMapMode;
-
+ // the vector of registered OverlayObjects
+ OverlayObjectVector maOverlayObjects;
+
// Stripe support. All striped OverlayObjects use these stripe
// values. Changes change all those objects.
Color maStripeColorA; // defaults to Color(COL_BLACK)
@@ -88,23 +82,33 @@ namespace sdr
// hold buffered the logic length of discrete vector (1.0, 0.0) and the
// view transformation belonging to it. Update happens in getDiscreteOne()
basegfx::B2DHomMatrix maViewTransformation;
+ drawinglayer::geometry::ViewInformation2D maViewInformation2D;
double mfDiscreteOne;
// internal
void ImpDrawMembers(const basegfx::B2DRange& rRange, OutputDevice& rDestinationDevice) const;
- void ImpCheckMapModeChange() const;
void ImpStripeDefinitionChanged();
+ void impApplyRemoveActions(OverlayObject& rTarget);
+ void impApplyAddActions(OverlayObject& rTarget);
// return mfDiscreteOne to derivations, but also check for buffered local
// ViewTransformation and evtl. correct mfDiscreteOne
double getDiscreteOne() const;
public:
- OverlayManager(OutputDevice& rOutputDevice);
+ // when handing over another OverlayManager at construction, the OverlayObjects
+ // will be taken over from it. The new one will have added all OverlayObjects
+ // while the handed over one will have none
+ OverlayManager(
+ OutputDevice& rOutputDevice,
+ OverlayManager* pOldOverlayManager = 0);
virtual ~OverlayManager();
+ // access to current ViewInformation2D; this call checks and evtl. updates ViewInformation2D
+ const drawinglayer::geometry::ViewInformation2D getCurrentViewInformation2D() const;
+
// complete redraw
- virtual void completeRedraw(const Region& rRegion, OutputDevice* pPreRenderDevice = 0L) const;
+ virtual void completeRedraw(const Region& rRegion, OutputDevice* pPreRenderDevice = 0) const;
// flush. Do buffered updates.
virtual void flush();
@@ -139,17 +143,6 @@ namespace sdr
// access to maDrawinglayerOpt
const SvtOptionsDrawinglayer& getDrawinglayerOpt() const { return maDrawinglayerOpt; }
-
- /** Return a list of all OverlayObjects that currently belong to
- the called OverlayManager. Subsequent calls to add() or
- remove() will not alter the content of the returned list.
- Modifying the list will not change the list of
- OverlayObjects that belong to the called OverlayManager.
- @return
- The returned pointer is never empty but the pointed-to
- vector may be.
- */
- ::boost::shared_ptr<OverlayObjectVector> GetOverlayObjects (void) const;
};
} // end of namespace overlay
} // end of namespace sdr
diff --git a/svx/inc/svx/sdr/overlay/overlaymanagerbuffered.hxx b/svx/inc/svx/sdr/overlay/overlaymanagerbuffered.hxx
index 5f3d7d3df5..709f3be982 100644
--- a/svx/inc/svx/sdr/overlay/overlaymanagerbuffered.hxx
+++ b/svx/inc/svx/sdr/overlay/overlaymanagerbuffered.hxx
@@ -65,7 +65,7 @@ namespace sdr
// bitfield
// Flag to decide if PreRendering shall be used for overlay refreshes.
- // Default is sal_False.
+ // Default is false.
unsigned mbRefreshWithPreRendering : 1;
// link for timer
@@ -78,7 +78,13 @@ namespace sdr
void ImpSaveBackground(const Region& rRegion, OutputDevice* pPreRenderDevice = 0L);
public:
- OverlayManagerBuffered(OutputDevice& rOutputDevice, sal_Bool bRefreshWithPreRendering = sal_False);
+ // when handing over another OverlayManager at construction, the OverlayObjects
+ // will be taken over from it. The new one will have added all OverlayObjects
+ // while the handed over one will have none
+ OverlayManagerBuffered(
+ OutputDevice& rOutputDevice,
+ OverlayManager* pOldOverlayManager = 0,
+ bool bRefreshWithPreRendering = false);
virtual ~OverlayManagerBuffered();
// complete redraw
@@ -97,8 +103,8 @@ namespace sdr
virtual void invalidateRange(const basegfx::B2DRange& rRange);
// access to RefreshWithPreRendering Flag
- sal_Bool DoRefreshWithPreRendering() const { return mbRefreshWithPreRendering; }
- void SetRefreshWithPreRendering(sal_Bool bNew);
+ bool DoRefreshWithPreRendering() const { return mbRefreshWithPreRendering; }
+ void SetRefreshWithPreRendering(bool bNew);
};
} // end of namespace overlay
} // end of namespace sdr
diff --git a/svx/inc/svx/sdr/overlay/overlayobject.hxx b/svx/inc/svx/sdr/overlay/overlayobject.hxx
index 3d8c4fbc29..a48afed140 100644
--- a/svx/inc/svx/sdr/overlay/overlayobject.hxx
+++ b/svx/inc/svx/sdr/overlay/overlayobject.hxx
@@ -36,6 +36,7 @@
#include <tools/color.hxx>
#include <svx/sdr/animation/scheduler.hxx>
#include "svx/svxdllapi.h"
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
#include <vector>
@@ -65,60 +66,64 @@ namespace sdr
{
namespace overlay
{
- class SVX_DLLPUBLIC OverlayObject : public ::sdr::animation::Event
+ class SVX_DLLPUBLIC OverlayObject : private ::boost::noncopyable, public ::sdr::animation::Event
{
- // Manager is allowed access to private Members, especially
- // pNext and pPrevious are used form the manager to handle the
- // OverlayObject.
- friend class OverlayManager;
+ private:
+ // Manager is allowed access to private Member mpOverlayManager
+ friend class OverlayManager;
// pointer to OverlayManager, if object is added. Changed by
// OverlayManager, do not chnge Yourself.
- OverlayManager* mpOverlayManager;
+ OverlayManager* mpOverlayManager;
- // Chaining of IAO's, used by OverlayManager. These will be
- // used form the OverlayManager, so do not change them Yourself.
- OverlayObject* mpNext;
- OverlayObject* mpPrevious;
+ // Primitive2DSequence of the OverlayObject
+ drawinglayer::primitive2d::Primitive2DSequence maPrimitive2DSequence;
protected:
+ // access methods to maPrimitive2DSequence. The usage of this methods may allow
+ // later thread-safe stuff to be added if needed. Only to be used by getPrimitive2DSequence()
+ // implementations for buffering the last decomposition.
+ const drawinglayer::primitive2d::Primitive2DSequence& getPrimitive2DSequence() const { return maPrimitive2DSequence; }
+ void setPrimitive2DSequence(const drawinglayer::primitive2d::Primitive2DSequence& rNew) { maPrimitive2DSequence = rNew; }
+
+ // the creation method for Primitive2DSequence. Called when getPrimitive2DSequence()
+ // sees that maPrimitive2DSequence is empty. Needs to be supported by all
+ // OverlayObject implementations. Default implementation will assert
+ // a missing implementation
+ virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence();
+
// region in logical coordinates
- basegfx::B2DRange maBaseRange;
+ basegfx::B2DRange maBaseRange;
// base color of this OverlayObject
- Color maBaseColor;
+ Color maBaseColor;
// bitfield
// Flag for visibility
- unsigned mbIsVisible : 1;
-
- // Flag for validity
- unsigned mbIsChanged : 1;
+ unsigned mbIsVisible : 1;
// Flag to control hittability
- unsigned mbIsHittable : 1;
+ unsigned mbIsHittable : 1;
// Flag to hold info if this objects supports animation. Default is
- // sal_False. If sal_True, the Trigger() method should be overloaded
+ // false. If true, the Trigger() method should be overloaded
// to implement the animation effect and to re-initiate the event.
- unsigned mbAllowsAnimation : 1;
+ unsigned mbAllowsAnimation : 1;
- // Draw geometry
- virtual void drawGeometry(OutputDevice& rOutputDevice) = 0;
-
- // Create the BaseRange. This method needs to calculate maBaseRange.
- virtual void createBaseRange(OutputDevice& rOutputDevice) = 0;
+ // Flag tocontrol if this OverlayObject allows AntiAliased visualisation.
+ // Default is true, but e.g. for selection visualisation in SC and SW,
+ // it is switched to false
+ unsigned mbAllowsAntiAliase : 1;
// set changed flag. Call after change, since the old range is invalidated
// and then the new one is calculated and invalidated, too. This will only
// work after the change.
- void objectChange();
+ virtual void objectChange();
- // support method to draw striped geometries
- void ImpDrawRangeStriped(OutputDevice& rOutputDevice, const basegfx::B2DRange& rRange);
- void ImpDrawLineStriped(OutputDevice& rOutputDevice, double x1, double y1, double x2, double y2);
- void ImpDrawLineStriped(OutputDevice& rOutputDevice, const basegfx::B2DPoint& rStart, const basegfx::B2DPoint& rEnd);
- void ImpDrawPolygonStriped(OutputDevice& rOutputDevice, const basegfx::B2DPolygon& rPolygon);
+ // write access to AntiAliase flag. This is protected since
+ // only implementations are allowed to change this, preferrably in their
+ // constructor
+ void allowAntiAliase(bool bNew);
public:
OverlayObject(Color aBaseColor);
@@ -127,19 +132,21 @@ namespace sdr
// get OverlayManager
OverlayManager* getOverlayManager() const { return mpOverlayManager; }
- // Hittest with logical coordinates. Default tests against maBaseRange.
- virtual sal_Bool isHit(const basegfx::B2DPoint& rPos, double fTol = 0.0) const;
+ // the access method for Primitive2DSequence. Will use createPrimitive2DSequence and
+ // setPrimitive2DSequence if needed. Overloading may be used to allow disposal of last
+ // created primitives to react on changed circumstances and to re-create primitives
+ virtual drawinglayer::primitive2d::Primitive2DSequence getOverlayObjectPrimitive2DSequence() const;
// access to visibility state
- sal_Bool isVisible() const { return mbIsVisible; }
- void setVisible(sal_Bool bNew);
-
- // read access to changed flag
- sal_Bool isChanged() const { return mbIsChanged; }
+ bool isVisible() const { return mbIsVisible; }
+ void setVisible(bool bNew);
// access to hittable flag
- sal_Bool isHittable() const { return mbIsHittable; }
- void setHittable(sal_Bool bNew);
+ bool isHittable() const { return mbIsHittable; }
+ void setHittable(bool bNew);
+
+ // read access to AntiAliase flag
+ bool allowsAntiAliase() const { return mbAllowsAntiAliase; }
// read access to baseRange. This may trigger createBaseRange() if
// object is changed.
@@ -154,16 +161,7 @@ namespace sdr
virtual void Trigger(sal_uInt32 nTime);
// acces to AllowsAnimation flag
- sal_Bool allowsAnimation() const { return mbAllowsAnimation; }
-
- // transform object coordinates.
- virtual void transform(const basegfx::B2DHomMatrix& rMatrix) = 0;
-
- // Zoom has changed. If the objects logical size
- // depends on the MapMode of the used OutputDevice, use this call
- // to invalidate the range in logical coordinates. Default is no
- // change.
- virtual void zoomHasChanged();
+ bool allowsAnimation() const { return mbAllowsAnimation; }
// stripe definition has changed. The OverlayManager does have
// support data to draw graphics in two colors striped. This
@@ -197,10 +195,6 @@ namespace sdr
// access to basePosition
const basegfx::B2DPoint& getBasePosition() const { return maBasePosition; }
void setBasePosition(const basegfx::B2DPoint& rNew);
-
- // transform object coordinates. Transforms maBasePosition
- // and invalidates on change
- virtual void transform(const basegfx::B2DHomMatrix& rMatrix);
};
} // end of namespace overlay
} // end of namespace sdr
diff --git a/svx/inc/svx/sdr/overlay/overlayobjectcell.hxx b/svx/inc/svx/sdr/overlay/overlayobjectcell.hxx
index 3a9cf12173..2c9c26888b 100644
--- a/svx/inc/svx/sdr/overlay/overlayobjectcell.hxx
+++ b/svx/inc/svx/sdr/overlay/overlayobjectcell.hxx
@@ -42,7 +42,7 @@ namespace sdr
{
namespace overlay
{
- enum CellOverlayType { CELL_OVERLAY_INVERT, CELL_OVERLAY_HATCH, CELL_OVERLAY_TRANSPARENT, CELL_OVERLAY_LIGHT_TRANSPARENT };
+ enum CellOverlayType { CELL_OVERLAY_INVERT, CELL_OVERLAY_TRANSPARENT };
// OverlayObjectCell - used for cell cursor, selection and AutoFill handle
@@ -55,14 +55,12 @@ namespace sdr
CellOverlayType mePaintType;
RangeVector maRectangles;
- virtual void drawGeometry(OutputDevice& rOutputDevice);
- virtual void createBaseRange(OutputDevice& rOutputDevice);
+ // geometry creation for OverlayObject
+ virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence();
public:
OverlayObjectCell( CellOverlayType eType, const Color& rColor, const RangeVector& rRects);
virtual ~OverlayObjectCell();
-
- virtual void transform(const basegfx::B2DHomMatrix& rMatrix);
};
} // end of namespace overlay
diff --git a/svx/inc/svx/sdr/overlay/overlayobjectlist.hxx b/svx/inc/svx/sdr/overlay/overlayobjectlist.hxx
index 30e7e62130..2b87ed1917 100644
--- a/svx/inc/svx/sdr/overlay/overlayobjectlist.hxx
+++ b/svx/inc/svx/sdr/overlay/overlayobjectlist.hxx
@@ -70,16 +70,13 @@ namespace sdr
OverlayObject& getOverlayObject(sal_uInt32 nIndex) const { return *(maVector[nIndex]); }
// Hittest with logical coordinates
- sal_Bool isHit(const basegfx::B2DPoint& rPos, double fTol = 0.0) const;
+ bool isHitLogic(const basegfx::B2DPoint& rLogicPosition, double fLogicTolerance = 0.0) const;
// Hittest with pixel coordinates and pixel tolerance
- sal_Bool isHitPixel(const Point& rPos, sal_uInt32 nTol = DEFAULT_VALUE_FOR_HITTEST_PIXEL) const;
+ bool isHitPixel(const Point& rDiscretePosition, sal_uInt32 fDiscreteTolerance = DEFAULT_VALUE_FOR_HITTEST_PIXEL) const;
// calculate BaseRange of all included OverlayObjects and return
basegfx::B2DRange getBaseRange() const;
-
- // transform all members coordinates
- void transform(const basegfx::B2DHomMatrix& rMatrix);
};
} // end of namespace overlay
} // end of namespace sdr
diff --git a/svx/inc/svx/sdr/overlay/overlaypolypolygon.hxx b/svx/inc/svx/sdr/overlay/overlaypolypolygon.hxx
index d6d48c02ce..523a9ba652 100644
--- a/svx/inc/svx/sdr/overlay/overlaypolypolygon.hxx
+++ b/svx/inc/svx/sdr/overlay/overlaypolypolygon.hxx
@@ -46,11 +46,8 @@ namespace sdr
// geometry
basegfx::B2DPolyPolygon maPolyPolygon;
- // Draw geometry
- virtual void drawGeometry(OutputDevice& rOutputDevice);
-
- // Create the BaseRange. This method needs to calculate maBaseRange.
- virtual void createBaseRange(OutputDevice& rOutputDevice);
+ // geometry creation for OverlayObject
+ virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence();
public:
OverlayPolyPolygonStriped(const basegfx::B2DPolyPolygon& rPolyPolygon);
@@ -60,33 +57,8 @@ namespace sdr
basegfx::B2DPolyPolygon getPolyPolygon() const { return maPolyPolygon; }
void setPolyPolygon(const basegfx::B2DPolyPolygon& rNew);
- // Hittest with logical coordinates
- virtual sal_Bool isHit(const basegfx::B2DPoint& rPos, double fTol = 0.0) const;
-
- // transform object coordinates. Needs to transform maSecondPosition
- // and maThirdPosition.
- virtual void transform(const basegfx::B2DHomMatrix& rMatrix);
- };
- } // end of namespace overlay
-} // end of namespace sdr
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace sdr
-{
- namespace overlay
- {
- class OverlayPolyPolygon : public OverlayPolyPolygonStriped
- {
- protected:
- // Draw geometry
- virtual void drawGeometry(OutputDevice& rOutputDevice);
-
- public:
- OverlayPolyPolygon(
- const basegfx::B2DPolyPolygon& rPolyPolygon,
- Color aPolygonColor = Color(COL_BLACK));
- virtual ~OverlayPolyPolygon();
+ // react on stripe definition change
+ virtual void stripeDefinitionHasChanged();
};
} // end of namespace overlay
} // end of namespace sdr
diff --git a/svx/inc/svx/sdr/overlay/overlayprimitive2dsequenceobject.hxx b/svx/inc/svx/sdr/overlay/overlayprimitive2dsequenceobject.hxx
index 8208e1a298..68ece1cb77 100644
--- a/svx/inc/svx/sdr/overlay/overlayprimitive2dsequenceobject.hxx
+++ b/svx/inc/svx/sdr/overlay/overlayprimitive2dsequenceobject.hxx
@@ -41,20 +41,14 @@ namespace sdr
{
namespace overlay
{
- class OverlayPrimitive2DSequenceObject : public OverlayObjectWithBasePosition
+ class SVX_DLLPUBLIC OverlayPrimitive2DSequenceObject : public OverlayObjectWithBasePosition
{
protected:
// the sequence of primitives to show
const drawinglayer::primitive2d::Primitive2DSequence maSequence;
- // Draw geometry
- virtual void drawGeometry(OutputDevice& rOutputDevice);
-
- // Create the BaseRange. This method needs to calculate maBaseRange.
- virtual void createBaseRange(OutputDevice& rOutputDevice);
-
- // Hittest with logical coordinates. Default tests against maBaseRange.
- virtual sal_Bool isHit(const basegfx::B2DPoint& rPos, double fTol = 0.0) const;
+ // geometry creation for OverlayObject
+ virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence();
private:
// internal helper to create a drawinglayer::geometry::ViewInformation2D
diff --git a/svx/inc/svx/sdr/overlay/overlayrollingrectangle.hxx b/svx/inc/svx/sdr/overlay/overlayrollingrectangle.hxx
index 574fb8f3cb..9b875ffdba 100644
--- a/svx/inc/svx/sdr/overlay/overlayrollingrectangle.hxx
+++ b/svx/inc/svx/sdr/overlay/overlayrollingrectangle.hxx
@@ -52,18 +52,15 @@ namespace sdr
// Flag to switch on/off the bounds itself
unsigned mbShowBounds : 1;
- // Draw geometry
- virtual void drawGeometry(OutputDevice& rOutputDevice);
-
- // Create the BaseRange. This method needs to calculate maBaseRange.
- virtual void createBaseRange(OutputDevice& rOutputDevice);
+ // geometry creation for OverlayObject
+ virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence();
public:
OverlayRollingRectangleStriped(
const basegfx::B2DPoint& rBasePos,
const basegfx::B2DPoint& rSecondPos,
- sal_Bool bExtendedLines = sal_False,
- sal_Bool bShowBounds = sal_True);
+ bool bExtendedLines = false,
+ bool bShowBounds = true);
virtual ~OverlayRollingRectangleStriped();
// change second position
@@ -71,42 +68,15 @@ namespace sdr
void setSecondPosition(const basegfx::B2DPoint& rNew);
// change extended lines
- sal_Bool getExtendedLines() const { return mbExtendedLines; }
- void setExtendedLines(sal_Bool bNew);
+ bool getExtendedLines() const { return mbExtendedLines; }
+ void setExtendedLines(bool bNew);
// change show bounds
- sal_Bool getShowBounds() const { return mbShowBounds; }
- void setShowBounds(sal_Bool bNew);
-
- // Hittest with logical coordinates
- virtual sal_Bool isHit(const basegfx::B2DPoint& rPos, double fTol = 0.0) const;
-
- // transform object coordinates. Needs to transform maSecondPosition.
- virtual void transform(const basegfx::B2DHomMatrix& rMatrix);
- };
- } // end of namespace overlay
-} // end of namespace sdr
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace sdr
-{
- namespace overlay
- {
- class OverlayRollingRectangle : public OverlayRollingRectangleStriped
- {
- protected:
- // Draw geometry
- virtual void drawGeometry(OutputDevice& rOutputDevice);
+ bool getShowBounds() const { return mbShowBounds; }
+ void setShowBounds(bool bNew);
- public:
- OverlayRollingRectangle(
- const basegfx::B2DPoint& rBasePos,
- const basegfx::B2DPoint& rSecondPos,
- Color aLineColor = Color(COL_BLACK),
- sal_Bool bExtendedLines = sal_False,
- sal_Bool bShowBounds = sal_True);
- virtual ~OverlayRollingRectangle();
+ // react on stripe definition change
+ virtual void stripeDefinitionHasChanged();
};
} // end of namespace overlay
} // end of namespace sdr
diff --git a/svx/inc/svx/sdr/overlay/overlayselection.hxx b/svx/inc/svx/sdr/overlay/overlayselection.hxx
new file mode 100644
index 0000000000..f6d3539877
--- /dev/null
+++ b/svx/inc/svx/sdr/overlay/overlayselection.hxx
@@ -0,0 +1,98 @@
+/*************************************************************************
+ *
+ * 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: overlayline.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 _SDR_OVERLAY_OVERLAYSELECTION_HXX
+#define _SDR_OVERLAY_OVERLAYSELECTION_HXX
+
+#include <svx/sdr/overlay/overlayobject.hxx>
+#include <vcl/region.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace overlay
+ {
+ // overlay type definition
+ enum OverlayType
+ {
+ OVERLAY_INVERT,
+ OVERLAY_SOLID,
+ OVERLAY_TRANSPARENT
+ };
+
+ class SVX_DLLPUBLIC OverlaySelection : public OverlayObject
+ {
+ protected:
+ // type of overlay
+ OverlayType meOverlayType;
+
+ // geometry of overlay
+ std::vector< basegfx::B2DRange > maRanges;
+
+ // Values of last primitive creation. These are checked in getOverlayObjectPrimitive2DSequence
+ // to evtl. get rid of last Primitive2DSequence. This ensures that these values are up-to-date
+ // and are usable when creating primitives
+ OverlayType maLastOverlayType;
+ sal_uInt16 mnLastTransparence;
+
+ // bitfield
+ unsigned mbBorder : 1;
+
+ // geometry creation for OverlayObject, can use local *Last* values
+ virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence();
+
+ public:
+ OverlaySelection(
+ OverlayType eType,
+ const Color& rColor,
+ const std::vector< basegfx::B2DRange >& rRanges,
+ bool bBorder);
+ virtual ~OverlaySelection();
+
+ // data read access
+ const OverlayType getOverlayType() const { return meOverlayType; }
+ const std::vector< basegfx::B2DRange >& getRanges() const { return maRanges; }
+ bool getBorder() const { return mbBorder; }
+
+ // overloaded to check conditions for last createOverlayObjectPrimitive2DSequence
+ virtual drawinglayer::primitive2d::Primitive2DSequence getOverlayObjectPrimitive2DSequence() const;
+
+ // data write access
+ void setRanges(const std::vector< basegfx::B2DRange >& rNew);
+ };
+ } // end of namespace overlay
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_OVERLAY_OVERLAYSELECTION_HXX
+
+// eof
diff --git a/svx/inc/svx/sdr/overlay/overlaytools.hxx b/svx/inc/svx/sdr/overlay/overlaytools.hxx
new file mode 100644
index 0000000000..761b588f1d
--- /dev/null
+++ b/svx/inc/svx/sdr/overlay/overlaytools.hxx
@@ -0,0 +1,281 @@
+/*************************************************************************
+ *
+ * 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: overlayobject.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 _SDR_OVERLAY_OVERLAYTOOLS_HXX
+#define _SDR_OVERLAY_OVERLAYTOOLS_HXX
+
+#include <drawinglayer/primitive2d/primitivetools2d.hxx>
+#include <vcl/bitmapex.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// Overlay helper class which holds a BotmapEx which is to be visualized
+// at the given logic position with the Bitmap's pixel size, unscaled and
+// unrotated (like a marker). The discrete pixel on the bitmap assocciated
+// with the target position is given in discrete X,Y coordinates
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ class OverlayBitmapExPrimitive : public DiscreteMetricDependentPrimitive2D
+ {
+ private:
+ // The BitmapEx to use, PixelSize is used
+ BitmapEx maBitmapEx;
+
+ // The logic position
+ basegfx::B2DPoint maBasePosition;
+
+ // The pixel inside the BitmapEx which is assocciated with
+ // the target position (offset in the bitmap)
+ sal_uInt16 mnCenterX;
+ sal_uInt16 mnCenterY;
+
+ protected:
+ virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ OverlayBitmapExPrimitive(
+ const BitmapEx& rBitmapEx,
+ const basegfx::B2DPoint& rBasePosition,
+ sal_uInt16 nCenterX,
+ sal_uInt16 nCenterY);
+
+ // data access
+ const BitmapEx& getBitmapEx() const { return maBitmapEx; }
+ const basegfx::B2DPoint& getBasePosition() const { return maBasePosition; }
+ sal_uInt16 getCenterX() const { return mnCenterX; }
+ sal_uInt16 getCenterY() const { return mnCenterY; }
+
+ // compare operator
+ virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
+
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// Overlay helper class for a crosshair
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ class OverlayCrosshairPrimitive : public ViewportDependentPrimitive2D
+ {
+ private:
+ // The logic position
+ basegfx::B2DPoint maBasePosition;
+
+ // The stripe colors and legth
+ basegfx::BColor maRGBColorA;
+ basegfx::BColor maRGBColorB;
+ double mfDiscreteDashLength;
+
+ protected:
+ virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ OverlayCrosshairPrimitive(
+ const basegfx::B2DPoint& rBasePosition,
+ const basegfx::BColor& rRGBColorA,
+ const basegfx::BColor& rRGBColorB,
+ double fDiscreteDashLength);
+
+ // data access
+ const basegfx::B2DPoint& getBasePosition() const { return maBasePosition; }
+ const basegfx::BColor& getRGBColorA() const { return maRGBColorA; }
+ const basegfx::BColor& getRGBColorB() const { return maRGBColorB; }
+ double getDiscreteDashLength() const { return mfDiscreteDashLength; }
+
+ // compare operator
+ virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
+
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// Overlay helper class for a hatch rectangle as used e.g. for text object
+// selection hilighting
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ class OverlayHatchRectanglePrimitive : public DiscreteMetricDependentPrimitive2D
+ {
+ private:
+ // the logic rectangle definition
+ basegfx::B2DRange maObjectRange;
+
+ // the hatch definition
+ double mfDiscreteHatchDistance;
+ double mfHatchRotation;
+ basegfx::BColor maHatchColor;
+
+ // the dscrete grow and shrink of the box
+ double mfDiscreteGrow;
+ double mfDiscreteShrink;
+
+ // the rotation of the primitive itself
+ double mfRotation;
+
+ protected:
+ virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ OverlayHatchRectanglePrimitive(
+ const basegfx::B2DRange& rObjectRange,
+ double fDiscreteHatchDistance,
+ double fHatchRotation,
+ const basegfx::BColor& rHatchColor,
+ double fDiscreteGrow,
+ double fDiscreteShrink,
+ double fRotation);
+
+ // data access
+ const basegfx::B2DRange& getObjectRange() const { return maObjectRange; }
+ double getDiscreteHatchDistance() const { return mfDiscreteHatchDistance; }
+ double getHatchRotation() const { return mfHatchRotation; }
+ const basegfx::BColor& getHatchColor() const { return maHatchColor; }
+ double getDiscreteGrow() const { return mfDiscreteGrow; }
+ double getDiscreteShrink() const { return mfDiscreteShrink; }
+ double getRotation() const { return mfRotation; }
+
+ // compare operator
+ virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
+
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// Overlay helper class for a striped helpline
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ enum HelplineStyle
+ {
+ HELPLINESTYLE_POINT,
+ HELPLINESTYLE_VERTICAL,
+ HELPLINESTYLE_HORIZONTAL
+ };
+
+ class OverlayHelplineStripedPrimitive : public ViewportDependentPrimitive2D
+ {
+ private:
+ // The logic position
+ basegfx::B2DPoint maBasePosition;
+
+ // the style
+ HelplineStyle meStyle;
+
+ // The stripe colors and legth
+ basegfx::BColor maRGBColorA;
+ basegfx::BColor maRGBColorB;
+ double mfDiscreteDashLength;
+
+ protected:
+ virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ OverlayHelplineStripedPrimitive(
+ const basegfx::B2DPoint& rBasePosition,
+ HelplineStyle eStyle,
+ const basegfx::BColor& rRGBColorA,
+ const basegfx::BColor& rRGBColorB,
+ double fDiscreteDashLength);
+
+ // data access
+ const basegfx::B2DPoint& getBasePosition() const { return maBasePosition; }
+ HelplineStyle getStyle() const { return meStyle; }
+ const basegfx::BColor& getRGBColorA() const { return maRGBColorA; }
+ const basegfx::BColor& getRGBColorB() const { return maRGBColorB; }
+ double getDiscreteDashLength() const { return mfDiscreteDashLength; }
+
+ // compare operator
+ virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
+
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// Overlay helper class for rolling rectangle helplines. This primitive is
+// only for the extended lines to the ends of the view
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ class OverlayRollingRectanglePrimitive : public ViewportDependentPrimitive2D
+ {
+ private:
+ // The logic range
+ basegfx::B2DRange maRollingRectangle;
+
+ // The stripe colors and legth
+ basegfx::BColor maRGBColorA;
+ basegfx::BColor maRGBColorB;
+ double mfDiscreteDashLength;
+
+ protected:
+ virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ OverlayRollingRectanglePrimitive(
+ const basegfx::B2DRange& aRollingRectangle,
+ const basegfx::BColor& rRGBColorA,
+ const basegfx::BColor& rRGBColorB,
+ double fDiscreteDashLength);
+
+ // data access
+ const basegfx::B2DRange& getRollingRectangle() const { return maRollingRectangle; }
+ const basegfx::BColor& getRGBColorA() const { return maRGBColorA; }
+ const basegfx::BColor& getRGBColorB() const { return maRGBColorB; }
+ double getDiscreteDashLength() const { return mfDiscreteDashLength; }
+
+ // compare operator
+ virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
+
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_OVERLAY_OVERLAYTOOLS_HXX
+
+// eof
diff --git a/svx/inc/svx/sdr/overlay/overlaytriangle.hxx b/svx/inc/svx/sdr/overlay/overlaytriangle.hxx
index 268460e71b..b9a175fa90 100644
--- a/svx/inc/svx/sdr/overlay/overlaytriangle.hxx
+++ b/svx/inc/svx/sdr/overlay/overlaytriangle.hxx
@@ -39,25 +39,23 @@ namespace sdr
{
namespace overlay
{
- class OverlayTriangleStriped : public OverlayObjectWithBasePosition
+ class OverlayTriangle : public OverlayObjectWithBasePosition
{
protected:
// second and third position in pixel
basegfx::B2DPoint maSecondPosition;
basegfx::B2DPoint maThirdPosition;
- // Draw geometry
- virtual void drawGeometry(OutputDevice& rOutputDevice);
-
- // Create the BaseRange. This method needs to calculate maBaseRange.
- virtual void createBaseRange(OutputDevice& rOutputDevice);
+ // geometry creation for OverlayObject
+ virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence();
public:
- OverlayTriangleStriped(
+ OverlayTriangle(
const basegfx::B2DPoint& rBasePos,
const basegfx::B2DPoint& rSecondPos,
- const basegfx::B2DPoint& rThirdPos);
- virtual ~OverlayTriangleStriped();
+ const basegfx::B2DPoint& rThirdPos,
+ Color aTriangleColor);
+ virtual ~OverlayTriangle();
// change second position
const basegfx::B2DPoint& getSecondPosition() const { return maSecondPosition; }
@@ -66,36 +64,6 @@ namespace sdr
// change third position
const basegfx::B2DPoint& getThirdPosition() const { return maThirdPosition; }
void setThirdPosition(const basegfx::B2DPoint& rNew);
-
- // Hittest with logical coordinates
- virtual sal_Bool isHit(const basegfx::B2DPoint& rPos, double fTol = 0.0) const;
-
- // transform object coordinates. Needs to transform maSecondPosition
- // and maThirdPosition.
- virtual void transform(const basegfx::B2DHomMatrix& rMatrix);
- };
- } // end of namespace overlay
-} // end of namespace sdr
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace sdr
-{
- namespace overlay
- {
- class OverlayTriangle : public OverlayTriangleStriped
- {
- protected:
- // Draw geometry
- virtual void drawGeometry(OutputDevice& rOutputDevice);
-
- public:
- OverlayTriangle(
- const basegfx::B2DPoint& rBasePos,
- const basegfx::B2DPoint& rSecondPos,
- const basegfx::B2DPoint& rThirdPos,
- Color aTriangleColor = Color(COL_BLACK));
- virtual ~OverlayTriangle();
};
} // end of namespace overlay
} // end of namespace sdr
diff --git a/svx/inc/svx/sdr/primitive2d/primitiveFactory2d.hxx b/svx/inc/svx/sdr/primitive2d/primitiveFactory2d.hxx
index 6ddfa92fed..ad4867b4da 100644
--- a/svx/inc/svx/sdr/primitive2d/primitiveFactory2d.hxx
+++ b/svx/inc/svx/sdr/primitive2d/primitiveFactory2d.hxx
@@ -36,6 +36,8 @@
#include <cppuhelper/compbase1.hxx>
#include <comphelper/broadcasthelper.hxx>
+#include <svx/svxdllapi.h>
+
//////////////////////////////////////////////////////////////////////////////
// UNO API helper methods
@@ -43,7 +45,7 @@ namespace drawinglayer
{
namespace primitive2d
{
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL XPrimitiveFactory2DProvider_createInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr) throw( ::com::sun::star::uno::Exception );
+ SVX_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL XPrimitiveFactory2DProvider_createInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr) throw( ::com::sun::star::uno::Exception );
} // end of namespace primitive2d
} // end of namespace drawinglayer
@@ -73,8 +75,8 @@ namespace drawinglayer
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XPrimitive2D > > SAL_CALL createPrimitivesFromXDrawPage( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& xDrawPage, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aParms ) throw (::com::sun::star::uno::RuntimeException);
// UNO API helpers
- static rtl::OUString getImplementationName_Static();
- static com::sun::star::uno::Sequence< rtl::OUString > getSupportedServiceNames_Static();
+ SVX_DLLPUBLIC static rtl::OUString getImplementationName_Static();
+ SVX_DLLPUBLIC static com::sun::star::uno::Sequence< rtl::OUString > getSupportedServiceNames_Static();
};
} // end of namespace primitive2d
} // end of namespace drawinglayer
diff --git a/svx/inc/svx/sdr/primitive2d/sdrattributecreator.hxx b/svx/inc/svx/sdr/primitive2d/sdrattributecreator.hxx
index 057e7ba6a0..097eecb952 100644
--- a/svx/inc/svx/sdr/primitive2d/sdrattributecreator.hxx
+++ b/svx/inc/svx/sdr/primitive2d/sdrattributecreator.hxx
@@ -71,7 +71,16 @@ namespace drawinglayer
attribute::SdrLineStartEndAttribute* createNewSdrLineStartEndAttribute(const SfxItemSet& rSet, double fWidth);
attribute::SdrShadowAttribute* createNewSdrShadowAttribute(const SfxItemSet& rSet);
attribute::SdrFillAttribute* createNewSdrFillAttribute(const SfxItemSet& rSet);
- attribute::SdrTextAttribute* createNewSdrTextAttribute(const SfxItemSet& rSet, const SdrText& rText);
+
+ // #i101508# Support handing over given text-to-border distances
+ attribute::SdrTextAttribute* createNewSdrTextAttribute(
+ const SfxItemSet& rSet,
+ const SdrText& rText,
+ const sal_Int32* pLeft = 0,
+ const sal_Int32* pUpper = 0,
+ const sal_Int32* pRight = 0,
+ const sal_Int32* pLower = 0);
+
attribute::FillGradientAttribute* createNewTransparenceGradientAttribute(const SfxItemSet& rSet);
attribute::SdrFillBitmapAttribute* createNewSdrFillBitmapAttribute(const SfxItemSet& rSet);
attribute::SdrShadowTextAttribute* createNewSdrShadowTextAttribute(
@@ -83,7 +92,15 @@ namespace drawinglayer
attribute::SdrLineFillShadowAttribute* createNewSdrLineFillShadowAttribute(const SfxItemSet& rSet, bool bSuppressFill);
attribute::SdrSceneAttribute* createNewSdrSceneAttribute(const SfxItemSet& rSet);
attribute::SdrLightingAttribute* createNewSdrLightingAttribute(const SfxItemSet& rSet);
- attribute::SdrFillTextAttribute* createNewSdrFillTextAttribute(const SfxItemSet& rSet, const SdrText* pSdrText);
+
+ // #i101508# Support handing over given text-to-border distances
+ attribute::SdrFillTextAttribute* createNewSdrFillTextAttribute(
+ const SfxItemSet& rSet,
+ const SdrText* pSdrText,
+ const sal_Int32* pLeft = 0,
+ const sal_Int32* pUpper = 0,
+ const sal_Int32* pRight = 0,
+ const sal_Int32* pLower = 0);
// helpers
void calculateRelativeCornerRadius(sal_Int32 nRadius, const ::basegfx::B2DRange& rObjectRange, double& rfCornerRadiusX, double& rfCornerRadiusY);
diff --git a/svx/inc/svx/sdr/primitive2d/sdrcaptionprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrcaptionprimitive2d.hxx
index b48009dc75..c47ba9b1cd 100644
--- a/svx/inc/svx/sdr/primitive2d/sdrcaptionprimitive2d.hxx
+++ b/svx/inc/svx/sdr/primitive2d/sdrcaptionprimitive2d.hxx
@@ -76,7 +76,7 @@ namespace drawinglayer
const ::basegfx::B2DPolygon& getTail() const { return maTail; }
double getCornerRadiusX() const { return mfCornerRadiusX; }
double getCornerRadiusY() const { return mfCornerRadiusY; }
- bool hasCornerRadius() const { return (0.0 != mfCornerRadiusX || 0.0 != mfCornerRadiusY); }
+ bool isCornerRadiusUsed() const { return (0.0 != mfCornerRadiusX || 0.0 != mfCornerRadiusY); }
// provide unique ID
DeclPrimitrive2DIDBlock()
diff --git a/svx/inc/svx/sdr/primitive2d/sdrdecompositiontools.hxx b/svx/inc/svx/sdr/primitive2d/sdrdecompositiontools.hxx
index 118c368ab6..d37adb214c 100644
--- a/svx/inc/svx/sdr/primitive2d/sdrdecompositiontools.hxx
+++ b/svx/inc/svx/sdr/primitive2d/sdrdecompositiontools.hxx
@@ -77,8 +77,8 @@ namespace drawinglayer
bool bCellText,
bool bWordWrap);
- Primitive2DReference createShadowPrimitive(
- const Primitive2DSequence& rSource,
+ Primitive2DSequence createEmbeddedShadowPrimitive(
+ const Primitive2DSequence& rContent,
const attribute::SdrShadowAttribute& rShadow);
} // end of namespace primitive2d
diff --git a/svx/inc/svx/sdr/primitive2d/sdrmeasureprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrmeasureprimitive2d.hxx
index 8b02fb511b..3e31be61ca 100644
--- a/svx/inc/svx/sdr/primitive2d/sdrmeasureprimitive2d.hxx
+++ b/svx/inc/svx/sdr/primitive2d/sdrmeasureprimitive2d.hxx
@@ -63,8 +63,8 @@ namespace drawinglayer
{
private:
attribute::SdrLineShadowTextAttribute maSdrLSTAttribute;
- ::basegfx::B2DPoint maStart;
- ::basegfx::B2DPoint maEnd;
+ basegfx::B2DPoint maStart;
+ basegfx::B2DPoint maEnd;
MeasureTextPosition meHorizontal;
MeasureTextPosition meVertical;
double mfDistance;
@@ -80,9 +80,9 @@ namespace drawinglayer
// internal decomposition helper
Primitive2DReference impCreatePart(
- const ::basegfx::B2DHomMatrix& rObjectMatrix,
- const ::basegfx::B2DPoint& rStart,
- const ::basegfx::B2DPoint& rEnd,
+ const basegfx::B2DHomMatrix& rObjectMatrix,
+ const basegfx::B2DPoint& rStart,
+ const basegfx::B2DPoint& rEnd,
bool bLeftActive,
bool bRightActive) const;
@@ -93,7 +93,8 @@ namespace drawinglayer
public:
SdrMeasurePrimitive2D(
const attribute::SdrLineShadowTextAttribute& rSdrLSTAttribute,
- const ::basegfx::B2DPoint& rStart, const ::basegfx::B2DPoint& rEnd,
+ const basegfx::B2DPoint& rStart,
+ const basegfx::B2DPoint& rEnd,
MeasureTextPosition eHorizontal,
MeasureTextPosition eVertical,
double fDistance,
@@ -107,8 +108,8 @@ namespace drawinglayer
// data access
const attribute::SdrLineShadowTextAttribute& getSdrLSTAttribute() const { return maSdrLSTAttribute; }
- const ::basegfx::B2DPoint& getStart() const { return maStart; }
- const ::basegfx::B2DPoint& getEnd() const { return maEnd; }
+ const basegfx::B2DPoint& getStart() const { return maStart; }
+ const basegfx::B2DPoint& getEnd() const { return maEnd; }
MeasureTextPosition getHorizontal() const { return meHorizontal; }
MeasureTextPosition getVertical() const { return meVertical; }
double getDistance() const { return mfDistance; }
diff --git a/svx/inc/svx/sdr/primitive2d/sdrolecontentprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrolecontentprimitive2d.hxx
new file mode 100644
index 0000000000..f54028d134
--- /dev/null
+++ b/svx/inc/svx/sdr/primitive2d/sdrolecontentprimitive2d.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: sdrcaptionprimitive2d.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * 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_SDR_PRIMITIVE2D_SDROLECONTENTPRIMITIVE2D_HXX
+#define INCLUDED_SDR_PRIMITIVE2D_SDROLECONTENTPRIMITIVE2D_HXX
+
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <svx/svdobj.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefinitions
+
+class SdrOle2Obj;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ class SdrOleContentPrimitive2D : public BasePrimitive2D
+ {
+ private:
+ SdrObjectWeakRef mpSdrOle2Obj;
+ basegfx::B2DHomMatrix maObjectTransform;
+
+ // bitfield
+ unsigned mbHighContrast : 1;
+
+ protected:
+ // local decomposition.
+ virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const;
+
+ public:
+ SdrOleContentPrimitive2D(
+ const SdrOle2Obj& rSdrOle2Obj,
+ const basegfx::B2DHomMatrix& rObjectTransform,
+ bool bHighContrast);
+
+ // compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ // The default implementation will use getDecomposition results to create the range
+ virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
+
+ // data access
+ const basegfx::B2DHomMatrix& getObjectTransform() const { return maObjectTransform; }
+ bool getHighContrast() const { return mbHighContrast; }
+
+ // provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_SDR_PRIMITIVE2D_SDROLECONTENTPRIMITIVE2D_HXX
+
+// eof
diff --git a/svx/inc/svx/sdr/primitive2d/sdrpathprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrpathprimitive2d.hxx
index defaa73eff..199f3c4fdc 100644
--- a/svx/inc/svx/sdr/primitive2d/sdrpathprimitive2d.hxx
+++ b/svx/inc/svx/sdr/primitive2d/sdrpathprimitive2d.hxx
@@ -49,9 +49,9 @@ namespace drawinglayer
class SdrPathPrimitive2D : public BasePrimitive2D
{
private:
- ::basegfx::B2DHomMatrix maTransform;
+ basegfx::B2DHomMatrix maTransform;
attribute::SdrLineFillShadowTextAttribute maSdrLFSTAttribute;
- ::basegfx::B2DPolyPolygon maUnitPolyPolygon;
+ basegfx::B2DPolyPolygon maUnitPolyPolygon;
protected:
// local decomposition.
@@ -59,14 +59,14 @@ namespace drawinglayer
public:
SdrPathPrimitive2D(
- const ::basegfx::B2DHomMatrix& rTransform,
+ const basegfx::B2DHomMatrix& rTransform,
const attribute::SdrLineFillShadowTextAttribute& rSdrLFSTAttribute,
- const ::basegfx::B2DPolyPolygon& rUnitPolyPolygon);
+ const basegfx::B2DPolyPolygon& rUnitPolyPolygon);
// data access
- const ::basegfx::B2DHomMatrix& getTransform() const { return maTransform; }
+ const basegfx::B2DHomMatrix& getTransform() const { return maTransform; }
const attribute::SdrLineFillShadowTextAttribute& getSdrLFSTAttribute() const { return maSdrLFSTAttribute; }
- const ::basegfx::B2DPolyPolygon& getUnitPolyPolygon() const { return maUnitPolyPolygon; }
+ const basegfx::B2DPolyPolygon& getUnitPolyPolygon() const { return maUnitPolyPolygon; }
// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
diff --git a/svx/inc/svx/sdr/primitive2d/sdrrectangleprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrrectangleprimitive2d.hxx
index e75fe94446..c604b4e1e9 100644
--- a/svx/inc/svx/sdr/primitive2d/sdrrectangleprimitive2d.hxx
+++ b/svx/inc/svx/sdr/primitive2d/sdrrectangleprimitive2d.hxx
@@ -49,28 +49,35 @@ namespace drawinglayer
class SdrRectanglePrimitive2D : public BasePrimitive2D
{
private:
- ::basegfx::B2DHomMatrix maTransform;
+ basegfx::B2DHomMatrix maTransform;
attribute::SdrLineFillShadowTextAttribute maSdrLFSTAttribute;
double mfCornerRadiusX; // [0.0..1.0] relative to 1/2 width
double mfCornerRadiusY; // [0.0..1.0] relative to 1/2 height
+ // bitfield
+ // flag which decides if this is a text frame. If Yes, the HitArea
+ // should be the filled geometry
+ bool mbTextFrame : 1;
+
protected:
// local decomposition.
virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const;
public:
SdrRectanglePrimitive2D(
- const ::basegfx::B2DHomMatrix& rTransform,
+ const basegfx::B2DHomMatrix& rTransform,
const attribute::SdrLineFillShadowTextAttribute& rSdrLFSTAttribute,
- double fCornerRadiusX = 0.0,
- double fCornerRadiusY = 0.0);
+ double fCornerRadiusX,
+ double fCornerRadiusY,
+ bool bTextFrame);
// data access
- const ::basegfx::B2DHomMatrix& getTransform() const { return maTransform; }
+ const basegfx::B2DHomMatrix& getTransform() const { return maTransform; }
const attribute::SdrLineFillShadowTextAttribute& getSdrLFSTAttribute() const { return maSdrLFSTAttribute; }
double getCornerRadiusX() const { return mfCornerRadiusX; }
double getCornerRadiusY() const { return mfCornerRadiusY; }
- bool hasCornerRadius() const { return (0.0 != mfCornerRadiusX || 0.0 != mfCornerRadiusY); }
+ bool isCornerRadiusUsed() const { return (0.0 != mfCornerRadiusX || 0.0 != mfCornerRadiusY); }
+ bool getTextFrame() const { return mbTextFrame; }
// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
diff --git a/svx/inc/svx/sdr/primitive2d/sdrtextprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrtextprimitive2d.hxx
index e7903997de..2e58067a57 100644
--- a/svx/inc/svx/sdr/primitive2d/sdrtextprimitive2d.hxx
+++ b/svx/inc/svx/sdr/primitive2d/sdrtextprimitive2d.hxx
@@ -36,8 +36,10 @@
#include <basegfx/polygon/b2dpolypolygon.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <com/sun/star/drawing/XDrawPage.hpp>
-#include <boost/shared_ptr.hpp>
#include <svx/outlobj.hxx>
+#include <tools/color.hxx>
+#include <svx/sdr/attribute/sdrformtextattribute.hxx>
+#include <tools/weakbase.hxx>
//////////////////////////////////////////////////////////////////////////////
// predefines
@@ -54,11 +56,11 @@ namespace drawinglayer
private:
// The text model data; this sould later just be the OutlinerParaObject or
// something equal
- const SdrText& mrSdrText; // text model data
+ ::tools::WeakReference< SdrText > mrSdrText;
// #i97628#
- // The text content; now as OutlinerParaObject* and in exclusive, local, cloned
- // form as needed in a primitive
+ // The text content; now as local OutlinerParaObject copy (internally RefCounted and
+ // COW) and in exclusive, local form as needed in a primitive
const OutlinerParaObject maOutlinerParaObject;
// remeber last VisualizingPage for which a decomposition was made. If the new target
@@ -67,6 +69,18 @@ namespace drawinglayer
// field renderings in SubGeometry and MasterPage mnode
com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage > mxLastVisualizingPage;
+ // remember last PageNumber for which a decomposition was made. This is only used
+ // when mbContainsPageField is true, else it is 0
+ sal_Int16 mnLastPageNumber;
+
+ // remember last PageCount for which a decomposition was made. This is only used
+ // when mbContainsPageCountField is true, else it is 0
+ sal_Int16 mnLastPageCount;
+
+ // #i101443# remember last TextBackgroundColor to decide if a new decomposition is
+ // needed because of background color change
+ Color maLastTextBackgroundColor;
+
// bitfield
// remember if last decomposition was with or without spell checker. In this special
// case the get2DDecomposition implementation has to take care of this aspect. This is
@@ -75,6 +89,8 @@ namespace drawinglayer
// is there a PageNumber, Header, Footer or DateTimeField used? Evaluated at construction
unsigned mbContainsPageField : 1;
+ unsigned mbContainsPageCountField : 1;
+ unsigned mbContainsOtherFields : 1;
protected:
// support for XTEXT_PAINTSHAPE_BEGIN/XTEXT_PAINTSHAPE_END Metafile comments
@@ -85,11 +101,11 @@ namespace drawinglayer
public:
SdrTextPrimitive2D(
- const SdrText& rSdrText,
+ const SdrText* pSdrText,
const OutlinerParaObject& rOutlinerParaObjectPtr);
// get data
- const SdrText& getSdrText() const { return mrSdrText; }
+ const SdrText* getSdrText() const { return mrSdrText.get(); }
const OutlinerParaObject& getOutlinerParaObject() const { return maOutlinerParaObject; }
// compare operator
@@ -100,7 +116,7 @@ namespace drawinglayer
virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
// transformed clone operator
- virtual SdrTextPrimitive2D* createTransformedClone(const ::basegfx::B2DHomMatrix& rTransform) const = 0;
+ virtual SdrTextPrimitive2D* createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const = 0;
};
} // end of namespace primitive2d
} // end of namespace drawinglayer
@@ -114,8 +130,11 @@ namespace drawinglayer
class SdrContourTextPrimitive2D : public SdrTextPrimitive2D
{
private:
- ::basegfx::B2DPolyPolygon maUnitPolyPolygon; // unit contour polygon (scaled to [0.0 .. 1.0])
- ::basegfx::B2DHomMatrix maObjectTransform; // complete contour polygon transform (scale, rotate, shear, translate)
+ // unit contour polygon (scaled to [0.0 .. 1.0])
+ basegfx::B2DPolyPolygon maUnitPolyPolygon;
+
+ // complete contour polygon transform (scale, rotate, shear, translate)
+ basegfx::B2DHomMatrix maObjectTransform;
protected:
// local decomposition.
@@ -123,20 +142,20 @@ namespace drawinglayer
public:
SdrContourTextPrimitive2D(
- const SdrText& rSdrText,
+ const SdrText* pSdrText,
const OutlinerParaObject& rOutlinerParaObjectPtr,
- const ::basegfx::B2DPolyPolygon& rUnitPolyPolygon,
- const ::basegfx::B2DHomMatrix& rObjectTransform);
+ const basegfx::B2DPolyPolygon& rUnitPolyPolygon,
+ const basegfx::B2DHomMatrix& rObjectTransform);
// get data
- const ::basegfx::B2DPolyPolygon& getUnitPolyPolygon() const { return maUnitPolyPolygon; }
- const ::basegfx::B2DHomMatrix& getObjectTransform() const { return maObjectTransform; }
+ const basegfx::B2DPolyPolygon& getUnitPolyPolygon() const { return maUnitPolyPolygon; }
+ const basegfx::B2DHomMatrix& getObjectTransform() const { return maObjectTransform; }
// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
// transformed clone operator
- virtual SdrTextPrimitive2D* createTransformedClone(const ::basegfx::B2DHomMatrix& rTransform) const;
+ virtual SdrTextPrimitive2D* createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const;
// provide unique ID
DeclPrimitrive2DIDBlock()
@@ -153,7 +172,11 @@ namespace drawinglayer
class SdrPathTextPrimitive2D : public SdrTextPrimitive2D
{
private:
- ::basegfx::B2DPolyPolygon maPathPolyPolygon; // the path to use. Each paragraph will use one Polygon.
+ // the path to use. Each paragraph will use one Polygon.
+ basegfx::B2DPolyPolygon maPathPolyPolygon;
+
+ // the Fontwork parameters
+ attribute::SdrFormTextAttribute maSdrFormTextAttribute;
protected:
// local decomposition.
@@ -161,18 +184,20 @@ namespace drawinglayer
public:
SdrPathTextPrimitive2D(
- const SdrText& rSdrText,
+ const SdrText* pSdrText,
const OutlinerParaObject& rOutlinerParaObjectPtr,
- const ::basegfx::B2DPolyPolygon& rPathPolyPolygon);
+ const basegfx::B2DPolyPolygon& rPathPolyPolygon,
+ const attribute::SdrFormTextAttribute& rSdrFormTextAttribute);
// get data
- const ::basegfx::B2DPolyPolygon& getPathPolyPolygon() const { return maPathPolyPolygon; }
+ const basegfx::B2DPolyPolygon& getPathPolyPolygon() const { return maPathPolyPolygon; }
+ const attribute::SdrFormTextAttribute& getSdrFormTextAttribute() const { return maSdrFormTextAttribute; }
// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
// transformed clone operator
- virtual SdrTextPrimitive2D* createTransformedClone(const ::basegfx::B2DHomMatrix& rTransform) const;
+ virtual SdrTextPrimitive2D* createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const;
// provide unique ID
DeclPrimitrive2DIDBlock()
@@ -189,7 +214,8 @@ namespace drawinglayer
class SdrBlockTextPrimitive2D : public SdrTextPrimitive2D
{
private:
- ::basegfx::B2DHomMatrix maTextRangeTransform; // text range transformation from unit range ([0.0 .. 1.0]) to text range
+ // text range transformation from unit range ([0.0 .. 1.0]) to text range
+ basegfx::B2DHomMatrix maTextRangeTransform;
// bitfield
unsigned mbUnlimitedPage : 1; // force layout with no text break
@@ -202,9 +228,9 @@ namespace drawinglayer
public:
SdrBlockTextPrimitive2D(
- const SdrText& rSdrText,
+ const SdrText* pSdrText,
const OutlinerParaObject& rOutlinerParaObjectPtr,
- const ::basegfx::B2DHomMatrix& rTextRangeTransform,
+ const basegfx::B2DHomMatrix& rTextRangeTransform,
bool bUnlimitedPage,
bool bCellText,
bool bWordWrap);
@@ -219,7 +245,7 @@ namespace drawinglayer
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
// transformed clone operator
- virtual SdrTextPrimitive2D* createTransformedClone(const ::basegfx::B2DHomMatrix& rTransform) const;
+ virtual SdrTextPrimitive2D* createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const;
// provide unique ID
DeclPrimitrive2DIDBlock()
@@ -236,7 +262,8 @@ namespace drawinglayer
class SdrStretchTextPrimitive2D : public SdrTextPrimitive2D
{
private:
- ::basegfx::B2DHomMatrix maTextRangeTransform; // text range transformation from unit range ([0.0 .. 1.0]) to text range
+ // text range transformation from unit range ([0.0 .. 1.0]) to text range
+ basegfx::B2DHomMatrix maTextRangeTransform;
protected:
// local decomposition.
@@ -244,18 +271,18 @@ namespace drawinglayer
public:
SdrStretchTextPrimitive2D(
- const SdrText& rSdrText,
+ const SdrText* pSdrText,
const OutlinerParaObject& rOutlinerParaObjectPtr,
- const ::basegfx::B2DHomMatrix& rTextRangeTransform);
+ const basegfx::B2DHomMatrix& rTextRangeTransform);
// get data
- const ::basegfx::B2DHomMatrix& getTextRangeTransform() const { return maTextRangeTransform; }
+ const basegfx::B2DHomMatrix& getTextRangeTransform() const { return maTextRangeTransform; }
// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
// transformed clone operator
- virtual SdrTextPrimitive2D* createTransformedClone(const ::basegfx::B2DHomMatrix& rTransform) const;
+ virtual SdrTextPrimitive2D* createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const;
// provide unique ID
DeclPrimitrive2DIDBlock()
diff --git a/svx/inc/svx/sdr/primitive2d/svx_primitivetypes2d.hxx b/svx/inc/svx/sdr/primitive2d/svx_primitivetypes2d.hxx
index b0f0e62b76..70dc15c62e 100644
--- a/svx/inc/svx/sdr/primitive2d/svx_primitivetypes2d.hxx
+++ b/svx/inc/svx/sdr/primitive2d/svx_primitivetypes2d.hxx
@@ -52,6 +52,13 @@
#define PRIMITIVE2D_ID_SDRSTRETCHTEXTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 13)
#define PRIMITIVE2D_ID_SDRCELLPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 14)
#define PRIMITIVE2D_ID_SDRBORDERLINEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 15)
+#define PRIMITIVE2D_ID_OVERLAYBITMAPEXPRIMITIVE (PRIMITIVE2D_ID_RANGE_SVX| 16)
+#define PRIMITIVE2D_ID_OVERLAYCROSSHAIRPRIMITIVE (PRIMITIVE2D_ID_RANGE_SVX| 17)
+#define PRIMITIVE2D_ID_OVERLAYHATCHRECTANGLEPRIMITIVE (PRIMITIVE2D_ID_RANGE_SVX| 18)
+#define PRIMITIVE2D_ID_OVERLAYHELPLINESTRIPEDPRIMITIVE (PRIMITIVE2D_ID_RANGE_SVX| 19)
+#define PRIMITIVE2D_ID_OVERLAYROLLINGRECTANGLEPRIMITIVE (PRIMITIVE2D_ID_RANGE_SVX| 20)
+#define PRIMITIVE2D_ID_SDRCONTROLPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 21)
+#define PRIMITIVE2D_ID_SDROLECONTENTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 22)
//////////////////////////////////////////////////////////////////////////////
diff --git a/svx/inc/svx/sdr/properties/properties.hxx b/svx/inc/svx/sdr/properties/properties.hxx
index 855b8a2504..2b8928e376 100644
--- a/svx/inc/svx/sdr/properties/properties.hxx
+++ b/svx/inc/svx/sdr/properties/properties.hxx
@@ -184,6 +184,11 @@ namespace sdr
// ClearItemAndBroadcast() and SetItemSetAndBroadcast(), see above.
// But also from inside SdrObjects.
void BroadcastItemChange(const ItemChangeBroadcaster& rChange);
+
+ // #i101556# add versioning mechanism; used from e.g. text attribute set to
+ // allow detection of e.g. style sheet or single text attribute changes. The
+ // default implementation returns 0 (zero)
+ virtual sal_uInt32 getVersion() const;
};
} // end of namespace properties
} // end of namespace sdr
diff --git a/svx/inc/svx/sdr/properties/textproperties.hxx b/svx/inc/svx/sdr/properties/textproperties.hxx
index 5dcc8f5d3f..08f2603a76 100644
--- a/svx/inc/svx/sdr/properties/textproperties.hxx
+++ b/svx/inc/svx/sdr/properties/textproperties.hxx
@@ -42,6 +42,10 @@ namespace sdr
{
class SVX_DLLPUBLIC TextProperties : public AttributeProperties
{
+ private:
+ // #i101556# versioning support
+ sal_uInt32 maVersion;
+
protected:
// create a new itemset
virtual SfxItemSet& CreateObjectSpecificItemSet(SfxItemPool& rPool);
@@ -82,6 +86,9 @@ namespace sdr
// Set single item at the local ItemSet. *Does not use* AllowItemChange(),
// ItemChange(), PostItemChange() and ItemSetChanged() calls.
void SetObjectItemNoBroadcast(const SfxPoolItem& rItem);
+
+ // #i101556# versioning support
+ virtual sal_uInt32 getVersion() const;
};
} // end of namespace properties
} // end of namespace sdr
diff --git a/svx/inc/svx/sdrhittesthelper.hxx b/svx/inc/svx/sdrhittesthelper.hxx
new file mode 100644
index 0000000000..dae0c26487
--- /dev/null
+++ b/svx/inc/svx/sdrhittesthelper.hxx
@@ -0,0 +1,81 @@
+/*************************************************************************
+ *
+ * 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: svdetc.hxx,v $
+ * $Revision: 1.4.152.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 _SDRHITTESTHELPER_HXX
+#define _SDRHITTESTHELPER_HXX
+
+#include "svx/svxdllapi.h"
+#include <tools/string.hxx>
+#include <tools/gen.hxx>
+
+/////////////////////////////////////////////////////////////////////
+// #i101872# new Object HitTest as View-tooling
+
+class SdrObject;
+class SdrPageView;
+class SetOfByte;
+class SdrObjList;
+namespace sdr { namespace contact { class ViewObjectContact; }}
+namespace basegfx { class B2DPoint; }
+
+/////////////////////////////////////////////////////////////////////
+// Wrappers for classic Sdr* Mode/View classes
+
+SVX_DLLPUBLIC SdrObject* SdrObjectPrimitiveHit(
+ const SdrObject& rObject,
+ const Point& rPnt,
+ sal_uInt16 nTol,
+ const SdrPageView& rSdrPageView,
+ const SetOfByte* pVisiLayer,
+ bool bTextOnly);
+
+SVX_DLLPUBLIC SdrObject* SdrObjListPrimitiveHit(
+ const SdrObjList& rList,
+ const Point& rPnt,
+ sal_uInt16 nTol,
+ const SdrPageView& rSdrPageView,
+ const SetOfByte* pVisiLayer,
+ bool bTextOnly);
+
+/////////////////////////////////////////////////////////////////////
+// the pure HitTest based on a VOC
+
+SVX_DLLPUBLIC bool ViewObjectContactPrimitiveHit(
+ const sdr::contact::ViewObjectContact& rVOC,
+ const basegfx::B2DPoint& rHitPosition,
+ double fLogicHitTolerance,
+ bool bTextOnly);
+
+/////////////////////////////////////////////////////////////////////
+
+#endif //_SDRHITTESTHELPER_HXX
+
+/////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/inc/svx/sdtfchim.hxx b/svx/inc/svx/sdtfchim.hxx
index 95d709a30e..2a630fac6b 100644
--- a/svx/inc/svx/sdtfchim.hxx
+++ b/svx/inc/svx/sdtfchim.hxx
@@ -32,28 +32,28 @@
#include <svx/svddef.hxx>
-class SdrTextFixedCellHeightItem : public SfxBoolItem
+class SVX_DLLPUBLIC SdrTextFixedCellHeightItem : public SfxBoolItem
{
public:
TYPEINFO();
SdrTextFixedCellHeightItem( BOOL bUseFixedCellHeight = FALSE );
- SdrTextFixedCellHeightItem( SvStream & rStream, sal_uInt16 nVersion );
+ SVX_DLLPRIVATE SdrTextFixedCellHeightItem( SvStream & rStream, sal_uInt16 nVersion );
- virtual SfxItemPresentation GetPresentation(SfxItemPresentation ePresentation,
+ SVX_DLLPRIVATE virtual SfxItemPresentation GetPresentation(SfxItemPresentation ePresentation,
SfxMapUnit eCoreMetric, SfxMapUnit ePresentationMetric,
String &rText, const IntlWrapper * = 0) const;
- virtual SfxPoolItem* Create( SvStream&, sal_uInt16 nItem ) const;
- virtual SvStream& Store( SvStream&, sal_uInt16 nVersion ) const;
- virtual SfxPoolItem* Clone( SfxItemPool* pPool = NULL ) const;
- virtual sal_uInt16 GetVersion( sal_uInt16 nFileFormatVersion ) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Create( SvStream&, sal_uInt16 nItem ) const;
+ SVX_DLLPRIVATE virtual SvStream& Store( SvStream&, sal_uInt16 nVersion ) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Clone( SfxItemPool* pPool = NULL ) const;
+ SVX_DLLPRIVATE virtual sal_uInt16 GetVersion( sal_uInt16 nFileFormatVersion ) const;
- virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const;
- virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 );
+ SVX_DLLPRIVATE virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const;
+ SVX_DLLPRIVATE virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 );
#ifdef SDR_ISPOOLABLE
- virtual int IsPoolable() const;
+ SVX_DLLPRIVATE virtual int IsPoolable() const;
#endif
};
diff --git a/svx/inc/svx/svdedxv.hxx b/svx/inc/svx/svdedxv.hxx
index 999a8b0963..c6599092e2 100644
--- a/svx/inc/svx/svdedxv.hxx
+++ b/svx/inc/svx/svdedxv.hxx
@@ -130,9 +130,6 @@ protected:
void ImpPaintOutlinerView(OutlinerView& rOutlView, const Rectangle& rRect) const;
void ImpInvalidateOutlinerView(OutlinerView& rOutlView) const;
- // Hintergrundfarbe fuer die Outlinerviews bestimmen
- Color ImpGetTextEditBackgroundColor() const;
-
// Feststellen, ob der gesamte Text markiert ist. Liefert auch TRUE wenn
// kein Text vorhanden ist.
BOOL ImpIsTextEditAllSelected() const;
diff --git a/svx/inc/svx/svdetc.hxx b/svx/inc/svx/svdetc.hxx
index 76d45f693a..5fe0d1245b 100644
--- a/svx/inc/svx/svdetc.hxx
+++ b/svx/inc/svx/svdetc.hxx
@@ -81,7 +81,7 @@ friend class SdrAttrObj;
Fraction aMapFraction;
private:
- SVX_DLLPRIVATE static SdrEngineDefaults& GetDefaults();
+ static SdrEngineDefaults& GetDefaults();
public:
SdrEngineDefaults();
@@ -272,7 +272,7 @@ protected:
public:
SdrLinkList(): aList(1024,4,4) {}
~SdrLinkList() { Clear(); }
- void Clear();
+ SVX_DLLPUBLIC void Clear();
unsigned GetLinkCount() const { return (unsigned)aList.Count(); }
Link& GetLink(unsigned nNum) { return *((Link*)(aList.GetObject(nNum))); }
const Link& GetLink(unsigned nNum) const { return *((Link*)(aList.GetObject(nNum))); }
@@ -299,7 +299,7 @@ class OLEObjCache : public Container
public:
OLEObjCache();
- ~OLEObjCache();
+ SVX_DLLPUBLIC ~OLEObjCache();
void SetSize(ULONG nNewSize);
void InsertObj(SdrOle2Obj* pObj);
@@ -344,8 +344,12 @@ SVX_DLLPUBLIC String GetResourceString(sal_uInt16 nResID);
}
+/////////////////////////////////////////////////////////////////////
+// #i101872# isolated GetTextEditBackgroundColor for tooling
+class SdrObjEditView;
+
+SVX_DLLPUBLIC Color GetTextEditBackgroundColor(const SdrObjEditView& rView);
/////////////////////////////////////////////////////////////////////
#endif //_SVDETC_HXX
-
diff --git a/svx/inc/svx/svdhdl.hxx b/svx/inc/svx/svdhdl.hxx
index f5a1cc4f90..77f7afae22 100644
--- a/svx/inc/svx/svdhdl.hxx
+++ b/svx/inc/svx/svdhdl.hxx
@@ -245,7 +245,7 @@ public:
sal_uInt32 GetSourceHdlNum() const { return nSourceHdlNum; }
virtual Pointer GetPointer() const;
- virtual bool IsHdlHit(const Point& rPnt) const;
+ bool IsHdlHit(const Point& rPnt) const;
// #97016# II
virtual BOOL IsFocusHdl() const;
@@ -363,7 +363,6 @@ public:
virtual ~SdrHdlLine();
virtual Pointer GetPointer() const;
- virtual bool IsHdlHit(const Point& rPnt) const;
};
// Ein SdrHdlBezWgt hat Kenntnis von seinem "BasisHandle". Seine Draw-Methode
diff --git a/svx/inc/svx/svdmodel.hxx b/svx/inc/svx/svdmodel.hxx
index c8d132536e..56c0e8550e 100644
--- a/svx/inc/svx/svdmodel.hxx
+++ b/svx/inc/svx/svdmodel.hxx
@@ -689,7 +689,7 @@ public:
void SetModelStorage( SotStorage* pStor ) { pModelStorage = pStor; }
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > getUnoModel();
- void setUnoModel( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xModel ) { mxUnoModel = xModel; }
+ void setUnoModel( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xModel );
// these functions are used by the api to disable repaints during a
// set of api calls.
diff --git a/svx/inc/svx/svdmrkv.hxx b/svx/inc/svx/svdmrkv.hxx
index 962fce5030..4639a291a2 100644
--- a/svx/inc/svx/svdmrkv.hxx
+++ b/svx/inc/svx/svdmrkv.hxx
@@ -180,9 +180,8 @@ protected:
void ForceUndirtyMrkPnt() const { if (bMrkPntDirty) UndirtyMrkPnt(); }
//HMHvoid ImpShowMarkHdl(bool bNoRefHdl);
- SdrObject* ImpCheckObjHit(const Point& rPnt, USHORT nTol, SdrObject* pObj, SdrPageView* pPV, ULONG nOptions, const SetOfByte* pMVisLay) const;
- SdrObject* ImpCheckObjHit(const Point& rPnt, USHORT nTol, SdrObjList* pOL, SdrPageView* pPV, ULONG nOptions, const SetOfByte* pMVisLay, SdrObject*& rpRootObj) const;
- BOOL ImpIsObjHit(const Point& rPnt, USHORT nTol, SdrObject* pObj, SdrPageView* pPV, ULONG nOptions) const { return ImpCheckObjHit(rPnt,nTol,pObj,pPV,nOptions,NULL)!=NULL; }
+ virtual SdrObject* CheckSingleSdrObjectHit(const Point& rPnt, USHORT nTol, SdrObject* pObj, SdrPageView* pPV, ULONG nOptions, const SetOfByte* pMVisLay) const;
+ virtual SdrObject* CheckSingleSdrObjectHit(const Point& rPnt, USHORT nTol, SdrObjList* pOL, SdrPageView* pPV, ULONG nOptions, const SetOfByte* pMVisLay, SdrObject*& rpRootObj) const;
BOOL ImpIsFrameHandles() const;
void ImpTakeDescriptionStr(USHORT nStrCacheID, String& rStr, USHORT nVal=0, USHORT nOpt=0) const;
@@ -309,9 +308,9 @@ public:
// SDRSEARCH_DEEP SDRSEARCH_ALSOONMASTER SDRSEARCH_TESTMARKABLE SDRSEARCH_TESTTEXTEDIT
// SDRSEARCH_WITHTEXT SDRSEARCH_TESTTEXTAREA SDRSEARCH_BACKWARD SDRSEARCH_MARKED
// SDRSEARCH_WHOLEPAGE
- BOOL PickObj(const Point& rPnt, short nTol, SdrObject*& rpObj, SdrPageView*& rpPV, ULONG nOptions, SdrObject** ppRootObj, ULONG* pnMarkNum=NULL, USHORT* pnPassNum=NULL) const;
- BOOL PickObj(const Point& rPnt, short nTol, SdrObject*& rpObj, SdrPageView*& rpPV, ULONG nOptions=0) const;
- BOOL PickObj(const Point& rPnt, SdrObject*& rpObj, SdrPageView*& rpPV, ULONG nOptions=0) const { return PickObj(rPnt,nHitTolLog,rpObj,rpPV,nOptions); }
+ virtual BOOL PickObj(const Point& rPnt, short nTol, SdrObject*& rpObj, SdrPageView*& rpPV, ULONG nOptions, SdrObject** ppRootObj, ULONG* pnMarkNum=NULL, USHORT* pnPassNum=NULL) const;
+ virtual BOOL PickObj(const Point& rPnt, short nTol, SdrObject*& rpObj, SdrPageView*& rpPV, ULONG nOptions=0) const;
+ // BOOL PickObj(const Point& rPnt, SdrObject*& rpObj, SdrPageView*& rpPV, ULONG nOptions=0) const { return PickObj(rPnt,nHitTolLog,rpObj,rpPV,nOptions); }
BOOL MarkObj(const Point& rPnt, short nTol=-2, BOOL bToggle=FALSE, BOOL bDeep=FALSE);
// Pick: Unterstuetzte Optionen fuer nOptions sind SDRSEARCH_PASS2BOUND und SDRSEARCH_PASS3NEAREST
diff --git a/svx/inc/svx/svdoashp.hxx b/svx/inc/svx/svdoashp.hxx
index 45cc1fefc8..1238cea024 100644
--- a/svx/inc/svx/svdoashp.hxx
+++ b/svx/inc/svx/svdoashp.hxx
@@ -105,7 +105,7 @@ private:
// #i37011# render geometry shadow
SdrObject* mpLastShadowGeometry;
- static SVX_DLLPRIVATE com::sun::star::uno::Reference< com::sun::star::drawing::XCustomShapeEngine > GetCustomShapeEngine( const SdrObjCustomShape* pCustomShape );
+ static com::sun::star::uno::Reference< com::sun::star::drawing::XCustomShapeEngine > GetCustomShapeEngine( const SdrObjCustomShape* pCustomShape );
// SVX_DLLPRIVATE com::sun::star::uno::Sequence< com::sun::star::uno::Reference< com::sun::star::drawing::XCustomShapeHandle > >
// SdrObjCustomShape::GetInteraction( const SdrObjCustomShape* pCustomShape ) const;
@@ -134,7 +134,7 @@ public:
const SdrObject* GetSdrObjectShadowFromCustomShape() const;
sal_Bool GetTextBounds( Rectangle& rTextBound ) const;
sal_Bool IsTextPath() const;
- static SVX_DLLPRIVATE basegfx::B2DPolyPolygon GetLineGeometry( const SdrObjCustomShape* pCustomShape, const sal_Bool bBezierAllowed );
+ static basegfx::B2DPolyPolygon GetLineGeometry( const SdrObjCustomShape* pCustomShape, const sal_Bool bBezierAllowed );
protected:
@@ -224,8 +224,6 @@ public:
virtual void TakeTextAnchorRect( Rectangle& rAnchorRect ) const;
virtual void TakeTextRect( SdrOutliner& rOutliner, Rectangle& rTextRect, FASTBOOL bNoEditText=FALSE,
Rectangle* pAnchorRect=NULL, BOOL bLineWidth=TRUE ) const;
-
- virtual SdrObject* CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const;
virtual void operator=(const SdrObject& rObj);
virtual void TakeObjNameSingul(String& rName) const;
diff --git a/svx/inc/svx/svdoattr.hxx b/svx/inc/svx/svdoattr.hxx
index 984d11b8a0..ca84262c7b 100644
--- a/svx/inc/svx/svdoattr.hxx
+++ b/svx/inc/svx/svdoattr.hxx
@@ -66,9 +66,6 @@ protected:
// Strichstaerke ermitteln. Keine Linie -> 0.
sal_Int32 ImpGetLineWdt() const;
- // Schattenabstand ermitteln. FALSE=Kein Schatten.
- FASTBOOL ImpGetShadowDist(sal_Int32& nXDist, sal_Int32& nYDist) const;
-
// Zuhoeren, ob sich ein StyleSheet aendert
virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint);
diff --git a/svx/inc/svx/svdobj.hxx b/svx/inc/svx/svdobj.hxx
index 6d64205a03..93bf3a1479 100644
--- a/svx/inc/svx/svdobj.hxx
+++ b/svx/inc/svx/svdobj.hxx
@@ -683,20 +683,10 @@ public:
// Tooling for painting a single object to a OutputDevice. This will be needed as long
// as not all painting is changed to use DrawContact objects.
sal_Bool SingleObjectPainter(OutputDevice& rOut) const;
-
BOOL LineGeometryUsageIsNecessary() const;
- // HitTest, 2. Stufe. nTol ist die zulaessige Toleranz in logischen Einheiten.
- // rVisiLayer ist hauptsaechlich fuer Gruppenobjekte gedacht, die ja Objekte
- // mit unterschiedlichen Layerzuordnungen beinhalten koennen.
- virtual SdrObject* CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const;
- //SdrObject* CheckHit(const Point& rPnt, USHORT nTol) const { return CheckHit(rPnt,nTol,NULL); }
- sal_Bool IsHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const { return CheckHit(rPnt,nTol,pVisiLayer)!=NULL; }
- sal_Bool IsHit(const Point& rPnt, USHORT nTol) const { return CheckHit(rPnt,nTol,NULL)!=NULL; }
-
// Clone() soll eine komplette Kopie des Objektes erzeugen.
virtual SdrObject* Clone() const;
- // #116235# virtual SdrObject* Clone(SdrPage* pPage, SdrModel* pModel) const;
virtual void operator=(const SdrObject& rObj);
// TakeObjName...() ist fuer die Anzeige in der UI, z.B. "3 Rahmen selektiert".
@@ -878,10 +868,6 @@ public:
// TextEdit
virtual FASTBOOL HasTextEdit() const;
- virtual SdrObject* CheckTextEditHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const;
- //SdrObject* CheckTextEditHit(const Point& rPnt, USHORT nTol) const { return CheckTextEditHit(rPnt,nTol,NULL); }
- sal_Bool IsTextEditHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const { return CheckTextEditHit(rPnt,nTol,pVisiLayer)!=NULL; }
- sal_Bool IsTextEditHit(const Point& rPnt, USHORT nTol) const { return CheckTextEditHit(rPnt,nTol,NULL)!=NULL; }
// Return==TRUE: TextEditMode gestartet
virtual sal_Bool BegTextEdit(SdrOutliner& rOutl);
diff --git a/svx/inc/svx/svdocapt.hxx b/svx/inc/svx/svdocapt.hxx
index f151d46762..e2cecd0579 100644
--- a/svx/inc/svx/svdocapt.hxx
+++ b/svx/inc/svx/svdocapt.hxx
@@ -99,7 +99,6 @@ public:
virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const;
virtual UINT16 GetObjIdentifier() const;
- virtual SdrObject* CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const;
virtual void operator=(const SdrObject& rObj);
// for calc: special shadow only for text box
diff --git a/svx/inc/svx/svdocirc.hxx b/svx/inc/svx/svdocirc.hxx
index 99faedcc3a..7fff0c36db 100644
--- a/svx/inc/svx/svdocirc.hxx
+++ b/svx/inc/svx/svdocirc.hxx
@@ -111,7 +111,6 @@ public:
virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const;
virtual UINT16 GetObjIdentifier() const;
virtual void TakeUnrotatedSnapRect(Rectangle& rRect) const;
- virtual SdrObject* CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const;
virtual void TakeObjNameSingul(String& rName) const;
virtual void TakeObjNamePlural(String& rName) const;
diff --git a/svx/inc/svx/svdoedge.hxx b/svx/inc/svx/svdoedge.hxx
index aff5d7ecd0..0f5366d5b1 100644
--- a/svx/inc/svx/svdoedge.hxx
+++ b/svx/inc/svx/svdoedge.hxx
@@ -73,7 +73,7 @@ protected:
public:
SdrObjConnection() { ResetVars(); }
- ~SdrObjConnection();
+ SVX_DLLPUBLIC ~SdrObjConnection();
void ResetVars();
FASTBOOL TakeGluePoint(SdrGluePoint& rGP, FASTBOOL bSetAbsolutePos) const;
@@ -252,7 +252,6 @@ public:
virtual void RecalcSnapRect();
virtual void TakeUnrotatedSnapRect(Rectangle& rRect) const;
- virtual SdrObject* CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const;
virtual void operator=(const SdrObject& rObj);
virtual void TakeObjNameSingul(String& rName) const;
virtual void TakeObjNamePlural(String& rName) const;
diff --git a/svx/inc/svx/svdograf.hxx b/svx/inc/svx/svdograf.hxx
index 8c7b47c0cb..8a81917dfe 100644
--- a/svx/inc/svx/svdograf.hxx
+++ b/svx/inc/svx/svdograf.hxx
@@ -180,7 +180,6 @@ public:
virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const;
virtual UINT16 GetObjIdentifier() const;
- virtual SdrObject* CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const;
virtual void TakeObjNameSingul(String& rName) const;
virtual void TakeObjNamePlural(String& rName) const;
@@ -227,6 +226,9 @@ public:
sal_Bool IsObjectTransparent() const;
::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > getInputStream();
+
+ // #i103116# FullDrag support
+ virtual SdrObject* getFullDragClone() const;
};
#endif //_SVDOGRAF_HXX
diff --git a/svx/inc/svx/svdogrp.hxx b/svx/inc/svx/svdogrp.hxx
index 06cc6a1674..5e796b75c9 100644
--- a/svx/inc/svx/svdogrp.hxx
+++ b/svx/inc/svx/svdogrp.hxx
@@ -84,7 +84,6 @@ public:
virtual const Rectangle& GetCurrentBoundRect() const;
virtual const Rectangle& GetSnapRect() const;
- virtual SdrObject* CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const;
virtual void operator=(const SdrObject& rObj);
virtual void TakeObjNameSingul(String& rName) const;
diff --git a/svx/inc/svx/svdomeas.hxx b/svx/inc/svx/svdomeas.hxx
index d3a8643085..e410904fe5 100644
--- a/svx/inc/svx/svdomeas.hxx
+++ b/svx/inc/svx/svdomeas.hxx
@@ -105,7 +105,6 @@ public:
virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const;
virtual UINT16 GetObjIdentifier() const;
virtual void TakeUnrotatedSnapRect(Rectangle& rRect) const;
- virtual SdrObject* CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const;
virtual void operator=(const SdrObject& rObj);
virtual void TakeObjNameSingul(String& rName) const;
@@ -153,7 +152,6 @@ public:
Rectangle* pAnchorRect=NULL, BOOL bLineWidth=TRUE ) const;
virtual void TakeTextAnchorRect(Rectangle& rAnchorRect) const;
virtual void TakeTextEditArea(Size* pPaperMin, Size* pPaperMax, Rectangle* pViewInit, Rectangle* pViewMin) const;
- virtual SdrObject* CheckTextEditHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const;
virtual USHORT GetOutlinerViewAnchorMode() const;
virtual void NbcSetOutlinerParaObject(OutlinerParaObject* pTextObject);
virtual OutlinerParaObject* GetOutlinerParaObject() const;
diff --git a/svx/inc/svx/svdoole2.hxx b/svx/inc/svx/svdoole2.hxx
index 180b9fd4b0..41157116b3 100644
--- a/svx/inc/svx/svdoole2.hxx
+++ b/svx/inc/svx/svdoole2.hxx
@@ -145,7 +145,6 @@ public:
virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const;
virtual UINT16 GetObjIdentifier() const;
- virtual SdrObject* CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const;
virtual void TakeObjNameSingul(String& rName) const;
virtual void TakeObjNamePlural(String& rName) const;
@@ -185,14 +184,8 @@ public:
sal_Bool CalculateNewScaling( Fraction& aScaleWidth, Fraction& aScaleHeight, Size& aObjAreaSize );
sal_Bool AddOwnLightClient();
- // helper for ViewObjectContactOfSdrOle2Obj. As long as the OLE stuff is not
- // reworked, the things the old Do_PaintObject did at this object need to be
- // emulated. Isolated those things here. Return value tells if the object
- // is active
- bool executeOldDoPaintPreparations(SdrPageView* pPageVew) const;
-
// handy to get the empty replacement bitmap without accessing all the old stuff
- Bitmap GetEmtyOLEReplacementBitmap() const;
+ static Bitmap GetEmtyOLEReplacementBitmap();
void SetWindow(const com::sun::star::uno::Reference < com::sun::star::awt::XWindow >& _xWindow);
};
diff --git a/svx/inc/svx/svdopath.hxx b/svx/inc/svx/svdopath.hxx
index 42668cb1e8..b59ee4b84b 100644
--- a/svx/inc/svx/svdopath.hxx
+++ b/svx/inc/svx/svdopath.hxx
@@ -99,7 +99,6 @@ public:
virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const;
virtual UINT16 GetObjIdentifier() const;
virtual void TakeUnrotatedSnapRect(Rectangle& rRect) const;
- virtual SdrObject* CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const;
virtual void operator=(const SdrObject& rObj);
virtual void TakeObjNameSingul(String& rName) const;
diff --git a/svx/inc/svx/svdorect.hxx b/svx/inc/svx/svdorect.hxx
index 50a4f5e170..9942941d04 100644
--- a/svx/inc/svx/svdorect.hxx
+++ b/svx/inc/svx/svdorect.hxx
@@ -75,7 +75,6 @@ protected:
protected:
XPolygon ImpCalcXPoly(const Rectangle& rRect1, long nRad1) const;
- SdrObject* ImpCheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer, FASTBOOL bForceFilled, FASTBOOL bForceTol=FALSE) const;
void SetXPolyDirty();
// RecalcXPoly sollte ueberladen werden. Dabei muss dann eine XPolygon
@@ -103,7 +102,6 @@ public:
virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const;
virtual UINT16 GetObjIdentifier() const;
virtual void TakeUnrotatedSnapRect(Rectangle& rRect) const;
- virtual SdrObject* CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const;
virtual void TakeObjNameSingul(String& rName) const;
virtual void TakeObjNamePlural(String& rName) const;
diff --git a/svx/inc/svx/svdotable.hxx b/svx/inc/svx/svdotable.hxx
index 792c8eb1bf..f14695ca48 100644
--- a/svx/inc/svx/svdotable.hxx
+++ b/svx/inc/svx/svdotable.hxx
@@ -226,7 +226,6 @@ public:
virtual FASTBOOL AdjustTextFrameWidthAndHeight(Rectangle& rR, FASTBOOL bHgt=TRUE, FASTBOOL bWdt=TRUE) const;
virtual FASTBOOL AdjustTextFrameWidthAndHeight(FASTBOOL bHgt=TRUE, FASTBOOL bWdt=TRUE);
- virtual SdrObject* CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const;
virtual void TakeObjNameSingul(String& rName) const;
virtual void TakeObjNamePlural(String& rName) const;
virtual void operator=(const SdrObject& rObj);
diff --git a/svx/inc/svx/svdotext.hxx b/svx/inc/svx/svdotext.hxx
index d8ceefa242..a32a7e5ffb 100644
--- a/svx/inc/svx/svdotext.hxx
+++ b/svx/inc/svx/svdotext.hxx
@@ -259,7 +259,7 @@ protected:
// Flag for allowing text animation. Default is sal_true.
BOOL mbTextAnimationAllowed : 1;
- SVX_DLLPRIVATE SdrOutliner& ImpGetDrawOutliner() const;
+ SdrOutliner& ImpGetDrawOutliner() const;
private:
SVX_DLLPRIVATE void ImpCheckMasterCachable();
@@ -272,14 +272,14 @@ private:
Rectangle& rAnchorRect,
Rectangle& rPaintRect,
Fraction& aFitXKorreg ) const;
- SVX_DLLPRIVATE SdrObject* ImpConvertObj(FASTBOOL bToPoly) const;
+ SVX_DLLPRIVATE SdrObject* ImpConvertContainedTextToSdrPathObjs(bool bToPoly) const;
SVX_DLLPRIVATE void ImpLinkAnmeldung();
SVX_DLLPRIVATE void ImpLinkAbmeldung();
SVX_DLLPRIVATE ImpSdrObjTextLinkUserData* GetLinkUserData() const;
// void ImpCheckItemSetChanges(const SfxItemSet& rAttr);
protected:
- FASTBOOL ImpCanConvTextToCurve() const { return GetOutlinerParaObject()!=NULL && pModel!=NULL && !IsOutlText() && !IsFontwork(); }
+ bool ImpCanConvTextToCurve() const;
SdrObject* ImpConvertMakeObj(const basegfx::B2DPolyPolygon& rPolyPolygon, sal_Bool bClosed, sal_Bool bBezier, sal_Bool bNoSetAttr = sal_False) const;
SdrObject* ImpConvertAddText(SdrObject* pObj, FASTBOOL bBezier) const;
void ImpSetTextStyleSheetListeners();
@@ -430,7 +430,6 @@ public:
// Wird zur Bestimmung des Textankerbereichs benoetigt
virtual void TakeUnrotatedSnapRect(Rectangle& rRect) const;
- virtual SdrObject* CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const;
virtual void TakeObjNameSingul(String& rName) const;
virtual void TakeObjNamePlural(String& rName) const;
virtual void operator=(const SdrObject& rObj);
@@ -472,7 +471,6 @@ public:
virtual sal_Bool BegTextEdit(SdrOutliner& rOutl);
virtual void TakeTextEditArea(Size* pPaperMin, Size* pPaperMax, Rectangle* pViewInit, Rectangle* pViewMin) const;
virtual void EndTextEdit(SdrOutliner& rOutl);
- virtual SdrObject* CheckTextEditHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const;
virtual USHORT GetOutlinerViewAnchorMode() const;
void StartTextAnimation(OutputDevice* pOutDev, const Point& rOffset, long nExtraData=0L);
diff --git a/svx/inc/svx/svdouno.hxx b/svx/inc/svx/svdouno.hxx
index 0723e74528..e6a7d53869 100644
--- a/svx/inc/svx/svdouno.hxx
+++ b/svx/inc/svx/svdouno.hxx
@@ -90,7 +90,6 @@ public:
virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const;
virtual UINT16 GetObjIdentifier() const;
- virtual SdrObject* CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const;
virtual void operator = (const SdrObject& rObj);
virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
diff --git a/svx/inc/svx/svdovirt.hxx b/svx/inc/svx/svdovirt.hxx
index a6b99d5428..b055c37dc7 100644
--- a/svx/inc/svx/svdovirt.hxx
+++ b/svx/inc/svx/svdovirt.hxx
@@ -83,7 +83,6 @@ public:
virtual const Rectangle& GetLastBoundRect() const;
virtual void RecalcBoundRect();
virtual void SetChanged();
- virtual SdrObject* CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const;
virtual SdrObject* Clone() const;
virtual void operator=(const SdrObject& rObj);
diff --git a/svx/inc/svx/svdpage.hxx b/svx/inc/svx/svdpage.hxx
index 2b4c25d913..09ff53ee5d 100644
--- a/svx/inc/svx/svdpage.hxx
+++ b/svx/inc/svx/svdpage.hxx
@@ -132,9 +132,7 @@ friend class SdrEditView;
FASTBOOL bRectsDirty;
protected:
virtual void RecalcRects();
-//#if 0 // _SOLAR__PRIVATE
- FASTBOOL ImpGetFillColor(SdrObject* pObj, Color& rCol) const;
-//#endif // __PRIVATE
+
private:
/// simple ActionChildInserted forwarder to have it on a central place
void impChildInserted(SdrObject& rChild) const;
@@ -188,12 +186,6 @@ public:
const Rectangle& GetAllObjSnapRect() const;
const Rectangle& GetAllObjBoundRect() const;
- // HitTest auf alle Objekte der Liste
- SdrObject* CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer, FASTBOOL bBackward=FALSE) const;
- SdrObject* CheckHit(const Point& rPnt, USHORT nTol, FASTBOOL bBackward=FALSE) const { return CheckHit(rPnt,nTol,NULL,bBackward); }
- FASTBOOL IsHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const { return CheckHit(rPnt,nTol,pVisiLayer)!=NULL; }
- FASTBOOL IsHit(const Point& rPnt, USHORT nTol) const { return CheckHit(rPnt,nTol)!=NULL; } // #i24906#
-
// Alle Textobjekte neu formatieren, z.B. bei Druckerwechsel
void NbcReformatAllTextObjects();
void ReformatAllTextObjects();
@@ -204,14 +196,6 @@ public:
// Die Vorlagenattribute der Zeichenobjekte in harte Attribute verwandeln.
void BurnInStyleSheetAttributes();
- // Bestimmung der FuellFarbe an einer bestimmten Position.
- // FALSE=Kein Objekt mit FuellFarbe an dieser Position gefunden.
- // rVisLayers gibt die zu durchsuchenden Layer an.
- // bLayerSorted: TRUE=Es wird in der Reihenfolge der Layer gesucht (ni)
- // rCol: Hier wird die gefundene Farbe zurueckgegeben
- FASTBOOL GetFillColor(const Point& rPnt, const SetOfByte& rVisLayers,
- /* FASTBOOL bLayerSorted, */ Color& rCol) const;
-
ULONG GetObjCount() const;
SdrObject* GetObj(ULONG nNum) const;
@@ -444,10 +428,6 @@ friend class ChXChartDocument;
// this is a weak reference to a possible living api wrapper for this page
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxUnoPage;
- // #108867# used by GetFillColor
- FASTBOOL ImplGetFillColor(const Point& rPnt, const SetOfByte& rVisLayers,
- /* FASTBOOL bLayerSorted, */ Color& rCol, FASTBOOL bSkipBackgroundShape) const;
-
protected:
SdrLayerAdmin* pLayerAdmin;
SdrObject* pBackgroundObj;
@@ -530,15 +510,6 @@ public:
const SdrLayerAdmin& GetLayerAdmin() const { return *pLayerAdmin; }
SdrLayerAdmin& GetLayerAdmin() { return *pLayerAdmin; }
- // Bestimmung der FuellFarbe an einer bestimmten Position.
- // FALSE=Kein Objekt mit FuellFarbe an dieser Position gefunden.
- // rVisLayers gibt die zu durchsuchenden Layer an.
- // bLayerSorted: TRUE=Es wird in der Reihenfolge der Layer gesucht (ni)
- // rCol: Hier wird die gefundene Farbe zurueckgegeben
- // Auch MasterPages werden durchsucht.
- FASTBOOL GetFillColor(const Point& rPnt, const SetOfByte& rVisLayers,
- /*FASTBOOL bLayerSorted,*/ Color& rCol) const;
-
// GetBitmap und GetMetafile sind noch nicht implementiert.
// Bitmap in Bildschirmaufloesung und -farbtiefe aus den Objekten der
// Page erzeugen.
diff --git a/svx/inc/svx/svdpntv.hxx b/svx/inc/svx/svdpntv.hxx
index f345897dd7..33fd3d0812 100644
--- a/svx/inc/svx/svdpntv.hxx
+++ b/svx/inc/svx/svdpntv.hxx
@@ -109,7 +109,7 @@ namespace sdr
////////////////////////////////////////////////////////////////////////////////////////////////////
-class SvxViewHint : public SfxHint
+class SVX_DLLPUBLIC SvxViewHint : public SfxHint
{
public:
enum HintType { SVX_HINT_VIEWCHANGED };
@@ -319,6 +319,10 @@ public:
void SetHitTolerancePixel(USHORT nVal) { nHitTolPix=nVal; TheresNewMapMode(); }
USHORT GetHitTolerancePixel() const { return (USHORT)nHitTolPix; }
+ // data read access on logic HitTolerance and MinMoveTolerance
+ USHORT getHitTolLog() const { return nHitTolLog; }
+ USHORT getMinMovLog() const { return nMinMovLog; }
+
// Flag zur Visualisierung von Gruppen abfragen/testen
BOOL DoVisualizeEnteredGroup() const { return bVisualizeEnteredGroup; }
void SetVisualizeEnteredGroup(BOOL bNew) { bVisualizeEnteredGroup = bNew; }
@@ -559,35 +563,6 @@ public:
// #103911# Set document color for svx at SdrPageViews
void SetApplicationDocumentColor(Color aDocumentColor);
- /** Determine typical background color for given area on given page
-
- This method calculates a single representative color for the
- given rectangular area. This is accomplished by sampling from
- various points within that area, and calculating a weighted
- mean value of those samples. High contrast settings are
- respected by this method, i.e. in high contrast mode,
- svtools::DOCCOLOR is used as the background color.
-
- @attention For some cases, such as highly structured
- background or huge color ranges spanned by the background,
- this method cannot yield meaningful results, as the background
- simply cannot be represented by a single color. Beware.
-
- @param rArea
- Rectangular area to determine representative background color from
-
- @param rVisibleLayers
- Set of layers visible when calculating the background color
-
- @param rCurrPage
- Current page for which to determine background color on
-
- @return a representative background color.
- */
- Color CalcBackgroundColor( const Rectangle& rArea,
- const SetOfByte& rVisibleLayers,
- const SdrPage& rCurrPage ) const;
-
// #i38135#
// Sets the timer for Object animations and restarts.
void SetAnimationTimer(sal_uInt32 nTime);
diff --git a/svx/inc/svx/svdtext.hxx b/svx/inc/svx/svdtext.hxx
index 15751f7c8d..d44f426958 100644
--- a/svx/inc/svx/svdtext.hxx
+++ b/svx/inc/svx/svdtext.hxx
@@ -33,6 +33,7 @@
#include <sal/types.h>
#include "svx/svxdllapi.h"
+#include <tools/weakbase.hxx>
// --------------------------------------------------------------------
@@ -49,7 +50,7 @@ namespace sdr { namespace properties {
/** This class stores information about one text inside a shape.
*/
-class SVX_DLLPUBLIC SdrText
+class SVX_DLLPUBLIC SdrText : public tools::WeakBase< SdrText >
{
public:
SdrText( SdrTextObj& rObject, OutlinerParaObject* pOutlinerParaObject = 0 );
diff --git a/svx/inc/svx/svdundo.hxx b/svx/inc/svx/svdundo.hxx
index e098fd3345..de73a88333 100644
--- a/svx/inc/svx/svdundo.hxx
+++ b/svx/inc/svx/svdundo.hxx
@@ -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
@@ -484,6 +484,35 @@ public:
virtual bool CanSdrRepeat(SdrView& rView) const;
};
+// --> OD 2009-07-09 #i73249#
+class SdrUndoObjStrAttr : public SdrUndoObj
+{
+public:
+ enum ObjStrAttrType
+ {
+ OBJ_NAME,
+ OBJ_TITLE,
+ OBJ_DESCRIPTION
+ };
+
+protected:
+ const ObjStrAttrType meObjStrAttr;
+ const String msOldStr;
+ const String msNewStr;
+
+public:
+ SdrUndoObjStrAttr( SdrObject& rNewObj,
+ const ObjStrAttrType eObjStrAttr,
+ const String& sOldStr,
+ const String& sNewStr);
+
+ virtual void Undo();
+ virtual void Redo();
+
+ virtual String GetComment() const;
+};
+// <--
+
////////////////////////////////////////////////////////////////////////////////////////////////////
//
// @@ @@@@ @@ @@ @@@@@ @@@@@
@@ -754,7 +783,7 @@ protected:
SdrUndoPageMasterPage(SdrPage& rChangedPage);
public:
- virtual ~SdrUndoPageMasterPage();
+ SVX_DLLPUBLIC virtual ~SdrUndoPageMasterPage();
};
//************************************************************
@@ -827,6 +856,13 @@ public:
virtual SdrUndoAction* CreateUndoObjectLayerChange( SdrObject& rObject, SdrLayerID aOldLayer, SdrLayerID aNewLayer );
virtual SdrUndoAction* CreateUndoObjectSetText( SdrObject& rNewObj, sal_Int32 nText );
+ // --> OD 2009-07-09 #i73249#
+ virtual SdrUndoAction* CreateUndoObjectStrAttr( SdrObject& rObject,
+ SdrUndoObjStrAttr::ObjStrAttrType eObjStrAttrType,
+ String sOldStr,
+ String sNewStr );
+ // <--
+
// layer
virtual SdrUndoAction* CreateUndoNewLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel);
virtual SdrUndoAction* CreateUndoDeleteLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel);
diff --git a/svx/inc/svx/svx3ditems.hxx b/svx/inc/svx/svx3ditems.hxx
index 558c1904cf..a9ea7d22b1 100644
--- a/svx/inc/svx/svx3ditems.hxx
+++ b/svx/inc/svx/svx3ditems.hxx
@@ -48,12 +48,12 @@ public:
class Svx3DBackscaleItem : public SfxUInt16Item {
public:
- Svx3DBackscaleItem(sal_uInt16 nVal = 100);
+ SVX_DLLPUBLIC Svx3DBackscaleItem(sal_uInt16 nVal = 100);
};
class Svx3DDepthItem : public SfxUInt32Item {
public:
- Svx3DDepthItem(sal_uInt32 nVal = 1000);
+ SVX_DLLPUBLIC Svx3DDepthItem(sal_uInt32 nVal = 1000);
};
class SVX_DLLPUBLIC Svx3DHorizontalSegmentsItem : public SfxUInt32Item {
@@ -63,12 +63,12 @@ public:
class Svx3DVerticalSegmentsItem : public SfxUInt32Item {
public:
- Svx3DVerticalSegmentsItem(sal_uInt32 nVal = 24);
+ SVX_DLLPUBLIC Svx3DVerticalSegmentsItem(sal_uInt32 nVal = 24);
};
class Svx3DEndAngleItem : public SfxUInt32Item {
public:
- Svx3DEndAngleItem(sal_uInt32 nVal = 3600);
+ SVX_DLLPUBLIC Svx3DEndAngleItem(sal_uInt32 nVal = 3600);
};
class SVX_DLLPUBLIC Svx3DDoubleSidedItem : public SfxBoolItem {
@@ -85,29 +85,29 @@ public:
virtual sal_uInt16 GetVersion(sal_uInt16 nFileFormatVersion) const;
};
-class Svx3DNormalsKindItem : public SfxUInt16Item {
+class SVX_DLLPUBLIC Svx3DNormalsKindItem : public SfxUInt16Item {
public:
Svx3DNormalsKindItem(sal_uInt16 nVal = 0);
// use drawing::NormalsKind
- virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const;
- virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 );
- virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const;
+ SVX_DLLPRIVATE virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const;
+ SVX_DLLPRIVATE virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 );
+ SVX_DLLPRIVATE virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const;
};
class Svx3DNormalsInvertItem : public SfxBoolItem {
public:
- Svx3DNormalsInvertItem(BOOL bVal = 0);
+ SVX_DLLPUBLIC Svx3DNormalsInvertItem(BOOL bVal = 0);
};
-class Svx3DTextureProjectionXItem : public SfxUInt16Item {
+class SVX_DLLPUBLIC Svx3DTextureProjectionXItem : public SfxUInt16Item {
public:
Svx3DTextureProjectionXItem(sal_uInt16 nVal = 0);
// use drawing::TextureProjectionMode
- virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const;
- virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 );
- virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const;
+ SVX_DLLPRIVATE virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const;
+ SVX_DLLPRIVATE virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 );
+ SVX_DLLPRIVATE virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const;
};
class SVX_DLLPUBLIC Svx3DTextureProjectionYItem : public SfxUInt16Item {
@@ -122,7 +122,7 @@ public:
class Svx3DShadow3DItem : public SfxBoolItem {
public:
- Svx3DShadow3DItem(BOOL bVal = 0);
+ SVX_DLLPUBLIC Svx3DShadow3DItem(BOOL bVal = 0);
};
class Svx3DMaterialColorItem : public SvxColorItem {
@@ -132,68 +132,68 @@ public:
class Svx3DMaterialEmissionItem : public SvxColorItem {
public:
- Svx3DMaterialEmissionItem(const Color& rCol = Color(0x00000000));
+ SVX_DLLPUBLIC Svx3DMaterialEmissionItem(const Color& rCol = Color(0x00000000));
};
class Svx3DMaterialSpecularItem : public SvxColorItem {
public:
- Svx3DMaterialSpecularItem(const Color& rCol = Color(0x00ffffff));
+ SVX_DLLPUBLIC Svx3DMaterialSpecularItem(const Color& rCol = Color(0x00ffffff));
};
class Svx3DMaterialSpecularIntensityItem : public SfxUInt16Item {
public:
- Svx3DMaterialSpecularIntensityItem(sal_uInt16 nVal = 15);
+ SVX_DLLPUBLIC Svx3DMaterialSpecularIntensityItem(sal_uInt16 nVal = 15);
};
-class Svx3DTextureKindItem : public SfxUInt16Item {
+class SVX_DLLPUBLIC Svx3DTextureKindItem : public SfxUInt16Item {
public:
Svx3DTextureKindItem(sal_uInt16 nVal = 3);
// use drawing::TextureKind
- virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const;
- virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 );
- virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const;
+ SVX_DLLPRIVATE virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const;
+ SVX_DLLPRIVATE virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 );
+ SVX_DLLPRIVATE virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const;
};
-class Svx3DTextureModeItem : public SfxUInt16Item {
+class SVX_DLLPUBLIC Svx3DTextureModeItem : public SfxUInt16Item {
public:
Svx3DTextureModeItem(sal_uInt16 nVal = 2);
// use drawing:TextureMode
- virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const;
- virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 );
- virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const;
+ SVX_DLLPRIVATE virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const;
+ SVX_DLLPRIVATE virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 );
+ SVX_DLLPRIVATE virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const;
};
class Svx3DTextureFilterItem : public SfxBoolItem {
public:
- Svx3DTextureFilterItem(BOOL bVal = 0);
+ SVX_DLLPUBLIC Svx3DTextureFilterItem(BOOL bVal = 0);
};
// Svx3D _3DSCENE_ Items
-class Svx3DPerspectiveItem : public SfxUInt16Item {
+class SVX_DLLPUBLIC Svx3DPerspectiveItem : public SfxUInt16Item {
public:
Svx3DPerspectiveItem(sal_uInt16 nVal = (sal_uInt16)PR_PERSPECTIVE);
// use drawing::ProjectionMode
- virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const;
- virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 );
- virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const;
+ SVX_DLLPRIVATE virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const;
+ SVX_DLLPRIVATE virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 );
+ SVX_DLLPRIVATE virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const;
};
class Svx3DDistanceItem : public SfxUInt32Item {
public:
- Svx3DDistanceItem(sal_uInt32 nVal = 100);
+ SVX_DLLPUBLIC Svx3DDistanceItem(sal_uInt32 nVal = 100);
};
class Svx3DFocalLengthItem : public SfxUInt32Item {
public:
- Svx3DFocalLengthItem(sal_uInt32 nVal = 100);
+ SVX_DLLPUBLIC Svx3DFocalLengthItem(sal_uInt32 nVal = 100);
};
class Svx3DTwoSidedLightingItem : public SfxBoolItem {
public:
- Svx3DTwoSidedLightingItem(BOOL bVal = 0);
+ SVX_DLLPUBLIC Svx3DTwoSidedLightingItem(BOOL bVal = 0);
};
class SVX_DLLPUBLIC Svx3DLightcolor1Item : public SvxColorItem {
@@ -323,17 +323,17 @@ public:
class Svx3DShadowSlantItem : public SfxUInt16Item {
public:
- Svx3DShadowSlantItem(sal_uInt16 nVal = 0);
+ SVX_DLLPUBLIC Svx3DShadowSlantItem(sal_uInt16 nVal = 0);
};
-class Svx3DShadeModeItem : public SfxUInt16Item {
+class SVX_DLLPUBLIC Svx3DShadeModeItem : public SfxUInt16Item {
public:
Svx3DShadeModeItem(sal_uInt16 nVal = 2);
// use drawing::ShadeMode
- virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const;
- virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 );
- virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const;
+ SVX_DLLPRIVATE virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const;
+ SVX_DLLPRIVATE virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 );
+ SVX_DLLPRIVATE virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const;
};
//////////////////////////////////////////////////////////////////////////////
@@ -362,19 +362,19 @@ public:
};
// #107245# Item to replace bExtrudeCloseFront and bLatheCloseFront
-class Svx3DCloseFrontItem : public SfxBoolItem {
+class SVX_DLLPUBLIC Svx3DCloseFrontItem : public SfxBoolItem {
public:
Svx3DCloseFrontItem(BOOL bVal = 1);
- virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nItemVersion) const;
- virtual sal_uInt16 GetVersion(sal_uInt16 nFileFormatVersion) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nItemVersion) const;
+ SVX_DLLPRIVATE virtual sal_uInt16 GetVersion(sal_uInt16 nFileFormatVersion) const;
};
// #107245# Item to replace bExtrudeCloseBack and bLatheCloseBack
-class Svx3DCloseBackItem : public SfxBoolItem {
+class SVX_DLLPUBLIC Svx3DCloseBackItem : public SfxBoolItem {
public:
Svx3DCloseBackItem(BOOL bVal = 1);
- virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nItemVersion) const;
- virtual sal_uInt16 GetVersion(sal_uInt16 nFileFormatVersion) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nItemVersion) const;
+ SVX_DLLPRIVATE virtual sal_uInt16 GetVersion(sal_uInt16 nFileFormatVersion) const;
};
#endif // _SVX3DITEMS_HXX
diff --git a/svx/inc/svx/svxdlg.hxx b/svx/inc/svx/svxdlg.hxx
index 0db2d86534..613d5752f5 100644
--- a/svx/inc/svx/svxdlg.hxx
+++ b/svx/inc/svx/svxdlg.hxx
@@ -347,6 +347,13 @@ public:
virtual sal_Int32 getColumns() const = 0;
};
+class SvxAbstractInsRowColDlg : public VclAbstractDialog
+{
+public:
+ virtual bool isInsertBefore() const = 0;
+ virtual sal_uInt16 getInsertCount() const = 0;
+};
+
//-------------------------------------------------------------
class SVX_DLLPUBLIC SvxAbstractDialogFactory : public SfxAbstractDialogFactory
@@ -543,6 +550,8 @@ public:
virtual SvxAbstractSplittTableDialog* CreateSvxSplittTableDialog( Window* pParent, bool bIsTableVertical, long nMaxVertical, long nMaxHorizontal )=0;
virtual SvxAbstractNewTableDialog* CreateSvxNewTableDialog( Window* pParent ) = 0;
+
+ virtual SvxAbstractInsRowColDlg* CreateSvxInsRowColDlg( Window* pParent, bool bCol, ULONG nHelpId ) = 0;
};
#endif
diff --git a/svx/inc/svx/svxfont.hxx b/svx/inc/svx/svxfont.hxx
index 656bcef471..a710c64097 100644
--- a/svx/inc/svx/svxfont.hxx
+++ b/svx/inc/svx/svxfont.hxx
@@ -70,7 +70,8 @@ public:
inline void SetCaseMap( const SvxCaseMap eNew ) { eCaseMap = eNew; }
inline LanguageType GetLanguage() const { return eLang; }
- inline void SetLanguage( const LanguageType eNewLan ) { eLang = eNewLan; }
+ inline void SetLanguage( const LanguageType eNewLan )
+ { eLang = eNewLan; Font::SetLanguage(eNewLan); }
// Is-Methoden:
inline BOOL IsCaseMap() const { return SVX_CASEMAP_NOT_MAPPED != eCaseMap; }
diff --git a/svx/inc/svx/svxids.hrc b/svx/inc/svx/svxids.hrc
index 4bfad86fba..36ca4a48e4 100644
--- a/svx/inc/svx/svxids.hrc
+++ b/svx/inc/svx/svxids.hrc
@@ -831,7 +831,11 @@
#define SID_OFASLOTS_START ( SID_SVX_START + 425 )
//#define SID_SD_AUTOPILOT ( SID_SVX_START + 425 ) -> sfxsids.hrc
#define SID_AUTOPILOT SID_SD_AUTOPILOT
-// 4 defines of Writer's old wizards have been removed here
+
+#define SID_TABLE_INSERT_COL_DLG ( SID_SVX_START + 426 )
+#define SID_TABLE_INSERT_ROW_DLG ( SID_SVX_START + 427 )
+#define SID_TABLE_PARAM_INSERT_AFTER ( SID_SVX_START + 428 )
+
#define SID_TABLEDESIGN ( SID_SVX_START + 429 )
#define SID_MN_AUTOPILOT ( SID_SVX_START + 430 )
#define SID_GENERAL_OPTIONS ( SID_SVX_START + 432 )
diff --git a/svx/inc/svx/sxfiitm.hxx b/svx/inc/svx/sxfiitm.hxx
index 6b985bf586..ab8e35de0e 100644
--- a/svx/inc/svx/sxfiitm.hxx
+++ b/svx/inc/svx/sxfiitm.hxx
@@ -40,7 +40,7 @@
class SdrFractionItem: public SfxPoolItem {
Fraction nValue;
public:
- TYPEINFO();
+ TYPEINFO_VISIBILITY( SVX_DLLPUBLIC );
SdrFractionItem(USHORT nId=0): SfxPoolItem(nId) {}
SdrFractionItem(USHORT nId, const Fraction& rVal): SfxPoolItem(nId), nValue(rVal) {}
SdrFractionItem(USHORT nId, SvStream& rIn);
diff --git a/svx/inc/svx/unoedsrc.hxx b/svx/inc/svx/unoedsrc.hxx
index a152063fb0..b6601ff93a 100644
--- a/svx/inc/svx/unoedsrc.hxx
+++ b/svx/inc/svx/unoedsrc.hxx
@@ -31,6 +31,8 @@
#ifndef _SVX_UNOEDSRC_HXX
#define _SVX_UNOEDSRC_HXX
+#include <com/sun/star/accessibility/TextSegment.hpp>
+
#include <tools/solar.h>
#include <i18npool/lang.h>
#include <tools/link.hxx>
@@ -357,6 +359,36 @@ public:
*/
virtual USHORT GetLineLen( USHORT nPara, USHORT nLine ) const = 0;
+
+ /** Query bounds of line in paragraph
+
+ @param rStart [output param; 0 .. text_len]
+ The index in the paragraph text that belongs to the chara at the start of the line
+
+ @param rEnd [output param; 0 .. text_len]
+ The index in the paragraph text that follows the last chara in the line
+
+ @param nParagraph[0 .. n-1]
+ Index of paragraph to query line length in
+
+ @param nLine[0 .. m-1]
+ Index of line in paragraph to query line length of
+
+ */
+ virtual void GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT nParagraph, USHORT nLine ) const = 0;
+
+ /** Query the line number for a index in the paragraphs text
+
+ @param nPara[0 .. n-1]
+ Index of paragraph to query line length in
+
+ @param nIndex[0 .. m-1]
+ Index of of the chara in the paragraph text
+
+ @returns [0 .. k-1]
+ The line number of the chara in the paragraph
+ */
+ virtual USHORT GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const = 0;
/** Delete given text range and reformat text
diff --git a/svx/inc/svx/unofored.hxx b/svx/inc/svx/unofored.hxx
index d8cdb8ee5e..6aa4a18fb0 100644
--- a/svx/inc/svx/unofored.hxx
+++ b/svx/inc/svx/unofored.hxx
@@ -81,6 +81,8 @@ public:
virtual sal_Bool GetAttributeRun( USHORT& nStartIndex, USHORT& nEndIndex, USHORT nPara, USHORT nIndex ) const;
virtual USHORT GetLineCount( USHORT nPara ) const;
virtual USHORT GetLineLen( USHORT nPara, USHORT nLine ) const;
+ virtual void GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT nParagraph, USHORT nLine ) const;
+ virtual USHORT GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const;
virtual sal_Bool Delete( const ESelection& );
virtual sal_Bool InsertText( const String&, const ESelection& );
virtual sal_Bool QuickFormatDoc( BOOL bFull=FALSE );
diff --git a/svx/inc/svx/unoforou.hxx b/svx/inc/svx/unoforou.hxx
index bd3b9d6d24..bb56d57721 100644
--- a/svx/inc/svx/unoforou.hxx
+++ b/svx/inc/svx/unoforou.hxx
@@ -102,6 +102,8 @@ public:
virtual sal_Bool GetAttributeRun( USHORT& nStartIndex, USHORT& nEndIndex, USHORT nPara, USHORT nIndex ) const;
virtual USHORT GetLineCount( USHORT nPara ) const;
virtual USHORT GetLineLen( USHORT nPara, USHORT nLine ) const;
+ virtual void GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT nPara, USHORT nLine ) const;
+ virtual USHORT GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const;
virtual sal_Bool Delete( const ESelection& );
virtual sal_Bool InsertText( const String&, const ESelection& );
virtual sal_Bool QuickFormatDoc( BOOL bFull=FALSE );
diff --git a/svx/inc/svx/unoprov.hxx b/svx/inc/svx/unoprov.hxx
index dac1f96f66..fcef2c605b 100644
--- a/svx/inc/svx/unoprov.hxx
+++ b/svx/inc/svx/unoprov.hxx
@@ -166,7 +166,7 @@ namespace comphelper { class PropertySetInfo; }
class SvxPropertySetInfoPool
{
public:
- static comphelper::PropertySetInfo* getOrCreate( sal_Int32 nServiceId ) throw();
+ SVX_DLLPUBLIC static comphelper::PropertySetInfo* getOrCreate( sal_Int32 nServiceId ) throw();
private:
static comphelper::PropertySetInfo* mpInfos[SVXUNO_SERVICEID_LASTID+1];
diff --git a/svx/inc/svx/unoshtxt.hxx b/svx/inc/svx/unoshtxt.hxx
index 6a128bda89..1c0c2d0de6 100644
--- a/svx/inc/svx/unoshtxt.hxx
+++ b/svx/inc/svx/unoshtxt.hxx
@@ -35,9 +35,14 @@
#include <svx/unoedsrc.hxx>
#include "svx/svxdllapi.h"
-namespace com { namespace sun { namespace star { namespace uno {
- class XInterface;
-} } } }
+namespace com { namespace sun { namespace star {
+ namespace uno {
+ class XInterface;
+ }
+ namespace accessibility {
+ struct TextSegment;
+ }
+} } }
class SvxTextForwarder;
class SdrObject;
@@ -80,7 +85,7 @@ public:
// static sal_Bool hasLevels( const SdrObject* pObject );
- // the viewforwarder interface
+ // the SvxViewForwarder interface
virtual BOOL IsValid() const;
virtual Rectangle GetVisArea() const;
virtual Point LogicToPixel( const Point&, const MapMode& ) const;
diff --git a/svx/inc/svx/unotext.hxx b/svx/inc/svx/unotext.hxx
index 478180bb75..fb06d47343 100644
--- a/svx/inc/svx/unotext.hxx
+++ b/svx/inc/svx/unotext.hxx
@@ -231,6 +231,8 @@ public:
virtual sal_Bool GetAttributeRun( USHORT& nStartIndex, USHORT& nEndIndex, USHORT nPara, USHORT nIndex ) const;
virtual USHORT GetLineCount( USHORT nPara ) const;
virtual USHORT GetLineLen( USHORT nPara, USHORT nLine ) const;
+ virtual void GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT nParagraph, USHORT nLine ) const;
+ virtual USHORT GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const;
virtual sal_Bool Delete( const ESelection& );
virtual sal_Bool InsertText( const String&, const ESelection& );
virtual sal_Bool QuickFormatDoc( BOOL bFull=FALSE );
@@ -673,9 +675,9 @@ public:
};
-const SvxItemPropertySet* ImplGetSvxUnoOutlinerTextCursorSvxPropertySet();
-const SfxItemPropertyMapEntry* ImplGetSvxUnoOutlinerTextCursorPropertyMap();
-const SvxItemPropertySet* ImplGetSvxTextPortionSvxPropertySet();
-const SfxItemPropertyMapEntry* ImplGetSvxTextPortionPropertyMap();
+SVX_DLLPUBLIC const SvxItemPropertySet* ImplGetSvxUnoOutlinerTextCursorSvxPropertySet();
+SVX_DLLPUBLIC const SfxItemPropertyMapEntry* ImplGetSvxUnoOutlinerTextCursorPropertyMap();
+SVX_DLLPUBLIC const SvxItemPropertySet* ImplGetSvxTextPortionSvxPropertySet();
+SVX_DLLPUBLIC const SfxItemPropertyMapEntry* ImplGetSvxTextPortionPropertyMap();
#endif
diff --git a/svx/inc/svx/xcolit.hxx b/svx/inc/svx/xcolit.hxx
index 2c36e77975..f1bc9f0643 100644
--- a/svx/inc/svx/xcolit.hxx
+++ b/svx/inc/svx/xcolit.hxx
@@ -48,7 +48,7 @@ class SVX_DLLPUBLIC XColorItem : public NameOrIndex
public:
TYPEINFO();
XColorItem() {}
- XColorItem(USHORT nWhich, long nIndex, const Color& rTheColor);
+ XColorItem(USHORT nWhich, INT32 nIndex, const Color& rTheColor);
virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const;
virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 );
diff --git a/svx/inc/svx/xflbckit.hxx b/svx/inc/svx/xflbckit.hxx
index dbebc22532..ff4e898c29 100644
--- a/svx/inc/svx/xflbckit.hxx
+++ b/svx/inc/svx/xflbckit.hxx
@@ -46,13 +46,13 @@ public:
TYPEINFO();
XFillBackgroundItem( BOOL bFill = FALSE );
- XFillBackgroundItem( SvStream& rIn );
+ SVX_DLLPRIVATE XFillBackgroundItem( SvStream& rIn );
- virtual SfxPoolItem* Clone( SfxItemPool* pPool = NULL ) const;
- virtual SfxPoolItem* Create( SvStream& rIn, USHORT nVer ) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Clone( SfxItemPool* pPool = NULL ) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Create( SvStream& rIn, USHORT nVer ) const;
- virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SVX_DLLPRIVATE virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
SfxMapUnit eCoreMetric,
SfxMapUnit ePresMetric,
String &rText, const IntlWrapper * = 0 ) const;
diff --git a/svx/inc/svx/xflbmpit.hxx b/svx/inc/svx/xflbmpit.hxx
index 43367a2238..e4b5174e90 100644
--- a/svx/inc/svx/xflbmpit.hxx
+++ b/svx/inc/svx/xflbmpit.hxx
@@ -45,18 +45,18 @@ class SVX_DLLPUBLIC XFillBmpPosItem : public SfxEnumItem
public:
TYPEINFO();
XFillBmpPosItem( RECT_POINT eRP = RP_MM );
- XFillBmpPosItem( SvStream& rIn );
+ SVX_DLLPRIVATE XFillBmpPosItem( SvStream& rIn );
- virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
- virtual SfxPoolItem* Create( SvStream& rIn, USHORT nVer ) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Create( SvStream& rIn, USHORT nVer ) const;
- virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SVX_DLLPRIVATE virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
SfxMapUnit eCoreMetric,
SfxMapUnit ePresMetric,
String &rText, const IntlWrapper * = 0 ) const;
- virtual USHORT GetValueCount() const;
- RECT_POINT GetValue() const { return (RECT_POINT) SfxEnumItem::GetValue(); }
+ SVX_DLLPRIVATE virtual USHORT GetValueCount() const;
+ SVX_DLLPRIVATE RECT_POINT GetValue() const { return (RECT_POINT) SfxEnumItem::GetValue(); }
};
diff --git a/svx/inc/svx/xflbmsli.hxx b/svx/inc/svx/xflbmsli.hxx
index c1cf2ad936..eb22a47016 100644
--- a/svx/inc/svx/xflbmsli.hxx
+++ b/svx/inc/svx/xflbmsli.hxx
@@ -45,12 +45,12 @@ class SVX_DLLPUBLIC XFillBmpSizeLogItem : public SfxBoolItem
public:
TYPEINFO();
XFillBmpSizeLogItem( BOOL bLog = TRUE );
- XFillBmpSizeLogItem( SvStream& rIn );
+ SVX_DLLPRIVATE XFillBmpSizeLogItem( SvStream& rIn );
- virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
- virtual SfxPoolItem* Create( SvStream& rIn, USHORT nVer ) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Create( SvStream& rIn, USHORT nVer ) const;
- virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SVX_DLLPRIVATE virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
SfxMapUnit eCoreMetric,
SfxMapUnit ePresMetric,
String &rText, const IntlWrapper * = 0 ) const;
diff --git a/svx/inc/svx/xflbmsxy.hxx b/svx/inc/svx/xflbmsxy.hxx
index 45eb9d32ba..39eabd4d41 100644
--- a/svx/inc/svx/xflbmsxy.hxx
+++ b/svx/inc/svx/xflbmsxy.hxx
@@ -45,12 +45,12 @@ class SVX_DLLPUBLIC XFillBmpSizeXItem : public SfxMetricItem
public:
TYPEINFO();
XFillBmpSizeXItem( long nSizeX = 0 );
- XFillBmpSizeXItem( SvStream& rIn );
+ SVX_DLLPRIVATE XFillBmpSizeXItem( SvStream& rIn );
- virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
- virtual SfxPoolItem* Create( SvStream& rIn, USHORT nVer ) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Create( SvStream& rIn, USHORT nVer ) const;
- virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SVX_DLLPRIVATE virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
SfxMapUnit eCoreMetric,
SfxMapUnit ePresMetric,
String &rText, const IntlWrapper * = 0 ) const;
@@ -58,7 +58,7 @@ public:
// Dieses Item nimmt sowohl metrische als auch
// Prozentwerte ( sind negativ ) auf; das muessen
// wir hier beruecksichtigen
- virtual FASTBOOL HasMetrics() const;
+ SVX_DLLPRIVATE virtual FASTBOOL HasMetrics() const;
};
/*************************************************************************
@@ -72,12 +72,12 @@ class SVX_DLLPUBLIC XFillBmpSizeYItem : public SfxMetricItem
public:
TYPEINFO();
XFillBmpSizeYItem( long nSizeY = 0 );
- XFillBmpSizeYItem( SvStream& rIn );
+ SVX_DLLPRIVATE XFillBmpSizeYItem( SvStream& rIn );
- virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
- virtual SfxPoolItem* Create( SvStream& rIn, USHORT nVer ) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Create( SvStream& rIn, USHORT nVer ) const;
- virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SVX_DLLPRIVATE virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
SfxMapUnit eCoreMetric,
SfxMapUnit ePresMetric,
String &rText, const IntlWrapper * = 0 ) const;
@@ -85,7 +85,7 @@ public:
// Dieses Item nimmt sowohl metrische als auch
// Prozentwerte ( sind negativ ) auf; das muessen
// wir hier beruecksichtigen
- virtual FASTBOOL HasMetrics() const;
+ SVX_DLLPRIVATE virtual FASTBOOL HasMetrics() const;
};
#endif
diff --git a/svx/inc/svx/xflboxy.hxx b/svx/inc/svx/xflboxy.hxx
index 59dd441545..1d1d8d5eb5 100644
--- a/svx/inc/svx/xflboxy.hxx
+++ b/svx/inc/svx/xflboxy.hxx
@@ -45,12 +45,12 @@ class SVX_DLLPUBLIC XFillBmpPosOffsetXItem : public SfxUInt16Item
public:
TYPEINFO();
XFillBmpPosOffsetXItem( USHORT nOffPosX = 0 );
- XFillBmpPosOffsetXItem( SvStream& rIn );
+ SVX_DLLPRIVATE XFillBmpPosOffsetXItem( SvStream& rIn );
- virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
- virtual SfxPoolItem* Create( SvStream& rIn, USHORT nVer ) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Create( SvStream& rIn, USHORT nVer ) const;
- virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SVX_DLLPRIVATE virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
SfxMapUnit eCoreMetric,
SfxMapUnit ePresMetric,
String &rText, const IntlWrapper * = 0 ) const;
@@ -68,12 +68,12 @@ class SVX_DLLPUBLIC XFillBmpPosOffsetYItem : public SfxUInt16Item
public:
TYPEINFO();
XFillBmpPosOffsetYItem( USHORT nOffPosY = 0 );
- XFillBmpPosOffsetYItem( SvStream& rIn );
+ SVX_DLLPRIVATE XFillBmpPosOffsetYItem( SvStream& rIn );
- virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
- virtual SfxPoolItem* Create( SvStream& rIn, USHORT nVer ) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Create( SvStream& rIn, USHORT nVer ) const;
- virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SVX_DLLPRIVATE virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
SfxMapUnit eCoreMetric,
SfxMapUnit ePresMetric,
String &rText, const IntlWrapper * = 0 ) const;
diff --git a/svx/inc/svx/xflbtoxy.hxx b/svx/inc/svx/xflbtoxy.hxx
index dd7068e7e6..83b283ea77 100644
--- a/svx/inc/svx/xflbtoxy.hxx
+++ b/svx/inc/svx/xflbtoxy.hxx
@@ -45,12 +45,12 @@ class SVX_DLLPUBLIC XFillBmpTileOffsetXItem : public SfxUInt16Item
public:
TYPEINFO();
XFillBmpTileOffsetXItem( USHORT nOffX = 0 );
- XFillBmpTileOffsetXItem( SvStream& rIn );
+ SVX_DLLPRIVATE XFillBmpTileOffsetXItem( SvStream& rIn );
- virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
- virtual SfxPoolItem* Create( SvStream& rIn, USHORT nVer ) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Create( SvStream& rIn, USHORT nVer ) const;
- virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SVX_DLLPRIVATE virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
SfxMapUnit eCoreMetric,
SfxMapUnit ePresMetric,
String &rText, const IntlWrapper * = 0 ) const;
@@ -68,12 +68,12 @@ class SVX_DLLPUBLIC XFillBmpTileOffsetYItem : public SfxUInt16Item
public:
TYPEINFO();
XFillBmpTileOffsetYItem( USHORT nOffX = 0 );
- XFillBmpTileOffsetYItem( SvStream& rIn );
+ SVX_DLLPRIVATE XFillBmpTileOffsetYItem( SvStream& rIn );
- virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
- virtual SfxPoolItem* Create( SvStream& rIn, USHORT nVer ) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Create( SvStream& rIn, USHORT nVer ) const;
- virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SVX_DLLPRIVATE virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
SfxMapUnit eCoreMetric,
SfxMapUnit ePresMetric,
String &rText, const IntlWrapper * = 0 ) const;
diff --git a/svx/inc/svx/xflclit.hxx b/svx/inc/svx/xflclit.hxx
index a91389987f..c579b66c2b 100644
--- a/svx/inc/svx/xflclit.hxx
+++ b/svx/inc/svx/xflclit.hxx
@@ -46,7 +46,7 @@ class SVX_DLLPUBLIC XFillColorItem : public XColorItem
public:
TYPEINFO();
XFillColorItem() {}
- XFillColorItem(long nIndex, const Color& rTheColor);
+ XFillColorItem(INT32 nIndex, const Color& rTheColor);
XFillColorItem(const String& rName, const Color& rTheColor);
XFillColorItem(SvStream& rIn);
diff --git a/svx/inc/svx/xflftrit.hxx b/svx/inc/svx/xflftrit.hxx
index abac4dc3f7..9737cf3b10 100644
--- a/svx/inc/svx/xflftrit.hxx
+++ b/svx/inc/svx/xflftrit.hxx
@@ -50,7 +50,7 @@ public:
TYPEINFO();
XFillFloatTransparenceItem();
- XFillFloatTransparenceItem( long nIndex, const XGradient& rGradient, BOOL bEnable = TRUE );
+ XFillFloatTransparenceItem( INT32 nIndex, const XGradient& rGradient, BOOL bEnable = TRUE );
XFillFloatTransparenceItem(const String& rName, const XGradient& rGradient, BOOL bEnable = TRUE );
XFillFloatTransparenceItem(SfxItemPool* pPool, const XGradient& rTheGradient, BOOL bEnable = TRUE );
XFillFloatTransparenceItem(SfxItemPool* pPool );
diff --git a/svx/inc/svx/xflgrit.hxx b/svx/inc/svx/xflgrit.hxx
index be4da4cce5..cf1bdcac6c 100644
--- a/svx/inc/svx/xflgrit.hxx
+++ b/svx/inc/svx/xflgrit.hxx
@@ -47,7 +47,7 @@ class SVX_DLLPUBLIC XFillGradientItem : public NameOrIndex
public:
TYPEINFO();
XFillGradientItem() : NameOrIndex(XATTR_FILLGRADIENT, -1) {}
- XFillGradientItem(long nIndex, const XGradient& rTheGradient);
+ XFillGradientItem(INT32 nIndex, const XGradient& rTheGradient);
XFillGradientItem(const UniString& rName, const XGradient& rTheGradient);
XFillGradientItem(SfxItemPool* pPool, const XGradient& rTheGradient);
XFillGradientItem(SfxItemPool* pPool );
diff --git a/svx/inc/svx/xflhtit.hxx b/svx/inc/svx/xflhtit.hxx
index a67fa8ef46..4f6ffefe0e 100644
--- a/svx/inc/svx/xflhtit.hxx
+++ b/svx/inc/svx/xflhtit.hxx
@@ -47,7 +47,7 @@ class SVX_DLLPUBLIC XFillHatchItem : public NameOrIndex
public:
TYPEINFO();
XFillHatchItem() : NameOrIndex(XATTR_FILLHATCH, -1) {}
- XFillHatchItem(long nIndex, const XHatch& rTheHatch);
+ XFillHatchItem(INT32 nIndex, const XHatch& rTheHatch);
XFillHatchItem(const String& rName, const XHatch& rTheHatch);
XFillHatchItem(SfxItemPool* pPool, const XHatch& rTheHatch);
XFillHatchItem(SfxItemPool* pPool );
diff --git a/svx/inc/svx/xftshcit.hxx b/svx/inc/svx/xftshcit.hxx
index 353a02235c..f05319fbbe 100644
--- a/svx/inc/svx/xftshcit.hxx
+++ b/svx/inc/svx/xftshcit.hxx
@@ -45,7 +45,7 @@ class SVX_DLLPUBLIC XFormTextShadowColorItem : public XColorItem
public:
TYPEINFO();
XFormTextShadowColorItem() {}
- XFormTextShadowColorItem(long nIndex, const Color& rTheColor);
+ XFormTextShadowColorItem(INT32 nIndex, const Color& rTheColor);
XFormTextShadowColorItem(const String& rName, const Color& rTheColor);
XFormTextShadowColorItem(SvStream& rIn);
diff --git a/svx/inc/svx/xit.hxx b/svx/inc/svx/xit.hxx
index c1754690d2..35b78558aa 100644
--- a/svx/inc/svx/xit.hxx
+++ b/svx/inc/svx/xit.hxx
@@ -54,7 +54,7 @@ typedef BOOL (*SvxCompareValueFunc)( const NameOrIndex* p1, const NameOrIndex* p
//-------------------
class SVX_DLLPUBLIC NameOrIndex : public SfxStringItem
{
- long nPalIndex;
+ INT32 nPalIndex;
protected:
void Detach() { nPalIndex = -1; }
@@ -62,7 +62,7 @@ protected:
public:
TYPEINFO();
NameOrIndex() { nPalIndex = -1; }
- NameOrIndex(USHORT nWhich, long nIndex);
+ NameOrIndex(USHORT nWhich, INT32 nIndex);
NameOrIndex(USHORT nWhich,
const String& rName= String());
NameOrIndex(USHORT nWhich, SvStream& rIn);
@@ -76,8 +76,8 @@ public:
String GetName() const { return GetValue(); }
void SetName(const String& rName) { SetValue(rName); }
- long GetIndex() const { return nPalIndex; }
- void SetIndex(long nIndex) { nPalIndex = nIndex; }
+ INT32 GetIndex() const { return nPalIndex; }
+ void SetIndex(INT32 nIndex) { nPalIndex = nIndex; }
BOOL IsIndex() const { return (nPalIndex >= 0); }
/** this static checks if the given NameOrIndex item has a unique name for its value.
diff --git a/svx/inc/svx/xlnclit.hxx b/svx/inc/svx/xlnclit.hxx
index b935781e81..be073fffd2 100644
--- a/svx/inc/svx/xlnclit.hxx
+++ b/svx/inc/svx/xlnclit.hxx
@@ -42,7 +42,7 @@ class SVX_DLLPUBLIC XLineColorItem : public XColorItem
public:
TYPEINFO();
XLineColorItem() {}
- XLineColorItem(long nIndex, const Color& rTheColor);
+ XLineColorItem(INT32 nIndex, const Color& rTheColor);
XLineColorItem(const String& rName, const Color& rTheColor);
XLineColorItem(SvStream& rIn);
diff --git a/svx/inc/svx/xlndsit.hxx b/svx/inc/svx/xlndsit.hxx
index cabb050085..a39e078b53 100644
--- a/svx/inc/svx/xlndsit.hxx
+++ b/svx/inc/svx/xlndsit.hxx
@@ -50,7 +50,7 @@ class SVX_DLLPUBLIC XLineDashItem : public NameOrIndex
public:
TYPEINFO();
XLineDashItem() : NameOrIndex(XATTR_LINEDASH, -1) {}
- XLineDashItem(long nIndex, const XDash& rTheDash);
+ XLineDashItem(INT32 nIndex, const XDash& rTheDash);
XLineDashItem(const String& rName, const XDash& rTheDash);
XLineDashItem(SfxItemPool* pPool, const XDash& rTheDash);
XLineDashItem(SfxItemPool* pPool );
diff --git a/svx/inc/svx/xlnedit.hxx b/svx/inc/svx/xlnedit.hxx
index 5d9b265071..a0ec1abfb7 100644
--- a/svx/inc/svx/xlnedit.hxx
+++ b/svx/inc/svx/xlnedit.hxx
@@ -46,7 +46,7 @@ class SVX_DLLPUBLIC XLineEndItem : public NameOrIndex
public:
TYPEINFO();
- XLineEndItem(long nIndex = -1);
+ XLineEndItem(INT32 nIndex = -1);
XLineEndItem(const String& rName, const basegfx::B2DPolyPolygon& rPolyPolygon);
XLineEndItem(SfxItemPool* pPool, const basegfx::B2DPolyPolygon& rPolyPolygon);
XLineEndItem(SfxItemPool* pPool );
diff --git a/svx/inc/svx/xlnstit.hxx b/svx/inc/svx/xlnstit.hxx
index 30686871d8..24475fc0ef 100644
--- a/svx/inc/svx/xlnstit.hxx
+++ b/svx/inc/svx/xlnstit.hxx
@@ -46,7 +46,7 @@ class SVX_DLLPUBLIC XLineStartItem : public NameOrIndex
public:
TYPEINFO();
- XLineStartItem(long nIndex = -1);
+ XLineStartItem(INT32 nIndex = -1);
XLineStartItem(const String& rName, const basegfx::B2DPolyPolygon& rPolyPolygon);
XLineStartItem(SfxItemPool* pPool, const basegfx::B2DPolyPolygon& rPolyPolygon);
XLineStartItem(SfxItemPool* pPool );
diff --git a/svx/inc/svx/xsflclit.hxx b/svx/inc/svx/xsflclit.hxx
index b54391391a..be552105b5 100644
--- a/svx/inc/svx/xsflclit.hxx
+++ b/svx/inc/svx/xsflclit.hxx
@@ -36,24 +36,24 @@
//------------------------------
// class XSecondaryFillColorItem
//------------------------------
-class XSecondaryFillColorItem : public XColorItem
+class SVX_DLLPUBLIC XSecondaryFillColorItem : public XColorItem
{
public:
TYPEINFO();
- XSecondaryFillColorItem() {}
- XSecondaryFillColorItem(long nIndex, const Color& rTheColor);
+ SVX_DLLPRIVATE XSecondaryFillColorItem() {}
+ SVX_DLLPRIVATE XSecondaryFillColorItem(INT32 nIndex, const Color& rTheColor);
XSecondaryFillColorItem(const String& rName, const Color& rTheColor);
- XSecondaryFillColorItem(SvStream& rIn);
+ SVX_DLLPRIVATE XSecondaryFillColorItem(SvStream& rIn);
- virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
- virtual SfxPoolItem* Create(SvStream& rIn, USHORT nVer) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Create(SvStream& rIn, USHORT nVer) const;
- virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SVX_DLLPRIVATE virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
SfxMapUnit eCoreMetric,
SfxMapUnit ePresMetric,
String &rText, const IntlWrapper * = 0 ) const;
- virtual USHORT GetVersion( USHORT nFileFormatVersion ) const;
+ SVX_DLLPRIVATE virtual USHORT GetVersion( USHORT nFileFormatVersion ) const;
};
diff --git a/svx/inc/unoapi.hxx b/svx/inc/unoapi.hxx
index f8c1352a1a..6d0720e0e0 100644
--- a/svx/inc/unoapi.hxx
+++ b/svx/inc/unoapi.hxx
@@ -97,12 +97,12 @@ SVX_DLLPUBLIC sal_Bool SvxFieldUnitToMeasureUnit( const short nVcl, short& eApi
/** if the given name is a predefined name for the current language it is replaced by
the corresponding api name.
*/
-void SvxUnogetApiNameForItem( const sal_Int16 nWhich, const String& rInternalName, rtl::OUString& rApiName ) throw();
+SVX_DLLPUBLIC void SvxUnogetApiNameForItem( const sal_Int16 nWhich, const String& rInternalName, rtl::OUString& rApiName ) throw();
/** if the given name is a predefined api name it is replaced by the predefined name
for the current language.
*/
-void SvxUnogetInternalNameForItem( const sal_Int16 nWhich, const rtl::OUString& rApiName, String& rInternalName ) throw();
+SVX_DLLPUBLIC void SvxUnogetInternalNameForItem( const sal_Int16 nWhich, const rtl::OUString& rApiName, String& rInternalName ) throw();
/** returns the which id for the given property name. This only works for
properties of shapes (map SVXMAP_SHAPE is used for searching)
@@ -115,10 +115,10 @@ void SvxUnogetInternalNameForItem( const sal_Int16 nWhich, const rtl::OUString&
//SVX_DLLPUBLIC sal_Int16 SvxUnoGetWhichIdForNamedProperty( const ::rtl::OUString & rPropName );
/** converts the given any with a metric to 100th/mm if needed */
-void SvxUnoConvertToMM( const SfxMapUnit eSourceMapUnit, com::sun::star::uno::Any & rMetric ) throw();
+SVX_DLLPUBLIC void SvxUnoConvertToMM( const SfxMapUnit eSourceMapUnit, com::sun::star::uno::Any & rMetric ) throw();
/** converts the given any with a metric from 100th/mm to the given metric if needed */
-void SvxUnoConvertFromMM( const SfxMapUnit eDestinationMapUnit, com::sun::star::uno::Any & rMetric ) throw();
+SVX_DLLPUBLIC void SvxUnoConvertFromMM( const SfxMapUnit eDestinationMapUnit, com::sun::star::uno::Any & rMetric ) throw();
#endif // _SVX_UNOAPI_HXX_
diff --git a/svx/inc/unoedhlp.hxx b/svx/inc/unoedhlp.hxx
index 7482f93dc6..8e63b8a8b5 100644
--- a/svx/inc/unoedhlp.hxx
+++ b/svx/inc/unoedhlp.hxx
@@ -49,7 +49,7 @@ class EditEngine;
case denotes the destination position, the two parameters the
start and the end of the moved paragraph range.
*/
-class SvxEditSourceHint : public TextHint
+class SVX_DLLPUBLIC SvxEditSourceHint : public TextHint
{
private:
ULONG mnStart;
diff --git a/svx/inc/unolingu.hxx b/svx/inc/unolingu.hxx
index 2427e44148..267cd80f44 100644
--- a/svx/inc/unolingu.hxx
+++ b/svx/inc/unolingu.hxx
@@ -67,7 +67,7 @@ class SvxLinguConfigUpdate
public:
- static void UpdateAll( sal_Bool bForceCheck = sal_False );
+ SVX_DLLPUBLIC static void UpdateAll( sal_Bool bForceCheck = sal_False );
static BOOL IsNeedUpdateAll( sal_Bool bForceCheck = sal_False );
};
diff --git a/svx/inc/xexch.hxx b/svx/inc/xexch.hxx
index f4ca2d4008..2e0c291677 100644
--- a/svx/inc/xexch.hxx
+++ b/svx/inc/xexch.hxx
@@ -60,7 +60,7 @@ public:
// Zuweisungsoperator
XFillExchangeData& operator=( const XFillExchangeData& rXFillExchangeData );
- friend SvStream& operator<<( SvStream& rOStm, const XFillExchangeData& rXFillExchangeData );
+ SVX_DLLPUBLIC friend SvStream& operator<<( SvStream& rOStm, const XFillExchangeData& rXFillExchangeData );
SVX_DLLPUBLIC friend SvStream& operator>>( SvStream& rIStm, XFillExchangeData& rXFillExchangeData );
static ULONG RegisterClipboardFormatName();
diff --git a/svx/inc/xmlgrhlp.hxx b/svx/inc/xmlgrhlp.hxx
index 96a381b22e..71d52a42c3 100644
--- a/svx/inc/xmlgrhlp.hxx
+++ b/svx/inc/xmlgrhlp.hxx
@@ -95,7 +95,7 @@ private:
SVX_DLLPRIVATE sal_Bool ImplWriteGraphic( const ::rtl::OUString& rPictureStorageName,
const ::rtl::OUString& rPictureStreamName,
const ::rtl::OUString& rGraphicId );
- SVX_DLLPRIVATE void ImplInsertGraphicURL( const ::rtl::OUString& rURLStr, sal_uInt32 nInsertPos );
+ SVX_DLLPRIVATE void ImplInsertGraphicURL( const ::rtl::OUString& rURLStr, sal_uInt32 nInsertPos, rtl::OUString& rRequestedFileName );
protected:
SvXMLGraphicHelper();
@@ -142,9 +142,9 @@ namespace svx
uses eCreateMode == GRAPHICHELPER_MODE_READ, bDirect == TRUE in
SvXMLGraphicHelper
*/
-::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL SvXMLGraphicImportHelper_createInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr) throw( ::com::sun::star::uno::Exception );
-::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL SvXMLGraphicImportHelper_getSupportedServiceNames() throw();
-::rtl::OUString SAL_CALL SvXMLGraphicImportHelper_getImplementationName() throw();
+SVX_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL SvXMLGraphicImportHelper_createInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr) throw( ::com::sun::star::uno::Exception );
+SVX_DLLPUBLIC ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL SvXMLGraphicImportHelper_getSupportedServiceNames() throw();
+SVX_DLLPUBLIC ::rtl::OUString SAL_CALL SvXMLGraphicImportHelper_getImplementationName() throw();
/** Create this with createInstanceWithArguments. service name
"com.sun.star.comp.Svx.GraphicExportHelper", one argument which is the
@@ -158,9 +158,9 @@ namespace svx
uses eCreateMode == GRAPHICHELPER_MODE_WRITE, bDirect == TRUE in
SvXMLGraphicHelper
*/
-::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL SvXMLGraphicExportHelper_createInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr) throw( ::com::sun::star::uno::Exception );
-::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL SvXMLGraphicExportHelper_getSupportedServiceNames() throw();
-::rtl::OUString SAL_CALL SvXMLGraphicExportHelper_getImplementationName() throw();
+SVX_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL SvXMLGraphicExportHelper_createInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr) throw( ::com::sun::star::uno::Exception );
+SVX_DLLPUBLIC ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL SvXMLGraphicExportHelper_getSupportedServiceNames() throw();
+SVX_DLLPUBLIC ::rtl::OUString SAL_CALL SvXMLGraphicExportHelper_getImplementationName() throw();
}
#endif
diff --git a/svx/inc/xoutbmp.hxx b/svx/inc/xoutbmp.hxx
index 33c90ffc97..7c09fd0b99 100644
--- a/svx/inc/xoutbmp.hxx
+++ b/svx/inc/xoutbmp.hxx
@@ -95,6 +95,6 @@ public:
// - DitherBitmap -
// ----------------
-BOOL DitherBitmap( Bitmap& rBitmap );
+SVX_DLLPUBLIC BOOL DitherBitmap( Bitmap& rBitmap );
#endif // _XOUTBMP_HXX
diff --git a/svx/prj/d.lst b/svx/prj/d.lst
index 74236afdad..227dac4db6 100644
--- a/svx/prj/d.lst
+++ b/svx/prj/d.lst
@@ -10,7 +10,7 @@ mkdir: %_DEST%\xml%_EXT%\uiconfig\global\accelerator\es
..\%__SRC%\inc\svxslots.ilb %_DEST%\inc%_EXT%\svxslots.ilb
..\%__SRC%\inc\*.ilb* %_DEST%\inc%_EXT%\*.ilb*
..\%__SRC%\lib\lib*.* %_DEST%\lib%_EXT%\lib*.*
-..\%__SRC%\lib\isvx.lib %_DEST%\lib%_EXT%\isvx.lib
+..\%__SRC%\lib\isvx*.lib %_DEST%\lib%_EXT%\isvx*.lib
..\%__SRC%\bin\gengal* %_DEST%\bin%_EXT%\gengal*
..\%__SRC%\bin\gengalrc %_DEST%\bin%_EXT%\gengal.ini
..\%__SRC%\bin\cui*.dll %_DEST%\bin%_EXT%\cui*.dll
@@ -218,6 +218,7 @@ mkdir: %_DEST%\inc%_EXT%\svx
..\inc\svx\svdedtv.hxx %_DEST%\inc%_EXT%\svx\svdedtv.hxx
..\inc\svx\svdedxv.hxx %_DEST%\inc%_EXT%\svx\svdedxv.hxx
..\inc\svx\svdetc.hxx %_DEST%\inc%_EXT%\svx\svdetc.hxx
+..\inc\svx\sdrhittesthelper.hxx %_DEST%\inc%_EXT%\svx\sdrhittesthelper.hxx
..\inc\svx\svdglev.hxx %_DEST%\inc%_EXT%\svx\svdglev.hxx
..\inc\svx\svdglue.hxx %_DEST%\inc%_EXT%\svx\svdglue.hxx
..\inc\svx\svdhdl.hxx %_DEST%\inc%_EXT%\svx\svdhdl.hxx
@@ -254,7 +255,6 @@ mkdir: %_DEST%\inc%_EXT%\svx
..\inc\svx\svdpoev.hxx %_DEST%\inc%_EXT%\svx\svdpoev.hxx
..\inc\svx\svdpool.hxx %_DEST%\inc%_EXT%\svx\svdpool.hxx
..\inc\svx\svdsnpv.hxx %_DEST%\inc%_EXT%\svx\svdsnpv.hxx
-..\inc\svdtouch.hxx %_DEST%\inc%_EXT%\svx\svdtouch.hxx
..\inc\svx\svdtrans.hxx %_DEST%\inc%_EXT%\svx\svdtrans.hxx
..\inc\svx\svdundo.hxx %_DEST%\inc%_EXT%\svx\svdundo.hxx
..\inc\svx\svdoutl.hxx %_DEST%\inc%_EXT%\svx\svdoutl.hxx
@@ -593,11 +593,9 @@ mkdir: %_DEST%\inc%_EXT%\svx\sdr\contact
mkdir: %_DEST%\inc%_EXT%\svx\sdr\overlay
..\inc\svx\sdr\overlay\overlayanimatedbitmapex.hxx %_DEST%\inc%_EXT%\svx\sdr\overlay\overlayanimatedbitmapex.hxx
-..\inc\svx\sdr\overlay\overlaybitmap.hxx %_DEST%\inc%_EXT%\svx\sdr\overlay\overlaybitmap.hxx
..\inc\svx\sdr\overlay\overlaybitmapex.hxx %_DEST%\inc%_EXT%\svx\sdr\overlay\overlaybitmapex.hxx
..\inc\svx\sdr\overlay\overlayline.hxx %_DEST%\inc%_EXT%\svx\sdr\overlay\overlayline.hxx
..\inc\svx\sdr\overlay\overlayhelpline.hxx %_DEST%\inc%_EXT%\svx\sdr\overlay\overlayhelpline.hxx
-..\inc\svx\sdr\overlay\overlaylinestriped.hxx %_DEST%\inc%_EXT%\svx\sdr\overlay\overlaylinestriped.hxx
..\inc\svx\sdr\overlay\overlaymanager.hxx %_DEST%\inc%_EXT%\svx\sdr\overlay\overlaymanager.hxx
..\inc\svx\sdr\overlay\overlaymanagerbuffered.hxx %_DEST%\inc%_EXT%\svx\sdr\overlay\overlaymanagerbuffered.hxx
..\inc\svx\sdr\overlay\overlayobject.hxx %_DEST%\inc%_EXT%\svx\sdr\overlay\overlayobject.hxx
@@ -605,7 +603,9 @@ mkdir: %_DEST%\inc%_EXT%\svx\sdr\overlay
..\inc\svx\sdr\overlay\overlaytriangle.hxx %_DEST%\inc%_EXT%\svx\sdr\overlay\overlaytriangle.hxx
..\inc\svx\sdr\overlay\overlaypolypolygon.hxx %_DEST%\inc%_EXT%\svx\sdr\overlay\overlaypolypolygon.hxx
..\inc\svx\sdr\overlay\overlayobjectcell.hxx %_DEST%\inc%_EXT%\svx\sdr\overlay\overlayobjectcell.hxx
-..\inc\svx\sdr\overlay\overlaysdrobject.hxx %_DEST%\inc%_EXT%\svx\sdr\overlay\overlaysdrobject.hxx
+..\inc\svx\sdr\overlay\overlayprimitive2dsequenceobject.hxx %_DEST%\inc%_EXT%\svx\sdr\overlay\overlayprimitive2dsequenceobject.hxx
+..\inc\svx\sdr\overlay\overlayselection.hxx %_DEST%\inc%_EXT%\svx\sdr\overlay\overlayselection.hxx
+..\inc\svx\sdr\overlay\overlaytools.hxx %_DEST%\inc%_EXT%\svx\sdr\overlay\overlaytools.hxx
mkdir: %_DEST%\inc%_EXT%\svx\sdr\animation
..\inc\svx\sdr\animation\ainfographic.hxx %_DEST%\inc%_EXT%\svx\sdr\animation\ainfographic.hxx
diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi
index a69aae4cf9..3c819229ee 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -14911,3 +14911,54 @@ SfxVoidItem RecheckDocument SID_RECHECK_DOCUMENT
GroupId = GID_DOCUMENT;
]
+//--------------------------------------------------------------------------
+
+SfxVoidItem InsertColumnDialog SID_TABLE_INSERT_COL_DLG
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = TRUE,
+ HasCoreId = FALSE,
+ HasDialog = TRUE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ Asynchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_TABLE;
+]
+
+//--------------------------------------------------------------------------
+
+SfxVoidItem InsertRowDialog SID_TABLE_INSERT_ROW_DLG
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = TRUE,
+ HasCoreId = FALSE,
+ HasDialog = TRUE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ Asynchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_TABLE;
+]
diff --git a/svx/source/accessibility/AccessibleEditableTextPara.cxx b/svx/source/accessibility/AccessibleEditableTextPara.cxx
index 7f43f3d81a..55775b8fbb 100644
--- a/svx/source/accessibility/AccessibleEditableTextPara.cxx
+++ b/svx/source/accessibility/AccessibleEditableTextPara.cxx
@@ -806,7 +806,7 @@ namespace accessibility
// must provide XAccesibleText by hand, since it comes publicly inherited by XAccessibleEditableText
if ( rType == ::getCppuType((uno::Reference< XAccessibleText > *)0) )
{
- uno::Reference< XAccessibleText > aAccText = this;
+ uno::Reference< XAccessibleText > aAccText = static_cast< XAccessibleEditableText * >(this);
aRet <<= aAccText;
}
else if ( rType == ::getCppuType((uno::Reference< XAccessibleEditableText > *)0) )
@@ -912,65 +912,18 @@ namespace accessibility
{
DBG_CHKTHIS( AccessibleEditableTextPara, NULL );
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
-
- // append first 40 characters from text, or first line, if shorter
- // (writer takes first sentence here, but that's not supported
- // from EditEngine)
- // throws if defunc
- ::rtl::OUString aLine;
-
- if( getCharacterCount() )
- aLine = getTextAtIndex(0, AccessibleTextType::LINE).SegmentText;
-
- // Get the string from the resource for the specified id.
- String sStr = ::rtl::OUString( SVX_RESSTR (RID_SVXSTR_A11Y_PARAGRAPH_DESCRIPTION ) );
- String sParaIndex = ::rtl::OUString::valueOf( GetParagraphIndex() );
- sStr.SearchAndReplace( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "$(ARG)" )),
- sParaIndex );
-
- if( aLine.getLength() > MaxDescriptionLen )
- {
- ::rtl::OUString aCurrWord;
- sal_Int32 i;
-
- // search backward from MaxDescriptionLen for previous word start
- for( aCurrWord=getTextAtIndex(MaxDescriptionLen, AccessibleTextType::WORD).SegmentText,
- i=MaxDescriptionLen,
- aLine=::rtl::OUString();
- i>=0;
- --i )
- {
- if( getTextAtIndex(i, AccessibleTextType::WORD).SegmentText != aCurrWord )
- {
- if( i == 0 )
- // prevent completely empty string
- aLine = getTextAtIndex(0, AccessibleTextType::WORD).SegmentText;
- else
- aLine = getTextRange(0, i);
- }
- }
- }
+// ::vos::OGuard aGuard( Application::GetSolarMutex() );
- return ::rtl::OUString( sStr ) + aLine;
+ return ::rtl::OUString();
}
::rtl::OUString SAL_CALL AccessibleEditableTextPara::getAccessibleName() throw (uno::RuntimeException)
{
DBG_CHKTHIS( AccessibleEditableTextPara, NULL );
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
-
- // throws if defunc
- sal_Int32 nPara( GetParagraphIndex() );
-
- // Get the string from the resource for the specified id.
- String sStr = ::rtl::OUString( SVX_RESSTR (RID_SVXSTR_A11Y_PARAGRAPH_NAME) );
- String sParaIndex = ::rtl::OUString::valueOf( nPara );
- sStr.SearchAndReplace( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "$(ARG)" )),
- sParaIndex );
+// ::vos::OGuard aGuard( Application::GetSolarMutex() );
- return ::rtl::OUString( sStr );
+ return ::rtl::OUString();
}
uno::Reference< XAccessibleRelationSet > SAL_CALL AccessibleEditableTextPara::getAccessibleRelationSet() throw (uno::RuntimeException)
@@ -2113,6 +2066,99 @@ namespace accessibility
return aOutSequence;
}
+ // XAccessibleMultiLineText
+ sal_Int32 SAL_CALL AccessibleEditableTextPara::getLineNumberAtIndex( sal_Int32 nIndex ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
+ {
+ DBG_CHKTHIS( AccessibleEditableTextPara, NULL );
+
+ sal_Int32 nRes = -1;
+ sal_Int32 nPara = GetParagraphIndex();
+
+ SvxTextForwarder &rCacheTF = GetTextForwarder();
+ const bool bValidPara = 0 <= nPara && nPara < rCacheTF.GetParagraphCount();
+ DBG_ASSERT( bValidPara, "getLineNumberAtIndex: current paragraph index out of range" );
+ if (bValidPara)
+ {
+ // we explicitly allow for the index to point at the character right behind the text
+ if (0 <= nIndex && nIndex <= rCacheTF.GetTextLen( static_cast< USHORT >(nPara) ))
+ nRes = rCacheTF.GetLineNumberAtIndex( static_cast< USHORT >(nPara), static_cast< USHORT >(nIndex) );
+ else
+ throw lang::IndexOutOfBoundsException();
+ }
+ return nRes;
+ }
+
+ // XAccessibleMultiLineText
+ ::com::sun::star::accessibility::TextSegment SAL_CALL AccessibleEditableTextPara::getTextAtLineNumber( sal_Int32 nLineNo ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
+ {
+ DBG_CHKTHIS( AccessibleEditableTextPara, NULL );
+
+ ::com::sun::star::accessibility::TextSegment aResult;
+ sal_Int32 nPara = GetParagraphIndex();
+ SvxTextForwarder &rCacheTF = GetTextForwarder();
+ const bool bValidPara = 0 <= nPara && nPara < rCacheTF.GetParagraphCount();
+ DBG_ASSERT( bValidPara, "getTextAtLineNumber: current paragraph index out of range" );
+ if (bValidPara)
+ {
+ if (0 <= nLineNo && nLineNo < rCacheTF.GetLineCount( static_cast< USHORT >(nPara) ))
+ {
+ USHORT nStart = 0, nEnd = 0;
+ rCacheTF.GetLineBoundaries( nStart, nEnd, static_cast< USHORT >(nPara), static_cast< USHORT >(nLineNo) );
+ if (nStart != 0xFFFF && nEnd != 0xFFFF)
+ {
+ try
+ {
+ aResult.SegmentText = getTextRange( nStart, nEnd );
+ aResult.SegmentStart = nStart;
+ aResult.SegmentEnd = nEnd;
+ }
+ catch (lang::IndexOutOfBoundsException)
+ {
+ // this is not the exception that should be raised in this function ...
+ DBG_ASSERT( 0, "unexpected exception" );
+ }
+ }
+ }
+ else
+ throw lang::IndexOutOfBoundsException();
+ }
+ return aResult;
+ }
+
+ // XAccessibleMultiLineText
+ ::com::sun::star::accessibility::TextSegment SAL_CALL AccessibleEditableTextPara::getTextAtLineWithCaret( ) throw (uno::RuntimeException)
+ {
+ DBG_CHKTHIS( AccessibleEditableTextPara, NULL );
+
+ ::com::sun::star::accessibility::TextSegment aResult;
+ try
+ {
+ aResult = getTextAtLineNumber( getNumberOfLineWithCaret() );
+ }
+ catch (lang::IndexOutOfBoundsException &)
+ {
+ // this one needs to be catched since this interface does not allow for it.
+ }
+ return aResult;
+ }
+
+ // XAccessibleMultiLineText
+ sal_Int32 SAL_CALL AccessibleEditableTextPara::getNumberOfLineWithCaret( ) throw (uno::RuntimeException)
+ {
+ DBG_CHKTHIS( AccessibleEditableTextPara, NULL );
+
+ sal_Int32 nRes = -1;
+ try
+ {
+ nRes = getLineNumberAtIndex( getCaretPosition() );
+ }
+ catch (lang::IndexOutOfBoundsException &)
+ {
+ // this one needs to be catched since this interface does not allow for it.
+ }
+ return nRes;
+ }
+
// XServiceInfo
::rtl::OUString SAL_CALL AccessibleEditableTextPara::getImplementationName (void) throw (uno::RuntimeException)
diff --git a/svx/source/accessibility/AccessibleEditableTextPara.hxx b/svx/source/accessibility/AccessibleEditableTextPara.hxx
index c13bdf820b..f78cbd4ad4 100644
--- a/svx/source/accessibility/AccessibleEditableTextPara.hxx
+++ b/svx/source/accessibility/AccessibleEditableTextPara.hxx
@@ -34,12 +34,10 @@
#include <tools/gen.hxx>
#include <tools/string.hxx>
#include <cppuhelper/weakref.hxx>
-#include <cppuhelper/compbase7.hxx>
+#include <cppuhelper/compbase8.hxx>
#include <cppuhelper/typeprovider.hxx>
-
-#ifndef _CPPUHELPER_INTERFACECONTAINER_H_
#include <cppuhelper/interfacecontainer.hxx>
-#endif
+
#include <com/sun/star/uno/Reference.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/accessibility/XAccessible.hpp>
@@ -47,6 +45,8 @@
#include <com/sun/star/accessibility/XAccessibleComponent.hpp>
#include <com/sun/star/accessibility/XAccessibleEditableText.hpp>
#include <com/sun/star/accessibility/XAccessibleTextAttributes.hpp>
+#include <com/sun/star/accessibility/XAccessibleMultiLineText.hpp>
+
#include <comphelper/accessibletexthelper.hxx>
#include <comphelper/broadcasthelper.hxx>
#include "AccessibleParaManager.hxx"
@@ -55,12 +55,13 @@
namespace accessibility
{
- typedef ::cppu::WeakComponentImplHelper7< ::com::sun::star::accessibility::XAccessible,
+ typedef ::cppu::WeakComponentImplHelper8< ::com::sun::star::accessibility::XAccessible,
::com::sun::star::accessibility::XAccessibleContext,
::com::sun::star::accessibility::XAccessibleComponent,
::com::sun::star::accessibility::XAccessibleEditableText,
::com::sun::star::accessibility::XAccessibleEventBroadcaster,
::com::sun::star::accessibility::XAccessibleTextAttributes,
+ ::com::sun::star::accessibility::XAccessibleMultiLineText,
::com::sun::star::lang::XServiceInfo > AccessibleTextParaInterfaceBase;
/** This class implements the actual text paragraphs for the EditEngine/Outliner UAA
@@ -128,7 +129,7 @@ namespace accessibility
virtual sal_Int32 SAL_CALL getForeground( ) throw (::com::sun::star::uno::RuntimeException);
virtual sal_Int32 SAL_CALL getBackground( ) throw (::com::sun::star::uno::RuntimeException);
- // XAccessibleText (this comes implicitely inherited by XAccessibleEditableText)
+ // XAccessibleText (this comes implicitely inherited by XAccessibleEditableText AND by XAccessibleMultiLineText)
virtual sal_Int32 SAL_CALL getCaretPosition() throw (::com::sun::star::uno::RuntimeException);
virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
virtual sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
@@ -163,6 +164,12 @@ namespace accessibility
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getDefaultAttributes( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& RequestedAttributes ) throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getRunAttributes( ::sal_Int32 Index, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& RequestedAttributes ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ // XAccessibleMultiLineText
+ virtual ::sal_Int32 SAL_CALL getLineNumberAtIndex( ::sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::accessibility::TextSegment SAL_CALL getTextAtLineNumber( ::sal_Int32 nLineNo ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::accessibility::TextSegment SAL_CALL getTextAtLineWithCaret( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getNumberOfLineWithCaret( ) throw (::com::sun::star::uno::RuntimeException);
+
// XServiceInfo
virtual ::rtl::OUString SAL_CALL getImplementationName (void) throw (::com::sun::star::uno::RuntimeException);
virtual sal_Bool SAL_CALL supportsService (const ::rtl::OUString& sServiceName) throw (::com::sun::star::uno::RuntimeException);
diff --git a/svx/source/accessibility/AccessibleEmptyEditSource.cxx b/svx/source/accessibility/AccessibleEmptyEditSource.cxx
index e19d5040b9..49306c3c4b 100644
--- a/svx/source/accessibility/AccessibleEmptyEditSource.cxx
+++ b/svx/source/accessibility/AccessibleEmptyEditSource.cxx
@@ -161,6 +161,8 @@ namespace accessibility
sal_Bool GetAttributeRun( USHORT&, USHORT&, USHORT, USHORT ) const { return sal_False; }
USHORT GetLineCount( USHORT nPara ) const { return nPara == 0 ? 1 : 0; }
USHORT GetLineLen( USHORT, USHORT ) const { return 0; }
+ void GetLineBoundaries( /*out*/USHORT & rStart, /*out*/USHORT & rEnd, USHORT /*nParagraph*/, USHORT /*nLine*/ ) const { rStart = rEnd = 0; }
+ USHORT GetLineNumberAtIndex( USHORT /*nPara*/, USHORT /*nIndex*/ ) const { return 0; }
// the following two methods would, strictly speaking, require
// a switch to a real EditSource, too. Fortunately, the
diff --git a/svx/source/accessibility/AccessibleImageBullet.cxx b/svx/source/accessibility/AccessibleImageBullet.cxx
index ab37707dee..9212b9dd40 100644
--- a/svx/source/accessibility/AccessibleImageBullet.cxx
+++ b/svx/source/accessibility/AccessibleImageBullet.cxx
@@ -172,16 +172,8 @@ namespace accessibility
::vos::OGuard aGuard( Application::GetSolarMutex() );
- // throws if defunc
- sal_Int32 nPara( GetParagraphIndex() );
-
// Get the string from the resource for the specified id.
- String sStr = ::rtl::OUString( SVX_RESSTR (RID_SVXSTR_A11Y_IMAGEBULLET_DESCRIPTION) );
- String sParaIndex = ::rtl::OUString::valueOf( nPara );
- sStr.SearchAndReplace( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "$(ARG)" )),
- sParaIndex );
-
- return ::rtl::OUString( sStr );
+ return ::rtl::OUString( SVX_RESSTR (RID_SVXSTR_A11Y_IMAGEBULLET_DESCRIPTION) );
}
::rtl::OUString SAL_CALL AccessibleImageBullet::getAccessibleName() throw (uno::RuntimeException)
@@ -190,16 +182,8 @@ namespace accessibility
::vos::OGuard aGuard( Application::GetSolarMutex() );
- // throws if defunc
- sal_Int32 nPara( GetParagraphIndex() );
-
// Get the string from the resource for the specified id.
- String sStr = ::rtl::OUString( SVX_RESSTR (RID_SVXSTR_A11Y_IMAGEBULLET_NAME) );
- String sParaIndex = ::rtl::OUString::valueOf( nPara );
- sStr.SearchAndReplace( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "$(ARG)" )),
- sParaIndex );
-
- return ::rtl::OUString( sStr );
+ return ::rtl::OUString( SVX_RESSTR (RID_SVXSTR_A11Y_IMAGEBULLET_NAME) );
}
uno::Reference< XAccessibleRelationSet > SAL_CALL AccessibleImageBullet::getAccessibleRelationSet() throw (uno::RuntimeException)
diff --git a/svx/source/accessibility/AccessibleStaticTextBase.cxx b/svx/source/accessibility/AccessibleStaticTextBase.cxx
index 68ddf62319..c5681a4f0e 100644
--- a/svx/source/accessibility/AccessibleStaticTextBase.cxx
+++ b/svx/source/accessibility/AccessibleStaticTextBase.cxx
@@ -173,13 +173,17 @@ namespace accessibility
AccessibleEditableTextPara& GetParagraph( sal_Int32 nPara ) const;
sal_Int32 GetParagraphCount() const;
- EPosition Index2Internal( sal_Int32 nFlatIndex ) const
+ sal_Int32 GetParagraphIndex() const;
+ sal_Int32 GetLineCount( sal_Int32 nParagraph ) const;
+
+ EPosition Index2Internal( sal_Int32 nFlatIndex ) const
{
DBG_CHKTHIS( AccessibleStaticTextBase_Impl, NULL );
return ImpCalcInternal( nFlatIndex, false );
}
- EPosition Range2Internal( sal_Int32 nFlatIndex ) const
+
+ EPosition Range2Internal( sal_Int32 nFlatIndex ) const
{
DBG_CHKTHIS( AccessibleStaticTextBase_Impl, NULL );
@@ -327,6 +331,26 @@ namespace accessibility
return mpTextParagraph->GetTextForwarder().GetParagraphCount();
}
+ sal_Int32 AccessibleStaticTextBase_Impl::GetParagraphIndex() const
+ {
+ DBG_CHKTHIS( AccessibleStaticTextBase_Impl, NULL );
+
+ sal_Int32 nIndex = -1;
+ if( mpTextParagraph )
+ nIndex = mpTextParagraph->GetParagraphIndex();
+ return nIndex;
+ }
+
+ sal_Int32 AccessibleStaticTextBase_Impl::GetLineCount( sal_Int32 nParagraph ) const
+ {
+ DBG_CHKTHIS( AccessibleStaticTextBase_Impl, NULL );
+
+ sal_Int32 nIndex = 0;
+ if( mpTextParagraph )
+ nIndex = mpTextParagraph->GetTextForwarder().GetLineCount( static_cast< USHORT >(nParagraph) );
+ return nIndex;
+ }
+
sal_Int32 AccessibleStaticTextBase_Impl::Internal2Index( EPosition nEEIndex ) const
{
sal_Int32 aRes(0);
@@ -1001,10 +1025,25 @@ namespace accessibility
return ::comphelper::concatSequences( aRunAttrSeq, aDiffVec.getAsConstList() );
}
- Rectangle AccessibleStaticTextBase::GetParagraphBoundingBox() const
- {
- return mpImpl->GetParagraphBoundingBox();
- }
+ Rectangle AccessibleStaticTextBase::GetParagraphBoundingBox() const
+ {
+ return mpImpl->GetParagraphBoundingBox();
+ }
+
+ sal_Int32 AccessibleStaticTextBase::GetParagraphIndex() const
+ {
+ return mpImpl->GetParagraphIndex();
+ }
+
+ sal_Int32 AccessibleStaticTextBase::GetParagraphCount() const
+ {
+ return mpImpl->GetParagraphCount();
+ }
+
+ sal_Int32 AccessibleStaticTextBase::GetLineCount( sal_Int32 nParagraph ) const
+ {
+ return mpImpl->GetLineCount( nParagraph );
+ }
} // end of namespace accessibility
diff --git a/svx/source/accessibility/GraphCtlAccessibleContext.cxx b/svx/source/accessibility/GraphCtlAccessibleContext.cxx
index 4373c58146..26c855ba69 100644
--- a/svx/source/accessibility/GraphCtlAccessibleContext.cxx
+++ b/svx/source/accessibility/GraphCtlAccessibleContext.cxx
@@ -64,6 +64,8 @@
#include <svx/svdpage.hxx>
#include <svx/unomod.hxx>
#include <svx/dialmgr.hxx>
+#include <svx/svdetc.hxx>
+#include <svx/sdrhittesthelper.hxx>
//===== namespaces ===========================================================
@@ -225,7 +227,14 @@ Reference< XAccessible > SAL_CALL SvxGraphCtrlAccessibleContext::getAccessibleAt
{
Point aPnt( rPoint.X, rPoint.Y );
mpControl->PixelToLogic( aPnt );
- SdrObject * pObj = mpPage->CheckHit(aPnt, 1, NULL, false);
+
+ SdrObject* pObj = 0;
+
+ if(mpView && mpView->GetSdrPageView())
+ {
+ pObj = SdrObjListPrimitiveHit(*mpPage, aPnt, 1, *mpView->GetSdrPageView(), 0, false);
+ }
+
if( pObj )
xAccessible = getAccessible( pObj );
}
diff --git a/svx/source/accessibility/accessibility.src b/svx/source/accessibility/accessibility.src
index e38e9bd85c..82fe774f5b 100644
--- a/svx/source/accessibility/accessibility.src
+++ b/svx/source/accessibility/accessibility.src
@@ -196,19 +196,9 @@ String RID_SVXSTR_GRAPHCTRL_ACC_DESCRIPTION
Text [ en-US ] = "This is where you can edit the contour." ;
};
-String RID_SVXSTR_A11Y_PARAGRAPH_DESCRIPTION
-{
- Text [ en-US ] = "Paragraph: $(ARG) " ;
-};
-
-String RID_SVXSTR_A11Y_PARAGRAPH_NAME
-{
- Text [ en-US ] = "Paragraph $(ARG)" ;
-};
-
String RID_SVXSTR_A11Y_IMAGEBULLET_DESCRIPTION
{
- Text [ en-US ] = "Image bullet in paragraph: $(ARG)" ;
+ Text [ en-US ] = "Image bullet in paragraph" ;
};
String RID_SVXSTR_A11Y_IMAGEBULLET_NAME
diff --git a/svx/source/accessibility/makefile.mk b/svx/source/accessibility/makefile.mk
index f953adc1dd..8b1802bf1a 100755
--- a/svx/source/accessibility/makefile.mk
+++ b/svx/source/accessibility/makefile.mk
@@ -33,6 +33,7 @@ PRJ=..$/..
PRJNAME=svx
TARGET=accessibility
+LIBTARGET=NO
ENABLE_EXCEPTIONS=TRUE
# --- Settings -----------------------------------------------------
@@ -42,7 +43,12 @@ ENABLE_EXCEPTIONS=TRUE
# --- Files --------------------------------------------------------
-SLOFILES = \
+LIB1TARGET= $(SLB)$/$(TARGET)-core.lib
+LIB1OBJFILES= \
+ $(SLO)$/AccessibleStringWrap.obj
+
+LIB2TARGET= $(SLB)$/$(TARGET).lib
+LIB2OBJFILES= \
$(SLO)$/charmapacc.obj \
$(SLO)$/svxrectctaccessiblecontext.obj \
$(SLO)$/GraphCtlAccessibleContext.obj \
@@ -63,13 +69,14 @@ SLOFILES = \
$(SLO)$/AccessibleStaticTextBase.obj \
$(SLO)$/AccessibleParaManager.obj \
$(SLO)$/AccessibleEditableTextPara.obj \
- $(SLO)$/AccessibleStringWrap.obj \
$(SLO)$/AccessibleImageBullet.obj \
$(SLO)$/ShapeTypeHandler.obj \
$(SLO)$/SvxShapeTypes.obj \
$(SLO)$/AccessibleControlShape.obj \
$(SLO)$/DGColorNameLookUp.obj \
$(SLO)$/AccessibleFrameSelector.obj
+
+SLOFILES = $(LIB1OBJFILES) $(LIB2OBJFILES)
SRS2NAME = accessibility
SRC2FILES = accessibility.src
diff --git a/svx/source/cui/autocdlg.cxx b/svx/source/cui/autocdlg.cxx
index 5fef343dfa..4da7f0d8d8 100644
--- a/svx/source/cui/autocdlg.cxx
+++ b/svx/source/cui/autocdlg.cxx
@@ -2308,7 +2308,7 @@ OfaAutoCompleteTabPage::OfaAutoCompleteTabPage( Window* pParent,
aCBAppendSpace (this, SVX_RES(CB_APPEND_SPACE)),
aCBAsTip (this, SVX_RES(CB_AS_TIP)),
aCBCollect (this, SVX_RES(CB_COLLECT)),
- aCBKeepList (this, SVX_RES(CB_KEEP_LIST)),
+ aCBRemoveList (this, SVX_RES(CB_REMOVE_LIST)),
aFTExpandKey (this, SVX_RES(FT_EXPAND_KEY)),
aDCBExpandKey (this, SVX_RES(DCB_EXPAND_KEY)),
aFTMinWordlen (this, SVX_RES(FT_MIN_WORDLEN)),
@@ -2369,8 +2369,8 @@ BOOL OfaAutoCompleteTabPage::FillItemSet( SfxItemSet& )
bCheck = aCBCollect.IsChecked();
bModified |= pOpt->bAutoCmpltCollectWords != bCheck;
pOpt->bAutoCmpltCollectWords = bCheck;
- bCheck = aCBKeepList.IsChecked();
- bModified |= pOpt->bAutoCmpltKeepList != bCheck;
+ bCheck = !aCBRemoveList.IsChecked(); // inverted value!
+ bModified |= pOpt->bAutoCmpltKeepList != bCheck;
pOpt->bAutoCmpltKeepList = bCheck;
bCheck = aCBAppendSpace.IsChecked();
bModified |= pOpt->bAutoCmpltAppendBlanc != bCheck;
@@ -2416,7 +2416,7 @@ void OfaAutoCompleteTabPage::Reset( const SfxItemSet& )
aCBActiv.Check( 0 != pOpt->bAutoCompleteWords );
aCBCollect.Check( 0 != pOpt->bAutoCmpltCollectWords );
- aCBKeepList.Check( 0 != pOpt->bAutoCmpltKeepList);
+ aCBRemoveList.Check( !pOpt->bAutoCmpltKeepList ); //inverted value!
aCBAppendSpace.Check( 0 != pOpt->bAutoCmpltAppendBlanc );
aCBAsTip.Check( 0 != pOpt->bAutoCmpltShowAsTip );
@@ -2487,7 +2487,7 @@ IMPL_LINK( OfaAutoCompleteTabPage, CheckHdl, CheckBox*, pBox )
aDCBExpandKey.Enable( bEnable );
}
else if(&aCBCollect == pBox)
- aCBKeepList.Enable( bEnable );
+ aCBRemoveList.Enable( bEnable );
return 0;
}
diff --git a/svx/source/cui/autocdlg.hrc b/svx/source/cui/autocdlg.hrc
index 08de5d0134..65770dbae1 100644
--- a/svx/source/cui/autocdlg.hrc
+++ b/svx/source/cui/autocdlg.hrc
@@ -129,7 +129,7 @@
#define CB_ACTIV 121
#define CB_COLLECT 122
#define CB_APPEND_SPACE 123
-#define CB_KEEP_LIST 124
+#define CB_REMOVE_LIST 124
#define CB_AS_TIP 125
#define FT_MIN_WORDLEN 126
#define FT_MAX_ENTRIES 127
diff --git a/svx/source/cui/autocdlg.hxx b/svx/source/cui/autocdlg.hxx
index fb5533b2f0..f6e48d671d 100644
--- a/svx/source/cui/autocdlg.hxx
+++ b/svx/source/cui/autocdlg.hxx
@@ -406,7 +406,7 @@ class OfaAutoCompleteTabPage : public SfxTabPage
CheckBox aCBAsTip; //Show as tip
CheckBox aCBCollect;//Collect words
- CheckBox aCBKeepList;//...save the list for later use...
+ CheckBox aCBRemoveList;//...save the list for later use...
//--removed--CheckBox aCBEndless;//
FixedText aFTExpandKey;
diff --git a/svx/source/cui/autocdlg.src b/svx/source/cui/autocdlg.src
index 437708e72d..0d9bc123d4 100644
--- a/svx/source/cui/autocdlg.src
+++ b/svx/source/cui/autocdlg.src
@@ -656,12 +656,12 @@ TabPage RID_OFAPAGE_AUTOCOMPLETE_OPTIONS
Size = MAP_APPFONT( 116, 10 );
Text [ en-US ] = "C~ollect words";
};
- CheckBox CB_KEEP_LIST
+ CheckBox CB_REMOVE_LIST
{
Pos = MAP_APPFONT( 10, 59 );
Size = MAP_APPFONT( 110, 40 );
WordBreak = TRUE;
- Text [ en-US ] = "~When closing a document, save the list for later use in other documents.";
+ Text [ en-US ] = "~When closing a document, remove the words collected from it from the list";
};
FixedText FT_EXPAND_KEY
{
diff --git a/svx/source/cui/commonlingui.src b/svx/source/cui/commonlingui.src
index 59fbb6b81f..f3d3c05c1a 100644
--- a/svx/source/cui/commonlingui.src
+++ b/svx/source/cui/commonlingui.src
@@ -47,7 +47,7 @@ Window RID_SVX_WND_COMMON_LINGU
{
HelpId=HID_SPELLDLG_SETWORD;
Pos = MAP_APPFONT( 51, 9 );
- Size = MAP_APPFONT( 149, 10 );
+ Size = MAP_APPFONT( 164, 10 );
Border =FALSE;
TabStop = TRUE;
};
@@ -62,7 +62,7 @@ Window RID_SVX_WND_COMMON_LINGU
Edit ED_NEWWORD
{
Pos = MAP_APPFONT( 51, 24 );
- Size = MAP_APPFONT( 122, 12 );
+ Size = MAP_APPFONT( 137, 12 );
Border = TRUE;
};
@@ -75,21 +75,21 @@ Window RID_SVX_WND_COMMON_LINGU
PushButton BTN_IGNORE
{
- Pos = MAP_APPFONT( 209, 6 );
+ Pos = MAP_APPFONT( 224, 6 );
Size = MAP_APPFONT( 55, 14 );
Text [ en-US ] = "~Ignore" ;
};
PushButton BTN_IGNOREALL
{
- Pos = MAP_APPFONT( 209, 22 );
+ Pos = MAP_APPFONT( 224, 22 );
Size = MAP_APPFONT( 55, 14 );
Text [ en-US ] = "Always I~gnore" ;
};
PushButton BTN_CHANGE
{
- Pos = MAP_APPFONT( 209, 40 );
+ Pos = MAP_APPFONT( 224, 40 );
Size = MAP_APPFONT( 55, 14 );
Text [ en-US ] = "~Replace" ;
DefButton = TRUE ;
@@ -97,14 +97,14 @@ Window RID_SVX_WND_COMMON_LINGU
PushButton BTN_CHANGEALL
{
- Pos = MAP_APPFONT( 209, 56 );
+ Pos = MAP_APPFONT( 224, 56 );
Size = MAP_APPFONT( 55, 14 );
Text [ en-US ] = "Always R~eplace" ;
};
PushButton BTN_OPTIONS
{
- Pos = MAP_APPFONT( 209, 129 );
+ Pos = MAP_APPFONT( 224, 129 );
Size = MAP_APPFONT( 55, 14 );
Hide = TRUE ;
Text [ en-US ] = "Options..." ;
@@ -119,19 +119,19 @@ Window RID_SVX_WND_COMMON_LINGU
GroupBox GB_AUDIT
{
Pos = MAP_APPFONT( 1, 1 );
- Size = MAP_APPFONT( 268, 148 );
+ Size = MAP_APPFONT( 283, 148 );
Hide=TRUE;
};
HelpButton BTN_SPL_HELP
{
- Pos = MAP_APPFONT( 145, 153 );
+ Pos = MAP_APPFONT( 160, 153 );
Size = MAP_APPFONT( 55, 14 );
};
CancelButton BTN_SPL_CANCEL
{
- Pos = MAP_APPFONT ( 209 , 153 ) ;
+ Pos = MAP_APPFONT ( 224 , 153 ) ;
Size = MAP_APPFONT ( 55 , 14 ) ;
TabStop = TRUE ;
Text [ en-US ] = "~Close" ;
diff --git a/svx/source/cui/cuicharmap.cxx b/svx/source/cui/cuicharmap.cxx
index fa962beafc..a66c7b3c10 100644
--- a/svx/source/cui/cuicharmap.cxx
+++ b/svx/source/cui/cuicharmap.cxx
@@ -6,9 +6,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: cuicharmap.cxx,v $
- * $Revision: 1.10 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -405,6 +402,11 @@ IMPL_LINK( SvxCharMapData, FontSelectHdl, ListBox *, EMPTYARG )
USHORT nPos = aFontLB.GetSelectEntryPos(),
nFont = (USHORT)(ULONG)aFontLB.GetEntryData( nPos );
aFont = mpDialog->GetDevFont( nFont );
+ aFont.SetWeight( WEIGHT_DONTKNOW );
+ aFont.SetItalic( ITALIC_NONE );
+ aFont.SetWidthType( WIDTH_DONTKNOW );
+ aFont.SetPitch( PITCH_DONTKNOW );
+ aFont.SetFamily( FAMILY_DONTKNOW );
// notify children using this font
aShowSet.SetFont( aFont );
diff --git a/svx/source/cui/dlgfact.cxx b/svx/source/cui/dlgfact.cxx
index a894f52f6a..28f879e77b 100644
--- a/svx/source/cui/dlgfact.cxx
+++ b/svx/source/cui/dlgfact.cxx
@@ -112,6 +112,7 @@
#include "newtabledlg.hxx"
#include "macroass.hxx"
#include "acccfg.hxx"
+#include "insrc.hxx"
using namespace ::com::sun::star;
using namespace ::com::sun::star::frame;
@@ -2385,3 +2386,8 @@ VclAbstractDialog* AbstractDialogFactory_Impl::CreateOptionsDialog(
{
return new VclAbstractDialog_Impl( new OfaTreeOptionsDialog( pParent, rExtensionId ) );
}
+
+SvxAbstractInsRowColDlg* AbstractDialogFactory_Impl::CreateSvxInsRowColDlg( Window* pParent, bool bCol, ULONG nHelpId )
+{
+ return new SvxInsRowColDlg( pParent, bCol, nHelpId );
+}
diff --git a/svx/source/cui/dlgfact.hxx b/svx/source/cui/dlgfact.hxx
index ce47d30163..a6bd99c97d 100644
--- a/svx/source/cui/dlgfact.hxx
+++ b/svx/source/cui/dlgfact.hxx
@@ -810,6 +810,8 @@ public:
virtual VclAbstractDialog* CreateOptionsDialog(
Window* pParent, const rtl::OUString& rExtensionId, const rtl::OUString& rApplicationContext );
+
+ virtual SvxAbstractInsRowColDlg* CreateSvxInsRowColDlg( Window* pParent, bool bCol, ULONG nHelpId );
};
#endif
diff --git a/svx/source/cui/hangulhanjadlg.src b/svx/source/cui/hangulhanjadlg.src
index 603a28e798..0d0041b67e 100644
--- a/svx/source/cui/hangulhanjadlg.src
+++ b/svx/source/cui/hangulhanjadlg.src
@@ -37,7 +37,7 @@
ModalDialog RID_SVX_MDLG_HANGULHANJA
{
HelpId = HID_DIALOG_HANGULHANJA;
- Size = MAP_APPFONT( 287, 175 );
+ Size = MAP_APPFONT( 302, 175 );
OutputSize = TRUE;
Closeable = TRUE ;
Moveable = TRUE ;
@@ -47,7 +47,7 @@ ModalDialog RID_SVX_MDLG_HANGULHANJA
PushButton PB_FIND
{
- Pos = MAP_APPFONT( 192, 23 );
+ Pos = MAP_APPFONT( 207, 23 );
Size = MAP_APPFONT( 30, 14 );
Text [ en-US ] = "~Find";
@@ -56,7 +56,7 @@ ModalDialog RID_SVX_MDLG_HANGULHANJA
Control CTL_SUGGESTIONS
{
Pos = MAP_APPFONT( 51, 46 );
- Size = MAP_APPFONT( 171, 30 );
+ Size = MAP_APPFONT( 186, 30 );
TabStop = TRUE ;
};
@@ -71,7 +71,7 @@ ModalDialog RID_SVX_MDLG_HANGULHANJA
RadioButton RB_SIMPLE_CONVERSION
{
Pos = MAP_APPFONT( 51, 81 );
- Size = MAP_APPFONT( 55, 8 );
+ Size = MAP_APPFONT( 60, 8 );
Group = TRUE;
@@ -80,16 +80,16 @@ ModalDialog RID_SVX_MDLG_HANGULHANJA
RadioButton RB_HANJA_HANGUL_BRACKETED
{
- Pos = MAP_APPFONT( 109, 81 );
- Size = MAP_APPFONT( 55, 8 );
+ Pos = MAP_APPFONT( 114, 81 );
+ Size = MAP_APPFONT( 60, 8 );
Text [ en-US ] = "Hanja (Han~gul)";
};
RadioButton RB_HANGUL_HANJA_BRACKETED
{
- Pos = MAP_APPFONT( 167, 81 );
- Size = MAP_APPFONT( 55, 8 );
+ Pos = MAP_APPFONT( 177, 81 );
+ Size = MAP_APPFONT( 60, 8 );
Text [ en-US ] = "Hang~ul (Hanja)";
};
@@ -97,7 +97,7 @@ ModalDialog RID_SVX_MDLG_HANGULHANJA
RadioButton RB_HANGUL_HANJA_ABOVE
{
Pos = MAP_APPFONT( 51, 95 );
- Size = MAP_APPFONT( 55, 16 );
+ Size = MAP_APPFONT( 60, 16 );
// this is the _primary_ text
Text [ en-US ] = "Hangu~l";
@@ -105,8 +105,8 @@ ModalDialog RID_SVX_MDLG_HANGULHANJA
RadioButton RB_HANGUL_HANJA_BELOW
{
- Pos = MAP_APPFONT( 109, 95 );
- Size = MAP_APPFONT( 55, 16 );
+ Pos = MAP_APPFONT( 114, 95 );
+ Size = MAP_APPFONT( 60, 16 );
// this is the _primary_ text
Text [ en-US ] = "Hang~ul";
@@ -114,8 +114,8 @@ ModalDialog RID_SVX_MDLG_HANGULHANJA
RadioButton RB_HANJA_HANGUL_ABOVE
{
- Pos = MAP_APPFONT( 51, 114 );
- Size = MAP_APPFONT( 55, 16 );
+ Pos = MAP_APPFONT( 56, 114 );
+ Size = MAP_APPFONT( 60, 16 );
// this is the _primary_ text
Text [ en-US ] = "Han~ja";
@@ -123,8 +123,8 @@ ModalDialog RID_SVX_MDLG_HANGULHANJA
RadioButton RB_HANJA_HANGUL_BELOW
{
- Pos = MAP_APPFONT( 109, 114 );
- Size = MAP_APPFONT( 55, 16 );
+ Pos = MAP_APPFONT( 114, 114 );
+ Size = MAP_APPFONT( 60, 16 );
// this is the _primary_ text
Text [ en-US ] = "Ha~nja";
@@ -141,14 +141,14 @@ ModalDialog RID_SVX_MDLG_HANGULHANJA
CheckBox CB_HANGUL_ONLY
{
Pos = MAP_APPFONT( 51, 134 );
- Size = MAP_APPFONT( 55, 8 );
+ Size = MAP_APPFONT( 60, 8 );
Text [ en-US ] = "Hangul ~only";
};
CheckBox CB_HANJA_ONLY
{
- Pos = MAP_APPFONT( 109, 134 );
+ Pos = MAP_APPFONT( 114, 134 );
Size = MAP_APPFONT( 55, 8 );
Text [ en-US ] = "Hanja onl~y";
@@ -157,12 +157,12 @@ ModalDialog RID_SVX_MDLG_HANGULHANJA
// this element is only for determining where our radio button group ends (in both directions)
FixedText FT_RESIZE_ANCHOR
{
- Pos = MAP_APPFONT( 226, 133 );
+ Pos = MAP_APPFONT( 241, 133 );
};
CheckBox CB_REPLACE_BY_CHARACTER
{
- Pos = MAP_APPFONT( 226, 81 );
+ Pos = MAP_APPFONT( 241, 81 );
Size = MAP_APPFONT( 55, 24 );
WordBreak = TRUE;
diff --git a/svx/source/cui/insrc.cxx b/svx/source/cui/insrc.cxx
new file mode 100644
index 0000000000..e0a7bdc5f0
--- /dev/null
+++ b/svx/source/cui/insrc.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: insrc.cxx,v $
+ * $Revision: 1.10 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_svx.hxx"
+#ifdef SVX_DLLIMPLEMENTATION
+#undef SVX_DLLIMPLEMENTATION
+#endif
+
+#include <svx/dialmgr.hxx>
+#include <svx/svxdlg.hxx>
+#include <svx/dialogs.hrc>
+#include "insrc.hxx"
+#include "insrc.hrc"
+
+bool SvxInsRowColDlg::isInsertBefore() const
+{
+ return !aAfterBtn.IsChecked();
+}
+
+sal_uInt16 SvxInsRowColDlg::getInsertCount() const
+{
+ return static_cast< sal_uInt16 >( aCountEdit.GetValue() );
+}
+
+SvxInsRowColDlg::SvxInsRowColDlg(Window* pParent, bool bCol, ULONG nHelpId )
+ : ModalDialog( pParent, SVX_RES(DLG_INS_ROW_COL) ),
+ aCount( this, SVX_RES( FT_COUNT ) ),
+ aCountEdit( this, SVX_RES( ED_COUNT ) ),
+ aInsFL( this, SVX_RES( FL_INS ) ),
+ aBeforeBtn( this, SVX_RES( CB_POS_BEFORE ) ),
+ aAfterBtn( this, SVX_RES( CB_POS_AFTER ) ),
+ aPosFL( this, SVX_RES( FL_POS ) ),
+ aRow(SVX_RES(STR_ROW)),
+ aCol(SVX_RES(STR_COL)),
+ aOKBtn( this, SVX_RES( BT_OK ) ),
+ aCancelBtn( this, SVX_RES( BT_CANCEL ) ),
+ aHelpBtn( this, SVX_RES( BT_HELP ) ),
+ bColumn( bCol )
+{
+ FreeResource();
+ String aTmp( GetText() );
+ if( bColumn )
+ {
+ aTmp += aCol;
+ }
+ else
+ {
+ aTmp += aRow;
+ }
+ SetText( aTmp );
+ SetHelpId( nHelpId );
+}
+
+short SvxInsRowColDlg::Execute(void)
+{
+ return ModalDialog::Execute();
+}
+
+
+
diff --git a/svx/source/cui/insrc.hrc b/svx/source/cui/insrc.hrc
new file mode 100644
index 0000000000..133bcf70c3
--- /dev/null
+++ b/svx/source/cui/insrc.hrc
@@ -0,0 +1,43 @@
+/*************************************************************************
+ *
+ * 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: insrc.hrc,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.
+ *
+ ************************************************************************/
+#define FT_COUNT 1
+#define ED_COUNT 2
+#define FL_INS 3
+
+#define CB_POS_BEFORE 10
+#define CB_POS_AFTER 11
+#define FL_POS 12
+
+#define STR_ROW 20
+#define STR_COL 21
+
+#define BT_OK 100
+#define BT_CANCEL 101
+#define BT_HELP 102
diff --git a/svx/source/svdraw/svdtxhdl.hxx b/svx/source/cui/insrc.hxx
index 0a15886e83..ea6dd8569d 100644
--- a/svx/source/svdraw/svdtxhdl.hxx
+++ b/svx/source/cui/insrc.hxx
@@ -6,8 +6,8 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: svdtxhdl.hxx,v $
- * $Revision: 1.9 $
+ * $RCSfile: insrc.hxx,v $
+ * $Revision: 1.4 $
*
* This file is part of OpenOffice.org.
*
@@ -27,47 +27,46 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
+#ifndef _SVX_INSRC_HXX
+#define _SVX_INSRC_HXX
-#ifndef _SVDTXHDL_HXX
-#define _SVDTXHDL_HXX
+#include <svx/stddlg.hxx>
-#include <vcl/virdev.hxx>
-#include <tools/poly.hxx>
-#include <tools/link.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/field.hxx>
+#include <vcl/button.hxx>
+#include <vcl/group.hxx>
+#include <vcl/button.hxx>
-//************************************************************
-// Vorausdeklarationen
-//************************************************************
+#include <tools/string.hxx>
-class SdrOutliner;
-class DrawPortionInfo;
-class SdrTextObj;
-class SdrObjGroup;
-class SdrModel;
+class SvxInsRowColDlg : public SvxAbstractInsRowColDlg, public ModalDialog
+{
+ FixedText aCount;
+ NumericField aCountEdit;
+ FixedLine aInsFL;
-//************************************************************
-// ImpTextPortionHandler
-//************************************************************
+ RadioButton aBeforeBtn;
+ RadioButton aAfterBtn;
+ FixedLine aPosFL;
-class ImpTextPortionHandler
-{
- VirtualDevice aVDev;
- SdrOutliner& rOutliner;
- const SdrTextObj& rTextObj;
+ String aRow;
+ String aCol;
+
+ OKButton aOKBtn;
+ CancelButton aCancelBtn;
+ HelpButton aHelpBtn;
- // Variablen fuer ConvertToPathObj
- SdrObjGroup* pGroup;
- FASTBOOL bToPoly;
- Rectangle maTextRect;
+ bool bColumn;
public:
- ImpTextPortionHandler(SdrOutliner& rOutln, const SdrTextObj& rTxtObj);
- void ConvertToPathObj(SdrObjGroup& rGroup, FASTBOOL bToPoly);
+ SvxInsRowColDlg( Window* pParent, bool bCol, ULONG nHelpId );
- DECL_LINK(ConvertHdl,DrawPortionInfo*);
-};
+ virtual short Execute(void);
-////////////////////////////////////////////////////////////////////////////////////////////////////
+ virtual bool isInsertBefore() const;
+ virtual sal_uInt16 getInsertCount() const;
+};
-#endif //_SVDTXHDL_HXX
+#endif
diff --git a/svx/source/cui/insrc.src b/svx/source/cui/insrc.src
new file mode 100644
index 0000000000..58b6ec63a6
--- /dev/null
+++ b/svx/source/cui/insrc.src
@@ -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: insrc.src,v $
+ * $Revision: 1.32 $
+ *
+ * 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 <svx/dialogs.hrc>
+#include "insrc.hrc"
+
+ModalDialog DLG_INS_ROW_COL
+{
+ OutputSize = TRUE ;
+ SVLook = TRUE ;
+ Size = MAP_APPFONT ( 136 , 84 ) ;
+ Text [ en-US ] = "Insert" ;
+ Moveable = TRUE ;
+ OKButton BT_OK
+ {
+ Pos = MAP_APPFONT ( 80 , 6 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ DefButton = TRUE ;
+ };
+ CancelButton BT_CANCEL
+ {
+ Pos = MAP_APPFONT ( 80 , 23 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ };
+ HelpButton BT_HELP
+ {
+ Pos = MAP_APPFONT ( 80 , 43 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ };
+ RadioButton CB_POS_BEFORE
+ {
+ Pos = MAP_APPFONT ( 12 , 49 ) ;
+ Size = MAP_APPFONT ( 56 , 10 ) ;
+ Text [ en-US ] = "~Before" ;
+ TabStop = TRUE ;
+ };
+ RadioButton CB_POS_AFTER
+ {
+ Pos = MAP_APPFONT ( 12 , 62 ) ;
+ Size = MAP_APPFONT ( 56 , 10 ) ;
+ Text [ en-US ] = "A~fter" ;
+ TabStop = TRUE ;
+ Check = TRUE ;
+ };
+ NumericField ED_COUNT
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 44 , 14 ) ;
+ Size = MAP_APPFONT ( 24 , 12 ) ;
+ TabStop = TRUE ;
+ Left = TRUE ;
+ Repeat = TRUE ;
+ Spin = TRUE ;
+ Minimum = 1 ;
+ Maximum = 99 ;
+ Value = 1 ;
+ First = 1 ;
+ Last = 5 ;
+ };
+ FixedLine FL_INS
+ {
+ Pos = MAP_APPFONT ( 6 , 3 ) ;
+ Size = MAP_APPFONT ( 68 , 8 ) ;
+ Text [ en-US ] = "Insert" ;
+ };
+ FixedLine FL_POS
+ {
+ Pos = MAP_APPFONT ( 6 , 38 ) ;
+ Size = MAP_APPFONT ( 68 , 8 ) ;
+ Text [ en-US ] = "Position";
+ };
+ FixedText FT_COUNT
+ {
+ Pos = MAP_APPFONT ( 12 , 16 ) ;
+ Size = MAP_APPFONT ( 30 , 8 ) ;
+ Text [ en-US ] = "~Number" ;
+ Left = TRUE ;
+ };
+ String STR_ROW
+ {
+ Text [ en-US ] = " Rows" ;
+ };
+ String STR_COL
+ {
+ Text [ en-US ] = " Columns" ;
+ };
+};
diff --git a/svx/source/cui/macropg.src b/svx/source/cui/macropg.src
index c8d3bcd760..7361c5c3b1 100644
--- a/svx/source/cui/macropg.src
+++ b/svx/source/cui/macropg.src
@@ -234,11 +234,11 @@ String RID_SVXSTR_EVENT_PAGECOUNTCHANGE
};
String RID_SVXSTR_EVENT_SUBCOMPONENT_OPENED
{
- Text = "Loaded a sub component" ;
+ Text [ en-US ] = "Loaded a sub component" ;
};
String RID_SVXSTR_EVENT_SUBCOMPONENT_CLOSED
{
- Text = "Closed a sub component" ;
+ Text [ en-US ] = "Closed a sub component" ;
};
String RID_SVXSTR_EVENT_APPROVEPARAMETER
{
diff --git a/svx/source/cui/makefile.mk b/svx/source/cui/makefile.mk
index 7db32bb15f..7a1db4a85f 100755
--- a/svx/source/cui/makefile.mk
+++ b/svx/source/cui/makefile.mk
@@ -100,7 +100,8 @@ SRC1FILES = \
textattr.src \
treeopt.src \
webconninfo.src \
- zoom.src
+ zoom.src \
+ insrc.src
SRS2NAME=cuidrawdlgs
SRC2FILES = \
@@ -221,7 +222,8 @@ SLOFILES+=\
$(SLO)$/macroass.obj \
$(SLO)$/cfg.obj \
$(SLO)$/cfgutil.obj \
- $(SLO)$/optchart.obj
+ $(SLO)$/optchart.obj \
+ $(SLO)$/insrc.obj
.IF "$(GUI)"=="WNT"
SLOFILES+=$(SLO)$/winpluginlib.obj
diff --git a/svx/source/cui/optgdlg.cxx b/svx/source/cui/optgdlg.cxx
index b4a642eeb5..f9155421b7 100644
--- a/svx/source/cui/optgdlg.cxx
+++ b/svx/source/cui/optgdlg.cxx
@@ -136,7 +136,6 @@ int OfaMiscTabPage::DeactivatePage( SfxItemSet* pSet_ )
return LEAVE_PAGE;
}
-# ifdef ENABLE_GTK
namespace
{
::rtl::OUString impl_SystemFileOpenServiceName()
@@ -146,13 +145,33 @@ namespace
if ( rDesktopEnvironment.equalsIgnoreAsciiCaseAscii( "gnome" ) )
{
+ #ifdef ENABLE_GTK
return ::rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.GtkFilePicker" );
+ #else
+ return rtl::OUString();
+ #endif
+ }
+ else if ( rDesktopEnvironment.equalsIgnoreAsciiCaseAscii( "kde4" ) )
+ {
+ #ifdef ENABLE_KDE4
+ return ::rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.KDE4FilePicker" );
+ #else
+ return rtl::OUString();
+ #endif
}
else if ( rDesktopEnvironment.equalsIgnoreAsciiCaseAscii( "kde" ) )
{
+ #ifdef ENABLE_KDE
return ::rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.KDEFilePicker" );
+ #else
+ return rtl::OUString();
+ #endif
}
+ #if defined WNT || (defined MACOSX && defined QUARTZ)
return ::rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.SystemFilePicker" );
+ #else
+ return rtl::OUString();
+ #endif
}
sal_Bool lcl_HasSystemFilePicker()
@@ -180,8 +199,6 @@ namespace
}
}
-#endif
-
// -----------------------------------------------------------------------
OfaMiscTabPage::OfaMiscTabPage(Window* pParent, const SfxItemSet& rSet ) :
@@ -210,20 +227,11 @@ OfaMiscTabPage::OfaMiscTabPage(Window* pParent, const SfxItemSet& rSet ) :
{
FreeResource();
- //system fileopen only available in Windows and with gtk vclplug based
- //picker and on MacOSX (aqua version)
-#if !defined( WNT ) && !defined( ENABLE_GTK ) && !(defined(MACOSX) && defined(QUARTZ))
- aFileDlgFL.Hide();
- aFileDlgCB.Hide();
-#else
-# ifdef ENABLE_GTK
if (!lcl_HasSystemFilePicker())
{
aFileDlgFL.Hide();
aFileDlgCB.Hide();
}
-# endif
-#endif
#if ! defined(QUARTZ)
aPrintDlgFL.Hide();
@@ -691,6 +699,12 @@ OfaViewTabPage::OfaViewTabPage(Window* pParent, const SfxItemSet& rSet ) :
aMousePosLB ( this, SVX_RES( LB_MOUSEPOS ) ),
aMouseMiddleFT ( this, SVX_RES( FT_MOUSEMIDDLE ) ),
aMouseMiddleLB ( this, SVX_RES( LB_MOUSEMIDDLE ) ),
+
+ // #i97672#
+ maSelectionFL(this, SVX_RES(FL_SELECTION)),
+ maSelectionCB(this, SVX_RES(CB_SELECTION)),
+ maSelectionMF(this, SVX_RES(MF_SELECTION)),
+
nSizeLB_InitialSelection(0),
nStyleLB_InitialSelection(0),
pAppearanceCfg(new SvtTabAppearanceCfg),
@@ -753,6 +767,9 @@ OfaViewTabPage::OfaViewTabPage(Window* pParent, const SfxItemSet& rSet ) :
#endif
+ // #i97672#
+ maSelectionCB.SetToggleHdl( LINK( this, OfaViewTabPage, OnSelectionToggled ) );
+
FreeResource();
if( ! Application::ValidateSystemFont() )
@@ -807,6 +824,15 @@ IMPL_LINK( OfaViewTabPage, OnAntialiasingToggled, void*, NOTINTERESTEDIN )
}
#endif
+// #i97672#
+IMPL_LINK( OfaViewTabPage, OnSelectionToggled, void*, NOTINTERESTEDIN )
+{
+ (void)NOTINTERESTEDIN;
+ const bool bSelectionEnabled(maSelectionCB.IsChecked());
+ maSelectionMF.Enable(bSelectionEnabled);
+ return 0;
+}
+
/*-----------------06.12.96 11.50-------------------
--------------------------------------------------*/
@@ -828,6 +854,7 @@ BOOL OfaViewTabPage::FillItemSet( SfxItemSet& )
BOOL bModified = FALSE;
BOOL bMenuOptModified = FALSE;
+ bool bRepaintWindows(false);
SvtMiscOptions aMiscOptions;
UINT16 nSizeLB_NewSelection = aIconSizeLB.GetSelectEntryPos();
@@ -953,16 +980,30 @@ BOOL OfaViewTabPage::FillItemSet( SfxItemSet& )
{
mpDrawinglayerOpt->SetAntiAliasing(aUseAntiAliase.IsChecked());
bModified = TRUE;
+ bRepaintWindows = true;
+ }
+ }
- // react on AA change; invalidate all windows to force
- // a repaint when changing from AA to non-AA or vice-versa
- Window* pAppWindow = Application::GetFirstTopLevelWindow();
+ // #i97672#
+ if(maSelectionCB.IsEnabled())
+ {
+ const bool bNewSelection(maSelectionCB.IsChecked());
+ const sal_uInt16 nNewTransparence((sal_uInt16)maSelectionMF.GetValue());
- while(pAppWindow)
- {
- pAppWindow->Invalidate();
- pAppWindow = Application::GetNextTopLevelWindow(pAppWindow);
- }
+ if(bNewSelection != (bool)mpDrawinglayerOpt->IsTransparentSelection())
+ {
+ mpDrawinglayerOpt->SetTransparentSelection(maSelectionCB.IsChecked());
+ bModified = TRUE;
+ bRepaintWindows = true;
+ }
+
+ // #i104150# even read the value when maSelectionMF is disabled; it may have been
+ // modified by enabling-modify-disabling by the user
+ if(nNewTransparence != mpDrawinglayerOpt->GetTransparentSelectionPercent())
+ {
+ mpDrawinglayerOpt->SetTransparentSelectionPercent(nNewTransparence);
+ bModified = TRUE;
+ bRepaintWindows = true;
}
}
@@ -993,6 +1034,17 @@ BOOL OfaViewTabPage::FillItemSet( SfxItemSet& )
pAppearanceCfg->SetApplicationDefaults ( GetpApp() );
}
+ if(bRepaintWindows)
+ {
+ Window* pAppWindow = Application::GetFirstTopLevelWindow();
+
+ while(pAppWindow)
+ {
+ pAppWindow->Invalidate();
+ pAppWindow = Application::GetNextTopLevelWindow(pAppWindow);
+ }
+ }
+
return bModified;
}
@@ -1082,6 +1134,27 @@ void OfaViewTabPage::Reset( const SfxItemSet& )
aUseAntiAliase.SaveValue();
}
+ {
+ // #i97672# Selection
+ // check if transparent selection is possible on this system
+ const bool bTransparentSelectionPossible(
+ !GetSettings().GetStyleSettings().GetHighContrastMode()
+ && supportsOperation(OutDevSupport_TransparentRect));
+
+ // enter values
+ if(bTransparentSelectionPossible)
+ {
+ maSelectionCB.Check(mpDrawinglayerOpt->IsTransparentSelection());
+ }
+ else
+ {
+ maSelectionCB.Enable(false);
+ }
+
+ maSelectionMF.SetValue(mpDrawinglayerOpt->GetTransparentSelectionPercent());
+ maSelectionMF.Enable(mpDrawinglayerOpt->IsTransparentSelection() && bTransparentSelectionPossible);
+ }
+
#if defined( UNX )
aFontAntiAliasing.SaveValue();
aAAPointLimit.SaveValue();
diff --git a/svx/source/cui/optgdlg.hrc b/svx/source/cui/optgdlg.hrc
index 79c0c24df0..4001d2056a 100644
--- a/svx/source/cui/optgdlg.hrc
+++ b/svx/source/cui/optgdlg.hrc
@@ -91,6 +91,10 @@
#define ROW_FT_MOUSEMIDDLE (ROW_LB_MOUSEPOS + RSC_CD_DROPDOWN_HEIGHT + ROWSPACE)
#define ROW_LB_MOUSEMIDDLE (ROW_FT_MOUSEMIDDLE + RSC_CD_FIXEDTEXT_HEIGHT + ROWSPACE)
+// #i97672#
+#define ROW_FL_SELECTION (ROW_LB_MOUSEMIDDLE + RSC_CD_DROPDOWN_HEIGHT + RSC_SP_FLGR_SPACE_X)
+#define ROW_CB_SELECTION (ROW_FL_SELECTION + RSC_CD_FIXEDLINE_HEIGHT + ROWSPACE)
+
// tabpage general -------------------------------------------------------
#define FL_HELP 10
@@ -150,6 +154,11 @@
#define CB_USE_HARDACCELL 68
#define CB_USE_ANTIALIASE 69
+// #i97672#
+#define FL_SELECTION 70
+#define CB_SELECTION 71
+#define MF_SELECTION 72
+
// tabpage languages -----------------------------------------------------
#define FL_UI_LANG 1
diff --git a/svx/source/cui/optgdlg.hxx b/svx/source/cui/optgdlg.hxx
index 5023f33644..52fe207310 100644
--- a/svx/source/cui/optgdlg.hxx
+++ b/svx/source/cui/optgdlg.hxx
@@ -129,6 +129,11 @@ private:
FixedText aMouseMiddleFT;
ListBox aMouseMiddleLB;
+ // #i97672#
+ FixedLine maSelectionFL;
+ CheckBox maSelectionCB;
+ MetricField maSelectionMF;
+
UINT16 nSizeLB_InitialSelection;
UINT16 nStyleLB_InitialSelection;
BOOL bSfxSymbolsAuto;
@@ -140,6 +145,9 @@ private:
#if defined( UNX )
DECL_LINK( OnAntialiasingToggled, void* );
#endif
+ // #i97672#
+ DECL_LINK( OnSelectionToggled, void* );
+
public:
OfaViewTabPage( Window* pParent, const SfxItemSet& rSet );
~OfaViewTabPage();
diff --git a/svx/source/cui/optgdlg.src b/svx/source/cui/optgdlg.src
index 7f3ad69680..a711be6bf0 100644
--- a/svx/source/cui/optgdlg.src
+++ b/svx/source/cui/optgdlg.src
@@ -404,6 +404,38 @@ TabPage OFA_TP_VIEW
};
};
+ // #i97672#
+ FixedLine FL_SELECTION
+ {
+ Pos = MAP_APPFONT ( 133 , ROW_FL_SELECTION ) ;
+ Size = MAP_APPFONT ( 120 , 8 ) ;
+ Text [ en-US ] = "Selection";
+ };
+
+ CheckBox CB_SELECTION
+ {
+ Pos = MAP_APPFONT ( 139, ROW_CB_SELECTION + (((12 - RSC_CD_CHECKBOX_HEIGHT) / 2) + 1)) ;
+ Size = MAP_APPFONT ( 118 - 34 , RSC_CD_CHECKBOX_HEIGHT ) ;
+ Text [ en-US ] = "Transparency" ;
+ };
+
+ MetricField MF_SELECTION
+ {
+ Pos = MAP_APPFONT ( 139 + (95 - 12), ROW_CB_SELECTION ) ;
+ Size = MAP_APPFONT ( 31 , 12 ) ;
+ Border = TRUE ;
+ TabStop = TRUE ;
+ Repeat = TRUE ;
+ Spin = TRUE ;
+ Minimum = 10 ;
+ Maximum = 90 ;
+ DecimalDigits = 0 ;
+ First = 10 ;
+ Last = 90 ;
+ SpinSize = 5 ;
+ Unit = FUNIT_CUSTOM ;
+ CustomUnitText [ en-US ] = "%" ;
+ };
};
// *******************************************************************
diff --git a/svx/source/cui/optpath.cxx b/svx/source/cui/optpath.cxx
index 54695490fa..ec589678b2 100644
--- a/svx/source/cui/optpath.cxx
+++ b/svx/source/cui/optpath.cxx
@@ -41,6 +41,7 @@
#include <tools/shl.hxx>
#include <vcl/msgbox.hxx>
#include <sfx2/filedlghelper.hxx>
+#include <sfx2/app.hxx>
#include <svtools/pickerhelper.hxx>
#include <svtools/aeitem.hxx>
#include <svtools/svtabbx.hxx>
@@ -52,6 +53,7 @@
#include <unotools/localfilehelper.hxx>
#include <svtools/pathoptions.hxx>
#include <svtools/moduleoptions.hxx>
+#include <svtools/viewoptions.hxx>
#define _SVX_OPTPATH_CXX
@@ -62,6 +64,7 @@
#include <svx/dialogs.hrc>
#include "helpid.hrc"
#include <comphelper/processfactory.hxx>
+#include <comphelper/configurationhelper.hxx>
#include <com/sun/star/uno/Exception.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
@@ -91,6 +94,7 @@ using namespace svx;
#define POSTFIX_WRITABLE String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "_writable" ) )
#define POSTFIX_READONLY String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "_readonly" ) )
#define VAR_ONE String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "%1" ) )
+#define IODLG_CONFIGNAME String(DEFINE_CONST_UNICODE("FilePicker_Save"))
// struct OptPath_Impl ---------------------------------------------------
@@ -536,6 +540,26 @@ void SvxPathTabPage::ChangeCurrentEntry( const String& _rFolder )
pPathImpl = (PathUserData_Impl*)pPathBox->GetEntry(nPos)->GetUserData();
pPathImpl->eState = SFX_ITEM_SET;
pPathImpl->sWritablePath = sNewPathStr;
+ if ( SvtPathOptions::PATH_WORK == pPathImpl->nRealId )
+ {
+ // Remove view options entry so the new work path
+ // will be used for the next open dialog.
+ SvtViewOptions aDlgOpt( E_DIALOG, IODLG_CONFIGNAME );
+ aDlgOpt.Delete();
+ // Reset also last used dir in the sfx application instance
+ SfxApplication *pSfxApp = SFX_APP();
+ pSfxApp->ResetLastDir();
+
+ // Set configuration flag to notify file picker that it's necessary
+ // to take over the path provided.
+ Reference < XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
+ ::comphelper::ConfigurationHelper::writeDirectKey(xFactory,
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Common/")),
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Path/Info")),
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("WorkPathChanged")),
+ ::com::sun::star::uno::makeAny(true),
+ ::comphelper::ConfigurationHelper::E_STANDARD);
+ }
}
}
diff --git a/svx/source/cui/page.cxx b/svx/source/cui/page.cxx
index 8e44ebc1fc..2ebbf8bcde 100644
--- a/svx/source/cui/page.cxx
+++ b/svx/source/cui/page.cxx
@@ -596,18 +596,24 @@ void SvxPageDescPage::Reset( const SfxItemSet& rSet )
aBspWin.SetSize( Size( ConvertLong_Impl( aPaperSize.Width(), eUnit ),
ConvertLong_Impl( aPaperSize.Height(), eUnit ) ) );
- // Werte in die Edits eintragen
- SetMetricValue( aPaperHeightEdit, aPaperSize.Height(), eUnit );
- SetMetricValue( aPaperWidthEdit, aPaperSize.Width(), eUnit );
- aPaperSizeBox.Clear();
+ aPaperSize = OutputDevice::LogicToLogic(aPaperSize, (MapUnit)eUnit, MAP_100TH_MM);
+ if ( bLandscape )
+ Swap( aPaperSize );
+
+ // Actual Paper Format
+ Paper ePaper = SvxPaperInfo::GetSvxPaper( aPaperSize, MAP_100TH_MM, TRUE );
- // Papierformate
- Size aTmpSize = aPaperSize;
+ if ( PAPER_USER != ePaper )
+ aPaperSize = SvxPaperInfo::GetPaperSize( ePaper, MAP_100TH_MM );
if ( bLandscape )
- Swap( aTmpSize );
- // aktuelles Format
- Paper ePaper = SvxPaperInfo::GetSvxPaper( aTmpSize, (MapUnit)eUnit, TRUE );
+ Swap( aPaperSize );
+
+ // Werte in die Edits eintragen
+ SetMetricValue( aPaperHeightEdit, aPaperSize.Height(), SFX_MAPUNIT_100TH_MM );
+ SetMetricValue( aPaperWidthEdit, aPaperSize.Width(), SFX_MAPUNIT_100TH_MM );
+ aPaperSizeBox.Clear();
+
USHORT nActPos = LISTBOX_ENTRY_NOTFOUND;
USHORT nAryId = RID_SVXSTRARY_PAPERSIZE_STD;
@@ -1044,19 +1050,19 @@ IMPL_LINK( SvxPageDescPage, PaperSizeSelect_Impl, ListBox *, pBox )
if ( ePaper != PAPER_USER )
{
- Size aSize( SvxPaperInfo::GetPaperSize( ePaper ) );
+ Size aSize( SvxPaperInfo::GetPaperSize( ePaper, MAP_100TH_MM ) );
if ( aLandscapeBtn.IsChecked() )
Swap( aSize );
- if ( aSize.Height() < aPaperHeightEdit.GetMin( FUNIT_TWIP ) )
+ if ( aSize.Height() < aPaperHeightEdit.GetMin( FUNIT_100TH_MM ) )
aPaperHeightEdit.SetMin(
- aPaperHeightEdit.Normalize( aSize.Height() ), FUNIT_TWIP );
- if ( aSize.Width() < aPaperWidthEdit.GetMin( FUNIT_TWIP ) )
+ aPaperHeightEdit.Normalize( aSize.Height() ), FUNIT_100TH_MM );
+ if ( aSize.Width() < aPaperWidthEdit.GetMin( FUNIT_100TH_MM ) )
aPaperWidthEdit.SetMin(
- aPaperWidthEdit.Normalize( aSize.Width() ), FUNIT_TWIP );
- SetMetricValue( aPaperHeightEdit, aSize.Height(), SFX_MAPUNIT_TWIP );
- SetMetricValue( aPaperWidthEdit, aSize.Width(), SFX_MAPUNIT_TWIP );
+ aPaperWidthEdit.Normalize( aSize.Width() ), FUNIT_100TH_MM );
+ SetMetricValue( aPaperHeightEdit, aSize.Height(), SFX_MAPUNIT_100TH_MM );
+ SetMetricValue( aPaperWidthEdit, aSize.Width(), SFX_MAPUNIT_100TH_MM );
// R"ander ggf. neu berechnen
CalcMargin_Impl();
@@ -1145,12 +1151,12 @@ IMPL_LINK( SvxPageDescPage, SwapOrientation_Impl, RadioButton *, pBtn )
{
bLandscape = aLandscapeBtn.IsChecked();
- const long lWidth = GetCoreValue( aPaperWidthEdit, SFX_MAPUNIT_TWIP );
- const long lHeight = GetCoreValue( aPaperHeightEdit, SFX_MAPUNIT_TWIP );
+ const long lWidth = GetCoreValue( aPaperWidthEdit, SFX_MAPUNIT_100TH_MM );
+ const long lHeight = GetCoreValue( aPaperHeightEdit, SFX_MAPUNIT_100TH_MM );
// swap with and height
- SetMetricValue( aPaperWidthEdit, lHeight, SFX_MAPUNIT_TWIP );
- SetMetricValue( aPaperHeightEdit, lWidth, SFX_MAPUNIT_TWIP );
+ SetMetricValue( aPaperWidthEdit, lHeight, SFX_MAPUNIT_100TH_MM );
+ SetMetricValue( aPaperHeightEdit, lWidth, SFX_MAPUNIT_100TH_MM );
// recalculate margins if necessary
CalcMargin_Impl();
diff --git a/svx/source/cui/page.h b/svx/source/cui/page.h
index dcbed63cc0..1df26b13b2 100644
--- a/svx/source/cui/page.h
+++ b/svx/source/cui/page.h
@@ -60,7 +60,7 @@
#define PAPERSIZE_MONARCH 25
#define PAPERSIZE_COM675 26
#define PAPERSIZE_COM9 27
-#define PAPERSIZE_COM10 29
+#define PAPERSIZE_COM10 28
#define PAPERSIZE_COM11 29
#define PAPERSIZE_COM12 30
#define PAPERSIZE_KAI16 31
@@ -68,7 +68,7 @@
#define PAPERSIZE_KAI32BIG 33
#define PAPERSIZE_B4_JIS 34
#define PAPERSIZE_B5_JIS 35
-#define PAPERSIZE_B6_JIS 38
+#define PAPERSIZE_B6_JIS 36
#endif
diff --git a/svx/source/cui/showcols.cxx b/svx/source/cui/showcols.cxx
index d226ecade4..af6f4a54ea 100644
--- a/svx/source/cui/showcols.cxx
+++ b/svx/source/cui/showcols.cxx
@@ -36,19 +36,17 @@
#endif
#include "showcols.hxx"
-#ifndef _SVX_FMRESIDS_HRC
#include "fmresids.hrc"
-#endif
#include <tools/shl.hxx>
#include <svx/dialmgr.hxx>
#include <vcl/msgbox.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <comphelper/extract.hxx>
#include <comphelper/types.hxx>
-#include "fmstatic.hxx" //CHINA001
-IMPLEMENT_CONSTASCII_USTRING(CUIFM_PROP_HIDDEN, "Hidden");
-IMPLEMENT_CONSTASCII_USTRING(CUIFM_PROP_LABEL,"Label");
+#define CUIFM_PROP_HIDDEN rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Hidden" ) )
+#define CUIFM_PROP_LABEL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Label" ) )
+
//==========================================================================
// FmShowColsDialog
//==========================================================================
diff --git a/svx/source/cui/svuidlg.src b/svx/source/cui/svuidlg.src
index 11a0fd9ac8..eeff7e33d0 100644
--- a/svx/source/cui/svuidlg.src
+++ b/svx/source/cui/svuidlg.src
@@ -156,37 +156,37 @@ ModalDialog MD_UPDATE_BASELINKS
};
CancelButton 1
{
- Pos = MAP_APPFONT ( 275 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
+ Pos = MAP_APPFONT ( 270 , 6 ) ;
+ Size = MAP_APPFONT ( 60 , 14 ) ;
Text [ en-US ] = "~Close" ;
};
HelpButton 1
{
- Pos = MAP_APPFONT ( 275 , 26 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
+ Pos = MAP_APPFONT ( 270 , 26 ) ;
+ Size = MAP_APPFONT ( 60 , 14 ) ;
};
PushButton PB_UPDATE_NOW
{
- Pos = MAP_APPFONT ( 275 , 43 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
+ Pos = MAP_APPFONT ( 270 , 43 ) ;
+ Size = MAP_APPFONT ( 60 , 14 ) ;
Text [ en-US ] = "~Update" ;
};
PushButton PB_OPEN_SOURCE
{
- Pos = MAP_APPFONT ( 275 , 60 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
+ Pos = MAP_APPFONT ( 270 , 60 ) ;
+ Size = MAP_APPFONT ( 60 , 14 ) ;
Text [ en-US ] = "~Open" ;
};
PushButton PB_CHANGE_SOURCE
{
- Pos = MAP_APPFONT ( 275 , 77 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
+ Pos = MAP_APPFONT ( 270 , 77 ) ;
+ Size = MAP_APPFONT ( 60 , 14 ) ;
Text [ en-US ] = "~Modify..." ;
};
PushButton PB_BREAK_LINK
{
- Pos = MAP_APPFONT ( 275 , 94 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
+ Pos = MAP_APPFONT ( 270 , 94 ) ;
+ Size = MAP_APPFONT ( 60 , 14 ) ;
Text [ en-US ] = "~Break Link" ;
};
FixedText FT_FILES2
diff --git a/svx/source/cui/treeopt.cxx b/svx/source/cui/treeopt.cxx
index fc2694c71d..d1be63e327 100644
--- a/svx/source/cui/treeopt.cxx
+++ b/svx/source/cui/treeopt.cxx
@@ -64,6 +64,8 @@
#include <com/sun/star/awt/XContainerWindowEventHandler.hpp>
#include <com/sun/star/awt/PosSize.hpp>
#include <com/sun/star/awt/XTopWindow.hpp>
+#include <com/sun/star/awt/XControl.hpp>
+#include <com/sun/star/awt/XTabController.hpp>
#include <vcl/help.hxx>
#ifndef _LINGUISTIC_MISC_HHX_
#include <linguistic/misc.hxx>
@@ -2745,10 +2747,23 @@ void ExtensionsTabPage::CreateDialogWithHandler()
if ( !bWithHandler || m_xEventHdl.is() )
{
+ SetStyle( GetStyle() | WB_DIALOGCONTROL | WB_CHILDDLGCTRL );
Reference< awt::XWindowPeer > xParent( VCLUnoHelper::GetInterface( this ), UNO_QUERY );
m_xPage = Reference < awt::XWindow >(
m_xWinProvider->createContainerWindow(
m_sPageURL, rtl::OUString(), xParent, m_xEventHdl ), UNO_QUERY );
+
+ Reference< awt::XControl > xPageControl( m_xPage, UNO_QUERY );
+ if ( xPageControl.is() )
+ {
+ Reference< awt::XWindowPeer > xWinPeer( xPageControl->getPeer() );
+ if ( xWinPeer.is() )
+ {
+ Window* pWindow = VCLUnoHelper::GetWindow( xWinPeer );
+ if ( pWindow )
+ pWindow->SetStyle( pWindow->GetStyle() | WB_DIALOGCONTROL | WB_CHILDDLGCTRL );
+ }
+ }
}
}
catch ( ::com::sun::star::lang::IllegalArgumentException& )
diff --git a/svx/source/cui/zoom.src b/svx/source/cui/zoom.src
index dca32260ab..197d1e2f29 100644
--- a/svx/source/cui/zoom.src
+++ b/svx/source/cui/zoom.src
@@ -37,48 +37,48 @@ ModalDialog RID_SVXDLG_ZOOM
HelpId = SID_ATTR_ZOOM ;
OutputSize = TRUE ;
SvLook = TRUE ;
- Size = MAP_APPFONT ( 218 , 112 ) ;
+ Size = MAP_APPFONT ( 242 , 112 ) ;
Moveable = TRUE ;
Text [ en-US ] = "Zoom & View Layout";
FixedLine FL_ZOOM
{
Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 100 , 8 ) ;
+ Size = MAP_APPFONT ( 112 , 8 ) ;
Text [ en-US ] = "Zoom factor";
};
RadioButton BTN_OPTIMAL
{
Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 91 , 10 ) ;
+ Size = MAP_APPFONT ( 105 , 10 ) ;
Text [ en-US ] = "~Optimal" ;
};
RadioButton BTN_WHOLE_PAGE
{
Pos = MAP_APPFONT ( 12 , 27 ) ;
- Size = MAP_APPFONT ( 91 , 10 ) ;
+ Size = MAP_APPFONT ( 105 , 10 ) ;
Text [ en-US ] = "~Fit width and height" ;
};
RadioButton BTN_PAGE_WIDTH
{
Pos = MAP_APPFONT ( 12 , 40 ) ;
- Size = MAP_APPFONT ( 91 , 10 ) ;
+ Size = MAP_APPFONT ( 105, 10 ) ;
Text [ en-US ] = "Fit ~width" ;
};
RadioButton BTN_100
{
Pos = MAP_APPFONT ( 12 , 53 ) ;
- Size = MAP_APPFONT ( 91 , 10 ) ;
+ Size = MAP_APPFONT ( 105, 10 ) ;
Text = "~100 %" ;
};
RadioButton BTN_USER
{
Pos = MAP_APPFONT ( 12 , 67 ) ;
- Size = MAP_APPFONT ( 59 , 10 ) ;
+ Size = MAP_APPFONT ( 72 , 10 ) ;
Text [ en-US ] = "~Variable" ;
};
MetricField ED_USER
{
- Pos = MAP_APPFONT ( 74 , 66 ) ;
+ Pos = MAP_APPFONT ( 86 , 66 ) ;
Size = MAP_APPFONT ( 32 , 12 ) ;
Border = TRUE ;
Group = TRUE ;
@@ -91,31 +91,31 @@ ModalDialog RID_SVXDLG_ZOOM
};
FixedLine FL_VIEWLAYOUT
{
- Pos = MAP_APPFONT ( 112 , 3 ) ;
- Size = MAP_APPFONT ( 100 , 8 ) ;
+ Pos = MAP_APPFONT ( 124 , 3 ) ;
+ Size = MAP_APPFONT ( 112 , 8 ) ;
Text [ en-US ] = "View layout";
};
RadioButton BTN_AUTOMATIC
{
- Pos = MAP_APPFONT ( 118 , 14 ) ;
- Size = MAP_APPFONT ( 91 , 10 ) ;
+ Pos = MAP_APPFONT ( 130 , 14 ) ;
+ Size = MAP_APPFONT ( 106 , 10 ) ;
Text [ en-US ] = "~Automatic" ;
};
RadioButton BTN_SINGLE
{
- Pos = MAP_APPFONT ( 118 , 27 ) ;
- Size = MAP_APPFONT ( 91 , 10 ) ;
+ Pos = MAP_APPFONT ( 130, 27 ) ;
+ Size = MAP_APPFONT ( 106, 10 ) ;
Text [ en-US ] = "~Single page" ;
};
RadioButton BTN_COLUMNS
{
- Pos = MAP_APPFONT ( 118 , 41 ) ;
- Size = MAP_APPFONT ( 64 , 10 ) ;
+ Pos = MAP_APPFONT ( 130, 41 ) ;
+ Size = MAP_APPFONT ( 75 , 10 ) ;
Text [ en-US ] = "~Columns" ;
};
MetricField ED_COLUMNS
{
- Pos = MAP_APPFONT ( 185 , 40 ) ;
+ Pos = MAP_APPFONT ( 209 , 40 ) ;
Size = MAP_APPFONT ( 24 , 12 ) ;
Border = TRUE ;
Group = TRUE ;
@@ -128,29 +128,29 @@ ModalDialog RID_SVXDLG_ZOOM
};
CheckBox CHK_BOOK
{
- Pos = MAP_APPFONT ( 124 , 55 ) ;
+ Pos = MAP_APPFONT ( 136 , 55 ) ;
Size = MAP_APPFONT ( 85 , 10 ) ;
Text [ en-US ] = "~Book mode" ;
};
FixedLine FL_BOTTOM
{
Pos = MAP_APPFONT ( 6 , 81 ) ;
- Size = MAP_APPFONT ( 206 , 8 ) ;
+ Size = MAP_APPFONT ( 230 , 8 ) ;
};
OKButton BTN_ZOOM_OK
{
- Pos = MAP_APPFONT ( 53 , 92 ) ;
+ Pos = MAP_APPFONT ( 77 , 92 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
DefButton = TRUE ;
};
CancelButton BTN_ZOOM_CANCEL
{
- Pos = MAP_APPFONT ( 106 , 92 ) ;
+ Pos = MAP_APPFONT ( 130 , 92 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
};
HelpButton BTN_ZOOM_HELP
{
- Pos = MAP_APPFONT ( 162 , 92 ) ;
+ Pos = MAP_APPFONT ( 186 , 92 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
};
};
diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx
index 61b4f60365..1f411f35bb 100644
--- a/svx/source/customshapes/EnhancedCustomShape2d.cxx
+++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx
@@ -751,30 +751,9 @@ EnhancedCustomShape2d::EnhancedCustomShape2d( SdrObject* pAObj ) :
}
break;
case mso_sptCurvedLeftArrow :
- {
- if ( ( seqAdjustmentValues.getLength() > 2 ) && ( seqAdjustmentValues[ 2 ].State == com::sun::star::beans::PropertyState_DIRECT_VALUE ) )
- {
- double fValue;
- seqAdjustmentValues[ 2 ].Value >>= fValue;
- fValue = 21600 - fValue;
- seqAdjustmentValues[ 2 ].Value <<= fValue;
- }
- nFlags |= DFF_CUSTOMSHAPE_FLIP_H;
- }
- break;
+ case mso_sptCurvedRightArrow :
case mso_sptCurvedUpArrow :
- {
- if ( ( seqAdjustmentValues.getLength() > 2 ) && ( seqAdjustmentValues[ 2 ].State == com::sun::star::beans::PropertyState_DIRECT_VALUE ) )
- {
- double fValue;
- seqAdjustmentValues[ 2 ].Value >>= fValue;
- fValue = 21600 - fValue;
- seqAdjustmentValues[ 2 ].Value <<= fValue;
- }
- nFlags |= DFF_CUSTOMSHAPE_FLIP_V | DFF_CUSTOMSHAPE_EXCH;
- }
- break;
- case mso_sptCurvedDownArrow : nFlags |= DFF_CUSTOMSHAPE_EXCH; break;
+ case mso_sptCurvedDownArrow : nColorData = 0x2d000000; break;
case mso_sptRibbon2 : nColorData = 0x30dd0000; break;
case mso_sptRibbon : nColorData = 0x30dd0000; break;
diff --git a/svx/source/customshapes/EnhancedCustomShape2d.hxx b/svx/source/customshapes/EnhancedCustomShape2d.hxx
index b1b4ba47d9..134118e3bf 100644
--- a/svx/source/customshapes/EnhancedCustomShape2d.hxx
+++ b/svx/source/customshapes/EnhancedCustomShape2d.hxx
@@ -32,28 +32,19 @@
#define _ENHANCEDCUSTOMSHAPE2D_HXX
#include <svx/msdffdef.hxx>
-#include <svx/msdffimp.hxx>
#include <svx/sdasitm.hxx>
#include <com/sun/star/uno/Sequence.h>
-#ifndef _com_sun_star_beans_PropertyValues_hpp__
#include <com/sun/star/beans/PropertyValues.hpp>
-#endif
#include <com/sun/star/awt/Point.hpp>
#include <svtools/itemset.hxx>
-#ifndef __com_sun_star_drawing_EnhancedCustomShapeParameterPair_hpp__
#include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp>
-#endif
#include <com/sun/star/drawing/EnhancedCustomShapeSegment.hpp>
#include <com/sun/star/drawing/EnhancedCustomShapeParameter.hpp>
-#ifndef __COM_SUN_STAR_DRAWING_ENHANCEDCUSTOMSHAPETEXTFRAME_HPP__
#include <com/sun/star/drawing/EnhancedCustomShapeTextFrame.hpp>
-#endif
#include <com/sun/star/drawing/EnhancedCustomShapeAdjustmentValue.hpp>
#include <EnhancedCustomShapeFunctionParser.hxx>
-#ifndef BOOST_SHARED_PTR_HPP_INCLUDED
#include <boost/shared_ptr.hpp>
-#endif
#include <vector>
#define DFF_CUSTOMSHAPE_FLIP_V 1
@@ -84,6 +75,7 @@ class SvxMSDffAdjustmentHandle;
// between X_RANGE and Y_RANGE
class SdrPathObj;
+
class EnhancedCustomShape2d : public SfxItemSet
{
SdrObject* pCustomShapeObj;
@@ -164,17 +156,17 @@ class EnhancedCustomShape2d : public SfxItemSet
sal_Bool IsFlipHorz() { return bFlipH; };
sal_Int32 GetRotateAngle() { return nRotateAngle; };
- SdrObject* CreateLineGeometry();
- SdrObject* CreateObject( sal_Bool bLineGeometryNeededOnly );
- void ApplyGluePoints( SdrObject* pObj );
- Rectangle GetTextRect() const;
+ SVX_DLLPUBLIC SdrObject* CreateLineGeometry();
+ SVX_DLLPUBLIC SdrObject* CreateObject( sal_Bool bLineGeometryNeededOnly );
+ SVX_DLLPUBLIC void ApplyGluePoints( SdrObject* pObj );
+ SVX_DLLPUBLIC Rectangle GetTextRect() const;
- sal_uInt32 GetHdlCount() const;
- sal_Bool GetHandlePosition( const sal_uInt32 nIndex, Point& rReturnPosition ) const;
- sal_Bool SetHandleControllerPosition( const sal_uInt32 nIndex, const com::sun::star::awt::Point& rPosition );
+ SVX_DLLPUBLIC sal_uInt32 GetHdlCount() const;
+ SVX_DLLPUBLIC sal_Bool GetHandlePosition( const sal_uInt32 nIndex, Point& rReturnPosition ) const;
+ SVX_DLLPUBLIC sal_Bool SetHandleControllerPosition( const sal_uInt32 nIndex, const com::sun::star::awt::Point& rPosition );
- EnhancedCustomShape2d( SdrObject* pSdrObjCustomShape );
- ~EnhancedCustomShape2d();
+ SVX_DLLPUBLIC EnhancedCustomShape2d( SdrObject* pSdrObjCustomShape );
+ SVX_DLLPUBLIC ~EnhancedCustomShape2d();
enum EnumFunc
{
@@ -198,15 +190,15 @@ class EnhancedCustomShape2d : public SfxItemSet
double GetEquationValueAsDouble( const sal_Int32 nIndex ) const;
sal_Int32 GetAdjustValueAsInteger( const sal_Int32 nIndex, const sal_Int32 nDefault = 0 ) const;
- static rtl::OUString GetEquation( const sal_uInt16 nFlags, sal_Int16 nPara1, sal_Int16 nPara2, sal_Int16 nPara3 );
+ SVX_DLLPUBLIC static rtl::OUString GetEquation( const sal_uInt16 nFlags, sal_Int16 nPara1, sal_Int16 nPara2, sal_Int16 nPara3 );
static void AppendEnhancedCustomShapeEquationParameter( rtl::OUString& rParameter, const sal_Int16 nPara, const sal_Bool bIsSpecialValue );
static void SetEnhancedCustomShapeEquationParameter( com::sun::star::drawing::EnhancedCustomShapeParameter&
rParameter, const sal_Int16 nPara, const sal_Bool bIsSpecialValue );
- static void SetEnhancedCustomShapeParameter( com::sun::star::drawing::EnhancedCustomShapeParameter&
+ SVX_DLLPUBLIC static void SetEnhancedCustomShapeParameter( com::sun::star::drawing::EnhancedCustomShapeParameter&
rParameter, const sal_Int32 nValue );
- static void SetEnhancedCustomShapeHandleParameter( com::sun::star::drawing::EnhancedCustomShapeParameter&
+ SVX_DLLPUBLIC static void SetEnhancedCustomShapeHandleParameter( com::sun::star::drawing::EnhancedCustomShapeParameter&
rParameter, const sal_Int32 nPara, const sal_Bool bIsSpecialValue, sal_Bool bHorz );
static sal_Bool ConvertSequenceToEnhancedCustomShape2dHandle( const com::sun::star::beans::PropertyValues& rHandleProperties,
EnhancedCustomShape2d::Handle& rDestinationHandle );
diff --git a/svx/source/customshapes/EnhancedCustomShape3d.hxx b/svx/source/customshapes/EnhancedCustomShape3d.hxx
index f7f4acd85a..45d98d9e4c 100644
--- a/svx/source/customshapes/EnhancedCustomShape3d.hxx
+++ b/svx/source/customshapes/EnhancedCustomShape3d.hxx
@@ -31,14 +31,15 @@
#ifndef _ENHANCEDCUSTOMSHAPE3D_HXX
#define _ENHANCEDCUSTOMSHAPE3D_HXX
-#include <svx/msdffimp.hxx>
#include <vector>
-//#include <poly3d.hxx>
-//#include <goodies/point3d.hxx>
#include <com/sun/star/drawing/ProjectionMode.hpp>
#include <basegfx/point/b3dpoint.hxx>
#include <basegfx/polygon/b3dpolygon.hxx>
+#include <tools/gen.hxx>
+
+class SdrObject;
+
class EnhancedCustomShape3d
{
class Transformation2D
diff --git a/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx b/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx
index c39ae74bdd..548c09b295 100644
--- a/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx
@@ -54,10 +54,6 @@ static const SvxMSDffTextRect TextRect[] =
{
{ { 0, 0 }, { 0, 0 } }
};
-static const sal_Int32 BoundRect[] =
-{
- 0, 0, 21600, 21600
-};
static const mso_CustomShape mso =
{
(SvxMSDffVertPair*)mso_sptVert, sizeof( mso_sptVert ) / sizeof( SvxMSDffVertPair ),
@@ -668,10 +664,6 @@ static const SvxMSDffVertPair mso_sptCanGluePoints[] =
{
{ 44, 6 MSO_I }, { 44, 0 }, { 0, 10800 }, { 44, 21600 }, { 88, 10800 }
};
-static const sal_Int32 mso_sptCanBoundRect[] =
-{
- 0, 0, 88, 21600
-};
static const SvxMSDffHandle mso_sptCanHandle[] =
{
{ MSDFF_HANDLE_FLAGS_RANGE,
@@ -1197,60 +1189,422 @@ static const mso_CustomShape msoBentUpArrow =
(SvxMSDffHandle*)mso_sptBentUpArrowHandle, sizeof( mso_sptBentUpArrowHandle ) / sizeof( SvxMSDffHandle )
};
-static const SvxMSDffVertPair mso_sptCurvedArrowVert[] = // adjustment1 : y 10800 - 21600, adjustment2 : y 16424 - 21600
-{ // adjustment3 : x 0 - 21600
- { 21600, 0 },
- { 9675, 0 }, { 0, 10 MSO_I }, { 0, 9 MSO_I }, // ccp
- { 0, 11 MSO_I },
- { 0, 14 MSO_I }, { 15 MSO_I, 1 MSO_I }, { 2 MSO_I, 1 MSO_I }, // ccp
- { 2 MSO_I, 21600 }, { 21600, 7 MSO_I }, { 2 MSO_I, 0 MSO_I }, { 2 MSO_I, 16 MSO_I },// pppp
- { 2 MSO_I, 16 MSO_I }, { 80, 8 MSO_I }, { 80, 8 MSO_I }, // ccp
- { 80, 8 MSO_I }, { 21600, 5 MSO_I }, { 21600, 0 } // ccp
-};
-static const sal_uInt16 mso_sptCurvedArrowSegm[] =
-{
- 0x4000, 0x2001, 0x0001, 0x2001, 0x0004, 0x2002, 0x6001, 0x8000
-};
-static const SvxMSDffCalculationData mso_sptCurvedArrowCalc[] =
-{
- { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, // 0
- { 0x2000, { DFF_Prop_adjust2Value, 0, 0 } }, // 1
- { 0x2000, { DFF_Prop_adjust3Value, 0, 0 } }, // 2
- { 0x8000, { 21600, 0, DFF_Prop_adjust2Value } }, // 3
- { 0xa000, { DFF_Prop_adjust2Value, 0, DFF_Prop_adjustValue } }, // 4
- { 0xa000, { 0x0404, 0, 0x0403 } }, // 5
- { 0x2001, { 0x0405, 1, 2 } }, // 6
- { 0xa000, { DFF_Prop_adjust2Value, 0, 0x0406 } }, // 7
- { 0x2001, { DFF_Prop_adjust2Value, 1, 2 } }, // 8
- { 0xa000, { 0x0408, 0, 0x0406 } }, // 9
- { 0x2001, { 0x0409, 10000, 22326 } }, // 10
- { 0x6000, { 0x0409, 0x0405, 0 } }, // 11
- { 0xa000, { DFF_Prop_adjust2Value, 0, 0x040b } }, // 12
- { 0x2001, { 0x040c, 10000, 23148 } }, // 13
- { 0x6000, { 0x040d, 0x040b, 0 } }, // 14
- { 0x2001, { DFF_Prop_adjust3Value, 10000, 25467 } }, // 15
- { 0x6000, { DFF_Prop_adjustValue, 0x0403, 0 } } // 16
-};
-static const sal_Int32 mso_sptCurvedArrowDefault[] =
-{
- 3, 13000, 19400, 14400
-};
-static const SvxMSDffTextRectangles mso_sptCurvedArrowTextRect[] = // todo
+
+static const SvxMSDffVertPair mso_sptCurvedDownVert[] =
{
- { { 0, 0 }, { 21600, 21600 } }
+ { 0, 0 }, { 3 MSO_I, 21 MSO_I }, { 0, 21600 }, { 4 MSO_I, 0 },
+ { 0, 0 }, { 3 MSO_I, 21 MSO_I }, { 4 MSO_I, 0 }, { 17 MSO_I, 24 MSO_I },
+ { 15 MSO_I, 0 }, { 1 MSO_I, 21 MSO_I }, { 17 MSO_I, 24 MSO_I }, { 15 MSO_I, 21600 },
+ { 15 MSO_I, 0 }, { 1 MSO_I, 21 MSO_I }, { 7 MSO_I, 0 }, { 13 MSO_I, 2 MSO_I },
+ { 14 MSO_I, 2 MSO_I }, { 8 MSO_I, 21600 }, { 12 MSO_I, 2 MSO_I },
+ { 0, 0 }, { 3 MSO_I, 21 MSO_I }, { 11 MSO_I, 2 MSO_I }, { 17 MSO_I, 24 MSO_I },
+ { 0, 0 }, { 3 MSO_I, 21 MSO_I }, { 17 MSO_I, 24 MSO_I }, { 4 MSO_I, 0 }
+};
+static const sal_uInt16 mso_sptCurvedDownSegm[] =
+{
+ 0xa508,
+ 0xa304,
+ 0x6000,
+ 0x8000,
+ 0xa604,
+ 0x0003,
+ 0xa308,
+ 0x6000,
+ 0x8000
+};
+static const SvxMSDffCalculationData mso_sptCurvedDownCalc[] =
+{
+ { 0x2000, { DFF_Prop_adjustValue, 0, 0 } },
+ { 0x2000, { DFF_Prop_adjust2Value, 0, 0 } },
+ { 0x2000, { DFF_Prop_adjust3Value, 0, 0 } },
+ { 0xa000, { DFF_Prop_adjustValue, 21600, DFF_Prop_adjust2Value } },
+ { 0x2001, { 0x403, 1, 2 } },
+ { 0x6000, { DFF_Prop_adjust2Value, DFF_Prop_adjust2Value, 21600 } },
+ { 0xe000, { 0x405, DFF_Prop_adjust2Value, DFF_Prop_adjustValue } },
+ { 0x2001, { 0x406, 1, 2 } },
+ { 0x4002, { 21600, DFF_Prop_adjustValue, 0 } },
+ { 0x8000, { 21600, 0, DFF_Prop_adjust3Value } },
+ { 0xa00f, { 0x409, 21600, 0x404 } },
+ { 0x6000, { 0x404, 0x40a, 0 } },
+ { 0x6000, { 0x40b, DFF_Prop_adjust2Value, 21600 } },
+ { 0x6000, { 0x407, 0x40a, 0 } },
+ { 0xa000, { 0x40c, 21600, DFF_Prop_adjustValue } },
+ { 0xa000, { 0x405, 0, DFF_Prop_adjustValue } },
+ { 0x2001, { 0x40f, 1, 2 } },
+ { 0x6002, { 0x404, 0x407, 0 } },
+ { 0x6000, { DFF_Prop_adjustValue, DFF_Prop_adjust2Value, 21600 } },
+ { 0x2001, { 0x412, 1, 2 } },
+ { 0xa000, { 0x411, 0, 0x413 } },
+ { 0x0001, { 21600, 2, 1 } },
+ { 0xa000, { 0x411, 0, 0x404 } },
+ { 0x600f, { 0x416, 0x404, 21600 } },
+ { 0x8000, { 21600, 0, 0x417 } },
+ { 0x2000, { 0x408, 128, 0 } },
+ { 0x2001, { 0x405, 1, 2 } },
+ { 0x2000, { 0x405, 0, 128 } },
+ { 0xe000, { DFF_Prop_adjustValue, 0x411, 0x40c } },
+ { 0x600f, { 0x414, 0x404, 21600 } },
+ { 0x8000, { 21600, 0, DFF_Prop_adjustValue } },
+ { 0x2001, { 0x41e, 1, 2 } },
+ { 0x0001, { 21600, 21600, 1 } },
+ { 0x6001, { 0x409, 0x409, 1 } },
+ { 0xa000, { 0x420, 0, 0x421 } },
+ { 0x200d, { 0x422, 0, 0 } },
+ { 0x2000, { 0x423, 21600, 0 } },
+ { 0x8001, { 21600, 21600, 0x424 } },
+ { 0x2000, { 0x425, 64, 0 } },
+ { 0x2001, { DFF_Prop_adjustValue, 1, 2 } },
+ { 0x600f, { 0x41f, 0x427, 21600 } },
+ { 0x8000, { 21600, 0, 0x428 } },
+ { 0x2000, { 0x429, 64, 0 } },
+ { 0x2001, { 0x404, 1, 2 } },
+ { 0xa000, { DFF_Prop_adjust2Value, 0, 0x42b } },
+ { 0x0001, { 21600, 2195, 16384 } },
+ { 0x0001, { 21600, 14189, 16384 } }
};
-static const mso_CustomShape msoCurvedArrow =
+static const sal_Int32 mso_sptCurvedDownDefault[] =
{
- (SvxMSDffVertPair*)mso_sptCurvedArrowVert, sizeof( mso_sptCurvedArrowVert ) / sizeof( SvxMSDffVertPair ),
- (sal_uInt16*)mso_sptCurvedArrowSegm, sizeof( mso_sptCurvedArrowSegm ) >> 1,
- (SvxMSDffCalculationData*)mso_sptCurvedArrowCalc, sizeof( mso_sptCurvedArrowCalc ) / sizeof( SvxMSDffCalculationData ),
- (sal_Int32*)mso_sptCurvedArrowDefault,
- (SvxMSDffTextRectangles*)mso_sptCurvedArrowTextRect, sizeof( mso_sptCurvedArrowTextRect ) / sizeof( SvxMSDffTextRectangles ),
+ 3, 12960, 19440, 14400
+};
+static const SvxMSDffTextRectangles mso_sptCurvedDownTextRect[] =
+{
+ { { 43 MSO_I, 45 MSO_I }, { 44 MSO_I, 46 MSO_I } }
+};
+static const SvxMSDffVertPair mso_sptCurvedDownGluePoints[] =
+{
+ { 17 MSO_I, 0 }, { 16 MSO_I, 21600 }, { 12 MSO_I, 2 MSO_I }, { 8 MSO_I, 21600 }, { 14 MSO_I, 2 MSO_I }
+};
+static const SvxMSDffHandle mso_sptCurvedDownHandles[] =
+{
+ { MSDFF_HANDLE_FLAGS_RANGE | MSDFF_HANDLE_FLAGS_RANGE_X_MIN_IS_SPECIAL | MSDFF_HANDLE_FLAGS_RANGE_X_MAX_IS_SPECIAL,
+ 0x100, 21600, 10800, 10800, 3 + 0x26, 3 + 0x1b, 0, 10800 },
+ { MSDFF_HANDLE_FLAGS_RANGE | MSDFF_HANDLE_FLAGS_RANGE_X_MIN_IS_SPECIAL,
+ 0x101, 21600, 10800, 10800, 3 + 0x19, 21600, 0, 10800 },
+ { MSDFF_HANDLE_FLAGS_RANGE | MSDFF_HANDLE_FLAGS_RANGE_Y_MIN_IS_SPECIAL,
+ 21600, 0x102, 10800, 10800, 3375, 21600, 3 + 0x2a, 21600 }
+};
+static const mso_CustomShape msoCurvedDownArrow =
+{
+ (SvxMSDffVertPair*)mso_sptCurvedDownVert, sizeof( mso_sptCurvedDownVert ) / sizeof( SvxMSDffVertPair ),
+ (sal_uInt16*)mso_sptCurvedDownSegm, sizeof( mso_sptCurvedDownSegm ) >> 1,
+ (SvxMSDffCalculationData*)mso_sptCurvedDownCalc, sizeof( mso_sptCurvedDownCalc ) / sizeof( SvxMSDffCalculationData ),
+ (sal_Int32*)mso_sptCurvedDownDefault,
+ (SvxMSDffTextRectangles*)mso_sptCurvedDownTextRect, sizeof( mso_sptCurvedDownTextRect ) / sizeof( SvxMSDffTextRectangles ),
21600, 21600,
0x80000000, 0x80000000,
- NULL, 0,
- NULL, 0 // handles
+ (SvxMSDffVertPair*)mso_sptCurvedDownGluePoints, sizeof( mso_sptCurvedDownGluePoints ) / sizeof( SvxMSDffVertPair ),
+ (SvxMSDffHandle*)mso_sptCurvedDownHandles, sizeof( mso_sptCurvedDownHandles ) / sizeof( SvxMSDffHandle )
+};
+
+static const SvxMSDffVertPair mso_sptCurvedUpVert[] =
+{
+ { 0, 22 MSO_I }, { 3 MSO_I, 21 MSO_I }, { 0, 0 }, { 4 MSO_I, 21 MSO_I },
+ { 14 MSO_I, 22 MSO_I }, { 1 MSO_I, 21 MSO_I }, { 7 MSO_I, 21 MSO_I }, { 12 MSO_I, 2 MSO_I },
+ { 13 MSO_I, 2 MSO_I }, { 8 MSO_I, 0 }, { 11 MSO_I, 2 MSO_I },
+ { 0, 22 MSO_I }, { 3 MSO_I, 21 MSO_I }, { 10 MSO_I, 2 MSO_I }, { 16 MSO_I, 24 MSO_I },
+ { 14 MSO_I, 22 MSO_I }, { 1 MSO_I, 21 MSO_I }, { 16 MSO_I, 24 MSO_I }, { 14 MSO_I, 0 },
+ { 14 MSO_I, 22 MSO_I }, { 1 MSO_I, 21 MSO_I }, { 7 MSO_I, 21 MSO_I }, { 16 MSO_I, 24 MSO_I }
+};
+static const sal_uInt16 mso_sptCurvedUpSegm[] =
+{
+ 0xa408,
+ 0x0003,
+ 0xa508,
+ 0x6000,
+ 0x8000,
+ 0xa604,
+ 0xaa00,
+ 0x8000
+};
+static const SvxMSDffCalculationData mso_sptCurvedUpCalc[] =
+{
+ { 0x2000, { DFF_Prop_adjustValue, 0, 0 } },
+ { 0x2000, { DFF_Prop_adjust2Value, 0, 0 } },
+ { 0x2000, { DFF_Prop_adjust3Value, 0, 0 } },
+ { 0xa000, { DFF_Prop_adjustValue, 21600, DFF_Prop_adjust2Value } },
+ { 0x2001, { 0x403, 1, 2 } },
+ { 0x6000, { DFF_Prop_adjust2Value, DFF_Prop_adjust2Value, 21600 } },
+ { 0xe000, { 0x405, DFF_Prop_adjust2Value, DFF_Prop_adjustValue } },
+ { 0x2001, { 0x406, 1, 2 } },
+ { 0x4002, { 21600, DFF_Prop_adjustValue, 0 } },
+ { 0xa00f, { DFF_Prop_adjust3Value, 21600, 0x404 } },
+ { 0x6000, { 0x404, 0x409, 0 } },
+ { 0x6000, { 0x40a, DFF_Prop_adjust2Value, 21600 } },
+ { 0x6000, { 0x407, 0x409, 0 } },
+ { 0xa000, { 0x40b, 21600, DFF_Prop_adjustValue } },
+ { 0xa000, { 0x405, 0, DFF_Prop_adjustValue } },
+ { 0x2001, { 0x40e, 1, 2 } },
+ { 0x6002, { 0x404, 0x407, 0 } },
+ { 0x6000, { DFF_Prop_adjustValue, DFF_Prop_adjust2Value, 21600 } },
+ { 0x2001, { 0x411, 1, 2 } },
+ { 0xa000, { 0x410, 0, 0x412 } },
+ { 0x0000, { 21600, 0, 0 } },
+ { 0x0000, { 21600, 0, 0 } },
+ { 0x0000, { 0, 0, 21600 } },
+ { 0xa000, { 0x410, 0, 0x404 } },
+ { 0x600f, { 0x417, 0x404, 21600 } },
+ { 0x2000, { 0x408, 128, 0 } },
+ { 0x2001, { 0x405, 1, 2 } },
+ { 0x2000, { 0x405, 0, 128 } },
+ { 0xe000, { DFF_Prop_adjustValue, 0x410, 0x40b } },
+ { 0x8000, { 21600, 0, DFF_Prop_adjustValue } },
+ { 0x2001, { 0x41d, 1, 2 } },
+ { 0x0001, { 21600, 21600, 1 } },
+ { 0x6001, { DFF_Prop_adjust3Value, DFF_Prop_adjust3Value, 1 } },
+ { 0xa000, { 0x41f, 0, 0x420 } },
+ { 0x200d, { 0x421, 0, 0 } },
+ { 0x2000, { 0x422, 21600, 0 } },
+ { 0x8001, { 21600, 21600, 0x423 } },
+ { 0x2000, { 0x424, 64, 0 } },
+ { 0x2001, { DFF_Prop_adjustValue, 1, 2 } },
+ { 0x600f, { 0x41e, 0x426, 21600 } },
+ { 0x2000, { 0x427, 0, 64 } },
+ { 0x2001, { 0x404, 1, 2 } },
+ { 0xa000, { DFF_Prop_adjust2Value, 0, 0x429 } },
+ { 0x0001, { 21600, 2195, 16384 } },
+ { 0x0001, { 21600, 14189, 16384 } }
+};
+static const sal_Int32 mso_sptCurvedUpDefault[] =
+{
+ 3, 12960, 19440, 7200
+};
+static const SvxMSDffTextRectangles mso_sptCurvedUpTextRect[] =
+{
+ { { 41 MSO_I, 43 MSO_I }, { 42 MSO_I, 44 MSO_I } }
+};
+static const SvxMSDffVertPair mso_sptCurvedUpGluePoints[] =
+{
+ { 8 MSO_I, 0 }, { 11 MSO_I, 2 MSO_I }, { 15 MSO_I, 0 }, { 16 MSO_I, 21 MSO_I }, { 13 MSO_I, 2 MSO_I }
+};
+static const SvxMSDffHandle mso_sptCurvedUpHandles[] =
+{
+ { MSDFF_HANDLE_FLAGS_RANGE | MSDFF_HANDLE_FLAGS_RANGE_X_MIN_IS_SPECIAL | MSDFF_HANDLE_FLAGS_RANGE_X_MAX_IS_SPECIAL,
+ 0x100, 0, 10800, 10800, 3 + 37, 3 + 27, 0, 10800 },
+ { MSDFF_HANDLE_FLAGS_RANGE | MSDFF_HANDLE_FLAGS_RANGE_X_MIN_IS_SPECIAL | MSDFF_HANDLE_FLAGS_RANGE_X_MAX_IS_SPECIAL,
+ 0x101, 0, 10800, 10800, 3 + 25, 3 + 20, 0, 10800 },
+ { MSDFF_HANDLE_FLAGS_RANGE | MSDFF_HANDLE_FLAGS_RANGE_Y_MAX_IS_SPECIAL,
+ 21600, 0x102, 10800, 10800, 3375, 21600, 0, 3 + 40 }
+};
+static const mso_CustomShape msoCurvedUpArrow =
+{
+ (SvxMSDffVertPair*)mso_sptCurvedUpVert, sizeof( mso_sptCurvedUpVert ) / sizeof( SvxMSDffVertPair ),
+ (sal_uInt16*)mso_sptCurvedUpSegm, sizeof( mso_sptCurvedUpSegm ) >> 1,
+ (SvxMSDffCalculationData*)mso_sptCurvedUpCalc, sizeof( mso_sptCurvedUpCalc ) / sizeof( SvxMSDffCalculationData ),
+ (sal_Int32*)mso_sptCurvedUpDefault,
+ (SvxMSDffTextRectangles*)mso_sptCurvedUpTextRect, sizeof( mso_sptCurvedUpTextRect ) / sizeof( SvxMSDffTextRectangles ),
+ 21600, 21600,
+ 0x80000000, 0x80000000,
+ (SvxMSDffVertPair*)mso_sptCurvedUpGluePoints, sizeof( mso_sptCurvedUpGluePoints ) / sizeof( SvxMSDffVertPair ),
+ (SvxMSDffHandle*)mso_sptCurvedUpHandles, sizeof( mso_sptCurvedUpHandles ) / sizeof( SvxMSDffHandle )
+};
+
+static const SvxMSDffVertPair mso_sptCurvedRightVert[] =
+{
+ { 0, 0 }, { 23 MSO_I, 3 MSO_I }, { 22 MSO_I, 0 }, { 0, 4 MSO_I }, { 0, 15 MSO_I }, { 23 MSO_I, 1 MSO_I }, { 0, 7 MSO_I }, { 2 MSO_I, 13 MSO_I },
+ { 2 MSO_I, 14 MSO_I }, { 22 MSO_I, 8 MSO_I }, { 2 MSO_I, 12 MSO_I },
+ { 0, 0 }, { 23 MSO_I, 3 MSO_I }, { 2 MSO_I, 11 MSO_I }, { 26 MSO_I, 17 MSO_I }, { 0, 15 MSO_I }, { 23 MSO_I, 1 MSO_I }, { 26 MSO_I, 17 MSO_I }, { 22 MSO_I, 15 MSO_I },
+ { 0, 0 }, { 23 MSO_I, 3 MSO_I }, { 0, 4 MSO_I }, { 26 MSO_I, 17 MSO_I }
+};
+static const sal_uInt16 mso_sptCurvedRightSegm[] =
+{
+ 0xa408,
+ 0x0003,
+ 0xa508,
+ 0x6000,
+ 0x8000,
+ 0xa404,
+ 0xaa00,
+ 0x8000
+};
+static const SvxMSDffCalculationData mso_sptCurvedRightCalc[] =
+{
+ { 0x2000, { DFF_Prop_adjustValue, 0, 0 } },
+ { 0x2000, { DFF_Prop_adjust2Value, 0, 0 } },
+ { 0x2000, { DFF_Prop_adjust3Value, 0, 0 } },
+ { 0xa000, { DFF_Prop_adjustValue, 21600, DFF_Prop_adjust2Value } },
+ { 0x2001, { 0x403, 1, 2 } },
+ { 0x6000, { DFF_Prop_adjust2Value, DFF_Prop_adjust2Value, 21600 } },
+ { 0xe000, { 0x405, DFF_Prop_adjust2Value, DFF_Prop_adjustValue } },
+ { 0x2001, { 0x406, 1, 2 } },
+ { 0x4002, { 21600, DFF_Prop_adjustValue, 0 } },
+ { 0x8000, { 21600, 0, DFF_Prop_adjust3Value } },
+ { 0xa00f, { 0x409, 21600, 0x404 } },
+ { 0x6000, { 0x404, 0x40a, 0 } },
+ { 0x6000, { 0x40b, DFF_Prop_adjust2Value, 21600 } },
+ { 0x6000, { 0x407, 0x40a, 0 } },
+ { 0xa000, { 0x40c, 21600, DFF_Prop_adjustValue } },
+ { 0xa000, { 0x405, 0, DFF_Prop_adjustValue } },
+ { 0x2001, { 0x40f, 1, 2 } },
+ { 0x6002, { 0x404, 0x407, 0 } },
+ { 0x6000, { DFF_Prop_adjustValue, DFF_Prop_adjust2Value, 21600 } },
+ { 0x2001, { 0x412, 1, 2 } },
+ { 0xa000, { 0x411, 0, 0x413 } },
+ { 0x0000, { 21600, 0, 0 } },
+ { 0x0000, { 21600, 0, 0 } },
+ { 0x0001, { 21600, 2, 1 } },
+ { 0xa000, { 0x411, 0, 0x404 } },
+ { 0x600f, { 0x418, 0x404, 21600 } },
+ { 0x8000, { 21600, 0, 0x419 } },
+ { 0x2000, { 0x408, 128, 0 } },
+ { 0x2001, { 0x405, 1, 2 } },
+ { 0x2000, { 0x405, 0, 128 } },
+ { 0xe000, { DFF_Prop_adjustValue, 0x411, 0x40c } },
+ { 0x600f, { 0x414, 0x404, 21600 } },
+ { 0x8000, { 21600, 0, DFF_Prop_adjustValue } },
+ { 0x2001, { 0x420, 1, 2 } },
+ { 0x0001, { 21600, 21600, 1 } },
+ { 0x6001, { 0x409, 0x409, 1 } },
+ { 0xa000, { 0x422, 0, 0x423 } },
+ { 0x200d, { 0x424, 0, 0 } },
+ { 0x2000, { 0x425, 21600, 0 } },
+ { 0x8001, { 21600, 21600, 0x426 } },
+ { 0x2000, { 0x427, 64, 0 } },
+ { 0x2001, { DFF_Prop_adjustValue, 1, 2 } },
+ { 0x600f, { 0x421, 0x429, 21600 } },
+ { 0x8000, { 21600, 0, 0x42a } },
+ { 0x2000, { 0x42b, 64, 0 } },
+ { 0x2001, { 0x404, 1, 2 } },
+ { 0xa000, { DFF_Prop_adjust2Value, 0, 0x42d } },
+ { 0x0001, { 21600, 2195, 16384 } },
+ { 0x0001, { 21600, 14189, 16384 } }
+};
+static const sal_Int32 mso_sptCurvedRightDefault[] =
+{
+ 3, 12960, 19440, 14400
+};
+static const SvxMSDffTextRectangles mso_sptCurvedRightTextRect[] =
+{
+ { { 47 MSO_I, 45 MSO_I }, { 48 MSO_I, 46 MSO_I } }
+};
+static const SvxMSDffVertPair mso_sptCurvedRightGluePoints[] =
+{
+ { 0, 17 MSO_I }, { 2 MSO_I, 14 MSO_I }, { 22 MSO_I, 8 MSO_I }, { 2 MSO_I, 12 MSO_I }, { 22 MSO_I, 16 MSO_I }
+};
+static const SvxMSDffHandle mso_sptCurvedRightHandles[] =
+{
+ { MSDFF_HANDLE_FLAGS_RANGE | MSDFF_HANDLE_FLAGS_RANGE_Y_MIN_IS_SPECIAL | MSDFF_HANDLE_FLAGS_RANGE_Y_MAX_IS_SPECIAL,
+ 21600, 0x100, 10800, 10800, 0, 10800, 3 + 40, 3 + 29 },
+ { MSDFF_HANDLE_FLAGS_RANGE | MSDFF_HANDLE_FLAGS_RANGE_Y_MIN_IS_SPECIAL | MSDFF_HANDLE_FLAGS_RANGE_Y_MAX_IS_SPECIAL,
+ 21600, 0x101, 10800, 10800, 0, 10800, 3 + 27, 3 + 21 },
+ { MSDFF_HANDLE_FLAGS_RANGE | MSDFF_HANDLE_FLAGS_RANGE_X_MIN_IS_SPECIAL | MSDFF_HANDLE_FLAGS_RANGE_X_MAX_IS_SPECIAL,
+ 0x102, 21600, 10800, 10800, 3 + 44, 3 + 22, 3375, 21600 }
+};
+static const mso_CustomShape msoCurvedRightArrow =
+{
+ (SvxMSDffVertPair*)mso_sptCurvedRightVert, sizeof( mso_sptCurvedRightVert ) / sizeof( SvxMSDffVertPair ),
+ (sal_uInt16*)mso_sptCurvedRightSegm, sizeof( mso_sptCurvedRightSegm ) >> 1,
+ (SvxMSDffCalculationData*)mso_sptCurvedRightCalc, sizeof( mso_sptCurvedRightCalc ) / sizeof( SvxMSDffCalculationData ),
+ (sal_Int32*)mso_sptCurvedRightDefault,
+ (SvxMSDffTextRectangles*)mso_sptCurvedRightTextRect, sizeof( mso_sptCurvedRightTextRect ) / sizeof( SvxMSDffTextRectangles ),
+ 21600, 21600,
+ 0x80000000, 0x80000000,
+ (SvxMSDffVertPair*)mso_sptCurvedRightGluePoints, sizeof( mso_sptCurvedRightGluePoints ) / sizeof( SvxMSDffVertPair ),
+ (SvxMSDffHandle*)mso_sptCurvedRightHandles, sizeof( mso_sptCurvedRightHandles ) / sizeof( SvxMSDffHandle )
+};
+
+static const SvxMSDffVertPair mso_sptCurvedLeftVert[] =
+{
+ { 22 MSO_I, 0 }, { 21 MSO_I, 3 MSO_I }, { 0, 0 }, { 21 MSO_I, 4 MSO_I }, { 22 MSO_I, 14 MSO_I }, { 21 MSO_I, 1 MSO_I }, { 21 MSO_I, 7 MSO_I }, { 2 MSO_I, 12 MSO_I },
+ { 2 MSO_I, 13 MSO_I }, { 0, 8 MSO_I }, { 2 MSO_I, 11 MSO_I },
+ { 22 MSO_I, 0 }, { 21 MSO_I, 3 MSO_I }, { 2 MSO_I, 10 MSO_I }, { 24 MSO_I, 16 MSO_I }, { 22 MSO_I, 14 MSO_I }, { 21 MSO_I, 1 MSO_I }, { 24 MSO_I, 16 MSO_I }, { 0, 14 MSO_I },
+ { 22 MSO_I, 14 MSO_I }, { 21 MSO_I, 1 MSO_I }, { 21 MSO_I, 7 MSO_I }, { 24 MSO_I, 16 MSO_I }
+};
+static const sal_uInt16 mso_sptCurvedLeftSegm[] =
+{
+ 0xa608,
+ 0x0003,
+ 0xa308,
+ 0x6000,
+ 0x8000,
+ 0xa404,
+ 0xaa00,
+ 0x8000
+};
+static const SvxMSDffCalculationData mso_sptCurvedLeftCalc[] =
+{
+ { 0x2000, { DFF_Prop_adjustValue, 0, 0 } },
+ { 0x2000, { DFF_Prop_adjust2Value, 0, 0 } },
+ { 0x2000, { DFF_Prop_adjust3Value, 0, 0 } },
+ { 0xa000, { DFF_Prop_adjustValue, 21600, DFF_Prop_adjust2Value } },
+ { 0x2001, { 0x403, 1, 2 } },
+ { 0x6000, { DFF_Prop_adjust2Value, DFF_Prop_adjust2Value, 21600 } },
+ { 0xe000, { 0x405, DFF_Prop_adjust2Value, DFF_Prop_adjustValue } },
+ { 0x2001, { 0x406, 1, 2 } },
+ { 0x4002, { 21600, DFF_Prop_adjustValue, 0 } },
+ { 0xa00f, { DFF_Prop_adjust3Value, 21600, 0x404 } },
+ { 0x6000, { 0x404, 0x409, 0 } },
+ { 0x6000, { 0x40a, DFF_Prop_adjust2Value, 21600 } },
+ { 0x6000, { 0x407, 0x409, 0 } },
+ { 0xa000, { 0x40b, 21600, DFF_Prop_adjustValue } },
+ { 0xa000, { 0x405, 0, DFF_Prop_adjustValue } },
+ { 0x2001, { 0x40e, 1, 2 } },
+ { 0x6002, { 0x404, 0x407, 0 } },
+ { 0x6000, { DFF_Prop_adjustValue, DFF_Prop_adjust2Value, 21600 } },
+ { 0x2001, { 0x411, 1, 2 } },
+ { 0xa000, { 0x410, 0, 0x412 } },
+ { 0x0000, { 21600, 0, 0 } },
+ { 0x0000, { 21600, 0, 0 } },
+ { 0x0000, { 0, 0, 21600 } },
+ { 0xa000, { 0x410, 0, 0x404 } },
+ { 0x600f, { 0x417, 0x404, 21600 } },
+ { 0x2000, { 0x408, 128, 0 } },
+ { 0x2001, { 0x405, 1, 2 } },
+ { 0x2000, { 0x405, 0, 128 } },
+ { 0xe000, { DFF_Prop_adjustValue, 0x410, 0x40b } },
+ { 0x8000, { 21600, 0, DFF_Prop_adjustValue } },
+ { 0x2001, { 0x41d, 1, 2 } },
+ { 0x0001, { 21600, 21600, 1 } },
+ { 0x6001, { DFF_Prop_adjust3Value, DFF_Prop_adjust3Value, 1 } },
+ { 0xa000, { 0x41f, 0, 0x420 } },
+ { 0x200d, { 0x421, 0, 0 } },
+ { 0x2000, { 0x422, 21600, 0 } },
+ { 0x8001, { 21600, 21600, 0x423 } },
+ { 0x2000, { 0x424, 64, 0 } },
+ { 0x2001, { DFF_Prop_adjustValue, 1, 2 } },
+ { 0x600f, { 0x41e, 0x426, 21600 } },
+ { 0x2000, { 0x427, 0, 64 } },
+ { 0x2001, { 0x404, 1, 2 } },
+ { 0xa000, { DFF_Prop_adjust2Value, 0, 0x429 } },
+ { 0x0001, { 21600, 2195, 16384 } },
+ { 0x0001, { 21600, 14189, 16384 } }
+};
+static const sal_Int32 mso_sptCurvedLeftDefault[] =
+{
+ 3, 12960, 19440, 7200
+};
+static const SvxMSDffTextRectangles mso_sptCurvedLeftTextRect[] =
+{
+ { { 43 MSO_I, 41 MSO_I }, { 44 MSO_I, 42 MSO_I } }
};
+static const SvxMSDffVertPair mso_sptCurvedLeftGluePoints[] =
+{
+ { 0, 15 MSO_I }, { 2 MSO_I, 11 MSO_I }, { 0, 8 MSO_I }, { 2 MSO_I, 13 MSO_I }, { 21 MSO_I, 16 MSO_I }
+};
+static const SvxMSDffHandle mso_sptCurvedLeftHandles[] =
+{
+ { MSDFF_HANDLE_FLAGS_RANGE | MSDFF_HANDLE_FLAGS_RANGE_Y_MIN_IS_SPECIAL | MSDFF_HANDLE_FLAGS_RANGE_Y_MAX_IS_SPECIAL,
+ 0, 0x100, 10800, 10800, 0, 10800, 3 + 37, 3 + 27 },
+ { MSDFF_HANDLE_FLAGS_RANGE | MSDFF_HANDLE_FLAGS_RANGE_Y_MIN_IS_SPECIAL | MSDFF_HANDLE_FLAGS_RANGE_Y_MAX_IS_SPECIAL,
+ 0, 0x101, 10800, 10800, 0, 10800, 3 + 25, 3 + 20 },
+ { MSDFF_HANDLE_FLAGS_RANGE | MSDFF_HANDLE_FLAGS_RANGE_X_MAX_IS_SPECIAL,
+ 0x102, 21600, 10800, 10800, 0, 3 + 40, 3375, 21600 }
+};
+static const mso_CustomShape msoCurvedLeftArrow =
+{
+ (SvxMSDffVertPair*)mso_sptCurvedLeftVert, sizeof( mso_sptCurvedLeftVert ) / sizeof( SvxMSDffVertPair ),
+ (sal_uInt16*)mso_sptCurvedLeftSegm, sizeof( mso_sptCurvedLeftSegm ) >> 1,
+ (SvxMSDffCalculationData*)mso_sptCurvedLeftCalc, sizeof( mso_sptCurvedLeftCalc ) / sizeof( SvxMSDffCalculationData ),
+ (sal_Int32*)mso_sptCurvedLeftDefault,
+ (SvxMSDffTextRectangles*)mso_sptCurvedLeftTextRect, sizeof( mso_sptCurvedLeftTextRect ) / sizeof( SvxMSDffTextRectangles ),
+ 21600, 21600,
+ 0x80000000, 0x80000000,
+ (SvxMSDffVertPair*)mso_sptCurvedLeftGluePoints, sizeof( mso_sptCurvedLeftGluePoints ) / sizeof( SvxMSDffVertPair ),
+ (SvxMSDffHandle*)mso_sptCurvedLeftHandles, sizeof( mso_sptCurvedLeftHandles ) / sizeof( SvxMSDffHandle )
+};
+
+
+
+
static const SvxMSDffVertPair mso_sptStripedRightArrowVert[] = // adjustment1 : x 3375 - 21600
{ // adjustment2 : y 0 - 10800
@@ -3046,10 +3400,6 @@ static const SvxMSDffVertPair mso_sptHeartGluePoints[] =
{
{ 10800, 2180 }, { 3090, 10800 }, { 10800, 21600 }, { 18490, 10800 }
};
-static const sal_Int32 mso_sptHeartBoundRect[] =
-{
- -9, 0, 21606, 21602
-};
static const mso_CustomShape msoHeart =
{
(SvxMSDffVertPair*)mso_sptHeartVert, sizeof( mso_sptHeartVert ) / sizeof( SvxMSDffVertPair ),
@@ -7772,10 +8122,10 @@ const mso_CustomShape* GetCustomShapeContent( MSO_SPT eSpType )
case mso_sptUturnArrow : pCustomShape = &msoUturnArrow; break;
case mso_sptLeftUpArrow : pCustomShape = &msoLeftUpArrow; break;
case mso_sptBentUpArrow : pCustomShape = &msoBentUpArrow; break;
- case mso_sptCurvedRightArrow : pCustomShape = &msoCurvedArrow; break;
- case mso_sptCurvedLeftArrow : pCustomShape = &msoCurvedArrow; break;
- case mso_sptCurvedUpArrow : pCustomShape = &msoCurvedArrow; break;
- case mso_sptCurvedDownArrow : pCustomShape = &msoCurvedArrow; break;
+ case mso_sptCurvedRightArrow : pCustomShape = &msoCurvedRightArrow; break;
+ case mso_sptCurvedLeftArrow : pCustomShape = &msoCurvedLeftArrow; break;
+ case mso_sptCurvedUpArrow : pCustomShape = &msoCurvedUpArrow; break;
+ case mso_sptCurvedDownArrow : pCustomShape = &msoCurvedDownArrow; break;
case mso_sptStripedRightArrow : pCustomShape = &msoStripedRightArrow; break;
case mso_sptNotchedRightArrow : pCustomShape = &msoNotchedRightArrow; break;
case mso_sptHomePlate : pCustomShape = &msoHomePlate; break;
diff --git a/svx/source/customshapes/EnhancedCustomShapeGeometry.hxx b/svx/source/customshapes/EnhancedCustomShapeGeometry.hxx
index 30e5bb4e7c..d216c5bb48 100644
--- a/svx/source/customshapes/EnhancedCustomShapeGeometry.hxx
+++ b/svx/source/customshapes/EnhancedCustomShapeGeometry.hxx
@@ -93,12 +93,12 @@ struct mso_CustomShape
#define MSO_I | (sal_Int32)0x80000000
sal_Bool SortFilledObjectsToBackByDefault( MSO_SPT eSpType );
-sal_Bool IsCustomShapeFilledByDefault( MSO_SPT eSpType );
-sal_Int16 GetCustomShapeConnectionTypeDefault( MSO_SPT eSpType );
+SVX_DLLPUBLIC sal_Bool IsCustomShapeFilledByDefault( MSO_SPT eSpType );
+SVX_DLLPUBLIC sal_Int16 GetCustomShapeConnectionTypeDefault( MSO_SPT eSpType );
// #i28269#
-sal_Bool IsCustomShapeStrokedByDefault( MSO_SPT eSpType );
+SVX_DLLPUBLIC sal_Bool IsCustomShapeStrokedByDefault( MSO_SPT eSpType );
-const mso_CustomShape* GetCustomShapeContent( MSO_SPT eSpType );
+SVX_DLLPUBLIC const mso_CustomShape* GetCustomShapeContent( MSO_SPT eSpType );
#endif
diff --git a/svx/source/customshapes/EnhancedCustomShapeTypeNames.hxx b/svx/source/customshapes/EnhancedCustomShapeTypeNames.hxx
index a42a05b233..a24f11ebf0 100644
--- a/svx/source/customshapes/EnhancedCustomShapeTypeNames.hxx
+++ b/svx/source/customshapes/EnhancedCustomShapeTypeNames.hxx
@@ -33,12 +33,10 @@
#include <svx/msdffdef.hxx>
#include <rtl/ustring.hxx>
-class EnhancedCustomShapeTypeNames
+namespace EnhancedCustomShapeTypeNames
{
- public :
-
- static MSO_SPT Get( const rtl::OUString& );
- static rtl::OUString Get( const MSO_SPT );
-};
+ SVX_DLLPUBLIC MSO_SPT Get( const rtl::OUString& );
+ SVX_DLLPUBLIC rtl::OUString Get( const MSO_SPT );
+}
#endif
diff --git a/svx/source/customshapes/makefile.mk b/svx/source/customshapes/makefile.mk
index a81910b830..9940a9bb21 100644
--- a/svx/source/customshapes/makefile.mk
+++ b/svx/source/customshapes/makefile.mk
@@ -32,6 +32,7 @@
PRJ=..$/..
PRJNAME=svx
TARGET=customshapes
+LIBTARGET=NO
ENABLE_EXCEPTIONS=TRUE
# --- Settings ----------------------------------
@@ -50,16 +51,23 @@ NOOPTFILES= $(SLO)$/EnhancedCustomShapeFunctionParser.obj
# --- Files -------------------------------------
-SLOFILES= $(SLO)$/EnhancedCustomShapeEngine.obj \
+LIB1TARGET= $(SLB)$/$(TARGET)-core.lib
+LIB1OBJFILES= \
$(SLO)$/EnhancedCustomShapeTypeNames.obj \
$(SLO)$/EnhancedCustomShapeGeometry.obj \
$(SLO)$/EnhancedCustomShape2d.obj \
+ $(SLO)$/EnhancedCustomShapeFunctionParser.obj
+
+LIB2TARGET= $(SLB)$/$(TARGET).lib
+LIB2OBJFILES= \
+ $(SLO)$/EnhancedCustomShapeEngine.obj \
$(SLO)$/EnhancedCustomShape3d.obj \
$(SLO)$/EnhancedCustomShapeFontWork.obj \
$(SLO)$/EnhancedCustomShapeHandle.obj \
- $(SLO)$/EnhancedCustomShapeFunctionParser.obj \
$(SLO)$/tbxcustomshapes.obj
+SLOFILES = $(LIB1OBJFILES) $(LIB2OBJFILES)
+
# --- Targets ----------------------------------
.INCLUDE : target.mk
diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx
index c330524be6..2d3b9d33b4 100644
--- a/svx/source/dialog/dlgctrl.cxx
+++ b/svx/source/dialog/dlgctrl.cxx
@@ -173,24 +173,22 @@ void SvxRectCtl::InitRectBitmap( void )
pBitmap = new Bitmap( SVX_RES( RID_SVXCTRL_RECTBTNS ) );
// set bitmap-colors
- long aTempAry1[(7*sizeof(Color))/sizeof(long)];
- long aTempAry2[(7*sizeof(Color))/sizeof(long)];
- Color* pColorAry1 = (Color*)aTempAry1;
- Color* pColorAry2 = (Color*)aTempAry2;
- pColorAry1[0] = Color( 0xC0, 0xC0, 0xC0 ); // light-gray
- pColorAry1[1] = Color( 0xFF, 0xFF, 0x00 ); // yellow
- pColorAry1[2] = Color( 0xFF, 0xFF, 0xFF ); // white
- pColorAry1[3] = Color( 0x80, 0x80, 0x80 ); // dark-gray
- pColorAry1[4] = Color( 0x00, 0x00, 0x00 ); // black
- pColorAry1[5] = Color( 0x00, 0xFF, 0x00 ); // green
- pColorAry1[6] = Color( 0x00, 0x00, 0xFF ); // blue
- pColorAry2[0] = rStyles.GetDialogColor(); // background
- pColorAry2[1] = rStyles.GetWindowColor();
- pColorAry2[2] = rStyles.GetLightColor();
- pColorAry2[3] = rStyles.GetShadowColor();
- pColorAry2[4] = rStyles.GetDarkShadowColor();
- pColorAry2[5] = Color( aColorConfig.GetColorValue( svtools::FONTCOLOR ).nColor );
- pColorAry2[6] = rStyles.GetDialogColor();
+ Color aColorAry1[7];
+ Color aColorAry2[7];
+ aColorAry1[0] = Color( 0xC0, 0xC0, 0xC0 ); // light-gray
+ aColorAry1[1] = Color( 0xFF, 0xFF, 0x00 ); // yellow
+ aColorAry1[2] = Color( 0xFF, 0xFF, 0xFF ); // white
+ aColorAry1[3] = Color( 0x80, 0x80, 0x80 ); // dark-gray
+ aColorAry1[4] = Color( 0x00, 0x00, 0x00 ); // black
+ aColorAry1[5] = Color( 0x00, 0xFF, 0x00 ); // green
+ aColorAry1[6] = Color( 0x00, 0x00, 0xFF ); // blue
+ aColorAry2[0] = rStyles.GetDialogColor(); // background
+ aColorAry2[1] = rStyles.GetWindowColor();
+ aColorAry2[2] = rStyles.GetLightColor();
+ aColorAry2[3] = rStyles.GetShadowColor();
+ aColorAry2[4] = rStyles.GetDarkShadowColor();
+ aColorAry2[5] = Color( aColorConfig.GetColorValue( svtools::FONTCOLOR ).nColor );
+ aColorAry2[6] = rStyles.GetDialogColor();
#ifdef DBG_UTIL
static BOOL bModify = FALSE;
@@ -205,11 +203,11 @@ void SvxRectCtl::InitRectBitmap( void )
UINT8& rr = r;
UINT8& rg = g;
UINT8& rb = b;
- pColorAry2[ rn ] = Color( rr, rg, rb );
+ aColorAry2[ rn ] = Color( rr, rg, rb );
}
#endif
- pBitmap->Replace( pColorAry1, pColorAry2, 7, NULL );
+ pBitmap->Replace( aColorAry1, aColorAry2, 7, NULL );
}
// -----------------------------------------------------------------------
diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx
index ff0c706b71..d76dd9a4a2 100644
--- a/svx/source/dialog/fntctrl.cxx
+++ b/svx/source/dialog/fntctrl.cxx
@@ -36,6 +36,7 @@
#include <sfx2/printer.hxx> // SfxPrinter
#include <vcl/metric.hxx>
#include <vcl/svapp.hxx>
+#include <unicode/uchar.h>
#include <com/sun/star/uno/Reference.h>
#include <com/sun/star/i18n/XBreakIterator.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -244,7 +245,25 @@ void FontPrevWin_Impl::_CheckScript()
do
{
nChg = (xub_StrLen)xBreak->endOfScript( aText, nChg, nScript );
- aScriptChg.Insert( nChg, nCnt );
+ if (nChg < aText.Len() && nChg > 0 &&
+ (com::sun::star::i18n::ScriptType::WEAK ==
+ xBreak->getScriptType(aText, nChg - 1)))
+ {
+ int8_t nType = u_charType(aText.GetChar(nChg) );
+ if (nType == U_NON_SPACING_MARK || nType == U_ENCLOSING_MARK ||
+ nType == U_COMBINING_SPACING_MARK )
+ {
+ aScriptChg.Insert( nChg - 1, nCnt );
+ }
+ else
+ {
+ aScriptChg.Insert( nChg, nCnt );
+ }
+ }
+ else
+ {
+ aScriptChg.Insert( nChg, nCnt );
+ }
aScriptType.Insert( nScript, nCnt );
aTextWidth.Insert( ULONG(0), nCnt++ );
@@ -604,6 +623,14 @@ void SvxFontPrevWindow::SetColor(const Color &rColor)
pImpl->pColor = new Color( rColor );
Invalidate();
}
+// -----------------------------------------------------------------------
+
+void SvxFontPrevWindow::ResetColor()
+{
+ delete pImpl->pColor;
+ pImpl->pColor = 0;
+ Invalidate();
+}
// -----------------------------------------------------------------------
diff --git a/svx/source/dialog/imapwnd.cxx b/svx/source/dialog/imapwnd.cxx
index 364087b6e4..1c981b92de 100644
--- a/svx/source/dialog/imapwnd.cxx
+++ b/svx/source/dialog/imapwnd.cxx
@@ -716,7 +716,7 @@ void IMapWindow::RequestHelp( const HelpEvent& rHEvt )
if ( Help::IsBalloonHelpEnabled() || Help::IsQuickHelpEnabled() )
{
- if ( pView->PickObj( aPos, pSdrObj, pPageView ) )
+ if ( pView->PickObj( aPos, pView->getHitTolLog(), pSdrObj, pPageView ) )
{
const IMapObject* pIMapObj = GetIMapObj( pSdrObj );
String aStr;
diff --git a/svx/source/dialog/makefile.mk b/svx/source/dialog/makefile.mk
index 04865246a9..c54081365a 100644
--- a/svx/source/dialog/makefile.mk
+++ b/svx/source/dialog/makefile.mk
@@ -31,6 +31,7 @@
PRJ=..$/..
PRJNAME=svx
TARGET=dialogs
+LIBTARGET=NO
ENABLE_EXCEPTIONS=TRUE
# --- Settings -----------------------------------------------------
@@ -76,9 +77,28 @@ SRC1FILES = \
SRS2NAME=drawdlgs
SRC2FILES = \
- sdstring.src \
+ sdstring.src
-SLOFILES= \
+LIB1TARGET=$(SLB)$/$(TARGET)-core.lib
+
+LIB1OBJFILES= \
+ $(SLO)$/dialmgr.obj\
+ $(SLO)$/dlgutil.obj \
+ $(SLO)$/framelink.obj\
+ $(SLO)$/hangulhanja.obj \
+ $(SLO)$/hyphen.obj \
+ $(SLO)$/impgrf.obj \
+ $(SLO)$/langbox.obj \
+ $(SLO)$/opengrf.obj \
+ $(SLO)$/simptabl.obj \
+ $(SLO)$/splwrap.obj \
+ $(SLO)$/svxdlg.obj \
+ $(SLO)$/stddlg.obj \
+ $(SLO)$/thesdlg.obj
+
+LIB2TARGET=$(SLB)$/$(TARGET).lib
+
+LIB2OBJFILES= \
$(SLO)$/charmap.obj \
$(SLO)$/checklbx.obj \
$(SLO)$/connctrl.obj \
@@ -86,31 +106,23 @@ SLOFILES= \
$(SLO)$/ctredlin.obj \
$(SLO)$/databaseregistrationui.obj \
$(SLO)$/dialcontrol.obj \
- $(SLO)$/dialmgr.obj\
$(SLO)$/dlgctl3d.obj \
$(SLO)$/dlgctrl.obj \
- $(SLO)$/dlgutil.obj \
$(SLO)$/docrecovery.obj \
$(SLO)$/fntctrl.obj \
$(SLO)$/fontlb.obj \
$(SLO)$/fontwork.obj \
- $(SLO)$/framelink.obj\
$(SLO)$/framelinkarray.obj \
$(SLO)$/frmdirlbox.obj \
$(SLO)$/frmsel.obj \
$(SLO)$/graphctl.obj \
$(SLO)$/grfflt.obj \
- $(SLO)$/hangulhanja.obj \
$(SLO)$/hdft.obj \
$(SLO)$/hyperdlg.obj \
- $(SLO)$/hyphen.obj \
$(SLO)$/hyprlink.obj \
$(SLO)$/imapdlg.obj \
$(SLO)$/imapwnd.obj \
- $(SLO)$/impgrf.obj \
- $(SLO)$/langbox.obj \
$(SLO)$/measctrl.obj \
- $(SLO)$/opengrf.obj \
$(SLO)$/orienthelper.obj \
$(SLO)$/pagectrl.obj \
$(SLO)$/paraprev.obj \
@@ -122,21 +134,16 @@ SLOFILES= \
$(SLO)$/rlrcitem.obj \
$(SLO)$/rubydialog.obj \
$(SLO)$/rulritem.obj \
- $(SLO)$/simptabl.obj \
$(SLO)$/SpellDialogChildWindow.obj \
- $(SLO)$/splwrap.obj \
$(SLO)$/srchctrl.obj \
$(SLO)$/srchdlg.obj \
- $(SLO)$/stddlg.obj \
$(SLO)$/strarray.obj \
$(SLO)$/svxbmpnumvalueset.obj\
$(SLO)$/svxbox.obj \
- $(SLO)$/svxdlg.obj \
$(SLO)$/svxgrahicitem.obj \
$(SLO)$/svxruler.obj \
$(SLO)$/swframeexample.obj \
$(SLO)$/swframeposstrings.obj \
- $(SLO)$/thesdlg.obj \
$(SLO)$/txencbox.obj \
$(SLO)$/txenctab.obj \
$(SLO)$/wrapfield.obj \
@@ -144,15 +151,17 @@ SLOFILES= \
$(SLO)$/_contdlg.obj
.IF "$(GUI)"=="UNX"
-SLOFILES += $(SLO)$/sendreportunx.obj
+LIB2OBJFILES += $(SLO)$/sendreportunx.obj
.ELSE
.IF "$(GUI)"=="WNT"
-SLOFILES += $(SLO)$/sendreportw32.obj
+LIB2OBJFILES += $(SLO)$/sendreportw32.obj
.ELSE
-SLOFILES += $(SLO)$/sendreportgen.obj
+LIB2OBJFILES += $(SLO)$/sendreportgen.obj
.ENDIF
.ENDIF
+SLOFILES = $(LIB1OBJFILES) $(LIB2OBJFILES)
+
# --- Targets -------------------------------------------------------
.INCLUDE : target.mk
diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx
index fa49e6e960..670264aae4 100644
--- a/svx/source/dialog/srchdlg.cxx
+++ b/svx/source/dialog/srchdlg.cxx
@@ -394,7 +394,7 @@ void SvxJSearchOptionsDialog::SetTransliterationFlags( INT32 nSettings )
aCalcStr ( THIS_SVX_RES( STR_WORDCALC ) ), \
pImpl ( NULL ), \
pSearchList ( NULL ), \
- pReplaceList ( NULL ), \
+ pReplaceList ( new SearchAttrItemList ), \
pSearchItem ( NULL ), \
pSearchController ( NULL ), \
pOptionsController ( NULL ), \
diff --git a/svx/source/editeng/editdoc.cxx b/svx/source/editeng/editdoc.cxx
index 45493a700f..7160a4197a 100644
--- a/svx/source/editeng/editdoc.cxx
+++ b/svx/source/editeng/editdoc.cxx
@@ -258,7 +258,7 @@ USHORT aV5Map[] = {
4035, 4036, 4037, 4038
};
-SV_IMPL_PTRARR( ContentList, ContentNode* );
+SV_IMPL_PTRARR( DummyContentList, ContentNode* );
SV_IMPL_VARARR( ScriptTypePosInfos, ScriptTypePosInfo );
SV_IMPL_VARARR( WritingDirectionInfos, WritingDirectionInfo );
// SV_IMPL_VARARR( ExtraCharInfos, ExtraCharInfo );
diff --git a/svx/source/editeng/editdoc.hxx b/svx/source/editeng/editdoc.hxx
index 301883042a..90efe213b6 100644
--- a/svx/source/editeng/editdoc.hxx
+++ b/svx/source/editeng/editdoc.hxx
@@ -285,7 +285,15 @@ public:
};
typedef ContentNode* ContentNodePtr;
-SV_DECL_PTRARR( ContentList, ContentNodePtr, 0, 4 )
+SV_DECL_PTRARR( DummyContentList, ContentNodePtr, 0, 4 )
+
+class ContentList : public DummyContentList
+{
+ USHORT nLastCache;
+public:
+ ContentList() : DummyContentList( 0, 4 ), nLastCache(0) {}
+ USHORT GetPos( const ContentNodePtr &rPtr ) const;
+};
// -------------------------------------------------------------------------
// class EditPaM
@@ -612,6 +620,7 @@ SV_DECL_PTRARR( DummyParaPortionList, ParaPortionPtr, 0, 4 )
// -------------------------------------------------------------------------
class ParaPortionList : public DummyParaPortionList
{
+ USHORT nLastCache;
public:
ParaPortionList();
~ParaPortionList();
@@ -623,6 +632,8 @@ public:
inline ParaPortion* SaveGetObject( USHORT nPos ) const
{ return ( nPos < Count() ) ? GetObject( nPos ) : 0; }
+ USHORT GetPos( const ParaPortionPtr &rPtr ) const;
+
// temporaer:
void DbgCheck( EditDoc& rDoc );
};
diff --git a/svx/source/editeng/editdoc2.cxx b/svx/source/editeng/editdoc2.cxx
index c24910a6ca..e0d5fc27e9 100644
--- a/svx/source/editeng/editdoc2.cxx
+++ b/svx/source/editeng/editdoc2.cxx
@@ -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
@@ -151,14 +151,14 @@ USHORT TextPortionList::GetStartPos( USHORT nPortion )
// -------------------------------------------------------------------------
ExtraPortionInfo::ExtraPortionInfo()
-{
- nOrgWidth = 0;
- nWidthFullCompression = 0;
+{
+ nOrgWidth = 0;
+ nWidthFullCompression = 0;
nMaxCompression100thPercent = 0;
- nAsianCompressionTypes = 0;
- nPortionOffsetX = 0;
- bFirstCharIsRightPunktuation = FALSE;
- bCompressed = FALSE;
+ nAsianCompressionTypes = 0;
+ nPortionOffsetX = 0;
+ bFirstCharIsRightPunktuation = FALSE;
+ bCompressed = FALSE;
pOrgDXArray = NULL;
}
@@ -167,7 +167,7 @@ ExtraPortionInfo::~ExtraPortionInfo()
delete[] pOrgDXArray;
}
-void ExtraPortionInfo::SaveOrgDXArray( const sal_Int32* pDXArray, USHORT nLen )
+void ExtraPortionInfo::SaveOrgDXArray( const sal_Int32* pDXArray, USHORT nLen )
{
delete[] pOrgDXArray;
pOrgDXArray = new sal_Int32[nLen];
@@ -324,10 +324,42 @@ void ParaPortion::CorrectValuesBehindLastFormattedLine( USHORT nLastFormattedLin
DBG_ASSERT( aLineList[ aLineList.Count()-1 ]->GetEnd() == pNode->Len(), "CorrectLines: Ende stimmt nicht!" );
}
- // -------------------------------------------------------------------------
+// Shared reverse lookup acceleration pieces ...
+
+static USHORT FastGetPos( const VoidPtr *pPtrArray, USHORT nPtrArrayLen,
+ VoidPtr pPtr, USHORT &rLastPos )
+{
+ // Through certain filter code-paths we do a lot of appends, which in
+ // turn call GetPos - creating some N^2 nightmares. If we have a
+ // non-trivially large list, do a few checks from the end first.
+ if( rLastPos > 16 )
+ {
+ USHORT nEnd;
+ if (rLastPos > nPtrArrayLen - 2)
+ nEnd = nPtrArrayLen;
+ else
+ nEnd = rLastPos + 2;
+
+ for( USHORT nIdx = rLastPos - 2; nIdx < nEnd; nIdx++ )
+ {
+ if( pPtrArray[ nIdx ] == pPtr )
+ {
+ rLastPos = nIdx;
+ return nIdx;
+ }
+ }
+ }
+ // The world's lamest linear search from svarray ...
+ for( USHORT nIdx = 0; nIdx < nPtrArrayLen; nIdx++ )
+ if (pPtrArray[ nIdx ] == pPtr )
+ return rLastPos = nIdx;
+ return USHRT_MAX;
+}
+
+// -------------------------------------------------------------------------
// class ParaPortionList
// -------------------------------------------------------------------------
-ParaPortionList::ParaPortionList()
+ParaPortionList::ParaPortionList() : nLastCache( 0 )
{
}
@@ -336,6 +368,20 @@ ParaPortionList::~ParaPortionList()
Reset();
}
+USHORT ParaPortionList::GetPos( const ParaPortionPtr &rPtr ) const
+{
+ return FastGetPos( reinterpret_cast<const VoidPtr *>( GetData() ),
+ Count(), static_cast<VoidPtr>( rPtr ),
+ ((ParaPortionList *)this)->nLastCache );
+}
+
+USHORT ContentList::GetPos( const ContentNodePtr &rPtr ) const
+{
+ return FastGetPos( reinterpret_cast<const VoidPtr *>( GetData() ),
+ Count(), static_cast<VoidPtr>( rPtr ),
+ ((ContentList *)this)->nLastCache );
+}
+
void ParaPortionList::Reset()
{
for ( USHORT nPortion = 0; nPortion < Count(); nPortion++ )
@@ -369,10 +415,10 @@ USHORT ParaPortionList::FindParagraph( long nYOffset )
return 0xFFFF; // solte mal ueber EE_PARA_NOT_FOUND erreicht werden!
}
-void ParaPortionList::DbgCheck( EditDoc&
+void ParaPortionList::DbgCheck( EditDoc&
#ifdef DBG_UTIL
rDoc
-#endif
+#endif
)
{
#ifdef DBG_UTIL
diff --git a/svx/source/editeng/editeng.cxx b/svx/source/editeng/editeng.cxx
index 05bfdea5bf..80027fff73 100644
--- a/svx/source/editeng/editeng.cxx
+++ b/svx/source/editeng/editeng.cxx
@@ -86,11 +86,9 @@
#include <vcl/help.hxx>
#include <svx/xpoly.hxx>
#include <com/sun/star/datatransfer/clipboard/XClipboard.hpp>
-#ifndef _COM_SUN_STAR_I18N_XINPUTSEQUENCECHECKER_HPP_
#include <com/sun/star/i18n/InputSequenceCheckMode.hpp>
-#endif
-#include <srchdlg.hxx>
+#include <sfx2/srchdefs.hxx>
#if OSL_DEBUG_LEVEL > 1
#include <svx/frmdiritem.hxx>
@@ -99,18 +97,11 @@
// Spaeter -> TOOLS\STRING.H (fuer Grep: WS_TARGET)
-//using namespace ::rtl;
-//using namespace ::utl;
using namespace ::com::sun::star;
-//using namespace ::com::sun::star::util;
using namespace ::com::sun::star::uno;
-//using namespace ::com::sun::star::lang;
-//using namespace ::com::sun::star::beans;
-//using namespace ::com::sun::star::frame;
using namespace ::com::sun::star::linguistic2;
-
DBG_NAME( EditEngine )
DBG_NAMEEX( EditView )
@@ -706,14 +697,34 @@ sal_uInt16 EditEngine::GetParagraphCount() const
sal_uInt16 EditEngine::GetLineCount( sal_uInt16 nParagraph ) const
{
DBG_CHKTHIS( EditEngine, 0 );
+ if ( !pImpEditEngine->IsFormatted() )
+ pImpEditEngine->FormatDoc();
return pImpEditEngine->GetLineCount( nParagraph );
}
sal_uInt16 EditEngine::GetLineLen( sal_uInt16 nParagraph, sal_uInt16 nLine ) const
{
DBG_CHKTHIS( EditEngine, 0 );
+ if ( !pImpEditEngine->IsFormatted() )
+ pImpEditEngine->FormatDoc();
return pImpEditEngine->GetLineLen( nParagraph, nLine );
}
+
+void EditEngine::GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT nParagraph, USHORT nLine ) const
+{
+ DBG_CHKTHIS( EditEngine, 0 );
+ if ( !pImpEditEngine->IsFormatted() )
+ pImpEditEngine->FormatDoc();
+ return pImpEditEngine->GetLineBoundaries( rStart, rEnd, nParagraph, nLine );
+}
+
+USHORT EditEngine::GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const
+{
+ DBG_CHKTHIS( EditEngine, 0 );
+ if ( !pImpEditEngine->IsFormatted() )
+ pImpEditEngine->FormatDoc();
+ return pImpEditEngine->GetLineNumberAtIndex( nPara, nIndex );
+}
sal_uInt32 EditEngine::GetLineHeight( sal_uInt16 nParagraph, sal_uInt16 nLine )
{
diff --git a/svx/source/editeng/editobj.cxx b/svx/source/editeng/editobj.cxx
index a9d3bca341..d8f0a332b9 100644
--- a/svx/source/editeng/editobj.cxx
+++ b/svx/source/editeng/editobj.cxx
@@ -253,6 +253,18 @@ void ContentInfo::DestroyLoadStoreTempInfos()
}
*/
+// #i102062#
+bool ContentInfo::isWrongListEqual(const ContentInfo& rCompare) const
+{
+ if(GetWrongList() == rCompare.GetWrongList())
+ return true;
+
+ if(!GetWrongList() || !rCompare.GetWrongList())
+ return false;
+
+ return (*GetWrongList() == *rCompare.GetWrongList());
+}
+
bool ContentInfo::operator==( const ContentInfo& rCompare ) const
{
if( (aText == rCompare.aText) &&
@@ -566,6 +578,12 @@ bool EditTextObject::operator==( const EditTextObject& rCompare ) const
return static_cast< const BinTextObject* >( this )->operator==( static_cast< const BinTextObject& >( rCompare ) );
}
+// #i102062#
+bool EditTextObject::isWrongListEqual(const EditTextObject& rCompare) const
+{
+ return static_cast< const BinTextObject* >(this)->isWrongListEqual(static_cast< const BinTextObject& >(rCompare));
+}
+
// from SfxItemPoolUser
void BinTextObject::ObjectInDestruction(const SfxItemPool& rSfxItemPool)
{
@@ -599,6 +617,23 @@ void BinTextObject::ObjectInDestruction(const SfxItemPool& rSfxItemPool)
}
}
+EditEngineItemPool* getEditEngineItemPool(SfxItemPool* pPool)
+{
+ EditEngineItemPool* pRetval = dynamic_cast< EditEngineItemPool* >(pPool);
+
+ while(!pRetval && pPool && pPool->GetSecondaryPool())
+ {
+ pPool = pPool->GetSecondaryPool();
+
+ if(pPool)
+ {
+ pRetval = dynamic_cast< EditEngineItemPool* >(pPool);
+ }
+ }
+
+ return pRetval;
+}
+
BinTextObject::BinTextObject( SfxItemPool* pP ) :
EditTextObject( EE_FORMAT_BIN ),
SfxItemPoolUser()
@@ -608,9 +643,17 @@ BinTextObject::BinTextObject( SfxItemPool* pP ) :
nUserType = 0;
nObjSettings = 0;
pPortionInfo = 0;
- if ( pP )
+
+ // #i101239# ensure target is a EditEngineItemPool, else
+ // fallback to pool ownership. This is needed to ensure that at
+ // pool destruction time of an alien pool, the pool is still alive.
+ // When registering would happen at an alien pool which just uses an
+ // EditEngineItemPool as some sub-pool, that pool could already
+ // be decoupled and deleted whcih would lead to crashes.
+ pPool = getEditEngineItemPool(pP);
+
+ if ( pPool )
{
- pPool = pP;
bOwnerOfPool = FALSE;
}
else
@@ -621,6 +664,7 @@ BinTextObject::BinTextObject( SfxItemPool* pP ) :
if(!bOwnerOfPool && pPool)
{
+ // it is sure now that the pool is an EditEngineItemPool
pPool->AddSfxItemPoolUser(*this);
}
@@ -641,9 +685,12 @@ BinTextObject::BinTextObject( const BinTextObject& r ) :
nScriptType = r.nScriptType;
pPortionInfo = NULL; // PortionInfo nicht kopieren
bStoreUnicodeStrings = FALSE;
+
if ( !r.bOwnerOfPool )
{
- // Dann den Pool mitverwenden
+ // reuse alien pool; this must be a EditEngineItemPool
+ // since there is no other way to construct a BinTextObject
+ // than it's regular constructor where that is ensured
pPool = r.pPool;
bOwnerOfPool = FALSE;
}
@@ -656,6 +703,7 @@ BinTextObject::BinTextObject( const BinTextObject& r ) :
if(!bOwnerOfPool && pPool)
{
+ // it is sure now that the pool is an EditEngineItemPool
pPool->AddSfxItemPoolUser(*this);
}
@@ -1589,6 +1637,28 @@ bool BinTextObject::operator==( const BinTextObject& rCompare ) const
return true;
}
+// #i102062#
+bool BinTextObject::isWrongListEqual(const BinTextObject& rCompare) const
+{
+ if(GetContents().Count() != rCompare.GetContents().Count())
+ {
+ return false;
+ }
+
+ for(USHORT a(0); a < GetContents().Count(); a++)
+ {
+ const ContentInfo& rCandA(*GetContents().GetObject(a));
+ const ContentInfo& rCandB(*rCompare.GetContents().GetObject(a));
+
+ if(!rCandA.isWrongListEqual(rCandB))
+ {
+ return false;
+ }
+ }
+
+ return true;
+}
+
#define CHARSETMARKER 0x9999
void __EXPORT BinTextObject::CreateData300( SvStream& rIStream )
diff --git a/svx/source/editeng/editobj2.hxx b/svx/source/editeng/editobj2.hxx
index c61a198f47..b37ceabbd7 100644
--- a/svx/source/editeng/editobj2.hxx
+++ b/svx/source/editeng/editobj2.hxx
@@ -181,13 +181,10 @@ public:
WrongList* GetWrongList() const { return pWrongs; }
void SetWrongList( WrongList* p ) { pWrongs = p; }
-
-/* cl removed because not needed anymore since binfilter
- LoadStoreTempInfos* GetLoadStoreTempInfos() const { return pTempLoadStoreInfos; }
- void CreateLoadStoreTempInfos();
- void DestroyLoadStoreTempInfos();
-*/
bool operator==( const ContentInfo& rCompare ) const;
+
+ // #i102062#
+ bool isWrongListEqual(const ContentInfo& rCompare) const;
};
typedef ContentInfo* ContentInfoPtr;
@@ -198,6 +195,7 @@ SV_DECL_PTRARR( ContentInfoList, ContentInfoPtr, 1, 4 )
class BinTextObject : public EditTextObject, public SfxItemPoolUser
{
using EditTextObject::operator==;
+ using EditTextObject::isWrongListEqual;
private:
ContentInfoList aContents;
@@ -303,6 +301,9 @@ public:
bool operator==( const BinTextObject& rCompare ) const;
+ // #i102062#
+ bool isWrongListEqual(const BinTextObject& rCompare) const;
+
// from SfxItemPoolUser
virtual void ObjectInDestruction(const SfxItemPool& rSfxItemPool);
};
diff --git a/svx/source/editeng/edtspell.cxx b/svx/source/editeng/edtspell.cxx
index cad0602529..2fb92641ef 100644
--- a/svx/source/editeng/edtspell.cxx
+++ b/svx/source/editeng/edtspell.cxx
@@ -476,6 +476,31 @@ WrongList* WrongList::Clone() const
return pNew;
}
+// #i102062#
+bool WrongList::operator==(const WrongList& rCompare) const
+{
+ // cleck direct members
+ if(GetInvalidStart() != rCompare.GetInvalidStart()
+ || GetInvalidEnd() != rCompare.GetInvalidEnd()
+ || Count() != rCompare.Count())
+ {
+ return false;
+ }
+
+ for(USHORT a(0); a < Count(); a++)
+ {
+ const WrongRange& rCandA(GetObject(a));
+ const WrongRange& rCandB(rCompare.GetObject(a));
+
+ if(rCandA.nStart != rCandB.nStart
+ || rCandA.nEnd != rCandB.nEnd)
+ {
+ return false;
+ }
+ }
+
+ return true;
+}
#ifdef DBG_UTIL
sal_Bool WrongList::DbgIsBuggy() const
diff --git a/svx/source/editeng/eertfpar.cxx b/svx/source/editeng/eertfpar.cxx
index b4e504b829..65c1b6c516 100644
--- a/svx/source/editeng/eertfpar.cxx
+++ b/svx/source/editeng/eertfpar.cxx
@@ -43,6 +43,19 @@
#include <svtools/rtftoken.h>
+// alle Werte auf default; wird nach einlesen der Bitmap aufgerufen !
+void SvxRTFPictureType::ResetValues()
+{ // setze alle Werte RTF-Defaults
+ eStyle = RTF_BITMAP;
+ nMode = HEX_MODE;
+ nType = nGoalWidth = nGoalHeight = 0;
+ nWidth = nHeight = nWidthBytes = 0;
+ uPicLen = 0;
+ nBitsPerPixel = nPlanes = 1;
+ nScalX = nScalY = 100; // Skalierung in Prozent
+ nCropT = nCropB = nCropL = nCropR = 0;
+}
+
ImportInfo::ImportInfo( ImportState eSt, SvParser* pPrsrs, const ESelection& rSel )
: aSelection( rSel )
{
diff --git a/svx/source/editeng/impedit.cxx b/svx/source/editeng/impedit.cxx
index 72dd53d026..51dff075be 100644
--- a/svx/source/editeng/impedit.cxx
+++ b/svx/source/editeng/impedit.cxx
@@ -670,6 +670,8 @@ void ImpEditView::ShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor, US
USHORT nTextPortionStart = 0;
USHORT nPara = pEditEngine->pImpEditEngine->aEditDoc.GetPos( aPaM.GetNode() );
+ if (nPara == USHRT_MAX) // #i94322
+ return;
ParaPortion* pParaPortion = pEditEngine->pImpEditEngine->GetParaPortions().GetObject( nPara );
nShowCursorFlags |= nExtraCursorFlags;
diff --git a/svx/source/editeng/impedit.hxx b/svx/source/editeng/impedit.hxx
index 9a1f3002f8..adf6afb7c2 100644
--- a/svx/source/editeng/impedit.hxx
+++ b/svx/source/editeng/impedit.hxx
@@ -812,7 +812,9 @@ public:
sal_uInt32 CalcTextWidth( BOOL bIgnoreExtraSpace );
sal_uInt32 CalcLineWidth( ParaPortion* pPortion, EditLine* pLine, BOOL bIgnoreExtraSpace );
sal_uInt16 GetLineCount( sal_uInt16 nParagraph ) const;
- sal_uInt16 GetLineLen( sal_uInt16 nParagraph, sal_uInt16 nLine ) const;
+ sal_uInt16 GetLineLen( sal_uInt16 nParagraph, sal_uInt16 nLine ) const;
+ void GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT nParagraph, USHORT nLine ) const;
+ USHORT GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const;
sal_uInt16 GetLineHeight( sal_uInt16 nParagraph, sal_uInt16 nLine );
sal_uInt32 GetParaHeight( sal_uInt16 nParagraph );
diff --git a/svx/source/editeng/impedit2.cxx b/svx/source/editeng/impedit2.cxx
index ed4c843d82..6be5fc0ef0 100644
--- a/svx/source/editeng/impedit2.cxx
+++ b/svx/source/editeng/impedit2.cxx
@@ -1777,7 +1777,7 @@ void ImpEditEngine::InitScriptTypes( USHORT nPara )
::rtl::OUString aOUText( aText );
USHORT nTextLen = (USHORT)aOUText.getLength();
- long nPos = 0;
+ sal_Int32 nPos = 0;
short nScriptType = _xBI->getScriptType( aOUText, nPos );
rTypes.Insert( ScriptTypePosInfo( nScriptType, (USHORT)nPos, nTextLen ), rTypes.Count() );
nPos = _xBI->endOfScript( aOUText, nPos, nScriptType );
@@ -1795,6 +1795,17 @@ void ImpEditEngine::InitScriptTypes( USHORT nPara )
}
else
{
+ if ( _xBI->getScriptType( aOUText, nPos - 1 ) == i18n::ScriptType::WEAK )
+ {
+ switch ( u_charType(aOUText.iterateCodePoints(&nPos, 0) ) ) {
+ case U_NON_SPACING_MARK:
+ case U_ENCLOSING_MARK:
+ case U_COMBINING_SPACING_MARK:
+ --nPos;
+ rTypes[rTypes.Count()-1].nEndPos--;
+ break;
+ }
+ }
rTypes.Insert( ScriptTypePosInfo( nScriptType, (USHORT)nPos, nTextLen ), rTypes.Count() );
}
@@ -3289,9 +3300,9 @@ USHORT ImpEditEngine::GetLineCount( USHORT nParagraph ) const
xub_StrLen ImpEditEngine::GetLineLen( USHORT nParagraph, USHORT nLine ) const
{
- DBG_ASSERT( nParagraph < GetParaPortions().Count(), "GetLineCount: Out of range" );
+ DBG_ASSERT( nParagraph < GetParaPortions().Count(), "GetLineLen: Out of range" );
ParaPortion* pPPortion = GetParaPortions().SaveGetObject( nParagraph );
- DBG_ASSERT( pPPortion, "Absatz nicht gefunden: GetLineHeight" );
+ DBG_ASSERT( pPPortion, "Absatz nicht gefunden: GetLineLen" );
if ( pPPortion && ( nLine < pPPortion->GetLines().Count() ) )
{
EditLine* pLine = pPPortion->GetLines().GetObject( nLine );
@@ -3302,6 +3313,48 @@ xub_StrLen ImpEditEngine::GetLineLen( USHORT nParagraph, USHORT nLine ) const
return 0xFFFF;
}
+void ImpEditEngine::GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT nParagraph, USHORT nLine ) const
+{
+ DBG_ASSERT( nParagraph < GetParaPortions().Count(), "GetLineCount: Out of range" );
+ ParaPortion* pPPortion = GetParaPortions().SaveGetObject( nParagraph );
+ DBG_ASSERT( pPPortion, "Absatz nicht gefunden: GetLineBoundaries" );
+ rStart = rEnd = 0xFFFF; // default values in case of error
+ if ( pPPortion && ( nLine < pPPortion->GetLines().Count() ) )
+ {
+ EditLine* pLine = pPPortion->GetLines().GetObject( nLine );
+ DBG_ASSERT( pLine, "Zeile nicht gefunden: GetLineBoundaries" );
+ rStart = pLine->GetStart();
+ rEnd = pLine->GetEnd();
+ }
+}
+
+USHORT ImpEditEngine::GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const
+{
+ USHORT nLineNo = 0xFFFF;
+ ContentNode* pNode = GetEditDoc().SaveGetObject( nPara );
+ DBG_ASSERT( pNode, "GetLineNumberAtIndex: invalid paragraph index" );
+ if (pNode)
+ {
+ // we explicitly allow for the index to point at the character right behind the text
+ const bool bValidIndex = /*0 <= nIndex &&*/ nIndex <= pNode->Len();
+ DBG_ASSERT( bValidIndex, "GetLineNumberAtIndex: invalid index" );
+ const USHORT nLineCount = GetLineCount( nPara );
+ if (nIndex == pNode->Len())
+ nLineNo = nLineCount > 0 ? nLineCount - 1 : 0;
+ else if (bValidIndex) // nIndex < pNode->Len()
+ {
+ USHORT nStart = USHRT_MAX, nEnd = USHRT_MAX;
+ for (USHORT i = 0; i < nLineCount && nLineNo == 0xFFFF; ++i)
+ {
+ GetLineBoundaries( nStart, nEnd, nPara, i );
+ if (nStart <= nIndex && nIndex < nEnd)
+ nLineNo = i;
+ }
+ }
+ }
+ return nLineNo;
+}
+
USHORT ImpEditEngine::GetLineHeight( USHORT nParagraph, USHORT nLine )
{
DBG_ASSERT( nParagraph < GetParaPortions().Count(), "GetLineCount: Out of range" );
diff --git a/svx/source/engine3d/helperhittest3d.cxx b/svx/source/engine3d/helperhittest3d.cxx
index 634fd8cc7f..401111be85 100644
--- a/svx/source/engine3d/helperhittest3d.cxx
+++ b/svx/source/engine3d/helperhittest3d.cxx
@@ -92,7 +92,12 @@ namespace drawinglayer
basegfx::B3DPoint maBack;
// the found cut points
- ::std::vector< basegfx::B3DPoint > mo_rResult;
+ ::std::vector< basegfx::B3DPoint > maResult;
+
+ // #i102956# the transformation change from TransformPrimitive3D processings
+ // needs to be remembered to be able to transform found cuts to the
+ // basic coordinate system the processor starts with
+ basegfx::B3DHomMatrix maCombinedTransform;
// as tooling, the process() implementation takes over API handling and calls this
// virtual render method when the primitive implementation is BasePrimitive3D-based.
@@ -105,11 +110,12 @@ namespace drawinglayer
: BaseProcessor3D(rViewInformation),
maFront(rFront),
maBack(rBack),
- mo_rResult()
+ maResult(),
+ maCombinedTransform()
{}
// data access
- const ::std::vector< basegfx::B3DPoint >& getCutPoints() const { return mo_rResult; }
+ const ::std::vector< basegfx::B3DPoint >& getCutPoints() const { return maResult; }
};
void CutFindProcessor::processBasePrimitive3D(const primitive3d::BasePrimitive3D& rCandidate)
@@ -119,9 +125,8 @@ namespace drawinglayer
{
case PRIMITIVE3D_ID_TRANSFORMPRIMITIVE3D :
{
- // transform group. Remember current transformations
+ // transform group.
const primitive3d::TransformPrimitive3D& rPrimitive = static_cast< const primitive3d::TransformPrimitive3D& >(rCandidate);
- const geometry::ViewInformation3D aLastViewInformation3D(getViewInformation3D());
// remember old and transform front, back to object coordinates
const basegfx::B3DPoint aLastFront(maFront);
@@ -131,7 +136,8 @@ namespace drawinglayer
maFront *= aInverseTrans;
maBack *= aInverseTrans;
- // create new transformation; add new object transform from right side
+ // remember current and create new transformation; add new object transform from right side
+ const geometry::ViewInformation3D aLastViewInformation3D(getViewInformation3D());
const geometry::ViewInformation3D aNewViewInformation3D(
aLastViewInformation3D.getObjectTransformation() * rPrimitive.getTransformation(),
aLastViewInformation3D.getOrientation(),
@@ -141,10 +147,15 @@ namespace drawinglayer
aLastViewInformation3D.getExtendedInformationSequence());
updateViewInformation(aNewViewInformation3D);
+ // #i102956# remember needed back-transform for found cuts (combine from right side)
+ const basegfx::B3DHomMatrix aLastCombinedTransform(maCombinedTransform);
+ maCombinedTransform = maCombinedTransform * rPrimitive.getTransformation();
+
// let break down
process(rPrimitive.getChildren());
// restore transformations and front, back
+ maCombinedTransform = aLastCombinedTransform;
updateViewInformation(aLastViewInformation3D);
maFront = aLastFront;
maBack = aLastBack;
@@ -207,7 +218,10 @@ namespace drawinglayer
if(basegfx::tools::isInside(rPolyPolygon, aCutPoint, false))
{
- mo_rResult.push_back(aCutPoint);
+ // #i102956# add result. Do not forget to do this in the coordinate
+ // system the processor get started with, so use the collected
+ // combined transformation from processed TransformPrimitive3D's
+ maResult.push_back(maCombinedTransform * aCutPoint);
}
}
}
@@ -376,9 +390,9 @@ SVX_DLLPUBLIC void getAllHit3DObjectsSortedFrontToBack(
::std::vector< basegfx::B3DPoint > aHitsWithObject;
getAllHit3DObjectWithRelativePoint(aFront, aBack, *pCandidate, aViewInfo3D, aHitsWithObject);
- if(aHitsWithObject.size())
+ for(sal_uInt32 a(0); a < aHitsWithObject.size(); a++)
{
- const basegfx::B3DPoint aPointInViewCoordinates(aViewInfo3D.getObjectToView() * aHitsWithObject[0]);
+ const basegfx::B3DPoint aPointInViewCoordinates(aViewInfo3D.getObjectToView() * aHitsWithObject[a]);
aDepthAndObjectResults.push_back(ImplPairDephAndObject(pCandidate, aPointInViewCoordinates.getZ()));
}
}
diff --git a/svx/source/engine3d/makefile.mk b/svx/source/engine3d/makefile.mk
index 4c03f949e9..bb590bd76c 100644
--- a/svx/source/engine3d/makefile.mk
+++ b/svx/source/engine3d/makefile.mk
@@ -33,6 +33,7 @@ PRJ=..$/..
PRJNAME=svx
TARGET=engine3d
+LIBTARGET=NO
ENABLE_EXCEPTIONS=TRUE
# --- Settings -----------------------------------------------------
@@ -42,7 +43,8 @@ ENABLE_EXCEPTIONS=TRUE
# --- Files --------------------------------------------------------
-SLOFILES= \
+LIB1TARGET= $(SLB)$/$(TARGET)-core.lib
+LIB1OBJFILES= \
$(SLO)$/e3dsceneupdater.obj \
$(SLO)$/helperminimaldepth3d.obj \
$(SLO)$/helperhittest3d.obj \
@@ -57,16 +59,21 @@ SLOFILES= \
$(SLO)$/svx3ditems.obj \
$(SLO)$/deflt3d.obj \
$(SLO)$/e3dundo.obj \
- $(SLO)$/volume3d.obj \
- $(SLO)$/viewpt3d.obj \
$(SLO)$/viewpt3d2.obj \
$(SLO)$/camera3d.obj \
$(SLO)$/objfac3d.obj \
$(SLO)$/dragmt3d.obj \
$(SLO)$/view3d.obj \
- $(SLO)$/view3d1.obj \
+ $(SLO)$/view3d1.obj
+
+LIB2TARGET= $(SLB)$/$(TARGET).lib
+LIB2OBJFILES= \
+ $(SLO)$/volume3d.obj \
+ $(SLO)$/viewpt3d.obj \
$(SLO)$/float3d.obj
+SLOFILES = $(LIB1OBJFILES) $(LIB2OBJFILES)
+
#disable optimizer for MSCompiler and ICC
.IF "$(COM)"=="ICC" || "$(COM)"=="MSC"
NOOPTFILES=\
diff --git a/svx/source/engine3d/obj3d.cxx b/svx/source/engine3d/obj3d.cxx
index bc26b8f4b4..85c35f03cb 100644
--- a/svx/source/engine3d/obj3d.cxx
+++ b/svx/source/engine3d/obj3d.cxx
@@ -1206,22 +1206,6 @@ void E3dCompoundObject::operator=(const SdrObject& rObj)
/*************************************************************************
|*
-|* Hittest fuer 3D-Objekte, wird an Geometrie weitergegeben
-|*
-\************************************************************************/
-
-SdrObject* E3dCompoundObject::CheckHit(const Point& rPnt, USHORT /*nTol*/, const SetOfByte* /*pVisiLayer*/) const
-{
- if(checkHitSingle3DObject(basegfx::B2DPoint(rPnt.X(), rPnt.Y()), *this))
- {
- return const_cast< E3dCompoundObject* >(this);
- }
-
- return 0;
-}
-
-/*************************************************************************
-|*
|* Parameter Geometrieerzeugung setzen
|*
\************************************************************************/
diff --git a/svx/source/engine3d/scene3d.cxx b/svx/source/engine3d/scene3d.cxx
index d29984c42d..5079f527bc 100644
--- a/svx/source/engine3d/scene3d.cxx
+++ b/svx/source/engine3d/scene3d.cxx
@@ -538,6 +538,19 @@ void E3dScene::operator=(const SdrObject& rObj)
// #110988#
ImpCleanup3DDepthMapper();
+
+ // #i101941#
+ // After a Scene as model object is cloned, the used
+ // ViewContactOfE3dScene is created and partially used
+ // to calculate Bound/SnapRects, but - since quite some
+ // values are buffered at the VC - not really well
+ // initialized. It would be possible to always watch for
+ // preconditions of buffered data, but this would be expensive
+ // and would create a lot of short living data structures.
+ // It is currently better to flush that data, e.g. by using
+ // ActionChanged at the VC which will for this class
+ // flush that cached data and initalize it's valid reconstruction
+ GetViewContact().ActionChanged();
}
/*************************************************************************
diff --git a/svx/source/fmcomp/dbaexchange.cxx b/svx/source/fmcomp/dbaexchange.cxx
index bfc819f113..04a2b30b40 100644
--- a/svx/source/fmcomp/dbaexchange.cxx
+++ b/svx/source/fmcomp/dbaexchange.cxx
@@ -61,7 +61,6 @@ namespace svx
using namespace ::com::sun::star::sdbcx;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::datatransfer;
- using namespace ::svxform;
using namespace ::comphelper;
//====================================================================
diff --git a/svx/source/fmcomp/dbaobjectex.cxx b/svx/source/fmcomp/dbaobjectex.cxx
index d9e67ac2b2..d30ba00e27 100644
--- a/svx/source/fmcomp/dbaobjectex.cxx
+++ b/svx/source/fmcomp/dbaobjectex.cxx
@@ -60,7 +60,6 @@ namespace svx
using namespace ::com::sun::star::sdbcx;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::datatransfer;
- using namespace ::svxform;
using namespace ::comphelper;
//====================================================================
diff --git a/svx/source/fmcomp/fmgridif.cxx b/svx/source/fmcomp/fmgridif.cxx
index 0b86ce9921..649a9f4fa1 100644
--- a/svx/source/fmcomp/fmgridif.cxx
+++ b/svx/source/fmcomp/fmgridif.cxx
@@ -1919,9 +1919,9 @@ void FmXGridPeer::setProperty( const ::rtl::OUString& PropertyName, const Any& V
sal_Bool bVoid = !Value.hasValue();
- if ( 0 == PropertyName.compareToAscii( FM_PROP_TEXTLINECOLOR ) )
+ if ( 0 == PropertyName.compareTo( FM_PROP_TEXTLINECOLOR ) )
{
- ::Color aTextLineColor(::comphelper::getINT32(Value));
+ ::Color aTextLineColor( bVoid ? COL_TRANSPARENT : ::comphelper::getINT32( Value ) );
if (bVoid)
{
pGrid->SetTextLineColor();
@@ -1953,21 +1953,21 @@ void FmXGridPeer::setProperty( const ::rtl::OUString& PropertyName, const Any& V
if (isDesignMode())
pGrid->Invalidate();
}
- else if ( 0 == PropertyName.compareToAscii( FM_PROP_FONTEMPHASISMARK ) )
+ else if ( 0 == PropertyName.compareTo( FM_PROP_FONTEMPHASISMARK ) )
{
Font aGridFont = pGrid->GetControlFont();
sal_Int16 nValue = ::comphelper::getINT16(Value);
aGridFont.SetEmphasisMark( nValue );
pGrid->SetControlFont( aGridFont );
}
- else if ( 0 == PropertyName.compareToAscii( FM_PROP_FONTRELIEF ) )
+ else if ( 0 == PropertyName.compareTo( FM_PROP_FONTRELIEF ) )
{
Font aGridFont = pGrid->GetControlFont();
sal_Int16 nValue = ::comphelper::getINT16(Value);
aGridFont.SetRelief( (FontRelief)nValue );
pGrid->SetControlFont( aGridFont );
}
- else if ( 0 == PropertyName.compareToAscii( FM_PROP_HELPURL ) )
+ else if ( 0 == PropertyName.compareTo( FM_PROP_HELPURL ) )
{
String sHelpURL(::comphelper::getString(Value));
String sPattern;
@@ -1978,11 +1978,11 @@ void FmXGridPeer::setProperty( const ::rtl::OUString& PropertyName, const Any& V
pGrid->SetHelpId(sID.ToInt32());
}
}
- else if ( 0 == PropertyName.compareToAscii( FM_PROP_DISPLAYSYNCHRON ) )
+ else if ( 0 == PropertyName.compareTo( FM_PROP_DISPLAYSYNCHRON ) )
{
pGrid->setDisplaySynchron(::comphelper::getBOOL(Value));
}
- else if ( 0 == PropertyName.compareToAscii( FM_PROP_CURSORCOLOR ) )
+ else if ( 0 == PropertyName.compareTo( FM_PROP_CURSORCOLOR ) )
{
if (bVoid)
pGrid->SetCursorColor(COL_TRANSPARENT);
@@ -1991,13 +1991,13 @@ void FmXGridPeer::setProperty( const ::rtl::OUString& PropertyName, const Any& V
if (isDesignMode())
pGrid->Invalidate();
}
- else if ( 0 == PropertyName.compareToAscii( FM_PROP_ALWAYSSHOWCURSOR ) )
+ else if ( 0 == PropertyName.compareTo( FM_PROP_ALWAYSSHOWCURSOR ) )
{
pGrid->EnablePermanentCursor(::comphelper::getBOOL(Value));
if (isDesignMode())
pGrid->Invalidate();
}
- else if ( 0 == PropertyName.compareToAscii( FM_PROP_FONT ) )
+ else if ( 0 == PropertyName.compareTo( FM_PROP_FONT ) )
{
if ( bVoid )
pGrid->SetControlFont( Font() );
@@ -2031,7 +2031,7 @@ void FmXGridPeer::setProperty( const ::rtl::OUString& PropertyName, const Any& V
}
}
}
- else if ( 0 == PropertyName.compareToAscii( FM_PROP_BACKGROUNDCOLOR ) )
+ else if ( 0 == PropertyName.compareTo( FM_PROP_BACKGROUNDCOLOR ) )
{
if ( bVoid )
{
@@ -2044,7 +2044,7 @@ void FmXGridPeer::setProperty( const ::rtl::OUString& PropertyName, const Any& V
pGrid->SetControlBackground( aColor );
}
}
- else if ( 0 == PropertyName.compareToAscii( FM_PROP_TEXTCOLOR ) )
+ else if ( 0 == PropertyName.compareTo( FM_PROP_TEXTCOLOR ) )
{
if ( bVoid )
{
@@ -2057,7 +2057,7 @@ void FmXGridPeer::setProperty( const ::rtl::OUString& PropertyName, const Any& V
pGrid->SetControlForeground( aColor );
}
}
- else if ( 0 == PropertyName.compareToAscii( FM_PROP_ROWHEIGHT ) )
+ else if ( 0 == PropertyName.compareTo( FM_PROP_ROWHEIGHT ) )
{
sal_Int32 nLogHeight(0);
if (Value >>= nLogHeight)
@@ -2070,17 +2070,17 @@ void FmXGridPeer::setProperty( const ::rtl::OUString& PropertyName, const Any& V
else if (bVoid)
pGrid->SetDataRowHeight(0);
}
- else if ( 0 == PropertyName.compareToAscii( FM_PROP_HASNAVIGATION ) )
+ else if ( 0 == PropertyName.compareTo( FM_PROP_HASNAVIGATION ) )
{
if (Value.getValueType() == ::getBooleanCppuType())
pGrid->EnableNavigationBar(*(sal_Bool*)Value.getValue());
}
- else if ( 0 == PropertyName.compareToAscii( FM_PROP_RECORDMARKER ) )
+ else if ( 0 == PropertyName.compareTo( FM_PROP_RECORDMARKER ) )
{
if (Value.getValueType() == ::getBooleanCppuType())
pGrid->EnableHandle(*(sal_Bool*)Value.getValue());
}
- else if ( 0 == PropertyName.compareToAscii( FM_PROP_ENABLED ) )
+ else if ( 0 == PropertyName.compareTo( FM_PROP_ENABLED ) )
{
if (Value.getValueType() == ::getBooleanCppuType())
{
@@ -2134,37 +2134,37 @@ Any FmXGridPeer::getProperty( const ::rtl::OUString& _rPropertyName ) throw( Run
FmGridControl* pGrid = (FmGridControl*) GetWindow();
Window* pDataWindow = &pGrid->GetDataWindow();
- if ( 0 == _rPropertyName.compareToAscii( FM_PROP_NAME ) )
+ if ( 0 == _rPropertyName.compareTo( FM_PROP_NAME ) )
{
Font aFont = pDataWindow->GetControlFont();
aProp <<= ImplCreateFontDescriptor( aFont );
}
- else if ( 0 == _rPropertyName.compareToAscii( FM_PROP_TEXTCOLOR ) )
+ else if ( 0 == _rPropertyName.compareTo( FM_PROP_TEXTCOLOR ) )
{
aProp <<= (sal_Int32)pDataWindow->GetControlForeground().GetColor();
}
- else if ( 0 == _rPropertyName.compareToAscii( FM_PROP_BACKGROUNDCOLOR ) )
+ else if ( 0 == _rPropertyName.compareTo( FM_PROP_BACKGROUNDCOLOR ) )
{
aProp <<= (sal_Int32)pDataWindow->GetControlBackground().GetColor();
}
- else if ( 0 == _rPropertyName.compareToAscii( FM_PROP_ROWHEIGHT ) )
+ else if ( 0 == _rPropertyName.compareTo( FM_PROP_ROWHEIGHT ) )
{
sal_Int32 nPixelHeight = pGrid->GetDataRowHeight();
// take the zoom factor into account
nPixelHeight = pGrid->CalcReverseZoom(nPixelHeight);
aProp <<= (sal_Int32)pGrid->PixelToLogic(Point(0,nPixelHeight),MAP_10TH_MM).Y();
}
- else if ( 0 == _rPropertyName.compareToAscii( FM_PROP_HASNAVIGATION ) )
+ else if ( 0 == _rPropertyName.compareTo( FM_PROP_HASNAVIGATION ) )
{
sal_Bool bHasNavBar = pGrid->HasNavigationBar();
aProp <<= (sal_Bool)bHasNavBar;
}
- else if ( 0 == _rPropertyName.compareToAscii( FM_PROP_RECORDMARKER ) )
+ else if ( 0 == _rPropertyName.compareTo( FM_PROP_RECORDMARKER ) )
{
sal_Bool bHasHandle = pGrid->HasHandle();
aProp <<= (sal_Bool)bHasHandle;
}
- else if ( 0 == _rPropertyName.compareToAscii( FM_PROP_ENABLED ) )
+ else if ( 0 == _rPropertyName.compareTo( FM_PROP_ENABLED ) )
{
aProp <<= (sal_Bool)pDataWindow->IsEnabled();
}
@@ -2948,7 +2948,7 @@ IMPL_LINK(FmXGridPeer, OnExecuteGridSlot, void*, pSlot)
if (m_pDispatchers[i].is())
{
// commit any changes done so far, if it's not the undoRecord URL
- if ( 0 == pUrls->Complete.compareToAscii( FMURL_RECORD_UNDO ) || commit() )
+ if ( 0 == pUrls->Complete.compareTo( FMURL_RECORD_UNDO ) || commit() )
m_pDispatchers[i]->dispatch(*pUrls, Sequence< PropertyValue>());
return 1; // handled
diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx
index a1e98b9a00..0442a5e1e8 100644
--- a/svx/source/fmcomp/gridcell.cxx
+++ b/svx/source/fmcomp/gridcell.cxx
@@ -55,6 +55,7 @@
#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
#include <com/sun/star/container/XNamed.hpp>
#include <com/sun/star/awt/LineEndFormat.hpp>
+#include <com/sun/star/awt/MouseWheelBehavior.hpp>
#ifndef _COM_SUN_STAR_SCRTIP_XEVENTATTACHERMANAGER_HPP_
#include <com/sun/star/script/XEventAttacherManager.hpp>
#endif
@@ -90,9 +91,9 @@ using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::sdb;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::form;
-using ::com::sun::star::util::XNumberFormatter;
using ::com::sun::star::util::XNumberFormatter;
+namespace MouseWheelBehavior = ::com::sun::star::awt::MouseWheelBehavior;
String INVALIDTEXT = String::CreateFromAscii("###");
String OBJECTTEXT = String::CreateFromAscii("<OBJECT>");
@@ -650,10 +651,10 @@ void DbCellControl::_propertyChanged(const PropertyChangeEvent& _rEvent) throw(R
Reference< XPropertySet > xSourceProps( _rEvent.Source, UNO_QUERY );
- if ( _rEvent.PropertyName.equalsAscii( FM_PROP_VALUE )
- || _rEvent.PropertyName.equalsAscii( FM_PROP_STATE )
- || _rEvent.PropertyName.equalsAscii( FM_PROP_TEXT )
- || _rEvent.PropertyName.equalsAscii( FM_PROP_EFFECTIVE_VALUE )
+ if ( _rEvent.PropertyName.equals( FM_PROP_VALUE )
+ || _rEvent.PropertyName.equals( FM_PROP_STATE )
+ || _rEvent.PropertyName.equals( FM_PROP_TEXT )
+ || _rEvent.PropertyName.equals( FM_PROP_EFFECTIVE_VALUE )
)
{ // it was one of the known "value" properties
if ( !isValuePropertyLocked() )
@@ -661,11 +662,11 @@ void DbCellControl::_propertyChanged(const PropertyChangeEvent& _rEvent) throw(R
implValuePropertyChanged( );
}
}
- else if ( _rEvent.PropertyName.equalsAscii( FM_PROP_READONLY ) )
+ else if ( _rEvent.PropertyName.equals( FM_PROP_READONLY ) )
{
implAdjustReadOnly( xSourceProps );
}
- else if ( _rEvent.PropertyName.equalsAscii( FM_PROP_ENABLED ) )
+ else if ( _rEvent.PropertyName.equals( FM_PROP_ENABLED ) )
{
implAdjustEnabled( xSourceProps );
}
@@ -836,22 +837,40 @@ void DbCellControl::Init( Window& rParent, const Reference< XRowSet >& _rxCursor
try
{
// some other common properties
- Reference< XPropertySet > xModel( m_rColumn.getModel() );
- Reference< XPropertySetInfo > xModelPSI;
- if ( xModel.is() )
- xModelPSI = xModel->getPropertySetInfo();
+ Reference< XPropertySet > xModel( m_rColumn.getModel(), UNO_SET_THROW );
+ Reference< XPropertySetInfo > xModelPSI( xModel->getPropertySetInfo(), UNO_SET_THROW );
- // the "readonly" state
- if ( xModelPSI.is() && xModelPSI->hasPropertyByName( FM_PROP_READONLY ) )
+ if ( xModelPSI->hasPropertyByName( FM_PROP_READONLY ) )
{
implAdjustReadOnly( xModel );
}
- // the "enabled" flag
- if ( xModelPSI.is() && xModelPSI->hasPropertyByName( FM_PROP_ENABLED ) )
+ if ( xModelPSI->hasPropertyByName( FM_PROP_ENABLED ) )
{
implAdjustEnabled( xModel );
}
+
+ if ( xModelPSI->hasPropertyByName( FM_PROP_MOUSE_WHEEL_BEHAVIOR ) )
+ {
+ sal_Int16 nWheelBehavior = MouseWheelBehavior::SCROLL_FOCUS_ONLY;
+ OSL_VERIFY( xModel->getPropertyValue( FM_PROP_MOUSE_WHEEL_BEHAVIOR ) >>= nWheelBehavior );
+ USHORT nVclSetting = MOUSE_WHEEL_FOCUS_ONLY;
+ switch ( nWheelBehavior )
+ {
+ case MouseWheelBehavior::SCROLL_DISABLED: nVclSetting = MOUSE_WHEEL_DISABLE; break;
+ case MouseWheelBehavior::SCROLL_FOCUS_ONLY: nVclSetting = MOUSE_WHEEL_FOCUS_ONLY; break;
+ case MouseWheelBehavior::SCROLL_ALWAYS: nVclSetting = MOUSE_WHEEL_ALWAYS; break;
+ default:
+ OSL_ENSURE( false, "DbCellControl::Init: invalid MouseWheelBehavior!" );
+ break;
+ }
+
+ AllSettings aSettings = m_pWindow->GetSettings();
+ MouseSettings aMouseSettings = aSettings.GetMouseSettings();
+ aMouseSettings.SetWheelBehavior( nVclSetting );
+ aSettings.SetMouseSettings( aMouseSettings );
+ m_pWindow->SetSettings( aSettings, TRUE );
+ }
}
catch( const Exception& )
{
@@ -2410,7 +2429,7 @@ DbComboBox::DbComboBox(DbGridColumn& _rColumn)
//------------------------------------------------------------------------------
void DbComboBox::_propertyChanged( const PropertyChangeEvent& _rEvent ) throw( RuntimeException )
{
- if ( _rEvent.PropertyName.equalsAscii( FM_PROP_STRINGITEMLIST ) )
+ if ( _rEvent.PropertyName.equals( FM_PROP_STRINGITEMLIST ) )
{
SetList(_rEvent.NewValue);
}
@@ -2539,7 +2558,7 @@ DbListBox::DbListBox(DbGridColumn& _rColumn)
//------------------------------------------------------------------------------
void DbListBox::_propertyChanged( const ::com::sun::star::beans::PropertyChangeEvent& _rEvent ) throw( RuntimeException )
{
- if ( _rEvent.PropertyName.equalsAscii( FM_PROP_STRINGITEMLIST ) )
+ if ( _rEvent.PropertyName.equals( FM_PROP_STRINGITEMLIST ) )
{
SetList(_rEvent.NewValue);
}
diff --git a/svx/source/fmcomp/gridcols.cxx b/svx/source/fmcomp/gridcols.cxx
index 2fc232f55b..561be8ab69 100644
--- a/svx/source/fmcomp/gridcols.cxx
+++ b/svx/source/fmcomp/gridcols.cxx
@@ -36,23 +36,6 @@
#include "fmservs.hxx"
#include "fmtools.hxx"
-namespace svxform
-{
-
- IMPLEMENT_CONSTASCII_USTRING(FM_COL_TEXTFIELD, "TextField");
- IMPLEMENT_CONSTASCII_USTRING(FM_COL_COMBOBOX, "ComboBox");
- IMPLEMENT_CONSTASCII_USTRING(FM_COL_CHECKBOX, "CheckBox");
- IMPLEMENT_CONSTASCII_USTRING(FM_COL_TIMEFIELD, "TimeField");
- IMPLEMENT_CONSTASCII_USTRING(FM_COL_DATEFIELD, "DateField");
- IMPLEMENT_CONSTASCII_USTRING(FM_COL_NUMERICFIELD, "NumericField");
- IMPLEMENT_CONSTASCII_USTRING(FM_COL_CURRENCYFIELD, "CurrencyField");
- IMPLEMENT_CONSTASCII_USTRING(FM_COL_PATTERNFIELD, "PatternField");
- IMPLEMENT_CONSTASCII_USTRING(FM_COL_LISTBOX, "ListBox");
- IMPLEMENT_CONSTASCII_USTRING(FM_COL_FORMATTEDFIELD, "FormattedField");
-
-} // namespace svxform
-using namespace ::svxform;
-
//------------------------------------------------------------------------------
const ::comphelper::StringSequence& getColumnTypes()
{
@@ -81,7 +64,7 @@ sal_Int32 getColumnTypeByModelName(const ::rtl::OUString& aModelName)
const ::rtl::OUString aCompatibleModelPrefix = ::rtl::OUString::createFromAscii("stardiv.one.form.component.");
sal_Int32 nTypeId = -1;
- if (aModelName == ::svxform::FM_COMPONENT_EDIT)
+ if (aModelName == FM_COMPONENT_EDIT)
nTypeId = TYPE_TEXTFIELD;
else
{
diff --git a/svx/source/fmcomp/makefile.mk b/svx/source/fmcomp/makefile.mk
index a2387ef180..1e86308f9c 100644
--- a/svx/source/fmcomp/makefile.mk
+++ b/svx/source/fmcomp/makefile.mk
@@ -33,6 +33,7 @@ PRJ=..$/..
PRJNAME=svx
TARGET=fmcomp
+LIBTARGET=NO
ENABLE_EXCEPTIONS=TRUE
@@ -48,25 +49,20 @@ SRC1FILES= \
gridctrl.src \
showcols.src
-#SLOFILES= \
-# $(SLO)$/dbaexchange.obj \
-# $(SLO)$/gridcols.obj \
-# $(SLO)$/gridctrl.obj \
-# $(SLO)$/gridcell.obj \
-# $(SLO)$/fmgridcl.obj \
-# $(SLO)$/fmgridif.obj \
-# $(SLO)$/trace.obj
-
-SLOFILES= \
+LIB1TARGET= $(SLB)$/$(TARGET)-core.lib
+LIB1OBJFILES= \
$(SLO)$/dbaexchange.obj \
- $(SLO)$/dbaobjectex.obj \
$(SLO)$/gridcols.obj \
$(SLO)$/gridctrl.obj \
$(SLO)$/gridcell.obj \
$(SLO)$/fmgridcl.obj \
$(SLO)$/fmgridif.obj \
- $(SLO)$/trace.obj \
+ $(SLO)$/trace.obj \
$(SLO)$/xmlexchg.obj
+LIB2TARGET= $(SLB)$/$(TARGET).lib
+LIB2OBJFILES= \
+ $(SLO)$/dbaobjectex.obj
+
.INCLUDE : target.mk
diff --git a/svx/source/form/fmprop.cxx b/svx/source/form/fmprop.cxx
deleted file mode 100644
index 63342725ff..0000000000
--- a/svx/source/form/fmprop.cxx
+++ /dev/null
@@ -1,194 +0,0 @@
-/*************************************************************************
- *
- * 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: fmprop.cxx,v $
- * $Revision: 1.22 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifndef _SVX_FMPROP_HRC
-#include "fmprop.hrc"
-#endif
-#include "fmstatic.hxx"
-
-#include <set>
-
-namespace svxform
-{
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_NAME,"Name");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CLASSID,"ClassId");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ROWCOUNT,"RowCount");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ROWCOUNTFINAL,"IsRowCountFinal");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_FETCHSIZE,"FetchSize");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_VALUE,"Value");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_TEXT,"Text");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_LABEL,"Label");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CANINSERT,"CanInsert");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CANUPDATE,"CanUpdate");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CANDELETE,"CanDelete");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_NAVIGATION,"NavigationBarMode");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_HASNAVIGATION,"HasNavigationBar");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CYCLE,"Cycle");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CONTROLSOURCE,"DataField");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ENABLED,"Enabled");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_READONLY,"ReadOnly");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ISREADONLY,"IsReadOnly");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_FILTER,"Filter");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_AUTOINCREMENT,"IsAutoIncrement");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DATAENTRY,"DataEntry");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_WIDTH,"Width");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_SEARCHABLE,"IsSearchable");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_MULTILINE,"MultiLine");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_TARGET_URL,"TargetURL");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DEFAULTCONTROL,"DefaultControl");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_MAXTEXTLEN,"MaxTextLen");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_EDITMASK,"EditMask");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_SPIN,"Spin");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DATE,"Date");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_TIME,"Time");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_STATE,"State");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_TRISTATE,"TriState");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_STRINGITEMLIST,"StringItemList");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DEFAULT_TEXT,"DefaultText");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DEFAULTCHECKED,"DefaultState");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_FORMATKEY,"FormatKey");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_FORMATSSUPPLIER,"FormatsSupplier");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_LISTSOURCETYPE,"ListSourceType");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_LISTSOURCE,"ListSource");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_SELECT_SEQ,"SelectedItems");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_VALUE_SEQ,"ValueItemList");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DEFAULT_SELECT_SEQ,"DefaultSelection");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ALIGN,"Align");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DEFAULT_DATE,"DefaultDate");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DEFAULT_TIME,"DefaultTime");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DEFAULT_VALUE,"DefaultValue");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DECIMAL_ACCURACY,"DecimalAccuracy");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CURSORSOURCE,"DataSelection");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CURSORSOURCETYPE,"DataSelectionType");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_FIELDTYPE,"Type");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_REFVALUE,"RefValue");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_VALUEMIN,"ValueMin");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_VALUEMAX,"ValueMax");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_STRICTFORMAT,"StrictFormat");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_LITERALMASK,"LiteralMask");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_VALUESTEP,"ValueStep");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_SHOWTHOUSANDSEP,"ShowThousandsSeparator");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CURRENCYSYMBOL,"CurrencySymbol");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DATEFORMAT,"DateFormat");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DATEMIN,"DateMin");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DATEMAX,"DateMax");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DATE_SHOW_CENTURY,"DateShowCentury");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_TIMEFORMAT, "TimeFormat");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_TIMEMIN, "TimeMin");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_TIMEMAX,"TimeMax");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_LINECOUNT,"LineCount");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_BOUNDCOLUMN, "BoundColumn");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_FONT,"FontDescriptor");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_BACKGROUNDCOLOR,"BackgroundColor");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_TEXTCOLOR,"TextColor");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_BORDER,"Border");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DROPDOWN,"Dropdown");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ROWHEIGHT,"RowHeight");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_HELPTEXT, "HelpText");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_HELPURL, "HelpURL");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_RECORDMARKER, "HasRecordMarker");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_BOUNDFIELD, "BoundField");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_EFFECTIVE_VALUE, "EffectiveValue");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_EFFECTIVE_DEFAULT, "EffectiveDefault");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_EFFECTIVE_MIN, "EffectiveMin");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_EFFECTIVE_MAX, "EffectiveMax");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_HIDDEN, "Hidden");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_FILTERPROPOSAL, "UseFilterValueProposal");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_FIELDSOURCE, "FieldSource");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_TABLENAME, "TableName");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_FILTERSUPPLIER, "FilterSupplier");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CURRENTFILTER, "CurrentFilter");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_SELECTED_FIELDS, "SelectedFields");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_SELECTED_TABLES, "SelectedTables");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_THREADSAFE, "ThreadSafe");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ISFILTERAPPLIED, "IsFilterApplied");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CONTROLLABEL, "LabelControl");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CURSORCOLOR, "CursorColor");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ALWAYSSHOWCURSOR, "AlwaysShowCursor");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DISPLAYSYNCHRON, "DisplayIsSynchron");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ISMODIFIED, "IsModified");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ISNEW, "IsNew");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_PRIVILEGES, "Privileges");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_COMMAND,"Command");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_COMMANDTYPE,"CommandType");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_RESULTSET_CONCURRENCY, "ResultSetConcurrency");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_INSERTONLY, "IgnoreResult");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_RESULTSET_TYPE, "ResultSetType");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ESCAPE_PROCESSING, "EscapeProcessing");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_APPLYFILTER, "ApplyFilter");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ISNULLABLE, "IsNullable");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ACTIVECOMMAND, "ActiveCommand");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ISCURRENCY, "IsCurrency");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_URL, "URL");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_ACTIVE_CONNECTION, "ActiveConnection");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_SORT, "Order");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_DATASOURCE, "DataSourceName");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_REALNAME,"RealName");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_CONTROLSOURCEPROPERTY,"DataFieldProperty");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_TEXTLINECOLOR, "TextLineColor");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_FONTEMPHASISMARK, "FontEmphasisMark");
- IMPLEMENT_CONSTASCII_USTRING(FM_PROP_FONTRELIEF, "FontRelief");
-
- IMPLEMENT_CONSTASCII_USTRING( FM_PROP_SCROLLVALUE_MIN, "ScrollValueMin" );
- IMPLEMENT_CONSTASCII_USTRING( FM_PROP_SCROLLVALUE_MAX, "ScrollValueMax" );
- IMPLEMENT_CONSTASCII_USTRING( FM_PROP_DEFAULT_SCROLLVALUE, "DefaultScrollValue" );
- IMPLEMENT_CONSTASCII_USTRING( FM_PROP_LINEINCREMENT, "LineIncrement" );
- IMPLEMENT_CONSTASCII_USTRING( FM_PROP_BLOCKINCREMENT, "BlockIncrement" );
- IMPLEMENT_CONSTASCII_USTRING( FM_PROP_ORIENTATION, "Orientation" );
- IMPLEMENT_CONSTASCII_USTRING( FM_PROP_REPEAT, "Repeat" );
- IMPLEMENT_CONSTASCII_USTRING( FM_PROP_REPEATDELAY, "RepeatDelay" );
- IMPLEMENT_CONSTASCII_USTRING( FM_PROP_SYMBOLCOLOR, "SymbolColor" );
- IMPLEMENT_CONSTASCII_USTRING( FM_PROP_VISIBILESIZE, "VisibleSize" );
- IMPLEMENT_CONSTASCII_USTRING( FM_PROP_SPINVALUE_MIN, "SpinValueMin" );
- IMPLEMENT_CONSTASCII_USTRING( FM_PROP_SPINVALUE_MAX, "SpinValueMax" );
- IMPLEMENT_CONSTASCII_USTRING( FM_PROP_DEFAULT_SPINVALUE, "DefaultSpinValue" );
- IMPLEMENT_CONSTASCII_USTRING( FM_PROP_SPININCREMENT, "SpinIncrement" );
- IMPLEMENT_CONSTASCII_USTRING( FM_PROP_LINEENDFORMAT, "LineEndFormat" );
- IMPLEMENT_CONSTASCII_USTRING( FM_PROP_TOGGLE, "Toggle" );
- IMPLEMENT_CONSTASCII_USTRING( FM_PROP_FOCUSONCLICK, "FocusOnClick" );
- IMPLEMENT_CONSTASCII_USTRING( FM_PROP_HIDEINACTIVESELECTION, "HideInactiveSelection" );
- IMPLEMENT_CONSTASCII_USTRING( FM_PROP_VISUALEFFECT, "VisualEffect" );
- IMPLEMENT_CONSTASCII_USTRING( FM_PROP_BORDERCOLOR, "BorderColor" );
- IMPLEMENT_CONSTASCII_USTRING( FM_PROP_DYNAMIC_CONTROL_BORDER, "DynamicControlBorder" );
- IMPLEMENT_CONSTASCII_USTRING( FM_PROP_CONTROL_BORDER_COLOR_FOCUS, "ControlBorderColorOnFocus" );
- IMPLEMENT_CONSTASCII_USTRING( FM_PROP_CONTROL_BORDER_COLOR_MOUSE, "ControlBorderColorOnHover" );
- IMPLEMENT_CONSTASCII_USTRING( FM_PROP_CONTROL_BORDER_COLOR_INVALID,"ControlBorderColorOnInvalid" );
-
- IMPLEMENT_CONSTASCII_USTRING( FM_PROP_BUTTON_TYPE, "ButtonType" );
- IMPLEMENT_CONSTASCII_USTRING( FM_PROP_FORM_OPERATIONS, "FormOperations" );
- IMPLEMENT_CONSTASCII_USTRING( FM_PROP_INPUT_REQUIRED, "InputRequired" );
-
- IMPLEMENT_CONSTASCII_USTRING( FM_PROP_WRITING_MODE, "WritingMode" );
-
-} // namespace svxform
-
diff --git a/svx/source/form/fmservs.cxx b/svx/source/form/fmservs.cxx
index cd62117010..d41886c844 100644
--- a/svx/source/form/fmservs.cxx
+++ b/svx/source/form/fmservs.cxx
@@ -31,76 +31,9 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
#include <com/sun/star/container/XSet.hpp>
-#include "fmstatic.hxx"
#include <cppuhelper/factory.hxx>
#include <comphelper/processfactory.hxx>
-
-namespace svxform
-{
-
- // -----------------------
- // service names for compatibility
- // -----------------------
- IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_EDIT,"stardiv.one.form.component.Edit"); // compatibility
- IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_TEXTFIELD,"stardiv.one.form.component.TextField");
- IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_LISTBOX,"stardiv.one.form.component.ListBox");
- IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_COMBOBOX,"stardiv.one.form.component.ComboBox");
- IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_RADIOBUTTON,"stardiv.one.form.component.RadioButton");
- IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_GROUPBOX,"stardiv.one.form.component.GroupBox"); // compatibility
- IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_FIXEDTEXT,"stardiv.one.form.component.FixedText"); // compatibility
- IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_COMMANDBUTTON,"stardiv.one.form.component.CommandButton");
- IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_CHECKBOX,"stardiv.one.form.component.CheckBox");
- IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_GRID,"stardiv.one.form.component.Grid"); // compatibility
- IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_GRIDCONTROL,"stardiv.one.form.component.GridControl");
- IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_IMAGEBUTTON,"stardiv.one.form.component.ImageButton");
- IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_FILECONTROL,"stardiv.one.form.component.FileControl");
- IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_TIMEFIELD,"stardiv.one.form.component.TimeField");
- IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_DATEFIELD,"stardiv.one.form.component.DateField");
- IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_NUMERICFIELD,"stardiv.one.form.component.NumericField");
- IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_CURRENCYFIELD,"stardiv.one.form.component.CurrencyField");
- IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_PATTERNFIELD,"stardiv.one.form.component.PatternField");
- IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_HIDDEN,"stardiv.one.form.component.Hidden");
- IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_HIDDENCONTROL,"stardiv.one.form.component.HiddenControl");
- IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_IMAGECONTROL,"stardiv.one.form.component.ImageControl");
- IMPLEMENT_CONSTASCII_USTRING(FM_COMPONENT_FORMATTEDFIELD,"stardiv.one.form.component.FormattedField");
-
- IMPLEMENT_CONSTASCII_USTRING(FM_CONTROL_GRID,"stardiv.one.form.control.Grid"); // compatibility
- IMPLEMENT_CONSTASCII_USTRING(FM_CONTROL_GRIDCONTROL,"stardiv.one.form.control.GridControl");
-
- // -----------------------
- // new (sun) service names
- // -----------------------
- IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_FORM,"com.sun.star.form.component.Form");
- IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_TEXTFIELD,"com.sun.star.form.component.TextField");
- IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_LISTBOX,"com.sun.star.form.component.ListBox");
- IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_COMBOBOX,"com.sun.star.form.component.ComboBox");
- IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_RADIOBUTTON,"com.sun.star.form.component.RadioButton");
- IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_GROUPBOX,"com.sun.star.form.component.GroupBox");
- IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_FIXEDTEXT,"com.sun.star.form.component.FixedText");
- IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_COMMANDBUTTON,"com.sun.star.form.component.CommandButton");
- IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_CHECKBOX,"com.sun.star.form.component.CheckBox");
- IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_GRIDCONTROL,"com.sun.star.form.component.GridControl");
- IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_IMAGEBUTTON,"com.sun.star.form.component.ImageButton");
- IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_FILECONTROL,"com.sun.star.form.component.FileControl");
- IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_TIMEFIELD,"com.sun.star.form.component.TimeField");
- IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_DATEFIELD,"com.sun.star.form.component.DateField");
- IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_NUMERICFIELD,"com.sun.star.form.component.NumericField");
- IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_CURRENCYFIELD,"com.sun.star.form.component.CurrencyField");
- IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_PATTERNFIELD,"com.sun.star.form.component.PatternField");
- IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_HIDDENCONTROL,"com.sun.star.form.component.HiddenControl");
- IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_IMAGECONTROL,"com.sun.star.form.component.DatabaseImageControl");
- IMPLEMENT_CONSTASCII_USTRING(FM_SUN_COMPONENT_FORMATTEDFIELD,"com.sun.star.form.component.FormattedField");
- IMPLEMENT_CONSTASCII_USTRING( FM_SUN_COMPONENT_SCROLLBAR, "com.sun.star.form.component.ScrollBar" );
- IMPLEMENT_CONSTASCII_USTRING( FM_SUN_COMPONENT_SPINBUTTON, "com.sun.star.form.component.SpinButton" );
- IMPLEMENT_CONSTASCII_USTRING( FM_SUN_COMPONENT_NAVIGATIONBAR,"com.sun.star.form.component.NavigationToolBar" );
-
- IMPLEMENT_CONSTASCII_USTRING(FM_SUN_CONTROL_GRIDCONTROL,"com.sun.star.form.control.GridControl");
-
- IMPLEMENT_CONSTASCII_USTRING(FM_NUMBER_FORMATTER,"com.sun.star.util.NumberFormatter");
- IMPLEMENT_CONSTASCII_USTRING(FM_FORM_CONTROLLER,"com.sun.star.form.FormController");
- IMPLEMENT_CONSTASCII_USTRING(SRV_SDB_CONNECTION,"com.sun.star.sdb.Connection");
- IMPLEMENT_CONSTASCII_USTRING(SRV_SDB_INTERACTION_HANDLER,"com.sun.star.sdb.InteractionHandler");
-} // namespace svxform
+#include "fmservs.hxx"
// ------------------------------------------------------------------------
#define DECL_SERVICE(ImplName) \
diff --git a/svx/source/form/fmtextcontrolshell.cxx b/svx/source/form/fmtextcontrolshell.cxx
index 8211bc1afd..7555b3d30d 100644
--- a/svx/source/form/fmtextcontrolshell.cxx
+++ b/svx/source/form/fmtextcontrolshell.cxx
@@ -94,7 +94,6 @@ namespace svx
using namespace ::com::sun::star::util;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::container;
- using namespace ::svxform;
//====================================================================
typedef USHORT WhichId;
diff --git a/svx/source/form/fmtools.cxx b/svx/source/form/fmtools.cxx
index 652c868c69..9be98fd4b1 100644
--- a/svx/source/form/fmtools.cxx
+++ b/svx/source/form/fmtools.cxx
@@ -100,7 +100,6 @@
#include <connectivity/dbtools.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/sequence.hxx>
-#include "fmstatic.hxx"
#include <comphelper/extract.hxx>
#include <comphelper/uno3.hxx>
#include <connectivity/dbexception.hxx>
@@ -109,14 +108,6 @@
#include <algorithm>
#include <rtl/logfile.hxx>
-namespace svxform
-{
-
- IMPLEMENT_CONSTASCII_USTRING(DATA_MODE,"DataMode");
- IMPLEMENT_CONSTASCII_USTRING(FILTER_MODE,"FilterMode");
-
-} // namespace svxform
-
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::util;
using namespace ::com::sun::star::lang;
diff --git a/svx/source/form/fmundo.cxx b/svx/source/form/fmundo.cxx
index 827fbb1280..bc8b334d55 100644
--- a/svx/source/form/fmundo.cxx
+++ b/svx/source/form/fmundo.cxx
@@ -459,7 +459,7 @@ void SAL_CALL FmXUndoEnvironment::propertyChange(const PropertyChangeEvent& evt)
return;
// if it's a "default value" property of a control model, set the according "value" property
- static const sal_Char* pDefaultValueProperties[] = {
+ static ::rtl::OUString pDefaultValueProperties[] = {
FM_PROP_DEFAULT_TEXT, FM_PROP_DEFAULTCHECKED, FM_PROP_DEFAULT_DATE, FM_PROP_DEFAULT_TIME,
FM_PROP_DEFAULT_VALUE, FM_PROP_DEFAULT_SELECT_SEQ, FM_PROP_EFFECTIVE_DEFAULT
};
@@ -472,7 +472,7 @@ void SAL_CALL FmXUndoEnvironment::propertyChange(const PropertyChangeEvent& evt)
"FmXUndoEnvironment::propertyChange: inconsistence!");
for (sal_Int32 i=0; i<nDefaultValueProps; ++i)
{
- if (0 == evt.PropertyName.compareToAscii(pDefaultValueProperties[i]))
+ if (0 == evt.PropertyName.compareTo(pDefaultValueProperties[i]))
{
try
{
diff --git a/svx/source/form/fmurl.cxx b/svx/source/form/fmurl.cxx
deleted file mode 100644
index dc81ed7a2d..0000000000
--- a/svx/source/form/fmurl.cxx
+++ /dev/null
@@ -1,74 +0,0 @@
-/*************************************************************************
- *
- * 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: fmurl.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.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-#include "fmurl.hxx"
-
-
-namespace svxform
-{
-
- IMPLEMENT_CONSTASCII_USTRING(FMURL_FORMSLOTS_PREFIX, ".uno:FormController/");
-
- IMPLEMENT_CONSTASCII_USTRING(FMURL_FORM_POSITION, ".uno:FormController/positionForm" );
- IMPLEMENT_CONSTASCII_USTRING(FMURL_FORM_RECORDCOUNT, ".uno:FormController/RecordCount" );
- IMPLEMENT_CONSTASCII_USTRING(FMURL_RECORD_MOVEFIRST, ".uno:FormController/moveToFirst" );
- IMPLEMENT_CONSTASCII_USTRING(FMURL_RECORD_MOVEPREV, ".uno:FormController/moveToPrev" );
- IMPLEMENT_CONSTASCII_USTRING(FMURL_RECORD_MOVENEXT, ".uno:FormController/moveToNext" );
- IMPLEMENT_CONSTASCII_USTRING(FMURL_RECORD_MOVELAST, ".uno:FormController/moveToLast" );
- IMPLEMENT_CONSTASCII_USTRING(FMURL_RECORD_MOVETONEW, ".uno:FormController/moveToNew" );
- IMPLEMENT_CONSTASCII_USTRING(FMURL_RECORD_UNDO, ".uno:FormController/undoRecord" );
- IMPLEMENT_CONSTASCII_USTRING(FMURL_RECORD_SAVE, ".uno:FormController/saveRecord" );
- IMPLEMENT_CONSTASCII_USTRING(FMURL_RECORD_DELETE, ".uno:FormController/deleteRecord" );
- IMPLEMENT_CONSTASCII_USTRING(FMURL_FORM_REFRESH, ".uno:FormController/refreshForm" );
- IMPLEMENT_CONSTASCII_USTRING(FMURL_FORM_REFRESH_CURRENT_CONTROL,
- ".uno:FormController/refreshCurrentControl" );
-
- IMPLEMENT_CONSTASCII_USTRING( FMURL_FORM_SORT_UP, ".uno:FormController/sortUp" );
- IMPLEMENT_CONSTASCII_USTRING( FMURL_FORM_SORT_DOWN, ".uno:FormController/sortDown" );
- IMPLEMENT_CONSTASCII_USTRING( FMURL_FORM_SORT, ".uno:FormController/sort" );
- IMPLEMENT_CONSTASCII_USTRING( FMURL_FORM_AUTO_FILTER, ".uno:FormController/autoFilter" );
- IMPLEMENT_CONSTASCII_USTRING( FMURL_FORM_FILTER, ".uno:FormController/filter" );
- IMPLEMENT_CONSTASCII_USTRING( FMURL_FORM_APPLY_FILTER, ".uno:FormController/applyFilter" );
- IMPLEMENT_CONSTASCII_USTRING( FMURL_FORM_REMOVE_FILTER,".uno:FormController/removeFilterOrder" );
-
- IMPLEMENT_CONSTASCII_USTRING(FMURL_CONFIRM_DELETION,".uno:FormSlots/ConfirmDeletion");
-
- IMPLEMENT_CONSTASCII_USTRING(FMURL_COMPONENT_FORMGRIDVIEW,".component:DB/FormGridView");
- IMPLEMENT_CONSTASCII_USTRING(FMURL_GRIDVIEW_CLEARVIEW,".uno:FormSlots/ClearView");
- IMPLEMENT_CONSTASCII_USTRING(FMURL_GRIDVIEW_ADDCOLUMN,".uno:FormSlots/AddGridColumn");
- IMPLEMENT_CONSTASCII_USTRING(FMURL_GRIDVIEW_ATTACHTOFORM,".uno:FormSlots/AttachToForm");
-
- IMPLEMENT_CONSTASCII_USTRING(FMARG_ATTACHTO_MASTERFORM,"MasterForm");
- IMPLEMENT_CONSTASCII_USTRING(FMARG_ADDCOL_COLUMNTYPE,"ColumnType");
- IMPLEMENT_CONSTASCII_USTRING(FMARG_ADDCOL_COLUMNPOS,"ColumnPosition");
-
-} // namespace svxform
diff --git a/svx/source/form/formcontrolling.cxx b/svx/source/form/formcontrolling.cxx
index e3f2a48efc..69a2fb308e 100644
--- a/svx/source/form/formcontrolling.cxx
+++ b/svx/source/form/formcontrolling.cxx
@@ -57,7 +57,6 @@ namespace svx
{
//........................................................................
- using namespace ::svxform;
/** === begin UNO using === **/
using ::com::sun::star::uno::Reference;
using ::com::sun::star::lang::XMultiServiceFactory;
diff --git a/svx/source/form/makefile.mk b/svx/source/form/makefile.mk
index 3d405edc00..b649be94d1 100644
--- a/svx/source/form/makefile.mk
+++ b/svx/source/form/makefile.mk
@@ -33,6 +33,7 @@ PRJ=..$/..
PRJNAME=svx
TARGET=form
+LIBTARGET=NO
ENABLE_EXCEPTIONS=TRUE
@@ -53,7 +54,8 @@ SRC1FILES= \
formshell.src \
datanavi.src
-SLOFILES = \
+LIB1TARGET= $(SLB)$/$(TARGET)-core.lib
+LIB1OBJFILES= \
$(SLO)$/formtoolbars.obj \
$(SLO)$/fmdocumentclassification.obj \
$(SLO)$/fmcontrolbordermanager.obj \
@@ -61,7 +63,6 @@ SLOFILES = \
$(SLO)$/fmtextcontroldialogs.obj \
$(SLO)$/fmtextcontrolfeature.obj \
$(SLO)$/fmtextcontrolshell.obj \
- $(SLO)$/dbcharsethelper.obj \
$(SLO)$/ParseContext.obj \
$(SLO)$/typeconversionclient.obj \
$(SLO)$/confirmdelete.obj \
@@ -69,9 +70,7 @@ SLOFILES = \
$(SLO)$/sqlparserclient.obj \
$(SLO)$/dataaccessdescriptor.obj \
$(SLO)$/fmpage.obj \
- $(SLO)$/fmPropBrw.obj \
$(SLO)$/fmundo.obj \
- $(SLO)$/fmprop.obj \
$(SLO)$/fmmodel.obj \
$(SLO)$/navigatortree.obj \
$(SLO)$/navigatortreemodel.obj \
@@ -81,21 +80,14 @@ SLOFILES = \
$(SLO)$/fmvwimp.obj \
$(SLO)$/fmdpage.obj \
$(SLO)$/fmitems.obj \
- $(SLO)$/tbxform.obj \
$(SLO)$/fmobj.obj \
$(SLO)$/fmdmod.obj \
- $(SLO)$/fmobjfac.obj \
- $(SLO)$/fmsrccfg.obj \
$(SLO)$/fmservs.obj \
$(SLO)$/typemap.obj \
$(SLO)$/fmexch.obj \
- $(SLO)$/tabwin.obj \
- $(SLO)$/fmurl.obj \
- $(SLO)$/filtnav.obj \
$(SLO)$/fmtools.obj \
$(SLO)$/fmshimp.obj \
$(SLO)$/fmshell.obj \
- $(SLO)$/fmsrcimp.obj \
$(SLO)$/fmview.obj \
$(SLO)$/sdbdatacolumn.obj \
$(SLO)$/formcontrolling.obj \
@@ -105,13 +97,22 @@ SLOFILES = \
$(SLO)$/datalistener.obj \
$(SLO)$/fmscriptingenv.obj \
$(SLO)$/stringlistresource.obj \
- $(SLO)$/databaselocationinput.obj \
$(SLO)$/delayedevent.obj \
$(SLO)$/formcontrolfactory.obj
-.IF "$(OS)$(CPU)"=="SOLARISI"
-NOOPTFILES=$(SLO)$/fmprop.obj
-.ENDIF
+LIB2TARGET= $(SLB)$/$(TARGET).lib
+LIB2OBJFILES= \
+ $(SLO)$/dbcharsethelper.obj \
+ $(SLO)$/fmPropBrw.obj \
+ $(SLO)$/tbxform.obj \
+ $(SLO)$/fmobjfac.obj \
+ $(SLO)$/fmsrccfg.obj \
+ $(SLO)$/tabwin.obj \
+ $(SLO)$/filtnav.obj \
+ $(SLO)$/fmsrcimp.obj \
+ $(SLO)$/databaselocationinput.obj
+
+SLOFILES = $(LIB1OBJFILES) $(LIB2OBJFILES)
# --- Targets ----------------------------------
diff --git a/svx/source/gallery2/galobj.cxx b/svx/source/gallery2/galobj.cxx
index dc6540fe97..a4b9cc0d39 100644
--- a/svx/source/gallery2/galobj.cxx
+++ b/svx/source/gallery2/galobj.cxx
@@ -134,7 +134,8 @@ BOOL SgaObject::CreateThumb( const Graphic& rGraphic )
else
aSize.Height() = (sal_Int32)( S_THUMB / fFactor );
- aThumbBmp = rGraphic.GetBitmap( &aSize );
+ const GraphicConversionParameters aParameters(aSize);
+ aThumbBmp = rGraphic.GetBitmap(aParameters);
if( !aThumbBmp.IsEmpty() )
{
diff --git a/svx/source/gengal/makefile.mk b/svx/source/gengal/makefile.mk
index 703f730433..ae1f36e5f7 100644
--- a/svx/source/gengal/makefile.mk
+++ b/svx/source/gengal/makefile.mk
@@ -66,7 +66,7 @@ APP1STDLIBS=$(TOOLSLIB) \
$(SALLIB) \
$(VCLLIB) \
$(UCBHELPERLIB) \
- $(SVXLIB)
+ $(SVXCORELIB)
#.IF "$(COM)"=="GCC"
#ADDOPTFILES=$(OBJ)$/gengal.obj
diff --git a/svx/source/inc/AccessibleStringWrap.hxx b/svx/source/inc/AccessibleStringWrap.hxx
index dba73dbb70..0d4e5c42e9 100644
--- a/svx/source/inc/AccessibleStringWrap.hxx
+++ b/svx/source/inc/AccessibleStringWrap.hxx
@@ -34,6 +34,8 @@
#include <sal/types.h>
#include <tools/string.hxx>
+#include <svx/svxdllapi.h>
+
class OutputDevice;
class SvxFont;
class Rectangle;
@@ -49,10 +51,10 @@ class AccessibleStringWrap
{
public:
- AccessibleStringWrap( OutputDevice& rDev, SvxFont& rFont, const String& rText );
+ SVX_DLLPUBLIC AccessibleStringWrap( OutputDevice& rDev, SvxFont& rFont, const String& rText );
- sal_Bool GetCharacterBounds( sal_Int32 nIndex, Rectangle& rRect );
- sal_Int32 GetIndexAtPoint( const Point& rPoint );
+ SVX_DLLPUBLIC sal_Bool GetCharacterBounds( sal_Int32 nIndex, Rectangle& rRect );
+ SVX_DLLPUBLIC sal_Int32 GetIndexAtPoint( const Point& rPoint );
private:
diff --git a/svx/source/inc/datanavi.hxx b/svx/source/inc/datanavi.hxx
index a61182189f..269db25f47 100644
--- a/svx/source/inc/datanavi.hxx
+++ b/svx/source/inc/datanavi.hxx
@@ -307,10 +307,10 @@ namespace svxform
};
//========================================================================
- class DataNavigatorManager : public SfxChildWindow
+ class SVX_DLLPUBLIC DataNavigatorManager : public SfxChildWindow
{
public:
- DataNavigatorManager( Window* pParent, sal_uInt16 nId,
+ SVX_DLLPRIVATE DataNavigatorManager( Window* pParent, sal_uInt16 nId,
SfxBindings* pBindings, SfxChildWinInfo* pInfo );
SFX_DECL_CHILDWINDOW( DataNavigatorManager );
};
diff --git a/svx/source/inc/dbtoolsclient.hxx b/svx/source/inc/dbtoolsclient.hxx
index 1e979315ec..262b791e80 100644
--- a/svx/source/inc/dbtoolsclient.hxx
+++ b/svx/source/inc/dbtoolsclient.hxx
@@ -36,6 +36,7 @@
#include <osl/module.h>
#include <tools/solar.h>
#include <unotools/sharedunocomponent.hxx>
+#include <svx/svxdllapi.h>
//........................................................................
namespace svxform
@@ -50,7 +51,7 @@ namespace svxform
/** base class for classes which want to use dbtools features with load-on-call
of the dbtools lib.
*/
- class ODbtoolsClient
+ class SVX_DLLPUBLIC ODbtoolsClient
{
private:
static ::osl::Mutex s_aMutex;
@@ -82,7 +83,7 @@ namespace svxform
//====================================================================
//= OStaticDataAccessTools
//====================================================================
- class OStaticDataAccessTools : public ODbtoolsClient
+ class SVX_DLLPUBLIC OStaticDataAccessTools : public ODbtoolsClient
{
protected:
mutable ::rtl::Reference< ::connectivity::simple::IDataAccessTools > m_xDataAccessTools;
@@ -93,7 +94,7 @@ namespace svxform
public:
OStaticDataAccessTools();
- const ::rtl::Reference< ::connectivity::simple::IDataAccessTools >& getDataAccessTools() const { return m_xDataAccessTools; }
+ SVX_DLLPRIVATE const ::rtl::Reference< ::connectivity::simple::IDataAccessTools >& getDataAccessTools() const { return m_xDataAccessTools; }
// ------------------------------------------------
::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier> getNumberFormats(
@@ -102,13 +103,13 @@ namespace svxform
) const;
// ------------------------------------------------
- sal_Int32 getDefaultNumberFormat(
+ SVX_DLLPRIVATE sal_Int32 getDefaultNumberFormat(
const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _xColumn,
const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatTypes >& _xTypes,
const ::com::sun::star::lang::Locale& _rLocale );
// ------------------------------------------------
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> getConnection_withFeedback(
+ SVX_DLLPRIVATE ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> getConnection_withFeedback(
const ::rtl::OUString& _rDataSourceName,
const ::rtl::OUString& _rUser,
const ::rtl::OUString& _rPwd,
@@ -130,26 +131,26 @@ namespace svxform
const SAL_THROW ( (::com::sun::star::uno::RuntimeException) );
// ------------------------------------------------
- void TransferFormComponentProperties(
+ SVX_DLLPRIVATE void TransferFormComponentProperties(
const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxOld,
const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxNew,
const ::com::sun::star::lang::Locale& _rLocale
) const;
// ------------------------------------------------
- ::rtl::OUString quoteName(
+ SVX_DLLPRIVATE ::rtl::OUString quoteName(
const ::rtl::OUString& _rQuote,
const ::rtl::OUString& _rName
) const;
// ------------------------------------------------
- ::rtl::OUString composeTableNameForSelect(
+ SVX_DLLPRIVATE ::rtl::OUString composeTableNameForSelect(
const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection,
const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xTable
) const;
// ------------------------------------------------
- ::com::sun::star::sdb::SQLContext prependContextInfo(
+ SVX_DLLPRIVATE ::com::sun::star::sdb::SQLContext prependContextInfo(
::com::sun::star::sdbc::SQLException& _rException,
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxContext,
const ::rtl::OUString& _rContextDescription,
@@ -157,7 +158,7 @@ namespace svxform
) const;
// ------------------------------------------------
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDataSource > getDataSource(
+ SVX_DLLPRIVATE ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDataSource > getDataSource(
const ::rtl::OUString& _rsRegisteredName,
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory
) const;
@@ -166,22 +167,22 @@ namespace svxform
/** check if the property "Privileges" supports ::com::sun::star::sdbcx::Privilege::INSERT
@param _rxCursorSet the property set
*/
- sal_Bool canInsert(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxCursorSet) const;
+ SVX_DLLPRIVATE sal_Bool canInsert(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxCursorSet) const;
// ------------------------------------------------
/** check if the property "Privileges" supports ::com::sun::star::sdbcx::Privilege::UPDATE
@param _rxCursorSet the property set
*/
- sal_Bool canUpdate(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxCursorSet) const;
+ SVX_DLLPRIVATE sal_Bool canUpdate(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxCursorSet) const;
// ------------------------------------------------
/** check if the property "Privileges" supports ::com::sun::star::sdbcx::Privilege::DELETE
@param _rxCursorSet the property set
*/
- sal_Bool canDelete(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxCursorSet) const;
+ SVX_DLLPRIVATE sal_Bool canDelete(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxCursorSet) const;
// ------------------------------------------------
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >
+ SVX_DLLPRIVATE ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >
getFieldsByCommandDescriptor(
const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection,
const sal_Int32 _nCommandType,
@@ -200,13 +201,13 @@ namespace svxform
) SAL_THROW( ( ) );
// ------------------------------------------------
- bool isEmbeddedInDatabase(
+ SVX_DLLPRIVATE bool isEmbeddedInDatabase(
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxComponent,
::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxActualConnection
);
// ------------------------------------------------
- bool isEmbeddedInDatabase(
+ SVX_DLLPRIVATE bool isEmbeddedInDatabase(
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxComponent
);
};
diff --git a/svx/source/inc/filtnav.hxx b/svx/source/inc/filtnav.hxx
index 13998e3beb..c84d8d5ae5 100644
--- a/svx/source/inc/filtnav.hxx
+++ b/svx/source/inc/filtnav.hxx
@@ -43,13 +43,8 @@
#include <vcl/image.hxx>
#include <svtools/svtreebx.hxx>
-#ifndef _DIALOG_HXX //autogen
#include <vcl/dialog.hxx>
-#endif
-
-#ifndef _GROUP_HXX //autogen
#include <vcl/group.hxx>
-#endif
#include <vcl/dockwin.hxx>
#include "fmtools.hxx"
#include "fmexch.hxx"
diff --git a/svx/source/inc/fmctrler.hxx b/svx/source/inc/fmctrler.hxx
index 6407ca78fd..7c127a2adf 100644
--- a/svx/source/inc/fmctrler.hxx
+++ b/svx/source/inc/fmctrler.hxx
@@ -273,7 +273,7 @@ public:
// XUnoTunnel
virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
static ::com::sun::star::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
- static FmXFormController* getImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxComponent );
+ SVX_DLLPUBLIC static FmXFormController* getImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxComponent );
// XDispatch
virtual void SAL_CALL dispatch( const ::com::sun::star::util::URL& _rURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _rArgs ) throw (::com::sun::star::uno::RuntimeException);
@@ -462,7 +462,7 @@ public:
--m_nCurrentFilterPosition;
}
- void setCurrentFilterPosition(sal_Int32 nPos);
+ SVX_DLLPUBLIC void setCurrentFilterPosition(sal_Int32 nPos);
sal_Int32 getCurrentFilterPosition() const {return m_nCurrentFilterPosition;}
protected:
diff --git a/svx/source/inc/fmexch.hxx b/svx/source/inc/fmexch.hxx
index 1f6db8abea..410addcf31 100644
--- a/svx/source/inc/fmexch.hxx
+++ b/svx/source/inc/fmexch.hxx
@@ -36,6 +36,8 @@
#include <com/sun/star/container/XNameContainer.hpp>
#include <tools/link.hxx>
+#include <svx/svxdllapi.h>
+
class FmFormShell;
class FmFormPage;
class SvLBoxEntry;
@@ -63,7 +65,7 @@ namespace svxform
//====================================================================
//= OLocalExchange
//====================================================================
- class OLocalExchange : public TransferableHelper
+ class SVX_DLLPUBLIC OLocalExchange : public TransferableHelper
{
private:
Link m_aClipboardListener;
@@ -110,7 +112,7 @@ namespace svxform
//= OLocalExchangeHelper
//====================================================================
/// a helper for navigator windows (SvTreeListBox'es) which allow DnD within themself
- class OLocalExchangeHelper
+ class SVX_DLLPUBLIC OLocalExchangeHelper
{
protected:
Window* m_pDragSource;
@@ -130,13 +132,13 @@ namespace svxform
inline sal_Bool isDataExchangeActive( ) const { return isDragSource() || isClipboardOwner(); }
inline void clear() { if ( isDataExchangeActive() ) m_pTransferable->clear(); }
- void setClipboardListener( const Link& _rListener ) { if ( m_pTransferable ) m_pTransferable->setClipboardListener( _rListener ); }
+ SVX_DLLPRIVATE void setClipboardListener( const Link& _rListener ) { if ( m_pTransferable ) m_pTransferable->setClipboardListener( _rListener ); }
protected:
- virtual OLocalExchange* createExchange() const = 0;
+ SVX_DLLPRIVATE virtual OLocalExchange* createExchange() const = 0;
protected:
- void implReset();
+ SVX_DLLPRIVATE void implReset();
};
//====================================================================
diff --git a/svx/source/inc/fmexpl.hxx b/svx/source/inc/fmexpl.hxx
index ba49c7b897..bb008a0727 100644
--- a/svx/source/inc/fmexpl.hxx
+++ b/svx/source/inc/fmexpl.hxx
@@ -595,10 +595,10 @@ namespace svxform
};
//========================================================================
- class NavigatorFrameManager : public SfxChildWindow
+ class SVX_DLLPUBLIC NavigatorFrameManager : public SfxChildWindow
{
public:
- NavigatorFrameManager( Window *pParent, sal_uInt16 nId, SfxBindings *pBindings,
+ SVX_DLLPRIVATE NavigatorFrameManager( Window *pParent, sal_uInt16 nId, SfxBindings *pBindings,
SfxChildWinInfo *pInfo );
SFX_DECL_CHILDWINDOW( NavigatorFrameManager );
};
diff --git a/svx/source/inc/fmobj.hxx b/svx/source/inc/fmobj.hxx
index 65ad3778fc..3dd15fc1cd 100644
--- a/svx/source/inc/fmobj.hxx
+++ b/svx/source/inc/fmobj.hxx
@@ -62,8 +62,8 @@ class FmFormObj: public SdrUnoObj
// only to be used for comparison with the current ref device!
public:
- FmFormObj(const ::rtl::OUString& rModelName,sal_Int32 _nType);
- FmFormObj(sal_Int32 _nType);
+ SVX_DLLPUBLIC FmFormObj(const ::rtl::OUString& rModelName,sal_Int32 _nType);
+ SVX_DLLPUBLIC FmFormObj(sal_Int32 _nType);
TYPEINFO();
diff --git a/svx/source/inc/fmpgeimp.hxx b/svx/source/inc/fmpgeimp.hxx
index 070ddf33b5..651232c68c 100644
--- a/svx/source/inc/fmpgeimp.hxx
+++ b/svx/source/inc/fmpgeimp.hxx
@@ -154,8 +154,7 @@ public:
/** returns an object mapping from control models to drawing shapes.
*/
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XMap >
- getControlToShapeMap();
+ SVX_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::container::XMap > getControlToShapeMap();
private:
/** validates whether <member>xCurrentForm</member> is still valid and to be used
diff --git a/svx/source/inc/fmprop.hrc b/svx/source/inc/fmprop.hrc
index 833439f52a..a981cc65c4 100644
--- a/svx/source/inc/fmprop.hrc
+++ b/svx/source/inc/fmprop.hrc
@@ -30,9 +30,6 @@
#ifndef _SVX_FMPROP_HRC
#define _SVX_FMPROP_HRC
-#ifndef _FM_STATIC_HXX_
-#include "fmstatic.hxx"
-#endif
// PropertyId's, welche eine Zuordnung zu einen PropertyName haben, das koennten
// auch in Zukunft WhichIds sein -> Itemset
#define FM_ATTR_START 0
@@ -40,150 +37,145 @@
#define FM_ATTR_FILTER ( FM_ATTR_START + 1 )
#define FM_ATTR_FORM_OPERATIONS ( FM_ATTR_START + 2 )
-
-namespace svxform
-{
- DECLARE_CONSTASCII_USTRING(FM_PROP_NAME);
- DECLARE_CONSTASCII_USTRING(FM_PROP_CLASSID);
- DECLARE_CONSTASCII_USTRING(FM_PROP_ALIGN);
- DECLARE_CONSTASCII_USTRING(FM_PROP_ROWCOUNT);
- DECLARE_CONSTASCII_USTRING(FM_PROP_ROWCOUNTFINAL);
- DECLARE_CONSTASCII_USTRING(FM_PROP_FETCHSIZE);
- DECLARE_CONSTASCII_USTRING(FM_PROP_VALUE);
- DECLARE_CONSTASCII_USTRING(FM_PROP_VALUEMIN);
- DECLARE_CONSTASCII_USTRING(FM_PROP_VALUEMAX);
- DECLARE_CONSTASCII_USTRING(FM_PROP_VALUESTEP);
- DECLARE_CONSTASCII_USTRING(FM_PROP_TEXT);
- DECLARE_CONSTASCII_USTRING(FM_PROP_LABEL);
- DECLARE_CONSTASCII_USTRING(FM_PROP_NAVIGATION);
- DECLARE_CONSTASCII_USTRING(FM_PROP_CYCLE);
- DECLARE_CONSTASCII_USTRING(FM_PROP_CONTROLSOURCE);
- DECLARE_CONSTASCII_USTRING(FM_PROP_ENABLED);
- DECLARE_CONSTASCII_USTRING(FM_PROP_SPIN);
- DECLARE_CONSTASCII_USTRING(FM_PROP_READONLY);
- DECLARE_CONSTASCII_USTRING(FM_PROP_FILTER);
- DECLARE_CONSTASCII_USTRING(FM_PROP_AUTOINCREMENT);
- DECLARE_CONSTASCII_USTRING(FM_PROP_WIDTH);
- DECLARE_CONSTASCII_USTRING(FM_PROP_SEARCHABLE);
- DECLARE_CONSTASCII_USTRING(FM_PROP_MULTILINE);
- DECLARE_CONSTASCII_USTRING(FM_PROP_TARGET_URL);
- DECLARE_CONSTASCII_USTRING(FM_PROP_DEFAULTCONTROL);
- DECLARE_CONSTASCII_USTRING(FM_PROP_MAXTEXTLEN);
- DECLARE_CONSTASCII_USTRING(FM_PROP_DATE);
- DECLARE_CONSTASCII_USTRING(FM_PROP_TIME);
- DECLARE_CONSTASCII_USTRING(FM_PROP_STATE);
- DECLARE_CONSTASCII_USTRING(FM_PROP_TRISTATE);
- DECLARE_CONSTASCII_USTRING(FM_PROP_STRINGITEMLIST);
- DECLARE_CONSTASCII_USTRING(FM_PROP_DEFAULT_TEXT);
- DECLARE_CONSTASCII_USTRING(FM_PROP_DEFAULTCHECKED);
- DECLARE_CONSTASCII_USTRING(FM_PROP_DEFAULT_DATE);
- DECLARE_CONSTASCII_USTRING(FM_PROP_DEFAULT_TIME);
- DECLARE_CONSTASCII_USTRING(FM_PROP_DEFAULT_VALUE);
- DECLARE_CONSTASCII_USTRING(FM_PROP_FORMATKEY);
- DECLARE_CONSTASCII_USTRING(FM_PROP_FORMATSSUPPLIER);
- DECLARE_CONSTASCII_USTRING(FM_PROP_LISTSOURCETYPE);
- DECLARE_CONSTASCII_USTRING(FM_PROP_LISTSOURCE);
- DECLARE_CONSTASCII_USTRING(FM_PROP_SELECT_SEQ);
- DECLARE_CONSTASCII_USTRING(FM_PROP_VALUE_SEQ);
- DECLARE_CONSTASCII_USTRING(FM_PROP_DEFAULT_SELECT_SEQ);
- DECLARE_CONSTASCII_USTRING(FM_PROP_DECIMAL_ACCURACY);
- DECLARE_CONSTASCII_USTRING(FM_PROP_EDITMASK);
- DECLARE_CONSTASCII_USTRING(FM_PROP_ISREADONLY);
- DECLARE_CONSTASCII_USTRING(FM_PROP_FIELDTYPE);
- DECLARE_CONSTASCII_USTRING(FM_PROP_REFVALUE);
- DECLARE_CONSTASCII_USTRING(FM_PROP_STRICTFORMAT);
- DECLARE_CONSTASCII_USTRING(FM_PROP_DATASOURCE);
- DECLARE_CONSTASCII_USTRING(FM_PROP_LITERALMASK);
- DECLARE_CONSTASCII_USTRING(FM_PROP_SHOWTHOUSANDSEP);
- DECLARE_CONSTASCII_USTRING(FM_PROP_CURRENCYSYMBOL);
- DECLARE_CONSTASCII_USTRING(FM_PROP_DATEFORMAT);
- DECLARE_CONSTASCII_USTRING(FM_PROP_DATEMIN);
- DECLARE_CONSTASCII_USTRING(FM_PROP_DATEMAX);
- DECLARE_CONSTASCII_USTRING(FM_PROP_DATE_SHOW_CENTURY);
- DECLARE_CONSTASCII_USTRING(FM_PROP_TIMEFORMAT);
- DECLARE_CONSTASCII_USTRING(FM_PROP_TIMEMIN);
- DECLARE_CONSTASCII_USTRING(FM_PROP_TIMEMAX);
- DECLARE_CONSTASCII_USTRING(FM_PROP_LINECOUNT);
- DECLARE_CONSTASCII_USTRING(FM_PROP_BOUNDCOLUMN);
- DECLARE_CONSTASCII_USTRING(FM_PROP_HASNAVIGATION);
- DECLARE_CONSTASCII_USTRING(FM_PROP_FONT);
- DECLARE_CONSTASCII_USTRING(FM_PROP_BACKGROUNDCOLOR);
- DECLARE_CONSTASCII_USTRING(FM_PROP_TEXTCOLOR);
- DECLARE_CONSTASCII_USTRING(FM_PROP_BORDER);
- DECLARE_CONSTASCII_USTRING(FM_PROP_DROPDOWN);
- DECLARE_CONSTASCII_USTRING(FM_PROP_ROWHEIGHT);
- DECLARE_CONSTASCII_USTRING(FM_PROP_HELPTEXT);
- DECLARE_CONSTASCII_USTRING(FM_PROP_HELPURL);
- DECLARE_CONSTASCII_USTRING(FM_PROP_RECORDMARKER);
- DECLARE_CONSTASCII_USTRING(FM_PROP_BOUNDFIELD);
- DECLARE_CONSTASCII_USTRING(FM_PROP_EFFECTIVE_VALUE);
- DECLARE_CONSTASCII_USTRING(FM_PROP_EFFECTIVE_DEFAULT);
- DECLARE_CONSTASCII_USTRING(FM_PROP_EFFECTIVE_MIN);
- DECLARE_CONSTASCII_USTRING(FM_PROP_EFFECTIVE_MAX);
- DECLARE_CONSTASCII_USTRING(FM_PROP_HIDDEN);
- DECLARE_CONSTASCII_USTRING(FM_PROP_FILTERPROPOSAL);
- DECLARE_CONSTASCII_USTRING(FM_PROP_FIELDSOURCE);
- DECLARE_CONSTASCII_USTRING(FM_PROP_TABLENAME);
- DECLARE_CONSTASCII_USTRING(FM_PROP_FILTERSUPPLIER);
- DECLARE_CONSTASCII_USTRING(FM_PROP_CURRENTFILTER);
- DECLARE_CONSTASCII_USTRING(FM_PROP_SELECTED_FIELDS);
- DECLARE_CONSTASCII_USTRING(FM_PROP_SELECTED_TABLES);
- DECLARE_CONSTASCII_USTRING(FM_PROP_THREADSAFE);
- DECLARE_CONSTASCII_USTRING(FM_PROP_CONTROLLABEL);
- DECLARE_CONSTASCII_USTRING(FM_PROP_CURSORCOLOR);
- DECLARE_CONSTASCII_USTRING(FM_PROP_ALWAYSSHOWCURSOR);
- DECLARE_CONSTASCII_USTRING(FM_PROP_DISPLAYSYNCHRON);
- DECLARE_CONSTASCII_USTRING(FM_PROP_ISMODIFIED);
- DECLARE_CONSTASCII_USTRING(FM_PROP_ISNEW);
- DECLARE_CONSTASCII_USTRING(FM_PROP_PRIVILEGES);
- DECLARE_CONSTASCII_USTRING(FM_PROP_COMMAND);
- DECLARE_CONSTASCII_USTRING(FM_PROP_COMMANDTYPE);
- DECLARE_CONSTASCII_USTRING(FM_PROP_RESULTSET_CONCURRENCY);
- DECLARE_CONSTASCII_USTRING(FM_PROP_INSERTONLY);
- DECLARE_CONSTASCII_USTRING(FM_PROP_RESULTSET_TYPE);
- DECLARE_CONSTASCII_USTRING(FM_PROP_ESCAPE_PROCESSING);
- DECLARE_CONSTASCII_USTRING(FM_PROP_APPLYFILTER);
- DECLARE_CONSTASCII_USTRING(FM_PROP_ISNULLABLE);
- DECLARE_CONSTASCII_USTRING(FM_PROP_ACTIVECOMMAND);
- DECLARE_CONSTASCII_USTRING(FM_PROP_ISCURRENCY);
- DECLARE_CONSTASCII_USTRING(FM_PROP_URL);
- DECLARE_CONSTASCII_USTRING(FM_PROP_ACTIVE_CONNECTION);
- DECLARE_CONSTASCII_USTRING(FM_PROP_SORT);
- DECLARE_CONSTASCII_USTRING(FM_PROP_CONTROLSOURCEPROPERTY);
- DECLARE_CONSTASCII_USTRING(FM_PROP_REALNAME);
- DECLARE_CONSTASCII_USTRING(FM_PROP_TEXTLINECOLOR);
- DECLARE_CONSTASCII_USTRING(FM_PROP_FONTEMPHASISMARK);
- DECLARE_CONSTASCII_USTRING(FM_PROP_FONTRELIEF);
- DECLARE_CONSTASCII_USTRING( FM_PROP_SCROLLVALUE_MIN );
- DECLARE_CONSTASCII_USTRING( FM_PROP_SCROLLVALUE_MAX );
- DECLARE_CONSTASCII_USTRING( FM_PROP_DEFAULT_SCROLLVALUE );
- DECLARE_CONSTASCII_USTRING( FM_PROP_LINEINCREMENT );
- DECLARE_CONSTASCII_USTRING( FM_PROP_BLOCKINCREMENT );
- DECLARE_CONSTASCII_USTRING( FM_PROP_ORIENTATION );
- DECLARE_CONSTASCII_USTRING( FM_PROP_REPEAT );
- DECLARE_CONSTASCII_USTRING( FM_PROP_REPEATDELAY );
- DECLARE_CONSTASCII_USTRING( FM_PROP_SYMBOLCOLOR );
- DECLARE_CONSTASCII_USTRING( FM_PROP_VISIBILESIZE );
- DECLARE_CONSTASCII_USTRING( FM_PROP_SPINVALUE_MIN );
- DECLARE_CONSTASCII_USTRING( FM_PROP_SPINVALUE_MAX );
- DECLARE_CONSTASCII_USTRING( FM_PROP_DEFAULT_SPINVALUE );
- DECLARE_CONSTASCII_USTRING( FM_PROP_SPININCREMENT );
- DECLARE_CONSTASCII_USTRING( FM_PROP_LINEENDFORMAT );
- DECLARE_CONSTASCII_USTRING( FM_PROP_TOGGLE );
- DECLARE_CONSTASCII_USTRING( FM_PROP_FOCUSONCLICK );
- DECLARE_CONSTASCII_USTRING( FM_PROP_HIDEINACTIVESELECTION );
- DECLARE_CONSTASCII_USTRING( FM_PROP_VISUALEFFECT );
- DECLARE_CONSTASCII_USTRING( FM_PROP_BORDERCOLOR );
- DECLARE_CONSTASCII_USTRING( FM_PROP_DYNAMIC_CONTROL_BORDER );
- DECLARE_CONSTASCII_USTRING( FM_PROP_CONTROL_BORDER_COLOR_FOCUS );
- DECLARE_CONSTASCII_USTRING( FM_PROP_CONTROL_BORDER_COLOR_MOUSE );
- DECLARE_CONSTASCII_USTRING( FM_PROP_CONTROL_BORDER_COLOR_INVALID );
- DECLARE_CONSTASCII_USTRING( FM_PROP_BUTTON_TYPE );
- DECLARE_CONSTASCII_USTRING( FM_PROP_FORM_OPERATIONS );
- DECLARE_CONSTASCII_USTRING( FM_PROP_INPUT_REQUIRED );
- DECLARE_CONSTASCII_USTRING( FM_PROP_WRITING_MODE );
-
-} // namespace svxform
+#define FM_PROP_NAME rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Name" ) )
+#define FM_PROP_CLASSID rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ClassId" ) )
+#define FM_PROP_ALIGN rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Align" ) )
+#define FM_PROP_ROWCOUNT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "RowCount" ) )
+#define FM_PROP_ROWCOUNTFINAL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsRowCountFinal" ) )
+#define FM_PROP_FETCHSIZE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FetchSize" ) )
+#define FM_PROP_VALUE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Value" ) )
+#define FM_PROP_VALUEMIN rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ValueMin" ) )
+#define FM_PROP_VALUEMAX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ValueMax" ) )
+#define FM_PROP_VALUESTEP rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ValueStep" ) )
+#define FM_PROP_TEXT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Text" ) )
+#define FM_PROP_LABEL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Label" ) )
+#define FM_PROP_NAVIGATION rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "NavigationBarMode" ) )
+#define FM_PROP_CYCLE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Cycle" ) )
+#define FM_PROP_CONTROLSOURCE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DataField" ) )
+#define FM_PROP_ENABLED rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Enabled" ) )
+#define FM_PROP_SPIN rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Spin" ) )
+#define FM_PROP_READONLY rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ReadOnly" ) )
+#define FM_PROP_FILTER rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Filter" ) )
+#define FM_PROP_AUTOINCREMENT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsAutoIncrement" ) )
+#define FM_PROP_WIDTH rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Width" ) )
+#define FM_PROP_SEARCHABLE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsSearchable" ) )
+#define FM_PROP_MULTILINE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MultiLine" ) )
+#define FM_PROP_TARGET_URL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TargetURL" ) )
+#define FM_PROP_DEFAULTCONTROL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultControl" ) )
+#define FM_PROP_MAXTEXTLEN rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MaxTextLen" ) )
+#define FM_PROP_DATE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Date" ) )
+#define FM_PROP_TIME rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Time" ) )
+#define FM_PROP_STATE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "State" ) )
+#define FM_PROP_TRISTATE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TriState" ) )
+#define FM_PROP_STRINGITEMLIST rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StringItemList" ) )
+#define FM_PROP_DEFAULT_TEXT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultText" ) )
+#define FM_PROP_DEFAULTCHECKED rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultState" ) )
+#define FM_PROP_DEFAULT_DATE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultDate" ) )
+#define FM_PROP_DEFAULT_TIME rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultTime" ) )
+#define FM_PROP_DEFAULT_VALUE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultValue" ) )
+#define FM_PROP_FORMATKEY rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FormatKey" ) )
+#define FM_PROP_FORMATSSUPPLIER rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FormatsSupplier" ) )
+#define FM_PROP_LISTSOURCETYPE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ListSourceType" ) )
+#define FM_PROP_LISTSOURCE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ListSource" ) )
+#define FM_PROP_SELECT_SEQ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SelectedItems" ) )
+#define FM_PROP_VALUE_SEQ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ValueItemList" ) )
+#define FM_PROP_DEFAULT_SELECT_SEQ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultSelection" ) )
+#define FM_PROP_DECIMAL_ACCURACY rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DecimalAccuracy" ) )
+#define FM_PROP_EDITMASK rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "EditMask" ) )
+#define FM_PROP_ISREADONLY rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsReadOnly" ) )
+#define FM_PROP_FIELDTYPE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Type" ) )
+#define FM_PROP_REFVALUE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "RefValue" ) )
+#define FM_PROP_STRICTFORMAT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StrictFormat" ) )
+#define FM_PROP_DATASOURCE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DataSourceName" ) )
+#define FM_PROP_LITERALMASK rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LiteralMask" ) )
+#define FM_PROP_SHOWTHOUSANDSEP rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ShowThousandsSeparator" ) )
+#define FM_PROP_CURRENCYSYMBOL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CurrencySymbol" ) )
+#define FM_PROP_DATEFORMAT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DateFormat" ) )
+#define FM_PROP_DATEMIN rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DateMin" ) )
+#define FM_PROP_DATEMAX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DateMax" ) )
+#define FM_PROP_DATE_SHOW_CENTURY rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DateShowCentury" ) )
+#define FM_PROP_TIMEFORMAT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TimeFormat" ) )
+#define FM_PROP_TIMEMIN rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TimeMin" ) )
+#define FM_PROP_TIMEMAX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TimeMax" ) )
+#define FM_PROP_LINECOUNT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LineCount" ) )
+#define FM_PROP_BOUNDCOLUMN rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "BoundColumn" ) )
+#define FM_PROP_HASNAVIGATION rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HasNavigationBar" ) )
+#define FM_PROP_FONT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FontDescriptor" ) )
+#define FM_PROP_BACKGROUNDCOLOR rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "BackgroundColor" ) )
+#define FM_PROP_TEXTCOLOR rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TextColor" ) )
+#define FM_PROP_BORDER rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Border" ) )
+#define FM_PROP_DROPDOWN rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Dropdown" ) )
+#define FM_PROP_ROWHEIGHT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "RowHeight" ) )
+#define FM_PROP_HELPTEXT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HelpText" ) )
+#define FM_PROP_HELPURL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HelpURL" ) )
+#define FM_PROP_RECORDMARKER rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HasRecordMarker" ) )
+#define FM_PROP_BOUNDFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "BoundField" ) )
+#define FM_PROP_EFFECTIVE_VALUE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "EffectiveValue" ) )
+#define FM_PROP_EFFECTIVE_DEFAULT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "EffectiveDefault" ) )
+#define FM_PROP_EFFECTIVE_MIN rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "EffectiveMin" ) )
+#define FM_PROP_EFFECTIVE_MAX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "EffectiveMax" ) )
+#define FM_PROP_HIDDEN rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Hidden" ) )
+#define FM_PROP_FILTERPROPOSAL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UseFilterValueProposal" ) )
+#define FM_PROP_FIELDSOURCE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FieldSource" ) )
+#define FM_PROP_TABLENAME rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TableName" ) )
+#define FM_PROP_FILTERSUPPLIER rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FilterSupplier" ) )
+#define FM_PROP_CURRENTFILTER rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CurrentFilter" ) )
+#define FM_PROP_SELECTED_FIELDS rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SelectedFields" ) )
+#define FM_PROP_SELECTED_TABLES rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SelectedTables" ) )
+#define FM_PROP_THREADSAFE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ThreadSafe" ) )
+#define FM_PROP_CONTROLLABEL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LabelControl" ) )
+#define FM_PROP_CURSORCOLOR rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CursorColor" ) )
+#define FM_PROP_ALWAYSSHOWCURSOR rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AlwaysShowCursor" ) )
+#define FM_PROP_DISPLAYSYNCHRON rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DisplayIsSynchron" ) )
+#define FM_PROP_ISMODIFIED rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsModified" ) )
+#define FM_PROP_ISNEW rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsNew" ) )
+#define FM_PROP_PRIVILEGES rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Privileges" ) )
+#define FM_PROP_COMMAND rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Command" ) )
+#define FM_PROP_COMMANDTYPE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CommandType" ) )
+#define FM_PROP_RESULTSET_CONCURRENCY rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ResultSetConcurrency" ) )
+#define FM_PROP_INSERTONLY rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IgnoreResult" ) )
+#define FM_PROP_RESULTSET_TYPE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ResultSetType" ) )
+#define FM_PROP_ESCAPE_PROCESSING rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "EscapeProcessing" ) )
+#define FM_PROP_APPLYFILTER rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ApplyFilter" ) )
+#define FM_PROP_ISNULLABLE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsNullable" ) )
+#define FM_PROP_ACTIVECOMMAND rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ActiveCommand" ) )
+#define FM_PROP_ISCURRENCY rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsCurrency" ) )
+#define FM_PROP_URL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "URL" ) )
+#define FM_PROP_ACTIVE_CONNECTION rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ActiveConnection" ) )
+#define FM_PROP_SORT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Order" ) )
+#define FM_PROP_CONTROLSOURCEPROPERTY rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DataFieldProperty" ) )
+#define FM_PROP_REALNAME rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "RealName" ) )
+#define FM_PROP_TEXTLINECOLOR rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TextLineColor" ) )
+#define FM_PROP_FONTEMPHASISMARK rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FontEmphasisMark" ) )
+#define FM_PROP_FONTRELIEF rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FontRelief" ) )
+#define FM_PROP_SCROLLVALUE_MIN rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ScrollValueMin" ) )
+#define FM_PROP_SCROLLVALUE_MAX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ScrollValueMax" ) )
+#define FM_PROP_DEFAULT_SCROLLVALUE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultScrollValue" ) )
+#define FM_PROP_LINEINCREMENT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LineIncrement" ) )
+#define FM_PROP_BLOCKINCREMENT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "BlockIncrement" ) )
+#define FM_PROP_ORIENTATION rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Orientation" ) )
+#define FM_PROP_REPEAT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Repeat" ) )
+#define FM_PROP_REPEATDELAY rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "RepeatDelay" ) )
+#define FM_PROP_SYMBOLCOLOR rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SymbolColor" ) )
+#define FM_PROP_VISIBILESIZE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "VisibleSize" ) )
+#define FM_PROP_SPINVALUE_MIN rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SpinValueMin" ) )
+#define FM_PROP_SPINVALUE_MAX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SpinValueMax" ) )
+#define FM_PROP_DEFAULT_SPINVALUE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultSpinValue" ) )
+#define FM_PROP_SPININCREMENT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SpinIncrement" ) )
+#define FM_PROP_LINEENDFORMAT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LineEndFormat" ) )
+#define FM_PROP_TOGGLE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Toggle" ) )
+#define FM_PROP_FOCUSONCLICK rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FocusOnClick" ) )
+#define FM_PROP_HIDEINACTIVESELECTION rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HideInactiveSelection" ) )
+#define FM_PROP_VISUALEFFECT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "VisualEffect" ) )
+#define FM_PROP_BORDERCOLOR rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "BorderColor" ) )
+#define FM_PROP_DYNAMIC_CONTROL_BORDER rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DynamicControlBorder" ) )
+#define FM_PROP_CONTROL_BORDER_COLOR_FOCUS rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ControlBorderColorOnFocus" ) )
+#define FM_PROP_CONTROL_BORDER_COLOR_MOUSE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ControlBorderColorOnHover" ) )
+#define FM_PROP_CONTROL_BORDER_COLOR_INVALID rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ControlBorderColorOnInvalid" ) )
+#define FM_PROP_BUTTON_TYPE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ButtonType" ) )
+#define FM_PROP_FORM_OPERATIONS rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FormOperations" ) )
+#define FM_PROP_INPUT_REQUIRED rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "InputRequired" ) )
+#define FM_PROP_WRITING_MODE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "WritingMode" ) )
+#define FM_PROP_MOUSE_WHEEL_BEHAVIOR rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MouseWheelBehavior" ) )
#endif // _SVX_FMPROP_HRC
-
diff --git a/svx/source/inc/fmservs.hxx b/svx/source/inc/fmservs.hxx
index 2e3d30cf0e..165630eab8 100644
--- a/svx/source/inc/fmservs.hxx
+++ b/svx/source/inc/fmservs.hxx
@@ -30,76 +30,64 @@
#ifndef _SVX_FMSERVS_HXX
#define _SVX_FMSERVS_HXX
-#include "fmstatic.hxx"
+#include <svx/svxdllapi.h>
+
+#define FM_NUMBER_FORMATTER rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.NumberFormatter" ) )
+#define FM_COMPONENT_EDIT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.Edit" ) )
+#define FM_COMPONENT_TEXTFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.TextField" ) )
+#define FM_COMPONENT_LISTBOX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.ListBox" ) )
+#define FM_COMPONENT_COMBOBOX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.ComboBox" ) )
+#define FM_COMPONENT_RADIOBUTTON rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.RadioButton" ) )
+#define FM_COMPONENT_GROUPBOX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.GroupBox" ) )
+#define FM_COMPONENT_FIXEDTEXT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.FixedText" ) )
+#define FM_COMPONENT_COMMANDBUTTON rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.CommandButton" ) )
+#define FM_COMPONENT_CHECKBOX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.CheckBox" ) )
+#define FM_COMPONENT_GRID rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.Grid" ) )
+#define FM_COMPONENT_GRIDCONTROL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.GridControl" ) )
+#define FM_COMPONENT_IMAGEBUTTON rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.ImageButton" ) )
+#define FM_COMPONENT_FILECONTROL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.FileControl" ) )
+#define FM_COMPONENT_TIMEFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.TimeField" ) )
+#define FM_COMPONENT_DATEFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.DateField" ) )
+#define FM_COMPONENT_NUMERICFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.NumericField" ) )
+#define FM_COMPONENT_CURRENCYFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.CurrencyField" ) )
+#define FM_COMPONENT_PATTERNFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.PatternField" ) )
+#define FM_COMPONENT_FORMATTEDFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.FormattedField" ) )
+#define FM_COMPONENT_HIDDEN rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.Hidden" ) )
+#define FM_COMPONENT_HIDDENCONTROL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.HiddenControl" ) )
+#define FM_COMPONENT_IMAGECONTROL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.ImageControl" ) )
+#define FM_CONTROL_GRID rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.control.Grid" ) )
+#define FM_CONTROL_GRIDCONTROL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.control.GridControl" ) )
+#define FM_FORM_CONTROLLER rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.FormController" ) )
+#define SRV_SDB_CONNECTION rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sdb.Connection" ) )
+#define SRV_SDB_INTERACTION_HANDLER rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sdb.InteractionHandler" ) )
+#define FM_SUN_COMPONENT_FORM rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.Form" ) )
+#define FM_SUN_COMPONENT_TEXTFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.TextField" ) )
+#define FM_SUN_COMPONENT_LISTBOX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.ListBox" ) )
+#define FM_SUN_COMPONENT_COMBOBOX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.ComboBox" ) )
+#define FM_SUN_COMPONENT_RADIOBUTTON rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.RadioButton" ) )
+#define FM_SUN_COMPONENT_GROUPBOX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.GroupBox" ) )
+#define FM_SUN_COMPONENT_FIXEDTEXT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.FixedText" ) )
+#define FM_SUN_COMPONENT_COMMANDBUTTON rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.CommandButton" ) )
+#define FM_SUN_COMPONENT_CHECKBOX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.CheckBox" ) )
+#define FM_SUN_COMPONENT_GRIDCONTROL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.GridControl" ) )
+#define FM_SUN_COMPONENT_IMAGEBUTTON rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.ImageButton" ) )
+#define FM_SUN_COMPONENT_FILECONTROL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.FileControl" ) )
+#define FM_SUN_COMPONENT_TIMEFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.TimeField" ) )
+#define FM_SUN_COMPONENT_DATEFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.DateField" ) )
+#define FM_SUN_COMPONENT_NUMERICFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.NumericField" ) )
+#define FM_SUN_COMPONENT_CURRENCYFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.CurrencyField" ) )
+#define FM_SUN_COMPONENT_PATTERNFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.PatternField" ) )
+#define FM_SUN_COMPONENT_HIDDENCONTROL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.HiddenControl" ) )
+#define FM_SUN_COMPONENT_IMAGECONTROL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.DatabaseImageControl" ) )
+#define FM_SUN_COMPONENT_FORMATTEDFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.FormattedField" ) )
+#define FM_SUN_COMPONENT_SCROLLBAR rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.ScrollBar" ) )
+#define FM_SUN_COMPONENT_SPINBUTTON rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.SpinButton" ) )
+#define FM_SUN_COMPONENT_NAVIGATIONBAR rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.NavigationToolBar" ) )
+#define FM_SUN_CONTROL_GRIDCONTROL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.control.GridControl" ) )
namespace svxform
{
-
- DECLARE_CONSTASCII_USTRING(FM_NUMBER_FORMATTER);
-
- DECLARE_CONSTASCII_USTRING(FM_COMPONENT_EDIT); // alter service name (5.0)
- DECLARE_CONSTASCII_USTRING(FM_COMPONENT_TEXTFIELD);
-
- DECLARE_CONSTASCII_USTRING(FM_COMPONENT_LISTBOX);
- DECLARE_CONSTASCII_USTRING(FM_COMPONENT_COMBOBOX);
- DECLARE_CONSTASCII_USTRING(FM_COMPONENT_RADIOBUTTON);
- DECLARE_CONSTASCII_USTRING(FM_COMPONENT_GROUPBOX);
- DECLARE_CONSTASCII_USTRING(FM_COMPONENT_FIXEDTEXT);
- DECLARE_CONSTASCII_USTRING(FM_COMPONENT_COMMANDBUTTON);
- DECLARE_CONSTASCII_USTRING(FM_COMPONENT_CHECKBOX);
-
- DECLARE_CONSTASCII_USTRING(FM_COMPONENT_GRID); // alter service name (5.0)
- DECLARE_CONSTASCII_USTRING(FM_COMPONENT_GRIDCONTROL);
-
- DECLARE_CONSTASCII_USTRING(FM_COMPONENT_IMAGEBUTTON);
- DECLARE_CONSTASCII_USTRING(FM_COMPONENT_FILECONTROL);
- DECLARE_CONSTASCII_USTRING(FM_COMPONENT_TIMEFIELD);
- DECLARE_CONSTASCII_USTRING(FM_COMPONENT_DATEFIELD);
- DECLARE_CONSTASCII_USTRING(FM_COMPONENT_NUMERICFIELD);
- DECLARE_CONSTASCII_USTRING(FM_COMPONENT_CURRENCYFIELD);
- DECLARE_CONSTASCII_USTRING(FM_COMPONENT_PATTERNFIELD);
- DECLARE_CONSTASCII_USTRING(FM_COMPONENT_FORMATTEDFIELD);
-
- DECLARE_CONSTASCII_USTRING(FM_COMPONENT_HIDDEN); // alter service name (5.0)
- DECLARE_CONSTASCII_USTRING(FM_COMPONENT_HIDDENCONTROL);
-
- DECLARE_CONSTASCII_USTRING(FM_COMPONENT_IMAGECONTROL);
-
- DECLARE_CONSTASCII_USTRING(FM_CONTROL_GRID);
- DECLARE_CONSTASCII_USTRING(FM_CONTROL_GRIDCONTROL);
-
- DECLARE_CONSTASCII_USTRING(FM_FORM_CONTROLLER);
- DECLARE_CONSTASCII_USTRING(SRV_SDB_CONNECTION);
- DECLARE_CONSTASCII_USTRING(SRV_SDB_INTERACTION_HANDLER);
-
- DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_FORM);
- DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_TEXTFIELD);
- DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_LISTBOX);
- DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_COMBOBOX);
- DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_RADIOBUTTON);
- DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_GROUPBOX);
- DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_FIXEDTEXT);
- DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_COMMANDBUTTON);
- DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_CHECKBOX);
- DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_GRIDCONTROL);
- DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_IMAGEBUTTON);
- DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_FILECONTROL);
- DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_TIMEFIELD);
- DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_DATEFIELD);
- DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_NUMERICFIELD);
- DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_CURRENCYFIELD);
- DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_PATTERNFIELD);
- DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_HIDDENCONTROL);
- DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_IMAGECONTROL);
- DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_FORMATTEDFIELD);
- DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_SCROLLBAR);
- DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_SPINBUTTON);
- DECLARE_CONSTASCII_USTRING(FM_SUN_COMPONENT_NAVIGATIONBAR);
-
- DECLARE_CONSTASCII_USTRING(FM_SUN_CONTROL_GRIDCONTROL);
-
- void ImplSmartRegisterUnoServices();
-
+ SVX_DLLPUBLIC void ImplSmartRegisterUnoServices();
} // namespace svxform
#endif // _SVX_FMSERVS_HXX
diff --git a/svx/source/inc/fmshimp.hxx b/svx/source/inc/fmshimp.hxx
index 481acade50..350bf26a5f 100644
--- a/svx/source/inc/fmshimp.hxx
+++ b/svx/source/inc/fmshimp.hxx
@@ -422,7 +422,7 @@ public:
/** retrieves the current selection
*/
- void getCurrentSelection( InterfaceBag& /* [out] */ _rSelection ) const;
+ SVX_DLLPUBLIC void getCurrentSelection( InterfaceBag& /* [out] */ _rSelection ) const;
/** sets a new current selection as indicated by a mark list
@return
@@ -631,7 +631,7 @@ public:
// ========================================================================
SV_DECL_PTRARR_DEL(StatusForwarderArray, SfxStatusForwarder*, 16, 0)
-class SAL_DLLPRIVATE ControlConversionMenuController : public SfxMenuControl
+class SVX_DLLPUBLIC ControlConversionMenuController : public SfxMenuControl
{
protected:
StatusForwarderArray m_aStatusForwarders;
@@ -639,11 +639,11 @@ protected:
PopupMenu* m_pConversionMenu;
public:
- ControlConversionMenuController(sal_uInt16 nId, Menu& rMenu, SfxBindings& rBindings);
- virtual ~ControlConversionMenuController();
+ SVX_DLLPRIVATE ControlConversionMenuController(sal_uInt16 nId, Menu& rMenu, SfxBindings& rBindings);
+ SVX_DLLPRIVATE virtual ~ControlConversionMenuController();
SFX_DECL_MENU_CONTROL();
- virtual void StateChanged(sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState);
+ SVX_DLLPRIVATE virtual void StateChanged(sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState);
};
//==================================================================
diff --git a/svx/source/inc/fmstatic.hxx b/svx/source/inc/fmstatic.hxx
deleted file mode 100644
index f34bf276af..0000000000
--- a/svx/source/inc/fmstatic.hxx
+++ /dev/null
@@ -1,81 +0,0 @@
-/*************************************************************************
- *
- * 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: fmstatic.hxx,v $
- * $Revision: 1.6 $
- *
- * 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 _FM_STATIC_HXX_
-#define _FM_STATIC_HXX_
-#include <tools/string.hxx>
-
-struct ConstAsciiString
-{
- const sal_Char* ascii;
- sal_Int32 length;
-
- inline operator const ::rtl::OUString () const;
- inline operator const sal_Char* () const { return ascii; }
-
- inline ConstAsciiString(const sal_Char* _pAsciiZeroTerminated, const sal_Int32 _nLength);
- inline ~ConstAsciiString();
-
-private:
- mutable ::rtl::OUString* ustring;
-};
-
-//------------------------------------------------------------
-inline ConstAsciiString::ConstAsciiString(const sal_Char* _pAsciiZeroTerminated, const sal_Int32 _nLength)
- :ascii(_pAsciiZeroTerminated)
- ,length(_nLength)
- ,ustring(NULL)
-{
-}
-
-//------------------------------------------------------------
-inline ConstAsciiString::~ConstAsciiString()
-{
- delete ustring;
- ustring = NULL;
-}
-
-//------------------------------------------------------------
-inline ConstAsciiString::operator const ::rtl::OUString () const
-{
- if (!ustring)
- ustring = new ::rtl::OUString(ascii, length, RTL_TEXTENCODING_ASCII_US);
- return *ustring;
-}
-
-#define DECLARE_CONSTASCII_USTRING(name) \
- extern ConstAsciiString name
-
-#define IMPLEMENT_CONSTASCII_USTRING(name, asciivalue) \
- ConstAsciiString name(asciivalue, sizeof(asciivalue) - 1)
-
-
-#endif // _FM_STATIC_HXX_
-
diff --git a/svx/source/inc/fmtools.hxx b/svx/source/inc/fmtools.hxx
index 3da2c92116..3c71698f06 100644
--- a/svx/source/inc/fmtools.hxx
+++ b/svx/source/inc/fmtools.hxx
@@ -96,7 +96,8 @@
#include <cppuhelper/implbase2.hxx>
#include <cppuhelper/implbase3.hxx>
#include <cppuhelper/component.hxx>
-#include "fmstatic.hxx"
+
+#include <svx/svxdllapi.h>
#include <set>
@@ -109,19 +110,12 @@ class Window;
// display info about a simple ::com::sun::star::sdbc::SQLException
void displayException(const ::com::sun::star::sdbc::SQLException&, Window* _pParent = NULL);
void displayException(const ::com::sun::star::sdbc::SQLWarning&, Window* _pParent = NULL);
-void displayException(const ::com::sun::star::sdb::SQLContext&, Window* _pParent = NULL);
+SVX_DLLPUBLIC void displayException(const ::com::sun::star::sdb::SQLContext&, Window* _pParent = NULL);
void displayException(const ::com::sun::star::sdb::SQLErrorEvent&, Window* _pParent = NULL);
void displayException(const ::com::sun::star::uno::Any&, Window* _pParent = NULL);
-// StringConversion
-namespace svxform
-{
- // modes for the XModeSelector
- DECLARE_CONSTASCII_USTRING(DATA_MODE);
- DECLARE_CONSTASCII_USTRING(FILTER_MODE);
-
-} // namespace svxform
-
+#define DATA_MODE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DataMode" ) )
+#define FILTER_MODE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FilterMode" ) )
// Kopieren von Persistenten Objecten
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> cloneUsingProperties(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XPersistObject>& _xObj);
@@ -139,7 +133,7 @@ String getFormComponentAccessPath(const ::com::sun::star::uno::Reference< ::com:
::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel> getXModel(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& xIface);
-::rtl::OUString getLabelName(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& xControlModel);
+SVX_DLLPUBLIC ::rtl::OUString getLabelName(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& xControlModel);
// ===================================================================================================
// = class CursorWrapper - eine Hilfsklasse, die parallel mit je einem ::com::sun::star::uno::Reference<XDatabaseUpdateCursor>,
@@ -159,7 +153,7 @@ public:
// Construction/Destruction
CursorWrapper() { }
CursorWrapper(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet>& _rxCursor, sal_Bool bUseCloned = sal_False);
- CursorWrapper(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet>& _rxCursor, sal_Bool bUseCloned = sal_False);
+ SVX_DLLPUBLIC CursorWrapper(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet>& _rxCursor, sal_Bool bUseCloned = sal_False);
// bei bUseCloned == sal_True wird der Cursor ueber das XCloneable-Interface (dass er besitzen muss) gedoubled und
// erst dann benutzt
diff --git a/svx/source/inc/fmurl.hxx b/svx/source/inc/fmurl.hxx
index 6333e8be9f..9513fa1841 100644
--- a/svx/source/inc/fmurl.hxx
+++ b/svx/source/inc/fmurl.hxx
@@ -31,46 +31,33 @@
#ifndef _SVX_FMURL_HXX
#define _SVX_FMURL_HXX
-#include "fmstatic.hxx"
-
-namespace svxform
-{
-
- DECLARE_CONSTASCII_USTRING(FMURL_FORMSLOTS_PREFIX);
-
- DECLARE_CONSTASCII_USTRING(FMURL_FORM_POSITION);
- DECLARE_CONSTASCII_USTRING(FMURL_FORM_RECORDCOUNT);
- DECLARE_CONSTASCII_USTRING(FMURL_RECORD_MOVEFIRST);
- DECLARE_CONSTASCII_USTRING(FMURL_RECORD_MOVEPREV);
- DECLARE_CONSTASCII_USTRING(FMURL_RECORD_MOVENEXT);
- DECLARE_CONSTASCII_USTRING(FMURL_RECORD_MOVELAST);
- DECLARE_CONSTASCII_USTRING(FMURL_RECORD_MOVETONEW);
- DECLARE_CONSTASCII_USTRING(FMURL_RECORD_UNDO);
- DECLARE_CONSTASCII_USTRING(FMURL_RECORD_SAVE);
- DECLARE_CONSTASCII_USTRING(FMURL_RECORD_DELETE);
- DECLARE_CONSTASCII_USTRING(FMURL_FORM_REFRESH);
- DECLARE_CONSTASCII_USTRING(FMURL_FORM_REFRESH_CURRENT_CONTROL);
-
- DECLARE_CONSTASCII_USTRING(FMURL_FORM_SORT_UP);
- DECLARE_CONSTASCII_USTRING(FMURL_FORM_SORT_DOWN);
- DECLARE_CONSTASCII_USTRING(FMURL_FORM_SORT);
- DECLARE_CONSTASCII_USTRING(FMURL_FORM_AUTO_FILTER);
- DECLARE_CONSTASCII_USTRING(FMURL_FORM_FILTER);
- DECLARE_CONSTASCII_USTRING(FMURL_FORM_APPLY_FILTER);
- DECLARE_CONSTASCII_USTRING(FMURL_FORM_REMOVE_FILTER);
-
- DECLARE_CONSTASCII_USTRING(FMURL_CONFIRM_DELETION);
-
- DECLARE_CONSTASCII_USTRING(FMURL_COMPONENT_FORMGRIDVIEW);
- DECLARE_CONSTASCII_USTRING(FMURL_GRIDVIEW_CLEARVIEW);
- DECLARE_CONSTASCII_USTRING(FMURL_GRIDVIEW_ADDCOLUMN);
- DECLARE_CONSTASCII_USTRING(FMURL_GRIDVIEW_ATTACHTOFORM);
-
- DECLARE_CONSTASCII_USTRING(FMARG_ATTACHTO_MASTERFORM);
- DECLARE_CONSTASCII_USTRING(FMARG_ADDCOL_COLUMNTYPE);
- DECLARE_CONSTASCII_USTRING(FMARG_ADDCOL_COLUMNPOS);
-
-} // namespace svxform
+#define FMURL_FORMSLOTS_PREFIX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/" ) )
+#define FMURL_FORM_POSITION rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/positionForm" ) )
+#define FMURL_FORM_RECORDCOUNT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/RecordCount" ) )
+#define FMURL_RECORD_MOVEFIRST rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/moveToFirst" ) )
+#define FMURL_RECORD_MOVEPREV rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/moveToPrev" ) )
+#define FMURL_RECORD_MOVENEXT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/moveToNext" ) )
+#define FMURL_RECORD_MOVELAST rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/moveToLast" ) )
+#define FMURL_RECORD_MOVETONEW rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/moveToNew" ) )
+#define FMURL_RECORD_UNDO rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/undoRecord" ) )
+#define FMURL_RECORD_SAVE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/saveRecord" ) )
+#define FMURL_RECORD_DELETE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/deleteRecord" ) )
+#define FMURL_FORM_REFRESH rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/refreshForm" ) )
+#define FMURL_FORM_REFRESH_CURRENT_CONTROL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/refreshCurrentControl" ) )
+#define FMURL_FORM_SORT_UP rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/sortUp" ) )
+#define FMURL_FORM_SORT_DOWN rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/sortDown" ) )
+#define FMURL_FORM_SORT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/sort" ) )
+#define FMURL_FORM_AUTO_FILTER rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/autoFilter" ) )
+#define FMURL_FORM_FILTER rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/filter" ) )
+#define FMURL_FORM_APPLY_FILTER rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/applyFilter" ) )
+#define FMURL_FORM_REMOVE_FILTER rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormController/removeFilterOrder" ) )
+#define FMURL_CONFIRM_DELETION rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormSlots/ConfirmDeletion" ) )
+#define FMURL_COMPONENT_FORMGRIDVIEW rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".component:DB/FormGridView" ) )
+#define FMURL_GRIDVIEW_CLEARVIEW rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormSlots/ClearView" ) )
+#define FMURL_GRIDVIEW_ADDCOLUMN rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormSlots/AddGridColumn" ) )
+#define FMURL_GRIDVIEW_ATTACHTOFORM rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormSlots/AttachToForm" ) )
+#define FMARG_ATTACHTO_MASTERFORM rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MasterForm" ) )
+#define FMARG_ADDCOL_COLUMNTYPE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ColumnType" ) )
+#define FMARG_ADDCOL_COLUMNPOS rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ColumnPosition" ) )
#endif // _SVX_FMURL_HXX
-
diff --git a/svx/source/inc/formtoolbars.hxx b/svx/source/inc/formtoolbars.hxx
index a833ff1273..2083e2baa8 100644
--- a/svx/source/inc/formtoolbars.hxx
+++ b/svx/source/inc/formtoolbars.hxx
@@ -31,14 +31,13 @@
#ifndef SVX_SOURCE_INC_FORMTOOLBARS_HXX
#define SVX_SOURCE_INC_FORMTOOLBARS_HXX
-/** === begin UNO includes === **/
-/** === end UNO includes === **/
-
#include "fmdocumentclassification.hxx"
#include <com/sun/star/frame/XLayoutManager.hpp>
#include <tools/solar.h>
+#include <svx/svxdllapi.h>
+
//........................................................................
namespace svxform
{
@@ -58,7 +57,7 @@ namespace svxform
@param _rxFrame
the frame to analyze
*/
- FormToolboxes(
+ SVX_DLLPUBLIC FormToolboxes(
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _rxFrame
);
@@ -66,16 +65,16 @@ namespace svxform
/** retrieves the URI for the toolbox associated with the given slot, depending
on the type of our document
*/
- ::rtl::OUString
+ SVX_DLLPUBLIC ::rtl::OUString
getToolboxResourceName( USHORT _nSlotId ) const;
/** toggles the toolbox associated with the given slot
*/
- void toggleToolbox( USHORT _nSlotId ) const;
+ SVX_DLLPUBLIC void toggleToolbox( USHORT _nSlotId ) const;
/** determines whether the toolbox associated with the given slot is currently visible
*/
- bool isToolboxVisible( USHORT _nSlotId ) const;
+ SVX_DLLPUBLIC bool isToolboxVisible( USHORT _nSlotId ) const;
/** ensures that a given toolbox is visible
*/
diff --git a/svx/source/inc/gridcols.hxx b/svx/source/inc/gridcols.hxx
index a8fb271abe..9b7930837e 100644
--- a/svx/source/inc/gridcols.hxx
+++ b/svx/source/inc/gridcols.hxx
@@ -30,25 +30,20 @@
#ifndef _SVX_GRIDCOLS_HXX
#define _SVX_GRIDCOLS_HXX
-#include "fmstatic.hxx"
+#include <sal/types.h>
-namespace svxform
-{
-
- // list of possible controls
- DECLARE_CONSTASCII_USTRING(FM_COL_TEXTFIELD);
- DECLARE_CONSTASCII_USTRING(FM_COL_CHECKBOX);
- DECLARE_CONSTASCII_USTRING(FM_COL_COMBOBOX);
- DECLARE_CONSTASCII_USTRING(FM_COL_LISTBOX);
- DECLARE_CONSTASCII_USTRING(FM_COL_NUMERICFIELD);
- DECLARE_CONSTASCII_USTRING(FM_COL_DATEFIELD);
- DECLARE_CONSTASCII_USTRING(FM_COL_TIMEFIELD);
- DECLARE_CONSTASCII_USTRING(FM_COL_CURRENCYFIELD);
- DECLARE_CONSTASCII_USTRING(FM_COL_PATTERNFIELD);
- DECLARE_CONSTASCII_USTRING(FM_COL_FORMATTEDFIELD);
-
-} // namespace svxform
+namespace rtl { class OUString; }
+#define FM_COL_TEXTFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TextField" ) )
+#define FM_COL_COMBOBOX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ComboBox" ) )
+#define FM_COL_CHECKBOX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CheckBox" ) )
+#define FM_COL_TIMEFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TimeField" ) )
+#define FM_COL_DATEFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DateField" ) )
+#define FM_COL_NUMERICFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "NumericField" ) )
+#define FM_COL_CURRENCYFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CurrencyField" ) )
+#define FM_COL_PATTERNFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PatternField" ) )
+#define FM_COL_LISTBOX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ListBox" ) )
+#define FM_COL_FORMATTEDFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FormattedField" ) )
// column type ids
#define TYPE_CHECKBOX 0
diff --git a/svx/source/inc/sqlparserclient.hxx b/svx/source/inc/sqlparserclient.hxx
index 398c638c73..61e0e951bd 100644
--- a/svx/source/inc/sqlparserclient.hxx
+++ b/svx/source/inc/sqlparserclient.hxx
@@ -43,7 +43,7 @@ namespace svxform
//====================================================================
//= OSQLParserClient
//====================================================================
- class OSQLParserClient : public ODbtoolsClient
+ class SVX_DLLPUBLIC OSQLParserClient : public ODbtoolsClient
,public ::svxform::OParseContextClient
{
private:
diff --git a/svx/source/inc/stringlistresource.hxx b/svx/source/inc/stringlistresource.hxx
index 3db48e105d..8fb8ff9db2 100644
--- a/svx/source/inc/stringlistresource.hxx
+++ b/svx/source/inc/stringlistresource.hxx
@@ -31,11 +31,10 @@
#ifndef SVX_STRINGLISTRESOURCE_HXX
#define SVX_STRINGLISTRESOURCE_HXX
-/** === begin UNO includes === **/
-/** === end UNO includes === **/
-
#include <tools/rc.hxx>
+#include <svx/svxdllapi.h>
+
#include <memory>
//........................................................................
@@ -52,8 +51,8 @@ namespace svx
class StringListResource : public Resource
{
public:
- StringListResource( const ResId& _rResId );
- ~StringListResource();
+ SVX_DLLPUBLIC StringListResource( const ResId& _rResId );
+ SVX_DLLPUBLIC ~StringListResource();
inline void get( ::std::vector< String >& _rStrings )
{
diff --git a/svx/source/inc/unoedprx.hxx b/svx/source/inc/unoedprx.hxx
index cf510f63dd..8edb9c773d 100644
--- a/svx/source/inc/unoedprx.hxx
+++ b/svx/source/inc/unoedprx.hxx
@@ -79,7 +79,10 @@ public:
virtual sal_Bool GetAttributeRun( USHORT& nStartIndex, USHORT& nEndIndex, USHORT nPara, USHORT nIndex ) const;
virtual USHORT GetLineCount( USHORT nPara ) const;
virtual USHORT GetLineLen( USHORT nPara, USHORT nLine ) const;
- virtual sal_Bool Delete( const ESelection& );
+ virtual void GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT nParagraph, USHORT nLine ) const;
+ virtual USHORT GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const;
+
+ virtual sal_Bool Delete( const ESelection& );
virtual sal_Bool InsertText( const String&, const ESelection& );
virtual sal_Bool QuickFormatDoc( BOOL bFull=FALSE );
virtual sal_Int16 GetDepth( USHORT nPara ) const;
@@ -118,12 +121,13 @@ public:
SvxAccessibleTextEditViewAdapter();
virtual ~SvxAccessibleTextEditViewAdapter();
+ // SvxViewForwarder interface
virtual BOOL IsValid() const;
-
virtual Rectangle GetVisArea() const;
virtual Point LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const;
virtual Point PixelToLogic( const Point& rPoint, const MapMode& rMapMode ) const;
+ // SvxEditViewForwarder interface
virtual sal_Bool GetSelection( ESelection& rSelection ) const;
virtual sal_Bool SetSelection( const ESelection& rSelection );
virtual sal_Bool Copy();
diff --git a/svx/source/inc/unogalthemeprovider.hxx b/svx/source/inc/unogalthemeprovider.hxx
index e4cfa57359..c4e3cf0287 100644
--- a/svx/source/inc/unogalthemeprovider.hxx
+++ b/svx/source/inc/unogalthemeprovider.hxx
@@ -36,6 +36,8 @@
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/gallery/XGalleryThemeProvider.hpp>
+#include <svx/svxdllapi.h>
+
class Gallery;
namespace unogallery {
@@ -60,8 +62,8 @@ public:
GalleryThemeProvider();
~GalleryThemeProvider();
- static ::rtl::OUString getImplementationName_Static() throw();
- static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static() throw();
+ SVX_DLLPUBLIC static ::rtl::OUString getImplementationName_Static() throw();
+ SVX_DLLPUBLIC static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static() throw();
protected:
diff --git a/svx/source/inc/unopolyhelper.hxx b/svx/source/inc/unopolyhelper.hxx
index 431b40cea2..e912d02ad4 100644
--- a/svx/source/inc/unopolyhelper.hxx
+++ b/svx/source/inc/unopolyhelper.hxx
@@ -33,6 +33,8 @@
#include <com/sun/star/lang/IllegalArgumentException.hpp>
+#include <svx/svxdllapi.h>
+
namespace com { namespace sun { namespace star { namespace drawing {
struct PolyPolygonBezierCoords;
} } } }
@@ -48,7 +50,7 @@ basegfx::B2DPolyPolygon SvxConvertPolyPolygonBezierToB2DPolyPolygon( const com::
/** convert a B2DPolyPolygon to a drawing::PolyPolygonBezierCoords
*/
-void SvxConvertB2DPolyPolygonToPolyPolygonBezier( const basegfx::B2DPolyPolygon& rPolyPoly, com::sun::star::drawing::PolyPolygonBezierCoords& rRetval );
+SVX_DLLPUBLIC void SvxConvertB2DPolyPolygonToPolyPolygonBezier( const basegfx::B2DPolyPolygon& rPolyPoly, com::sun::star::drawing::PolyPolygonBezierCoords& rRetval );
#endif
diff --git a/svx/source/items/makefile.mk b/svx/source/items/makefile.mk
index c6cae54647..ef4bf0b001 100644
--- a/svx/source/items/makefile.mk
+++ b/svx/source/items/makefile.mk
@@ -38,6 +38,7 @@ PROJECTPCHSOURCE=$(PRJ)$/util$/svxpch
PRJNAME=svx
TARGET=items
+LIBTARGET=NO
# --- Settings -----------------------------------------------------
@@ -51,41 +52,45 @@ SRC1FILES = \
svxerr.src \
svxitems.src
-SLOFILES= \
- $(SLO)$/ofaitem.obj \
+LIB1TARGET= $(SLB)$/$(TARGET)-core.lib
+LIB1OBJFILES= \
$(SLO)$/writingmodeitem.obj \
$(SLO)$/frmitems.obj \
$(SLO)$/paraitem.obj \
$(SLO)$/textitem.obj \
- $(SLO)$/postattr.obj \
$(SLO)$/flditem.obj \
- $(SLO)$/hlnkitem.obj \
$(SLO)$/svxfont.obj \
- $(SLO)$/pageitem.obj \
- $(SLO)$/viewlayoutitem.obj \
- $(SLO)$/paperinf.obj \
+ $(SLO)$/paperinf.obj \
$(SLO)$/drawitem.obj \
- $(SLO)$/algitem.obj \
$(SLO)$/itemtype.obj \
- $(SLO)$/rotmodit.obj \
- $(SLO)$/numinf.obj \
- $(SLO)$/svxerr.obj \
- $(SLO)$/numfmtsh.obj \
- $(SLO)$/zoomitem.obj \
$(SLO)$/chrtitem.obj \
$(SLO)$/bulitem.obj \
$(SLO)$/e3ditem.obj \
$(SLO)$/numitem.obj \
$(SLO)$/grfitem.obj \
$(SLO)$/clipfmtitem.obj \
- $(SLO)$/svxempty.obj \
$(SLO)$/xmlcnitm.obj \
$(SLO)$/customshapeitem.obj \
- $(SLO)$/charhiddenitem.obj \
+ $(SLO)$/charhiddenitem.obj
+
+LIB2TARGET= $(SLB)$/$(TARGET).lib
+LIB2OBJFILES= \
+ $(SLO)$/ofaitem.obj \
+ $(SLO)$/postattr.obj \
+ $(SLO)$/hlnkitem.obj \
+ $(SLO)$/pageitem.obj \
+ $(SLO)$/viewlayoutitem.obj \
+ $(SLO)$/algitem.obj \
+ $(SLO)$/rotmodit.obj \
+ $(SLO)$/numinf.obj \
+ $(SLO)$/svxerr.obj \
+ $(SLO)$/numfmtsh.obj \
+ $(SLO)$/zoomitem.obj \
+ $(SLO)$/svxempty.obj \
$(SLO)$/SmartTagItem.obj \
$(SLO)$/zoomslideritem.obj \
-
+SLOFILES = $(LIB1OBJFILES) $(LIB2OBJFILES)
EXCEPTIONSFILES= \
$(SLO)$/paraitem.obj \
diff --git a/svx/source/items/textitem.cxx b/svx/source/items/textitem.cxx
index 32e8b9f617..8460558e67 100644
--- a/svx/source/items/textitem.cxx
+++ b/svx/source/items/textitem.cxx
@@ -485,6 +485,13 @@ SfxItemPresentation SvxFontItem::GetPresentation
return SFX_ITEM_PRESENTATION_NONE;
}
+//------------------------------------------------------------------------
+
+void SvxFontItem::EnableStoreUnicodeNames( BOOL bEnable )
+{
+ bEnableStoreUnicodeNames = bEnable;
+}
+
// class SvxPostureItem --------------------------------------------------
SvxPostureItem::SvxPostureItem( const FontItalic ePosture, const USHORT nId ) :
diff --git a/svx/source/msfilter/escherex.cxx b/svx/source/msfilter/escherex.cxx
index 4eeeda8171..d21aa84a2d 100644
--- a/svx/source/msfilter/escherex.cxx
+++ b/svx/source/msfilter/escherex.cxx
@@ -156,14 +156,6 @@ EscherExClientAnchor_Base::~EscherExClientAnchor_Base()
// ---------------------------------------------------------------------------------------------
-struct EscherPropSortStruct
-{
- sal_uInt8* pBuf;
- sal_uInt32 nPropSize;
- sal_uInt32 nPropValue;
- sal_uInt16 nPropId;
-};
-
void EscherPropertyContainer::ImplInit()
{
nSortCount = 0;
@@ -275,21 +267,40 @@ void EscherPropertyContainer::AddOpt( sal_uInt16 nPropID, sal_Bool bBlib, sal_uI
}
}
-sal_Bool EscherPropertyContainer::GetOpt( sal_uInt16 nPropId, sal_uInt32& nPropValue ) const
+sal_Bool EscherPropertyContainer::GetOpt( sal_uInt16 nPropId, sal_uInt32& rPropValue ) const
+{
+ EscherPropSortStruct aPropStruct;
+
+ if ( GetOpt( nPropId, aPropStruct ) )
+ {
+ rPropValue = aPropStruct.nPropValue;
+ return sal_True;
+ }
+ return sal_False;
+}
+
+sal_Bool EscherPropertyContainer::GetOpt( sal_uInt16 nPropId, EscherPropSortStruct& rPropValue ) const
{
- sal_Bool bRetValue = sal_False;
for( sal_uInt32 i = 0; i < nSortCount; i++ )
{
if ( ( pSortStruct[ i ].nPropId &~0xc000 ) == ( nPropId &~0xc000 ) )
{
- nPropValue = pSortStruct[ i ].nPropValue;
- bRetValue = sal_True;
- break;
+ rPropValue = pSortStruct[ i ];
+ return sal_True;
}
}
- return bRetValue;
+ return sal_False;
}
+EscherProperties EscherPropertyContainer::GetOpts() const
+{
+ EscherProperties aVector;
+
+ for ( sal_uInt32 i = 0; i < nSortCount; ++i )
+ aVector.push_back( pSortStruct[ i ] );
+
+ return aVector;
+}
extern "C" int __LOADONCALLAPI EscherPropSortFunc( const void* p1, const void* p2 )
{
@@ -715,7 +726,7 @@ void EscherPropertyContainer::CreateTextProperties(
AddOpt( ESCHER_Prop_lTxid, nTextId );
}
-static sal_Bool GetLineArrow( const sal_Bool bLineStart,
+sal_Bool EscherPropertyContainer::GetLineArrow( const sal_Bool bLineStart,
const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
ESCHER_LineEnd& reLineEnd, sal_Int32& rnArrowLength, sal_Int32& rnArrowWidth )
{
@@ -2084,6 +2095,68 @@ void ConvertEnhancedCustomShapeEquation( SdrObjCustomShape* pCustoShape,
}
}
+sal_Bool EscherPropertyContainer::IsDefaultObject( SdrObjCustomShape* pCustoShape )
+{
+ sal_Bool bIsDefaultObject = sal_False;
+ if ( pCustoShape )
+ {
+ if ( pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_EQUATIONS )
+ && pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_VIEWBOX )
+ && pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_PATH )
+ && pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_GLUEPOINTS )
+ && pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_SEGMENTS )
+ && pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_STRETCHX )
+ && pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_STRETCHY )
+// && pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_HANDLES )
+ && pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_TEXTFRAMES ) )
+ bIsDefaultObject = sal_True;
+ }
+
+ return bIsDefaultObject;
+}
+
+void EscherPropertyContainer::LookForPolarHandles( const MSO_SPT eShapeType, sal_Int32& nAdjustmentsWhichNeedsToBeConverted )
+{
+ const mso_CustomShape* pDefCustomShape = GetCustomShapeContent( eShapeType );
+ if ( pDefCustomShape && pDefCustomShape->nHandles && pDefCustomShape->pHandles )
+ {
+ sal_Int32 k, nkCount = pDefCustomShape->nHandles;
+ const SvxMSDffHandle* pData = pDefCustomShape->pHandles;
+ for ( k = 0; k < nkCount; k++, pData++ )
+ {
+ if ( pData->nFlags & MSDFF_HANDLE_FLAGS_POLAR )
+ {
+ if ( ( pData->nPositionY >= 0x256 ) || ( pData->nPositionY <= 0x107 ) )
+ nAdjustmentsWhichNeedsToBeConverted |= ( 1 << k );
+ }
+ }
+ }
+}
+
+sal_Bool EscherPropertyContainer::GetAdjustmentValue( const com::sun::star::drawing::EnhancedCustomShapeAdjustmentValue & rkProp, sal_Int32 nIndex, sal_Int32 nAdjustmentsWhichNeedsToBeConverted, sal_Int32& nValue )
+{
+ if ( rkProp.State != beans::PropertyState_DIRECT_VALUE )
+ return FALSE;
+
+ sal_Bool bUseFixedFloat = ( nAdjustmentsWhichNeedsToBeConverted & ( 1 << nIndex ) ) != 0;
+ if ( rkProp.Value.getValueTypeClass() == uno::TypeClass_DOUBLE )
+ {
+ double fValue;
+ rkProp.Value >>= fValue;
+ if ( bUseFixedFloat )
+ fValue *= 65536.0;
+ nValue = (sal_Int32)fValue;
+ }
+ else
+ {
+ rkProp.Value >>= nValue;
+ if ( bUseFixedFloat )
+ nValue <<= 16;
+ }
+
+ return TRUE;
+}
+
void EscherPropertyContainer::CreateCustomShapeProperties( const MSO_SPT eShapeType, const uno::Reference< drawing::XShape > & rXShape )
{
uno::Reference< beans::XPropertySet > aXPropSet( rXShape, uno::UNO_QUERY );
@@ -2108,22 +2181,7 @@ void EscherPropertyContainer::CreateCustomShapeProperties( const MSO_SPT eShapeT
sal_Int32 nAdjustmentsWhichNeedsToBeConverted = 0;
uno::Sequence< beans::PropertyValues > aHandlesPropSeq;
sal_Bool bPredefinedHandlesUsed = sal_True;
-
-
- sal_Bool bIsDefaultObject = sal_False;
- if ( pCustoShape )
- {
- if ( pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_EQUATIONS )
- && pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_VIEWBOX )
- && pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_PATH )
- && pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_GLUEPOINTS )
- && pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_SEGMENTS )
- && pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_STRETCHX )
- && pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_STRETCHY )
-// && pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_HANDLES )
- && pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_TEXTFRAMES ) )
- bIsDefaultObject = sal_True;
- }
+ sal_Bool bIsDefaultObject = IsDefaultObject( pCustoShape );
// convert property "Equations" into std::vector< EnhancedCustomShapeEquationEquation >
std::vector< EnhancedCustomShapeEquation > aEquations;
@@ -3185,46 +3243,12 @@ void EscherPropertyContainer::CreateCustomShapeProperties( const MSO_SPT eShapeT
if ( pAdjustmentValuesProp->Value >>= aAdjustmentSeq )
{
if ( bPredefinedHandlesUsed )
- {
- const mso_CustomShape* pDefCustomShape = GetCustomShapeContent( eShapeType );
- if ( pDefCustomShape && pDefCustomShape->nHandles && pDefCustomShape->pHandles )
- {
- sal_Int32 k, nkCount = pDefCustomShape->nHandles;
- const SvxMSDffHandle* pData = pDefCustomShape->pHandles;
- for ( k = 0; k < nkCount; k++, pData++ )
- {
- if ( pData->nFlags & MSDFF_HANDLE_FLAGS_POLAR )
- {
- if ( ( pData->nPositionY >= 0x256 ) || ( pData->nPositionY <= 0x107 ) )
- nAdjustmentsWhichNeedsToBeConverted |= ( 1 << k );
- }
- }
- }
- }
+ LookForPolarHandles( eShapeType, nAdjustmentsWhichNeedsToBeConverted );
+
sal_Int32 k, nValue = 0, nAdjustmentValues = aAdjustmentSeq.getLength();
for ( k = 0; k < nAdjustmentValues; k++ )
- {
- const com::sun::star::drawing::EnhancedCustomShapeAdjustmentValue & rkProp = aAdjustmentSeq[ k ];
- if ( rkProp.State == beans::PropertyState_DIRECT_VALUE )
- {
- sal_Bool bUseFixedFloat = ( nAdjustmentsWhichNeedsToBeConverted & ( 1 << k ) ) != 0;
- if ( rkProp.Value.getValueTypeClass() == uno::TypeClass_DOUBLE )
- {
- double fValue;
- rkProp.Value >>= fValue;
- if ( bUseFixedFloat )
- fValue *= 65536.0;
- nValue = (sal_Int32)fValue;
- }
- else
- {
- rkProp.Value >>= nValue;
- if ( bUseFixedFloat )
- nValue <<= 16;
- }
+ if( GetAdjustmentValue( aAdjustmentSeq[ k ], k, nAdjustmentsWhichNeedsToBeConverted, nValue ) )
AddOpt( (sal_uInt16)( DFF_Prop_adjustValue + k ), (sal_uInt32)nValue );
- }
- }
}
}
}
@@ -3923,30 +3947,6 @@ struct EscherConnectorRule
sal_uInt32 ncptiB; // Connection site Index of shape B
};
-struct EscherConnectorListEntry
-{
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > mXConnector;
- ::com::sun::star::awt::Point maPointA;
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > mXConnectToA;
- ::com::sun::star::awt::Point maPointB;
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > mXConnectToB;
-
- sal_uInt32 GetConnectorRule( sal_Bool bFirst );
-
- EscherConnectorListEntry( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rC,
- const ::com::sun::star::awt::Point& rPA,
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rSA ,
- const ::com::sun::star::awt::Point& rPB,
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rSB ) :
- mXConnector ( rC ),
- maPointA ( rPA ),
- mXConnectToA( rSA ),
- maPointB ( rPB ),
- mXConnectToB( rSB ) {}
-
- sal_uInt32 GetClosestPoint( const Polygon& rPoly, const ::com::sun::star::awt::Point& rP );
-};
-
struct EscherShapeListEntry
{
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > aXShape;
@@ -4650,6 +4650,17 @@ void EscherEx::AddAtom( UINT32 nAtomSize, UINT16 nRecType, int nRecVersion, int
// ---------------------------------------------------------------------------------------------
+void EscherEx::AddChildAnchor( const Rectangle& rRect )
+{
+ AddAtom( 16, ESCHER_ChildAnchor );
+ GetStream() << (INT32)rRect.Left()
+ << (INT32)rRect.Top()
+ << (INT32)rRect.Right()
+ << (INT32)rRect.Bottom();
+}
+
+// ---------------------------------------------------------------------------------------------
+
void EscherEx::AddClientAnchor( const Rectangle& rRect )
{
AddAtom( 8, ESCHER_ClientAnchor );
@@ -4699,15 +4710,10 @@ UINT32 EscherEx::EnterGroup( const String& rShapeName, const Rectangle* pBoundRe
if( rShapeName.Len() > 0 )
aPropOpt.AddOpt( ESCHER_Prop_wzName, rShapeName );
- aPropOpt.Commit( *mpOutStrm );
+ Commit( aPropOpt, aRect );
if ( mnGroupLevel > 1 )
- {
- AddAtom( 16, ESCHER_ChildAnchor );
- *mpOutStrm << (INT32)aRect.Left()
- << (INT32)aRect.Top()
- << (INT32)aRect.Right()
- << (INT32)aRect.Bottom();
- }
+ AddChildAnchor( aRect );
+
EscherExHostAppData* pAppData = mpImplEscherExSdr->ImplGetHostData();
if( pAppData )
{
@@ -4805,6 +4811,13 @@ UINT32 EscherEx::GetShapeID()
// ---------------------------------------------------------------------------------------------
+void EscherEx::Commit( EscherPropertyContainer& rProps, const Rectangle& )
+{
+ rProps.Commit( GetStream() );
+}
+
+// ---------------------------------------------------------------------------------------------
+
UINT32 EscherEx::GetColor( const UINT32 nSOColor, BOOL bSwap )
{
if ( bSwap )
diff --git a/svx/source/msfilter/eschesdo.cxx b/svx/source/msfilter/eschesdo.cxx
index 319cb2d43d..86a1bd131b 100644
--- a/svx/source/msfilter/eschesdo.cxx
+++ b/svx/source/msfilter/eschesdo.cxx
@@ -736,16 +736,10 @@ UINT32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
if( rObj.GetAngle() )
ImplFlipBoundingBox( rObj, aPropOpt );
- aPropOpt.Commit( mpEscherEx->GetStream() );
+ mpEscherEx->Commit( aPropOpt, rObj.GetRect() );
if( mpEscherEx->GetGroupLevel() > 1 )
- {
- mpEscherEx->AddAtom( 16, ESCHER_ChildAnchor );
- const Rectangle& rRect = rObj.GetRect();
- mpEscherEx->GetStream() << (INT32)rRect.Left()
- << (INT32)rRect.Top()
- << (INT32)rRect.Right()
- << (INT32)rRect.Bottom();
- }
+ mpEscherEx->AddChildAnchor( rObj.GetRect() );
+
if ( mpHostAppData )
{ //! with AdditionalText the App has to control whether these are written or not
mpHostAppData->WriteClientAnchor( *mpEscherEx, rObj.GetRect() );
@@ -839,15 +833,10 @@ void ImplEESdrWriter::ImplWriteAdditionalText( ImplEESdrObject& rObj,
rObj.GetRect() );
}
rObj.SetAngle( nAngle );
- aPropOpt.Commit( mpEscherEx->GetStream() );
+ mpEscherEx->Commit( aPropOpt, rObj.GetRect() );
// write the childanchor
- mpEscherEx->AddAtom( 16, ESCHER_ChildAnchor );
- const Rectangle& rRect = rObj.GetRect();
- mpEscherEx->GetStream() << (INT32)rRect.Left()
- << (INT32)rRect.Top()
- << (INT32)rRect.Right()
- << (INT32)rRect.Bottom();
+ mpEscherEx->AddChildAnchor( rObj.GetRect() );
#if defined EES_WRITE_EPP
// ClientAnchor
diff --git a/svx/source/msfilter/makefile.mk b/svx/source/msfilter/makefile.mk
index 85c120f88d..adbe8b1048 100644
--- a/svx/source/msfilter/makefile.mk
+++ b/svx/source/msfilter/makefile.mk
@@ -33,6 +33,7 @@ PRJ=..$/..
PRJNAME=svx
TARGET=msfilter
+LIBTARGET=NO
AUTOSEG=true
# --- Settings -----------------------------------------------------
@@ -42,7 +43,8 @@ AUTOSEG=true
# --- Files --------------------------------------------------------
-SLOFILES=\
+LIB1TARGET= $(SLB)$/$(TARGET)-msfilter.lib
+LIB1OBJFILES= \
$(SLO)$/countryid.obj \
$(SLO)$/escherex.obj \
$(SLO)$/eschesdo.obj \
@@ -54,6 +56,12 @@ SLOFILES=\
$(SLO)$/mscodec.obj \
$(SLO)$/msfiltertracer.obj
+LIB2TARGET= $(SLB)$/$(TARGET)-core.lib
+LIB2OBJFILES= \
+ $(SLO)$/svxmsbas2.obj
+
+SLOFILES = $(LIB1OBJFILES) $(LIB2OBJFILES)
+
EXCEPTIONSFILES= \
$(SLO)$/eschesdo.obj \
$(SLO)$/escherex.obj \
diff --git a/svx/source/msfilter/mscodec.cxx b/svx/source/msfilter/mscodec.cxx
index e549fd48ee..54da76c546 100644
--- a/svx/source/msfilter/mscodec.cxx
+++ b/svx/source/msfilter/mscodec.cxx
@@ -37,6 +37,13 @@
#include <string.h>
#include <tools/solar.h>
+#define DEBUG_MSO_ENCRYPTION_STD97 0
+
+#if DEBUG_MSO_ENCRYPTION_STD97
+#include <stdio.h>
+#endif
+
+
namespace svx {
// ============================================================================
@@ -241,15 +248,50 @@ MSCodec_Std97::~MSCodec_Std97 ()
rtl_cipher_destroy (m_hCipher);
}
+#if DEBUG_MSO_ENCRYPTION_STD97
+static void lcl_PrintKeyData(const sal_uInt8* pKeyData, const char* msg)
+{
+ printf("pKeyData: (%s)\n", msg);
+ for (int j = 0; j < 4; ++j)
+ {
+ for (int i = 0; i < 16; ++i)
+ printf("%2.2x ", pKeyData[j*16+i]);
+ printf("\n");
+ }
+}
+#else
+static void lcl_PrintKeyData(const sal_uInt8* /*pKeyData*/, const char* /*msg*/)
+{
+}
+#endif
+
+#if DEBUG_MSO_ENCRYPTION_STD97
+static void lcl_PrintDigest(const sal_uInt8* pDigest, const char* msg)
+{
+ printf("digest: (%s)\n", msg);
+ for (int i = 0; i < 16; ++i)
+ printf("%2.2x ", pDigest[i]);
+ printf("\n");
+}
+#else
+static void lcl_PrintDigest(const sal_uInt8* /*pDigest*/, const char* /*msg*/)
+{
+}
+#endif
+
void MSCodec_Std97::InitKey (
const sal_uInt16 pPassData[16],
const sal_uInt8 pUnique[16])
{
+#if DEBUG_MSO_ENCRYPTION_STD97
+ fprintf(stdout, "MSCodec_Std97::InitKey: --begin\n");fflush(stdout);
+#endif
sal_uInt8 pKeyData[64];
int i, n;
// Fill PassData into KeyData.
(void)memset (pKeyData, 0, sizeof(pKeyData));
+ lcl_PrintKeyData(pKeyData, "initial");
for (i = 0, n = 16; (i < n) && pPassData[i]; i++)
{
pKeyData[2*i ] = sal::static_int_cast< sal_uInt8 >(
@@ -260,12 +302,16 @@ void MSCodec_Std97::InitKey (
pKeyData[2*i] = 0x80;
pKeyData[ 56] = sal::static_int_cast< sal_uInt8 >(i << 4);
+ lcl_PrintKeyData(pKeyData, "password data");
+
// Fill raw digest of KeyData into KeyData.
(void)rtl_digest_updateMD5 (
m_hDigest, pKeyData, sizeof(pKeyData));
(void)rtl_digest_rawMD5 (
m_hDigest, pKeyData, RTL_DIGEST_LENGTH_MD5);
+ lcl_PrintKeyData(pKeyData, "raw digest of key data");
+
// Update digest with KeyData and Unique.
for (i = 0; i < 16; i++)
{
@@ -279,6 +325,8 @@ void MSCodec_Std97::InitKey (
pKeyData[56] = 0x80;
pKeyData[57] = 0x0a;
+ lcl_PrintKeyData(pKeyData, "update digest with padding");
+
rtl_digest_updateMD5 (
m_hDigest, &(pKeyData[16]), sizeof(pKeyData) - 16);
@@ -286,6 +334,8 @@ void MSCodec_Std97::InitKey (
rtl_digest_rawMD5 (
m_hDigest, m_pDigestValue, sizeof(m_pDigestValue));
+ lcl_PrintDigest(m_pDigestValue, "digest value");
+
// Erase KeyData array and leave.
(void)memset (pKeyData, 0, sizeof(pKeyData));
}
@@ -294,27 +344,21 @@ bool MSCodec_Std97::VerifyKey (
const sal_uInt8 pSaltData[16],
const sal_uInt8 pSaltDigest[16])
{
+ // both the salt data and salt digest (hash) come from the document being imported.
+
+#if DEBUG_MSO_ENCRYPTION_STD97
+ fprintf(stdout, "MSCodec_Std97::VerifyKey: \n");
+ lcl_PrintDigest(pSaltData, "salt data");
+ lcl_PrintDigest(pSaltDigest, "salt hash");
+#endif
bool result = false;
if (InitCipher(0))
{
sal_uInt8 pDigest[RTL_DIGEST_LENGTH_MD5];
- sal_uInt8 pBuffer[64];
-
- // Decode SaltData into Buffer.
- rtl_cipher_decode (
- m_hCipher, pSaltData, 16, pBuffer, sizeof(pBuffer));
-
- pBuffer[16] = 0x80;
- (void)memset (pBuffer + 17, 0, sizeof(pBuffer) - 17);
- pBuffer[56] = 0x80;
-
- // Fill raw digest of Buffer into Digest.
- rtl_digest_updateMD5 (
- m_hDigest, pBuffer, sizeof(pBuffer));
- rtl_digest_rawMD5 (
- m_hDigest, pDigest, sizeof(pDigest));
+ GetDigestFromSalt(pSaltData, pDigest);
+ sal_uInt8 pBuffer[16];
// Decode original SaltDigest into Buffer.
rtl_cipher_decode (
m_hCipher, pSaltDigest, 16, pBuffer, sizeof(pBuffer));
@@ -333,7 +377,7 @@ bool MSCodec_Std97::VerifyKey (
bool MSCodec_Std97::InitCipher (sal_uInt32 nCounter)
{
rtlCipherError result;
- sal_uInt8 pKeyData[64];
+ sal_uInt8 pKeyData[64]; // 512-bit message block
// Initialize KeyData array.
(void)memset (pKeyData, 0, sizeof(pKeyData));
@@ -358,7 +402,7 @@ bool MSCodec_Std97::InitCipher (sal_uInt32 nCounter)
// Initialize Cipher with KeyData (for decoding).
result = rtl_cipher_init (
- m_hCipher, rtl_Cipher_DirectionDecode,
+ m_hCipher, rtl_Cipher_DirectionBoth,
pKeyData, RTL_DIGEST_LENGTH_MD5, 0, 0);
// Erase KeyData array and leave.
@@ -367,6 +411,39 @@ bool MSCodec_Std97::InitCipher (sal_uInt32 nCounter)
return (result == rtl_Cipher_E_None);
}
+bool MSCodec_Std97::CreateSaltDigest( const sal_uInt8 nSaltData[16], sal_uInt8 nSaltDigest[16] )
+{
+#if DEBUG_MSO_ENCRYPTION_STD97
+ lcl_PrintDigest(pSaltData, "salt data");
+#endif
+ bool result = false;
+
+ if (InitCipher(0))
+ {
+ sal_uInt8 pDigest[RTL_DIGEST_LENGTH_MD5];
+ GetDigestFromSalt(nSaltData, pDigest);
+
+ rtl_cipher_decode (
+ m_hCipher, pDigest, 16, pDigest, sizeof(pDigest));
+
+ (void)memcpy(nSaltDigest, pDigest, 16);
+ }
+
+ return (result);
+}
+
+bool MSCodec_Std97::Encode (
+ const void *pData, sal_Size nDatLen,
+ sal_uInt8 *pBuffer, sal_Size nBufLen)
+{
+ rtlCipherError result;
+
+ result = rtl_cipher_encode (
+ m_hCipher, pData, nDatLen, pBuffer, nBufLen);
+
+ return (result == rtl_Cipher_E_None);
+}
+
bool MSCodec_Std97::Decode (
const void *pData, sal_Size nDatLen,
sal_uInt8 *pBuffer, sal_Size nBufLen)
@@ -395,6 +472,65 @@ bool MSCodec_Std97::Skip( sal_Size nDatLen )
return bResult;
}
+void MSCodec_Std97::GetDigestFromSalt( const sal_uInt8 pSaltData[16], sal_uInt8 pDigest[16] )
+{
+ sal_uInt8 pBuffer[64];
+ sal_uInt8 pDigestLocal[16];
+
+ // Decode SaltData into Buffer.
+ rtl_cipher_decode (
+ m_hCipher, pSaltData, 16, pBuffer, sizeof(pBuffer));
+
+ // set the 129th bit to make the buffer 128-bit in length.
+ pBuffer[16] = 0x80;
+
+ // erase the rest of the buffer with zeros.
+ (void)memset (pBuffer + 17, 0, sizeof(pBuffer) - 17);
+
+ // set the 441st bit.
+ pBuffer[56] = 0x80;
+
+ // Fill raw digest of Buffer into Digest.
+ rtl_digest_updateMD5 (
+ m_hDigest, pBuffer, sizeof(pBuffer));
+ rtl_digest_rawMD5 (
+ m_hDigest, pDigestLocal, sizeof(pDigestLocal));
+
+ memcpy(pDigest, pDigestLocal, 16);
+}
+
+void MSCodec_Std97::GetEncryptKey (
+ const sal_uInt8 pSalt[16],
+ sal_uInt8 pSaltData[16],
+ sal_uInt8 pSaltDigest[16])
+{
+ if (InitCipher(0))
+ {
+ sal_uInt8 pDigest[RTL_DIGEST_LENGTH_MD5];
+ sal_uInt8 pBuffer[64];
+
+ rtl_cipher_encode (
+ m_hCipher, pSalt, 16, pSaltData, sizeof(pBuffer));
+
+ (void)memcpy( pBuffer, pSalt, 16 );
+
+ pBuffer[16] = 0x80;
+ (void)memset (pBuffer + 17, 0, sizeof(pBuffer) - 17);
+ pBuffer[56] = 0x80;
+
+ rtl_digest_updateMD5 (
+ m_hDigest, pBuffer, sizeof(pBuffer));
+ rtl_digest_rawMD5 (
+ m_hDigest, pDigest, sizeof(pDigest));
+
+ rtl_cipher_encode (
+ m_hCipher, pDigest, 16, pSaltDigest, 16);
+
+ (void)memset (pBuffer, 0, sizeof(pBuffer));
+ (void)memset (pDigest, 0, sizeof(pDigest));
+ }
+}
+
// ============================================================================
} // namespace svx
diff --git a/svx/source/msfilter/msdffimp.cxx b/svx/source/msfilter/msdffimp.cxx
index 554a185ced..31e7716651 100644
--- a/svx/source/msfilter/msdffimp.cxx
+++ b/svx/source/msfilter/msdffimp.cxx
@@ -4754,13 +4754,13 @@ SdrObject* SvxMSDffManager::ImportGroup( const DffRecordHeader& rHd, SvStream& r
if ( ( nGroupRotateAngle > 4500 && nGroupRotateAngle <= 13500 )
|| ( nGroupRotateAngle > 22500 && nGroupRotateAngle <= 31500 ) )
{
- sal_Int32 nHalfWidth = ( aGlobalChildRect.GetWidth() + 1 ) >> 1;
- sal_Int32 nHalfHeight = ( aGlobalChildRect.GetHeight() + 1 ) >> 1;
- Point aTopLeft( aGlobalChildRect.Left() + nHalfWidth - nHalfHeight,
- aGlobalChildRect.Top() + nHalfHeight - nHalfWidth );
- Size aNewSize( aGlobalChildRect.GetHeight(), aGlobalChildRect.GetWidth() );
+ sal_Int32 nHalfWidth = ( aClientRect.GetWidth() + 1 ) >> 1;
+ sal_Int32 nHalfHeight = ( aClientRect.GetHeight() + 1 ) >> 1;
+ Point aTopLeft( aClientRect.Left() + nHalfWidth - nHalfHeight,
+ aClientRect.Top() + nHalfHeight - nHalfWidth );
+ Size aNewSize( aClientRect.GetHeight(), aClientRect.GetWidth() );
Rectangle aNewRect( aTopLeft, aNewSize );
- aGlobalChildRect = aNewRect;
+ aClientRect = aNewRect;
}
// now importing the inner objects of the group
diff --git a/svx/source/msfilter/msocximex.cxx b/svx/source/msfilter/msocximex.cxx
index c8f4ba519f..493e097857 100644
--- a/svx/source/msfilter/msocximex.cxx
+++ b/svx/source/msfilter/msocximex.cxx
@@ -623,7 +623,11 @@ class ContainerRecReader
pS->SeekRel( 4 );
// option flags
if( nContentFlags & 0x00000010 )
- pS->SeekRel( 4 );
+ {
+ sal_uInt32 nBitFlags = 0;
+ *pS >> nBitFlags;
+ rec.bVisible = ( ( nBitFlags & 0x02 ) == 0x02 );
+ }
// substream size
if( nContentFlags & 0x00000020 )
*pS >> rec.nSubStreamLen;
@@ -1212,6 +1216,13 @@ sal_Bool OCX_Control::Import(uno::Reference<container::XNameContainer> &rDialog
xPropSet->setPropertyValue(WW8_ASCII2STR("Step"), aTmp);
}
+ try
+ {
+ xPropSet->setPropertyValue(WW8_ASCII2STR("EnableVisible"), uno::makeAny( mbVisible ) );
+ }
+ catch( uno::Exception& )
+ {
+ }
return sal_True;
}
@@ -3612,6 +3623,7 @@ void OCX_ContainerControl::ProcessControl(OCX_Control* pControl,SvStorageStream*
// reflect the ms tabbing from orig MS UserForm, see below
pControl->mnTabPos = rec.nTabPos;
pControl->SetInDialog(true);
+ pControl->mbVisible = rec.bVisible;
if ( mnStep )
{
// If the container has a step then it should be
diff --git a/svx/source/msfilter/svxmsbas.cxx b/svx/source/msfilter/svxmsbas.cxx
index 4dd3446f61..a2448c8727 100644
--- a/svx/source/msfilter/svxmsbas.cxx
+++ b/svx/source/msfilter/svxmsbas.cxx
@@ -403,53 +403,4 @@ BOOL SvxImportMSVBasic::ImportCode_Impl( const String& rStorageName,
return bRet;
}
-ULONG SvxImportMSVBasic::SaveOrDelMSVBAStorage( BOOL bSaveInto,
- const String& rStorageName )
-{
- ULONG nRet = ERRCODE_NONE;
- uno::Reference < embed::XStorage > xSrcRoot( rDocSh.GetStorage() );
- String aDstStgName( GetMSBasicStorageName() );
- SotStorageRef xVBAStg( SotStorage::OpenOLEStorage( xSrcRoot, aDstStgName,
- STREAM_READWRITE | STREAM_NOCREATE | STREAM_SHARE_DENYALL ) );
- if( xVBAStg.Is() && !xVBAStg->GetError() )
- {
- xVBAStg = 0;
- if( bSaveInto )
- {
- BasicManager *pBasicMan = rDocSh.GetBasicManager();
- if( pBasicMan && pBasicMan->IsBasicModified() )
- nRet = ERRCODE_SVX_MODIFIED_VBASIC_STORAGE;
-
- SotStorageRef xSrc = SotStorage::OpenOLEStorage( xSrcRoot, aDstStgName, STREAM_STD_READ );
- SotStorageRef xDst = xRoot->OpenSotStorage( rStorageName, STREAM_READWRITE | STREAM_TRUNC );
- xSrc->CopyTo( xDst );
- xDst->Commit();
- ErrCode nError = xDst->GetError();
- if ( nError == ERRCODE_NONE )
- nError = xSrc->GetError();
- if ( nError != ERRCODE_NONE )
- xRoot->SetError( nError );
- }
- }
-
- return nRet;
-}
-
-// check if the MS-VBA-Storage exists in the RootStorage of the DocShell.
-// If it exists, then return the WarningId for losing the information.
-ULONG SvxImportMSVBasic::GetSaveWarningOfMSVBAStorage( SfxObjectShell &rDocSh)
-{
- uno::Reference < embed::XStorage > xSrcRoot( rDocSh.GetStorage() );
- SvStorageRef xVBAStg( SotStorage::OpenOLEStorage( xSrcRoot, GetMSBasicStorageName(),
- STREAM_READ | STREAM_NOCREATE | STREAM_SHARE_DENYALL ));
- return ( xVBAStg.Is() && !xVBAStg->GetError() )
- ? ERRCODE_SVX_VBASIC_STORAGE_EXIST
- : ERRCODE_NONE;
-}
-
-String SvxImportMSVBasic::GetMSBasicStorageName()
-{
- return String( RTL_CONSTASCII_USTRINGPARAM( "_MS_VBA_Macros" ) );
-}
-
/* vi:set tabstop=4 shiftwidth=4 expandtab: */
diff --git a/svx/source/msfilter/svxmsbas2.cxx b/svx/source/msfilter/svxmsbas2.cxx
new file mode 100644
index 0000000000..afd772bbd7
--- /dev/null
+++ b/svx/source/msfilter/svxmsbas2.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: svxmsbas.cxx,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.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_svx.hxx"
+
+#include <basic/basmgr.hxx>
+#include <sfx2/objsh.hxx>
+#include <svxerr.hxx>
+#include <svxmsbas.hxx>
+
+using namespace com::sun::star;
+
+ULONG SvxImportMSVBasic::SaveOrDelMSVBAStorage( BOOL bSaveInto,
+ const String& rStorageName )
+{
+ ULONG nRet = ERRCODE_NONE;
+ uno::Reference < embed::XStorage > xSrcRoot( rDocSh.GetStorage() );
+ String aDstStgName( GetMSBasicStorageName() );
+ SotStorageRef xVBAStg( SotStorage::OpenOLEStorage( xSrcRoot, aDstStgName,
+ STREAM_READWRITE | STREAM_NOCREATE | STREAM_SHARE_DENYALL ) );
+ if( xVBAStg.Is() && !xVBAStg->GetError() )
+ {
+ xVBAStg = 0;
+ if( bSaveInto )
+ {
+ BasicManager *pBasicMan = rDocSh.GetBasicManager();
+ if( pBasicMan && pBasicMan->IsBasicModified() )
+ nRet = ERRCODE_SVX_MODIFIED_VBASIC_STORAGE;
+
+ SotStorageRef xSrc = SotStorage::OpenOLEStorage( xSrcRoot, aDstStgName, STREAM_STD_READ );
+ SotStorageRef xDst = xRoot->OpenSotStorage( rStorageName, STREAM_READWRITE | STREAM_TRUNC );
+ xSrc->CopyTo( xDst );
+ xDst->Commit();
+ ErrCode nError = xDst->GetError();
+ if ( nError == ERRCODE_NONE )
+ nError = xSrc->GetError();
+ if ( nError != ERRCODE_NONE )
+ xRoot->SetError( nError );
+ }
+ }
+
+ return nRet;
+}
+
+// check if the MS-VBA-Storage exists in the RootStorage of the DocShell.
+// If it exists, then return the WarningId for losing the information.
+ULONG SvxImportMSVBasic::GetSaveWarningOfMSVBAStorage( SfxObjectShell &rDocSh)
+{
+ uno::Reference < embed::XStorage > xSrcRoot( rDocSh.GetStorage() );
+ SvStorageRef xVBAStg( SotStorage::OpenOLEStorage( xSrcRoot, GetMSBasicStorageName(),
+ STREAM_READ | STREAM_NOCREATE | STREAM_SHARE_DENYALL ));
+ return ( xVBAStg.Is() && !xVBAStg->GetError() )
+ ? ERRCODE_SVX_VBASIC_STORAGE_EXIST
+ : ERRCODE_NONE;
+}
+
+String SvxImportMSVBasic::GetMSBasicStorageName()
+{
+ return String( RTL_CONSTASCII_USTRINGPARAM( "_MS_VBA_Macros" ) );
+}
diff --git a/svx/source/options/makefile.mk b/svx/source/options/makefile.mk
index c4828b81f3..d68703983e 100644
--- a/svx/source/options/makefile.mk
+++ b/svx/source/options/makefile.mk
@@ -36,6 +36,7 @@ PROJECTPCHSOURCE=$(PRJ)$/util\svxpch
PRJNAME=svx
TARGET=options
+LIBTARGET=NO
# --- Settings -----------------------------------------------------
@@ -62,39 +63,23 @@ SRC1FILES=\
optchart.src \
optimprove.src
-#EXCEPTIONSFILES=\
-# $(SLO)$/optasian.obj \
-# $(SLO)$/optlingu.obj \
-# $(SLO)$/optaccessibility.obj \
-# $(SLO)$/optsave.obj \
-# $(SLO)$/optpath.obj
-
-#SLOFILES=\
-# $(EXCEPTIONSFILES) \
-# $(SLO)$/asiancfg.obj \
-# $(SLO)$/htmlcfg.obj \
-# $(SLO)$/optcolor.obj \
-# $(SLO)$/optjsearch.obj \
-# $(SLO)$/optitems.obj \
-# $(SLO)$/optgenrl.obj \
-# $(SLO)$/adritem.obj \
-# $(SLO)$/optgrid.obj \
-# $(SLO)$/optinet2.obj \
-# $(SLO)$/optextbr.obj \
-# $(SLO)$/srchcfg.obj \
-# $(SLO)$/optctl.obj
-
EXCEPTIONSFILES=\
$(SLO)$/optlingu.obj
-SLOFILES=\
- $(EXCEPTIONSFILES) \
- $(SLO)$/asiancfg.obj \
+LIB1TARGET= $(SLB)$/$(TARGET)-core.lib
+LIB1OBJFILES= \
+ $(SLO)$/asiancfg.obj
+
+LIB2TARGET= $(SLB)$/$(TARGET).lib
+LIB2OBJFILES= \
+ $(SLO)$/optlingu.obj \
$(SLO)$/htmlcfg.obj \
$(SLO)$/optitems.obj \
$(SLO)$/optgrid.obj \
$(SLO)$/srchcfg.obj
+SLOFILES = $(LIB1OBJFILES) $(LIB2OBJFILES)
+
# --- Targets -------------------------------------------------------
.INCLUDE : target.mk
diff --git a/svx/source/options/optimprove.src b/svx/source/options/optimprove.src
index 148d7391c9..86fc6d1c1a 100644
--- a/svx/source/options/optimprove.src
+++ b/svx/source/options/optimprove.src
@@ -87,7 +87,7 @@ TabPage RID_SVXPAGE_IMPROVEMENT
{
Pos = MAP_APPFONT ( 12 , 132 ) ;
Size = MAP_APPFONT ( 80 , 8 ) ;
- Text [ en-US ] = "Number of reports send:" ;
+ Text [ en-US ] = "Number of reports sent:" ;
};
FixedText FT_NR_REPORTS_VALUE
{
diff --git a/svx/source/outliner/outliner.cxx b/svx/source/outliner/outliner.cxx
index 66aa95474d..f290864808 100644
--- a/svx/source/outliner/outliner.cxx
+++ b/svx/source/outliner/outliner.cxx
@@ -1519,14 +1519,14 @@ void Outliner::ImplCheckParagraphs( USHORT nStart, USHORT nEnd )
// --> OD 2009-03-10 #i100014#
// assure that the following for-loop does not loop forever
- for ( ULONG n = nStart; n < nEnd; n++ )
+ for ( USHORT n = nStart; n < nEnd; n++ )
// <--
{
Paragraph* pPara = pParaList->GetParagraph( n );
if (pPara)
{
pPara->Invalidate();
- ImplCalcBulletText( static_cast< USHORT >(n), FALSE, FALSE );
+ ImplCalcBulletText( n, FALSE, FALSE );
}
}
}
diff --git a/svx/source/outliner/outlobj.cxx b/svx/source/outliner/outlobj.cxx
index bdcbcf88e6..72601d9d7e 100644
--- a/svx/source/outliner/outlobj.cxx
+++ b/svx/source/outliner/outlobj.cxx
@@ -77,6 +77,12 @@ public:
&& maParagraphDataVector == rCandidate.maParagraphDataVector
&& mbIsEditDoc == rCandidate.mbIsEditDoc);
}
+
+ // #i102062#
+ bool isWrongListEqual(const ImplOutlinerParaObject& rCompare) const
+ {
+ return mpEditTextObject->isWrongListEqual(*rCompare.mpEditTextObject);
+ }
};
//////////////////////////////////////////////////////////////////////////////
@@ -147,6 +153,17 @@ bool OutlinerParaObject::operator==(const OutlinerParaObject& rCandidate) const
return (*rCandidate.mpImplOutlinerParaObject == *mpImplOutlinerParaObject);
}
+// #i102062#
+bool OutlinerParaObject::isWrongListEqual(const OutlinerParaObject& rCompare) const
+{
+ if(rCompare.mpImplOutlinerParaObject == mpImplOutlinerParaObject)
+ {
+ return true;
+ }
+
+ return mpImplOutlinerParaObject->isWrongListEqual(*rCompare.mpImplOutlinerParaObject);
+}
+
sal_uInt16 OutlinerParaObject::GetOutlinerMode() const
{
return mpImplOutlinerParaObject->mpEditTextObject->GetUserType();
diff --git a/svx/source/sdr/attribute/makefile.mk b/svx/source/sdr/attribute/makefile.mk
index adbd85f88d..44e161a3b5 100644
--- a/svx/source/sdr/attribute/makefile.mk
+++ b/svx/source/sdr/attribute/makefile.mk
@@ -33,6 +33,7 @@ PRJ=..$/..$/..
PRJNAME=svx
TARGET=attribute
+ENABLE_EXCEPTIONS=TRUE
# --- Settings -----------------------------------------------------
@@ -43,6 +44,8 @@ TARGET=attribute
SLOFILES=\
$(SLO)$/sdrallattribute.obj \
- $(SLO)$/sdrtextattribute.obj
+ $(SLO)$/sdrtextattribute.obj \
+ $(SLO)$/sdrformtextattribute.obj \
+ $(SLO)$/sdrformtextoutlineattribute.obj
.INCLUDE : target.mk
diff --git a/svx/source/sdr/attribute/sdrallattribute.cxx b/svx/source/sdr/attribute/sdrallattribute.cxx
index 6dea264890..1150f5a684 100644
--- a/svx/source/sdr/attribute/sdrallattribute.cxx
+++ b/svx/source/sdr/attribute/sdrallattribute.cxx
@@ -30,6 +30,7 @@
************************************************************************/
#include "precompiled_svx.hxx"
+
#include <svx/sdr/attribute/sdrallattribute.hxx>
#include <drawinglayer/attribute/sdrattribute.hxx>
#include <drawinglayer/attribute/fillattribute.hxx>
@@ -45,20 +46,20 @@ namespace drawinglayer
{
namespace attribute
{
- SdrShadowTextAttribute::SdrShadowTextAttribute(SdrShadowAttribute* pShadow, SdrTextAttribute* pTextAttribute)
+ SdrShadowTextAttribute::SdrShadowTextAttribute(
+ SdrShadowAttribute* pShadow,
+ SdrTextAttribute* pTextAttribute)
: mpShadow(pShadow),
mpTextAttribute(pTextAttribute)
{
}
- SdrShadowTextAttribute::SdrShadowTextAttribute(const SdrShadowTextAttribute& rCandidate)
- : mpShadow(0L),
- mpTextAttribute(0L)
+ SdrShadowTextAttribute::SdrShadowTextAttribute(
+ const SdrShadowTextAttribute& rCandidate)
+ : mpShadow(0),
+ mpTextAttribute(0)
{
- if(!(*this == rCandidate))
- {
- *this = rCandidate;
- }
+ *this = rCandidate;
}
SdrShadowTextAttribute::~SdrShadowTextAttribute()
@@ -72,14 +73,14 @@ namespace drawinglayer
// handle mpShadow
{
// delete local mpShadow if necessary
- if(mpShadow && ((!rCandidate.mpShadow) || (!(*mpShadow == *rCandidate.mpShadow))))
+ if(mpShadow)
{
delete mpShadow;
- mpShadow = 0L;
+ mpShadow = 0;
}
// copy mpShadow if necessary
- if(!mpShadow && rCandidate.mpShadow)
+ if(rCandidate.mpShadow)
{
mpShadow = new SdrShadowAttribute(*rCandidate.mpShadow);
}
@@ -88,14 +89,14 @@ namespace drawinglayer
// handle mpTextAttribute
{
// delete local mpTextAttribute if necessary
- if(mpTextAttribute && ((!rCandidate.mpTextAttribute) || (!(*mpTextAttribute == *rCandidate.mpTextAttribute))))
+ if(mpTextAttribute)
{
delete mpTextAttribute;
- mpTextAttribute = 0L;
+ mpTextAttribute = 0;
}
// copy mpTextAttribute if necessary
- if(!mpTextAttribute && rCandidate.mpTextAttribute)
+ if(rCandidate.mpTextAttribute)
{
mpTextAttribute = new SdrTextAttribute(*rCandidate.mpTextAttribute);
}
@@ -125,22 +126,23 @@ namespace drawinglayer
{
namespace attribute
{
- SdrFillTextAttribute::SdrFillTextAttribute(SdrFillAttribute* pFill, FillGradientAttribute* pFillFloatTransGradient, SdrTextAttribute* pTextAttribute)
+ SdrFillTextAttribute::SdrFillTextAttribute(
+ SdrFillAttribute* pFill,
+ FillGradientAttribute* pFillFloatTransGradient,
+ SdrTextAttribute* pTextAttribute)
: mpFill(pFill),
mpFillFloatTransGradient(pFillFloatTransGradient),
mpTextAttribute(pTextAttribute)
{
}
- SdrFillTextAttribute::SdrFillTextAttribute(const SdrFillTextAttribute& rCandidate)
+ SdrFillTextAttribute::SdrFillTextAttribute(
+ const SdrFillTextAttribute& rCandidate)
: mpFill(0),
mpFillFloatTransGradient(0),
mpTextAttribute(0)
{
- if(!(*this == rCandidate))
- {
- *this = rCandidate;
- }
+ *this = rCandidate;
}
SdrFillTextAttribute::~SdrFillTextAttribute()
@@ -155,14 +157,14 @@ namespace drawinglayer
// handle mpFill
{
// delete local mpFill if necessary
- if(mpFill && ((!rCandidate.mpFill) || (!(*mpFill == *rCandidate.mpFill))))
+ if(mpFill)
{
delete mpFill;
- mpFill = 0L;
+ mpFill = 0;
}
// copy mpFill if necessary
- if(!mpFill && rCandidate.mpFill)
+ if(rCandidate.mpFill)
{
mpFill = new attribute::SdrFillAttribute(*rCandidate.mpFill);
}
@@ -171,14 +173,14 @@ namespace drawinglayer
// handle mpFillFloatTransGradient
{
// delete local mpFillFloatTransGradient if necessary
- if(mpFillFloatTransGradient && ((!rCandidate.mpFillFloatTransGradient) || (!(*mpFillFloatTransGradient == *rCandidate.mpFillFloatTransGradient))))
+ if(mpFillFloatTransGradient)
{
delete mpFillFloatTransGradient;
- mpFillFloatTransGradient = 0L;
+ mpFillFloatTransGradient = 0;
}
// copy mpFillFloatTransGradient if necessary
- if(!mpFillFloatTransGradient && rCandidate.mpFillFloatTransGradient)
+ if(rCandidate.mpFillFloatTransGradient)
{
mpFillFloatTransGradient = new FillGradientAttribute(*rCandidate.mpFillFloatTransGradient);
}
@@ -187,14 +189,14 @@ namespace drawinglayer
// handle mpTextAttribute
{
// delete local mpTextAttribute if necessary
- if(mpTextAttribute && ((!rCandidate.mpTextAttribute) || (!(*mpTextAttribute == *rCandidate.mpTextAttribute))))
+ if(mpTextAttribute)
{
delete mpTextAttribute;
- mpTextAttribute = 0L;
+ mpTextAttribute = 0;
}
// copy mpTextAttribute if necessary
- if(!mpTextAttribute && rCandidate.mpTextAttribute)
+ if(rCandidate.mpTextAttribute)
{
mpTextAttribute = new SdrTextAttribute(*rCandidate.mpTextAttribute);
}
@@ -229,23 +231,23 @@ namespace drawinglayer
namespace attribute
{
SdrLineShadowTextAttribute::SdrLineShadowTextAttribute(
- SdrLineAttribute* pLine, SdrLineStartEndAttribute* pLineStartEnd,
- SdrShadowAttribute* pShadow, SdrTextAttribute* pTextAttribute)
+ SdrLineAttribute* pLine,
+ SdrLineStartEndAttribute* pLineStartEnd,
+ SdrShadowAttribute* pShadow,
+ SdrTextAttribute* pTextAttribute)
: SdrShadowTextAttribute(pShadow, pTextAttribute),
mpLine(pLine),
mpLineStartEnd(pLineStartEnd)
{
}
- SdrLineShadowTextAttribute::SdrLineShadowTextAttribute(const SdrLineShadowTextAttribute& rCandidate)
- : SdrShadowTextAttribute(0L, 0L),
- mpLine(0L),
- mpLineStartEnd(0L)
+ SdrLineShadowTextAttribute::SdrLineShadowTextAttribute(
+ const SdrLineShadowTextAttribute& rCandidate)
+ : SdrShadowTextAttribute(0, 0),
+ mpLine(0),
+ mpLineStartEnd(0)
{
- if(!(*this == rCandidate))
- {
- *this = rCandidate;
- }
+ *this = rCandidate;
}
SdrLineShadowTextAttribute::~SdrLineShadowTextAttribute()
@@ -262,14 +264,14 @@ namespace drawinglayer
// handle mpLine
{
// delete local mpLine if necessary
- if(mpLine && ((!rCandidate.mpLine) || (!(*mpLine == *rCandidate.mpLine))))
+ if(mpLine)
{
delete mpLine;
- mpLine = 0L;
+ mpLine = 0;
}
// copy mpLine if necessary
- if(!mpLine && rCandidate.mpLine)
+ if(rCandidate.mpLine)
{
mpLine = new SdrLineAttribute(*rCandidate.mpLine);
}
@@ -278,14 +280,14 @@ namespace drawinglayer
// handle mpLineStartEnd
{
// delete local mpLineStartEnd if necessary
- if(mpLineStartEnd && ((!rCandidate.mpLineStartEnd) || (!(*mpLineStartEnd == *rCandidate.mpLineStartEnd))))
+ if(mpLineStartEnd)
{
delete mpLineStartEnd;
- mpLineStartEnd = 0L;
+ mpLineStartEnd = 0;
}
// copy mpLineStartEnd if necessary
- if(!mpLineStartEnd && rCandidate.mpLineStartEnd)
+ if(rCandidate.mpLineStartEnd)
{
mpLineStartEnd = new SdrLineStartEndAttribute(*rCandidate.mpLineStartEnd);
}
@@ -320,23 +322,25 @@ namespace drawinglayer
namespace attribute
{
SdrLineFillShadowTextAttribute::SdrLineFillShadowTextAttribute(
- SdrLineAttribute* pLine, attribute::SdrFillAttribute* pFill, SdrLineStartEndAttribute* pLineStartEnd,
- SdrShadowAttribute* pShadow, FillGradientAttribute* pFillFloatTransGradient, SdrTextAttribute* pTextAttribute)
+ SdrLineAttribute* pLine,
+ attribute::SdrFillAttribute* pFill,
+ SdrLineStartEndAttribute* pLineStartEnd,
+ SdrShadowAttribute* pShadow,
+ FillGradientAttribute* pFillFloatTransGradient,
+ SdrTextAttribute* pTextAttribute)
: SdrLineShadowTextAttribute(pLine, pLineStartEnd, pShadow, pTextAttribute),
mpFill(pFill),
mpFillFloatTransGradient(pFillFloatTransGradient)
{
}
- SdrLineFillShadowTextAttribute::SdrLineFillShadowTextAttribute(const SdrLineFillShadowTextAttribute& rCandidate)
- : SdrLineShadowTextAttribute(0L, 0L, 0L, 0L),
- mpFill(0L),
- mpFillFloatTransGradient(0L)
+ SdrLineFillShadowTextAttribute::SdrLineFillShadowTextAttribute(
+ const SdrLineFillShadowTextAttribute& rCandidate)
+ : SdrLineShadowTextAttribute(0, 0, 0, 0),
+ mpFill(0),
+ mpFillFloatTransGradient(0)
{
- if(!(*this == rCandidate))
- {
- *this = rCandidate;
- }
+ *this = rCandidate;
}
SdrLineFillShadowTextAttribute::~SdrLineFillShadowTextAttribute()
@@ -353,14 +357,14 @@ namespace drawinglayer
// handle mpFill
{
// delete local mpFill if necessary
- if(mpFill && ((!rCandidate.mpFill) || (!(*mpFill == *rCandidate.mpFill))))
+ if(mpFill)
{
delete mpFill;
- mpFill = 0L;
+ mpFill = 0;
}
// copy mpFill if necessary
- if(!mpFill && rCandidate.mpFill)
+ if(rCandidate.mpFill)
{
mpFill = new attribute::SdrFillAttribute(*rCandidate.mpFill);
}
@@ -369,14 +373,14 @@ namespace drawinglayer
// handle mpFillFloatTransGradient
{
// delete local mpFillFloatTransGradient if necessary
- if(mpFillFloatTransGradient && ((!rCandidate.mpFillFloatTransGradient) || (!(*mpFillFloatTransGradient == *rCandidate.mpFillFloatTransGradient))))
+ if(mpFillFloatTransGradient)
{
delete mpFillFloatTransGradient;
- mpFillFloatTransGradient = 0L;
+ mpFillFloatTransGradient = 0;
}
// copy mpFillFloatTransGradient if necessary
- if(!mpFillFloatTransGradient && rCandidate.mpFillFloatTransGradient)
+ if(rCandidate.mpFillFloatTransGradient)
{
mpFillFloatTransGradient = new FillGradientAttribute(*rCandidate.mpFillFloatTransGradient);
}
diff --git a/svx/source/sdr/attribute/sdrformtextattribute.cxx b/svx/source/sdr/attribute/sdrformtextattribute.cxx
new file mode 100644
index 0000000000..8bd8c3b6b6
--- /dev/null
+++ b/svx/source/sdr/attribute/sdrformtextattribute.cxx
@@ -0,0 +1,304 @@
+/*************************************************************************
+ *
+ * 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: sdrtextattribute.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * 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/sdr/attribute/sdrformtextattribute.hxx>
+#include <svtools/itemset.hxx>
+
+#include <svx/xftdiit.hxx>
+#include <svx/xftstit.hxx>
+#include <svx/xftshxy.hxx>
+#include <svx/xftshtit.hxx>
+#include <svx/xtextit0.hxx>
+#include <svx/xftadit.hxx>
+#include <svx/xftshit.hxx>
+#include <svx/xftshcit.hxx>
+#include <svx/xftmrit.hxx>
+#include <svx/xftouit.hxx>
+
+#include <svx/sdshtitm.hxx>
+#include <svx/xlntrit.hxx>
+#include <drawinglayer/attribute/lineattribute.hxx>
+#include <drawinglayer/attribute/strokeattribute.hxx>
+#include <svx/sdshcitm.hxx>
+#include <svx/xlnclit.hxx>
+#include <svx/xlnwtit.hxx>
+#include <xlinjoit.hxx>
+#include <svx/xlineit0.hxx>
+#include <svx/xdash.hxx>
+#include <svx/xlndsit.hxx>
+#include <svx/sdr/attribute/sdrformtextoutlineattribute.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// pointer compare define
+#define pointerOrContentEqual(p, q) ((p == q) || (p && q && *p == *q))
+
+//////////////////////////////////////////////////////////////////////////////
+// helper to get line, stroke and transparence attributes from SfxItemSet
+
+namespace
+{
+ basegfx::B2DLineJoin impGetB2DLineJoin(XLineJoint eLineJoint)
+ {
+ switch(eLineJoint)
+ {
+ case XLINEJOINT_MIDDLE :
+ {
+ return basegfx::B2DLINEJOIN_MIDDLE;
+ }
+ case XLINEJOINT_BEVEL :
+ {
+ return basegfx::B2DLINEJOIN_BEVEL;
+ }
+ case XLINEJOINT_MITER :
+ {
+ return basegfx::B2DLINEJOIN_MITER;
+ }
+ case XLINEJOINT_ROUND :
+ {
+ return basegfx::B2DLINEJOIN_ROUND;
+ }
+ default :
+ {
+ return basegfx::B2DLINEJOIN_NONE; // XLINEJOINT_NONE
+ }
+ }
+ }
+
+ sal_uInt8 impGetStrokeTransparence(bool bShadow, const SfxItemSet& rSet)
+ {
+ sal_uInt8 nRetval;
+
+ if(bShadow)
+ {
+ nRetval = (sal_uInt8)((((SdrShadowTransparenceItem&)(rSet.Get(SDRATTR_SHADOWTRANSPARENCE))).GetValue() * 255) / 100);
+ }
+ else
+ {
+ nRetval = (sal_uInt8)((((XLineTransparenceItem&)(rSet.Get(XATTR_LINETRANSPARENCE))).GetValue() * 255) / 100);
+ }
+
+ return nRetval;
+ }
+
+ drawinglayer::attribute::LineAttribute impGetLineAttribute(bool bShadow, const SfxItemSet& rSet)
+ {
+ basegfx::BColor aColorAttribute;
+
+ if(bShadow)
+ {
+ const Color aShadowColor(((SdrShadowColorItem&)(rSet.Get(SDRATTR_SHADOWCOLOR))).GetColorValue());
+ aColorAttribute = aShadowColor.getBColor();
+ }
+ else
+ {
+ const Color aLineColor(((XLineColorItem&)(rSet.Get(XATTR_LINECOLOR))).GetColorValue());
+ aColorAttribute = aLineColor.getBColor();
+ }
+
+ const sal_uInt32 nLineWidth = ((const XLineWidthItem&)(rSet.Get(XATTR_LINEWIDTH))).GetValue();
+ const XLineJoint eLineJoint = ((const XLineJointItem&)(rSet.Get(XATTR_LINEJOINT))).GetValue();
+
+ return drawinglayer::attribute::LineAttribute(aColorAttribute, (double)nLineWidth, impGetB2DLineJoin(eLineJoint));
+ }
+
+ drawinglayer::attribute::StrokeAttribute impGetStrokeAttribute(const SfxItemSet& rSet)
+ {
+ const XLineStyle eLineStyle = ((XLineStyleItem&)(rSet.Get(XATTR_LINESTYLE))).GetValue();
+ double fFullDotDashLen(0.0);
+ ::std::vector< double > aDotDashArray;
+
+ if(XLINE_DASH == eLineStyle)
+ {
+ const XDash& rDash = ((const XLineDashItem&)(rSet.Get(XATTR_LINEDASH))).GetDashValue();
+
+ if(rDash.GetDots() || rDash.GetDashes())
+ {
+ const sal_uInt32 nLineWidth = ((const XLineWidthItem&)(rSet.Get(XATTR_LINEWIDTH))).GetValue();
+ fFullDotDashLen = rDash.CreateDotDashArray(aDotDashArray, (double)nLineWidth);
+ }
+ }
+
+ return drawinglayer::attribute::StrokeAttribute(aDotDashArray, fFullDotDashLen);
+ }
+} // end of anonymous namespace
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ SdrFormTextAttribute::SdrFormTextAttribute(const SfxItemSet& rSet)
+ : mnFormTextDistance(((const XFormTextDistanceItem&)rSet.Get(XATTR_FORMTXTDISTANCE)).GetValue()),
+ mnFormTextStart(((const XFormTextStartItem&)rSet.Get(XATTR_FORMTXTSTART)).GetValue()),
+ mnFormTextShdwXVal(((const XFormTextShadowXValItem&)rSet.Get(XATTR_FORMTXTSHDWXVAL)).GetValue()),
+ mnFormTextShdwYVal(((const XFormTextShadowYValItem&)rSet.Get(XATTR_FORMTXTSHDWYVAL)).GetValue()),
+ mnFormTextShdwTransp(((const XFormTextShadowTranspItem&)rSet.Get(XATTR_FORMTXTSHDWTRANSP)).GetValue()),
+ meFormTextStyle(((const XFormTextStyleItem&)rSet.Get(XATTR_FORMTXTSTYLE)).GetValue()),
+ meFormTextAdjust(((const XFormTextAdjustItem&)rSet.Get(XATTR_FORMTXTADJUST)).GetValue()),
+ meFormTextShadow(((const XFormTextShadowItem&)rSet.Get(XATTR_FORMTXTSHADOW)).GetValue()),
+ maFormTextShdwColor(((const XFormTextShadowColorItem&)rSet.Get(XATTR_FORMTXTSHDWCOLOR)).GetColorValue()),
+ mpOutline(0),
+ mpShadowOutline(0),
+ mbFormTextMirror(((const XFormTextMirrorItem&)rSet.Get(XATTR_FORMTXTMIRROR)).GetValue()),
+ mbFormTextOutline(((const XFormTextOutlineItem&)rSet.Get(XATTR_FORMTXTOUTLINE)).GetValue())
+ {
+ if(getFormTextOutline())
+ {
+ const StrokeAttribute aStrokeAttribute(impGetStrokeAttribute(rSet));
+
+ // also need to prepare attributes for outlines
+ {
+ const LineAttribute aLineAttribute(impGetLineAttribute(false, rSet));
+ const sal_uInt8 nTransparence(impGetStrokeTransparence(false, rSet));
+
+ mpOutline = new SdrFormTextOutlineAttribute(
+ aLineAttribute, aStrokeAttribute, nTransparence);
+ }
+
+ if(XFTSHADOW_NONE != getFormTextShadow())
+ {
+ // also need to prepare attributes for shadow outlines
+ const LineAttribute aLineAttribute(impGetLineAttribute(true, rSet));
+ const sal_uInt8 nTransparence(impGetStrokeTransparence(true, rSet));
+
+ mpShadowOutline = new SdrFormTextOutlineAttribute(
+ aLineAttribute, aStrokeAttribute, nTransparence);
+ }
+ }
+ }
+
+ SdrFormTextAttribute::~SdrFormTextAttribute()
+ {
+ if(mpOutline)
+ {
+ delete mpOutline;
+ mpOutline = 0;
+ }
+
+ if(mpShadowOutline)
+ {
+ delete mpShadowOutline;
+ mpShadowOutline = 0;
+ }
+ }
+
+ SdrFormTextAttribute::SdrFormTextAttribute(const SdrFormTextAttribute& rCandidate)
+ : mnFormTextDistance(rCandidate.getFormTextDistance()),
+ mnFormTextStart(rCandidate.getFormTextStart()),
+ mnFormTextShdwXVal(rCandidate.getFormTextShdwXVal()),
+ mnFormTextShdwYVal(rCandidate.getFormTextShdwYVal()),
+ mnFormTextShdwTransp(rCandidate.getFormTextShdwTransp()),
+ meFormTextStyle(rCandidate.getFormTextStyle()),
+ meFormTextAdjust(rCandidate.getFormTextAdjust()),
+ meFormTextShadow(rCandidate.getFormTextShadow()),
+ maFormTextShdwColor(rCandidate.getFormTextShdwColor()),
+ mpOutline(0),
+ mpShadowOutline(0),
+ mbFormTextMirror(rCandidate.getFormTextMirror()),
+ mbFormTextOutline(rCandidate.getFormTextOutline())
+ {
+ if(rCandidate.getOutline())
+ {
+ mpOutline = new SdrFormTextOutlineAttribute(*rCandidate.getOutline());
+ }
+
+ if(rCandidate.getShadowOutline())
+ {
+ mpShadowOutline = new SdrFormTextOutlineAttribute(*rCandidate.getShadowOutline());
+ }
+ }
+
+ SdrFormTextAttribute& SdrFormTextAttribute::operator=(const SdrFormTextAttribute& rCandidate)
+ {
+ mnFormTextDistance = rCandidate.getFormTextDistance();
+ mnFormTextStart = rCandidate.getFormTextStart();
+ mnFormTextShdwXVal = rCandidate.getFormTextShdwXVal();
+ mnFormTextShdwYVal = rCandidate.getFormTextShdwYVal();
+ mnFormTextShdwTransp = rCandidate.getFormTextShdwTransp();
+ meFormTextStyle = rCandidate.getFormTextStyle();
+ meFormTextAdjust = rCandidate.getFormTextAdjust();
+ meFormTextShadow = rCandidate.getFormTextShadow();
+ maFormTextShdwColor = rCandidate.getFormTextShdwColor();
+
+ if(mpOutline)
+ {
+ delete mpOutline;
+ }
+
+ mpOutline = 0;
+
+ if(rCandidate.getOutline())
+ {
+ mpOutline = new SdrFormTextOutlineAttribute(*rCandidate.getOutline());
+ }
+
+ if(mpShadowOutline)
+ {
+ delete mpShadowOutline;
+ }
+
+ mpShadowOutline = 0;
+
+ if(rCandidate.getShadowOutline())
+ {
+ mpShadowOutline = new SdrFormTextOutlineAttribute(*rCandidate.getShadowOutline());
+ }
+
+ mbFormTextMirror = rCandidate.getFormTextMirror();
+ mbFormTextOutline = rCandidate.getFormTextOutline();
+
+ return *this;
+ }
+
+ bool SdrFormTextAttribute::operator==(const SdrFormTextAttribute& rCandidate) const
+ {
+ return (getFormTextDistance() == rCandidate.getFormTextDistance()
+ && getFormTextStart() == rCandidate.getFormTextStart()
+ && getFormTextShdwXVal() == rCandidate.getFormTextShdwXVal()
+ && getFormTextShdwYVal() == rCandidate.getFormTextShdwYVal()
+ && getFormTextShdwTransp() == rCandidate.getFormTextShdwTransp()
+ && getFormTextStyle() == rCandidate.getFormTextStyle()
+ && getFormTextAdjust() == rCandidate.getFormTextAdjust()
+ && getFormTextShadow() == rCandidate.getFormTextShadow()
+ && getFormTextShdwColor() == rCandidate.getFormTextShdwColor()
+ && pointerOrContentEqual(getOutline(), rCandidate.getOutline())
+ && pointerOrContentEqual(getShadowOutline(), rCandidate.getShadowOutline())
+ && getFormTextMirror() == rCandidate.getFormTextMirror()
+ && getFormTextOutline() == rCandidate.getFormTextOutline());
+ }
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/inc/svx/sdr/overlay/overlaysdrobject.hxx b/svx/source/sdr/attribute/sdrformtextoutlineattribute.cxx
index 1625ba89be..0a96ad2f6f 100644
--- a/svx/inc/svx/sdr/overlay/overlaysdrobject.hxx
+++ b/svx/source/sdr/attribute/sdrformtextoutlineattribute.cxx
@@ -6,8 +6,9 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: overlaysdrobject.hxx,v $
- * $Revision: 1.4 $
+ * $RCSfile: sdrtextattribute.cxx,v $
+ *
+ * $Revision: 1.2 $
*
* This file is part of OpenOffice.org.
*
@@ -28,47 +29,38 @@
*
************************************************************************/
-#ifndef _SDR_OVERLAY_OVERLAYSDROBJECT_HXX
-#define _SDR_OVERLAY_OVERLAYSDROBJECT_HXX
+#include "precompiled_svx.hxx"
-#include <svx/sdr/overlay/overlayobject.hxx>
+#include <svx/sdr/attribute/sdrformtextoutlineattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
-// predeclarations
-class SdrObject;
+// pointer compare define
+#define pointerOrContentEqual(p, q) ((p == q) || (p && q && *p == *q))
//////////////////////////////////////////////////////////////////////////////
-namespace sdr
+namespace drawinglayer
{
- namespace overlay
+ namespace attribute
{
- class SVX_DLLPUBLIC OverlaySdrObject : public OverlayObjectWithBasePosition
+ SdrFormTextOutlineAttribute::SdrFormTextOutlineAttribute(
+ const LineAttribute& rLineAttribute,
+ const StrokeAttribute& rStrokeAttribute,
+ sal_uInt8 nTransparence)
+ : maLineAttribute(rLineAttribute),
+ maStrokeAttribute(rStrokeAttribute),
+ mnTransparence(nTransparence)
{
- protected:
- // the SdrObject to show
- const SdrObject& mrSdrObject;
-
- // Draw geometry
- virtual void drawGeometry(OutputDevice& rOutputDevice);
-
- // Create the BaseRange. This method needs to calculate maBaseRange.
- virtual void createBaseRange(OutputDevice& rOutputDevice);
-
- // Hittest with logical coordinates. Default tests against maBaseRange.
- virtual sal_Bool isHit(const basegfx::B2DPoint& rPos, double fTol = 0.0) const;
+ }
- public:
- OverlaySdrObject(
- const basegfx::B2DPoint& rBasePos,
- const SdrObject& rObject);
- virtual ~OverlaySdrObject();
- };
- } // end of namespace overlay
-} // end of namespace sdr
+ bool SdrFormTextOutlineAttribute::operator==(const SdrFormTextOutlineAttribute& rCandidate) const
+ {
+ return (getLineAttribute() == rCandidate.getLineAttribute()
+ && getStrokeAttribute() == rCandidate.getStrokeAttribute()
+ && getTransparence() == rCandidate.getTransparence());
+ }
+ } // end of namespace attribute
+} // end of namespace drawinglayer
//////////////////////////////////////////////////////////////////////////////
-
-#endif //_SDR_OVERLAY_OVERLAYSDROBJECT_HXX
-
// eof
diff --git a/svx/source/sdr/attribute/sdrtextattribute.cxx b/svx/source/sdr/attribute/sdrtextattribute.cxx
index 591fcb026a..09f5299654 100644
--- a/svx/source/sdr/attribute/sdrtextattribute.cxx
+++ b/svx/source/sdr/attribute/sdrtextattribute.cxx
@@ -30,11 +30,18 @@
************************************************************************/
#include "precompiled_svx.hxx"
+
#include <svx/sdr/attribute/sdrtextattribute.hxx>
+#include <svx/sdr/attribute/sdrformtextattribute.hxx>
#include <svx/svdotext.hxx>
#include <svx/outlobj.hxx>
#include <svx/editobj.hxx>
#include <svx/flditem.hxx>
+#include <svx/sdr/properties/properties.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// pointer compare define
+#define pointerOrContentEqual(p, q) ((p == q) || (p && q && *p == *q))
//////////////////////////////////////////////////////////////////////////////
@@ -56,13 +63,14 @@ namespace drawinglayer
bool bBlink,
bool bScroll,
bool bInEditMode)
- : mrSdrText(rSdrText),
+ : mpSdrText(&rSdrText),
maOutlinerParaObject(rOutlinerParaObject),
- meFormTextStyle(eFormTextStyle),
+ mpSdrFormTextAttribute(0),
maTextLeftDistance(aTextLeftDistance),
maTextUpperDistance(aTextUpperDistance),
maTextRightDistance(aTextRightDistance),
maTextLowerDistance(aTextLowerDistance),
+ maPropertiesVersion(0),
mbContour(bContour),
mbFitToSize(bFitToSize),
mbHideContour(bHideContour),
@@ -70,16 +78,94 @@ namespace drawinglayer
mbScroll(bScroll),
mbInEditMode(bInEditMode)
{
+ if(XFT_NONE != eFormTextStyle)
+ {
+ // text on path. Create FormText attribute
+ const SfxItemSet& rSet = getSdrText().GetItemSet();
+ mpSdrFormTextAttribute = new SdrFormTextAttribute(rSet);
+ }
+
+ // #i101556# init with version number to detect changes of single text
+ // attribute and/or style sheets in primitive data without having to
+ // copy that data locally (which would be better from principle)
+ maPropertiesVersion = rSdrText.GetObject().GetProperties().getVersion();
+ }
+
+ SdrTextAttribute::~SdrTextAttribute()
+ {
+ if(mpSdrFormTextAttribute)
+ {
+ delete mpSdrFormTextAttribute;
+ mpSdrFormTextAttribute = 0;
+ }
+ }
+
+ SdrTextAttribute::SdrTextAttribute(const SdrTextAttribute& rCandidate)
+ : mpSdrText(&rCandidate.getSdrText()),
+ maOutlinerParaObject(rCandidate.getOutlinerParaObject()),
+ mpSdrFormTextAttribute(0),
+ maTextLeftDistance(rCandidate.getTextLeftDistance()),
+ maTextUpperDistance(rCandidate.getTextUpperDistance()),
+ maTextRightDistance(rCandidate.getTextRightDistance()),
+ maTextLowerDistance(rCandidate.getTextLowerDistance()),
+ mbContour(rCandidate.isContour()),
+ mbFitToSize(rCandidate.isFitToSize()),
+ mbHideContour(rCandidate.isHideContour()),
+ mbBlink(rCandidate.isBlink()),
+ mbScroll(rCandidate.isScroll()),
+ mbInEditMode(rCandidate.isInEditMode())
+ {
+ if(rCandidate.getSdrFormTextAttribute())
+ {
+ mpSdrFormTextAttribute = new SdrFormTextAttribute(*rCandidate.getSdrFormTextAttribute());
+ }
+ }
+
+ SdrTextAttribute& SdrTextAttribute::operator=(const SdrTextAttribute& rCandidate)
+ {
+ mpSdrText = &rCandidate.getSdrText();
+ maOutlinerParaObject = rCandidate.getOutlinerParaObject();
+
+ if(mpSdrFormTextAttribute)
+ {
+ delete mpSdrFormTextAttribute;
+ }
+
+ mpSdrFormTextAttribute = 0;
+
+ if(rCandidate.getSdrFormTextAttribute())
+ {
+ mpSdrFormTextAttribute = new SdrFormTextAttribute(*rCandidate.getSdrFormTextAttribute());
+ }
+
+ maTextLeftDistance = rCandidate.getTextLeftDistance();
+ maTextUpperDistance = rCandidate.getTextUpperDistance();
+ maTextRightDistance = rCandidate.getTextRightDistance();
+ maTextLowerDistance = rCandidate.getTextLowerDistance();
+ mbContour = rCandidate.isContour();
+ mbFitToSize = rCandidate.isFitToSize();
+ mbHideContour = rCandidate.isHideContour();
+ mbBlink = rCandidate.isBlink();
+ mbScroll = rCandidate.isScroll();
+ mbInEditMode = rCandidate.isInEditMode();
+
+ return *this;
}
bool SdrTextAttribute::operator==(const SdrTextAttribute& rCandidate) const
{
return (getOutlinerParaObject() == rCandidate.getOutlinerParaObject()
- && getFormTextStyle() == rCandidate.getFormTextStyle()
+ // #i102062# for primitive visualisation, the WrongList (SpellChecking)
+ // is important, too, so use isWrongListEqual since there is no WrongList
+ // comparison in the regular OutlinerParaObject compare (since it's
+ // not-persistent data)
+ && getOutlinerParaObject().isWrongListEqual(rCandidate.getOutlinerParaObject())
+ && pointerOrContentEqual(getSdrFormTextAttribute(), rCandidate.getSdrFormTextAttribute())
&& getTextLeftDistance() == rCandidate.getTextLeftDistance()
&& getTextUpperDistance() == rCandidate.getTextUpperDistance()
&& getTextRightDistance() == rCandidate.getTextRightDistance()
&& getTextLowerDistance() == rCandidate.getTextLowerDistance()
+ && getPropertiesVersion() == rCandidate.getPropertiesVersion()
&& isContour() == rCandidate.isContour()
&& isFitToSize() == rCandidate.isFitToSize()
&& isHideContour() == rCandidate.isHideContour()
@@ -92,7 +178,7 @@ namespace drawinglayer
{
if(isBlink())
{
- mrSdrText.GetObject().impGetBlinkTextTiming(rAnimList);
+ mpSdrText->GetObject().impGetBlinkTextTiming(rAnimList);
}
}
@@ -100,7 +186,7 @@ namespace drawinglayer
{
if(isScroll())
{
- mrSdrText.GetObject().impGetScrollTextTiming(rAnimList, fFrameLength, fTextLength);
+ mpSdrText->GetObject().impGetScrollTextTiming(rAnimList, fFrameLength, fTextLength);
}
}
} // end of namespace attribute
diff --git a/svx/source/sdr/contact/viewcontactofe3dpolygon.cxx b/svx/source/sdr/contact/viewcontactofe3dpolygon.cxx
index 61d5cc78cb..e61c73c2d8 100644
--- a/svx/source/sdr/contact/viewcontactofe3dpolygon.cxx
+++ b/svx/source/sdr/contact/viewcontactofe3dpolygon.cxx
@@ -75,8 +75,8 @@ namespace sdr
basegfx::B3DPolyPolygon aPolyPolygon3D(GetE3dPolygonObj().GetPolyPolygon3D());
const basegfx::B3DPolyPolygon aPolyNormals3D(GetE3dPolygonObj().GetPolyNormals3D());
const basegfx::B2DPolyPolygon aPolyTexture2D(GetE3dPolygonObj().GetPolyTexture2D());
- const bool bNormals(aPolyNormals3D.count());
- const bool bTexture(aPolyTexture2D.count());
+ const bool bNormals(aPolyNormals3D.count() && aPolyNormals3D.count() == aPolyPolygon3D.count());
+ const bool bTexture(aPolyTexture2D.count() && aPolyTexture2D.count() == aPolyPolygon3D.count());
if(bNormals || bTexture)
{
@@ -100,12 +100,19 @@ namespace sdr
{
if(bNormals)
{
- aCandidate3D.setNormal(b, aNormals3D.getB3DPoint(b));
+ sal_uInt32 nNormalCount = aNormals3D.count();
+ if( b < nNormalCount )
+ aCandidate3D.setNormal(b, aNormals3D.getB3DPoint(b));
+ else if( nNormalCount > 0 )
+ aCandidate3D.setNormal(b, aNormals3D.getB3DPoint(0));
}
-
if(bTexture)
{
- aCandidate3D.setTextureCoordinate(b, aTexture2D.getB2DPoint(b));
+ sal_uInt32 nTextureCount = aTexture2D.count();
+ if( b < nTextureCount )
+ aCandidate3D.setTextureCoordinate(b, aTexture2D.getB2DPoint(b));
+ else if( nTextureCount > 0 )
+ aCandidate3D.setTextureCoordinate(b, aTexture2D.getB2DPoint(0));
}
}
diff --git a/svx/source/sdr/contact/viewcontactofgraphic.cxx b/svx/source/sdr/contact/viewcontactofgraphic.cxx
index 3f6ac13caf..29ee7efce1 100644
--- a/svx/source/sdr/contact/viewcontactofgraphic.cxx
+++ b/svx/source/sdr/contact/viewcontactofgraphic.cxx
@@ -53,6 +53,18 @@
#include <svdglob.hxx>
#include <vcl/svapp.hxx>
+#include <basegfx/polygon/b2dpolygontools.hxx>
+#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
+#include <drawinglayer/primitive2d/bitmapprimitive2d.hxx>
+#include <drawinglayer/primitive2d/textprimitive2d.hxx>
+#include <drawinglayer/primitive2d/textlayoutdevice.hxx>
+#include <drawinglayer/primitive2d/maskprimitive2d.hxx>
+
+#include <svx/sdr/primitive2d/sdrtextprimitive2d.hxx>
+#include <svx/eeitem.hxx>
+#include <svx/colritem.hxx>
+//#include <svx/xtable.hxx>
+
//////////////////////////////////////////////////////////////////////////////
namespace sdr
@@ -78,6 +90,238 @@ namespace sdr
{
}
+ void ViewContactOfGraphic::flushGraphicObjects()
+ {
+ // #i102380# The graphic is swapped out. To let that have an effect ist is necessary to
+ // delete copies of the GraphicObject which are not swapped out and have no SwapHandler set
+ // (this is what happnes when the GraphicObject gets copied to a SdrGrafPrimitive2D). This
+ // is best achieved for the VC by clearing the local decomposition cache. It would be possible
+ // to also do this for the VOC cache, but that VOCs exist exactly expresss that the object
+ // gets visualised, so this would be wrong.
+ flushViewIndependentPrimitive2DSequence();
+ }
+
+ drawinglayer::primitive2d::Primitive2DSequence ViewContactOfGraphic::createVIP2DSForPresObj(
+ const basegfx::B2DHomMatrix& rObjectMatrix,
+ const drawinglayer::attribute::SdrLineFillShadowTextAttribute& rAttribute,
+ const GraphicAttr& rLocalGrafInfo) const
+ {
+ drawinglayer::primitive2d::Primitive2DSequence xRetval;
+ GraphicObject aEmptyGraphicObject;
+ GraphicAttr aEmptyGraphicAttr;
+
+ // SdrGrafPrimitive2D without content in original size which carries all eventual attributes and texts
+ const drawinglayer::primitive2d::Primitive2DReference xReferenceA(new drawinglayer::primitive2d::SdrGrafPrimitive2D(
+ rObjectMatrix,
+ rAttribute,
+ aEmptyGraphicObject,
+ aEmptyGraphicAttr));
+ xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReferenceA, 1);
+
+ // SdrGrafPrimitive2D with content (which is the preview graphic) scaled to smaller size and
+ // without attributes
+ basegfx::B2DHomMatrix aSmallerMatrix;
+
+ // #i94431# for some reason, i forgot to take the PrefMapMode of the graphic
+ // into account. Since EmptyPresObj's are only used in Draw/Impress, it is
+ // safe to assume 100th mm as target.
+ Size aPrefSize(GetGrafObject().GetGrafPrefSize());
+
+ if(MAP_PIXEL == GetGrafObject().GetGrafPrefMapMode().GetMapUnit())
+ {
+ aPrefSize = Application::GetDefaultDevice()->PixelToLogic(aPrefSize, MAP_100TH_MM);
+ }
+ else
+ {
+ aPrefSize = Application::GetDefaultDevice()->LogicToLogic(aPrefSize, GetGrafObject().GetGrafPrefMapMode(), MAP_100TH_MM);
+ }
+
+ // decompose object matrix to get single values
+ basegfx::B2DVector aScale, aTranslate;
+ double fRotate, fShearX;
+ rObjectMatrix.decompose(aScale, aTranslate, fRotate, fShearX);
+
+ const double fOffsetX((aScale.getX() - aPrefSize.getWidth()) / 2.0);
+ const double fOffsetY((aScale.getY() - aPrefSize.getHeight()) / 2.0);
+
+ if(basegfx::fTools::moreOrEqual(fOffsetX, 0.0) && basegfx::fTools::moreOrEqual(fOffsetY, 0.0))
+ {
+ // create the EmptyPresObj fallback visualisation. The fallback graphic
+ // is already provided in rGraphicObject in this case, use it
+ aSmallerMatrix.scale(aPrefSize.getWidth(), aPrefSize.getHeight());
+ aSmallerMatrix.translate(fOffsetX, fOffsetY);
+ aSmallerMatrix.shearX(fShearX);
+ aSmallerMatrix.rotate(fRotate);
+ aSmallerMatrix.translate(aTranslate.getX(), aTranslate.getY());
+
+ const GraphicObject& rGraphicObject = GetGrafObject().GetGraphicObject(false);
+ const drawinglayer::attribute::SdrLineFillShadowTextAttribute aEmptyAttributes(0, 0, 0, 0, 0, 0);
+ const drawinglayer::primitive2d::Primitive2DReference xReferenceB(new drawinglayer::primitive2d::SdrGrafPrimitive2D(
+ aSmallerMatrix,
+ aEmptyAttributes,
+ rGraphicObject,
+ rLocalGrafInfo));
+
+ drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(xRetval, xReferenceB);
+ }
+
+ return xRetval;
+ }
+
+ drawinglayer::primitive2d::Primitive2DSequence ViewContactOfGraphic::createVIP2DSForDraft(
+ const basegfx::B2DHomMatrix& rObjectMatrix,
+ const drawinglayer::attribute::SdrLineFillShadowTextAttribute& rAttribute) const
+ {
+ drawinglayer::primitive2d::Primitive2DSequence xRetval;
+ GraphicObject aEmptyGraphicObject;
+ GraphicAttr aEmptyGraphicAttr;
+
+ // SdrGrafPrimitive2D without content in original size which carries all eventual attributes and texts
+ const drawinglayer::primitive2d::Primitive2DReference xReferenceA(new drawinglayer::primitive2d::SdrGrafPrimitive2D(
+ rObjectMatrix,
+ rAttribute,
+ aEmptyGraphicObject,
+ aEmptyGraphicAttr));
+ xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReferenceA, 1);
+
+ if(!rAttribute.getLine())
+ {
+ // create a surrounding frame when no linestyle given
+ const Color aColor(Application::GetSettings().GetStyleSettings().GetShadowColor());
+ const basegfx::BColor aBColor(aColor.getBColor());
+ const basegfx::B2DRange aUnitRange(0.0, 0.0, 1.0, 1.0);
+
+ basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(aUnitRange));
+ aOutline.transform(rObjectMatrix);
+
+ drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(xRetval,
+ drawinglayer::primitive2d::Primitive2DReference(
+ new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(
+ aOutline,
+ aBColor)));
+ }
+
+ // decompose object matrix to get single values
+ basegfx::B2DVector aScale, aTranslate;
+ double fRotate, fShearX;
+ rObjectMatrix.decompose(aScale, aTranslate, fRotate, fShearX);
+
+ // define a distance value, used for distance from bitmap to borders and from bitmap
+ // to text, too (2 mm)
+ const double fDistance(200.0);
+
+ // consume borders from values
+ aScale.setX(std::max(0.0, aScale.getX() - (2.0 * fDistance)));
+ aScale.setY(std::max(0.0, aScale.getY() - (2.0 * fDistance)));
+ aTranslate.setX(aTranslate.getX() + fDistance);
+ aTranslate.setY(aTranslate.getY() + fDistance);
+
+ // draw a draft bitmap
+ const Bitmap aDraftBitmap(ResId(BMAP_GrafikEi, *ImpGetResMgr()));
+
+ if(!aDraftBitmap.IsEmpty())
+ {
+ Size aPrefSize(aDraftBitmap.GetPrefSize());
+
+ if(MAP_PIXEL == aDraftBitmap.GetPrefMapMode().GetMapUnit())
+ {
+ aPrefSize = Application::GetDefaultDevice()->PixelToLogic(aDraftBitmap.GetSizePixel(), MAP_100TH_MM);
+ }
+ else
+ {
+ aPrefSize = Application::GetDefaultDevice()->LogicToLogic(aPrefSize, aDraftBitmap.GetPrefMapMode(), MAP_100TH_MM);
+ }
+
+ const double fBitmapScaling(2.0);
+ const double fWidth(aPrefSize.getWidth() * fBitmapScaling);
+ const double fHeight(aPrefSize.getHeight() * fBitmapScaling);
+
+ if(basegfx::fTools::more(fWidth, 1.0)
+ && basegfx::fTools::more(fHeight, 1.0)
+ && basegfx::fTools::lessOrEqual(fWidth, aScale.getX())
+ && basegfx::fTools::lessOrEqual(fHeight, aScale.getY()))
+ {
+ basegfx::B2DHomMatrix aBitmapMatrix;
+
+ aBitmapMatrix.scale(fWidth, fHeight);
+ aBitmapMatrix.shearX(fShearX);
+ aBitmapMatrix.rotate(fRotate);
+ aBitmapMatrix.translate(aTranslate.getX(), aTranslate.getY());
+
+ drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(xRetval,
+ drawinglayer::primitive2d::Primitive2DReference(
+ new drawinglayer::primitive2d::BitmapPrimitive2D(
+ BitmapEx(aDraftBitmap),
+ aBitmapMatrix)));
+
+ // consume bitmap size in X
+ aScale.setX(std::max(0.0, aScale.getX() - (fWidth + fDistance)));
+ aTranslate.setX(aTranslate.getX() + fWidth + fDistance);
+ }
+ }
+
+ // Build the text for the draft object
+ XubString aDraftText = GetGrafObject().GetFileName();
+
+ if(!aDraftText.Len())
+ {
+ aDraftText = GetGrafObject().GetName();
+ aDraftText.AppendAscii(" ...");
+ }
+
+ if(aDraftText.Len() && GetGrafObject().GetModel())
+ {
+ // #i103255# Goal is to produce TextPrimitives which hold the given text as
+ // BlockText in the available space. It would be very tricky to do
+ // an own word wrap/line layout here.
+ // Using SdrBlockTextPrimitive2D OTOH is critical since it internally
+ // uses the SdrObject it references. To solve this, create a temp
+ // SdrObject with Attributes and Text, generate a SdrBlockTextPrimitive2D
+ // directly and immediately decompose it. After that, it is no longer
+ // needed and can be deleted.
+
+ // create temp RectObj as TextObj and set needed attributes
+ SdrRectObj aRectObj(OBJ_TEXT);
+ aRectObj.SetModel(GetGrafObject().GetModel());
+ aRectObj.NbcSetText(aDraftText);
+ aRectObj.SetMergedItem(SvxColorItem(Color(COL_LIGHTRED), EE_CHAR_COLOR));
+
+ // get SdrText and OPO
+ SdrText* pSdrText = aRectObj.getText(0);
+ OutlinerParaObject* pOPO = aRectObj.GetOutlinerParaObject();
+
+ if(pSdrText && pOPO)
+ {
+ // directly use the remaining space as TextRangeTransform
+ basegfx::B2DHomMatrix aTextRangeTransform;
+
+ aTextRangeTransform.scale(aScale.getX(), aScale.getY());
+ aTextRangeTransform.shearX(fShearX);
+ aTextRangeTransform.rotate(fRotate);
+ aTextRangeTransform.translate(aTranslate.getX(), aTranslate.getY());
+
+ // directly create temp SdrBlockTextPrimitive2D
+ drawinglayer::primitive2d::SdrBlockTextPrimitive2D aBlockTextPrimitive(
+ pSdrText,
+ *pOPO,
+ aTextRangeTransform,
+ false,
+ false,
+ false);
+
+ // decompose immediately with neutral ViewInformation. This will
+ // layout the text to more simple TextPrimitives from drawinglayer
+ const drawinglayer::geometry::ViewInformation2D aViewInformation2D(0);
+
+ drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(
+ xRetval,
+ aBlockTextPrimitive.get2DDecomposition(aViewInformation2D));
+ }
+ }
+
+ return xRetval;
+ }
+
drawinglayer::primitive2d::Primitive2DSequence ViewContactOfGraphic::createViewIndependentPrimitive2DSequence() const
{
drawinglayer::primitive2d::Primitive2DSequence xRetval;
@@ -86,7 +330,8 @@ namespace sdr
if(pSdrText)
{
const SfxItemSet& rItemSet = GetGrafObject().GetMergedItemSet();
- drawinglayer::attribute::SdrLineFillShadowTextAttribute* pAttribute = drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute(rItemSet, *pSdrText);
+ drawinglayer::attribute::SdrLineFillShadowTextAttribute* pAttribute =
+ drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute(rItemSet, *pSdrText);
bool bVisible(pAttribute && pAttribute->isVisible());
// create and fill GraphicAttr
@@ -131,7 +376,7 @@ namespace sdr
// which will use the primitive data we just create in the near future
const Rectangle& rRectangle = GetGrafObject().GetGeoRect();
const ::basegfx::B2DRange aObjectRange(rRectangle.Left(), rRectangle.Top(), rRectangle.Right(), rRectangle.Bottom());
- ::basegfx::B2DHomMatrix aObjectMatrix;
+ basegfx::B2DHomMatrix aObjectMatrix;
// look for mirroring
const GeoStat& rGeoStat(GetGrafObject().GetGeoStat());
@@ -170,60 +415,25 @@ namespace sdr
// get the current, unchenged graphic obect from SdrGrafObj
const GraphicObject& rGraphicObject = GetGrafObject().GetGraphicObject(false);
- if(GetGrafObject().IsEmptyPresObj())
+ if(visualisationUsesPresObj())
{
// it's an EmptyPresObj, create the SdrGrafPrimitive2D without content and another scaled one
// with the content which is the placeholder graphic
- GraphicObject aEmptyGraphicObject;
- GraphicAttr aEmptyGraphicAttr;
- drawinglayer::attribute::SdrLineFillShadowTextAttribute aEmptyAttributes(0, 0, 0, 0, 0, 0);
-
- // SdrGrafPrimitive2D without content in original size which carries all eventual attributes and texts
- const drawinglayer::primitive2d::Primitive2DReference xReferenceA(new drawinglayer::primitive2d::SdrGrafPrimitive2D(
- aObjectMatrix, *pAttribute, aEmptyGraphicObject, aEmptyGraphicAttr));
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReferenceA, 1);
-
- // SdrGrafPrimitive2D with content (which is the preview graphic) scaled to smaller size and
- // without attributes
- basegfx::B2DHomMatrix aSmallerMatrix;
-
- // #i94431# for some reason, i forgot to take the PrefMapMode of the graphic
- // into account. Since EmptyPresObj's are only used in Draw/Impress, it is
- // safe to assume 100th mm as target.
- Size aPrefSize(GetGrafObject().GetGrafPrefSize());
-
- if(MAP_PIXEL == GetGrafObject().GetGrafPrefMapMode().GetMapUnit())
- {
- aPrefSize = Application::GetDefaultDevice()->PixelToLogic(aPrefSize, MAP_100TH_MM);
- }
- else
- {
- aPrefSize = Application::GetDefaultDevice()->LogicToLogic(aPrefSize, GetGrafObject().GetGrafPrefMapMode(), MAP_100TH_MM);
- }
-
- const double fOffsetX((aObjectRange.getWidth() - aPrefSize.getWidth()) / 2.0);
- const double fOffsetY((aObjectRange.getHeight() - aPrefSize.getHeight()) / 2.0);
-
- if(basegfx::fTools::moreOrEqual(fOffsetX, 0.0) && basegfx::fTools::moreOrEqual(fOffsetY, 0.0))
- {
- aSmallerMatrix.scale(aPrefSize.getWidth(), aPrefSize.getHeight());
- aSmallerMatrix.translate(fOffsetX, fOffsetY);
- aSmallerMatrix.shearX(fShearX);
- aSmallerMatrix.rotate(fRotate);
- aSmallerMatrix.translate(aObjectRange.getMinX(), aObjectRange.getMinY());
-
- const drawinglayer::primitive2d::Primitive2DReference xReferenceB(new drawinglayer::primitive2d::SdrGrafPrimitive2D(
- aSmallerMatrix,
- aEmptyAttributes,
- rGraphicObject,
- aLocalGrafInfo));
-
- drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(xRetval, xReferenceB);
- }
+ xRetval = createVIP2DSForPresObj(aObjectMatrix, *pAttribute, aLocalGrafInfo);
+ }
+ else if(visualisationUsesDraft())
+ {
+ // #i102380# The graphic is swapped out. To not force a swap-in here, there is a mechanism
+ // which shows a swapped-out-visualisation (which gets created here now) and an asynchronious
+ // visual update mechanism for swapped-out grapgics when they were loaded (see AsynchGraphicLoadingEvent
+ // and ViewObjectContactOfGraphic implementation). Not forcing the swap-in here allows faster
+ // (non-blocking) processing here and thus in the effect e.g. fast scrolling through pages
+ xRetval = createVIP2DSForDraft(aObjectMatrix, *pAttribute);
}
else
{
- // create primitive
+ // create primitive. Info: Calling the copy-constructor of GraphicObject in this
+ // SdrGrafPrimitive2D constructor will force a full swap-in of the graphic
const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::SdrGrafPrimitive2D(
aObjectMatrix,
*pAttribute,
@@ -241,6 +451,31 @@ namespace sdr
return xRetval;
}
+ bool ViewContactOfGraphic::visualisationUsesPresObj() const
+ {
+ return GetGrafObject().IsEmptyPresObj();
+ }
+
+ bool ViewContactOfGraphic::visualisationUsesDraft() const
+ {
+ // no draft when already PresObj
+ if(visualisationUsesPresObj())
+ return false;
+
+ // draft when swapped out
+ const GraphicObject& rGraphicObject = GetGrafObject().GetGraphicObject(false);
+ static bool bAllowReplacements(true);
+
+ if(rGraphicObject.IsSwappedOut() && bAllowReplacements)
+ return true;
+
+ // draft when no graphic
+ if(GRAPHIC_NONE == rGraphicObject.GetType() || GRAPHIC_DEFAULT == rGraphicObject.GetType())
+ return true;
+
+ return false;
+ }
+
} // end of namespace contact
} // end of namespace sdr
diff --git a/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx b/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx
index 9ef9832871..454b68cbfb 100644
--- a/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx
@@ -45,6 +45,7 @@
#include <svtools/colorcfg.hxx>
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
#include <vcl/svapp.hxx>
+#include <svx/sdr/primitive2d/sdrolecontentprimitive2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -71,7 +72,8 @@ namespace sdr
{
}
- drawinglayer::primitive2d::Primitive2DSequence ViewContactOfSdrOle2Obj::createPrimitive2DSequenceWithGivenGraphic(const Graphic& rOLEGraphic, bool bScaleContent) const
+ drawinglayer::primitive2d::Primitive2DSequence ViewContactOfSdrOle2Obj::createPrimitive2DSequenceWithParameters(
+ bool bHighContrast) const
{
drawinglayer::primitive2d::Primitive2DSequence xRetval;
SdrText* pSdrText = GetOle2Obj().getText(0);
@@ -103,80 +105,24 @@ namespace sdr
pAttribute = new drawinglayer::attribute::SdrLineFillShadowTextAttribute(0, 0, 0, 0, 0, 0);
}
- // Prepare OLE filling. This is normally the metafile describing OLE content, but may also
- // be the empty OLE bitmap for empty/not loaded OLEs
- const GraphicObject aGraphicObject(rOLEGraphic);
- const GraphicAttr aGraphicAttr;
- drawinglayer::primitive2d::Primitive2DSequence xOLEContent;
+ // #i102063# embed OLE content in an own primitive; this will be able to decompose accessing
+ // the weak SdrOle2 reference and will also implement getB2DRange() for fast BoundRect
+ // calculations without OLE Graphic access (which may trigger e.g. chart recalculation).
+ // It will also take care of HighContrast and ScaleContent
+ const drawinglayer::primitive2d::Primitive2DReference xOleContent(
+ new drawinglayer::primitive2d::SdrOleContentPrimitive2D(
+ GetOle2Obj(),
+ aObjectMatrix,
+ bHighContrast));
- if(bScaleContent)
- {
- // Create outline and placeholder graphic with some scaling
- // #i94431# for some reason, i forgot to take the PrefMapMode of the graphic
- // into account. Since EmptyPresObj's are only used in Draw/Impress, it is
- // safe to assume 100th mm as target.
- Size aPrefSize(rOLEGraphic.GetPrefSize());
-
- if(MAP_PIXEL == rOLEGraphic.GetPrefMapMode().GetMapUnit())
- {
- aPrefSize = Application::GetDefaultDevice()->PixelToLogic(aPrefSize, MAP_100TH_MM);
- }
- else
- {
- aPrefSize = Application::GetDefaultDevice()->LogicToLogic(aPrefSize, rOLEGraphic.GetPrefMapMode(), MAP_100TH_MM);
- }
-
- const double fOffsetX((aObjectRange.getWidth() - aPrefSize.getWidth()) / 2.0);
- const double fOffsetY((aObjectRange.getHeight() - aPrefSize.getHeight()) / 2.0);
-
- if(basegfx::fTools::moreOrEqual(fOffsetX, 0.0) && basegfx::fTools::moreOrEqual(fOffsetY, 0.0))
- {
- // if content fits into frame, create it
- basegfx::B2DHomMatrix aInnerObjectMatrix;
-
- aInnerObjectMatrix.scale(aPrefSize.getWidth(), aPrefSize.getHeight());
- aInnerObjectMatrix.translate(fOffsetX, fOffsetY);
- aInnerObjectMatrix.shearX(fShearX);
- aInnerObjectMatrix.rotate(fRotate);
- aInnerObjectMatrix.translate(aObjectRange.getMinX(), aObjectRange.getMinY());
-
- drawinglayer::primitive2d::Primitive2DReference xScaledContent(
- new drawinglayer::primitive2d::GraphicPrimitive2D(aInnerObjectMatrix, aGraphicObject, aGraphicAttr));
- xOLEContent = drawinglayer::primitive2d::Primitive2DSequence(&xScaledContent, 1);
- }
- }
- else
- {
- // create graphic primitive for content
- drawinglayer::primitive2d::Primitive2DReference xDirectContent(
- new drawinglayer::primitive2d::GraphicPrimitive2D(aObjectMatrix, aGraphicObject, aGraphicAttr));
- xOLEContent = drawinglayer::primitive2d::Primitive2DSequence(&xDirectContent, 1);
- }
-
// create primitive. Use Ole2 primitive here. Prepare attribute settings, will be used soon anyways.
+ const drawinglayer::primitive2d::Primitive2DSequence xOLEContent(&xOleContent, 1);
const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::SdrOle2Primitive2D(
xOLEContent,
aObjectMatrix,
*pAttribute));
xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
delete pAttribute;
-
- // a standard gray outline is created for scaled content
- if(bScaleContent)
- {
- const svtools::ColorConfig aColorConfig;
- const svtools::ColorConfigValue aColor(aColorConfig.GetColorValue(svtools::OBJECTBOUNDARIES));
-
- if(aColor.bIsVisible)
- {
- basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0, 0, 1, 1)));
- const Color aVclColor(aColor.nColor);
- aOutline.transform(aObjectMatrix);
- const drawinglayer::primitive2d::Primitive2DReference xOutline(
- new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(aOutline, aVclColor.getBColor()));
- drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(xRetval, xOutline);
- }
- }
}
return xRetval;
@@ -184,21 +130,8 @@ namespace sdr
drawinglayer::primitive2d::Primitive2DSequence ViewContactOfSdrOle2Obj::createViewIndependentPrimitive2DSequence() const
{
- const Graphic* pOLEGraphic = GetOle2Obj().GetGraphic();
-
- if(pOLEGraphic)
- {
- // there is a graphic set, use it
- return createPrimitive2DSequenceWithGivenGraphic(*pOLEGraphic, GetOle2Obj().IsEmptyPresObj());
- }
- else
- {
- // no graphic, use default empty OLE bitmap
- const Bitmap aEmptyOLEBitmap(GetOle2Obj().GetEmtyOLEReplacementBitmap());
- const Graphic aEmtyOLEGraphic(aEmptyOLEBitmap);
-
- return createPrimitive2DSequenceWithGivenGraphic(aEmtyOLEGraphic, true);
- }
+ // do as if no HC and call standard creator
+ return createPrimitive2DSequenceWithParameters(false);
}
} // end of namespace contact
} // end of namespace sdr
diff --git a/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx b/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx
index da467f8c63..1cb99de835 100644
--- a/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx
@@ -62,59 +62,86 @@ namespace sdr
if(pSdrText)
{
- drawinglayer::attribute::SdrLineFillShadowTextAttribute* pAttribute = drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute(rItemSet, *pSdrText);
+ drawinglayer::attribute::SdrLineFillShadowTextAttribute* pAttribute =
+ drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute(
+ rItemSet,
+ *pSdrText);
if(pAttribute)
{
if(pAttribute->isVisible())
{
- // prepare object transformation and unit polygon (direct model data)
- ::basegfx::B2DHomMatrix aObjectMatrix;
- ::basegfx::B2DPolyPolygon aUnitPolyPolygon(GetPathObj().GetPathPoly());
- const bool bIsLine(
- !aUnitPolyPolygon.areControlPointsUsed()
- && 1L == aUnitPolyPolygon.count()
- && 2L == aUnitPolyPolygon.getB2DPolygon(0L).count());
-
- if(bIsLine)
- {
- // special handling for single line mode (2 points)
- const ::basegfx::B2DPolygon aSubPolygon(aUnitPolyPolygon.getB2DPolygon(0L));
- const ::basegfx::B2DPoint aStart(aSubPolygon.getB2DPoint(0L));
- const ::basegfx::B2DPoint aEnd(aSubPolygon.getB2DPoint(1L));
- const ::basegfx::B2DVector aLine(aEnd - aStart);
-
- // create new polygon
- ::basegfx::B2DPolygon aNewPolygon;
- aNewPolygon.append(::basegfx::B2DPoint(0.0, 0.0));
- aNewPolygon.append(::basegfx::B2DPoint(aLine.getLength(), 0.0));
- aUnitPolyPolygon.setB2DPolygon(0L, aNewPolygon);
-
- // fill objectMatrix with rotation and offset (no shear for lines, scale in polygon)
- aObjectMatrix.rotate(atan2(aLine.getY(), aLine.getX()));
- aObjectMatrix.translate(aStart.getX(), aStart.getY());
- }
- else
+ basegfx::B2DPolyPolygon aUnitPolyPolygon(GetPathObj().GetPathPoly());
+ const sal_uInt32 nPolyCount(aUnitPolyPolygon.count());
+
+ if(nPolyCount)
{
- // create scaled, but unsheared, unrotated and untranslated polygon
- // by creating the object matrix and back-transforming the polygon
- const ::basegfx::B2DRange aObjectRange(::basegfx::tools::getRange(aUnitPolyPolygon));
- const GeoStat& rGeoStat(GetPathObj().GetGeoStat());
-
- aObjectMatrix.shearX(tan((36000 - rGeoStat.nShearWink) * F_PI18000));
- aObjectMatrix.rotate((36000 - rGeoStat.nDrehWink) * F_PI18000);
- aObjectMatrix.translate(aObjectRange.getMinX(), aObjectRange.getMinY());
-
- // ceate scaled unit polygon from object's absolute path
- ::basegfx::B2DHomMatrix aInverse(aObjectMatrix);
- aInverse.invert();
- aUnitPolyPolygon.transform(aInverse);
+ // prepare object transformation and unit polygon (direct model data)
+ basegfx::B2DHomMatrix aObjectMatrix;
+ const bool bIsLine(
+ !aUnitPolyPolygon.areControlPointsUsed()
+ && 1 == nPolyCount
+ && 2 == aUnitPolyPolygon.getB2DPolygon(0).count());
+
+ if(bIsLine)
+ {
+ // special handling for single line mode (2 points)
+ const basegfx::B2DPolygon aSubPolygon(aUnitPolyPolygon.getB2DPolygon(0));
+ const basegfx::B2DPoint aStart(aSubPolygon.getB2DPoint(0));
+ const basegfx::B2DPoint aEnd(aSubPolygon.getB2DPoint(1));
+ const basegfx::B2DVector aLine(aEnd - aStart);
+
+ // #i102548# create new unit polygon for line (horizontal)
+ basegfx::B2DPolygon aNewPolygon;
+ aNewPolygon.append(basegfx::B2DPoint(0.0, 0.0));
+ aNewPolygon.append(basegfx::B2DPoint(1.0, 0.0));
+ aUnitPolyPolygon.setB2DPolygon(0, aNewPolygon);
+
+ // #i102548# fill objectMatrix with rotation and offset (no shear for lines)
+ aObjectMatrix.scale(aLine.getLength(), 1.0);
+ aObjectMatrix.rotate(atan2(aLine.getY(), aLine.getX()));
+ aObjectMatrix.translate(aStart.getX(), aStart.getY());
+ }
+ else
+ {
+ // #i102548# create unscaled, unsheared, unrotated and untranslated polygon
+ // (unit polygon) by creating the object matrix and back-transforming the polygon
+ const basegfx::B2DRange aObjectRange(basegfx::tools::getRange(aUnitPolyPolygon));
+ const GeoStat& rGeoStat(GetPathObj().GetGeoStat());
+ const double fWidth(aObjectRange.getWidth());
+ const double fHeight(aObjectRange.getHeight());
+
+ aObjectMatrix.scale(
+ basegfx::fTools::equalZero(fWidth) ? 1.0 : fWidth,
+ basegfx::fTools::equalZero(fHeight) ? 1.0 : fHeight);
+
+ if(rGeoStat.nShearWink)
+ {
+ aObjectMatrix.shearX(tan((36000 - rGeoStat.nShearWink) * F_PI18000));
+ }
+
+ if(rGeoStat.nDrehWink)
+ {
+ aObjectMatrix.rotate((36000 - rGeoStat.nDrehWink) * F_PI18000);
+ }
+
+ aObjectMatrix.translate(aObjectRange.getMinX(), aObjectRange.getMinY());
+
+ // ceate unit polygon from object's absolute path
+ basegfx::B2DHomMatrix aInverse(aObjectMatrix);
+ aInverse.invert();
+ aUnitPolyPolygon.transform(aInverse);
+ }
+
+ // create primitive
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ new drawinglayer::primitive2d::SdrPathPrimitive2D(
+ aObjectMatrix,
+ *pAttribute,
+ aUnitPolyPolygon));
+
+ xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
-
- // create primitive
- const drawinglayer::primitive2d::Primitive2DReference xReference(
- new drawinglayer::primitive2d::SdrPathPrimitive2D(aObjectMatrix, *pAttribute, aUnitPolyPolygon));
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
delete pAttribute;
diff --git a/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx b/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx
index 0c6d3177b9..9c7810ea46 100644
--- a/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx
@@ -105,8 +105,14 @@ namespace sdr
drawinglayer::primitive2d::calculateRelativeCornerRadius(nCornerRadius, aObjectRange, fCornerRadiusX, fCornerRadiusY);
// create primitive
- const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::SdrRectanglePrimitive2D(
- aObjectMatrix, *pAttribute, fCornerRadiusX, fCornerRadiusY));
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ new drawinglayer::primitive2d::SdrRectanglePrimitive2D(
+ aObjectMatrix,
+ *pAttribute,
+ fCornerRadiusX,
+ fCornerRadiusY,
+ GetRectObj().IsTextFrame()));
+
xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
diff --git a/svx/source/sdr/contact/viewobjectcontactofgraphic.cxx b/svx/source/sdr/contact/viewobjectcontactofgraphic.cxx
index 7a6e115490..276da4a240 100644
--- a/svx/source/sdr/contact/viewobjectcontactofgraphic.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofgraphic.cxx
@@ -38,6 +38,7 @@
#include <svx/svdograf.hxx>
#include <svx/sdr/contact/objectcontact.hxx>
#include <svx/svdmodel.hxx>
+#include <svx/svdpage.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -219,6 +220,11 @@ namespace sdr
SdrGrafObj& rGrafObj = getSdrGrafObj();
rGrafObj.ForceSwapIn();
+ // #i103720# forget event to avoid possible deletion by the following ActionChanged call
+ // which may use createPrimitive2DSequence/impPrepareGraphicWithAsynchroniousLoading again.
+ // Deletion is actally done by the scheduler who leaded to coming here
+ mpAsynchLoadEvent = 0;
+
// Invalidate all paint areas and check existing animation (which may have changed).
GetViewContact().ActionChanged();
}
@@ -229,11 +235,15 @@ namespace sdr
void ViewObjectContactOfGraphic::forgetAsynchGraphicLoadingEvent(sdr::event::AsynchGraphicLoadingEvent* pEvent)
{
(void) pEvent; // suppress warning
- DBG_ASSERT(mpAsynchLoadEvent, "ViewObjectContactOfGraphic::forgetAsynchGraphicLoadingEvent: I did not trigger a event, why am i called (?)");
- DBG_ASSERT(mpAsynchLoadEvent == pEvent, "ViewObjectContactOfGraphic::forgetAsynchGraphicLoadingEvent: Forced to forget another event then i have scheduled (?)");
- // forget event
- mpAsynchLoadEvent = 0;
+ if(mpAsynchLoadEvent)
+ {
+ OSL_ENSURE(!pEvent || mpAsynchLoadEvent == pEvent,
+ "ViewObjectContactOfGraphic::forgetAsynchGraphicLoadingEvent: Forced to forget another event then i have scheduled (?)");
+
+ // forget event
+ mpAsynchLoadEvent = 0;
+ }
}
SdrGrafObj& ViewObjectContactOfGraphic::getSdrGrafObj()
@@ -245,10 +255,19 @@ namespace sdr
{
// prepare primitive generation with evtl. loading the graphic when it's swapped out
SdrGrafObj& rGrafObj = const_cast< ViewObjectContactOfGraphic* >(this)->getSdrGrafObj();
- const bool bDoAsynchronGraphicLoading(rGrafObj.GetModel() && rGrafObj.GetModel()->IsSwapGraphics());
+ bool bDoAsynchronGraphicLoading(rGrafObj.GetModel() && rGrafObj.GetModel()->IsSwapGraphics());
static bool bSuppressAsynchLoading(false);
bool bSwapInDone(false);
+ if(bDoAsynchronGraphicLoading
+ && rGrafObj.IsSwappedOut()
+ && rGrafObj.GetPage()
+ && rGrafObj.GetPage()->IsMasterPage())
+ {
+ // #i102380# force Swap-In for GraphicObjects on MasterPage to have a nicer visualisation
+ bDoAsynchronGraphicLoading = false;
+ }
+
if(bDoAsynchronGraphicLoading && !bSuppressAsynchLoading)
{
bSwapInDone = const_cast< ViewObjectContactOfGraphic* >(this)->impPrepareGraphicWithAsynchroniousLoading();
@@ -261,6 +280,23 @@ namespace sdr
// get return value by calling parent
drawinglayer::primitive2d::Primitive2DSequence xRetval = ViewObjectContactOfSdrObj::createPrimitive2DSequence(rDisplayInfo);
+ if(xRetval.hasElements())
+ {
+ // #i103255# suppress when graphic needs draft visualisation and output
+ // is for PDF export/Printer
+ const ViewContactOfGraphic& rVCOfGraphic = static_cast< const ViewContactOfGraphic& >(GetViewContact());
+
+ if(rVCOfGraphic.visualisationUsesDraft())
+ {
+ const ObjectContact& rObjectContact = GetObjectContact();
+
+ if(rObjectContact.isOutputToPDFFile() || rObjectContact.isOutputToPrinter())
+ {
+ xRetval = drawinglayer::primitive2d::Primitive2DSequence();
+ }
+ }
+ }
+
// if swap in was forced only for printing, swap out again
const bool bSwapInExclusiveForPrinting(bSwapInDone && GetObjectContact().isOutputToPrinter());
diff --git a/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx b/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx
index f69f4d5550..87ba0b8c3a 100644
--- a/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx
@@ -291,7 +291,8 @@ namespace sdr
}
// add a gray outline frame, except not when printing
- if(!GetObjectContact().isOutputToPrinter())
+ // #i102637# add frame also when printing and page exists (handout pages)
+ if(!GetObjectContact().isOutputToPrinter() || pPage)
{
const Color aFrameColor(aColorConfig.GetColorValue(svtools::OBJECTBOUNDARIES).nColor);
basegfx::B2DPolygon aOwnOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
diff --git a/svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx b/svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx
index b11bc993f3..9c9aaa959c 100644
--- a/svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx
@@ -37,10 +37,13 @@
#include <svx/sdr/contact/viewcontactofsdrole2obj.hxx>
#include <svx/svdoole2.hxx>
#include <svx/sdr/contact/objectcontact.hxx>
+#include <svx/svdview.hxx>
#include <drawinglayer/primitive2d/chartprimitive2d.hxx>
#include <drawinglayer/attribute/fillattribute.hxx>
#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
+#include <com/sun/star/embed/EmbedMisc.hpp>
+#include <com/sun/star/embed/EmbedStates.hpp>
//////////////////////////////////////////////////////////////////////////////
@@ -57,138 +60,175 @@ namespace sdr
return static_cast< ViewContactOfSdrOle2Obj& >(GetViewContact()).GetOle2Obj();
}
- drawinglayer::primitive2d::Primitive2DSequence ViewObjectContactOfSdrOle2Obj::createPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const
+ drawinglayer::primitive2d::Primitive2DSequence ViewObjectContactOfSdrOle2Obj::createPrimitive2DSequence(
+ const DisplayInfo& /*rDisplayInfo*/) const
{
// this method is overloaded to do some things the old SdrOle2Obj::DoPaintObject did.
// In the future, some of these may be solved different, but ATM try to stay compatible
// with the old behaviour
drawinglayer::primitive2d::Primitive2DSequence xRetval;
const SdrOle2Obj& rSdrOle2 = getSdrOle2Object();
- const bool bIsActive(rSdrOle2.executeOldDoPaintPreparations(GetObjectContact().TryToGetSdrPageView()));
- const Rectangle& rObjectRectangle(rSdrOle2.GetGeoRect());
- const basegfx::B2DRange aObjectRange(rObjectRectangle.Left(), rObjectRectangle.Top(), rObjectRectangle.Right(), rObjectRectangle.Bottom());
-
- // create object transform
- basegfx::B2DHomMatrix aObjectTransform;
- aObjectTransform.set(0, 0, aObjectRange.getWidth());
- aObjectTransform.set(1, 1, aObjectRange.getHeight());
- aObjectTransform.set(0, 2, aObjectRange.getMinX());
- aObjectTransform.set(1, 2, aObjectRange.getMinY());
-
- if(GetObjectContact().isDrawModeHighContrast())
- {
- // directly call at the corresponding VC and force OLE Graphic to HighContrast
- const ViewContactOfSdrOle2Obj& rVC = static_cast< const ViewContactOfSdrOle2Obj& >(GetViewContact());
- Graphic* pOLEHighContrastGraphic = rSdrOle2.getEmbeddedObjectRef().GetHCGraphic();
+ sal_Int32 nState(-1);
- if(pOLEHighContrastGraphic)
- {
- // there is a graphic set, use it
- xRetval = rVC.createPrimitive2DSequenceWithGivenGraphic(*pOLEHighContrastGraphic, rSdrOle2.IsEmptyPresObj());
- }
- else
- {
- // no HighContrast graphic, use default empty OLE bitmap
- const Bitmap aEmptyOLEBitmap(rSdrOle2.GetEmtyOLEReplacementBitmap());
- const Graphic aEmtyOLEGraphic(aEmptyOLEBitmap);
-
- xRetval = rVC.createPrimitive2DSequenceWithGivenGraphic(aEmtyOLEGraphic, true);
- }
- }
- else
{
- // call parent which will use the regular createViewIndependentPrimitive2DSequence
- // at the corresponding VC
- xRetval = ViewObjectContactOfSdrObj::createPrimitive2DSequence(rDisplayInfo);
+ const svt::EmbeddedObjectRef& xObjRef = rSdrOle2.getEmbeddedObjectRef();
+ if ( xObjRef.is() )
+ nState = xObjRef->getCurrentState();
}
- if(rSdrOle2.getEmbeddedObjectRef().IsChart())
+ const bool bIsOutplaceActive(nState == embed::EmbedStates::ACTIVE);
+ const bool bIsInplaceActive((nState == embed::EmbedStates::INPLACE_ACTIVE) || (nState == embed::EmbedStates::UI_ACTIVE));
+ const bool bIsChart(rSdrOle2.IsChart());
+ bool bDone(false);
+
+ if(!bDone && bIsInplaceActive)
{
- // for chart, to not lose the current better quality visualisation which
- // uses a direct paint, use a primtive wrapper for that exceptional case. The renderers
- // will then ATM paint it to an OutputDevice directly.
- // In later versions this should be replaced by getting the Primitive2DSequnce from
- // the chart and using it.
- // to be able to render something in non-VCL using renderers, the wrapper is a
- // GroupPrimitive2D which automatically decomposes to the already created Metafile
- // content.
- // For being completely compatible, ATM Window and VDEV PrettyPrinting is suppressed.
- // It works in the VCL renderers, though. So for activating again with VCL primitive
- // renderers, change conditions here.
-
- // determine if embedding and PrettyPrinting shall be done at all
- uno::Reference< frame::XModel > xChartModel;
- bool bDoChartPrettyPrinting(true);
- static bool bPrettyPrintingForBitmaps(false);
-
- // the original ChartPrettyPainter does not do it for Window
- if(!bPrettyPrintingForBitmaps && bDoChartPrettyPrinting && GetObjectContact().isOutputToWindow())
+ if( !GetObjectContact().isOutputToPrinter() && !GetObjectContact().isOutputToRecordingMetaFile() )
{
- bDoChartPrettyPrinting = false;
+ //no need to create a primitive sequence here as the OLE object does render itself
+ //in case of charts the superfluous creation of a metafile is strongly performance relevant!
+ bDone = true;
}
+ }
+
+ if( !bDone )
+ {
+ const Rectangle& rObjectRectangle(rSdrOle2.GetGeoRect());
+ const basegfx::B2DRange aObjectRange(rObjectRectangle.Left(), rObjectRectangle.Top(), rObjectRectangle.Right(), rObjectRectangle.Bottom());
+
+ // create object transform
+ basegfx::B2DHomMatrix aObjectTransform;
+ aObjectTransform.set(0, 0, aObjectRange.getWidth());
+ aObjectTransform.set(1, 1, aObjectRange.getHeight());
+ aObjectTransform.set(0, 2, aObjectRange.getMinX());
+ aObjectTransform.set(1, 2, aObjectRange.getMinY());
- // the original ChartPrettyPainter does not do it for VDEV
- if(!bPrettyPrintingForBitmaps && bDoChartPrettyPrinting && GetObjectContact().isOutputToVirtualDevice())
+ if(bIsChart)
{
- if(GetObjectContact().isOutputToPDFFile())
+ //charts must be painted resolution dependent!! #i82893#, #i75867#
+
+ // for chart, to not lose the current better quality visualisation which
+ // uses a direct paint, use a primtive wrapper for that exceptional case. The renderers
+ // will then ATM paint it to an OutputDevice directly.
+ // In later versions this should be replaced by getting the Primitive2DSequnce from
+ // the chart and using it.
+ // to be able to render something in non-VCL using renderers, the wrapper is a
+ // GroupPrimitive2D which automatically decomposes to the already created Metafile
+ // content.
+ // For being completely compatible, ATM Window and VDEV PrettyPrinting is suppressed.
+ // It works in the VCL renderers, though. So for activating again with VCL primitive
+ // renderers, change conditions here.
+
+ // determine if embedding and PrettyPrinting shall be done at all
+ uno::Reference< frame::XModel > xChartModel;
+ bool bDoChartPrettyPrinting(true);
+
+ // the original ChartPrettyPainter does not do it for Window
+ if(bDoChartPrettyPrinting && GetObjectContact().isOutputToWindow())
{
- // #i97982#
- // For PDF files, allow PrettyPrinting
+ bDoChartPrettyPrinting = false;
}
- else
+
+ // the original ChartPrettyPainter does not do it for VDEV
+ if(bDoChartPrettyPrinting && GetObjectContact().isOutputToVirtualDevice())
{
- bDoChartPrettyPrinting = false;
+ if(GetObjectContact().isOutputToPDFFile())
+ {
+ // #i97982#
+ // For PDF files, allow PrettyPrinting
+ }
+ else
+ {
+ bDoChartPrettyPrinting = false;
+ }
}
- }
- // the chart model is needed. Check if it's available
- if(bDoChartPrettyPrinting)
- {
- // get chart model
- xChartModel = rSdrOle2.getXModel();
+ // the chart model is needed. Check if it's available
+ if(bDoChartPrettyPrinting)
+ {
+ // get chart model
+ xChartModel = rSdrOle2.getXModel();
- if(!xChartModel.is())
+ if(!xChartModel.is())
+ {
+ bDoChartPrettyPrinting = false;
+ }
+ }
+
+ if(bDoChartPrettyPrinting)
{
- bDoChartPrettyPrinting = false;
+ // embed MetaFile data in a specialized Wrapper Primitive which holds also the ChartModel needed
+ // for PrettyPrinting
+ const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::ChartPrimitive2D(
+ xChartModel, aObjectTransform, xRetval));
+ xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
+ bDone = true;
}
}
- if(bDoChartPrettyPrinting)
+ if( !bDone )
{
- // embed MetaFile data in a specialized Wrapper Primitive which holds also the ChartModel needed
- // for PrettyPrinting
- const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::ChartPrimitive2D(
- xChartModel, aObjectTransform, xRetval));
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
+ //old stuff that should be reworked
+ {
+ //if no replacement image is available load the OLE object
+ if(!rSdrOle2.GetGraphic()) //try to fetch the metafile - this can lead to the actual creation of the metafile what can be extremely expensive (e.g. for big charts)!!! #i101925#
+ {
+ // try to create embedded object
+ rSdrOle2.GetObjRef(); //this loads the OLE object if it is not loaded already
+ }
+ const svt::EmbeddedObjectRef& xObjRef = rSdrOle2.getEmbeddedObjectRef();
+ if(xObjRef.is())
+ {
+ const sal_Int64 nMiscStatus(xObjRef->getStatus(rSdrOle2.GetAspect()));
+
+ // this hack (to change model data during PAINT argh(!)) should be reworked
+ if(!rSdrOle2.IsResizeProtect() && (nMiscStatus & embed::EmbedMisc::EMBED_NEVERRESIZE))
+ {
+ const_cast< SdrOle2Obj* >(&rSdrOle2)->SetResizeProtect(true);
+ }
+
+ SdrPageView* pPageView = GetObjectContact().TryToGetSdrPageView();
+ if(pPageView && (nMiscStatus & embed::EmbedMisc::MS_EMBED_ACTIVATEWHENVISIBLE))
+ {
+ // connect plugin object
+ pPageView->GetView().DoConnect(const_cast< SdrOle2Obj* >(&rSdrOle2));
+ }
+ }
+ }//end old stuff to rework
+
+ // create OLE primitive stuff directly at VC with HC as parameter
+ const ViewContactOfSdrOle2Obj& rVC = static_cast< const ViewContactOfSdrOle2Obj& >(GetViewContact());
+ xRetval = rVC.createPrimitive2DSequenceWithParameters(GetObjectContact().isDrawModeHighContrast());
}
- }
- if(bIsActive)
- {
- // do not shade when printing or PDF exporting
- if(!GetObjectContact().isOutputToPrinter() && !GetObjectContact().isOutputToRecordingMetaFile())
+ if(bIsOutplaceActive)
{
- // shade the representation if the object is activated outplace
- basegfx::B2DPolygon aObjectOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
- aObjectOutline.transform(aObjectTransform);
-
- // Use a FillHatchPrimitive2D with necessary attributes
- const drawinglayer::attribute::FillHatchAttribute aFillHatch(
- drawinglayer::attribute::HATCHSTYLE_SINGLE, // single hatch
- 125.0, // 1.25 mm
- 45.0 * F_PI180, // 45 degree diagonal
- Color(COL_BLACK).getBColor(), // black color
- false); // no filling
-
- const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::PolyPolygonHatchPrimitive2D(
- basegfx::B2DPolyPolygon(aObjectOutline),
- Color(COL_BLACK).getBColor(),
- aFillHatch));
-
- drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(xRetval, xReference);
+ // do not shade when printing or PDF exporting
+ if(!GetObjectContact().isOutputToPrinter() && !GetObjectContact().isOutputToRecordingMetaFile())
+ {
+ // shade the representation if the object is activated outplace
+ basegfx::B2DPolygon aObjectOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
+ aObjectOutline.transform(aObjectTransform);
+
+ // Use a FillHatchPrimitive2D with necessary attributes
+ const drawinglayer::attribute::FillHatchAttribute aFillHatch(
+ drawinglayer::attribute::HATCHSTYLE_SINGLE, // single hatch
+ 125.0, // 1.25 mm
+ 45.0 * F_PI180, // 45 degree diagonal
+ Color(COL_BLACK).getBColor(), // black color
+ false); // no filling
+
+ const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::PolyPolygonHatchPrimitive2D(
+ basegfx::B2DPolyPolygon(aObjectOutline),
+ Color(COL_BLACK).getBColor(),
+ aFillHatch));
+
+ drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(xRetval, xReference);
+ }
}
- }
+ }
+
return xRetval;
}
diff --git a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
index 43114516c7..2ba50855ae 100644
--- a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
@@ -35,6 +35,7 @@
#include <svx/sdr/contact/displayinfo.hxx>
#include <svx/sdr/properties/properties.hxx>
#include <svx/sdr/contact/objectcontactofpageview.hxx>
+#include <svx/sdr/primitive2d/svx_primitivetypes2d.hxx>
/** === begin UNO includes === **/
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -80,6 +81,7 @@ namespace sdr { namespace contact {
using ::com::sun::star::uno::XInterface;
using ::com::sun::star::uno::UNO_QUERY;
using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::com::sun::star::uno::UNO_SET_THROW;
using ::com::sun::star::uno::Exception;
using ::com::sun::star::uno::RuntimeException;
using ::com::sun::star::awt::XControl;
@@ -175,7 +177,11 @@ namespace sdr { namespace contact {
inline void addWindowListener( const Reference< XWindowListener >& _l ) const { m_xControlWindow->addWindowListener( _l ); }
inline void removeWindowListener( const Reference< XWindowListener >& _l ) const { m_xControlWindow->removeWindowListener( _l ); }
void setPosSize( const Rectangle& _rPosSize ) const;
- void setZoom( const MapMode& _rMapMode ) const;
+ Rectangle
+ getPosSize() const;
+ void setZoom( const ::basegfx::B2DVector& _rScale ) const;
+ ::basegfx::B2DVector
+ getZoom() const;
inline void setGraphics( const Reference< XGraphics >& _g ) const { m_xControlView->setGraphics( _g ); }
inline Reference< XGraphics >
@@ -221,10 +227,36 @@ namespace sdr { namespace contact {
}
//--------------------------------------------------------------------
- void ControlHolder::setZoom( const MapMode& _rMapMode ) const
+ ::Rectangle ControlHolder::getPosSize() const
{
// no check whether we're valid, this is the responsibility of the caller
- m_xControlView->setZoom( (float)double( _rMapMode.GetScaleX() ), (float)double( _rMapMode.GetScaleY() ) );
+ return VCLUnoHelper::ConvertToVCLRect( m_xControlWindow->getPosSize() );
+ }
+
+ //--------------------------------------------------------------------
+ void ControlHolder::setZoom( const ::basegfx::B2DVector& _rScale ) const
+ {
+ // no check whether we're valid, this is the responsibility of the caller
+ m_xControlView->setZoom( (float)_rScale.getX(), (float)_rScale.getY() );
+ }
+
+ //--------------------------------------------------------------------
+ ::basegfx::B2DVector ControlHolder::getZoom() const
+ {
+ // no check whether we're valid, this is the responsibility of the caller
+
+ // Argh. Why does XView have a setZoom only, but not a getZoom?
+ Window* pWindow = VCLUnoHelper::GetWindow( m_xControlWindow );
+ OSL_ENSURE( pWindow, "ControlHolder::setZoom: no implementation access!" );
+
+ ::basegfx::B2DVector aZoom( 1, 1 );
+ if ( pWindow )
+ {
+ const Fraction& rZoom( pWindow->GetZoom() );
+ aZoom.setX( (double)rZoom );
+ aZoom.setY( (double)rZoom );
+ }
+ return aZoom;
}
//====================================================================
@@ -233,37 +265,13 @@ namespace sdr { namespace contact {
class UnoControlContactHelper
{
public:
- /** positions a control relative to a device
-
- @precond <arg>_pDevice</arg> is not <NULL/>
+ /** positions a control, and sets its zoom mode, using a given transformation and output device
*/
- static void positionControl_throw(
+ static void adjustControlGeometry_throw(
const ControlHolder& _rControl,
const Rectangle& _rLogicBoundingRect,
- const OutputDevice* _pDevice
- );
-
- /** sets the zoom at a UNO control, according to a Device's MapMode
-
- @precond <arg>_pDevice</arg> is not <NULL/>
- */
- static void setControlZoom(
- const ControlHolder& _rControl,
- const OutputDevice* _pDevice
- );
-
- /** draws a given control onto it's current XGraphics, at given coordinates
-
- Note that the control is not drawn onto the given device, instead you must
- use ->XView::setGraphics yourself, before calling this method. The given ->OutputDevice
- is only used to calculate pixel coordinates from logic coordinates
-
- @precond <arg>_pDevice</arg> is not <NULL/>
- */
- static void drawControl(
- const ControlHolder& _rControl,
- const Point& _rLogicTopLeft,
- const OutputDevice* _pDevice
+ const ::basegfx::B2DHomMatrix& _rViewTransformation,
+ const ::basegfx::B2DHomMatrix& _rZoomLevelNormalization
);
/** disposes the given control
@@ -279,50 +287,28 @@ namespace sdr { namespace contact {
};
//--------------------------------------------------------------------
- void UnoControlContactHelper::positionControl_throw( const ControlHolder& _rControl, const Rectangle& _rLogicBoundingRect,
- const OutputDevice* _pDevice )
+ void UnoControlContactHelper::adjustControlGeometry_throw( const ControlHolder& _rControl, const Rectangle& _rLogicBoundingRect,
+ const basegfx::B2DHomMatrix& _rViewTransformation, const ::basegfx::B2DHomMatrix& _rZoomLevelNormalization )
{
- OSL_PRECOND( _pDevice, "UnoControlContactHelper::positionControl_throw: no device -> no survival!" );
-
- if ( _rControl.is() )
- {
- const Rectangle aPaintRectPixel(
- _pDevice->LogicToPixel( _rLogicBoundingRect.TopLeft() ),
- _pDevice->LogicToPixel( _rLogicBoundingRect.GetSize() )
- );
-
- _rControl.setPosSize( aPaintRectPixel );
- }
- }
-
- //--------------------------------------------------------------------
- void UnoControlContactHelper::setControlZoom( const ControlHolder& _rControl, const OutputDevice* _pDevice )
- {
- OSL_PRECOND( _pDevice, "UnoControlContactHelper::setControlZoom: no device -> no survival!" );
- OSL_PRECOND( _rControl.is(), "UnoControlContactHelper::setControlZoom: illegal control!" );
-
- if ( _rControl.is() )
- _rControl.setZoom( _pDevice->GetMapMode() );
- }
-
- //--------------------------------------------------------------------
- void UnoControlContactHelper::drawControl( const ControlHolder& _rControl, const Point& _rLogicTopLeft,
- const OutputDevice* _pDevice )
- {
- OSL_PRECOND( _rControl.is(), "UnoControlContactHelper::drawControl: invalid control!" );
+ OSL_PRECOND( _rControl.is(), "UnoControlContactHelper::adjustControlGeometry_throw: illegal control!" );
if ( !_rControl.is() )
return;
- try
- {
- _rControl.draw(
- _pDevice->LogicToPixel( _rLogicTopLeft )
- );
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
+ // transform the logic bound rect, using the view transformation, to pixel coordinates
+ ::basegfx::B2DPoint aTopLeft( _rLogicBoundingRect.Left(), _rLogicBoundingRect.Top() );
+ aTopLeft *= _rViewTransformation;
+ ::basegfx::B2DPoint aBottomRight( _rLogicBoundingRect.Right(), _rLogicBoundingRect.Bottom() );
+ aBottomRight *= _rViewTransformation;
+
+ const Rectangle aPaintRectPixel( (long)aTopLeft.getX(), (long)aTopLeft.getY(), (long)aBottomRight.getX(), (long)aBottomRight.getY() );
+ _rControl.setPosSize( aPaintRectPixel );
+
+ // determine the scale from the current view transformation, and the normalization matrix
+ ::basegfx::B2DHomMatrix aObtainResolutionDependentScale( _rViewTransformation * _rZoomLevelNormalization );
+ ::basegfx::B2DVector aScale, aTranslate;
+ double fRotate, fShearX;
+ aObtainResolutionDependentScale.decompose( aScale, aTranslate, fRotate, fShearX );
+ _rControl.setZoom( aScale );
}
//--------------------------------------------------------------------
@@ -402,40 +388,7 @@ namespace sdr { namespace contact {
}
//====================================================================
- //= DummyPageViewAccess
- //====================================================================
- /** is a ->IPageViewAccess implementation which defaults all attribute access, and thus can be
- operated without an actual ->SdrPageView
- */
- class DummyPageViewAccess : public IPageViewAccess
- {
- public:
- virtual bool isDesignMode() const;
- virtual Reference< XControlContainer >
- getControlContainer( const OutputDevice& _rDevice ) const;
- virtual bool isLayerVisible( SdrLayerID _nLayerID ) const;
- };
-
- //--------------------------------------------------------------------
- bool DummyPageViewAccess::isDesignMode() const
- {
- return true;
- }
-
- //--------------------------------------------------------------------
- Reference< XControlContainer > DummyPageViewAccess::getControlContainer( const OutputDevice& /*_rDevice*/ ) const
- {
- return Reference< XControlContainer >();
- }
-
- //--------------------------------------------------------------------
- bool DummyPageViewAccess::isLayerVisible( SdrLayerID /*_nLayerID*/ ) const
- {
- return true;
- }
-
- //====================================================================
- //= DummyPageViewAccess
+ //= InvisibleControlViewAccess
//====================================================================
/** is a ->IPageViewAccess implementation which can be used to create an invisble control for
an arbitrary device
@@ -510,7 +463,7 @@ namespace sdr { namespace contact {
Reference< XContainer > m_xContainer;
/// the output device for which the control was created
- OutputDevice const* m_pOutputDeviceForWindow;
+ const OutputDevice* m_pOutputDeviceForWindow;
/// flag indicating whether the control is currently visible
bool m_bControlIsVisible;
@@ -527,6 +480,8 @@ namespace sdr { namespace contact {
/// is the control currently in design mode?
mutable ViewControlMode m_eControlDesignMode;
+ ::basegfx::B2DHomMatrix m_aZoomLevelNormalization;
+
public:
ViewObjectContactOfUnoControl_Impl( ViewObjectContactOfUnoControl* _pAntiImpl );
@@ -549,17 +504,13 @@ namespace sdr { namespace contact {
*/
bool getUnoObject( SdrUnoObj*& _out_rpObject ) const;
- /** ensures that we have an XControl which can be painted onto the given display
- */
- bool ensureControl( const DisplayInfo& _rDisplayInfo );
-
/** ensures that we have an ->XControl
Must only be called if a control is needed when no DisplayInfo is present, yet.
- For creating a control, an ->OutputDevice is needed, and an ->SdrPageView. Both can only be
- obtained from a ->DisplayInfo struct, or alternatively a ->ObjectContactOfPageView. So, if
- our (anti-impl's) object contact is not a ->ObjectContactOfPageView, this method fill fail.
+ For creating a control, an ->OutputDevice is needed, and an ->SdrPageView. Both will be obtained
+ from a ->ObjectContactOfPageView. So, if our (anti-impl's) object contact is not a ->ObjectContactOfPageView,
+ this method fill fail.
Failure of this method will be reported via an assertion in a non-product version.
*/
@@ -572,22 +523,16 @@ namespace sdr { namespace contact {
inline const ControlHolder&
getExistentControl() const { return m_aControl; }
- /** positions our XControl according to the geometry settings in the SdrUnoObj,
- and sets proper zoom settings according to our device
+ inline bool
+ hasControl() const { return m_aControl.is(); }
+
+ /** positions our XControl according to the geometry settings in the SdrUnoObj, modified by the given
+ transformation, and sets proper zoom settings according to our device
@precond
->m_pOutputDeviceForWindow and ->m_aControl are not <NULL/>
- @tolerant
- If the preconditions are not met, nothing is done at all
*/
- void positionAndZoomControl() const;
-
- /** positions the control for a paint onto a given device
-
- If we do not (yet) have a control, or the control does not belong to the
- device for which a paint is requested, no positioning happens.
- */
- void positionControlForPaint( const DisplayInfo& _rDisplayInfo ) const;
+ void positionAndZoomControl( const basegfx::B2DHomMatrix& _rViewTransformation ) const;
/** determines whether or not our control is printable
@@ -626,6 +571,13 @@ namespace sdr { namespace contact {
struct GuardAccess { friend class VOCGuard; private: GuardAccess() { } };
::osl::Mutex& getMutex( GuardAccess ) const { return m_aMutex; }
+ const ViewContactOfUnoControl&
+ getViewContact() const
+ {
+ ENSURE_OR_THROW( !impl_isDisposed_nofail(), "already disposed" );
+ return static_cast< const ViewContactOfUnoControl& >( m_pAntiImpl->GetViewContact() );
+ }
+
protected:
~ViewObjectContactOfUnoControl_Impl();
@@ -797,10 +749,11 @@ namespace sdr { namespace contact {
This method cares for this, by retrieving the very original OutputDevice.
*/
- const OutputDevice& imp_getPageViewDevice_nothrow( const ObjectContactOfPageView& _rObjectContact ) const;
+ static const OutputDevice& imp_getPageViewDevice_nothrow( const ObjectContactOfPageView& _rObjectContact );
+ const OutputDevice& imp_getPageViewDevice_nothrow() const;
private:
- ViewObjectContactOfUnoControl_Impl(); // never implemented
+ ViewObjectContactOfUnoControl_Impl(); // never implemented
ViewObjectContactOfUnoControl_Impl( const ViewObjectContactOfUnoControl_Impl& ); // never implemented
ViewObjectContactOfUnoControl_Impl& operator=( const ViewObjectContactOfUnoControl_Impl& ); // never implemented
};
@@ -812,18 +765,65 @@ namespace sdr { namespace contact {
*/
class VOCGuard
{
- const ViewObjectContactOfUnoControl_Impl& m_rImpl;
- ::osl::MutexGuard m_aMutexGuard;
+ private:
+ ::osl::MutexGuard m_aMutexGuard;
public:
VOCGuard( const ViewObjectContactOfUnoControl_Impl& _rImpl )
- :m_rImpl( _rImpl )
- ,m_aMutexGuard( _rImpl.getMutex( ViewObjectContactOfUnoControl_Impl::GuardAccess() ) )
+ :m_aMutexGuard( _rImpl.getMutex( ViewObjectContactOfUnoControl_Impl::GuardAccess() ) )
{
}
};
//====================================================================
+ //= LazyControlCreationPrimitive2D
+ //====================================================================
+ class LazyControlCreationPrimitive2D : public ::drawinglayer::primitive2d::BasePrimitive2D
+ {
+ private:
+ typedef ::drawinglayer::primitive2d::BasePrimitive2D BasePrimitive2D;
+
+ protected:
+ virtual ::drawinglayer::primitive2d::Primitive2DSequence
+ get2DDecomposition(
+ const ::drawinglayer::geometry::ViewInformation2D& rViewInformation
+ ) const;
+
+ virtual ::drawinglayer::primitive2d::Primitive2DSequence
+ createLocalDecomposition(
+ const ::drawinglayer::geometry::ViewInformation2D& rViewInformation
+ ) const;
+
+ virtual ::basegfx::B2DRange
+ getB2DRange(
+ const ::drawinglayer::geometry::ViewInformation2D& rViewInformation
+ ) const;
+
+ public:
+ LazyControlCreationPrimitive2D( const ::rtl::Reference< ViewObjectContactOfUnoControl_Impl >& _pVOCImpl )
+ :m_pVOCImpl( _pVOCImpl )
+ {
+ ENSURE_OR_THROW( m_pVOCImpl.is(), "Illegal argument." );
+ getTransformation( m_pVOCImpl->getViewContact(), m_aTransformation );
+ }
+
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ // declare unique ID for this primitive class
+ DeclPrimitrive2DIDBlock()
+
+ static void getTransformation( const ViewContactOfUnoControl& _rVOC, ::basegfx::B2DHomMatrix& _out_Transformation );
+
+ private:
+ ::rtl::Reference< ViewObjectContactOfUnoControl_Impl > m_pVOCImpl;
+ /** The geometry is part of the identity of an primitive, so we cannot calculate it on demand
+ (since the data the calculation is based on might have changed then), but need to calc
+ it at construction time, and remember it.
+ */
+ ::basegfx::B2DHomMatrix m_aTransformation;
+ };
+
+ //====================================================================
//= ViewObjectContactOfUnoControl_Impl
//====================================================================
DBG_NAME( ViewObjectContactOfUnoControl_Impl )
@@ -834,10 +834,20 @@ namespace sdr { namespace contact {
,m_bControlIsVisible( false )
,m_bIsDesignModeListening( false )
,m_eControlDesignMode( eUnknown )
+ ,m_aZoomLevelNormalization()
{
DBG_CTOR( ViewObjectContactOfUnoControl_Impl, NULL );
DBG_ASSERT( m_pAntiImpl, "ViewObjectContactOfUnoControl_Impl::ViewObjectContactOfUnoControl_Impl: invalid AntiImpl!" );
- }
+
+ const OutputDevice& rPageViewDevice( imp_getPageViewDevice_nothrow() );
+ m_aZoomLevelNormalization = rPageViewDevice.GetInverseViewTransformation();
+
+ ::basegfx::B2DHomMatrix aScaleNormalization;
+ MapMode aCurrentDeviceMapMode( rPageViewDevice.GetMapMode() );
+ aScaleNormalization.set( 0, 0, (double)aCurrentDeviceMapMode.GetScaleX() );
+ aScaleNormalization.set( 1, 1, (double)aCurrentDeviceMapMode.GetScaleY() );
+ m_aZoomLevelNormalization *= aScaleNormalization;
+ }
//--------------------------------------------------------------------
ViewObjectContactOfUnoControl_Impl::~ViewObjectContactOfUnoControl_Impl()
@@ -898,27 +908,21 @@ namespace sdr { namespace contact {
}
//--------------------------------------------------------------------
- void ViewObjectContactOfUnoControl_Impl::positionControlForPaint( const DisplayInfo& /* #i74769# _rDisplayInfo*/ ) const
- {
- if ( !m_aControl.is() )
- return;
-
- positionAndZoomControl();
- }
-
- //--------------------------------------------------------------------
- void ViewObjectContactOfUnoControl_Impl::positionAndZoomControl() const
+ void ViewObjectContactOfUnoControl_Impl::positionAndZoomControl( const basegfx::B2DHomMatrix& _rViewTransformation ) const
{
- OSL_PRECOND( m_pOutputDeviceForWindow && m_aControl.is(), "ViewObjectContactOfUnoControl_Impl::positionAndZoomControl: no output device or no control!" );
- if ( !m_pOutputDeviceForWindow || !m_aControl.is() )
+ OSL_PRECOND( ( m_pOutputDeviceForWindow != NULL ) && m_aControl.is(), "ViewObjectContactOfUnoControl_Impl::positionAndZoomControl: no output device or no control!" );
+ if ( ( m_pOutputDeviceForWindow == NULL ) || !m_aControl.is() )
return;
try
{
SdrUnoObj* pUnoObject( NULL );
if ( getUnoObject( pUnoObject ) )
- UnoControlContactHelper::positionControl_throw( m_aControl, pUnoObject->GetLogicRect(), m_pOutputDeviceForWindow );
- UnoControlContactHelper::setControlZoom( m_aControl, m_pOutputDeviceForWindow );
+ {
+ UnoControlContactHelper::adjustControlGeometry_throw( m_aControl, pUnoObject->GetLogicRect(), _rViewTransformation, m_aZoomLevelNormalization );
+ }
+ else
+ OSL_ENSURE( false, "ViewObjectContactOfUnoControl_Impl::positionAndZoomControl: no SdrUnoObj!" );
}
catch( const Exception& )
{
@@ -927,37 +931,6 @@ namespace sdr { namespace contact {
}
//--------------------------------------------------------------------
- bool ViewObjectContactOfUnoControl_Impl::ensureControl( const DisplayInfo& /*_rDisplayInfo*/ )
- {
- OSL_PRECOND( !impl_isDisposed_nofail(), "ViewObjectContactOfUnoControl_Impl::ensureControl: already disposed()" );
- if ( impl_isDisposed_nofail() )
- return false;
-
- const OutputDevice* pDeviceForControl( NULL );
-
- // if we're working for a page view, use the respective OutputDevice at the proper
- // PaintWindow. The DisplayInfo might only contain a temporary (virtual) device, which
- // is dangerous to remember
- // 2006-10-24 / #i70604# / frank.schoenheit@sun.com
- ObjectContactOfPageView* pPageViewContact = dynamic_cast< ObjectContactOfPageView* >( &m_pAntiImpl->GetObjectContact() );
- if ( pPageViewContact )
- pDeviceForControl = &imp_getPageViewDevice_nothrow( *pPageViewContact );
-
- if ( !pDeviceForControl && pPageViewContact)
- pDeviceForControl = pPageViewContact->TryToGetOutputDevice();
-
- DBG_ASSERT( pDeviceForControl, "ViewObjectContactOfUnoControl_Impl::ensureControl: no output device!" );
- if ( !pDeviceForControl )
- return false;
-
- SdrPageView* pPageView = m_pAntiImpl->GetObjectContact().TryToGetSdrPageView();
-
- ::std::auto_ptr< IPageViewAccess > pPVAccess;
- pPVAccess.reset( pPageView ? (IPageViewAccess*)new SdrPageViewAccess( *pPageView ) : (IPageViewAccess*)new DummyPageViewAccess() );
- return impl_ensureControl_nothrow( *pPVAccess, *pDeviceForControl );
- }
-
- //--------------------------------------------------------------------
bool ViewObjectContactOfUnoControl_Impl::ensureControl()
{
OSL_PRECOND( !impl_isDisposed_nofail(), "ViewObjectContactOfUnoControl_Impl::ensureControl: already disposed()" );
@@ -977,13 +950,21 @@ namespace sdr { namespace contact {
}
//--------------------------------------------------------------------
- const OutputDevice& ViewObjectContactOfUnoControl_Impl::imp_getPageViewDevice_nothrow( const ObjectContactOfPageView& _rObjectContact ) const
+ const OutputDevice& ViewObjectContactOfUnoControl_Impl::imp_getPageViewDevice_nothrow() const
+ {
+ ObjectContactOfPageView* pPageViewContact = dynamic_cast< ObjectContactOfPageView* >( &m_pAntiImpl->GetObjectContact() );
+ ENSURE_OR_THROW( pPageViewContact, "need a ObjectContactOfPageView." );
+ return imp_getPageViewDevice_nothrow( *pPageViewContact );
+ }
+
+ //--------------------------------------------------------------------
+ const OutputDevice& ViewObjectContactOfUnoControl_Impl::imp_getPageViewDevice_nothrow( const ObjectContactOfPageView& _rObjectContact )
{
// if the PageWindow has a patched PaintWindow, use the original PaintWindow
// this ensures that our control is _not_ re-created just because somebody
// (temporarily) changed the window to paint onto.
// #i72429# / 2007-02-20 / frank.schoenheit@sun.com
- const SdrPageWindow& rPageWindow( _rObjectContact.GetPageWindow() );
+ SdrPageWindow& rPageWindow( _rObjectContact.GetPageWindow() );
if ( rPageWindow.GetOriginalPaintWindow() )
return rPageWindow.GetOriginalPaintWindow()->GetOutputDevice();
@@ -1001,7 +982,7 @@ namespace sdr { namespace contact {
// Somebody requested a control for a new device, which means either of
// - our PageView's paint window changed since we were last here
// - we don't belong to a page view, and are simply painted onto different devices
- // The first sounds strange (doens't it?), the second means we could perhaps
+ // The first sounds strange (doens't it?), the second means we could perhaps
// optimize this in the future - there is no need to re-create the control every time,
// is it?
// #i74523# / 2007-02-15 / frank.schoenheit@sun.com
@@ -1063,44 +1044,37 @@ namespace sdr { namespace contact {
bool bSuccess = false;
try
{
- do
- {
- const ::rtl::OUString sControlServiceName( _rUnoObject.GetUnoControlTypeName() );
+ const ::rtl::OUString sControlServiceName( _rUnoObject.GetUnoControlTypeName() );
- Reference< XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
- if ( xFactory.is() )
- {
- _out_rControl = Reference< XControl >( xFactory->createInstance( sControlServiceName ), UNO_QUERY );
- }
- DBG_ASSERT( _out_rControl.is(), "ViewObjectContactOfUnoControl_Impl::createControlForDevice: no control could be created!" );
- if ( !_out_rControl.is() )
- break;
+ Reference< XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory(), UNO_SET_THROW );
+ _out_rControl = Reference< XControl >( xFactory->createInstance( sControlServiceName ), UNO_QUERY_THROW );
- // knit the model and the control
- _out_rControl.setModel( xControlModel );
+ // knit the model and the control
+ _out_rControl.setModel( xControlModel );
- UnoControlContactHelper::positionControl_throw( _out_rControl, _rUnoObject.GetLogicRect(), &_rDevice );
-
- // proper zoom
- UnoControlContactHelper::setControlZoom( _out_rControl, &_rDevice );
+ // proper geometry
+ UnoControlContactHelper::adjustControlGeometry_throw(
+ _out_rControl,
+ _rUnoObject.GetLogicRect(),
+ _rDevice.GetViewTransformation(),
+ _rDevice.GetInverseViewTransformation()
+ );
- // #107049# set design mode before peer is created,
- // this is also needed for accessibility
- _out_rControl.setDesignMode( _rPageView.isDesignMode() );
+ // #107049# set design mode before peer is created,
+ // this is also needed for accessibility
+ _out_rControl.setDesignMode( _rPageView.isDesignMode() );
- // adjust the initial visibility according to the visibility of the layer
- // 2003-06-03 - #110592# - fs@openoffice.org
- impl_adjustControlVisibilityToLayerVisibility_throw( _out_rControl, _rUnoObject, _rPageView, false, true );
+ // adjust the initial visibility according to the visibility of the layer
+ // 2003-06-03 - #110592# - fs@openoffice.org
+ impl_adjustControlVisibilityToLayerVisibility_throw( _out_rControl, _rUnoObject, _rPageView, false, true );
- // add the control to the respective control container
- // #108327# do this last
- Reference< XControlContainer > xControlContainer( _rPageView.getControlContainer( _rDevice ) );
- if ( xControlContainer.is() )
- xControlContainer->addControl( sControlServiceName, _out_rControl.getControl() );
+ // add the control to the respective control container
+ // #108327# do this last
+ Reference< XControlContainer > xControlContainer( _rPageView.getControlContainer( _rDevice ) );
+ if ( xControlContainer.is() )
+ xControlContainer->addControl( sControlServiceName, _out_rControl.getControl() );
- bSuccess = true;
- }
- while ( false );
+ bSuccess = true;
}
catch( const Exception& )
{
@@ -1257,18 +1231,16 @@ namespace sdr { namespace contact {
//--------------------------------------------------------------------
bool ViewObjectContactOfUnoControl_Impl::isPrintableControl() const
{
- if ( !m_aControl.is() )
+ SdrUnoObj* pUnoObject( NULL );
+ if ( !getUnoObject( pUnoObject ) )
return false;
bool bIsPrintable = false;
try
{
- Reference< XPropertySet > xModelProperties( m_aControl.getModel(), UNO_QUERY );
- Reference< XPropertySetInfo > xPropertyInfo( xModelProperties.is() ? xModelProperties->getPropertySetInfo() : Reference< XPropertySetInfo >() );
- const ::rtl::OUString sPrintablePropertyName( RTL_CONSTASCII_USTRINGPARAM( "Printable" ) );
-
- if ( xPropertyInfo.is() && xPropertyInfo->hasPropertyByName( sPrintablePropertyName ) )
- OSL_VERIFY( xModelProperties->getPropertyValue( sPrintablePropertyName ) >>= bIsPrintable );
+ Reference< XPropertySet > xModelProperties( pUnoObject->GetUnoControlModel(), UNO_QUERY_THROW );
+ static const ::rtl::OUString s_sPrintablePropertyName( RTL_CONSTASCII_USTRINGPARAM( "Printable" ) );
+ OSL_VERIFY( xModelProperties->getPropertyValue( s_sPrintablePropertyName ) >>= bIsPrintable );
}
catch( const Exception& )
{
@@ -1411,15 +1383,20 @@ namespace sdr { namespace contact {
if ( !xNewControl.is() )
return;
+ ENSURE_OR_THROW( m_pOutputDeviceForWindow, "calling this without /me having an output device should be impossible." );
+
DBG_ASSERT( xNewControl->getModel() == m_aControl.getModel(), "ViewObjectContactOfUnoControl_Impl::elementReplaced: another model at the new control?" );
// another model should - in the drawing layer - also imply another SdrUnoObj, which
// should also result in new ViewContact, and thus in new ViewObjectContacts
impl_switchControlListening_nothrow( false );
+ ControlHolder aNewControl( xNewControl );
+ aNewControl.setZoom( m_aControl.getZoom() );
+ aNewControl.setPosSize( m_aControl.getPosSize() );
+ aNewControl.setDesignMode( impl_isControlDesignMode_nothrow() );
+
m_aControl = xNewControl;
- positionAndZoomControl();
- m_aControl.setDesignMode( impl_isControlDesignMode_nothrow() );
m_bControlIsVisible = m_aControl.isVisible();
impl_switchControlListening_nothrow( true );
@@ -1449,30 +1426,96 @@ namespace sdr { namespace contact {
}
}
+ //====================================================================
+ //= LazyControlCreationPrimitive2D
+ //====================================================================
//--------------------------------------------------------------------
- bool ViewObjectContactOfUnoControl_Impl::belongsToDevice( const OutputDevice* _pDevice ) const
+ bool LazyControlCreationPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
{
- DBG_ASSERT( _pDevice, "ViewObjectContactOfUnoControl_Impl::belongsToDevice: invalid device!" );
+ if ( !BasePrimitive2D::operator==( rPrimitive ) )
+ return false;
- OSL_PRECOND( !impl_isDisposed_nofail(), "ViewObjectContactOfUnoControl_Impl::belongsToDevice: already disposed!" );
- if ( impl_isDisposed_nofail() )
+ const LazyControlCreationPrimitive2D* pRHS = dynamic_cast< const LazyControlCreationPrimitive2D* >( &rPrimitive );
+ if ( !pRHS )
return false;
- if ( m_pOutputDeviceForWindow )
- {
- if ( _pDevice == m_pOutputDeviceForWindow )
- return true;
+ if ( m_pVOCImpl != pRHS->m_pVOCImpl )
return false;
- }
- ObjectContactOfPageView* pPageViewContact = dynamic_cast< ObjectContactOfPageView* >( &m_pAntiImpl->GetObjectContact() );
- if ( pPageViewContact )
- return ( _pDevice == &imp_getPageViewDevice_nothrow( *pPageViewContact ) );
+ if ( m_aTransformation != pRHS->m_aTransformation )
+ return false;
- DBG_ERROR( "ViewObjectContactOfUnoControl_Impl::belongsToDevice: could not determine the device I belong to!" );
- return false;
+ return true;
+ }
+
+ //--------------------------------------------------------------------
+ void LazyControlCreationPrimitive2D::getTransformation( const ViewContactOfUnoControl& _rVOC, ::basegfx::B2DHomMatrix& _out_Transformation )
+ {
+ // Do use model data directly to create the correct geometry. Do NOT
+ // use getBoundRect()/getSnapRect() here; tese will use the sequence of
+ // primitives themselves in the long run.
+ const Rectangle aSdrGeoData( _rVOC.GetSdrUnoObj().GetGeoRect() );
+ const basegfx::B2DRange aRange(
+ aSdrGeoData.Left(),
+ aSdrGeoData.Top(),
+ aSdrGeoData.Right(),
+ aSdrGeoData.Bottom()
+ );
+
+ _out_Transformation.identity();
+ _out_Transformation.set( 0, 0, aRange.getWidth() );
+ _out_Transformation.set( 1, 1, aRange.getHeight() );
+ _out_Transformation.set( 0, 2, aRange.getMinX() );
+ _out_Transformation.set( 1, 2, aRange.getMinY() );
}
+ //--------------------------------------------------------------------
+ ::basegfx::B2DRange LazyControlCreationPrimitive2D::getB2DRange( const ::drawinglayer::geometry::ViewInformation2D& /*rViewInformation*/ ) const
+ {
+ ::basegfx::B2DRange aRange( 0.0, 0.0, 1.0, 1.0 );
+ aRange.transform( m_aTransformation );
+ return aRange;
+ }
+
+ //--------------------------------------------------------------------
+ ::drawinglayer::primitive2d::Primitive2DSequence LazyControlCreationPrimitive2D::get2DDecomposition( const ::drawinglayer::geometry::ViewInformation2D& _rViewInformation ) const
+ {
+ if ( m_pVOCImpl->hasControl() )
+ m_pVOCImpl->positionAndZoomControl( _rViewInformation.getObjectToViewTransformation() );
+ return BasePrimitive2D::get2DDecomposition( _rViewInformation );
+ }
+
+ //--------------------------------------------------------------------
+ ::drawinglayer::primitive2d::Primitive2DSequence LazyControlCreationPrimitive2D::createLocalDecomposition( const ::drawinglayer::geometry::ViewInformation2D& _rViewInformation ) const
+ {
+ // force control here to make it a VCL ChildWindow. Will be fetched
+ // and used below by getExistentControl()
+ m_pVOCImpl->ensureControl();
+ m_pVOCImpl->positionAndZoomControl( _rViewInformation.getObjectToViewTransformation() );
+
+ // get needed data
+ const ViewContactOfUnoControl& rViewContactOfUnoControl( m_pVOCImpl->getViewContact() );
+ Reference< XControlModel > xControlModel( rViewContactOfUnoControl.GetSdrUnoObj().GetUnoControlModel() );
+ const ControlHolder& rControl( m_pVOCImpl->getExistentControl() );
+
+ // check if we already have an XControl.
+ if ( !xControlModel.is() || !rControl.is() )
+ // use the default mechanism. This will create a ControlPrimitive2D without
+ // handing over a XControl. If not even a XControlModel exists, it will
+ // create the SdrObject fallback visualisation
+ return rViewContactOfUnoControl.getViewIndependentPrimitive2DSequence();
+
+ // create a primitive and hand over the existing xControl. This will
+ // allow the primitive to not need to create another one on demand.
+ const drawinglayer::primitive2d::Primitive2DReference xRetval( new ::drawinglayer::primitive2d::ControlPrimitive2D(
+ m_aTransformation, xControlModel, rControl.getControl() ) );
+
+ return drawinglayer::primitive2d::Primitive2DSequence(&xRetval, 1);
+ }
+
+ //--------------------------------------------------------------------
+ ImplPrimitrive2DIDBlock( LazyControlCreationPrimitive2D, PRIMITIVE2D_ID_SDRCONTROLPRIMITIVE2D )
+
//====================================================================
//= ViewObjectContactOfUnoControl
//====================================================================
@@ -1522,20 +1565,6 @@ namespace sdr { namespace contact {
}
//--------------------------------------------------------------------
- void ViewObjectContactOfUnoControl::positionControlForPaint( const DisplayInfo& _rDisplayInfo ) const
- {
- VOCGuard aGuard( *m_pImpl );
-
- // ensure we have a control. If we don't, then the Drawing Layer might be tempted to
- // never draw the complete form layer.
- // #i75095# / 2007-03-05 / frank.schoenheit@sun.com
- m_pImpl->ensureControl( _rDisplayInfo );
-
- // position the control
- m_pImpl->positionControlForPaint( _rDisplayInfo );
- }
-
- //--------------------------------------------------------------------
void ViewObjectContactOfUnoControl::ensureControlVisibility( bool _bVisible ) const
{
VOCGuard aGuard( *m_pImpl );
@@ -1582,70 +1611,32 @@ namespace sdr { namespace contact {
}
//--------------------------------------------------------------------
- bool ViewObjectContactOfUnoControl::belongsToDevice( const OutputDevice* _pDevice ) const
+ drawinglayer::primitive2d::Primitive2DSequence ViewObjectContactOfUnoControl::createPrimitive2DSequence(const DisplayInfo& /*rDisplayInfo*/) const
{
- VOCGuard aGuard( *m_pImpl );
- return m_pImpl->belongsToDevice( _pDevice );
+ if ( m_pImpl->isDisposed() )
+ // 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();
+
+ ::drawinglayer::primitive2d::Primitive2DReference xPrimitive( new LazyControlCreationPrimitive2D( m_pImpl ) );
+ return ::drawinglayer::primitive2d::Primitive2DSequence( &xPrimitive, 1 );
}
//--------------------------------------------------------------------
- drawinglayer::primitive2d::Primitive2DSequence ViewObjectContactOfUnoControl::createPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const
- {
- // force control here to make it a VCL ChildWindow. Will be fetched
- // and used below by getExistentControl()
- m_pImpl->ensureControl();
- m_pImpl->positionControlForPaint(rDisplayInfo);
-
- // get needed data
- const ViewContactOfUnoControl& rViewContactOfUnoControl(static_cast< const ViewContactOfUnoControl& >(GetViewContact()));
- Reference< XControlModel > xControlModel(rViewContactOfUnoControl.GetSdrUnoObj().GetUnoControlModel());
- const ControlHolder& rControl(m_pImpl->getExistentControl());
-
- // check if we already have a XControl.
- if(xControlModel.is() && rControl.is())
- {
- // create a primitive and hand over the existing xControl. This will
- // allow the primitive to not need to create another one on demand.
- // Do use model data directly to create the correct geometry. Do NOT
- // use getBoundRect()/getSnapRect() here; tese will use the sequence of
- // primitives themselves in the long run.
- const Rectangle aUnoControlModelData(rViewContactOfUnoControl.GetSdrUnoObj().GetGeoRect());
- const basegfx::B2DRange aRange(aUnoControlModelData.Left(), aUnoControlModelData.Top(), aUnoControlModelData.Right(), aUnoControlModelData.Bottom());
-
- // create object transform
- basegfx::B2DHomMatrix aTransform;
- aTransform.set(0, 0, aRange.getWidth());
- aTransform.set(1, 1, aRange.getHeight());
- aTransform.set(0, 2, aRange.getMinX());
- aTransform.set(1, 2, aRange.getMinY());
-
- // create control primitive with existing XControl
- const drawinglayer::primitive2d::Primitive2DReference xRetval(new drawinglayer::primitive2d::ControlPrimitive2D(
- aTransform, xControlModel, rControl.getControl()));
-
- return drawinglayer::primitive2d::Primitive2DSequence(&xRetval, 1);
- }
- else
- {
- // use the default mechanism. This will create a ControlPrimitive2D without
- // handing over a XControl. If not even a XControlModel exists, it will
- // create the SdrObject fallback visualisation
- return rViewContactOfUnoControl.getViewIndependentPrimitive2DSequence();
- }
- }
-
void ViewObjectContactOfUnoControl::propertyChange()
{
// graphical invalidate at all views
ActionChanged();
// #i93318# flush Primitive2DSequence to force recreation with updated XControlModel
- // since e.g. background color has changed and existing decompositions are evtl. no
+ // since e.g. background color has changed and existing decompositions are possibly no
// longer valid. Unfortunately this is not detected from ControlPrimitive2D::operator==
// since it only has a uno reference to the XControlModel
flushPrimitive2DSequence();
}
+ //--------------------------------------------------------------------
void ViewObjectContactOfUnoControl::ActionChanged()
{
// call parent
@@ -1721,6 +1712,14 @@ namespace sdr { namespace contact {
DBG_DTOR( UnoControlPrintOrPreviewContact, NULL );
}
+ //--------------------------------------------------------------------
+ drawinglayer::primitive2d::Primitive2DSequence UnoControlPrintOrPreviewContact::createPrimitive2DSequence(const DisplayInfo& rDisplayInfo ) const
+ {
+ if ( !m_pImpl->isPrintableControl() )
+ return drawinglayer::primitive2d::Primitive2DSequence();
+ return ViewObjectContactOfUnoControl::createPrimitive2DSequence( rDisplayInfo );
+ }
+
//====================================================================
//= UnoControlPDFExportContact
//====================================================================
diff --git a/svx/source/sdr/overlay/makefile.mk b/svx/source/sdr/overlay/makefile.mk
index 1243a71e25..d202992c09 100644
--- a/svx/source/sdr/overlay/makefile.mk
+++ b/svx/source/sdr/overlay/makefile.mk
@@ -43,22 +43,21 @@ ENABLE_EXCEPTIONS=TRUE
SLOFILES=\
$(SLO)$/overlayanimatedbitmapex.obj \
- $(SLO)$/overlaybitmap.obj \
$(SLO)$/overlaybitmapex.obj \
+ $(SLO)$/overlaycrosshair.obj \
+ $(SLO)$/overlayhatchrect.obj \
+ $(SLO)$/overlayhelpline.obj \
$(SLO)$/overlayline.obj \
- $(SLO)$/overlaylinestriped.obj \
$(SLO)$/overlaymanager.obj \
$(SLO)$/overlaymanagerbuffered.obj \
$(SLO)$/overlayobject.obj \
+ $(SLO)$/overlayobjectcell.obj \
$(SLO)$/overlayobjectlist.obj \
- $(SLO)$/overlaytriangle.obj \
- $(SLO)$/overlaycrosshair.obj \
- $(SLO)$/overlayhelpline.obj \
- $(SLO)$/overlayhatchrect.obj \
- $(SLO)$/overlayrollingrectangle.obj \
$(SLO)$/overlaypolypolygon.obj \
- $(SLO)$/overlaysdrobject.obj \
$(SLO)$/overlayprimitive2dsequenceobject.obj \
- $(SLO)$/overlayobjectcell.obj
+ $(SLO)$/overlayrollingrectangle.obj \
+ $(SLO)$/overlayselection.obj \
+ $(SLO)$/overlaytools.obj \
+ $(SLO)$/overlaytriangle.obj
.INCLUDE : target.mk
diff --git a/svx/source/sdr/overlay/overlayanimatedbitmapex.cxx b/svx/source/sdr/overlay/overlayanimatedbitmapex.cxx
index 9fbecbc0fe..7ea78b6d4c 100644
--- a/svx/source/sdr/overlay/overlayanimatedbitmapex.cxx
+++ b/svx/source/sdr/overlay/overlayanimatedbitmapex.cxx
@@ -34,9 +34,8 @@
#include <vcl/salbtype.hxx>
#include <vcl/outdev.hxx>
#include <svx/sdr/overlay/overlaymanager.hxx>
-
-// #i77674#
#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <svx/sdr/overlay/overlaytools.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -57,43 +56,30 @@ namespace sdr
}
}
- void OverlayAnimatedBitmapEx::drawGeometry(OutputDevice& rOutputDevice)
- {
- // #i77674# calculate discrete top-left
- basegfx::B2DPoint aDiscreteTopLeft(rOutputDevice.GetViewTransformation() * getBasePosition());
- aDiscreteTopLeft -= (mbOverlayState)
- ? basegfx::B2DPoint((double)mnCenterX1, (double)mnCenterY1)
- : basegfx::B2DPoint((double)mnCenterX2, (double)mnCenterY2);
-
- // remember MapMode and switch to pixels
- const bool bMapModeWasEnabled(rOutputDevice.IsMapModeEnabled());
- rOutputDevice.EnableMapMode(false);
-
- // draw the bitmap
- const Point aPixelTopLeft((sal_Int32)floor(aDiscreteTopLeft.getX()), (sal_Int32)floor(aDiscreteTopLeft.getY()));
- rOutputDevice.DrawBitmapEx(aPixelTopLeft, (mbOverlayState) ? maBitmapEx1 : maBitmapEx2);
-
- // restore MapMode
- rOutputDevice.EnableMapMode(bMapModeWasEnabled);
- }
-
- void OverlayAnimatedBitmapEx::createBaseRange(OutputDevice& rOutputDevice)
+ drawinglayer::primitive2d::Primitive2DSequence OverlayAnimatedBitmapEx::createOverlayObjectPrimitive2DSequence()
{
- // #i77674# calculate discrete top-left
- basegfx::B2DPoint aDiscreteTopLeft(rOutputDevice.GetViewTransformation() * getBasePosition());
- aDiscreteTopLeft -= (mbOverlayState)
- ? basegfx::B2DPoint((double)mnCenterX1, (double)mnCenterY1)
- : basegfx::B2DPoint((double)mnCenterX2, (double)mnCenterY2);
-
- // calculate discrete range
- const Size aBitmapPixelSize((mbOverlayState) ? maBitmapEx1.GetSizePixel() : maBitmapEx2.GetSizePixel());
- const basegfx::B2DRange aDiscreteRange(
- aDiscreteTopLeft.getX(), aDiscreteTopLeft.getY(),
- aDiscreteTopLeft.getX() + (double)aBitmapPixelSize.getWidth(), aDiscreteTopLeft.getY() + (double)aBitmapPixelSize.getHeight());
-
- // set and go back to logic range
- maBaseRange = aDiscreteRange;
- maBaseRange.transform(rOutputDevice.GetInverseViewTransformation());
+ if(mbOverlayState)
+ {
+ const drawinglayer::primitive2d::Primitive2DReference aPrimitive(
+ new drawinglayer::primitive2d::OverlayBitmapExPrimitive(
+ getBitmapEx1(),
+ getBasePosition(),
+ getCenterX1(),
+ getCenterY1()));
+
+ return drawinglayer::primitive2d::Primitive2DSequence(&aPrimitive, 1);
+ }
+ else
+ {
+ const drawinglayer::primitive2d::Primitive2DReference aPrimitive(
+ new drawinglayer::primitive2d::OverlayBitmapExPrimitive(
+ getBitmapEx2(),
+ getBasePosition(),
+ getCenterX2(),
+ getCenterY2()));
+
+ return drawinglayer::primitive2d::Primitive2DSequence(&aPrimitive, 1);
+ }
}
OverlayAnimatedBitmapEx::OverlayAnimatedBitmapEx(
@@ -111,10 +97,10 @@ namespace sdr
mnCenterX1(nCenX1), mnCenterY1(nCenY1),
mnCenterX2(nCenX2), mnCenterY2(nCenY2),
mnBlinkTime(nBlinkTime),
- mbOverlayState(sal_False)
+ mbOverlayState(false)
{
// set AllowsAnimation flag to mark this object as animation capable
- mbAllowsAnimation = sal_True;
+ mbAllowsAnimation = true;
// #i53216# check blink time value range
impCheckBlinkTimeValueRange();
@@ -213,11 +199,11 @@ namespace sdr
// switch state
if(mbOverlayState)
{
- mbOverlayState = sal_False;
+ mbOverlayState = false;
}
else
{
- mbOverlayState = sal_True;
+ mbOverlayState = true;
}
// re-insert me as event
@@ -227,12 +213,6 @@ namespace sdr
objectChange();
}
}
-
- void OverlayAnimatedBitmapEx::zoomHasChanged()
- {
- // reset validity of range in logical coor to force recalculation
- mbIsChanged = sal_True;
- }
} // end of namespace overlay
} // end of namespace sdr
diff --git a/svx/source/sdr/overlay/overlaybitmap.cxx b/svx/source/sdr/overlay/overlaybitmap.cxx
deleted file mode 100644
index be40a026ac..0000000000
--- a/svx/source/sdr/overlay/overlaybitmap.cxx
+++ /dev/null
@@ -1,162 +0,0 @@
-/*************************************************************************
- *
- * 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: overlaybitmap.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.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-#include <svx/sdr/overlay/overlaybitmap.hxx>
-#include <vcl/salbtype.hxx>
-#include <vcl/outdev.hxx>
-#include <vcl/bitmapex.hxx>
-
-// #i77674#
-#include <basegfx/matrix/b2dhommatrix.hxx>
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace sdr
-{
- namespace overlay
- {
- void OverlayBitmap::drawGeometry(OutputDevice& rOutputDevice)
- {
- // #i77674# calculate discrete top-left
- basegfx::B2DPoint aDiscreteTopLeft(rOutputDevice.GetViewTransformation() * getBasePosition());
- aDiscreteTopLeft -= basegfx::B2DPoint((double)mnCenterX, (double)mnCenterY);
-
- // remember MapMode and switch to pixels
- const bool bMapModeWasEnabled(rOutputDevice.IsMapModeEnabled());
- rOutputDevice.EnableMapMode(false);
-
- // draw the bitmap
- const Point aPixelTopLeft((sal_Int32)floor(aDiscreteTopLeft.getX()), (sal_Int32)floor(aDiscreteTopLeft.getY()));
-
- if(mbUseTransparenceColor)
- {
- BitmapEx aBitmapEx(maBitmap, getBaseColor());
- rOutputDevice.DrawBitmapEx(aPixelTopLeft, aBitmapEx);
- }
- else
- {
- rOutputDevice.DrawBitmap(aPixelTopLeft, maBitmap);
- }
-
- // restore MapMode
- rOutputDevice.EnableMapMode(bMapModeWasEnabled);
- }
-
- void OverlayBitmap::createBaseRange(OutputDevice& rOutputDevice)
- {
- // #i77674# calculate discrete top-left
- basegfx::B2DPoint aDiscreteTopLeft(rOutputDevice.GetViewTransformation() * getBasePosition());
- aDiscreteTopLeft -= basegfx::B2DPoint((double)mnCenterX, (double)mnCenterY);
-
- // calculate discrete range
- const Size aBitmapPixelSize(maBitmap.GetSizePixel());
- const basegfx::B2DRange aDiscreteRange(
- aDiscreteTopLeft.getX(), aDiscreteTopLeft.getY(),
- aDiscreteTopLeft.getX() + (double)aBitmapPixelSize.getWidth(), aDiscreteTopLeft.getY() + (double)aBitmapPixelSize.getHeight());
-
- // set and go back to logic range
- maBaseRange = aDiscreteRange;
- maBaseRange.transform(rOutputDevice.GetInverseViewTransformation());
- }
-
- OverlayBitmap::OverlayBitmap(
- const basegfx::B2DPoint& rBasePos,
- const Bitmap& rBitmap,
- sal_uInt16 nCenX, sal_uInt16 nCenY,
- sal_Bool bUseTransCol,
- Color aTransColor)
- : OverlayObjectWithBasePosition(rBasePos, aTransColor),
- maBitmap(rBitmap),
- mnCenterX(nCenX),
- mnCenterY(nCenY),
- mbUseTransparenceColor(bUseTransCol)
- {
- }
-
- OverlayBitmap::~OverlayBitmap()
- {
- }
-
- void OverlayBitmap::setBitmap(const Bitmap& rNew)
- {
- if(rNew != maBitmap)
- {
- // remember new Bitmap
- maBitmap = rNew;
-
- // register change (after change)
- objectChange();
- }
- }
-
- void OverlayBitmap::setTransparenceUsed(sal_Bool bNew)
- {
- if(bNew != mbUseTransparenceColor)
- {
- // remember new value
- mbUseTransparenceColor = bNew;
-
- // register change (after change)
- objectChange();
- }
- }
-
- void OverlayBitmap::setCenterXY(sal_uInt16 nNewX, sal_uInt16 nNewY)
- {
- if(nNewX != mnCenterX || nNewY != mnCenterY)
- {
- // remember new values
- if(nNewX != mnCenterX)
- {
- mnCenterX = nNewX;
- }
-
- if(nNewY != mnCenterY)
- {
- mnCenterY = nNewY;
- }
-
- // register change (after change)
- objectChange();
- }
- }
-
- void OverlayBitmap::zoomHasChanged()
- {
- // reset validity of range in logical coor to force recalculation
- mbIsChanged = sal_True;
- }
- } // end of namespace overlay
-} // end of namespace sdr
-
-//////////////////////////////////////////////////////////////////////////////
-// eof
diff --git a/svx/source/sdr/overlay/overlaybitmapex.cxx b/svx/source/sdr/overlay/overlaybitmapex.cxx
index c1f5e2269a..bf3a020398 100644
--- a/svx/source/sdr/overlay/overlaybitmapex.cxx
+++ b/svx/source/sdr/overlay/overlaybitmapex.cxx
@@ -33,9 +33,8 @@
#include <svx/sdr/overlay/overlaybitmapex.hxx>
#include <vcl/salbtype.hxx>
#include <vcl/outdev.hxx>
-
-// #i77674#
#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <svx/sdr/overlay/overlaytools.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -43,39 +42,16 @@ namespace sdr
{
namespace overlay
{
- void OverlayBitmapEx::drawGeometry(OutputDevice& rOutputDevice)
- {
- // #i77674# calculate discrete top-left
- basegfx::B2DPoint aDiscreteTopLeft(rOutputDevice.GetViewTransformation() * getBasePosition());
- aDiscreteTopLeft -= basegfx::B2DPoint((double)mnCenterX, (double)mnCenterY);
-
- // remember MapMode and switch to pixels
- const bool bMapModeWasEnabled(rOutputDevice.IsMapModeEnabled());
- rOutputDevice.EnableMapMode(false);
-
- // draw the bitmap
- const Point aPixelTopLeft((sal_Int32)floor(aDiscreteTopLeft.getX()), (sal_Int32)floor(aDiscreteTopLeft.getY()));
- rOutputDevice.DrawBitmapEx(aPixelTopLeft, maBitmapEx);
-
- // restore MapMode
- rOutputDevice.EnableMapMode(bMapModeWasEnabled);
- }
-
- void OverlayBitmapEx::createBaseRange(OutputDevice& rOutputDevice)
+ drawinglayer::primitive2d::Primitive2DSequence OverlayBitmapEx::createOverlayObjectPrimitive2DSequence()
{
- // #i77674# calculate discrete top-left
- basegfx::B2DPoint aDiscreteTopLeft(rOutputDevice.GetViewTransformation() * getBasePosition());
- aDiscreteTopLeft -= basegfx::B2DPoint((double)mnCenterX, (double)mnCenterY);
-
- // calculate discrete range
- const Size aBitmapPixelSize(maBitmapEx.GetSizePixel());
- const basegfx::B2DRange aDiscreteRange(
- aDiscreteTopLeft.getX(), aDiscreteTopLeft.getY(),
- aDiscreteTopLeft.getX() + (double)aBitmapPixelSize.getWidth(), aDiscreteTopLeft.getY() + (double)aBitmapPixelSize.getHeight());
-
- // set and go back to logic range
- maBaseRange = aDiscreteRange;
- maBaseRange.transform(rOutputDevice.GetInverseViewTransformation());
+ const drawinglayer::primitive2d::Primitive2DReference aReference(
+ new drawinglayer::primitive2d::OverlayBitmapExPrimitive(
+ getBitmapEx(),
+ getBasePosition(),
+ getCenterX(),
+ getCenterY()));
+
+ return drawinglayer::primitive2d::Primitive2DSequence(&aReference, 1);
}
OverlayBitmapEx::OverlayBitmapEx(
@@ -124,12 +100,6 @@ namespace sdr
objectChange();
}
}
-
- void OverlayBitmapEx::zoomHasChanged()
- {
- // reset validity of range in logical coor to force recalculation
- mbIsChanged = sal_True;
- }
} // end of namespace overlay
} // end of namespace sdr
diff --git a/svx/source/sdr/overlay/overlaycrosshair.cxx b/svx/source/sdr/overlay/overlaycrosshair.cxx
index f755c70af1..9204c0e87b 100644
--- a/svx/source/sdr/overlay/overlaycrosshair.cxx
+++ b/svx/source/sdr/overlay/overlaycrosshair.cxx
@@ -34,6 +34,8 @@
#include <tools/gen.hxx>
#include <vcl/salbtype.hxx>
#include <vcl/outdev.hxx>
+#include <svx/sdr/overlay/overlaytools.hxx>
+#include <svx/sdr/overlay/overlaymanager.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -41,31 +43,33 @@ namespace sdr
{
namespace overlay
{
- void OverlayCrosshairStriped::drawGeometry(OutputDevice& rOutputDevice)
+ drawinglayer::primitive2d::Primitive2DSequence OverlayCrosshairStriped::createOverlayObjectPrimitive2DSequence()
{
- const Point aEmptyPoint;
- const Rectangle aVisiblePixel(aEmptyPoint, rOutputDevice.GetOutputSizePixel());
- const Rectangle aVisibleLogic(rOutputDevice.PixelToLogic(aVisiblePixel));
+ drawinglayer::primitive2d::Primitive2DSequence aRetval;
- const basegfx::B2DPoint aStartA(aVisibleLogic.Left(), getBasePosition().getY());
- const basegfx::B2DPoint aEndA(aVisibleLogic.Right(), getBasePosition().getY());
- ImpDrawLineStriped(rOutputDevice, aStartA, aEndA);
+ if(getOverlayManager())
+ {
+ const basegfx::BColor aRGBColorA(getOverlayManager()->getStripeColorA().getBColor());
+ const basegfx::BColor aRGBColorB(getOverlayManager()->getStripeColorB().getBColor());
+ const double fStripeLengthPixel(getOverlayManager()->getStripeLengthPixel());
+
+ const drawinglayer::primitive2d::Primitive2DReference aReference(
+ new drawinglayer::primitive2d::OverlayCrosshairPrimitive(
+ getBasePosition(),
+ aRGBColorA,
+ aRGBColorB,
+ fStripeLengthPixel));
+
+ aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aReference, 1);
+ }
- const basegfx::B2DPoint aStartB(getBasePosition().getX(), aVisibleLogic.Top());
- const basegfx::B2DPoint aEndB(getBasePosition().getX(), aVisibleLogic.Bottom());
- ImpDrawLineStriped(rOutputDevice, aStartB, aEndB);
+ return aRetval;
}
- void OverlayCrosshairStriped::createBaseRange(OutputDevice& rOutputDevice)
+ void OverlayCrosshairStriped::stripeDefinitionHasChanged()
{
- // reset range and expand it
- const Point aEmptyPoint;
- const Rectangle aVisiblePixel(aEmptyPoint, rOutputDevice.GetOutputSizePixel());
- const Rectangle aVisibleLogic(rOutputDevice.PixelToLogic(aVisiblePixel));
-
- maBaseRange.reset();
- maBaseRange.expand(basegfx::B2DPoint(aVisibleLogic.Left(), aVisibleLogic.Top()));
- maBaseRange.expand(basegfx::B2DPoint(aVisibleLogic.Right(), aVisibleLogic.Bottom()));
+ // react on OverlayManager's stripe definition change
+ objectChange();
}
OverlayCrosshairStriped::OverlayCrosshairStriped(const basegfx::B2DPoint& rBasePos)
@@ -76,64 +80,6 @@ namespace sdr
OverlayCrosshairStriped::~OverlayCrosshairStriped()
{
}
-
- sal_Bool OverlayCrosshairStriped::isHit(const basegfx::B2DPoint& rPos, double fTol) const
- {
- if(isHittable())
- {
- // test vertical
- if(rPos.getY() >= (getBasePosition().getY() - fTol)
- && rPos.getY() <= (getBasePosition().getY() + fTol))
- {
- return sal_True;
- }
-
- // test horizontal
- if(rPos.getX() >= (getBasePosition().getX() - fTol)
- && rPos.getX() <= (getBasePosition().getX() + fTol))
- {
- return sal_True;
- }
- }
-
- return sal_False;
- }
- } // end of namespace overlay
-} // end of namespace sdr
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace sdr
-{
- namespace overlay
- {
- void OverlayCrosshair::drawGeometry(OutputDevice& rOutputDevice)
- {
- const Point aBasePos(FRound(getBasePosition().getX()), FRound(getBasePosition().getY()));
- const Point aEmptyPoint;
- const Rectangle aVisiblePixel(aEmptyPoint, rOutputDevice.GetOutputSizePixel());
- const Rectangle aVisibleLogic(rOutputDevice.PixelToLogic(aVisiblePixel));
-
- rOutputDevice.SetLineColor(getBaseColor());
- rOutputDevice.SetFillColor();
-
- rOutputDevice.DrawLine(Point(aVisibleLogic.Left(), aBasePos.Y()), Point(aVisibleLogic.Right(), aBasePos.Y()));
- rOutputDevice.DrawLine(Point(aBasePos.X(), aVisibleLogic.Top()), Point(aBasePos.X(), aVisibleLogic.Bottom()));
- }
-
- OverlayCrosshair::OverlayCrosshair(
- const basegfx::B2DPoint& rBasePos,
- Color aLineColor)
- : OverlayCrosshairStriped(rBasePos)
- {
- // set base color here, OverlayCrosshairStriped constructor has set
- // it to it's own default.
- maBaseColor = aLineColor;
- }
-
- OverlayCrosshair::~OverlayCrosshair()
- {
- }
} // end of namespace overlay
} // end of namespace sdr
diff --git a/svx/source/sdr/overlay/overlayhatchrect.cxx b/svx/source/sdr/overlay/overlayhatchrect.cxx
index a1c6f35cd4..284aa204af 100644
--- a/svx/source/sdr/overlay/overlayhatchrect.cxx
+++ b/svx/source/sdr/overlay/overlayhatchrect.cxx
@@ -38,6 +38,7 @@
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/numeric/ftools.hxx>
+#include <svx/sdr/overlay/overlaytools.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -45,81 +46,34 @@ namespace sdr
{
namespace overlay
{
- basegfx::B2DPolyPolygon OverlayHatchRect::getGeometry(OutputDevice& rOutputDevice)
+ drawinglayer::primitive2d::Primitive2DSequence OverlayHatchRect::createOverlayObjectPrimitive2DSequence()
{
- const basegfx::B2DPoint aDiscreteTopLeft(rOutputDevice.GetViewTransformation() * getBasePosition());
- const basegfx::B2DPoint aDiscreteBottomRight(rOutputDevice.GetViewTransformation() * getSecondPosition());
-
- basegfx::B2DRange aInnerRange(
- floor(aDiscreteTopLeft.getX()), floor(aDiscreteTopLeft.getY()),
- floor(aDiscreteBottomRight.getX()), floor(aDiscreteBottomRight.getY()));
- basegfx::B2DRange aOuterRange(aInnerRange);
- basegfx::B2DPolyPolygon aRetval;
-
- aOuterRange.grow(getDiscreteWidth() * 0.5);
- aInnerRange.grow(getDiscreteWidth() * -0.5);
-
- aRetval.append(basegfx::tools::createPolygonFromRect(aOuterRange));
- aRetval.append(basegfx::tools::createPolygonFromRect(aInnerRange));
-
- if(!basegfx::fTools::equalZero(mfRotation))
- {
- basegfx::B2DHomMatrix aTransform;
-
- aTransform.translate(-aOuterRange.getMinX(), -aOuterRange.getMinY());
- aTransform.rotate(getRotation());
- aTransform.translate(aOuterRange.getMinX(), aOuterRange.getMinY());
-
- aRetval.transform(aTransform);
- }
-
- return aRetval;
- }
-
- void OverlayHatchRect::drawGeometry(OutputDevice& rOutputDevice)
- {
- const basegfx::B2DPolyPolygon aB2DGeometry(getGeometry(rOutputDevice));
- const bool bMapModeWasEnabled(rOutputDevice.IsMapModeEnabled());
-
- // use VCL polygon and methodology for paint
- double fFullRotation(getHatchRotation() - getRotation());
-
- while(fFullRotation < 0.0)
- {
- fFullRotation += F_2PI;
- }
-
- while(fFullRotation >= F_2PI)
- {
- fFullRotation -= F_2PI;
- }
-
- const Hatch aHatch(HATCH_SINGLE, getBaseColor(), 3, (sal_uInt16)basegfx::fround(fFullRotation * ( 10.0 / F_PI180)));
- rOutputDevice.EnableMapMode(false);
- rOutputDevice.DrawHatch(PolyPolygon(aB2DGeometry), aHatch);
- rOutputDevice.EnableMapMode(bMapModeWasEnabled);
- }
-
- void OverlayHatchRect::createBaseRange(OutputDevice& rOutputDevice)
- {
- // reset range and expand with fresh geometry
- maBaseRange = getGeometry(rOutputDevice).getB2DRange();
-
- // getGeometry data is in discrete coordinates (pixels), so transform back to
- // world coordinates (logic)
- maBaseRange.transform(rOutputDevice.GetInverseViewTransformation());
+ const basegfx::B2DRange aHatchRange(getBasePosition(), getSecondPosition());
+ const drawinglayer::primitive2d::Primitive2DReference aReference(
+ new drawinglayer::primitive2d::OverlayHatchRectanglePrimitive(
+ aHatchRange,
+ 3.0,
+ getHatchRotation(),
+ getBaseColor().getBColor(),
+ getDiscreteGrow(),
+ getDiscreteShrink(),
+ getRotation()));
+
+ return drawinglayer::primitive2d::Primitive2DSequence(&aReference, 1);
}
OverlayHatchRect::OverlayHatchRect(
const basegfx::B2DPoint& rBasePosition,
const basegfx::B2DPoint& rSecondPosition,
const Color& rHatchColor,
- double fDiscreteWidth,
+ double fDiscreteGrow,
+ double fDiscreteShrink,
double fHatchRotation,
double fRotation)
: OverlayObjectWithBasePosition(rBasePosition, rHatchColor),
maSecondPosition(rSecondPosition),
- mfDiscreteWidth(fDiscreteWidth),
+ mfDiscreteGrow(fDiscreteGrow),
+ mfDiscreteShrink(fDiscreteShrink),
mfHatchRotation(fHatchRotation),
mfRotation(fRotation)
{
@@ -136,12 +90,6 @@ namespace sdr
objectChange();
}
}
-
- void OverlayHatchRect::zoomHasChanged()
- {
- // reset validity of range in logical coor to force recalculation
- mbIsChanged = sal_True;
- }
} // end of namespace overlay
} // end of namespace sdr
diff --git a/svx/source/sdr/overlay/overlayhelpline.cxx b/svx/source/sdr/overlay/overlayhelpline.cxx
index fa12c6df89..eaff70a6f0 100644
--- a/svx/source/sdr/overlay/overlayhelpline.cxx
+++ b/svx/source/sdr/overlay/overlayhelpline.cxx
@@ -35,6 +35,8 @@
#include <vcl/salbtype.hxx>
#include <vcl/outdev.hxx>
#include <basegfx/vector/b2dvector.hxx>
+#include <svx/sdr/overlay/overlaytools.hxx>
+#include <svx/sdr/overlay/overlaymanager.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -42,79 +44,38 @@ namespace sdr
{
namespace overlay
{
- void OverlayHelplineStriped::drawGeometry(OutputDevice& rOutputDevice)
+ drawinglayer::primitive2d::Primitive2DSequence OverlayHelplineStriped::createOverlayObjectPrimitive2DSequence()
{
- // prepare OutputDevice
- const Point aEmptyPoint;
- const Rectangle aVisiblePixel(aEmptyPoint, rOutputDevice.GetOutputSizePixel());
- const Rectangle aVisibleLogic(rOutputDevice.PixelToLogic(aVisiblePixel));
+ drawinglayer::primitive2d::Primitive2DSequence aRetval;
- switch(meKind)
+ if(getOverlayManager())
{
- case SDRHELPLINE_VERTICAL :
- {
- const basegfx::B2DPoint aStart(getBasePosition().getX(), aVisibleLogic.Top());
- const basegfx::B2DPoint aEnd(getBasePosition().getX(), aVisibleLogic.Bottom());
- ImpDrawLineStriped(rOutputDevice, aStart, aEnd);
- break;
- }
-
- case SDRHELPLINE_HORIZONTAL :
- {
- const basegfx::B2DPoint aStart(aVisibleLogic.Left(), getBasePosition().getY());
- const basegfx::B2DPoint aEnd(aVisibleLogic.Right(), getBasePosition().getY());
- ImpDrawLineStriped(rOutputDevice, aStart, aEnd);
- break;
- }
-
- case SDRHELPLINE_POINT :
- {
- const Size aPixelSize(SDRHELPLINE_POINT_PIXELSIZE, SDRHELPLINE_POINT_PIXELSIZE);
- const Size aLogicSize(rOutputDevice.PixelToLogic(aPixelSize));
-
- const basegfx::B2DPoint aStartA(getBasePosition().getX(), getBasePosition().getY() - aLogicSize.Height());
- const basegfx::B2DPoint aEndA(getBasePosition().getX(), getBasePosition().getY() + aLogicSize.Height());
- ImpDrawLineStriped(rOutputDevice, aStartA, aEndA);
-
- const basegfx::B2DPoint aStartB(getBasePosition().getX() - aLogicSize.Width(), getBasePosition().getY());
- const basegfx::B2DPoint aEndB(getBasePosition().getX() + aLogicSize.Width(), getBasePosition().getY());
- ImpDrawLineStriped(rOutputDevice, aStartB, aEndB);
-
- break;
- }
+ const basegfx::BColor aRGBColorA(getOverlayManager()->getStripeColorA().getBColor());
+ const basegfx::BColor aRGBColorB(getOverlayManager()->getStripeColorB().getBColor());
+ const double fStripeLengthPixel(getOverlayManager()->getStripeLengthPixel());
+ const drawinglayer::primitive2d::HelplineStyle aStyle(
+ SDRHELPLINE_POINT == getKind() ? drawinglayer::primitive2d::HELPLINESTYLE_POINT :
+ SDRHELPLINE_VERTICAL == getKind() ? drawinglayer::primitive2d::HELPLINESTYLE_VERTICAL :
+ drawinglayer::primitive2d::HELPLINESTYLE_HORIZONTAL);
+
+ const drawinglayer::primitive2d::Primitive2DReference aReference(
+ new drawinglayer::primitive2d::OverlayHelplineStripedPrimitive(
+ getBasePosition(),
+ aStyle,
+ aRGBColorA,
+ aRGBColorB,
+ fStripeLengthPixel));
+
+ aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aReference, 1);
}
+
+ return aRetval;
}
- void OverlayHelplineStriped::createBaseRange(OutputDevice& rOutputDevice)
+ void OverlayHelplineStriped::stripeDefinitionHasChanged()
{
- // reset range and expand it
- maBaseRange.reset();
-
- if(SDRHELPLINE_POINT == meKind)
- {
- const Size aPixelSize(SDRHELPLINE_POINT_PIXELSIZE, SDRHELPLINE_POINT_PIXELSIZE);
- const Size aLogicSize(rOutputDevice.PixelToLogic(aPixelSize));
-
- maBaseRange.expand(basegfx::B2DPoint(getBasePosition().getX() - aLogicSize.Width(), getBasePosition().getY() - aLogicSize.Height()));
- maBaseRange.expand(basegfx::B2DPoint(getBasePosition().getX() + aLogicSize.Width(), getBasePosition().getY() + aLogicSize.Height()));
- }
- else
- {
- const Point aEmptyPoint;
- const Rectangle aVisiblePixel(aEmptyPoint, rOutputDevice.GetOutputSizePixel());
- const Rectangle aVisibleLogic(rOutputDevice.PixelToLogic(aVisiblePixel));
-
- if(SDRHELPLINE_HORIZONTAL == meKind)
- {
- maBaseRange.expand(basegfx::B2DPoint(aVisibleLogic.Left(), getBasePosition().getY()));
- maBaseRange.expand(basegfx::B2DPoint(aVisibleLogic.Right(), getBasePosition().getY()));
- }
- else if(SDRHELPLINE_VERTICAL == meKind)
- {
- maBaseRange.expand(basegfx::B2DPoint(getBasePosition().getX(), aVisibleLogic.Top()));
- maBaseRange.expand(basegfx::B2DPoint(getBasePosition().getX(), aVisibleLogic.Bottom()));
- }
- }
+ // react on OverlayManager's stripe definition change
+ objectChange();
}
OverlayHelplineStriped::OverlayHelplineStriped(
@@ -128,102 +89,6 @@ namespace sdr
OverlayHelplineStriped::~OverlayHelplineStriped()
{
}
-
- sal_Bool OverlayHelplineStriped::isHit(const basegfx::B2DPoint& rPos, double fTol) const
- {
- if(isHittable())
- {
- if(SDRHELPLINE_POINT == meKind)
- {
- // use distance to BasePosition
- const basegfx::B2DVector aVector(rPos - getBasePosition());
-
- return (aVector.getLength() < fTol);
- }
- else
- {
- if(SDRHELPLINE_HORIZONTAL == meKind)
- {
- // test vertical
- if(rPos.getY() >= (getBasePosition().getY() - fTol)
- && rPos.getY() <= (getBasePosition().getY() + fTol))
- {
- return sal_True;
- }
- }
- else if(SDRHELPLINE_VERTICAL == meKind)
- {
- // test horizontal
- if(rPos.getX() >= (getBasePosition().getX() - fTol)
- && rPos.getX() <= (getBasePosition().getX() + fTol))
- {
- return sal_True;
- }
- }
- }
- }
-
- return sal_False;
- }
- } // end of namespace overlay
-} // end of namespace sdr
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace sdr
-{
- namespace overlay
- {
- void OverlayHelpline::drawGeometry(OutputDevice& rOutputDevice)
- {
- Point aBasePos(FRound(getBasePosition().getX()), FRound(getBasePosition().getY()));
-
- rOutputDevice.SetLineColor(getBaseColor());
- rOutputDevice.SetFillColor();
-
- if(SDRHELPLINE_POINT == meKind)
- {
- Size aPixelSize(SDRHELPLINE_POINT_PIXELSIZE, SDRHELPLINE_POINT_PIXELSIZE);
- Size aLogicSize(rOutputDevice.PixelToLogic(aPixelSize));
-
- rOutputDevice.DrawLine(
- Point(aBasePos.X() - aLogicSize.Width(), aBasePos.Y()),
- Point(aBasePos.X() + aLogicSize.Width(), aBasePos.Y()));
- rOutputDevice.DrawLine(
- Point(aBasePos.X(), aBasePos.Y() - aLogicSize.Height()),
- Point(aBasePos.X(), aBasePos.Y() + aLogicSize.Height()));
- }
- else
- {
- Point aEmptyPoint;
- Rectangle aVisiblePixel(aEmptyPoint, rOutputDevice.GetOutputSizePixel());
- Rectangle aVisibleLogic(rOutputDevice.PixelToLogic(aVisiblePixel));
-
- if(SDRHELPLINE_HORIZONTAL == meKind)
- {
- rOutputDevice.DrawLine(Point(aVisibleLogic.Left(), aBasePos.Y()), Point(aVisibleLogic.Right(), aBasePos.Y()));
- }
- else if(SDRHELPLINE_VERTICAL == meKind)
- {
- rOutputDevice.DrawLine(Point(aBasePos.X(), aVisibleLogic.Top()), Point(aBasePos.X(), aVisibleLogic.Bottom()));
- }
- }
- }
-
- OverlayHelpline::OverlayHelpline(
- const basegfx::B2DPoint& rBasePos,
- Color aLineColor,
- SdrHelpLineKind eNewKind)
- : OverlayHelplineStriped(rBasePos, eNewKind)
- {
- // set base color here, OverlayCrosshairStriped constructor has set
- // it to it's own default.
- maBaseColor = aLineColor;
- }
-
- OverlayHelpline::~OverlayHelpline()
- {
- }
} // end of namespace overlay
} // end of namespace sdr
diff --git a/svx/source/sdr/overlay/overlayline.cxx b/svx/source/sdr/overlay/overlayline.cxx
index 325c2f459e..5a2a5f2248 100644
--- a/svx/source/sdr/overlay/overlayline.cxx
+++ b/svx/source/sdr/overlay/overlayline.cxx
@@ -37,6 +37,9 @@
#include <basegfx/vector/b2dvector.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
+#include <svx/sdr/overlay/overlaymanager.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
+#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -44,17 +47,37 @@ namespace sdr
{
namespace overlay
{
- void OverlayLineStriped::drawGeometry(OutputDevice& rOutputDevice)
+ drawinglayer::primitive2d::Primitive2DSequence OverlayLineStriped::createOverlayObjectPrimitive2DSequence()
{
- ImpDrawLineStriped(rOutputDevice, getBasePosition(), getSecondPosition());
+ drawinglayer::primitive2d::Primitive2DSequence aRetval;
+
+ if(getOverlayManager())
+ {
+ const basegfx::BColor aRGBColorA(getOverlayManager()->getStripeColorA().getBColor());
+ const basegfx::BColor aRGBColorB(getOverlayManager()->getStripeColorB().getBColor());
+ const double fStripeLengthPixel(getOverlayManager()->getStripeLengthPixel());
+ basegfx::B2DPolygon aLine;
+
+ aLine.append(getBasePosition());
+ aLine.append(getSecondPosition());
+
+ const drawinglayer::primitive2d::Primitive2DReference aReference(
+ new drawinglayer::primitive2d::PolygonMarkerPrimitive2D(
+ aLine,
+ aRGBColorA,
+ aRGBColorB,
+ fStripeLengthPixel));
+
+ aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aReference, 1);
+ }
+
+ return aRetval;
}
- void OverlayLineStriped::createBaseRange(OutputDevice& /*rOutputDevice*/)
+ void OverlayLineStriped::stripeDefinitionHasChanged()
{
- // reset range and expand it
- maBaseRange.reset();
- maBaseRange.expand(getBasePosition());
- maBaseRange.expand(getSecondPosition());
+ // react on OverlayManager's stripe definition change
+ objectChange();
}
OverlayLineStriped::OverlayLineStriped(
@@ -80,63 +103,6 @@ namespace sdr
objectChange();
}
}
-
- sal_Bool OverlayLineStriped::isHit(const basegfx::B2DPoint& rPos, double fTol) const
- {
- if(isHittable() && !getBasePosition().equal(getSecondPosition()))
- {
- return basegfx::tools::isInEpsilonRange(getBasePosition(), getSecondPosition(), rPos, fTol);
- }
-
- return sal_False;
- }
-
- void OverlayLineStriped::transform(const basegfx::B2DHomMatrix& rMatrix)
- {
- if(!rMatrix.isIdentity())
- {
- // transform base position
- OverlayObjectWithBasePosition::transform(rMatrix);
-
- // transform maSecondPosition
- const basegfx::B2DPoint aNewSecondPosition = rMatrix * getSecondPosition();
- setSecondPosition(aNewSecondPosition);
- }
- }
- } // end of namespace overlay
-} // end of namespace sdr
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace sdr
-{
- namespace overlay
- {
- void OverlayLine::drawGeometry(OutputDevice& rOutputDevice)
- {
- const Point aStart(FRound(getBasePosition().getX()), FRound(getBasePosition().getY()));
- const Point aEnd(FRound(getSecondPosition().getX()), FRound(getSecondPosition().getY()));
-
- rOutputDevice.SetLineColor(getBaseColor());
- rOutputDevice.SetFillColor();
-
- rOutputDevice.DrawLine(aStart, aEnd);
- }
-
- OverlayLine::OverlayLine(
- const basegfx::B2DPoint& rBasePos,
- const basegfx::B2DPoint& rSecondPos,
- Color aLineColor)
- : OverlayLineStriped(rBasePos, rSecondPos)
- {
- // set base color here, OverlayCrosshairStriped constructor has set
- // it to it's own default.
- maBaseColor = aLineColor;
- }
-
- OverlayLine::~OverlayLine()
- {
- }
} // end of namespace overlay
} // end of namespace sdr
diff --git a/svx/source/sdr/overlay/overlaymanager.cxx b/svx/source/sdr/overlay/overlaymanager.cxx
index 834f8f170c..f77b533a0e 100644
--- a/svx/source/sdr/overlay/overlaymanager.cxx
+++ b/svx/source/sdr/overlay/overlaymanager.cxx
@@ -50,121 +50,212 @@ namespace sdr
{
void OverlayManager::ImpDrawMembers(const basegfx::B2DRange& rRange, OutputDevice& rDestinationDevice) const
{
- ::sdr::overlay::OverlayObject* pCurrent = mpOverlayObjectStart;
+ const sal_uInt32 nSize(maOverlayObjects.size());
- if(pCurrent)
+ if(nSize)
{
const sal_uInt16 nOriginalAA(rDestinationDevice.GetAntialiasing());
+ const bool bIsAntiAliasing(getDrawinglayerOpt().IsAntiAliasing());
- // react on AntiAliasing settings
- if(maDrawinglayerOpt.IsAntiAliasing())
- {
- rDestinationDevice.SetAntialiasing(nOriginalAA | ANTIALIASING_ENABLE_B2DDRAW);
- }
- else
- {
- rDestinationDevice.SetAntialiasing(nOriginalAA & ~ANTIALIASING_ENABLE_B2DDRAW);
- }
+ // create processor
+ drawinglayer::processor2d::BaseProcessor2D* pProcessor = ::sdr::contact::createBaseProcessor2DFromOutputDevice(
+ rDestinationDevice,
+ getCurrentViewInformation2D());
- while(pCurrent)
+ if(pProcessor)
{
- if(pCurrent->isVisible())
+ for(OverlayObjectVector::const_iterator aIter(maOverlayObjects.begin()); aIter != maOverlayObjects.end(); aIter++)
{
- if(rRange.overlaps(pCurrent->getBaseRange()))
+ OSL_ENSURE(*aIter, "Corrupted OverlayObject List (!)");
+ const OverlayObject& rCandidate = **aIter;
+
+ if(rCandidate.isVisible())
{
- pCurrent->drawGeometry(rDestinationDevice);
+ const drawinglayer::primitive2d::Primitive2DSequence& rSequence = rCandidate.getOverlayObjectPrimitive2DSequence();
+
+ if(rSequence.hasElements())
+ {
+ if(rRange.overlaps(rCandidate.getBaseRange()))
+ {
+ if(bIsAntiAliasing && rCandidate.allowsAntiAliase())
+ {
+ rDestinationDevice.SetAntialiasing(nOriginalAA | ANTIALIASING_ENABLE_B2DDRAW);
+ }
+ else
+ {
+ rDestinationDevice.SetAntialiasing(nOriginalAA & ~ANTIALIASING_ENABLE_B2DDRAW);
+ }
+
+ pProcessor->process(rSequence);
+ }
+ }
}
}
- pCurrent = pCurrent->mpNext;
+ delete pProcessor;
}
-
+
// restore AA settings
rDestinationDevice.SetAntialiasing(nOriginalAA);
}
}
- void OverlayManager::ImpCheckMapModeChange() const
+ void OverlayManager::ImpStripeDefinitionChanged()
{
- sal_Bool bZoomHasChanged(sal_False);
- MapMode aOutputDeviceMapMode(getOutputDevice().GetMapMode());
- ::sdr::overlay::OverlayObject* pCurrent = mpOverlayObjectStart;
+ const sal_uInt32 nSize(maOverlayObjects.size());
- if(maMapMode != aOutputDeviceMapMode)
+ if(nSize)
{
- bZoomHasChanged = (
- maMapMode.GetScaleX() != aOutputDeviceMapMode.GetScaleX()
- || maMapMode.GetScaleY() != aOutputDeviceMapMode.GetScaleY());
-
- // remember MapMode
- ((OverlayManager*)this)->maMapMode = aOutputDeviceMapMode;
- }
-
- if(bZoomHasChanged && pCurrent)
- {
- while(pCurrent)
+ for(OverlayObjectVector::iterator aIter(maOverlayObjects.begin()); aIter != maOverlayObjects.end(); aIter++)
{
- pCurrent->zoomHasChanged();
- pCurrent = pCurrent->mpNext;
+ OSL_ENSURE(*aIter, "Corrupted OverlayObject List (!)");
+ OverlayObject& rCandidate = **aIter;
+ rCandidate.stripeDefinitionHasChanged();
}
}
}
- void OverlayManager::ImpStripeDefinitionChanged()
- {
- ::sdr::overlay::OverlayObject* pCurrent = mpOverlayObjectStart;
-
- while(pCurrent)
- {
- pCurrent->stripeDefinitionHasChanged();
- pCurrent = pCurrent->mpNext;
- }
- }
-
- double OverlayManager::getDiscreteOne() const
+ double OverlayManager::getDiscreteOne() const
{
- if(getOutputDevice().GetViewTransformation() != maViewTransformation)
+ if(basegfx::fTools::equalZero(mfDiscreteOne))
{
- OverlayManager* pThis = const_cast< OverlayManager* >(this);
- pThis->maViewTransformation = getOutputDevice().GetViewTransformation();
const basegfx::B2DVector aDiscreteInLogic(getOutputDevice().GetInverseViewTransformation() * basegfx::B2DVector(1.0, 0.0));
- pThis->mfDiscreteOne = aDiscreteInLogic.getLength();
+ const_cast< OverlayManager* >(this)->mfDiscreteOne = aDiscreteInLogic.getLength();
}
return mfDiscreteOne;
}
- OverlayManager::OverlayManager(OutputDevice& rOutputDevice)
+ OverlayManager::OverlayManager(
+ OutputDevice& rOutputDevice,
+ OverlayManager* pOldOverlayManager)
: Scheduler(),
rmOutputDevice(rOutputDevice),
- mpOverlayObjectStart(0L),
- mpOverlayObjectEnd(0L),
+ maOverlayObjects(),
maStripeColorA(Color(COL_BLACK)),
maStripeColorB(Color(COL_WHITE)),
- mnStripeLengthPixel(5L),
+ mnStripeLengthPixel(5),
maDrawinglayerOpt(),
maViewTransformation(),
+ maViewInformation2D(0),
mfDiscreteOne(0.0)
{
+ if(pOldOverlayManager)
+ {
+ // take over OverlayObjects from given OverlayManager. Copy
+ // the vector of pointers
+ maOverlayObjects = pOldOverlayManager->maOverlayObjects;
+ const sal_uInt32 nSize(maOverlayObjects.size());
+
+ if(nSize)
+ {
+ for(OverlayObjectVector::iterator aIter(maOverlayObjects.begin()); aIter != maOverlayObjects.end(); aIter++)
+ {
+ OSL_ENSURE(*aIter, "Corrupted OverlayObject List (!)");
+ OverlayObject& rCandidate = **aIter;
+
+ // remove from old and add to new OverlayManager
+ pOldOverlayManager->impApplyRemoveActions(rCandidate);
+ impApplyAddActions(rCandidate);
+ }
+
+ pOldOverlayManager->maOverlayObjects.clear();
+ }
+ }
+ }
+
+ const drawinglayer::geometry::ViewInformation2D OverlayManager::getCurrentViewInformation2D() const
+ {
+ if(getOutputDevice().GetViewTransformation() != maViewTransformation)
+ {
+ basegfx::B2DRange aViewRange(maViewInformation2D.getViewport());
+
+ if(OUTDEV_WINDOW == getOutputDevice().GetOutDevType())
+ {
+ const Size aOutputSizePixel(getOutputDevice().GetOutputSizePixel());
+ aViewRange = basegfx::B2DRange(0.0, 0.0, aOutputSizePixel.getWidth(), aOutputSizePixel.getHeight());
+ aViewRange.transform(getOutputDevice().GetInverseViewTransformation());
+ }
+
+ OverlayManager* pThis = const_cast< OverlayManager* >(this);
+
+ pThis->maViewTransformation = getOutputDevice().GetViewTransformation();
+ pThis->maViewInformation2D = drawinglayer::geometry::ViewInformation2D(
+ maViewInformation2D.getObjectTransformation(),
+ maViewTransformation,
+ aViewRange,
+ maViewInformation2D.getVisualizedPage(),
+ maViewInformation2D.getViewTime(),
+ maViewInformation2D.getExtendedInformationSequence());
+ pThis->mfDiscreteOne = 0.0;
+ }
+
+ return maViewInformation2D;
+ }
+
+ void OverlayManager::impApplyRemoveActions(OverlayObject& rTarget)
+ {
+ // handle evtl. animation
+ if(rTarget.allowsAnimation())
+ {
+ // remove from event chain
+ RemoveEvent(&rTarget);
+ }
+
+ // make invisible
+ invalidateRange(rTarget.getBaseRange());
+
+ // clear manager
+ rTarget.mpOverlayManager = 0;
+ }
+
+ void OverlayManager::impApplyAddActions(OverlayObject& rTarget)
+ {
+ // set manager
+ rTarget.mpOverlayManager = this;
+
+ // make visible
+ invalidateRange(rTarget.getBaseRange());
+
+ // handle evtl. animation
+ if(rTarget.allowsAnimation())
+ {
+ // Trigger at current time to get alive. This will do the
+ // object-specific next time calculation and hand over adding
+ // again to the scheduler to the animated object, too. This works for
+ // a paused or non-paused animator.
+ rTarget.Trigger(GetTime());
+ }
}
OverlayManager::~OverlayManager()
{
- // the OverlayManager is not the owner of the OverlayObjects
- // and thus will not delete them, but remove them.
- while(mpOverlayObjectStart)
+ // The OverlayManager is not the owner of the OverlayObjects
+ // and thus will not delete them, but remove them. Profit here
+ // from knowing that all will be removed
+ const sal_uInt32 nSize(maOverlayObjects.size());
+
+ if(nSize)
{
- remove(*mpOverlayObjectStart);
+ for(OverlayObjectVector::iterator aIter(maOverlayObjects.begin()); aIter != maOverlayObjects.end(); aIter++)
+ {
+ OSL_ENSURE(*aIter, "Corrupted OverlayObject List (!)");
+ OverlayObject& rCandidate = **aIter;
+ impApplyRemoveActions(rCandidate);
+ }
+
+ // erase vector
+ maOverlayObjects.clear();
}
}
void OverlayManager::completeRedraw(const Region& rRegion, OutputDevice* pPreRenderDevice) const
{
- if(!rRegion.IsEmpty() && mpOverlayObjectStart)
+ if(!rRegion.IsEmpty() && maOverlayObjects.size())
{
// check for changed MapModes. That may influence the
// logical size of pixel based OverlayObjects (like BitmapHandles)
- ImpCheckMapModeChange();
+ //ImpCheckMapModeChange();
// paint members
const Rectangle aRegionBoundRect(rRegion.GetBoundRect());
@@ -195,87 +286,38 @@ namespace sdr
void OverlayManager::add(OverlayObject& rOverlayObject)
{
- // add to the end of chain to preserve display order in paint
- DBG_ASSERT(0L == rOverlayObject.mpOverlayManager,
- "OverlayManager::add: OverlayObject is added to an OverlayManager (!)");
-
- if(mpOverlayObjectEnd)
- {
- // new element, add to end
- rOverlayObject.mpNext = mpOverlayObjectEnd->mpNext;
- rOverlayObject.mpPrevious = mpOverlayObjectEnd;
- mpOverlayObjectEnd->mpNext = &rOverlayObject;
- mpOverlayObjectEnd = &rOverlayObject;
- }
- else
- {
- // first element
- rOverlayObject.mpNext = rOverlayObject.mpPrevious = 0L;
- mpOverlayObjectEnd = mpOverlayObjectStart = &rOverlayObject;
- }
+ OSL_ENSURE(0 == rOverlayObject.mpOverlayManager, "OverlayObject is added twice to an OverlayManager (!)");
- // set manager
- rOverlayObject.mpOverlayManager = this;
-
- // make visible
- invalidateRange(rOverlayObject.getBaseRange());
+ // add to the end of chain to preserve display order in paint
+ maOverlayObjects.push_back(&rOverlayObject);
- // handle evtl. animation
- if(rOverlayObject.allowsAnimation())
- {
- // Trigger at current time to get alive. This will do the
- // object-specific next time calculation and hand over adding
- // again to the scheduler to the animated object, too. This works for
- // a paused or non-paused animator.
- rOverlayObject.Trigger(GetTime());
- }
+ // execute add actions
+ impApplyAddActions(rOverlayObject);
}
void OverlayManager::remove(OverlayObject& rOverlayObject)
{
- // handle evtl. animation
- if(rOverlayObject.allowsAnimation())
- {
- // remove from event chain
- RemoveEvent(&rOverlayObject);
- }
+ OSL_ENSURE(rOverlayObject.mpOverlayManager == this, "OverlayObject is removed from wrong OverlayManager (!)");
- // Remove from chain
- DBG_ASSERT(rOverlayObject.mpOverlayManager == this,
- "OverlayManager::remove: OverlayObject is removed from wrong OverlayManager (!)");
-
- if(rOverlayObject.mpPrevious)
- {
- rOverlayObject.mpPrevious->mpNext = rOverlayObject.mpNext;
- }
+ // execute remove actions
+ impApplyRemoveActions(rOverlayObject);
- if(rOverlayObject.mpNext)
- {
- rOverlayObject.mpNext->mpPrevious = rOverlayObject.mpPrevious;
- }
-
- if(&rOverlayObject == mpOverlayObjectStart)
- {
- mpOverlayObjectStart = rOverlayObject.mpNext;
- }
+ // remove from vector
+ const OverlayObjectVector::iterator aFindResult = ::std::find(maOverlayObjects.begin(), maOverlayObjects.end(), &rOverlayObject);
+ const bool bFound(aFindResult != maOverlayObjects.end());
+ OSL_ENSURE(bFound, "OverlayObject NOT found at OverlayManager (!)");
- if(&rOverlayObject == mpOverlayObjectEnd)
+ if(bFound)
{
- mpOverlayObjectEnd = rOverlayObject.mpPrevious;
+ maOverlayObjects.erase(aFindResult);
}
-
- // make invisible
- invalidateRange(rOverlayObject.getBaseRange());
-
- // clear manager
- rOverlayObject.mpOverlayManager = 0L;
}
void OverlayManager::invalidateRange(const basegfx::B2DRange& rRange)
{
if(OUTDEV_WINDOW == getOutputDevice().GetOutDevType())
{
- if(maDrawinglayerOpt.IsAntiAliasing())
+ if(getDrawinglayerOpt().IsAntiAliasing())
{
// assume AA needs one pixel more and invalidate one pixel more
const double fDiscreteOne(getDiscreteOne());
@@ -331,18 +373,6 @@ namespace sdr
ImpStripeDefinitionChanged();
}
}
-
- ::boost::shared_ptr<OverlayObjectVector> OverlayManager::GetOverlayObjects (void) const
- {
- ::boost::shared_ptr<OverlayObjectVector> pObjectList (new OverlayObjectVector());
- sdr::overlay::OverlayObject* pObject = mpOverlayObjectStart;
- while (pObject != NULL)
- {
- pObjectList->push_back(pObject);
- pObject = pObject->mpNext;
- }
- return pObjectList;
- }
} // end of namespace overlay
} // end of namespace sdr
diff --git a/svx/source/sdr/overlay/overlaymanagerbuffered.cxx b/svx/source/sdr/overlay/overlaymanagerbuffered.cxx
index 38ac0ce98a..9b0fdb1589 100644
--- a/svx/source/sdr/overlay/overlaymanagerbuffered.cxx
+++ b/svx/source/sdr/overlay/overlaymanagerbuffered.cxx
@@ -36,12 +36,8 @@
#include <basegfx/range/b2drange.hxx>
#include <vcl/salbtype.hxx>
#include <vcl/window.hxx>
-
-// #i72754#
#include <vcl/bitmap.hxx>
#include <tools/stream.hxx>
-
-// #i75163#
#include <basegfx/matrix/b2dhommatrix.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -63,7 +59,7 @@ namespace sdr
// compare the MapModes for zoom/scroll changes
if(maBufferDevice.GetMapMode() != getOutputDevice().GetMapMode())
{
- const sal_Bool bZoomed(
+ const bool bZoomed(
maBufferDevice.GetMapMode().GetScaleX() != getOutputDevice().GetMapMode().GetScaleX()
|| maBufferDevice.GetMapMode().GetScaleY() != getOutputDevice().GetMapMode().GetScaleY());
@@ -71,7 +67,7 @@ namespace sdr
{
const Point& rOriginOld = maBufferDevice.GetMapMode().GetOrigin();
const Point& rOriginNew = getOutputDevice().GetMapMode().GetOrigin();
- const sal_Bool bScrolled(rOriginOld != rOriginNew);
+ const bool bScrolled(rOriginOld != rOriginNew);
if(bScrolled)
{
@@ -81,8 +77,8 @@ namespace sdr
const Size aOutputSizePixel(maBufferDevice.GetOutputSizePixel());
// remember and switch off MapMode
- const sal_Bool bMapModeWasEnabled(maBufferDevice.IsMapModeEnabled());
- maBufferDevice.EnableMapMode(sal_False);
+ const bool bMapModeWasEnabled(maBufferDevice.IsMapModeEnabled());
+ maBufferDevice.EnableMapMode(false);
// scroll internally buffered stuff
const Point aDestinationOffsetPixel(aOriginNewPixel - aOriginOldPixel);
@@ -132,10 +128,10 @@ namespace sdr
Rectangle aRegionRectanglePixel;
// MapModes off
- const sal_Bool bMapModeWasEnabledDest(getOutputDevice().IsMapModeEnabled());
- const sal_Bool bMapModeWasEnabledSource(maBufferDevice.IsMapModeEnabled());
- getOutputDevice().EnableMapMode(sal_False);
- ((OverlayManagerBuffered*)this)->maBufferDevice.EnableMapMode(sal_False);
+ const bool bMapModeWasEnabledDest(getOutputDevice().IsMapModeEnabled());
+ const bool bMapModeWasEnabledSource(maBufferDevice.IsMapModeEnabled());
+ getOutputDevice().EnableMapMode(false);
+ ((OverlayManagerBuffered*)this)->maBufferDevice.EnableMapMode(false);
while(aRegionPixel.GetEnumRects(aRegionHandle, aRegionRectanglePixel))
{
@@ -200,10 +196,10 @@ namespace sdr
Rectangle aRegionRectanglePixel;
// MapModes off
- const sal_Bool bMapModeWasEnabledDest(rSource.IsMapModeEnabled());
- const sal_Bool bMapModeWasEnabledSource(maBufferDevice.IsMapModeEnabled());
- rSource.EnableMapMode(sal_False);
- maBufferDevice.EnableMapMode(sal_False);
+ const bool bMapModeWasEnabledDest(rSource.IsMapModeEnabled());
+ const bool bMapModeWasEnabledSource(maBufferDevice.IsMapModeEnabled());
+ rSource.EnableMapMode(false);
+ maBufferDevice.EnableMapMode(false);
while(aRegion.GetEnumRects(aRegionHandle, aRegionRectanglePixel))
{
@@ -221,7 +217,7 @@ namespace sdr
static bool bDoPaintForVisualControl(false);
if(bDoPaintForVisualControl)
{
- const sal_Bool bMapModeWasEnabledTest(getOutputDevice().IsMapModeEnabled());
+ const bool bMapModeWasEnabledTest(getOutputDevice().IsMapModeEnabled());
getOutputDevice().EnableMapMode(false);
getOutputDevice().SetLineColor(COL_LIGHTRED);
getOutputDevice().SetFillColor();
@@ -282,7 +278,7 @@ namespace sdr
}
maOutputBufferDevice.SetMapMode(getOutputDevice().GetMapMode());
- maOutputBufferDevice.EnableMapMode(sal_False);
+ maOutputBufferDevice.EnableMapMode(false);
maOutputBufferDevice.SetDrawMode(maBufferDevice.GetDrawMode());
maOutputBufferDevice.SetSettings(maBufferDevice.GetSettings());
maOutputBufferDevice.SetAntialiasing(maBufferDevice.GetAntialiasing());
@@ -320,8 +316,8 @@ namespace sdr
const Size aSize(aRegionRectanglePixel.GetSize());
{
- const sal_Bool bMapModeWasEnabledDest(maBufferDevice.IsMapModeEnabled());
- maBufferDevice.EnableMapMode(sal_False);
+ const bool bMapModeWasEnabledDest(maBufferDevice.IsMapModeEnabled());
+ maBufferDevice.EnableMapMode(false);
maOutputBufferDevice.DrawOutDev(
aTopLeft, aSize, // destination
@@ -334,14 +330,14 @@ namespace sdr
// paint overlay content for remembered region, use
// method from base class directly
- maOutputBufferDevice.EnableMapMode(sal_True);
+ maOutputBufferDevice.EnableMapMode(true);
OverlayManager::ImpDrawMembers(aBufferRememberedRangeLogic, maOutputBufferDevice);
- maOutputBufferDevice.EnableMapMode(sal_False);
+ maOutputBufferDevice.EnableMapMode(false);
// copy to output
{
- const sal_Bool bMapModeWasEnabledDest(getOutputDevice().IsMapModeEnabled());
- getOutputDevice().EnableMapMode(sal_False);
+ const bool bMapModeWasEnabledDest(getOutputDevice().IsMapModeEnabled());
+ getOutputDevice().EnableMapMode(false);
getOutputDevice().DrawOutDev(
aTopLeft, aSize, // destination
@@ -417,8 +413,11 @@ namespace sdr
return 0;
}
- OverlayManagerBuffered::OverlayManagerBuffered(OutputDevice& rOutputDevice, sal_Bool bRefreshWithPreRendering)
- : OverlayManager(rOutputDevice),
+ OverlayManagerBuffered::OverlayManagerBuffered(
+ OutputDevice& rOutputDevice,
+ OverlayManager* pOldOverlayManager,
+ bool bRefreshWithPreRendering)
+ : OverlayManager(rOutputDevice, pOldOverlayManager),
mbRefreshWithPreRendering(bRefreshWithPreRendering)
{
// Init timer
@@ -515,9 +514,9 @@ namespace sdr
}
}
- void OverlayManagerBuffered::SetRefreshWithPreRendering(sal_Bool bNew)
+ void OverlayManagerBuffered::SetRefreshWithPreRendering(bool bNew)
{
- if(mbRefreshWithPreRendering != bNew)
+ if((bool)mbRefreshWithPreRendering != bNew)
{
mbRefreshWithPreRendering = bNew;
}
diff --git a/svx/source/sdr/overlay/overlayobject.cxx b/svx/source/sdr/overlay/overlayobject.cxx
index 63dc6c1f2a..83947826ff 100644
--- a/svx/source/sdr/overlay/overlayobject.cxx
+++ b/svx/source/sdr/overlay/overlayobject.cxx
@@ -43,7 +43,6 @@
#include <basegfx/polygon/b2dpolypolygontools.hxx>
#include <svx/sdr/contact/objectcontacttools.hxx>
#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
-#include <drawinglayer/processor2d/baseprocessor2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -52,207 +51,95 @@ namespace sdr
namespace overlay
{
void OverlayObject::objectChange()
- {
- if(mpOverlayManager)
- {
- basegfx::B2DRange aPreviousRange(maBaseRange);
-
- if(!aPreviousRange.isEmpty())
- {
- mpOverlayManager->invalidateRange(aPreviousRange);
- }
-
- mbIsChanged = sal_True;
- const basegfx::B2DRange& rCurrentRange = getBaseRange();
-
- if(rCurrentRange != aPreviousRange && !rCurrentRange.isEmpty())
- {
- mpOverlayManager->invalidateRange(rCurrentRange);
- }
- }
- }
-
- // support method to draw striped geometries
- void OverlayObject::ImpDrawRangeStriped(OutputDevice& rOutputDevice, const basegfx::B2DRange& rRange)
{
- if(getOverlayManager())
- {
- const basegfx::B2DPolygon aPolygon(basegfx::tools::createPolygonFromRect(rRange));
+ const basegfx::B2DRange aPreviousRange(maBaseRange);
+ maBaseRange.reset();
+ setPrimitive2DSequence(drawinglayer::primitive2d::Primitive2DSequence());
- if(aPolygon.count())
- {
- ImpDrawPolygonStriped(rOutputDevice, aPolygon);
- }
+ if(getOverlayManager() && !aPreviousRange.isEmpty())
+ {
+ getOverlayManager()->invalidateRange(aPreviousRange);
}
- }
- void OverlayObject::ImpDrawLineStriped(OutputDevice& rOutputDevice, double x1, double y1, double x2, double y2)
- {
- if(getOverlayManager())
- {
- const basegfx::B2DPoint aStart(x1, y1);
- const basegfx::B2DPoint aEnd(x2, y2);
+ const basegfx::B2DRange& rCurrentRange = getBaseRange();
- if(!aStart.equal(aEnd))
- {
- basegfx::B2DPolygon aPolygon;
- aPolygon.append(aStart);
- aPolygon.append(aEnd);
-
- ImpDrawPolygonStriped(rOutputDevice, aPolygon);
- }
+ if(getOverlayManager() && rCurrentRange != aPreviousRange && !rCurrentRange.isEmpty())
+ {
+ getOverlayManager()->invalidateRange(rCurrentRange);
}
}
- void OverlayObject::ImpDrawLineStriped(OutputDevice& rOutputDevice, const basegfx::B2DPoint& rStart, const basegfx::B2DPoint& rEnd)
+ // OverlayObject implementations.
+ drawinglayer::primitive2d::Primitive2DSequence OverlayObject::createOverlayObjectPrimitive2DSequence()
{
- if(getOverlayManager() && !rStart.equal(rEnd))
- {
- basegfx::B2DPolygon aPolygon;
- aPolygon.append(rStart);
- aPolygon.append(rEnd);
-
- ImpDrawPolygonStriped(rOutputDevice, aPolygon);
- }
+ // Default implementation has to assert a missing implementation. It cannot
+ // be useful to have overlay object derivations which have no visualisation
+ // at all
+ OSL_ENSURE(false, "OverlayObject derivation without visualisation definition (missing createOverlayObjectPrimitive2DSequence implementation) (!)");
+ return drawinglayer::primitive2d::Primitive2DSequence();
}
- void OverlayObject::ImpDrawPolygonStriped(OutputDevice& rOutputDevice, const basegfx::B2DPolygon& rPolygon)
+ void OverlayObject::allowAntiAliase(bool bNew)
{
- if(getOverlayManager() && rPolygon.count())
+ if(bNew != (bool)mbAllowsAntiAliase)
{
- if(getOverlayManager() && getOverlayManager()->getDrawinglayerOpt().IsAntiAliasing())
- {
- // prepare ViewInformation2D
- const drawinglayer::geometry::ViewInformation2D aViewInformation2D(
- basegfx::B2DHomMatrix(),
- rOutputDevice.GetViewTransformation(),
- basegfx::B2DRange(),
- 0,
- 0.0,
- 0);
-
- // create processor
- drawinglayer::processor2d::BaseProcessor2D* pProcessor = ::sdr::contact::createBaseProcessor2DFromOutputDevice(
- rOutputDevice,
- aViewInformation2D);
-
- if(pProcessor)
- {
- // prepare primitives
- const drawinglayer::primitive2d::Primitive2DReference aPolygonMarkerPrimitive2D(
- new drawinglayer::primitive2d::PolygonMarkerPrimitive2D(
- rPolygon,
- getOverlayManager()->getStripeColorA().getBColor(),
- getOverlayManager()->getStripeColorB().getBColor(),
- getOverlayManager()->getStripeLengthPixel()));
- const drawinglayer::primitive2d::Primitive2DSequence aSequence(&aPolygonMarkerPrimitive2D, 1);
-
- pProcessor->process(aSequence);
-
- delete pProcessor;
- }
- }
- else
- {
- const sal_uInt32 nLenPixel(getOverlayManager()->getStripeLengthPixel());
- const Size aDashSizePixel(nLenPixel, nLenPixel);
- const Size aDashSizeLogic(rOutputDevice.PixelToLogic(aDashSizePixel));
- const double fDashLength(aDashSizeLogic.Width());
- const double fFullDotDashLength(fDashLength + fDashLength);
-
- // fill DashDot vector
- ::std::vector<double> aDotDashArray;
- aDotDashArray.push_back(fDashLength);
- aDotDashArray.push_back(fDashLength);
-
- // get dash polygons
- basegfx::B2DPolyPolygon aStripesA;
- basegfx::B2DPolyPolygon aStripesB;
- basegfx::tools::applyLineDashing(rPolygon, aDotDashArray, &aStripesA, &aStripesB, fFullDotDashLength);
-
- // draw stripes A
- if(aStripesA.count())
- {
- rOutputDevice.SetFillColor();
- rOutputDevice.SetLineColor(getOverlayManager()->getStripeColorA());
-
- for(sal_uInt32 a(0L); a < aStripesA.count();a ++)
- {
- rOutputDevice.DrawPolyLine(aStripesA.getB2DPolygon(a));
- }
- }
-
- // draw stripes B
- if(aStripesB.count())
- {
- rOutputDevice.SetFillColor();
- rOutputDevice.SetLineColor(getOverlayManager()->getStripeColorB());
+ // remember new value
+ mbAllowsAntiAliase = bNew;
- for(sal_uInt32 a(0L); a < aStripesB.count();a ++)
- {
- rOutputDevice.DrawPolyLine(aStripesB.getB2DPolygon(a));
- }
- }
- }
+ // register change (after change)
+ objectChange();
}
}
OverlayObject::OverlayObject(Color aBaseColor)
- : Event(0L),
- mpOverlayManager(0L),
- mpNext(0L),
- mpPrevious(0L),
+ : Event(0),
+ mpOverlayManager(0),
maBaseColor(aBaseColor),
- mbIsVisible(sal_True),
- mbIsChanged(sal_True),
- mbIsHittable(sal_True),
- mbAllowsAnimation(sal_False)
+ mbIsVisible(true),
+ mbIsHittable(true),
+ mbAllowsAnimation(false),
+ mbAllowsAntiAliase(true)
{
}
OverlayObject::~OverlayObject()
{
- DBG_ASSERT(0L == mpOverlayManager,
- "OverlayObject is destructed which is still registered at OverlayManager (!)");
+ OSL_ENSURE(0 == getOverlayManager(), "OverlayObject is destructed which is still registered at OverlayManager (!)");
}
- sal_Bool OverlayObject::isHit(const basegfx::B2DPoint& rPos, double fTol) const
+ drawinglayer::primitive2d::Primitive2DSequence OverlayObject::getOverlayObjectPrimitive2DSequence() const
{
- if(isHittable())
+ if(!getPrimitive2DSequence().hasElements())
{
- if(0.0 != fTol)
- {
- basegfx::B2DRange aRange(getBaseRange());
- aRange.grow(fTol);
- return aRange.isInside(rPos);
- }
- else
- {
- return getBaseRange().isInside(rPos);
- }
+ // no existing sequence; create one
+ const_cast< OverlayObject* >(this)->setPrimitive2DSequence(
+ const_cast< OverlayObject* >(this)->createOverlayObjectPrimitive2DSequence());
}
- return sal_False;
+ return getPrimitive2DSequence();
}
const basegfx::B2DRange& OverlayObject::getBaseRange() const
{
- if(mbIsChanged)
+ if(getOverlayManager() && maBaseRange.isEmpty())
{
- if(mpOverlayManager)
+ const drawinglayer::primitive2d::Primitive2DSequence& rSequence = getOverlayObjectPrimitive2DSequence();
+
+ if(rSequence.hasElements())
{
- ((::sdr::overlay::OverlayObject*)this)->createBaseRange(mpOverlayManager->getOutputDevice());
- }
+ const drawinglayer::geometry::ViewInformation2D aViewInformation2D(getOverlayManager()->getCurrentViewInformation2D());
- ((::sdr::overlay::OverlayObject*)this)->mbIsChanged = sal_False;
+ const_cast< sdr::overlay::OverlayObject* >(this)->maBaseRange =
+ drawinglayer::primitive2d::getB2DRangeFromPrimitive2DSequence(rSequence, aViewInformation2D);
+ }
}
return maBaseRange;
}
- void OverlayObject::setVisible(sal_Bool bNew)
+ void OverlayObject::setVisible(bool bNew)
{
- if(bNew != mbIsVisible)
+ if(bNew != (bool)mbIsVisible)
{
// remember new value
mbIsVisible = bNew;
@@ -262,9 +149,9 @@ namespace sdr
}
}
- void OverlayObject::setHittable(sal_Bool bNew)
+ void OverlayObject::setHittable(bool bNew)
{
- if(bNew != mbIsHittable)
+ if(bNew != (bool)mbIsHittable)
{
// remember new value
mbIsHittable = bNew;
@@ -291,11 +178,6 @@ namespace sdr
// default does not register again
}
- void OverlayObject::zoomHasChanged()
- {
- // default does not need to do anything
- }
-
void OverlayObject::stripeDefinitionHasChanged()
{
// default does not need to do anything
@@ -330,15 +212,6 @@ namespace sdr
objectChange();
}
}
-
- void OverlayObjectWithBasePosition::transform(const basegfx::B2DHomMatrix& rMatrix)
- {
- if(!rMatrix.isIdentity())
- {
- basegfx::B2DPoint aNewBasePosition = rMatrix * getBasePosition();
- setBasePosition(aNewBasePosition);
- }
- }
} // end of namespace overlay
} // end of namespace sdr
diff --git a/svx/source/sdr/overlay/overlayobjectcell.cxx b/svx/source/sdr/overlay/overlayobjectcell.cxx
index 87954ea7e5..cda1bbd636 100644
--- a/svx/source/sdr/overlay/overlayobjectcell.cxx
+++ b/svx/source/sdr/overlay/overlayobjectcell.cxx
@@ -35,6 +35,11 @@
#include <vcl/outdev.hxx>
#include <vcl/hatch.hxx>
#include <svx/sdr/overlay/overlayobjectcell.hxx>
+#include <basegfx/polygon/b2dpolygontools.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
+#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
+#include <drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx>
+#include <drawinglayer/primitive2d/invertprimitive2d.hxx>
using namespace ::basegfx;
@@ -48,83 +53,60 @@ namespace sdr
mePaintType( eType ),
maRectangles( rRects )
{
+ // no AA for selection overlays
+ allowAntiAliase(false);
}
OverlayObjectCell::~OverlayObjectCell()
{
}
- void OverlayObjectCell::drawGeometry(OutputDevice& rOutputDevice)
+ drawinglayer::primitive2d::Primitive2DSequence OverlayObjectCell::createOverlayObjectPrimitive2DSequence()
{
- // set colors
- rOutputDevice.SetLineColor();
- rOutputDevice.SetFillColor(getBaseColor());
+ drawinglayer::primitive2d::Primitive2DSequence aRetval;
+ const sal_uInt32 nCount(maRectangles.size());
- if ( mePaintType == CELL_OVERLAY_INVERT )
+ if(nCount)
{
- rOutputDevice.Push();
- rOutputDevice.SetRasterOp( ROP_XOR );
- rOutputDevice.SetFillColor( COL_WHITE );
- }
-
- for(sal_uInt32 a(0L);a < maRectangles.size(); a++)
- {
- const basegfx::B2DRange& rRange(maRectangles[a]);
- const Rectangle aRectangle(fround(rRange.getMinX()), fround(rRange.getMinY()), fround(rRange.getMaxX()), fround(rRange.getMaxY()));
+ const basegfx::BColor aRGBColor(getBaseColor().getBColor());
+ aRetval.realloc(nCount);
- switch(mePaintType)
+ // create primitives for all ranges
+ for(sal_uInt32 a(0); a < nCount; a++)
{
- case CELL_OVERLAY_INVERT :
- {
- rOutputDevice.DrawRect( aRectangle );
-
- // if(OUTDEV_WINDOW == rOutputDevice.GetOutDevType())
- // {
- // ((Window&)rOutputDevice).Invert(aRectangle, INVERT_HIGHLIGHT);
- // }
+ const basegfx::B2DRange& rRange(maRectangles[a]);
+ const basegfx::B2DPolygon aPolygon(basegfx::tools::createPolygonFromRect(rRange));
- break;
- }
- case CELL_OVERLAY_HATCH :
- {
- rOutputDevice.DrawHatch(PolyPolygon(Polygon(aRectangle)), Hatch(HATCH_SINGLE, getBaseColor(), 2, 450));
- break;
- }
- case CELL_OVERLAY_TRANSPARENT :
- {
- rOutputDevice.DrawTransparent(PolyPolygon(Polygon(aRectangle)), 50);
- break;
- }
- case CELL_OVERLAY_LIGHT_TRANSPARENT :
- {
- rOutputDevice.DrawTransparent(PolyPolygon(Polygon(aRectangle)), 80);
- break;
- }
+ aRetval[a] = drawinglayer::primitive2d::Primitive2DReference(
+ new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D(
+ basegfx::B2DPolyPolygon(aPolygon),
+ aRGBColor));
}
- }
- if ( mePaintType == CELL_OVERLAY_INVERT )
- rOutputDevice.Pop();
- }
- void OverlayObjectCell::createBaseRange(OutputDevice& /*rOutputDevice*/)
- {
- maBaseRange.reset();
+ if(mePaintType == CELL_OVERLAY_TRANSPARENT)
+ {
+ // embed in 50% transparent paint
+ const drawinglayer::primitive2d::Primitive2DReference aUnifiedAlpha(
+ new drawinglayer::primitive2d::UnifiedAlphaPrimitive2D(
+ aRetval,
+ 0.5));
- for(sal_uInt32 a(0L); a < maRectangles.size(); a++)
- {
- maBaseRange.expand(maRectangles[a]);
- }
- }
+ aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aUnifiedAlpha, 1);
+ }
+ else // CELL_OVERLAY_INVERT
+ {
+ // embed in invert primitive
+ const drawinglayer::primitive2d::Primitive2DReference aInvert(
+ new drawinglayer::primitive2d::InvertPrimitive2D(
+ aRetval));
- void OverlayObjectCell::transform(const basegfx::B2DHomMatrix& rMatrix)
- {
- for(sal_uInt32 a(0L); a < maRectangles.size(); a++)
- {
- maRectangles[a].transform(rMatrix);
+ aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aInvert, 1);
+ }
}
- }
+ return aRetval;
+ }
} // end of namespace overlay
} // end of namespace sdr
diff --git a/svx/source/sdr/overlay/overlayobjectlist.cxx b/svx/source/sdr/overlay/overlayobjectlist.cxx
index 2b18f048b4..1ca102e36e 100644
--- a/svx/source/sdr/overlay/overlayobjectlist.cxx
+++ b/svx/source/sdr/overlay/overlayobjectlist.cxx
@@ -40,6 +40,8 @@
// get access to basic algos like ::std::find
#include <algorithm>
+#include <drawinglayer/processor2d/hittestprocessor2d.hxx>
+
//////////////////////////////////////////////////////////////////////////////
namespace sdr
@@ -73,63 +75,92 @@ namespace sdr
void OverlayObjectList::remove(OverlayObject& rOverlayObject)
{
const OverlayObjectVector::iterator aFindResult = ::std::find(maVector.begin(), maVector.end(), &rOverlayObject);
- DBG_ASSERT((aFindResult != maVector.end()),
- "OverlayObjectList::remove: Could not find given object in list (!)");
- maVector.erase(aFindResult);
+ const bool bFound(aFindResult != maVector.end());
+ OSL_ENSURE(bFound, "Could not find given object in list (!)");
+
+ if(bFound)
+ {
+ maVector.erase(aFindResult);
+ }
}
- sal_Bool OverlayObjectList::isHit(const basegfx::B2DPoint& rPos, double fTol) const
+ bool OverlayObjectList::isHitLogic(const basegfx::B2DPoint& rLogicPosition, double fLogicTolerance) const
{
if(maVector.size())
{
OverlayObjectVector::const_iterator aStart(maVector.begin());
+ sdr::overlay::OverlayObject* pFirst = *aStart;
+ OSL_ENSURE(pFirst, "Corrupt OverlayObjectList (!)");
+ OverlayManager* pManager = pFirst->getOverlayManager();
- if(0.0 == fTol)
+ if(pManager)
{
- ::sdr::overlay::OverlayObject* pCandidate = *aStart;
- OverlayManager* pManager = pCandidate->getOverlayManager();
-
- if(pManager)
+ if(0.0 == fLogicTolerance)
{
- Size aSizeLogic(pManager->getOutputDevice().PixelToLogic(
+ const Size aSizeLogic(pManager->getOutputDevice().PixelToLogic(
Size(DEFAULT_VALUE_FOR_HITTEST_PIXEL, DEFAULT_VALUE_FOR_HITTEST_PIXEL)));
- fTol = aSizeLogic.Width();
+ fLogicTolerance = aSizeLogic.Width();
}
- }
- for(; aStart != maVector.end(); aStart++)
- {
- ::sdr::overlay::OverlayObject* pCandidate = *aStart;
+ const drawinglayer::geometry::ViewInformation2D aViewInformation2D(pManager->getCurrentViewInformation2D());
+ drawinglayer::processor2d::HitTestProcessor2D aHitTestProcessor2D(
+ aViewInformation2D,
+ rLogicPosition,
+ fLogicTolerance,
+ false);
- if(pCandidate->isHit(rPos, fTol))
+ for(; aStart != maVector.end(); aStart++)
{
- return sal_True;
+ sdr::overlay::OverlayObject* pCandidate = *aStart;
+ OSL_ENSURE(pCandidate, "Corrupt OverlayObjectList (!)");
+
+ if(pCandidate->isHittable())
+ {
+ const drawinglayer::primitive2d::Primitive2DSequence& rSequence = pCandidate->getOverlayObjectPrimitive2DSequence();
+
+ if(rSequence.hasElements())
+ {
+ aHitTestProcessor2D.process(rSequence);
+
+ if(aHitTestProcessor2D.getHit())
+ {
+ return true;
+ }
+ }
+ }
}
}
}
- return sal_False;
+ return false;
}
- sal_Bool OverlayObjectList::isHitPixel(const Point& rPos, sal_uInt32 nTol) const
+ bool OverlayObjectList::isHitPixel(const Point& rDiscretePosition, sal_uInt32 nDiscreteTolerance) const
{
if(maVector.size())
{
OverlayObjectVector::const_iterator aStart(maVector.begin());
- ::sdr::overlay::OverlayObject* pCandidate = *aStart;
+ sdr::overlay::OverlayObject* pCandidate = *aStart;
OverlayManager* pManager = pCandidate->getOverlayManager();
if(pManager)
{
- Point aPosLogic(pManager->getOutputDevice().PixelToLogic(rPos));
- Size aSizeLogic(pManager->getOutputDevice().PixelToLogic(Size(nTol, nTol)));
- basegfx::B2DPoint aPosition(aPosLogic.X(), aPosLogic.Y());
+ const Point aPosLogic(pManager->getOutputDevice().PixelToLogic(rDiscretePosition));
+ const basegfx::B2DPoint aPosition(aPosLogic.X(), aPosLogic.Y());
- return isHit(aPosition, (double)aSizeLogic.Width());
+ if(nDiscreteTolerance)
+ {
+ const Size aSizeLogic(pManager->getOutputDevice().PixelToLogic(Size(nDiscreteTolerance, nDiscreteTolerance)));
+ return isHitLogic(aPosition, (double)aSizeLogic.Width());
+ }
+ else
+ {
+ return isHitLogic(aPosition);
+ }
}
}
- return sal_False;
+ return false;
}
basegfx::B2DRange OverlayObjectList::getBaseRange() const
@@ -149,20 +180,6 @@ namespace sdr
return aRetval;
}
-
- void OverlayObjectList::transform(const basegfx::B2DHomMatrix& rMatrix)
- {
- if(!rMatrix.isIdentity() && maVector.size())
- {
- OverlayObjectVector::iterator aStart(maVector.begin());
-
- for(; aStart != maVector.end(); aStart++)
- {
- ::sdr::overlay::OverlayObject* pCandidate = *aStart;
- pCandidate->transform(rMatrix);
- }
- }
- }
} // end of namespace overlay
} // end of namespace sdr
diff --git a/svx/source/sdr/overlay/overlaypolypolygon.cxx b/svx/source/sdr/overlay/overlaypolypolygon.cxx
index 16890fa8a5..6827cd64cf 100644
--- a/svx/source/sdr/overlay/overlaypolypolygon.cxx
+++ b/svx/source/sdr/overlay/overlaypolypolygon.cxx
@@ -35,6 +35,8 @@
#include <vcl/outdev.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/polygon/b2dpolypolygontools.hxx>
+#include <svx/sdr/overlay/overlaymanager.hxx>
+#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -42,21 +44,33 @@ namespace sdr
{
namespace overlay
{
- void OverlayPolyPolygonStriped::drawGeometry(OutputDevice& rOutputDevice)
+ drawinglayer::primitive2d::Primitive2DSequence OverlayPolyPolygonStriped::createOverlayObjectPrimitive2DSequence()
{
- if(maPolyPolygon.count())
+ drawinglayer::primitive2d::Primitive2DSequence aRetval;
+
+ if(getOverlayManager())
{
- for(sal_uInt32 a(0L); a < maPolyPolygon.count(); a++)
- {
- ImpDrawPolygonStriped(rOutputDevice, maPolyPolygon.getB2DPolygon(a));
- }
+ const basegfx::BColor aRGBColorA(getOverlayManager()->getStripeColorA().getBColor());
+ const basegfx::BColor aRGBColorB(getOverlayManager()->getStripeColorB().getBColor());
+ const double fStripeLengthPixel(getOverlayManager()->getStripeLengthPixel());
+
+ const drawinglayer::primitive2d::Primitive2DReference aReference(
+ new drawinglayer::primitive2d::PolyPolygonMarkerPrimitive2D(
+ getPolyPolygon(),
+ aRGBColorA,
+ aRGBColorB,
+ fStripeLengthPixel));
+
+ aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aReference, 1);
}
+
+ return aRetval;
}
- void OverlayPolyPolygonStriped::createBaseRange(OutputDevice& /*rOutputDevice*/)
+ void OverlayPolyPolygonStriped::stripeDefinitionHasChanged()
{
- // use tooling to get range from PolyPolygon
- maBaseRange = basegfx::tools::getRange(maPolyPolygon);
+ // react on OverlayManager's stripe definition change
+ objectChange();
}
OverlayPolyPolygonStriped::OverlayPolyPolygonStriped(
@@ -81,67 +95,6 @@ namespace sdr
objectChange();
}
}
-
- sal_Bool OverlayPolyPolygonStriped::isHit(const basegfx::B2DPoint& rPos, double fTol) const
- {
- if(isHittable())
- {
- return basegfx::tools::isInEpsilonRange(maPolyPolygon, rPos, fTol);
- }
-
- return sal_False;
- }
-
- void OverlayPolyPolygonStriped::transform(const basegfx::B2DHomMatrix& rMatrix)
- {
- if(!rMatrix.isIdentity())
- {
- // transform maPolyPolygon
- maPolyPolygon.transform(rMatrix);
-
- // register change (after change)
- objectChange();
- }
- }
- } // end of namespace overlay
-} // end of namespace sdr
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace sdr
-{
- namespace overlay
- {
- void OverlayPolyPolygon::drawGeometry(OutputDevice& rOutputDevice)
- {
- if(maPolyPolygon.count())
- {
- rOutputDevice.SetLineColor(getBaseColor());
- rOutputDevice.SetFillColor();
-
- // iterate self, else the single polygons will be closed when
- // using DrawPolyPolygon
- for(sal_uInt32 a(0L); a < maPolyPolygon.count(); a++)
- {
- const Polygon aPaintPoly(maPolyPolygon.getB2DPolygon(a));
- rOutputDevice.DrawPolyLine(aPaintPoly);
- }
- }
- }
-
- OverlayPolyPolygon::OverlayPolyPolygon(
- const basegfx::B2DPolyPolygon& rPolyPolygon,
- Color aPolygonColor)
- : OverlayPolyPolygonStriped(rPolyPolygon)
- {
- // set base color here, OverlayCrosshairStriped constructor has set
- // it to it's own default.
- maBaseColor = aPolygonColor;
- }
-
- OverlayPolyPolygon::~OverlayPolyPolygon()
- {
- }
} // end of namespace overlay
} // end of namespace sdr
diff --git a/svx/source/sdr/overlay/overlayprimitive2dsequenceobject.cxx b/svx/source/sdr/overlay/overlayprimitive2dsequenceobject.cxx
index 6ceca0ff7a..d89a457a87 100644
--- a/svx/source/sdr/overlay/overlayprimitive2dsequenceobject.cxx
+++ b/svx/source/sdr/overlay/overlayprimitive2dsequenceobject.cxx
@@ -43,55 +43,9 @@ namespace sdr
{
namespace overlay
{
- void OverlayPrimitive2DSequenceObject::drawGeometry(OutputDevice& rOutputDevice)
+ drawinglayer::primitive2d::Primitive2DSequence OverlayPrimitive2DSequenceObject::createOverlayObjectPrimitive2DSequence()
{
- if(getOverlayManager())
- {
- // prepare ViewInformation2D
- const drawinglayer::geometry::ViewInformation2D aViewInformation2D(
- basegfx::B2DHomMatrix(),
- rOutputDevice.GetViewTransformation(),
- basegfx::B2DRange(),
- 0,
- 0.0,
- 0);
-
- // create processor
- drawinglayer::processor2d::BaseProcessor2D* pProcessor = ::sdr::contact::createBaseProcessor2DFromOutputDevice(
- rOutputDevice,
- aViewInformation2D);
-
- if(pProcessor)
- {
- pProcessor->process(getSequence());
-
- delete pProcessor;
- }
- }
- }
-
- void OverlayPrimitive2DSequenceObject::createBaseRange(OutputDevice& rOutputDevice)
- {
- const drawinglayer::geometry::ViewInformation2D aViewInformation2D(
- basegfx::B2DHomMatrix(),
- rOutputDevice.GetViewTransformation(),
- basegfx::B2DRange(),
- 0,
- 0.0,
- 0);
-
- maBaseRange = drawinglayer::primitive2d::getB2DRangeFromPrimitive2DSequence(
- getSequence(), aViewInformation2D);
- }
-
- sal_Bool OverlayPrimitive2DSequenceObject::isHit(const basegfx::B2DPoint& /*rPos*/, double /*fTol*/) const
- {
- if(isHittable())
- {
- return false;
- }
-
- return false;
+ return getSequence();
}
OverlayPrimitive2DSequenceObject::OverlayPrimitive2DSequenceObject(const drawinglayer::primitive2d::Primitive2DSequence& rSequence)
diff --git a/svx/source/sdr/overlay/overlayrollingrectangle.cxx b/svx/source/sdr/overlay/overlayrollingrectangle.cxx
index 8b862484d6..e2e079a37f 100644
--- a/svx/source/sdr/overlay/overlayrollingrectangle.cxx
+++ b/svx/source/sdr/overlay/overlayrollingrectangle.cxx
@@ -35,6 +35,11 @@
#include <vcl/salbtype.hxx>
#include <vcl/outdev.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <svx/sdr/overlay/overlaytools.hxx>
+#include <svx/sdr/overlay/overlaymanager.hxx>
+#include <basegfx/polygon/b2dpolygontools.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
+#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -42,65 +47,59 @@ namespace sdr
{
namespace overlay
{
- void OverlayRollingRectangleStriped::drawGeometry(OutputDevice& rOutputDevice)
+ drawinglayer::primitive2d::Primitive2DSequence OverlayRollingRectangleStriped::createOverlayObjectPrimitive2DSequence()
{
- const basegfx::B2DRange aRange(getBasePosition(), getSecondPosition());
+ drawinglayer::primitive2d::Primitive2DSequence aRetval;
- if(getShowBounds())
+ if(getOverlayManager() && (getShowBounds() || getExtendedLines()))
{
- ImpDrawRangeStriped(rOutputDevice, aRange);
- }
-
- if(getExtendedLines())
- {
- const Point aEmptyPoint;
- const Rectangle aVisiblePixel(aEmptyPoint, rOutputDevice.GetOutputSizePixel());
- const Rectangle aVisibleLogic(rOutputDevice.PixelToLogic(aVisiblePixel));
-
- // Left lines
- ImpDrawLineStriped(rOutputDevice, aVisibleLogic.Left(), aRange.getMinY(), aRange.getMinX(), aRange.getMinY());
- ImpDrawLineStriped(rOutputDevice, aVisibleLogic.Left(), aRange.getMaxY(), aRange.getMinX(), aRange.getMaxY());
-
- // Right lines
- ImpDrawLineStriped(rOutputDevice, aRange.getMaxX(), aRange.getMinY(), aVisibleLogic.Right(), aRange.getMinY());
- ImpDrawLineStriped(rOutputDevice, aRange.getMaxX(), aRange.getMaxY(), aVisibleLogic.Right(), aRange.getMaxY());
-
- // Top lines
- ImpDrawLineStriped(rOutputDevice, aRange.getMinX(), aVisibleLogic.Top(), aRange.getMinX(), aRange.getMinY());
- ImpDrawLineStriped(rOutputDevice, aRange.getMaxX(), aVisibleLogic.Top(), aRange.getMaxX(), aRange.getMinY());
+ const basegfx::BColor aRGBColorA(getOverlayManager()->getStripeColorA().getBColor());
+ const basegfx::BColor aRGBColorB(getOverlayManager()->getStripeColorB().getBColor());
+ const double fStripeLengthPixel(getOverlayManager()->getStripeLengthPixel());
+ const basegfx::B2DRange aRollingRectangle(getBasePosition(), getSecondPosition());
+
+ if(getShowBounds())
+ {
+ // view-independent part, create directly
+ const basegfx::B2DPolygon aPolygon(basegfx::tools::createPolygonFromRect(aRollingRectangle));
+ const drawinglayer::primitive2d::Primitive2DReference aReference(
+ new drawinglayer::primitive2d::PolygonMarkerPrimitive2D(
+ aPolygon,
+ aRGBColorA,
+ aRGBColorB,
+ fStripeLengthPixel));
+
+ drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, aReference);
+ }
- // Bottom lines
- ImpDrawLineStriped(rOutputDevice, aRange.getMinX(), aRange.getMaxY(), aRange.getMinX(), aVisibleLogic.Bottom());
- ImpDrawLineStriped(rOutputDevice, aRange.getMaxX(), aRange.getMaxY(), aRange.getMaxX(), aVisibleLogic.Bottom());
+ if(getExtendedLines())
+ {
+ // view-dependent part, use helper primitive
+ const drawinglayer::primitive2d::Primitive2DReference aReference(
+ new drawinglayer::primitive2d::OverlayRollingRectanglePrimitive(
+ aRollingRectangle,
+ aRGBColorA,
+ aRGBColorB,
+ fStripeLengthPixel));
+
+ drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, aReference);
+ }
}
+
+ return aRetval;
}
- void OverlayRollingRectangleStriped::createBaseRange(OutputDevice& rOutputDevice)
+ void OverlayRollingRectangleStriped::stripeDefinitionHasChanged()
{
- // reset range and expand it
- maBaseRange.reset();
-
- if(getExtendedLines())
- {
- const Point aEmptyPoint;
- const Rectangle aVisiblePixel(aEmptyPoint, rOutputDevice.GetOutputSizePixel());
- const Rectangle aVisibleLogic(rOutputDevice.PixelToLogic(aVisiblePixel));
- maBaseRange.expand(basegfx::B2DPoint(aVisibleLogic.Left(), aVisibleLogic.Top()));
- maBaseRange.expand(basegfx::B2DPoint(aVisibleLogic.Right(), aVisibleLogic.Bottom()));
- }
-
- if(getShowBounds())
- {
- maBaseRange.expand(getBasePosition());
- maBaseRange.expand(getSecondPosition());
- }
+ // react on OverlayManager's stripe definition change
+ objectChange();
}
OverlayRollingRectangleStriped::OverlayRollingRectangleStriped(
const basegfx::B2DPoint& rBasePos,
const basegfx::B2DPoint& rSecondPos,
- sal_Bool bExtendedLines,
- sal_Bool bShowBounds)
+ bool bExtendedLines,
+ bool bShowBounds)
: OverlayObjectWithBasePosition(rBasePos, Color(COL_BLACK)),
maSecondPosition(rSecondPos),
mbExtendedLines(bExtendedLines),
@@ -124,9 +123,9 @@ namespace sdr
}
}
- void OverlayRollingRectangleStriped::setExtendedLines(sal_Bool bNew)
+ void OverlayRollingRectangleStriped::setExtendedLines(bool bNew)
{
- if(bNew != mbExtendedLines)
+ if(bNew != (bool)mbExtendedLines)
{
// remember new value
mbExtendedLines = bNew;
@@ -136,9 +135,9 @@ namespace sdr
}
}
- void OverlayRollingRectangleStriped::setShowBounds(sal_Bool bNew)
+ void OverlayRollingRectangleStriped::setShowBounds(bool bNew)
{
- if(bNew != mbShowBounds)
+ if(bNew != (bool)mbShowBounds)
{
// remember new value
mbShowBounds = bNew;
@@ -147,138 +146,6 @@ namespace sdr
objectChange();
}
}
-
- sal_Bool OverlayRollingRectangleStriped::isHit(const basegfx::B2DPoint& rPos, double fTol) const
- {
- if(isHittable())
- {
- if(getExtendedLines())
- {
- const basegfx::B2DRange aRange(getBaseRange());
- const basegfx::B2DPoint aMinimum(aRange.getMinimum());
- const basegfx::B2DPoint aMaximum(aRange.getMaximum());
-
- // test upper line horizontal
- if(rPos.getY() > (aMinimum.getY() - fTol) && rPos.getY() < (aMinimum.getY() + fTol))
- {
- return sal_True;
- }
-
- // test lower line horizontal
- if(rPos.getY() > (aMaximum.getY() - fTol) && rPos.getY() < (aMaximum.getY() + fTol))
- {
- return sal_True;
- }
-
- // test left line vertical
- if(rPos.getX() > (aMinimum.getX() - fTol) && rPos.getX() < (aMinimum.getX() + fTol))
- {
- return sal_True;
- }
-
- // test rightline vertical
- if(rPos.getX() > (aMaximum.getX() - fTol) && rPos.getX() < (aMaximum.getX() + fTol))
- {
- return sal_True;
- }
- }
-
- if(getShowBounds())
- {
- // test for inside grown range, outside shrinked one to test for border
- // hit without interiour
- basegfx::B2DRange aOuterRange(getBaseRange());
- aOuterRange.grow(fTol);
-
- if(aOuterRange.isInside(rPos))
- {
- basegfx::B2DRange aInnerRange(getBaseRange());
- aInnerRange.grow(-fTol);
-
- return !aInnerRange.isInside(rPos);
- }
- }
- }
-
- return sal_False;
- }
-
- void OverlayRollingRectangleStriped::transform(const basegfx::B2DHomMatrix& rMatrix)
- {
- if(!rMatrix.isIdentity())
- {
- // transform base position
- OverlayObjectWithBasePosition::transform(rMatrix);
-
- // transform maSecondPosition
- const basegfx::B2DPoint aNewSecondPosition = rMatrix * getSecondPosition();
- setSecondPosition(aNewSecondPosition);
- }
- }
- } // end of namespace overlay
-} // end of namespace sdr
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace sdr
-{
- namespace overlay
- {
- void OverlayRollingRectangle::drawGeometry(OutputDevice& rOutputDevice)
- {
- const Point aStart(FRound(getBasePosition().getX()), FRound(getBasePosition().getY()));
- const Point aEnd(FRound(getSecondPosition().getX()), FRound(getSecondPosition().getY()));
- Rectangle aRectangle(aStart, aEnd);
- aRectangle.Justify();
-
- if(getShowBounds())
- {
- rOutputDevice.SetLineColor(getBaseColor());
- rOutputDevice.SetFillColor();
-
- rOutputDevice.DrawRect(aRectangle);
- }
-
- if(getExtendedLines())
- {
- const Point aEmptyPoint;
- const Rectangle aVisiblePixel(aEmptyPoint, rOutputDevice.GetOutputSizePixel());
- const Rectangle aVisibleLogic(rOutputDevice.PixelToLogic(aVisiblePixel));
-
- // Left lines
- rOutputDevice.DrawLine(Point(aVisibleLogic.Left(), aRectangle.Top()), aRectangle.TopLeft());
- rOutputDevice.DrawLine(Point(aVisibleLogic.Left(), aRectangle.Bottom()), aRectangle.BottomLeft());
-
- // Right lines
- rOutputDevice.DrawLine(aRectangle.TopRight(), Point(aVisibleLogic.Right(), aRectangle.Top()));
- rOutputDevice.DrawLine(aRectangle.BottomRight(), Point(aVisibleLogic.Right(), aRectangle.Bottom()));
-
- // Top lines
- rOutputDevice.DrawLine(Point(aRectangle.Left(), aVisibleLogic.Top()), aRectangle.TopLeft());
- rOutputDevice.DrawLine(Point(aRectangle.Right(), aVisibleLogic.Top()), aRectangle.TopRight());
-
- // Bottom lines
- rOutputDevice.DrawLine(aRectangle.BottomLeft(), Point(aRectangle.Left(), aVisibleLogic.Bottom()));
- rOutputDevice.DrawLine(aRectangle.BottomRight(), Point(aRectangle.Right(), aVisibleLogic.Bottom()));
- }
- }
-
- OverlayRollingRectangle::OverlayRollingRectangle(
- const basegfx::B2DPoint& rBasePos,
- const basegfx::B2DPoint& rSecondPos,
- Color aLineColor,
- sal_Bool bExtendedLines,
- sal_Bool bShowBounds)
- : OverlayRollingRectangleStriped(rBasePos, rSecondPos, bExtendedLines, bShowBounds)
- {
- // set base color here, OverlayCrosshairStriped constructor has set
- // it to it's own default.
- maBaseColor = aLineColor;
- }
-
- OverlayRollingRectangle::~OverlayRollingRectangle()
- {
- }
} // end of namespace overlay
} // end of namespace sdr
diff --git a/svx/source/sdr/overlay/overlaysdrobject.cxx b/svx/source/sdr/overlay/overlaysdrobject.cxx
deleted file mode 100644
index 70aedad836..0000000000
--- a/svx/source/sdr/overlay/overlaysdrobject.cxx
+++ /dev/null
@@ -1,87 +0,0 @@
-/*************************************************************************
- *
- * 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: overlaysdrobject.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.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-#include <svx/sdr/overlay/overlaysdrobject.hxx>
-#include <svx/svdobj.hxx>
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace sdr
-{
- namespace overlay
- {
- void OverlaySdrObject::drawGeometry(OutputDevice& rOutputDevice)
- {
- mrSdrObject.SingleObjectPainter(rOutputDevice);
- }
-
- void OverlaySdrObject::createBaseRange(OutputDevice& /*rOutputDevice*/)
- {
- // reset range and expand it
- maBaseRange.reset();
-
- // get BoundRect
- Rectangle aBoundRect(mrSdrObject.GetCurrentBoundRect());
- const basegfx::B2DPoint aTopLeft(aBoundRect.Left(), aBoundRect.Top());
- const basegfx::B2DPoint aBottomRight(aBoundRect.Right(), aBoundRect.Bottom());
-
- maBaseRange.expand(aTopLeft);
- maBaseRange.expand(aBottomRight);
- }
-
- OverlaySdrObject::OverlaySdrObject(
- const basegfx::B2DPoint& rBasePos,
- const SdrObject& rObject)
- : OverlayObjectWithBasePosition(rBasePos, Color(COL_BLACK)),
- mrSdrObject(rObject)
- {
- }
-
- OverlaySdrObject::~OverlaySdrObject()
- {
- }
-
- sal_Bool OverlaySdrObject::isHit(const basegfx::B2DPoint& rPos, double fTol) const
- {
- if(isHittable())
- {
- Point aPnt( (long)rPos.getX(), (long)rPos.getY() );
- return mrSdrObject.CheckHit(aPnt, (USHORT)fTol, 0) != 0 ? sal_True : sal_False;
- }
-
- return sal_False;
- }
- } // end of namespace overlay
-} // end of namespace sdr
-
-//////////////////////////////////////////////////////////////////////////////
-// eof
diff --git a/svx/source/sdr/overlay/overlayselection.cxx b/svx/source/sdr/overlay/overlayselection.cxx
new file mode 100644
index 0000000000..b60f1e66ce
--- /dev/null
+++ b/svx/source/sdr/overlay/overlayselection.cxx
@@ -0,0 +1,233 @@
+/*************************************************************************
+ *
+ * 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: overlayline.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.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_svx.hxx"
+#include <svx/sdr/overlay/overlayselection.hxx>
+#include <basegfx/polygon/b2dpolygontools.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
+#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
+#include <svtools/optionsdrawinglayer.hxx>
+#include <vcl/svapp.hxx>
+#include <vcl/outdev.hxx>
+#include <drawinglayer/primitive2d/invertprimitive2d.hxx>
+#include <drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx>
+#include <basegfx/polygon/b2dpolypolygoncutter.hxx>
+#include <svx/sdr/overlay/overlaymanager.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace overlay
+ {
+ // combine rages geometrically to a single, ORed polygon
+ basegfx::B2DPolyPolygon impCombineRangesToPolyPolygon(const std::vector< basegfx::B2DRange >& rRanges)
+ {
+ const sal_uInt32 nCount(rRanges.size());
+ basegfx::B2DPolyPolygon aRetval;
+
+ for(sal_uInt32 a(0); a < nCount; a++)
+ {
+ const basegfx::B2DPolygon aDiscretePolygon(basegfx::tools::createPolygonFromRect(rRanges[a]));
+
+ if(0 == a)
+ {
+ aRetval.append(aDiscretePolygon);
+ }
+ else
+ {
+ aRetval = basegfx::tools::solvePolygonOperationOr(aRetval, basegfx::B2DPolyPolygon(aDiscretePolygon));
+ }
+ }
+
+ return aRetval;
+ }
+
+ // check if wanted type OVERLAY_TRANSPARENT or OVERLAY_SOLID
+ // is possible. If not, fallback to invert mode (classic mode)
+ OverlayType impCheckPossibleOverlayType(OverlayType aOverlayType)
+ {
+ if(OVERLAY_INVERT != aOverlayType)
+ {
+ const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
+
+ if(!aSvtOptionsDrawinglayer.IsTransparentSelection())
+ {
+ // not possible when switched off by user
+ return OVERLAY_INVERT;
+ }
+ else
+ {
+ const OutputDevice *pOut = Application::GetDefaultDevice();
+
+ if(pOut->GetSettings().GetStyleSettings().GetHighContrastMode())
+ {
+ // not possible when in high contrast mode
+ return OVERLAY_INVERT;
+ }
+
+ if(!pOut->supportsOperation(OutDevSupport_TransparentRect))
+ {
+ // not possible when no fast transparence paint is supported on the system
+ return OVERLAY_INVERT;
+ }
+ }
+ }
+
+ return aOverlayType;
+ }
+
+ drawinglayer::primitive2d::Primitive2DSequence OverlaySelection::createOverlayObjectPrimitive2DSequence()
+ {
+ drawinglayer::primitive2d::Primitive2DSequence aRetval;
+ const sal_uInt32 nCount(getRanges().size());
+
+ if(nCount)
+ {
+ // create range primitives
+ const basegfx::BColor aRGBColor(getBaseColor().getBColor());
+ aRetval.realloc(nCount);
+
+ for(sal_uInt32 a(0);a < nCount; a++)
+ {
+ const basegfx::B2DPolygon aPolygon(basegfx::tools::createPolygonFromRect(maRanges[a]));
+ aRetval[a] = drawinglayer::primitive2d::Primitive2DReference(
+ new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D(
+ basegfx::B2DPolyPolygon(aPolygon),
+ aRGBColor));
+ }
+
+ if(OVERLAY_INVERT == maLastOverlayType)
+ {
+ // embed all in invert primitive
+ const drawinglayer::primitive2d::Primitive2DReference aInvert(
+ new drawinglayer::primitive2d::InvertPrimitive2D(
+ aRetval));
+ aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aInvert, 1);
+ }
+ else if(OVERLAY_TRANSPARENT == maLastOverlayType)
+ {
+ // embed all rectangles in transparent paint
+ const double fTransparence(mnLastTransparence / 100.0);
+ const drawinglayer::primitive2d::Primitive2DReference aUnifiedAlpha(
+ new drawinglayer::primitive2d::UnifiedAlphaPrimitive2D(
+ aRetval,
+ fTransparence));
+
+ if(getBorder())
+ {
+ const basegfx::B2DPolyPolygon aPolyPolygon(impCombineRangesToPolyPolygon(getRanges()));
+ const drawinglayer::primitive2d::Primitive2DReference aSelectionOutline(
+ new drawinglayer::primitive2d::PolyPolygonHairlinePrimitive2D(
+ aPolyPolygon,
+ aRGBColor));
+
+ // add both to result
+ aRetval.realloc(2);
+ aRetval[0] = aUnifiedAlpha;
+ aRetval[1] = aSelectionOutline;
+ }
+ else
+ {
+ // just add transparent part
+ aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aUnifiedAlpha, 1);
+ }
+ }
+ }
+
+ return aRetval;
+ }
+
+ OverlaySelection::OverlaySelection(
+ OverlayType eType,
+ const Color& rColor,
+ const std::vector< basegfx::B2DRange >& rRanges,
+ bool bBorder)
+ : OverlayObject(rColor),
+ meOverlayType(eType),
+ maRanges(rRanges),
+ maLastOverlayType(eType),
+ mnLastTransparence(0),
+ mbBorder(bBorder)
+ {
+ // no AA for selection overlays
+ allowAntiAliase(false);
+ }
+
+ OverlaySelection::~OverlaySelection()
+ {
+ if(getOverlayManager())
+ {
+ getOverlayManager()->remove(*this);
+ }
+ }
+
+ drawinglayer::primitive2d::Primitive2DSequence OverlaySelection::getOverlayObjectPrimitive2DSequence() const
+ {
+ // get current values
+ const OverlayType aNewOverlayType(impCheckPossibleOverlayType(meOverlayType));
+ const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
+ const sal_uInt16 nNewTransparence(aSvtOptionsDrawinglayer.GetTransparentSelectionPercent());
+
+ if(getPrimitive2DSequence().hasElements())
+ {
+ if(aNewOverlayType != maLastOverlayType
+ || nNewTransparence != mnLastTransparence)
+ {
+ // conditions of last local decomposition have changed, delete
+ const_cast< OverlaySelection* >(this)->setPrimitive2DSequence(drawinglayer::primitive2d::Primitive2DSequence());
+ }
+ }
+
+ if(!getPrimitive2DSequence().hasElements())
+ {
+ // remember new values
+ const_cast< OverlaySelection* >(this)->maLastOverlayType = aNewOverlayType;
+ const_cast< OverlaySelection* >(this)->mnLastTransparence = nNewTransparence;
+ }
+
+ // call base implementation
+ return OverlayObject::getOverlayObjectPrimitive2DSequence();
+ }
+
+ void OverlaySelection::setRanges(const std::vector< basegfx::B2DRange >& rNew)
+ {
+ if(rNew != maRanges)
+ {
+ maRanges = rNew;
+ objectChange();
+ }
+ }
+ } // end of namespace overlay
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/source/sdr/overlay/overlaytools.cxx b/svx/source/sdr/overlay/overlaytools.cxx
new file mode 100644
index 0000000000..ea20bd4f20
--- /dev/null
+++ b/svx/source/sdr/overlay/overlaytools.cxx
@@ -0,0 +1,498 @@
+/*************************************************************************
+ *
+ * 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: overlayobject.cxx,v $
+ * $Revision: 1.6 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_svx.hxx"
+
+#include <svx/sdr/overlay/overlaytools.hxx>
+#include <svx/sdr/primitive2d/svx_primitivetypes2d.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <drawinglayer/primitive2d/bitmapprimitive2d.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
+#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
+#include <basegfx/polygon/b2dpolygontools.hxx>
+#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
+#include <drawinglayer/geometry/viewinformation2d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ OverlayBitmapExPrimitive::OverlayBitmapExPrimitive(
+ const BitmapEx& rBitmapEx,
+ const basegfx::B2DPoint& rBasePosition,
+ sal_uInt16 nCenterX,
+ sal_uInt16 nCenterY)
+ : DiscreteMetricDependentPrimitive2D(),
+ maBitmapEx(rBitmapEx),
+ maBasePosition(rBasePosition),
+ mnCenterX(nCenterX),
+ mnCenterY(nCenterY)
+ {}
+
+ Primitive2DSequence OverlayBitmapExPrimitive::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ {
+ Primitive2DSequence aRetval;
+ const Size aBitmapSize(getBitmapEx().GetSizePixel());
+
+ if(aBitmapSize.Width() && aBitmapSize.Height() && basegfx::fTools::more(getDiscreteUnit(), 0.0))
+ {
+ // calculate back from internal bitmap's extreme coordinates (the edges)
+ // to logical coordinates. Only use a unified scaling value (getDiscreteUnit(),
+ // the prepared one which expresses how many logic units form a discrete unit)
+ // for this step. This primitive is to be displayed always unscaled (in it's pixel size)
+ // and unrotated, more like a marker
+ const double fLeft(((0.0 - getCenterX()) * getDiscreteUnit()) + getBasePosition().getX());
+ const double fTop(((0.0 - getCenterY()) * getDiscreteUnit()) + getBasePosition().getY());
+ const double fRight((((aBitmapSize.getWidth() - 1.0) - getCenterX()) * getDiscreteUnit()) + getBasePosition().getX());
+ const double fBottom((((aBitmapSize.getHeight() - 1.0) - getCenterY()) * getDiscreteUnit()) + getBasePosition().getY());
+
+ // create a BitmapPrimitive2D using those positions
+ basegfx::B2DHomMatrix aTransform;
+
+ aTransform.set(0, 0, fRight - fLeft);
+ aTransform.set(1, 1, fBottom - fTop);
+ aTransform.set(0, 2, fLeft);
+ aTransform.set(1, 2, fTop);
+
+ const Primitive2DReference aPrimitive(new BitmapPrimitive2D(getBitmapEx(), aTransform));
+ aRetval = Primitive2DSequence(&aPrimitive, 1);
+ }
+
+ return aRetval;
+ }
+
+ bool OverlayBitmapExPrimitive::operator==( const BasePrimitive2D& rPrimitive ) const
+ {
+ if(DiscreteMetricDependentPrimitive2D::operator==(rPrimitive))
+ {
+ const OverlayBitmapExPrimitive& rCompare = static_cast< const OverlayBitmapExPrimitive& >(rPrimitive);
+
+ return (getBitmapEx() == rCompare.getBitmapEx()
+ && getBasePosition() == rCompare.getBasePosition()
+ && getCenterX() == rCompare.getCenterX()
+ && getCenterY() == rCompare.getCenterY());
+ }
+
+ return false;
+ }
+
+ ImplPrimitrive2DIDBlock(OverlayBitmapExPrimitive, PRIMITIVE2D_ID_OVERLAYBITMAPEXPRIMITIVE)
+
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ OverlayCrosshairPrimitive::OverlayCrosshairPrimitive(
+ const basegfx::B2DPoint& rBasePosition,
+ const basegfx::BColor& rRGBColorA,
+ const basegfx::BColor& rRGBColorB,
+ double fDiscreteDashLength)
+ : ViewportDependentPrimitive2D(),
+ maBasePosition(rBasePosition),
+ maRGBColorA(rRGBColorA),
+ maRGBColorB(rRGBColorB),
+ mfDiscreteDashLength(fDiscreteDashLength)
+ {}
+
+ Primitive2DSequence OverlayCrosshairPrimitive::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ {
+ // use the prepared Viewport information accessible using getViewport()
+ Primitive2DSequence aRetval;
+
+ if(!getViewport().isEmpty())
+ {
+ aRetval.realloc(2);
+ basegfx::B2DPolygon aPolygon;
+
+ aPolygon.append(basegfx::B2DPoint(getViewport().getMinX(), getBasePosition().getY()));
+ aPolygon.append(basegfx::B2DPoint(getViewport().getMaxX(), getBasePosition().getY()));
+
+ aRetval[0] = Primitive2DReference(
+ new PolygonMarkerPrimitive2D(
+ aPolygon,
+ getRGBColorA(),
+ getRGBColorB(),
+ getDiscreteDashLength()));
+
+ aPolygon.clear();
+ aPolygon.append(basegfx::B2DPoint(getBasePosition().getX(), getViewport().getMinY()));
+ aPolygon.append(basegfx::B2DPoint(getBasePosition().getX(), getViewport().getMaxY()));
+
+ aRetval[1] = Primitive2DReference(
+ new PolygonMarkerPrimitive2D(
+ aPolygon,
+ getRGBColorA(),
+ getRGBColorB(),
+ getDiscreteDashLength()));
+ }
+
+ return aRetval;
+ }
+
+ bool OverlayCrosshairPrimitive::operator==( const BasePrimitive2D& rPrimitive ) const
+ {
+ if(ViewportDependentPrimitive2D::operator==(rPrimitive))
+ {
+ const OverlayCrosshairPrimitive& rCompare = static_cast< const OverlayCrosshairPrimitive& >(rPrimitive);
+
+ return (getBasePosition() == rCompare.getBasePosition()
+ && getRGBColorA() == rCompare.getRGBColorA()
+ && getRGBColorB() == rCompare.getRGBColorB()
+ && getDiscreteDashLength() == rCompare.getDiscreteDashLength());
+ }
+
+ return false;
+ }
+
+ ImplPrimitrive2DIDBlock(OverlayCrosshairPrimitive, PRIMITIVE2D_ID_OVERLAYCROSSHAIRPRIMITIVE)
+
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ OverlayHatchRectanglePrimitive::OverlayHatchRectanglePrimitive(
+ const basegfx::B2DRange& rObjectRange,
+ double fDiscreteHatchDistance,
+ double fHatchRotation,
+ const basegfx::BColor& rHatchColor,
+ double fDiscreteGrow,
+ double fDiscreteShrink,
+ double fRotation)
+ : DiscreteMetricDependentPrimitive2D(),
+ maObjectRange(rObjectRange),
+ mfDiscreteHatchDistance(fDiscreteHatchDistance),
+ mfHatchRotation(fHatchRotation),
+ maHatchColor(rHatchColor),
+ mfDiscreteGrow(fDiscreteGrow),
+ mfDiscreteShrink(fDiscreteShrink),
+ mfRotation(fRotation)
+ {}
+
+ Primitive2DSequence OverlayHatchRectanglePrimitive::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ {
+ Primitive2DSequence aRetval;
+
+ if(basegfx::fTools::more(getDiscreteUnit(), 0.0))
+ {
+ basegfx::B2DRange aInnerRange(getObjectRange());
+ basegfx::B2DRange aOuterRange(getObjectRange());
+ basegfx::B2DPolyPolygon aHatchPolyPolygon;
+
+ aOuterRange.grow(getDiscreteUnit() * getDiscreteGrow());
+ aInnerRange.grow(getDiscreteUnit() * -getDiscreteShrink());
+
+ aHatchPolyPolygon.append(basegfx::tools::createPolygonFromRect(aOuterRange));
+
+ if(!aInnerRange.isEmpty())
+ {
+ aHatchPolyPolygon.append(basegfx::tools::createPolygonFromRect(aInnerRange));
+ }
+
+ if(!basegfx::fTools::equalZero(getRotation()))
+ {
+ basegfx::B2DHomMatrix aTransform;
+
+ aTransform.translate(-getObjectRange().getMinX(), -getObjectRange().getMinY());
+ aTransform.rotate(getRotation());
+ aTransform.translate(getObjectRange().getMinX(), getObjectRange().getMinY());
+
+ aHatchPolyPolygon.transform(aTransform);
+ }
+
+ const basegfx::BColor aEmptyColor(0.0, 0.0, 0.0);
+ const drawinglayer::attribute::FillHatchAttribute aFillHatchAttribute(
+ drawinglayer::attribute::HATCHSTYLE_SINGLE,
+ getDiscreteHatchDistance() * getDiscreteUnit(),
+ getHatchRotation() - getRotation(),
+ getHatchColor(),
+ false);
+ const Primitive2DReference aPrimitive(
+ new PolyPolygonHatchPrimitive2D(
+ aHatchPolyPolygon,
+ aEmptyColor,
+ aFillHatchAttribute));
+
+ aRetval = Primitive2DSequence(&aPrimitive, 1);
+ }
+
+ return aRetval;
+ }
+
+ bool OverlayHatchRectanglePrimitive::operator==( const BasePrimitive2D& rPrimitive ) const
+ {
+ if(DiscreteMetricDependentPrimitive2D::operator==(rPrimitive))
+ {
+ const OverlayHatchRectanglePrimitive& rCompare = static_cast< const OverlayHatchRectanglePrimitive& >(rPrimitive);
+
+ return (getObjectRange() == rCompare.getObjectRange()
+ && getDiscreteHatchDistance() == rCompare.getDiscreteHatchDistance()
+ && getHatchRotation() == rCompare.getHatchRotation()
+ && getHatchColor() == rCompare.getHatchColor()
+ && getDiscreteGrow() == rCompare.getDiscreteGrow()
+ && getDiscreteShrink() == rCompare.getDiscreteShrink()
+ && getRotation() == rCompare.getRotation());
+ }
+
+ return false;
+ }
+
+ ImplPrimitrive2DIDBlock(OverlayHatchRectanglePrimitive, PRIMITIVE2D_ID_OVERLAYHATCHRECTANGLEPRIMITIVE)
+
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ OverlayHelplineStripedPrimitive::OverlayHelplineStripedPrimitive(
+ const basegfx::B2DPoint& rBasePosition,
+ HelplineStyle eStyle,
+ const basegfx::BColor& rRGBColorA,
+ const basegfx::BColor& rRGBColorB,
+ double fDiscreteDashLength)
+ : ViewportDependentPrimitive2D(),
+ maBasePosition(rBasePosition),
+ meStyle(eStyle),
+ maRGBColorA(rRGBColorA),
+ maRGBColorB(rRGBColorB),
+ mfDiscreteDashLength(fDiscreteDashLength)
+ {}
+
+ Primitive2DSequence OverlayHelplineStripedPrimitive::createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const
+ {
+ // use the prepared Viewport information accessible using getViewport()
+ Primitive2DSequence aRetval;
+
+ if(!getViewport().isEmpty())
+ {
+ switch(getStyle())
+ {
+ case HELPLINESTYLE_VERTICAL :
+ {
+ aRetval.realloc(1);
+ basegfx::B2DPolygon aLine;
+
+ aLine.append(basegfx::B2DPoint(getBasePosition().getX(), getViewport().getMinY()));
+ aLine.append(basegfx::B2DPoint(getBasePosition().getX(), getViewport().getMaxY()));
+
+ aRetval[0] = Primitive2DReference(
+ new PolygonMarkerPrimitive2D(
+ aLine,
+ getRGBColorA(),
+ getRGBColorB(),
+ getDiscreteDashLength()));
+ break;
+ }
+
+ case HELPLINESTYLE_HORIZONTAL :
+ {
+ aRetval.realloc(1);
+ basegfx::B2DPolygon aLine;
+
+ aLine.append(basegfx::B2DPoint(getViewport().getMinX(), getBasePosition().getY()));
+ aLine.append(basegfx::B2DPoint(getViewport().getMaxX(), getBasePosition().getY()));
+
+ aRetval[0] = Primitive2DReference(
+ new PolygonMarkerPrimitive2D(
+ aLine,
+ getRGBColorA(),
+ getRGBColorB(),
+ getDiscreteDashLength()));
+ break;
+ }
+
+ default: // case HELPLINESTYLE_POINT :
+ {
+ const double fDiscreteUnit((rViewInformation.getInverseObjectToViewTransformation() * basegfx::B2DVector(1.0, 0.0)).getLength());
+ aRetval.realloc(2);
+ basegfx::B2DPolygon aLineA, aLineB;
+
+ aLineA.append(basegfx::B2DPoint(getBasePosition().getX(), getBasePosition().getY() - fDiscreteUnit));
+ aLineA.append(basegfx::B2DPoint(getBasePosition().getX(), getBasePosition().getY() + fDiscreteUnit));
+
+ aRetval[0] = Primitive2DReference(
+ new PolygonMarkerPrimitive2D(
+ aLineA,
+ getRGBColorA(),
+ getRGBColorB(),
+ getDiscreteDashLength()));
+
+ aLineB.append(basegfx::B2DPoint(getBasePosition().getX() - fDiscreteUnit, getBasePosition().getY()));
+ aLineB.append(basegfx::B2DPoint(getBasePosition().getX() + fDiscreteUnit, getBasePosition().getY()));
+
+ aRetval[1] = Primitive2DReference(
+ new PolygonMarkerPrimitive2D(
+ aLineB,
+ getRGBColorA(),
+ getRGBColorB(),
+ getDiscreteDashLength()));
+
+ break;
+ }
+ }
+ }
+
+ return aRetval;
+ }
+
+ bool OverlayHelplineStripedPrimitive::operator==( const BasePrimitive2D& rPrimitive ) const
+ {
+ if(ViewportDependentPrimitive2D::operator==(rPrimitive))
+ {
+ const OverlayHelplineStripedPrimitive& rCompare = static_cast< const OverlayHelplineStripedPrimitive& >(rPrimitive);
+
+ return (getBasePosition() == rCompare.getBasePosition()
+ && getStyle() == rCompare.getStyle()
+ && getRGBColorA() == rCompare.getRGBColorA()
+ && getRGBColorB() == rCompare.getRGBColorB()
+ && getDiscreteDashLength() == rCompare.getDiscreteDashLength());
+ }
+
+ return false;
+ }
+
+ ImplPrimitrive2DIDBlock(OverlayHelplineStripedPrimitive, PRIMITIVE2D_ID_OVERLAYHELPLINESTRIPEDPRIMITIVE)
+
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ OverlayRollingRectanglePrimitive::OverlayRollingRectanglePrimitive(
+ const basegfx::B2DRange& aRollingRectangle,
+ const basegfx::BColor& rRGBColorA,
+ const basegfx::BColor& rRGBColorB,
+ double fDiscreteDashLength)
+ : ViewportDependentPrimitive2D(),
+ maRollingRectangle(aRollingRectangle),
+ maRGBColorA(rRGBColorA),
+ maRGBColorB(rRGBColorB),
+ mfDiscreteDashLength(fDiscreteDashLength)
+ {}
+
+ Primitive2DSequence OverlayRollingRectanglePrimitive::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ {
+ // use the prepared Viewport information accessible using getViewport()
+ Primitive2DSequence aRetval;
+
+ if(!getViewport().isEmpty())
+ {
+ basegfx::B2DPolygon aLine;
+ aRetval.realloc(8);
+
+ // Left lines
+ aLine.append(basegfx::B2DPoint(getViewport().getMinX(), getRollingRectangle().getMinY()));
+ aLine.append(basegfx::B2DPoint(getRollingRectangle().getMinX(), getRollingRectangle().getMinY()));
+ aRetval[0] = Primitive2DReference(new PolygonMarkerPrimitive2D(aLine, getRGBColorA(), getRGBColorB(), getDiscreteDashLength()));
+
+ aLine.clear();
+ aLine.append(basegfx::B2DPoint(getViewport().getMinX(), getRollingRectangle().getMaxY()));
+ aLine.append(basegfx::B2DPoint(getRollingRectangle().getMinX(), getRollingRectangle().getMaxY()));
+ aRetval[1] = Primitive2DReference(new PolygonMarkerPrimitive2D(aLine, getRGBColorA(), getRGBColorB(), getDiscreteDashLength()));
+
+ // Right lines
+ aLine.clear();
+ aLine.append(basegfx::B2DPoint(getRollingRectangle().getMaxX(), getRollingRectangle().getMinY()));
+ aLine.append(basegfx::B2DPoint(getViewport().getMaxX(), getRollingRectangle().getMinY()));
+ aRetval[2] = Primitive2DReference(new PolygonMarkerPrimitive2D(aLine, getRGBColorA(), getRGBColorB(), getDiscreteDashLength()));
+
+ aLine.clear();
+ aLine.append(basegfx::B2DPoint(getRollingRectangle().getMaxX(), getRollingRectangle().getMaxY()));
+ aLine.append(basegfx::B2DPoint(getViewport().getMaxX(), getRollingRectangle().getMaxY()));
+ aRetval[3] = Primitive2DReference(new PolygonMarkerPrimitive2D(aLine, getRGBColorA(), getRGBColorB(), getDiscreteDashLength()));
+
+ // Top lines
+ aLine.clear();
+ aLine.append(basegfx::B2DPoint(getRollingRectangle().getMinX(), getViewport().getMinY()));
+ aLine.append(basegfx::B2DPoint(getRollingRectangle().getMinX(), getRollingRectangle().getMinY()));
+ aRetval[4] = Primitive2DReference(new PolygonMarkerPrimitive2D(aLine, getRGBColorA(), getRGBColorB(), getDiscreteDashLength()));
+
+ aLine.clear();
+ aLine.append(basegfx::B2DPoint(getRollingRectangle().getMaxX(), getViewport().getMinY()));
+ aLine.append(basegfx::B2DPoint(getRollingRectangle().getMaxX(), getRollingRectangle().getMinY()));
+ aRetval[5] = Primitive2DReference(new PolygonMarkerPrimitive2D(aLine, getRGBColorA(), getRGBColorB(), getDiscreteDashLength()));
+
+ // Bottom lines
+ aLine.clear();
+ aLine.append(basegfx::B2DPoint(getRollingRectangle().getMinX(), getRollingRectangle().getMaxY()));
+ aLine.append(basegfx::B2DPoint(getRollingRectangle().getMinX(), getViewport().getMaxY()));
+ aRetval[6] = Primitive2DReference(new PolygonMarkerPrimitive2D(aLine, getRGBColorA(), getRGBColorB(), getDiscreteDashLength()));
+
+ aLine.clear();
+ aLine.append(basegfx::B2DPoint(getRollingRectangle().getMaxX(), getRollingRectangle().getMaxY()));
+ aLine.append(basegfx::B2DPoint(getRollingRectangle().getMaxX(), getViewport().getMaxY()));
+ aRetval[7] = Primitive2DReference(new PolygonMarkerPrimitive2D(aLine, getRGBColorA(), getRGBColorB(), getDiscreteDashLength()));
+ }
+
+ return aRetval;
+ }
+
+ bool OverlayRollingRectanglePrimitive::operator==( const BasePrimitive2D& rPrimitive ) const
+ {
+ if(ViewportDependentPrimitive2D::operator==(rPrimitive))
+ {
+ const OverlayRollingRectanglePrimitive& rCompare = static_cast< const OverlayRollingRectanglePrimitive& >(rPrimitive);
+
+ return (getRollingRectangle() == rCompare.getRollingRectangle()
+ && getRGBColorA() == rCompare.getRGBColorA()
+ && getRGBColorB() == rCompare.getRGBColorB()
+ && getDiscreteDashLength() == rCompare.getDiscreteDashLength());
+ }
+
+ return false;
+ }
+
+ ImplPrimitrive2DIDBlock(OverlayRollingRectanglePrimitive, PRIMITIVE2D_ID_OVERLAYROLLINGRECTANGLEPRIMITIVE)
+
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/source/sdr/overlay/overlaytriangle.cxx b/svx/source/sdr/overlay/overlaytriangle.cxx
index 715a27bfe0..f22c737166 100644
--- a/svx/source/sdr/overlay/overlaytriangle.cxx
+++ b/svx/source/sdr/overlay/overlaytriangle.cxx
@@ -37,6 +37,9 @@
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
+#include <svx/sdr/overlay/overlaymanager.hxx>
+#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
+#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -44,7 +47,7 @@ namespace sdr
{
namespace overlay
{
- void OverlayTriangleStriped::drawGeometry(OutputDevice& rOutputDevice)
+ drawinglayer::primitive2d::Primitive2DSequence OverlayTriangle::createOverlayObjectPrimitive2DSequence()
{
basegfx::B2DPolygon aPolygon;
@@ -52,34 +55,31 @@ namespace sdr
aPolygon.append(getSecondPosition());
aPolygon.append(getThirdPosition());
aPolygon.setClosed(true);
+
+ const drawinglayer::primitive2d::Primitive2DReference aReference(
+ new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D(
+ basegfx::B2DPolyPolygon(aPolygon),
+ getBaseColor().getBColor()));
- ImpDrawPolygonStriped(rOutputDevice, aPolygon);
+ return drawinglayer::primitive2d::Primitive2DSequence(&aReference, 1);
}
- void OverlayTriangleStriped::createBaseRange(OutputDevice& /*rOutputDevice*/)
- {
- // reset range and expand it
- maBaseRange.reset();
- maBaseRange.expand(getBasePosition());
- maBaseRange.expand(getSecondPosition());
- maBaseRange.expand(getThirdPosition());
- }
-
- OverlayTriangleStriped::OverlayTriangleStriped(
+ OverlayTriangle::OverlayTriangle(
const basegfx::B2DPoint& rBasePos,
const basegfx::B2DPoint& rSecondPos,
- const basegfx::B2DPoint& rThirdPos)
- : OverlayObjectWithBasePosition(rBasePos, Color(COL_BLACK)),
+ const basegfx::B2DPoint& rThirdPos,
+ Color aTriangleColor)
+ : OverlayObjectWithBasePosition(rBasePos, aTriangleColor),
maSecondPosition(rSecondPos),
maThirdPosition(rThirdPos)
{
}
- OverlayTriangleStriped::~OverlayTriangleStriped()
+ OverlayTriangle::~OverlayTriangle()
{
}
- void OverlayTriangleStriped::setSecondPosition(const basegfx::B2DPoint& rNew)
+ void OverlayTriangle::setSecondPosition(const basegfx::B2DPoint& rNew)
{
if(rNew != maSecondPosition)
{
@@ -91,7 +91,7 @@ namespace sdr
}
}
- void OverlayTriangleStriped::setThirdPosition(const basegfx::B2DPoint& rNew)
+ void OverlayTriangle::setThirdPosition(const basegfx::B2DPoint& rNew)
{
if(rNew != maThirdPosition)
{
@@ -102,96 +102,6 @@ namespace sdr
objectChange();
}
}
-
- sal_Bool OverlayTriangleStriped::isHit(const basegfx::B2DPoint& rPos, double fTol) const
- {
- if(isHittable())
- {
- // test with all lines and epsilon-range
- if(basegfx::tools::isInEpsilonRange(getBasePosition(), getThirdPosition(), rPos, fTol))
- {
- return sal_True;
- }
- else if(basegfx::tools::isInEpsilonRange(getSecondPosition(), getBasePosition(), rPos, fTol))
- {
- return sal_True;
- }
- else if(basegfx::tools::isInEpsilonRange(getThirdPosition(), getSecondPosition(), rPos, fTol))
- {
- return sal_True;
- }
-
- // test if inside triangle
- basegfx::B2DPolygon aTestPoly;
- aTestPoly.append(getBasePosition());
- aTestPoly.append(getSecondPosition());
- aTestPoly.append(getThirdPosition());
- aTestPoly.setClosed(true);
-
- return basegfx::tools::isInside(aTestPoly, rPos);
- }
-
- return sal_False;
- }
-
- void OverlayTriangleStriped::transform(const basegfx::B2DHomMatrix& rMatrix)
- {
- if(!rMatrix.isIdentity())
- {
- // transform base position
- OverlayObjectWithBasePosition::transform(rMatrix);
-
- // transform maSecondPosition
- const basegfx::B2DPoint aNewSecondPosition = rMatrix * getSecondPosition();
- setSecondPosition(aNewSecondPosition);
-
- // transform maThirdPosition
- const basegfx::B2DPoint aNewThirdPosition = rMatrix * getThirdPosition();
- setThirdPosition(aNewThirdPosition);
- }
- }
- } // end of namespace overlay
-} // end of namespace sdr
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace sdr
-{
- namespace overlay
- {
- void OverlayTriangle::drawGeometry(OutputDevice& rOutputDevice)
- {
- Polygon aPolygon(4);
- Point aPosition(FRound(getBasePosition().getX()), FRound(getBasePosition().getY()));
- aPolygon[0] = aPolygon[3] = aPosition;
- aPosition.X() = FRound(getSecondPosition().getX());
- aPosition.Y() = FRound(getSecondPosition().getY());
- aPolygon[1] = aPosition;
- aPosition.X() = FRound(getThirdPosition().getX());
- aPosition.Y() = FRound(getThirdPosition().getY());
- aPolygon[2] = aPosition;
-
- rOutputDevice.SetLineColor();
- rOutputDevice.SetFillColor(getBaseColor());
-
- rOutputDevice.DrawPolygon(aPolygon);
- }
-
- OverlayTriangle::OverlayTriangle(
- const basegfx::B2DPoint& rBasePos,
- const basegfx::B2DPoint& rSecondPos,
- const basegfx::B2DPoint& rThirdPos,
- Color aTriangleColor)
- : OverlayTriangleStriped(rBasePos, rSecondPos, rThirdPos)
- {
- // set base color here, OverlayCrosshairStriped constructor has set
- // it to it's own default.
- maBaseColor = aTriangleColor;
- }
-
- OverlayTriangle::~OverlayTriangle()
- {
- }
} // end of namespace overlay
} // end of namespace sdr
diff --git a/svx/source/sdr/primitive2d/makefile.mk b/svx/source/sdr/primitive2d/makefile.mk
index e9e976d434..7510b6a23b 100644
--- a/svx/source/sdr/primitive2d/makefile.mk
+++ b/svx/source/sdr/primitive2d/makefile.mk
@@ -51,6 +51,7 @@ SLOFILES=\
$(SLO)$/sdrcaptionprimitive2d.obj \
$(SLO)$/sdrgrafprimitive2d.obj \
$(SLO)$/sdrole2primitive2d.obj \
+ $(SLO)$/sdrolecontentprimitive2d.obj \
$(SLO)$/sdrpathprimitive2d.obj \
$(SLO)$/sdrprimitivetools.obj \
$(SLO)$/sdrmeasureprimitive2d.obj \
diff --git a/svx/source/sdr/primitive2d/sdrattributecreator.cxx b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
index c617fde61b..6669912886 100644
--- a/svx/source/sdr/primitive2d/sdrattributecreator.cxx
+++ b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
@@ -473,7 +473,14 @@ namespace drawinglayer
return pRetval;
}
- attribute::SdrTextAttribute* createNewSdrTextAttribute(const SfxItemSet& rSet, const SdrText& rText)
+ // #i101508# Support handing over given text-to-border distances
+ attribute::SdrTextAttribute* createNewSdrTextAttribute(
+ const SfxItemSet& rSet,
+ const SdrText& rText,
+ const sal_Int32* pLeft,
+ const sal_Int32* pUpper,
+ const sal_Int32* pRight,
+ const sal_Int32* pLower)
{
attribute::SdrTextAttribute* pRetval(0);
const SdrTextObj& rTextObj = rText.GetObject();
@@ -519,10 +526,10 @@ namespace drawinglayer
rText,
aOutlinerParaObject,
((const XFormTextStyleItem&)rSet.Get(XATTR_FORMTXTSTYLE)).GetValue(),
- rTextObj.GetTextLeftDistance(),
- rTextObj.GetTextUpperDistance(),
- rTextObj.GetTextRightDistance(),
- rTextObj.GetTextLowerDistance(),
+ pLeft ? *pLeft : rTextObj.GetTextLeftDistance(),
+ pUpper ? *pUpper : rTextObj.GetTextUpperDistance(),
+ pRight ? *pRight : rTextObj.GetTextRightDistance(),
+ pLower ? *pLower : rTextObj.GetTextLowerDistance(),
((const SdrTextContourFrameItem&)rSet.Get(SDRATTR_TEXT_CONTOURFRAME)).GetValue(),
(SDRTEXTFIT_PROPORTIONAL == eFit || SDRTEXTFIT_ALLLINES == eFit),
((const XFormTextHideFormItem&)rSet.Get(XATTR_FORMTXTHIDEFORM)).GetValue(),
@@ -591,10 +598,18 @@ namespace drawinglayer
if(aBitmap.GetPrefMapMode() != aDestinationMapUnit)
{
- // #i96237# need to use LogicToLogic, source is not always pixels
- aBitmap.SetPrefSize(Application::GetDefaultDevice()->LogicToLogic(
- aBitmap.GetPrefSize(), aBitmap.GetPrefMapMode(), aDestinationMapUnit));
- aBitmap.SetPrefMapMode(aDestinationMapUnit);
+ // #i100360# for MAP_PIXEL, LogicToLogic will not work properly,
+ // so fallback to Application::GetDefaultDevice()
+ if(MAP_PIXEL == aBitmap.GetPrefMapMode().GetMapUnit())
+ {
+ aBitmap.SetPrefSize(Application::GetDefaultDevice()->PixelToLogic(
+ aBitmap.GetPrefSize(), aDestinationMapUnit));
+ }
+ else
+ {
+ aBitmap.SetPrefSize(OutputDevice::LogicToLogic(
+ aBitmap.GetPrefSize(), aBitmap.GetPrefMapMode(), aDestinationMapUnit));
+ }
}
// get size
@@ -665,7 +680,7 @@ namespace drawinglayer
// when object has text and text is fontwork and hide contour is set for fontwork, force
// line and fill style to empty
- if(pText && pText->isFontwork() && pText->isHideContour())
+ if(pText && pText->getSdrFormTextAttribute() && pText->isHideContour())
{
bFontworkHideContour = true;
}
@@ -730,7 +745,7 @@ namespace drawinglayer
// when object has text and text is fontwork and hide contour is set for fontwork, force
// line and fill style to empty
- if(pText && pText->isFontwork() && pText->isHideContour())
+ if(pText && pText->getSdrFormTextAttribute() && pText->isHideContour())
{
bFontworkHideContour = true;
}
@@ -1023,7 +1038,14 @@ namespace drawinglayer
}
}
- attribute::SdrFillTextAttribute* createNewSdrFillTextAttribute(const SfxItemSet& rSet, const SdrText* pSdrText)
+ // #i101508# Support handing over given text-to-border distances
+ attribute::SdrFillTextAttribute* createNewSdrFillTextAttribute(
+ const SfxItemSet& rSet,
+ const SdrText* pSdrText,
+ const sal_Int32* pLeft,
+ const sal_Int32* pUpper,
+ const sal_Int32* pRight,
+ const sal_Int32* pLower)
{
attribute::SdrFillTextAttribute* pRetval(0L);
attribute::SdrFillAttribute* pFill(0L);
@@ -1034,12 +1056,12 @@ namespace drawinglayer
// look for text first
if(pSdrText)
{
- pText = createNewSdrTextAttribute(rSet, *pSdrText);
+ pText = createNewSdrTextAttribute(rSet, *pSdrText, pLeft, pUpper, pRight, pLower);
}
// when object has text and text is fontwork and hide contour is set for fontwork, force
// fill style to empty
- if(pText && pText->isFontwork() && pText->isHideContour())
+ if(pText && pText->getSdrFormTextAttribute() && pText->isHideContour())
{
bFontworkHideContour = true;
}
diff --git a/svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx
index 855fafe223..bde6bb4cd6 100644
--- a/svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx
@@ -50,62 +50,95 @@ namespace drawinglayer
Primitive2DSequence SdrCaptionPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const
{
Primitive2DSequence aRetval;
+ Primitive2DSequence aHitTestContent;
// create unit outline polygon
- ::basegfx::B2DPolygon aUnitOutline(::basegfx::tools::createPolygonFromRect(::basegfx::B2DRange(0.0, 0.0, 1.0, 1.0), getCornerRadiusX(), getCornerRadiusY()));
+ const basegfx::B2DPolygon aUnitOutline(basegfx::tools::createPolygonFromRect(
+ basegfx::B2DRange(0.0, 0.0, 1.0, 1.0),
+ getCornerRadiusX(),
+ getCornerRadiusY()));
// add fill
if(getSdrLFSTAttribute().getFill())
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolyPolygonFillPrimitive(::basegfx::B2DPolyPolygon(aUnitOutline), getTransform(), *getSdrLFSTAttribute().getFill(), getSdrLFSTAttribute().getFillFloatTransGradient()));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createPolyPolygonFillPrimitive(
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTransform(),
+ *getSdrLFSTAttribute().getFill(),
+ getSdrLFSTAttribute().getFillFloatTransGradient()));
+ }
+ else
+ {
+ // if no fill, create one for HitTest and BoundRect fallback
+ appendPrimitive2DReferenceToPrimitive2DSequence(aHitTestContent,
+ createPolyPolygonFillPrimitive(
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTransform(),
+ attribute::SdrFillAttribute(0.0, basegfx::BColor(0.0, 0.0, 0.0)),
+ getSdrLFSTAttribute().getFillFloatTransGradient()));
}
// add line
if(getSdrLFSTAttribute().getLine())
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolygonLinePrimitive(aUnitOutline, getTransform(), *getSdrLFSTAttribute().getLine()));
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolygonLinePrimitive(getTail(), getTransform(), *getSdrLFSTAttribute().getLine(), getSdrLFSTAttribute().getLineStartEnd()));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createPolygonLinePrimitive(
+ aUnitOutline,
+ getTransform(),
+ *getSdrLFSTAttribute().getLine()));
+
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createPolygonLinePrimitive(
+ getTail(),
+ getTransform(),
+ *getSdrLFSTAttribute().getLine(),
+ getSdrLFSTAttribute().getLineStartEnd()));
}
else
{
- // if initially no line is defined, create one for HitTest and BoundRect
- Primitive2DSequence aLineSequence(2);
- const attribute::SdrLineAttribute aBlackHairline(basegfx::BColor(0.0, 0.0, 0.0));
+ // if initially no line is defined, create one for HitTest and BoundRect. It
+ // is sufficient to use the tail; the body is already ensured with fill creation
+ appendPrimitive2DReferenceToPrimitive2DSequence(aHitTestContent,
+ createPolygonLinePrimitive(
+ getTail(),
+ getTransform(),
+ attribute::SdrLineAttribute(basegfx::BColor(0.0, 0.0, 0.0))));
+ }
- aLineSequence[0] = createPolygonLinePrimitive(aUnitOutline, getTransform(), aBlackHairline);
- aLineSequence[1] = createPolygonLinePrimitive(getTail(), getTransform(), aBlackHairline);
-
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, Primitive2DReference(new HitTestPrimitive2D(aLineSequence)));
+ // add HitTest and BoundRect helper geometry (if exists)
+ if(aHitTestContent.hasElements())
+ {
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ Primitive2DReference(new HitTestPrimitive2D(aHitTestContent)));
}
// add text
if(getSdrLFSTAttribute().getText())
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(::basegfx::B2DPolyPolygon(aUnitOutline), getTransform(), *getSdrLFSTAttribute().getText(), getSdrLFSTAttribute().getLine(), false, false));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createTextPrimitive(
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTransform(),
+ *getSdrLFSTAttribute().getText(),
+ getSdrLFSTAttribute().getLine(),
+ false,
+ false));
}
// add shadow
if(getSdrLFSTAttribute().getShadow())
{
- // attention: shadow is added BEFORE object stuff to render it BEHIND object (!)
- const Primitive2DReference xShadow(createShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow()));
-
- if(xShadow.is())
- {
- Primitive2DSequence aContentWithShadow(2L);
- aContentWithShadow[0L] = xShadow;
- aContentWithShadow[1L] = Primitive2DReference(new GroupPrimitive2D(aRetval));
- aRetval = aContentWithShadow;
- }
+ aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow());
}
return aRetval;
}
SdrCaptionPrimitive2D::SdrCaptionPrimitive2D(
- const ::basegfx::B2DHomMatrix& rTransform,
+ const basegfx::B2DHomMatrix& rTransform,
const attribute::SdrLineFillShadowTextAttribute& rSdrLFSTAttribute,
- const ::basegfx::B2DPolygon& rTail,
+ const basegfx::B2DPolygon& rTail,
double fCornerRadiusX,
double fCornerRadiusY)
: BasePrimitive2D(),
@@ -118,7 +151,7 @@ namespace drawinglayer
// transform maTail to unit polygon
if(getTail().count())
{
- ::basegfx::B2DHomMatrix aInverse(getTransform());
+ basegfx::B2DHomMatrix aInverse(getTransform());
aInverse.invert();
maTail.transform(aInverse);
}
diff --git a/svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx
index 13da3dcca7..58745f87ad 100644
--- a/svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx
@@ -78,15 +78,7 @@ namespace drawinglayer
// add shadow
if(getSdrLSTAttribute().getShadow())
{
- const Primitive2DReference xShadow(createShadowPrimitive(aRetval, *getSdrLSTAttribute().getShadow()));
-
- if(xShadow.is())
- {
- Primitive2DSequence aContentWithShadow(2L);
- aContentWithShadow[0L] = xShadow;
- aContentWithShadow[1L] = Primitive2DReference(new GroupPrimitive2D(aRetval));
- aRetval = aContentWithShadow;
- }
+ aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLSTAttribute().getShadow());
}
return aRetval;
diff --git a/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx
index 7a03bd2f2d..926967314a 100644
--- a/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx
@@ -60,18 +60,9 @@ namespace drawinglayer
}
// add shadow
- if(getSdrSTAttribute().getShadow())
+ if(aRetval.hasElements() && getSdrSTAttribute().getShadow())
{
- // attention: shadow is added BEFORE object stuff to render it BEHIND object (!)
- const Primitive2DReference xShadow(createShadowPrimitive(aRetval, *getSdrSTAttribute().getShadow()));
-
- if(xShadow.is())
- {
- Primitive2DSequence aContentWithShadow(2L);
- aContentWithShadow[0L] = xShadow;
- aContentWithShadow[1L] = Primitive2DReference(new GroupPrimitive2D(aRetval));
- aRetval = aContentWithShadow;
- }
+ aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrSTAttribute().getShadow());
}
return aRetval;
diff --git a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
index 39157f5b7f..11ace8b8f5 100644
--- a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
+++ b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
@@ -67,13 +67,13 @@ namespace drawinglayer
namespace primitive2d
{
Primitive2DReference createPolyPolygonFillPrimitive(
- const ::basegfx::B2DPolyPolygon& rUnitPolyPolygon,
- const ::basegfx::B2DHomMatrix& rObjectTransform,
+ const basegfx::B2DPolyPolygon& rUnitPolyPolygon,
+ const basegfx::B2DHomMatrix& rObjectTransform,
const attribute::SdrFillAttribute& rFill,
const attribute::FillGradientAttribute* pFillGradient)
{
// prepare fully scaled polygon
- ::basegfx::B2DPolyPolygon aScaledPolyPolygon(rUnitPolyPolygon);
+ basegfx::B2DPolyPolygon aScaledPolyPolygon(rUnitPolyPolygon);
aScaledPolyPolygon.transform(rObjectTransform);
BasePrimitive2D* pNewFillPrimitive = 0L;
@@ -87,7 +87,7 @@ namespace drawinglayer
}
else if(rFill.isBitmap())
{
- const ::basegfx::B2DRange aRange(::basegfx::tools::getRange(aScaledPolyPolygon));
+ const basegfx::B2DRange aRange(basegfx::tools::getRange(aScaledPolyPolygon));
pNewFillPrimitive = new PolyPolygonBitmapPrimitive2D(aScaledPolyPolygon, rFill.getColor(), rFill.getBitmap()->getFillBitmapAttribute(aRange));
}
else
@@ -110,7 +110,7 @@ namespace drawinglayer
// create FillGradientPrimitive2D for transparence and add to new sequence
// fillGradientPrimitive is enough here (compared to PolyPolygonGradientPrimitive2D) since float transparence will be masked anyways
- const ::basegfx::B2DRange aRange(::basegfx::tools::getRange(aScaledPolyPolygon));
+ const basegfx::B2DRange aRange(basegfx::tools::getRange(aScaledPolyPolygon));
const Primitive2DReference xRefB(new FillGradientPrimitive2D(aRange, *pFillGradient));
const Primitive2DSequence aAlpha(&xRefB, 1L);
@@ -125,13 +125,13 @@ namespace drawinglayer
}
Primitive2DReference createPolygonLinePrimitive(
- const ::basegfx::B2DPolygon& rUnitPolygon,
- const ::basegfx::B2DHomMatrix& rObjectTransform,
+ const basegfx::B2DPolygon& rUnitPolygon,
+ const basegfx::B2DHomMatrix& rObjectTransform,
const attribute::SdrLineAttribute& rLine,
const attribute::SdrLineStartEndAttribute* pStroke)
{
// prepare fully scaled polygon
- ::basegfx::B2DPolygon aScaledPolygon(rUnitPolygon);
+ basegfx::B2DPolygon aScaledPolygon(rUnitPolygon);
aScaledPolygon.transform(rObjectTransform);
// create line and stroke attribute
@@ -168,15 +168,15 @@ namespace drawinglayer
}
Primitive2DReference createTextPrimitive(
- const ::basegfx::B2DPolyPolygon& rUnitPolyPolygon,
- const ::basegfx::B2DHomMatrix& rObjectTransform,
+ const basegfx::B2DPolyPolygon& rUnitPolyPolygon,
+ const basegfx::B2DHomMatrix& rObjectTransform,
const attribute::SdrTextAttribute& rText,
const attribute::SdrLineAttribute* pStroke,
bool bCellText,
bool bWordWrap)
{
- ::basegfx::B2DHomMatrix aAnchorTransform(rObjectTransform);
- SdrTextPrimitive2D* pNew = 0L;
+ basegfx::B2DHomMatrix aAnchorTransform(rObjectTransform);
+ SdrTextPrimitive2D* pNew = 0;
if(rText.isContour())
{
@@ -185,20 +185,20 @@ namespace drawinglayer
{
// take line width into account and shrink contour polygon accordingly
// decompose to get scale
- ::basegfx::B2DVector aScale, aTranslate;
+ basegfx::B2DVector aScale, aTranslate;
double fRotate, fShearX;
rObjectTransform.decompose(aScale, aTranslate, fRotate, fShearX);
// scale outline to object's size to allow growing with value relative to that size
// and also to keep aspect ratio
- ::basegfx::B2DHomMatrix aScaleTransform;
+ basegfx::B2DHomMatrix aScaleTransform;
aScaleTransform.set(0, 0, fabs(aScale.getX()));
aScaleTransform.set(1, 1, fabs(aScale.getY()));
- ::basegfx::B2DPolyPolygon aScaledUnitPolyPolygon(rUnitPolyPolygon);
+ basegfx::B2DPolyPolygon aScaledUnitPolyPolygon(rUnitPolyPolygon);
aScaledUnitPolyPolygon.transform(aScaleTransform);
// grow the polygon. To shrink, use negative value (half width)
- aScaledUnitPolyPolygon = ::basegfx::tools::growInNormalDirection(aScaledUnitPolyPolygon, -(pStroke->getWidth() * 0.5));
+ aScaledUnitPolyPolygon = basegfx::tools::growInNormalDirection(aScaledUnitPolyPolygon, -(pStroke->getWidth() * 0.5));
// scale back to unit polygon
aScaleTransform.set(0, 0, 0.0 != aScale.getX() ? 1.0 / aScale.getX() : 1.0);
@@ -206,48 +206,60 @@ namespace drawinglayer
aScaledUnitPolyPolygon.transform(aScaleTransform);
// create with unit polygon
- pNew = new SdrContourTextPrimitive2D(rText.getSdrText(), rText.getOutlinerParaObject(), aScaledUnitPolyPolygon, rObjectTransform);
+ pNew = new SdrContourTextPrimitive2D(
+ &rText.getSdrText(),
+ rText.getOutlinerParaObject(),
+ aScaledUnitPolyPolygon,
+ rObjectTransform);
}
else
{
// create with unit polygon
- pNew = new SdrContourTextPrimitive2D(rText.getSdrText(), rText.getOutlinerParaObject(), rUnitPolyPolygon, rObjectTransform);
+ pNew = new SdrContourTextPrimitive2D(
+ &rText.getSdrText(),
+ rText.getOutlinerParaObject(),
+ rUnitPolyPolygon,
+ rObjectTransform);
}
}
- else if(rText.isFontwork() && !rText.isScroll())
+ else if(rText.getSdrFormTextAttribute())
{
- // text on path, use scaled polygon. Not allowed when text scrolling is used.
- ::basegfx::B2DPolyPolygon aScaledPolyPolygon(rUnitPolyPolygon);
+ // text on path, use scaled polygon
+ basegfx::B2DPolyPolygon aScaledPolyPolygon(rUnitPolyPolygon);
aScaledPolyPolygon.transform(rObjectTransform);
- pNew = new SdrPathTextPrimitive2D(rText.getSdrText(), rText.getOutlinerParaObject(), aScaledPolyPolygon);
+ pNew = new SdrPathTextPrimitive2D(
+ &rText.getSdrText(),
+ rText.getOutlinerParaObject(),
+ aScaledPolyPolygon,
+ *rText.getSdrFormTextAttribute());
}
else
{
// rObjectTransform is the whole SdrObject transformation from unit rectangle
// to it's size and position. Decompose to allow working with single values.
- ::basegfx::B2DVector aScale, aTranslate;
+ basegfx::B2DVector aScale, aTranslate;
double fRotate, fShearX;
rObjectTransform.decompose(aScale, aTranslate, fRotate, fShearX);
// extract mirroring
- const bool bMirrorX(::basegfx::fTools::less(aScale.getX(), 0.0));
- const bool bMirrorY(::basegfx::fTools::less(aScale.getY(), 0.0));
+ const bool bMirrorX(basegfx::fTools::less(aScale.getX(), 0.0));
+ const bool bMirrorY(basegfx::fTools::less(aScale.getY(), 0.0));
aScale = basegfx::absolute(aScale);
// Get the real size, since polygon ountline and scale
// from the object transformation may vary (e.g. ellipse segments)
- ::basegfx::B2DHomMatrix aJustScaleTransform;
+ basegfx::B2DHomMatrix aJustScaleTransform;
aJustScaleTransform.set(0, 0, aScale.getX());
aJustScaleTransform.set(1, 1, aScale.getY());
- ::basegfx::B2DPolyPolygon aScaledUnitPolyPolygon(rUnitPolyPolygon);
+ basegfx::B2DPolyPolygon aScaledUnitPolyPolygon(rUnitPolyPolygon);
aScaledUnitPolyPolygon.transform(aJustScaleTransform);
- const ::basegfx::B2DRange aSnapRange(::basegfx::tools::getRange(aScaledUnitPolyPolygon));
+ const basegfx::B2DRange aSnapRange(basegfx::tools::getRange(aScaledUnitPolyPolygon));
// create a range describing the wanted text position and size (aTextAnchorRange). This
// means to use the text distance values here
- const ::basegfx::B2DPoint aTopLeft(aSnapRange.getMinX() + rText.getTextLeftDistance(), aSnapRange.getMinY() + rText.getTextUpperDistance());
- const ::basegfx::B2DPoint aBottomRight(aSnapRange.getMaxX() - rText.getTextRightDistance(), aSnapRange.getMaxY() - rText.getTextLowerDistance());
- ::basegfx::B2DRange aTextAnchorRange;
+ const basegfx::B2DPoint aTopLeft(aSnapRange.getMinX() + rText.getTextLeftDistance(), aSnapRange.getMinY() + rText.getTextUpperDistance());
+ const basegfx::B2DPoint aBottomRight(aSnapRange.getMaxX() - rText.getTextRightDistance(), aSnapRange.getMaxY() - rText.getTextLowerDistance());
+ basegfx::B2DRange aTextAnchorRange;
aTextAnchorRange.expand(aTopLeft);
aTextAnchorRange.expand(aBottomRight);
@@ -267,12 +279,21 @@ namespace drawinglayer
if(rText.isFitToSize())
{
// streched text in range
- pNew = new SdrStretchTextPrimitive2D(rText.getSdrText(), rText.getOutlinerParaObject(), aAnchorTransform);
+ pNew = new SdrStretchTextPrimitive2D(
+ &rText.getSdrText(),
+ rText.getOutlinerParaObject(),
+ aAnchorTransform);
}
else // text in range
{
// build new primitive
- pNew = new SdrBlockTextPrimitive2D(rText.getSdrText(), rText.getOutlinerParaObject(), aAnchorTransform, rText.isScroll(), bCellText, bWordWrap);
+ pNew = new SdrBlockTextPrimitive2D(
+ &rText.getSdrText(),
+ rText.getOutlinerParaObject(),
+ aAnchorTransform,
+ rText.isScroll(),
+ bCellText,
+ bWordWrap);
}
}
@@ -299,154 +320,164 @@ namespace drawinglayer
return Primitive2DReference(pNew);
}
}
- else if(rText.isScroll())
+
+ if(rText.isScroll())
{
- // get scroll direction
- const SdrTextAniDirection eDirection(rText.getSdrText().GetObject().GetTextAniDirection());
- const bool bHorizontal(SDRTEXTANI_LEFT == eDirection || SDRTEXTANI_RIGHT == eDirection);
-
- // decompose to get separated values for the scroll box
- ::basegfx::B2DVector aScale, aTranslate;
- double fRotate, fShearX;
- aAnchorTransform.decompose(aScale, aTranslate, fRotate, fShearX);
-
- // build transform from scaled only to full AnchorTransform and inverse
- ::basegfx::B2DHomMatrix aSRT;
- aSRT.shearX(fShearX);
- aSRT.rotate(fRotate);
- aSRT.translate(aTranslate.getX(), aTranslate.getY());
- ::basegfx::B2DHomMatrix aISRT(aSRT);
- aISRT.invert();
-
- // bring the primitive back to scaled only and get scaled range, create new clone for this
- SdrTextPrimitive2D* pNew2 = pNew->createTransformedClone(aISRT);
- OSL_ENSURE(pNew2, "createTextPrimitive: Could not create transformed clone of text primitive (!)");
- delete pNew;
- pNew = pNew2;
-
- // create neutral geometry::ViewInformation2D for local range and decompose calls. This is okay
- // since the decompose is view-independent
- const uno::Sequence< beans::PropertyValue > xViewParameters;
- geometry::ViewInformation2D aViewInformation2D(xViewParameters);
-
- // get range
- const ::basegfx::B2DRange aScaledRange(pNew->getB2DRange(aViewInformation2D));
-
- // create left outside and right outside transformations. Also take care
- // of the clip rectangle
- ::basegfx::B2DHomMatrix aLeft, aRight;
- ::basegfx::B2DPoint aClipTopLeft(0.0, 0.0);
- ::basegfx::B2DPoint aClipBottomRight(aScale.getX(), aScale.getY());
-
- if(bHorizontal)
- {
- aClipTopLeft.setY(aScaledRange.getMinY());
- aClipBottomRight.setY(aScaledRange.getMaxY());
- aLeft.translate(-aScaledRange.getMaxX(), 0.0);
- aRight.translate(aScale.getX() - aScaledRange.getMinX(), 0.0);
- }
- else
+ // suppress scroll when FontWork
+ if(!rText.getSdrFormTextAttribute())
{
- aClipTopLeft.setX(aScaledRange.getMinX());
- aClipBottomRight.setX(aScaledRange.getMaxX());
- aLeft.translate(0.0, -aScaledRange.getMaxY());
- aRight.translate(0.0, aScale.getY() - aScaledRange.getMinY());
- }
+ // get scroll direction
+ const SdrTextAniDirection eDirection(rText.getSdrText().GetObject().GetTextAniDirection());
+ const bool bHorizontal(SDRTEXTANI_LEFT == eDirection || SDRTEXTANI_RIGHT == eDirection);
- aLeft *= aSRT;
- aRight *= aSRT;
-
- // prepare animation list
- drawinglayer::animation::AnimationEntryList aAnimationList;
-
- if(bHorizontal)
- {
- rText.getScrollTextTiming(aAnimationList, aScale.getX(), aScaledRange.getWidth());
- }
- else
- {
- rText.getScrollTextTiming(aAnimationList, aScale.getY(), aScaledRange.getHeight());
- }
-
- if(0.0 != aAnimationList.getDuration())
- {
- // create a new Primitive2DSequence containing the animated text in it's scaled only state.
- // use the decomposition to force to simple text primitives, those will no longer
- // need the outliner for formatting (alternatively it is also possible to just add
- // pNew to aNewPrimitiveSequence)
- Primitive2DSequence aAnimSequence(pNew->get2DDecomposition(aViewInformation2D));
+ // decompose to get separated values for the scroll box
+ basegfx::B2DVector aScale, aTranslate;
+ double fRotate, fShearX;
+ aAnchorTransform.decompose(aScale, aTranslate, fRotate, fShearX);
+
+ // build transform from scaled only to full AnchorTransform and inverse
+ basegfx::B2DHomMatrix aSRT;
+ aSRT.shearX(fShearX);
+ aSRT.rotate(fRotate);
+ aSRT.translate(aTranslate.getX(), aTranslate.getY());
+ basegfx::B2DHomMatrix aISRT(aSRT);
+ aISRT.invert();
+
+ // bring the primitive back to scaled only and get scaled range, create new clone for this
+ SdrTextPrimitive2D* pNew2 = pNew->createTransformedClone(aISRT);
+ OSL_ENSURE(pNew2, "createTextPrimitive: Could not create transformed clone of text primitive (!)");
delete pNew;
-
- // create a new animatedInterpolatePrimitive and add it
- std::vector< basegfx::B2DHomMatrix > aMatrixStack;
- aMatrixStack.push_back(aLeft);
- aMatrixStack.push_back(aRight);
- const Primitive2DReference xRefA(new AnimatedInterpolatePrimitive2D(aMatrixStack, aAnimationList, aAnimSequence, true));
- const Primitive2DSequence aContent(&xRefA, 1L);
-
- // scrolling needs an encapsulating clipping primitive
- const ::basegfx::B2DRange aClipRange(aClipTopLeft, aClipBottomRight);
- ::basegfx::B2DPolygon aClipPolygon(::basegfx::tools::createPolygonFromRect(aClipRange));
- aClipPolygon.transform(aSRT);
- return Primitive2DReference(new MaskPrimitive2D(::basegfx::B2DPolyPolygon(aClipPolygon), aContent));
- }
- else
- {
- // add to decomposition
- return Primitive2DReference(pNew);
+ pNew = pNew2;
+
+ // create neutral geometry::ViewInformation2D for local range and decompose calls. This is okay
+ // since the decompose is view-independent
+ const uno::Sequence< beans::PropertyValue > xViewParameters;
+ geometry::ViewInformation2D aViewInformation2D(xViewParameters);
+
+ // get range
+ const basegfx::B2DRange aScaledRange(pNew->getB2DRange(aViewInformation2D));
+
+ // create left outside and right outside transformations. Also take care
+ // of the clip rectangle
+ basegfx::B2DHomMatrix aLeft, aRight;
+ basegfx::B2DPoint aClipTopLeft(0.0, 0.0);
+ basegfx::B2DPoint aClipBottomRight(aScale.getX(), aScale.getY());
+
+ if(bHorizontal)
+ {
+ aClipTopLeft.setY(aScaledRange.getMinY());
+ aClipBottomRight.setY(aScaledRange.getMaxY());
+ aLeft.translate(-aScaledRange.getMaxX(), 0.0);
+ aRight.translate(aScale.getX() - aScaledRange.getMinX(), 0.0);
+ }
+ else
+ {
+ aClipTopLeft.setX(aScaledRange.getMinX());
+ aClipBottomRight.setX(aScaledRange.getMaxX());
+ aLeft.translate(0.0, -aScaledRange.getMaxY());
+ aRight.translate(0.0, aScale.getY() - aScaledRange.getMinY());
+ }
+
+ aLeft *= aSRT;
+ aRight *= aSRT;
+
+ // prepare animation list
+ drawinglayer::animation::AnimationEntryList aAnimationList;
+
+ if(bHorizontal)
+ {
+ rText.getScrollTextTiming(aAnimationList, aScale.getX(), aScaledRange.getWidth());
+ }
+ else
+ {
+ rText.getScrollTextTiming(aAnimationList, aScale.getY(), aScaledRange.getHeight());
+ }
+
+ if(0.0 != aAnimationList.getDuration())
+ {
+ // create a new Primitive2DSequence containing the animated text in it's scaled only state.
+ // use the decomposition to force to simple text primitives, those will no longer
+ // need the outliner for formatting (alternatively it is also possible to just add
+ // pNew to aNewPrimitiveSequence)
+ Primitive2DSequence aAnimSequence(pNew->get2DDecomposition(aViewInformation2D));
+ delete pNew;
+
+ // create a new animatedInterpolatePrimitive and add it
+ std::vector< basegfx::B2DHomMatrix > aMatrixStack;
+ aMatrixStack.push_back(aLeft);
+ aMatrixStack.push_back(aRight);
+ const Primitive2DReference xRefA(new AnimatedInterpolatePrimitive2D(aMatrixStack, aAnimationList, aAnimSequence, true));
+ const Primitive2DSequence aContent(&xRefA, 1L);
+
+ // scrolling needs an encapsulating clipping primitive
+ const basegfx::B2DRange aClipRange(aClipTopLeft, aClipBottomRight);
+ basegfx::B2DPolygon aClipPolygon(basegfx::tools::createPolygonFromRect(aClipRange));
+ aClipPolygon.transform(aSRT);
+ return Primitive2DReference(new MaskPrimitive2D(basegfx::B2DPolyPolygon(aClipPolygon), aContent));
+ }
+ else
+ {
+ // add to decomposition
+ return Primitive2DReference(pNew);
+ }
}
}
+
+ if(rText.isInEditMode())
+ {
+ // #i97628#
+ // encapsulate with TextHierarchyEditPrimitive2D to allow renderers
+ // to suppress actively edited content if needed
+ const Primitive2DReference xRefA(pNew);
+ const Primitive2DSequence aContent(&xRefA, 1L);
+
+ // create and add TextHierarchyEditPrimitive2D primitive
+ return Primitive2DReference(new TextHierarchyEditPrimitive2D(aContent));
+ }
else
{
- if(rText.isInEditMode())
- {
- // #i97628#
- // encapsulate with TextHierarchyEditPrimitive2D to allow renderers
- // to suppress actively edited content if needed
- const Primitive2DReference xRefA(pNew);
- const Primitive2DSequence aContent(&xRefA, 1L);
-
- // create and add TextHierarchyEditPrimitive2D primitive
- return Primitive2DReference(new TextHierarchyEditPrimitive2D(aContent));
- }
- else
- {
- // add to decomposition
- return Primitive2DReference(pNew);
- }
+ // add to decomposition
+ return Primitive2DReference(pNew);
}
}
- Primitive2DReference createShadowPrimitive(
- const Primitive2DSequence& rSource,
+ Primitive2DSequence createEmbeddedShadowPrimitive(
+ const Primitive2DSequence& rContent,
const attribute::SdrShadowAttribute& rShadow)
{
- // create Shadow primitives. Need to be added in front, should use already created primitives
- if(rSource.hasElements())
+ if(rContent.hasElements())
{
+ Primitive2DSequence aRetval(2);
+ basegfx::B2DHomMatrix aShadowOffset;
+
// prepare shadow offset
- ::basegfx::B2DHomMatrix aShadowOffset;
aShadowOffset.set(0, 2, rShadow.getOffset().getX());
aShadowOffset.set(1, 2, rShadow.getOffset().getY());
// create shadow primitive and add content
- const Primitive2DReference xRefShadow(new ShadowPrimitive2D(aShadowOffset, rShadow.getColor(), rSource));
+ aRetval[0] = Primitive2DReference(
+ new ShadowPrimitive2D(
+ aShadowOffset,
+ rShadow.getColor(),
+ rContent));
if(0.0 != rShadow.getTransparence())
{
// create SimpleTransparencePrimitive2D
- const Primitive2DSequence aContent(&xRefShadow, 1L);
- return Primitive2DReference(new UnifiedAlphaPrimitive2D(aContent, rShadow.getTransparence()));
- }
- else
- {
- // return directly
- return xRefShadow;
+ const Primitive2DSequence aTempContent(&aRetval[0], 1);
+
+ aRetval[0] = Primitive2DReference(
+ new UnifiedAlphaPrimitive2D(
+ aTempContent,
+ rShadow.getTransparence()));
}
+
+ aRetval[1] = Primitive2DReference(new GroupPrimitive2D(rContent));
+ return aRetval;
}
else
{
- return Primitive2DReference();
+ return rContent;
}
}
} // end of namespace primitive2d
diff --git a/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx
index d43b2ce3c1..c30b036bf5 100644
--- a/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx
@@ -100,16 +100,7 @@ namespace drawinglayer
// add shadow
if(getSdrLFSTAttribute().getShadow())
{
- // attention: shadow is added BEFORE object stuff to render it BEHIND object (!)
- const Primitive2DReference xShadow(createShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow()));
-
- if(xShadow.is())
- {
- Primitive2DSequence aContentWithShadow(2L);
- aContentWithShadow[0L] = xShadow;
- aContentWithShadow[1L] = Primitive2DReference(new GroupPrimitive2D(aRetval));
- aRetval = aContentWithShadow;
- }
+ aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow());
}
return aRetval;
@@ -206,16 +197,7 @@ namespace drawinglayer
// add shadow
if(getSdrLFSTAttribute().getShadow())
{
- // attention: shadow is added BEFORE object stuff to render it BEHIND object (!)
- const Primitive2DReference xShadow(createShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow()));
-
- if(xShadow.is())
- {
- Primitive2DSequence aContentWithShadow(2L);
- aContentWithShadow[0L] = xShadow;
- aContentWithShadow[1L] = Primitive2DReference(new GroupPrimitive2D(aRetval));
- aRetval = aContentWithShadow;
- }
+ aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow());
}
return aRetval;
diff --git a/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx
index 9250feaf41..e4183f3e69 100644
--- a/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx
@@ -110,16 +110,7 @@ namespace drawinglayer
// add shadow
if(getSdrLFSTAttribute().getShadow())
{
- // attention: shadow is added BEFORE object stuff to render it BEHIND object (!)
- const Primitive2DReference xShadow(createShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow()));
-
- if(xShadow.is())
- {
- Primitive2DSequence aContentWithShadow(2L);
- aContentWithShadow[0L] = xShadow;
- aContentWithShadow[1L] = Primitive2DReference(new GroupPrimitive2D(aRetval));
- aRetval = aContentWithShadow;
- }
+ aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow());
}
return aRetval;
diff --git a/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx
index 2eba93c5c0..8f9d863a41 100644
--- a/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx
@@ -52,71 +52,71 @@ namespace drawinglayer
namespace primitive2d
{
Primitive2DReference SdrMeasurePrimitive2D::impCreatePart(
- const ::basegfx::B2DHomMatrix& rObjectMatrix,
- const ::basegfx::B2DPoint& rStart,
- const ::basegfx::B2DPoint& rEnd,
+ const basegfx::B2DHomMatrix& rObjectMatrix,
+ const basegfx::B2DPoint& rStart,
+ const basegfx::B2DPoint& rEnd,
bool bLeftActive,
bool bRightActive) const
{
- ::basegfx::B2DPolygon aPolygon;
+ basegfx::B2DPolygon aPolygon;
aPolygon.append(rStart);
aPolygon.append(rEnd);
- if(!maSdrLSTAttribute.getLineStartEnd() || (!bLeftActive && !bRightActive))
+ if(!getSdrLSTAttribute().getLineStartEnd() || (!bLeftActive && !bRightActive))
{
- return createPolygonLinePrimitive(aPolygon, rObjectMatrix, *maSdrLSTAttribute.getLine(), 0L);
+ return createPolygonLinePrimitive(aPolygon, rObjectMatrix, *getSdrLSTAttribute().getLine(), 0L);
}
if(bLeftActive && bRightActive)
{
- return createPolygonLinePrimitive(aPolygon, rObjectMatrix, *maSdrLSTAttribute.getLine(), maSdrLSTAttribute.getLineStartEnd());
+ return createPolygonLinePrimitive(aPolygon, rObjectMatrix, *getSdrLSTAttribute().getLine(), getSdrLSTAttribute().getLineStartEnd());
}
- const attribute::SdrLineStartEndAttribute* pLineStartEnd = maSdrLSTAttribute.getLineStartEnd();
- const ::basegfx::B2DPolyPolygon aEmpty;
+ const attribute::SdrLineStartEndAttribute* pLineStartEnd = getSdrLSTAttribute().getLineStartEnd();
+ const basegfx::B2DPolyPolygon aEmpty;
const attribute::SdrLineStartEndAttribute aLineStartEnd(
bLeftActive ? pLineStartEnd->getStartPolyPolygon() : aEmpty, bRightActive ? pLineStartEnd->getEndPolyPolygon() : aEmpty,
bLeftActive ? pLineStartEnd->getStartWidth() : 0.0, bRightActive ? pLineStartEnd->getEndWidth() : 0.0,
bLeftActive ? pLineStartEnd->isStartActive() : false, bRightActive ? pLineStartEnd->isEndActive() : false,
bLeftActive ? pLineStartEnd->isStartCentered() : false, bRightActive? pLineStartEnd->isEndCentered() : false);
- return createPolygonLinePrimitive(aPolygon, rObjectMatrix, *maSdrLSTAttribute.getLine(), &aLineStartEnd);
+ return createPolygonLinePrimitive(aPolygon, rObjectMatrix, *getSdrLSTAttribute().getLine(), &aLineStartEnd);
}
Primitive2DSequence SdrMeasurePrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const
{
Primitive2DSequence aRetval;
SdrBlockTextPrimitive2D* pBlockText = 0L;
- ::basegfx::B2DRange aTextRange;
- double fTextX((maStart.getX() + maEnd.getX()) * 0.5);
- double fTextY((maStart.getX() + maEnd.getX()) * 0.5);
- const ::basegfx::B2DVector aLine(maEnd - maStart);
+ basegfx::B2DRange aTextRange;
+ double fTextX((getStart().getX() + getEnd().getX()) * 0.5);
+ double fTextY((getStart().getX() + getEnd().getX()) * 0.5);
+ const basegfx::B2DVector aLine(getEnd() - getStart());
const double fDistance(aLine.getLength());
const double fAngle(atan2(aLine.getY(), aLine.getX()));
bool bAutoUpsideDown(false);
- const attribute::SdrTextAttribute* pTextAttribute = maSdrLSTAttribute.getText();
+ const attribute::SdrTextAttribute* pTextAttribute = getSdrLSTAttribute().getText();
- ::basegfx::B2DHomMatrix aObjectMatrix;
+ basegfx::B2DHomMatrix aObjectMatrix;
aObjectMatrix.rotate(fAngle);
- aObjectMatrix.translate(maStart.getX(), maStart.getY());
+ aObjectMatrix.translate(getStart().getX(), getStart().getY());
if(pTextAttribute)
{
- ::basegfx::B2DHomMatrix aTextMatrix;
+ basegfx::B2DHomMatrix aTextMatrix;
double fTestAngle(fAngle);
- if(mbTextRotation)
+ if(getTextRotation())
{
aTextMatrix.rotate(-90.0 * F_PI180);
fTestAngle -= (90.0 * F_PI180);
- if(mbTextAutoAngle && fTestAngle < -F_PI)
+ if(getTextAutoAngle() && fTestAngle < -F_PI)
{
fTestAngle += F_2PI;
}
}
- if(mbTextAutoAngle)
+ if(getTextAutoAngle())
{
if(fTestAngle > (F_PI / 4.0) || fTestAngle < (-F_PI * (3.0 / 4.0)))
{
@@ -125,13 +125,18 @@ namespace drawinglayer
}
// create primitive and get text range
- pBlockText = new SdrBlockTextPrimitive2D(pTextAttribute->getSdrText(), pTextAttribute->getOutlinerParaObject(),
- aTextMatrix, pTextAttribute->isScroll(), false, false);
+ pBlockText = new SdrBlockTextPrimitive2D(
+ &pTextAttribute->getSdrText(),
+ pTextAttribute->getOutlinerParaObject(),
+ aTextMatrix,
+ pTextAttribute->isScroll(),
+ false,
+ false);
aTextRange = pBlockText->getB2DRange(aViewInformation);
}
// prepare line attribute and result
- const attribute::SdrLineAttribute* pLineAttribute(maSdrLSTAttribute.getLine());
+ const attribute::SdrLineAttribute* pLineAttribute(getSdrLSTAttribute().getLine());
if(!pLineAttribute)
{
@@ -142,7 +147,7 @@ namespace drawinglayer
{
bool bArrowsOutside(false);
bool bMainLineSplitted(false);
- const attribute::SdrLineStartEndAttribute* pLineStartEnd = maSdrLSTAttribute.getLineStartEnd();
+ const attribute::SdrLineStartEndAttribute* pLineStartEnd = getSdrLSTAttribute().getLineStartEnd();
double fStartArrowW(0.0);
double fStartArrowH(0.0);
double fEndArrowW(0.0);
@@ -152,7 +157,7 @@ namespace drawinglayer
{
if(pLineStartEnd->isStartActive())
{
- const ::basegfx::B2DRange aArrowRange(::basegfx::tools::getRange(pLineStartEnd->getStartPolyPolygon()));
+ const basegfx::B2DRange aArrowRange(basegfx::tools::getRange(pLineStartEnd->getStartPolyPolygon()));
fStartArrowW = pLineStartEnd->getStartWidth();
fStartArrowH = aArrowRange.getHeight() * fStartArrowW / aArrowRange.getWidth();
@@ -164,7 +169,7 @@ namespace drawinglayer
if(pLineStartEnd->isEndActive())
{
- const ::basegfx::B2DRange aArrowRange(::basegfx::tools::getRange(pLineStartEnd->getEndPolyPolygon()));
+ const basegfx::B2DRange aArrowRange(basegfx::tools::getRange(pLineStartEnd->getEndPolyPolygon()));
fEndArrowW = pLineStartEnd->getEndWidth();
fEndArrowH = aArrowRange.getHeight() * fEndArrowW / aArrowRange.getWidth();
@@ -184,8 +189,8 @@ namespace drawinglayer
bArrowsOutside = true;
}
- MeasureTextPosition eHorizontal(meHorizontal);
- MeasureTextPosition eVertical(meVertical);
+ MeasureTextPosition eHorizontal(getHorizontal());
+ MeasureTextPosition eVertical(getVertical());
if(MEASURETEXTPOSITION_AUTOMATIC == eVertical)
{
@@ -232,7 +237,7 @@ namespace drawinglayer
}
// switch text above/below?
- if(mbBelow || (bAutoUpsideDown && !mbTextRotation))
+ if(getBelow() || (bAutoUpsideDown && !getTextRotation()))
{
if(MEASURETEXTPOSITION_NEGATIVE == eVertical)
{
@@ -244,9 +249,9 @@ namespace drawinglayer
}
}
- const double fMainLineOffset(mbBelow ? mfDistance : -mfDistance);
- const ::basegfx::B2DPoint aMainLeft(0.0, fMainLineOffset);
- const ::basegfx::B2DPoint aMainRight(fDistance, fMainLineOffset);
+ const double fMainLineOffset(getBelow() ? getDistance() : -getDistance());
+ const basegfx::B2DPoint aMainLeft(0.0, fMainLineOffset);
+ const basegfx::B2DPoint aMainRight(fDistance, fMainLineOffset);
// main line
if(bArrowsOutside)
@@ -266,8 +271,8 @@ namespace drawinglayer
}
}
- const ::basegfx::B2DPoint aMainLeftLeft(aMainLeft.getX() - fLenLeft, aMainLeft.getY());
- const ::basegfx::B2DPoint aMainRightRight(aMainRight.getX() + fLenRight, aMainRight.getY());
+ const basegfx::B2DPoint aMainLeftLeft(aMainLeft.getX() - fLenLeft, aMainLeft.getY());
+ const basegfx::B2DPoint aMainRightRight(aMainRight.getX() + fLenRight, aMainRight.getY());
appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(aObjectMatrix, aMainLeftLeft, aMainLeft, false, true));
appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(aObjectMatrix, aMainRight, aMainRightRight, true, false));
@@ -282,8 +287,8 @@ namespace drawinglayer
if(bMainLineSplitted)
{
const double fHalfLength((fDistance - (aTextRange.getWidth() + (fStartArrowH + fEndArrowH) * 0.25)) * 0.5);
- const ::basegfx::B2DPoint aMainInnerLeft(aMainLeft.getX() + fHalfLength, aMainLeft.getY());
- const ::basegfx::B2DPoint aMainInnerRight(aMainRight.getX() - fHalfLength, aMainRight.getY());
+ const basegfx::B2DPoint aMainInnerLeft(aMainLeft.getX() + fHalfLength, aMainLeft.getY());
+ const basegfx::B2DPoint aMainInnerRight(aMainRight.getX() - fHalfLength, aMainRight.getY());
appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(aObjectMatrix, aMainLeft, aMainInnerLeft, true, false));
appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(aObjectMatrix, aMainInnerRight, aMainRight, false, true));
@@ -295,19 +300,19 @@ namespace drawinglayer
}
// left/right help line value preparation
- const double fTopEdge(mbBelow ? mfUpper + mfDistance : -mfUpper - mfDistance);
- const double fBottomLeft(mbBelow ? mfLower - mfLeftDelta : mfLeftDelta - mfLower);
- const double fBottomRight(mbBelow ? mfLower - mfRightDelta : mfRightDelta - mfLower);
+ const double fTopEdge(getBelow() ? getUpper() + getDistance() : -getUpper() - getDistance());
+ const double fBottomLeft(getBelow() ? getLower() - getLeftDelta() : getLeftDelta() - getLower());
+ const double fBottomRight(getBelow() ? getLower() - getRightDelta() : getRightDelta() - getLower());
// left help line
- const ::basegfx::B2DPoint aLeftUp(0.0, fTopEdge);
- const ::basegfx::B2DPoint aLeftDown(0.0, fBottomLeft);
+ const basegfx::B2DPoint aLeftUp(0.0, fTopEdge);
+ const basegfx::B2DPoint aLeftDown(0.0, fBottomLeft);
appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(aObjectMatrix, aLeftDown, aLeftUp, false, false));
// right help line
- const ::basegfx::B2DPoint aRightUp(fDistance, fTopEdge);
- const ::basegfx::B2DPoint aRightDown(fDistance, fBottomRight);
+ const basegfx::B2DPoint aRightUp(fDistance, fTopEdge);
+ const basegfx::B2DPoint aRightDown(fDistance, fBottomRight);
appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(aObjectMatrix, aRightDown, aRightUp, false, false));
@@ -390,7 +395,7 @@ namespace drawinglayer
}
}
- if(!maSdrLSTAttribute.getLine())
+ if(!getSdrLSTAttribute().getLine())
{
// embed line geometry to invisible line group
const Primitive2DReference xHiddenLines(new HitTestPrimitive2D(aRetval));
@@ -403,7 +408,7 @@ namespace drawinglayer
if(pBlockText)
{
// create transformation to text primitive end position
- ::basegfx::B2DHomMatrix aChange;
+ basegfx::B2DHomMatrix aChange;
// handle auto text rotation
if(bAutoUpsideDown)
@@ -427,18 +432,9 @@ namespace drawinglayer
}
// add shadow
- if(maSdrLSTAttribute.getShadow())
+ if(getSdrLSTAttribute().getShadow())
{
- // attention: shadow is added BEFORE object stuff to render it BEHIND object (!)
- const Primitive2DReference xShadow(createShadowPrimitive(aRetval, *maSdrLSTAttribute.getShadow()));
-
- if(xShadow.is())
- {
- Primitive2DSequence aContentWithShadow(2L);
- aContentWithShadow[0L] = xShadow;
- aContentWithShadow[1L] = Primitive2DReference(new GroupPrimitive2D(aRetval));
- aRetval = aContentWithShadow;
- }
+ aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLSTAttribute().getShadow());
}
return aRetval;
@@ -446,8 +442,8 @@ namespace drawinglayer
SdrMeasurePrimitive2D::SdrMeasurePrimitive2D(
const attribute::SdrLineShadowTextAttribute& rSdrLSTAttribute,
- const ::basegfx::B2DPoint& rStart,
- const ::basegfx::B2DPoint& rEnd,
+ const basegfx::B2DPoint& rStart,
+ const basegfx::B2DPoint& rEnd,
MeasureTextPosition eHorizontal,
MeasureTextPosition eVertical,
double fDistance,
@@ -481,19 +477,19 @@ namespace drawinglayer
{
const SdrMeasurePrimitive2D& rCompare = (SdrMeasurePrimitive2D&)rPrimitive;
- return (maStart == rCompare.maStart
- && maEnd == rCompare.maEnd
- && meHorizontal == rCompare.meHorizontal
- && meVertical == rCompare.meVertical
- && mfDistance == rCompare.mfDistance
- && mfUpper == rCompare.mfUpper
- && mfLower == rCompare.mfLower
- && mfLeftDelta == rCompare.mfLeftDelta
- && mfRightDelta == rCompare.mfRightDelta
- && mbBelow == rCompare.mbBelow
- && mbTextRotation == rCompare.mbTextRotation
- && mbTextAutoAngle == rCompare.mbTextAutoAngle
- && maSdrLSTAttribute == rCompare.maSdrLSTAttribute);
+ return (getStart() == rCompare.getStart()
+ && getEnd() == rCompare.getEnd()
+ && getHorizontal() == rCompare.getHorizontal()
+ && getVertical() == rCompare.getVertical()
+ && getDistance() == rCompare.getDistance()
+ && getUpper() == rCompare.getUpper()
+ && getLower() == rCompare.getLower()
+ && getLeftDelta() == rCompare.getLeftDelta()
+ && getRightDelta() == rCompare.getRightDelta()
+ && getBelow() == rCompare.getBelow()
+ && getTextRotation() == rCompare.getTextRotation()
+ && getTextAutoAngle() == rCompare.getTextAutoAngle()
+ && getSdrLSTAttribute() == rCompare.getSdrLSTAttribute());
}
return false;
diff --git a/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx b/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx
index cd2b7b7789..a7d647d2c5 100644
--- a/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx
@@ -116,16 +116,7 @@ namespace drawinglayer
// add shadow
if(!bBehaveCompatibleToPaintVersion && getSdrLFSTAttribute().getShadow())
{
- // attention: shadow is added BEFORE object stuff to render it BEHIND object (!)
- const Primitive2DReference xShadow(createShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow()));
-
- if(xShadow.is())
- {
- Primitive2DSequence aContentWithShadow(2L);
- aContentWithShadow[0L] = xShadow;
- aContentWithShadow[1L] = Primitive2DReference(new GroupPrimitive2D(aRetval));
- aRetval = aContentWithShadow;
- }
+ aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow());
}
return aRetval;
diff --git a/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx
new file mode 100644
index 0000000000..9c5616ebff
--- /dev/null
+++ b/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx
@@ -0,0 +1,200 @@
+/*************************************************************************
+ *
+ * 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: sdrcaptionprimitive2d.cxx,v $
+ *
+ * $Revision: 1.2.18.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 "precompiled_svx.hxx"
+#include <svx/sdr/primitive2d/sdrolecontentprimitive2d.hxx>
+#include <svx/sdr/primitive2d/svx_primitivetypes2d.hxx>
+#include <svx/svdoole2.hxx>
+#include <vcl/svapp.hxx>
+#include <drawinglayer/primitive2d/graphicprimitive2d.hxx>
+#include <svtools/colorcfg.hxx>
+#include <basegfx/polygon/b2dpolygontools.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
+#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ Primitive2DSequence SdrOleContentPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const
+ {
+ Primitive2DSequence aRetval;
+ const SdrOle2Obj* pSource = (mpSdrOle2Obj.is() ? static_cast< SdrOle2Obj* >(mpSdrOle2Obj.get()) : 0);
+ bool bScaleContent(false);
+ Graphic aGraphic;
+
+ if(pSource)
+ {
+ Graphic* pOLEGraphic = (getHighContrast())
+ ? pSource->getEmbeddedObjectRef().GetHCGraphic()
+ : pSource->GetGraphic();
+
+ if(pOLEGraphic)
+ {
+ aGraphic = *pOLEGraphic;
+ bScaleContent = pSource->IsEmptyPresObj();
+ }
+ }
+
+ if(GRAPHIC_NONE == aGraphic.GetType())
+ {
+ // no source, use fallback ressource emty OLE graphic
+ const Bitmap aEmptyOLEBitmap(SdrOle2Obj::GetEmtyOLEReplacementBitmap());
+ aGraphic = Graphic(aEmptyOLEBitmap);
+ bScaleContent = true;
+ }
+
+ if(GRAPHIC_NONE != aGraphic.GetType())
+ {
+ const GraphicObject aGraphicObject(aGraphic);
+ const GraphicAttr aGraphicAttr;
+ drawinglayer::primitive2d::Primitive2DSequence xOLEContent;
+
+ if(bScaleContent)
+ {
+ // get transformation atoms
+ basegfx::B2DVector aScale, aTranslate;
+ double fRotate, fShearX;
+ getObjectTransform().decompose(aScale, aTranslate, fRotate, fShearX);
+
+ // get PrefSize from the graphic in 100th mm
+ Size aPrefSize(aGraphic.GetPrefSize());
+
+ if(MAP_PIXEL == aGraphic.GetPrefMapMode().GetMapUnit())
+ {
+ aPrefSize = Application::GetDefaultDevice()->PixelToLogic(aPrefSize, MAP_100TH_MM);
+ }
+ else
+ {
+ aPrefSize = Application::GetDefaultDevice()->LogicToLogic(aPrefSize, aGraphic.GetPrefMapMode(), MAP_100TH_MM);
+ }
+
+ const double fOffsetX((aScale.getX() - aPrefSize.getWidth()) / 2.0);
+ const double fOffsetY((aScale.getY() - aPrefSize.getHeight()) / 2.0);
+
+ if(basegfx::fTools::moreOrEqual(fOffsetX, 0.0) && basegfx::fTools::moreOrEqual(fOffsetY, 0.0))
+ {
+ // if content fits into frame, create it
+ basegfx::B2DHomMatrix aInnerObjectMatrix;
+
+ aInnerObjectMatrix.scale(aPrefSize.getWidth(), aPrefSize.getHeight());
+ aInnerObjectMatrix.translate(fOffsetX, fOffsetY);
+ aInnerObjectMatrix.shearX(fShearX);
+ aInnerObjectMatrix.rotate(fRotate);
+ aInnerObjectMatrix.translate(aTranslate.getX(), aTranslate.getY());
+
+ const drawinglayer::primitive2d::Primitive2DReference aGraphicPrimitive(
+ new drawinglayer::primitive2d::GraphicPrimitive2D(
+ aInnerObjectMatrix,
+ aGraphicObject,
+ aGraphicAttr));
+ drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, aGraphicPrimitive);
+ }
+ }
+ else
+ {
+ // create graphic primitive for content
+ const drawinglayer::primitive2d::Primitive2DReference aGraphicPrimitive(
+ new drawinglayer::primitive2d::GraphicPrimitive2D(
+ getObjectTransform(),
+ aGraphicObject,
+ aGraphicAttr));
+ drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, aGraphicPrimitive);
+ }
+
+ // a standard gray outline is created for scaled content
+ if(bScaleContent)
+ {
+ const svtools::ColorConfig aColorConfig;
+ const svtools::ColorConfigValue aColor(aColorConfig.GetColorValue(svtools::OBJECTBOUNDARIES));
+
+ if(aColor.bIsVisible)
+ {
+ basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
+ const Color aVclColor(aColor.nColor);
+ aOutline.transform(getObjectTransform());
+ const drawinglayer::primitive2d::Primitive2DReference xOutline(
+ new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(aOutline, aVclColor.getBColor()));
+ drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, xOutline);
+ }
+ }
+ }
+
+ // get graphic and check scale content state
+ return aRetval;
+ }
+
+ SdrOleContentPrimitive2D::SdrOleContentPrimitive2D(
+ const SdrOle2Obj& rSdrOle2Obj,
+ const basegfx::B2DHomMatrix& rObjectTransform,
+ bool bHighContrast)
+ : BasePrimitive2D(),
+ mpSdrOle2Obj(const_cast< SdrOle2Obj* >(&rSdrOle2Obj)),
+ maObjectTransform(rObjectTransform),
+ mbHighContrast(bHighContrast)
+ {
+ }
+
+ bool SdrOleContentPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
+ {
+ if(BasePrimitive2D::operator==(rPrimitive))
+ {
+ const SdrOleContentPrimitive2D& rCompare = (SdrOleContentPrimitive2D&)rPrimitive;
+ const bool bBothNot(!mpSdrOle2Obj.is() && !rCompare.mpSdrOle2Obj.is());
+ const bool bBothAndEqual(mpSdrOle2Obj.is() && rCompare.mpSdrOle2Obj.is()
+ && mpSdrOle2Obj.get() == rCompare.mpSdrOle2Obj.get());
+
+ return ((bBothNot || bBothAndEqual)
+ && getObjectTransform() == rCompare.getObjectTransform()
+ && getHighContrast() == rCompare.getHighContrast());
+ }
+
+ return false;
+ }
+
+ basegfx::B2DRange SdrOleContentPrimitive2D::getB2DRange(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ {
+ basegfx::B2DRange aRange(0.0, 0.0, 1.0, 1.0);
+ aRange.transform(getObjectTransform());
+
+ return aRange;
+ }
+
+ // provide unique ID
+ ImplPrimitrive2DIDBlock(SdrOleContentPrimitive2D, PRIMITIVE2D_ID_SDROLECONTENTPRIMITIVE2D)
+
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx
index f892648dc0..f09e9c14b8 100644
--- a/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx
@@ -52,22 +52,22 @@ namespace drawinglayer
Primitive2DSequence aRetval;
// add fill
- if(maSdrLFSTAttribute.getFill() && maUnitPolyPolygon.isClosed())
+ if(getSdrLFSTAttribute().getFill() && getUnitPolyPolygon().isClosed())
{
// take care for orientations
- ::basegfx::B2DPolyPolygon aOrientedUnitPolyPolygon(::basegfx::tools::correctOrientations(maUnitPolyPolygon));
+ basegfx::B2DPolyPolygon aOrientedUnitPolyPolygon(basegfx::tools::correctOrientations(getUnitPolyPolygon()));
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolyPolygonFillPrimitive(aOrientedUnitPolyPolygon, maTransform, *maSdrLFSTAttribute.getFill(), maSdrLFSTAttribute.getFillFloatTransGradient()));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolyPolygonFillPrimitive(aOrientedUnitPolyPolygon, getTransform(), *getSdrLFSTAttribute().getFill(), getSdrLFSTAttribute().getFillFloatTransGradient()));
}
// add line
- if(maSdrLFSTAttribute.getLine())
+ if(getSdrLFSTAttribute().getLine())
{
- Primitive2DSequence aTemp(maUnitPolyPolygon.count());
+ Primitive2DSequence aTemp(getUnitPolyPolygon().count());
- for(sal_uInt32 a(0L); a < maUnitPolyPolygon.count(); a++)
+ for(sal_uInt32 a(0L); a < getUnitPolyPolygon().count(); a++)
{
- aTemp[a] = createPolygonLinePrimitive(maUnitPolyPolygon.getB2DPolygon(a), maTransform, *maSdrLFSTAttribute.getLine(), maSdrLFSTAttribute.getLineStartEnd());
+ aTemp[a] = createPolygonLinePrimitive(getUnitPolyPolygon().getB2DPolygon(a), getTransform(), *getSdrLFSTAttribute().getLine(), getSdrLFSTAttribute().getLineStartEnd());
}
appendPrimitive2DSequenceToPrimitive2DSequence(aRetval, aTemp);
@@ -76,44 +76,35 @@ namespace drawinglayer
{
// if initially no line is defined, create one for HitTest and BoundRect
const attribute::SdrLineAttribute aBlackHairline(basegfx::BColor(0.0, 0.0, 0.0));
- Primitive2DSequence xHiddenLineSequence(maUnitPolyPolygon.count());
+ Primitive2DSequence xHiddenLineSequence(getUnitPolyPolygon().count());
- for(sal_uInt32 a(0); a < maUnitPolyPolygon.count(); a++)
+ for(sal_uInt32 a(0); a < getUnitPolyPolygon().count(); a++)
{
- xHiddenLineSequence[a] = createPolygonLinePrimitive(maUnitPolyPolygon.getB2DPolygon(a), maTransform, aBlackHairline);
+ xHiddenLineSequence[a] = createPolygonLinePrimitive(getUnitPolyPolygon().getB2DPolygon(a), getTransform(), aBlackHairline);
}
appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, Primitive2DReference(new HitTestPrimitive2D(xHiddenLineSequence)));
}
// add text
- if(maSdrLFSTAttribute.getText())
+ if(getSdrLFSTAttribute().getText())
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(maUnitPolyPolygon, maTransform, *maSdrLFSTAttribute.getText(), maSdrLFSTAttribute.getLine(), false, false));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(getUnitPolyPolygon(), getTransform(), *getSdrLFSTAttribute().getText(), getSdrLFSTAttribute().getLine(), false, false));
}
// add shadow
- if(maSdrLFSTAttribute.getShadow())
+ if(getSdrLFSTAttribute().getShadow())
{
- // attention: shadow is added BEFORE object stuff to render it BEHIND object (!)
- const Primitive2DReference xShadow(createShadowPrimitive(aRetval, *maSdrLFSTAttribute.getShadow()));
-
- if(xShadow.is())
- {
- Primitive2DSequence aContentWithShadow(2L);
- aContentWithShadow[0L] = xShadow;
- aContentWithShadow[1L] = Primitive2DReference(new GroupPrimitive2D(aRetval));
- aRetval = aContentWithShadow;
- }
+ aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow());
}
return aRetval;
}
SdrPathPrimitive2D::SdrPathPrimitive2D(
- const ::basegfx::B2DHomMatrix& rTransform,
+ const basegfx::B2DHomMatrix& rTransform,
const attribute::SdrLineFillShadowTextAttribute& rSdrLFSTAttribute,
- const ::basegfx::B2DPolyPolygon& rUnitPolyPolygon)
+ const basegfx::B2DPolyPolygon& rUnitPolyPolygon)
: BasePrimitive2D(),
maTransform(rTransform),
maSdrLFSTAttribute(rSdrLFSTAttribute),
@@ -127,9 +118,9 @@ namespace drawinglayer
{
const SdrPathPrimitive2D& rCompare = (SdrPathPrimitive2D&)rPrimitive;
- return (maUnitPolyPolygon == rCompare.maUnitPolyPolygon
- && maTransform == rCompare.maTransform
- && maSdrLFSTAttribute == rCompare.maSdrLFSTAttribute);
+ return (getUnitPolyPolygon() == rCompare.getUnitPolyPolygon()
+ && getTransform() == rCompare.getTransform()
+ && getSdrLFSTAttribute() == rCompare.getSdrLFSTAttribute());
}
return false;
diff --git a/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx
index e197679296..e4b9d3f4ec 100644
--- a/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx
@@ -50,65 +50,90 @@ namespace drawinglayer
Primitive2DSequence SdrRectanglePrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const
{
Primitive2DSequence aRetval;
+ Primitive2DSequence aHitTestContent;
// create unit outline polygon
- ::basegfx::B2DPolygon aUnitOutline(::basegfx::tools::createPolygonFromRect(::basegfx::B2DRange(0.0, 0.0, 1.0, 1.0), getCornerRadiusX(), getCornerRadiusY()));
+ const basegfx::B2DPolygon aUnitOutline(basegfx::tools::createPolygonFromRect(
+ basegfx::B2DRange(0.0, 0.0, 1.0, 1.0),
+ getCornerRadiusX(),
+ getCornerRadiusY()));
// add fill
if(getSdrLFSTAttribute().getFill())
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolyPolygonFillPrimitive(::basegfx::B2DPolyPolygon(aUnitOutline), getTransform(), *getSdrLFSTAttribute().getFill(), getSdrLFSTAttribute().getFillFloatTransGradient()));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createPolyPolygonFillPrimitive(
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTransform(),
+ *getSdrLFSTAttribute().getFill(),
+ getSdrLFSTAttribute().getFillFloatTransGradient()));
+ }
+ else if(getTextFrame())
+ {
+ // if no fill and it's a text frame, create a fill for HitTest and
+ // BoundRect fallback
+ appendPrimitive2DReferenceToPrimitive2DSequence(aHitTestContent,
+ createPolyPolygonFillPrimitive(
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTransform(),
+ attribute::SdrFillAttribute(0.0, basegfx::BColor(0.0, 0.0, 0.0)),
+ getSdrLFSTAttribute().getFillFloatTransGradient()));
}
// add line
if(getSdrLFSTAttribute().getLine())
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolygonLinePrimitive(aUnitOutline, getTransform(), *getSdrLFSTAttribute().getLine()));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createPolygonLinePrimitive(
+ aUnitOutline,
+ getTransform(),
+ *getSdrLFSTAttribute().getLine()));
}
- else
+ else if(!getTextFrame())
+ {
+ // if initially no line is defined and it's not a text frame, create
+ // a line for HitTest and BoundRect
+ appendPrimitive2DReferenceToPrimitive2DSequence(aHitTestContent,
+ createPolygonLinePrimitive(
+ aUnitOutline,
+ getTransform(),
+ attribute::SdrLineAttribute(basegfx::BColor(0.0, 0.0, 0.0))));
+ }
+
+ // add HitTest and BoundRect helper geometry (if exists)
+ if(aHitTestContent.hasElements())
{
- // if initially no line is defined, create one for HitTest and BoundRect
- const attribute::SdrLineAttribute aBlackHairline(basegfx::BColor(0.0, 0.0, 0.0));
- const Primitive2DReference xHiddenLineReference(createPolygonLinePrimitive(aUnitOutline, getTransform(), aBlackHairline));
- const Primitive2DSequence xHiddenLineSequence(&xHiddenLineReference, 1);
-
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, Primitive2DReference(new HitTestPrimitive2D(xHiddenLineSequence)));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ Primitive2DReference(new HitTestPrimitive2D(aHitTestContent)));
}
// add text
if(getSdrLFSTAttribute().getText())
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(::basegfx::B2DPolyPolygon(aUnitOutline), getTransform(), *getSdrLFSTAttribute().getText(), getSdrLFSTAttribute().getLine(), false, false));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(basegfx::B2DPolyPolygon(aUnitOutline), getTransform(), *getSdrLFSTAttribute().getText(), getSdrLFSTAttribute().getLine(), false, false));
}
// add shadow
if(getSdrLFSTAttribute().getShadow())
{
- // attention: shadow is added BEFORE object stuff to render it BEHIND object (!)
- const Primitive2DReference xShadow(createShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow()));
-
- if(xShadow.is())
- {
- Primitive2DSequence aContentWithShadow(2L);
- aContentWithShadow[0L] = xShadow;
- aContentWithShadow[1L] = Primitive2DReference(new GroupPrimitive2D(aRetval));
- aRetval = aContentWithShadow;
- }
+ aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow());
}
return aRetval;
}
SdrRectanglePrimitive2D::SdrRectanglePrimitive2D(
- const ::basegfx::B2DHomMatrix& rTransform,
+ const basegfx::B2DHomMatrix& rTransform,
const attribute::SdrLineFillShadowTextAttribute& rSdrLFSTAttribute,
double fCornerRadiusX,
- double fCornerRadiusY)
+ double fCornerRadiusY,
+ bool bTextFrame)
: BasePrimitive2D(),
maTransform(rTransform),
maSdrLFSTAttribute(rSdrLFSTAttribute),
mfCornerRadiusX(fCornerRadiusX),
- mfCornerRadiusY(fCornerRadiusY)
+ mfCornerRadiusY(fCornerRadiusY),
+ mbTextFrame(bTextFrame)
{
}
@@ -121,7 +146,8 @@ namespace drawinglayer
return (getCornerRadiusX() == rCompare.getCornerRadiusX()
&& getCornerRadiusY() == rCompare.getCornerRadiusY()
&& getTransform() == rCompare.getTransform()
- && getSdrLFSTAttribute() == rCompare.getSdrLFSTAttribute());
+ && getSdrLFSTAttribute() == rCompare.getSdrLFSTAttribute()
+ && getTextFrame() == rCompare.getTextFrame());
}
return false;
diff --git a/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx
index 919ac76e39..0b5abd1482 100644
--- a/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx
@@ -41,12 +41,55 @@
#include <drawinglayer/geometry/viewinformation2d.hxx>
#include <unoapi.hxx>
#include <svx/svdpage.hxx>
+#include <svx/svdmodel.hxx>
+#include <svx/svdoutl.hxx>
+#include <com/sun/star/beans/XPropertySet.hpp>
//////////////////////////////////////////////////////////////////////////////
using namespace com::sun::star;
//////////////////////////////////////////////////////////////////////////////
+
+namespace
+{
+ sal_Int16 getPageNumber(const uno::Reference< drawing::XDrawPage >& rxDrawPage)
+ {
+ sal_Int16 nRetval(0);
+ uno::Reference< beans::XPropertySet > xSet(rxDrawPage, uno::UNO_QUERY);
+
+ if (xSet.is())
+ {
+ try
+ {
+ const uno::Any aNumber(xSet->getPropertyValue(::rtl::OUString::createFromAscii("Number")));
+ aNumber >>= nRetval;
+ }
+ catch(const uno::Exception&)
+ {
+ OSL_ASSERT(false);
+ }
+ }
+
+ return nRetval;
+ }
+
+ sal_Int16 getPageCount(const uno::Reference< drawing::XDrawPage >& rxDrawPage)
+ {
+ sal_Int16 nRetval(0);
+ SdrPage* pPage = GetSdrPageFromXDrawPage(rxDrawPage);
+
+ if(pPage && pPage->GetModel())
+ {
+ const sal_uInt16 nPageCount(pPage->GetModel()->GetPageCount());
+ nRetval = ((sal_Int16)nPageCount - 1) / 2;
+ }
+
+ return nRetval;
+ }
+} // end of anonymous namespace
+
+//////////////////////////////////////////////////////////////////////////////
namespace drawinglayer
{
@@ -64,20 +107,28 @@ namespace drawinglayer
}
SdrTextPrimitive2D::SdrTextPrimitive2D(
- const SdrText& rSdrText,
+ const SdrText* pSdrText,
const OutlinerParaObject& rOutlinerParaObject)
: BasePrimitive2D(),
- mrSdrText(rSdrText),
+ mrSdrText(const_cast< SdrText* >(pSdrText)),
maOutlinerParaObject(rOutlinerParaObject),
mxLastVisualizingPage(),
+ mnLastPageNumber(0),
+ mnLastPageCount(0),
+ maLastTextBackgroundColor(),
mbLastSpellCheck(false),
- mbContainsPageField(false)
+ mbContainsPageField(false),
+ mbContainsPageCountField(false),
+ mbContainsOtherFields(false)
{
const EditTextObject& rETO = maOutlinerParaObject.GetTextObject();
- mbContainsPageField = rETO.HasField(SvxPageField::StaticType())
- || rETO.HasField(SvxHeaderField::StaticType())
- || rETO.HasField(SvxFooterField::StaticType())
- || rETO.HasField(SvxDateTimeField::StaticType());
+
+ mbContainsPageField = rETO.HasField(SvxPageField::StaticType());
+ mbContainsPageCountField = rETO.HasField(SvxPagesField::StaticType());
+ mbContainsOtherFields = rETO.HasField(SvxHeaderField::StaticType())
+ || rETO.HasField(SvxFooterField::StaticType())
+ || rETO.HasField(SvxDateTimeField::StaticType())
+ || rETO.HasField(SvxAuthorField::StaticType());
}
bool SdrTextPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
@@ -94,21 +145,66 @@ namespace drawinglayer
Primitive2DSequence SdrTextPrimitive2D::get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const
{
- const bool bCurrentSpellCheck(getSdrText().GetObject().impCheckSpellCheckForDecomposeTextPrimitive());
+ const bool bCurrentSpellCheck(getSdrText()
+ ? getSdrText()->GetObject().impCheckSpellCheckForDecomposeTextPrimitive()
+ : false);
uno::Reference< drawing::XDrawPage > xCurrentlyVisualizingPage;
+ bool bCurrentlyVisualizingPageIsSet(false);
+ Color aNewTextBackgroundColor;
+ bool bNewTextBackgroundColorIsSet(false);
+ sal_Int16 nCurrentlyValidPageNumber(0);
+ sal_Int16 nCurrentlyValidPageCount(0);
if(getLocalDecomposition().hasElements())
{
bool bDoDelete(getLastSpellCheck() != bCurrentSpellCheck);
- if(!bDoDelete && mbContainsPageField)
+ // check visualized page
+ if(!bDoDelete && (mbContainsPageField || mbContainsPageCountField || mbContainsOtherFields))
{
+ // get visualized page and remember
xCurrentlyVisualizingPage = rViewInformation.getVisualizedPage();
+ bCurrentlyVisualizingPageIsSet = true;
if(xCurrentlyVisualizingPage != mxLastVisualizingPage)
{
bDoDelete = true;
}
+
+ // #i98870# check visualized PageNumber
+ if(!bDoDelete && mbContainsPageField)
+ {
+ nCurrentlyValidPageNumber = getPageNumber(xCurrentlyVisualizingPage);
+
+ if(nCurrentlyValidPageNumber != mnLastPageNumber)
+ {
+ bDoDelete = true;
+ }
+ }
+
+ // #i98870# check visualized PageCount, too
+ if(!bDoDelete && mbContainsPageCountField)
+ {
+ nCurrentlyValidPageCount = getPageCount(xCurrentlyVisualizingPage);
+
+ if(nCurrentlyValidPageCount != mnLastPageCount)
+ {
+ bDoDelete = true;
+ }
+ }
+ }
+
+ // #i101443# check change of TextBackgroundolor
+ if(!bDoDelete && getSdrText() && getSdrText()->GetModel())
+ {
+ SdrOutliner& rDrawOutliner = getSdrText()->GetModel()->GetDrawOutliner(0);
+ aNewTextBackgroundColor = rDrawOutliner.GetBackgroundColor();
+ bNewTextBackgroundColorIsSet = true;
+
+ if(aNewTextBackgroundColor != maLastTextBackgroundColor)
+ {
+ bDoDelete = true;
+ }
}
if(bDoDelete)
@@ -119,8 +215,32 @@ namespace drawinglayer
if(!getLocalDecomposition().hasElements())
{
+ if(!bCurrentlyVisualizingPageIsSet && mbContainsPageField)
+ {
+ xCurrentlyVisualizingPage = rViewInformation.getVisualizedPage();
+ }
+
+ if(!nCurrentlyValidPageNumber && mbContainsPageField)
+ {
+ nCurrentlyValidPageNumber = getPageNumber(xCurrentlyVisualizingPage);
+ }
+
+ if(!nCurrentlyValidPageCount && mbContainsPageCountField)
+ {
+ nCurrentlyValidPageCount = getPageCount(xCurrentlyVisualizingPage);
+ }
+
+ if(!bNewTextBackgroundColorIsSet && getSdrText() && getSdrText()->GetModel())
+ {
+ SdrOutliner& rDrawOutliner = getSdrText()->GetModel()->GetDrawOutliner(0);
+ aNewTextBackgroundColor = rDrawOutliner.GetBackgroundColor();
+ }
+
const_cast< SdrTextPrimitive2D* >(this)->setLastSpellCheck(bCurrentSpellCheck);
const_cast< SdrTextPrimitive2D* >(this)->mxLastVisualizingPage = xCurrentlyVisualizingPage;
+ const_cast< SdrTextPrimitive2D* >(this)->mnLastPageNumber = nCurrentlyValidPageNumber;
+ const_cast< SdrTextPrimitive2D* >(this)->mnLastPageCount = nCurrentlyValidPageCount;
+ const_cast< SdrTextPrimitive2D* >(this)->maLastTextBackgroundColor = aNewTextBackgroundColor;
}
// call parent
@@ -138,7 +258,9 @@ namespace drawinglayer
Primitive2DSequence SdrContourTextPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const
{
Primitive2DSequence aRetval;
- const bool bCurrentSpellCheck(getSdrText().GetObject().impDecomposeContourTextPrimitive(aRetval, *this, aViewInformation));
+ const bool bCurrentSpellCheck(getSdrText()
+ ? getSdrText()->GetObject().impDecomposeContourTextPrimitive(aRetval, *this, aViewInformation)
+ : false);
if(getLastSpellCheck() != bCurrentSpellCheck)
{
@@ -150,11 +272,11 @@ namespace drawinglayer
}
SdrContourTextPrimitive2D::SdrContourTextPrimitive2D(
- const SdrText& rSdrText,
+ const SdrText* pSdrText,
const OutlinerParaObject& rOutlinerParaObject,
- const ::basegfx::B2DPolyPolygon& rUnitPolyPolygon,
- const ::basegfx::B2DHomMatrix& rObjectTransform)
- : SdrTextPrimitive2D(rSdrText, rOutlinerParaObject),
+ const basegfx::B2DPolyPolygon& rUnitPolyPolygon,
+ const basegfx::B2DHomMatrix& rObjectTransform)
+ : SdrTextPrimitive2D(pSdrText, rOutlinerParaObject),
maUnitPolyPolygon(rUnitPolyPolygon),
maObjectTransform(rObjectTransform)
{
@@ -166,16 +288,20 @@ namespace drawinglayer
{
const SdrContourTextPrimitive2D& rCompare = (SdrContourTextPrimitive2D&)rPrimitive;
- return (maUnitPolyPolygon == rCompare.maUnitPolyPolygon
- && maObjectTransform == rCompare.maObjectTransform);
+ return (getUnitPolyPolygon() == rCompare.getUnitPolyPolygon()
+ && getObjectTransform() == rCompare.getObjectTransform());
}
return false;
}
- SdrTextPrimitive2D* SdrContourTextPrimitive2D::createTransformedClone(const ::basegfx::B2DHomMatrix& rTransform) const
+ SdrTextPrimitive2D* SdrContourTextPrimitive2D::createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const
{
- return new SdrContourTextPrimitive2D(getSdrText(), getOutlinerParaObject(), maUnitPolyPolygon, rTransform * maObjectTransform);
+ return new SdrContourTextPrimitive2D(
+ getSdrText(),
+ getOutlinerParaObject(),
+ getUnitPolyPolygon(),
+ rTransform * getObjectTransform());
}
// provide unique ID
@@ -193,7 +319,9 @@ namespace drawinglayer
Primitive2DSequence SdrPathTextPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const
{
Primitive2DSequence aRetval;
- const bool bCurrentSpellCheck(getSdrText().GetObject().impDecomposePathTextPrimitive(aRetval, *this, aViewInformation));
+ const bool bCurrentSpellCheck(getSdrText()
+ ? getSdrText()->GetObject().impDecomposePathTextPrimitive(aRetval, *this, aViewInformation)
+ : false);
if(getLastSpellCheck() != bCurrentSpellCheck)
{
@@ -205,11 +333,13 @@ namespace drawinglayer
}
SdrPathTextPrimitive2D::SdrPathTextPrimitive2D(
- const SdrText& rSdrText,
+ const SdrText* pSdrText,
const OutlinerParaObject& rOutlinerParaObject,
- const ::basegfx::B2DPolyPolygon& rPathPolyPolygon)
- : SdrTextPrimitive2D(rSdrText, rOutlinerParaObject),
- maPathPolyPolygon(rPathPolyPolygon)
+ const basegfx::B2DPolyPolygon& rPathPolyPolygon,
+ const attribute::SdrFormTextAttribute& rSdrFormTextAttribute)
+ : SdrTextPrimitive2D(pSdrText, rOutlinerParaObject),
+ maPathPolyPolygon(rPathPolyPolygon),
+ maSdrFormTextAttribute(rSdrFormTextAttribute)
{
}
@@ -219,17 +349,23 @@ namespace drawinglayer
{
const SdrPathTextPrimitive2D& rCompare = (SdrPathTextPrimitive2D&)rPrimitive;
- return (maPathPolyPolygon == rCompare.maPathPolyPolygon);
+ return (getPathPolyPolygon() == rCompare.getPathPolyPolygon()
+ && getSdrFormTextAttribute() == rCompare.getSdrFormTextAttribute());
}
return false;
}
- SdrTextPrimitive2D* SdrPathTextPrimitive2D::createTransformedClone(const ::basegfx::B2DHomMatrix& rTransform) const
+ SdrTextPrimitive2D* SdrPathTextPrimitive2D::createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const
{
- ::basegfx::B2DPolyPolygon aNewPolyPolygon(maPathPolyPolygon);
+ basegfx::B2DPolyPolygon aNewPolyPolygon(getPathPolyPolygon());
aNewPolyPolygon.transform(rTransform);
- return new SdrPathTextPrimitive2D(getSdrText(), getOutlinerParaObject(), aNewPolyPolygon);
+
+ return new SdrPathTextPrimitive2D(
+ getSdrText(),
+ getOutlinerParaObject(),
+ aNewPolyPolygon,
+ getSdrFormTextAttribute());
}
// provide unique ID
@@ -247,7 +383,9 @@ namespace drawinglayer
Primitive2DSequence SdrBlockTextPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const
{
Primitive2DSequence aRetval;
- const bool bCurrentSpellCheck(getSdrText().GetObject().impDecomposeBlockTextPrimitive(aRetval, *this, aViewInformation));
+ const bool bCurrentSpellCheck(getSdrText()
+ ? getSdrText()->GetObject().impDecomposeBlockTextPrimitive(aRetval, *this, aViewInformation)
+ : false);
if(getLastSpellCheck() != bCurrentSpellCheck)
{
@@ -259,13 +397,13 @@ namespace drawinglayer
}
SdrBlockTextPrimitive2D::SdrBlockTextPrimitive2D(
- const SdrText& rSdrText,
+ const SdrText* pSdrText,
const OutlinerParaObject& rOutlinerParaObject,
- const ::basegfx::B2DHomMatrix& rTextRangeTransform,
+ const basegfx::B2DHomMatrix& rTextRangeTransform,
bool bUnlimitedPage,
bool bCellText,
bool bWordWrap)
- : SdrTextPrimitive2D(rSdrText, rOutlinerParaObject),
+ : SdrTextPrimitive2D(pSdrText, rOutlinerParaObject),
maTextRangeTransform(rTextRangeTransform),
mbUnlimitedPage(bUnlimitedPage),
mbCellText(bCellText),
@@ -288,9 +426,15 @@ namespace drawinglayer
return false;
}
- SdrTextPrimitive2D* SdrBlockTextPrimitive2D::createTransformedClone(const ::basegfx::B2DHomMatrix& rTransform) const
+ SdrTextPrimitive2D* SdrBlockTextPrimitive2D::createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const
{
- return new SdrBlockTextPrimitive2D(getSdrText(), getOutlinerParaObject(), rTransform * getTextRangeTransform(), getUnlimitedPage(), getCellText(), getWordWrap());
+ return new SdrBlockTextPrimitive2D(
+ getSdrText(),
+ getOutlinerParaObject(),
+ rTransform * getTextRangeTransform(),
+ getUnlimitedPage(),
+ getCellText(),
+ getWordWrap());
}
// provide unique ID
@@ -308,7 +452,9 @@ namespace drawinglayer
Primitive2DSequence SdrStretchTextPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const
{
Primitive2DSequence aRetval;
- const bool bCurrentSpellCheck(getSdrText().GetObject().impDecomposeStretchTextPrimitive(aRetval, *this, aViewInformation));
+ const bool bCurrentSpellCheck(getSdrText()
+ ? getSdrText()->GetObject().impDecomposeStretchTextPrimitive(aRetval, *this, aViewInformation)
+ : false);
if(getLastSpellCheck() != bCurrentSpellCheck)
{
@@ -320,10 +466,10 @@ namespace drawinglayer
}
SdrStretchTextPrimitive2D::SdrStretchTextPrimitive2D(
- const SdrText& rSdrText,
+ const SdrText* pSdrText,
const OutlinerParaObject& rOutlinerParaObject,
- const ::basegfx::B2DHomMatrix& rTextRangeTransform)
- : SdrTextPrimitive2D(rSdrText, rOutlinerParaObject),
+ const basegfx::B2DHomMatrix& rTextRangeTransform)
+ : SdrTextPrimitive2D(pSdrText, rOutlinerParaObject),
maTextRangeTransform(rTextRangeTransform)
{
}
@@ -334,15 +480,18 @@ namespace drawinglayer
{
const SdrStretchTextPrimitive2D& rCompare = (SdrStretchTextPrimitive2D&)rPrimitive;
- return (maTextRangeTransform == rCompare.maTextRangeTransform);
+ return (getTextRangeTransform() == rCompare.getTextRangeTransform());
}
return false;
}
- SdrTextPrimitive2D* SdrStretchTextPrimitive2D::createTransformedClone(const ::basegfx::B2DHomMatrix& rTransform) const
+ SdrTextPrimitive2D* SdrStretchTextPrimitive2D::createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const
{
- return new SdrStretchTextPrimitive2D(getSdrText(), getOutlinerParaObject(), rTransform * maTextRangeTransform);
+ return new SdrStretchTextPrimitive2D(
+ getSdrText(),
+ getOutlinerParaObject(),
+ rTransform * getTextRangeTransform());
}
// provide unique ID
diff --git a/svx/source/sdr/properties/properties.cxx b/svx/source/sdr/properties/properties.cxx
index 0d6cb3b83b..fe317a495a 100644
--- a/svx/source/sdr/properties/properties.cxx
+++ b/svx/source/sdr/properties/properties.cxx
@@ -180,6 +180,11 @@ namespace sdr
GetSdrObject().SendUserCall(SDRUSERCALL_CHGATTR, rChange.GetRectangle(a));
}
}
+
+ sal_uInt32 BaseProperties::getVersion() const
+ {
+ return 0;
+ }
} // end of namespace properties
} // end of namespace sdr
diff --git a/svx/source/sdr/properties/textproperties.cxx b/svx/source/sdr/properties/textproperties.cxx
index 139d2fb988..229ba89db5 100644
--- a/svx/source/sdr/properties/textproperties.cxx
+++ b/svx/source/sdr/properties/textproperties.cxx
@@ -72,12 +72,14 @@ namespace sdr
}
TextProperties::TextProperties(SdrObject& rObj)
- : AttributeProperties(rObj)
+ : AttributeProperties(rObj),
+ maVersion(0)
{
}
TextProperties::TextProperties(const TextProperties& rProps, SdrObject& rObj)
- : AttributeProperties(rProps, rObj)
+ : AttributeProperties(rProps, rObj),
+ maVersion(rProps.getVersion())
{
}
@@ -93,10 +95,11 @@ namespace sdr
void TextProperties::ItemSetChanged(const SfxItemSet& rSet)
{
SdrTextObj& rObj = (SdrTextObj&)GetSdrObject();
-
-
sal_Int32 nText = rObj.getTextCount();
+ // #i101556# ItemSet has changed -> new version
+ maVersion++;
+
while( --nText >= 0 )
{
SdrText* pText = rObj.getText( nText );
@@ -237,6 +240,9 @@ namespace sdr
// call parent
AttributeProperties::SetStyleSheet(pNewStyleSheet, bDontRemoveHardAttr);
+ // #i101556# StyleSheet has changed -> new version
+ maVersion++;
+
if( rObj.GetModel() /*&& !rObj.IsTextEditActive()*/ && !rObj.IsLinkedText() )
{
SdrOutliner& rOutliner = rObj.ImpGetDrawOutliner();
@@ -577,6 +583,9 @@ namespace sdr
rObj.ActionChanged();
//rObj.BroadcastObjectChange();
}
+
+ // #i101556# content of StyleSheet has changed -> new version
+ maVersion++;
}
if(SFX_HINT_DYING == nId)
@@ -616,6 +625,12 @@ namespace sdr
}
}
}
+
+ // #i101556# Handout version information
+ sal_uInt32 TextProperties::getVersion() const
+ {
+ return maVersion;
+ }
} // end of namespace properties
} // end of namespace sdr
diff --git a/svx/source/svdraw/makefile.mk b/svx/source/svdraw/makefile.mk
index 0ac4b70130..e777ad70d3 100644
--- a/svx/source/svdraw/makefile.mk
+++ b/svx/source/svdraw/makefile.mk
@@ -33,6 +33,7 @@ PRJ=..$/..
PRJNAME=svx
TARGET=svdraw
+LIBTARGET=NO
ENABLE_EXCEPTIONS=TRUE
# --- Settings -----------------------------------------------------
@@ -42,11 +43,11 @@ ENABLE_EXCEPTIONS=TRUE
# --- Files --------------------------------------------------------
-SLOFILES=\
+LIB1TARGET= $(SLB)$/$(TARGET)-core.lib
+LIB1OBJFILES= \
$(SLO)$/svdxcgv.obj \
$(SLO)$/svdmodel.obj \
$(SLO)$/svdpage.obj \
- $(SLO)$/svdoimp.obj \
$(SLO)$/svdobj.obj \
$(SLO)$/svdedtv1.obj \
$(SLO)$/svdcrtv.obj \
@@ -59,7 +60,6 @@ SLOFILES=\
$(SLO)$/svdotextdecomposition.obj \
$(SLO)$/svdotextpathdecomposition.obj \
$(SLO)$/svdouno.obj \
- $(SLO)$/svdfppt.obj \
$(SLO)$/svdpagv.obj \
$(SLO)$/svddrgmt.obj \
$(SLO)$/svdpntv.obj \
@@ -91,11 +91,11 @@ SLOFILES=\
$(SLO)$/svdedtv2.obj \
$(SLO)$/svdedxv.obj \
$(SLO)$/svdetc.obj \
+ $(SLO)$/sdrhittesthelper.obj \
$(SLO)$/svdfmtf.obj \
$(SLO)$/svdglev.obj \
$(SLO)$/svdglue.obj \
$(SLO)$/svdhlpln.obj \
- $(SLO)$/svdibrow.obj \
$(SLO)$/svditer.obj \
$(SLO)$/svdlayer.obj \
$(SLO)$/svdmark.obj \
@@ -105,20 +105,29 @@ SLOFILES=\
$(SLO)$/sdrpagewindow.obj \
$(SLO)$/sdrpaintwindow.obj \
$(SLO)$/svdpoev.obj \
- $(SLO)$/svdscrol.obj \
- $(SLO)$/svdtouch.obj \
$(SLO)$/svdtrans.obj \
- $(SLO)$/svdtxhdl.obj \
$(SLO)$/svdundo.obj \
$(SLO)$/svdviter.obj \
$(SLO)$/clonelist.obj \
- $(SLO)$/ActionDescriptionProvider.obj \
$(SLO)$/svdedtv.obj \
$(SLO)$/selectioncontroller.obj \
$(SLO)$/polypolygoneditor.obj \
- $(SLO)$/svdomedia.obj \
+ $(SLO)$/svdibrow.obj \
+ $(SLO)$/svdomedia.obj
+
+LIB2TARGET= $(SLB)$/$(TARGET).lib
+LIB2OBJFILES= \
+ $(SLO)$/svdoimp.obj \
+ $(SLO)$/svdscrol.obj \
+ $(SLO)$/ActionDescriptionProvider.obj \
$(SLO)$/impgrfll.obj
+LIB3TARGET= $(SLB)$/$(TARGET)-msfilter.lib
+LIB3OBJFILES= \
+ $(SLO)$/svdfppt.obj \
+
+SLOFILES = $(LIB1OBJFILES) $(LIB2OBJFILES) $(LIB3OBJFILES)
+
SRS1NAME=svdstr
SRC1FILES= svdstr.src
diff --git a/svx/source/svdraw/sdrhittesthelper.cxx b/svx/source/svdraw/sdrhittesthelper.cxx
new file mode 100644
index 0000000000..008ae7734e
--- /dev/null
+++ b/svx/source/svdraw/sdrhittesthelper.cxx
@@ -0,0 +1,176 @@
+/*************************************************************************
+ *
+ * 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: svdetc.cxx,v $
+ * $Revision: 1.35.18.2 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_svx.hxx"
+
+#include <svx/sdrhittesthelper.hxx>
+#include <svx/obj3d.hxx>
+#include <svx/helperhittest3d.hxx>
+#include <svx/sdrpagewindow.hxx>
+#include <svx/sdr/contact/viewobjectcontact.hxx>
+#include <svx/sdr/contact/displayinfo.hxx>
+#include <svx/sdr/contact/objectcontact.hxx>
+#include <drawinglayer/processor2d/hittestprocessor2d.hxx>
+#include <svx/svdpagv.hxx>
+#include <svx/sdr/contact/viewcontact.hxx>
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// #i101872# new Object HitTest as View-tooling
+
+SdrObject* SdrObjectPrimitiveHit(
+ const SdrObject& rObject,
+ const Point& rPnt,
+ sal_uInt16 nTol,
+ const SdrPageView& rSdrPageView,
+ const SetOfByte* pVisiLayer,
+ bool bTextOnly)
+{
+ SdrObject* pResult = 0;
+
+ if(rObject.GetSubList() && rObject.GetSubList()->GetObjCount())
+ {
+ // group or scene with content. Single 3D objects also have a
+ // true == rObject.GetSubList(), but no content
+ pResult = SdrObjListPrimitiveHit(*rObject.GetSubList(), rPnt, nTol, rSdrPageView, pVisiLayer, bTextOnly);
+ }
+ else
+ {
+ if(!pVisiLayer || pVisiLayer->IsSet(rObject.GetLayer()))
+ {
+ // single object, 3d object, empty scene or empty group. Check if
+ // it's a single 3D object
+ const E3dCompoundObject* pE3dCompoundObject = dynamic_cast< const E3dCompoundObject* >(&rObject);
+
+ if(pE3dCompoundObject)
+ {
+ const basegfx::B2DPoint aHitPosition(rPnt.X(), rPnt.Y());
+
+ if(checkHitSingle3DObject(aHitPosition, *pE3dCompoundObject))
+ {
+ pResult = const_cast< E3dCompoundObject* >(pE3dCompoundObject);
+ }
+ }
+ else
+ {
+ // not a single 3D object; Check in first PageWindow using prmitives (only SC
+ // with split views uses multiple PageWindows nowadays)
+ if(rSdrPageView.PageWindowCount())
+ {
+ const double fLogicTolerance(nTol);
+ const basegfx::B2DPoint aHitPosition(rPnt.X(), rPnt.Y());
+ const sdr::contact::ViewObjectContact& rVOC = rObject.GetViewContact().GetViewObjectContact(
+ rSdrPageView.GetPageWindow(0)->GetObjectContact());
+
+ if(ViewObjectContactPrimitiveHit(rVOC, aHitPosition, fLogicTolerance, bTextOnly))
+ {
+ pResult = const_cast< SdrObject* >(&rObject);
+ }
+ }
+ }
+ }
+ }
+
+ return pResult;
+}
+
+/////////////////////////////////////////////////////////////////////
+
+SdrObject* SdrObjListPrimitiveHit(
+ const SdrObjList& rList,
+ const Point& rPnt,
+ sal_uInt16 nTol,
+ const SdrPageView& rSdrPageView,
+ const SetOfByte* pVisiLayer,
+ bool bTextOnly)
+{
+ sal_uInt32 nObjNum(rList.GetObjCount());
+ SdrObject* pRetval = 0;
+
+ while(!pRetval && nObjNum > 0)
+ {
+ nObjNum--;
+ SdrObject* pObj = rList.GetObj(nObjNum);
+
+ pRetval = SdrObjectPrimitiveHit(*pObj, rPnt, nTol, rSdrPageView, pVisiLayer, bTextOnly);
+ }
+
+ return pRetval;
+}
+
+/////////////////////////////////////////////////////////////////////
+
+bool ViewObjectContactPrimitiveHit(
+ const sdr::contact::ViewObjectContact& rVOC,
+ const basegfx::B2DPoint& rHitPosition,
+ double fLogicHitTolerance,
+ bool bTextOnly)
+{
+ basegfx::B2DRange aObjectRange(rVOC.getObjectRange());
+
+ if(!aObjectRange.isEmpty())
+ {
+ // first do a rough B2DRange based HitTest; do not forget to
+ // include the HitTolerance if given
+ if(basegfx::fTools::more(fLogicHitTolerance, 0.0))
+ {
+ aObjectRange.grow(fLogicHitTolerance);
+ }
+
+ if(aObjectRange.isInside(rHitPosition))
+ {
+ // get primitive sequence
+ sdr::contact::DisplayInfo aDisplayInfo;
+ const drawinglayer::primitive2d::Primitive2DSequence& rSequence(rVOC.getPrimitive2DSequence(aDisplayInfo));
+
+ if(rSequence.hasElements())
+ {
+ // create a HitTest processor
+ const drawinglayer::geometry::ViewInformation2D& rViewInformation2D = rVOC.GetObjectContact().getViewInformation2D();
+ drawinglayer::processor2d::HitTestProcessor2D aHitTestProcessor2D(
+ rViewInformation2D,
+ rHitPosition,
+ fLogicHitTolerance,
+ bTextOnly);
+
+ // feed it with the primitives
+ aHitTestProcessor2D.process(rSequence);
+
+ // deliver result
+ return aHitTestProcessor2D.getHit();
+ }
+ }
+ }
+
+ return false;
+}
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/source/svdraw/sdrpaintwindow.cxx b/svx/source/svdraw/sdrpaintwindow.cxx
index 05cca4c5ce..276a7d4f8d 100644
--- a/svx/source/svdraw/sdrpaintwindow.cxx
+++ b/svx/source/svdraw/sdrpaintwindow.cxx
@@ -116,8 +116,9 @@ void SdrPaintWindow::impCreateOverlayManager(const bool bUseBuffer)
// When the buffer usage has changed then we have to create a new
// overlay manager. Save the current one so that later we can move its
// overlay objects to the new one.
- ::sdr::overlay::OverlayManager* pOldOverlayManager = NULL;
- if (mbUseBuffer != bUseBuffer)
+ sdr::overlay::OverlayManager* pOldOverlayManager = NULL;
+
+ if(mbUseBuffer != bUseBuffer)
{
mbUseBuffer = bUseBuffer;
pOldOverlayManager = mpOverlayManager;
@@ -134,15 +135,19 @@ void SdrPaintWindow::impCreateOverlayManager(const bool bUseBuffer)
if(GetPaintView().IsBufferedOverlayAllowed() && mbUseBuffer)
{
// buffered OverlayManager, buffers it's background and refreshes from there
- // for pure overlay changes (no system redraw). The 2nd parameter specifies
+ // for pure overlay changes (no system redraw). The 3rd parameter specifies
// if that refresh itself will use a 2nd vdev to avoid flickering.
- mpOverlayManager = new ::sdr::overlay::OverlayManagerBuffered(GetOutputDevice(), sal_True);
+ // Also hand over the evtl. existing old OverlayManager; this means to take over
+ // the registered OverlayObjects from it
+ mpOverlayManager = new ::sdr::overlay::OverlayManagerBuffered(GetOutputDevice(), pOldOverlayManager, true);
}
else
{
// unbuffered OverlayManager, just invalidates places where changes
// take place
- mpOverlayManager = new ::sdr::overlay::OverlayManager(GetOutputDevice());
+ // Also hand over the evtl. existing old OverlayManager; this means to take over
+ // the registered OverlayObjects from it
+ mpOverlayManager = new ::sdr::overlay::OverlayManager(GetOutputDevice(), pOldOverlayManager);
}
OSL_ENSURE(mpOverlayManager, "SdrPaintWindow::SdrPaintWindow: Could not allocate an overlayManager (!)");
@@ -169,33 +174,10 @@ void SdrPaintWindow::impCreateOverlayManager(const bool bUseBuffer)
}
}
- // Because we can not notify the creators of the overlay objects that
- // belong to the old overlay manager we have to move these objects from
- // the old to the new overlay manager and hope for the best (ie that the
- // owner of the overlay objects did not store a pointer to the overlay
- // manager but asks the view for the current one.)
- if (pOldOverlayManager != NULL)
+ // OverlayObjects are transfered for the evtl. newly created OverlayManager by handing over
+ // at construction time
+ if(pOldOverlayManager)
{
- if (mpOverlayManager != NULL)
- {
- // Get a list of all overlay objects added to the old overlay
- // manager. This list is not modified when overlay objects are
- // moved from one overlay manager to the other so its save to
- // iterate over it.
- ::boost::shared_ptr<sdr::overlay::OverlayObjectVector> pOverlayObjects (
- pOldOverlayManager->GetOverlayObjects());
- // Iterate over the list of overlay objects and move, not copy,
- // them from the old to the new overlay manager.
- sdr::overlay::OverlayObjectVector::iterator iOverlay;
- for (iOverlay=pOverlayObjects->begin(); iOverlay!=pOverlayObjects->end(); ++iOverlay)
- {
- if (*iOverlay != NULL)
- {
- pOldOverlayManager->remove(**iOverlay);
- mpOverlayManager->add(**iOverlay);
- }
- }
- }
// The old overlay manager is not used anymore and can be (has to be) deleted.
delete pOldOverlayManager;
}
diff --git a/svx/source/svdraw/svdcrtv.cxx b/svx/source/svdraw/svdcrtv.cxx
index d0d2cd01d2..54cb04d980 100644
--- a/svx/source/svdraw/svdcrtv.cxx
+++ b/svx/source/svdraw/svdcrtv.cxx
@@ -41,28 +41,19 @@
#include <svx/svdetc.hxx>
#include <svx/scene3d.hxx>
#include <svx/view3d.hxx>
-
-// #116425#
#include <svx/sdr/contact/objectcontactofobjlistpainter.hxx>
-
-// #116425#
#include <svx/sdr/contact/displayinfo.hxx>
#include <svx/svdouno.hxx>
-
#define XOR_CREATE_PEN PEN_SOLID
#include <svx/svdopath.hxx>
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
#include <svx/sdr/overlay/overlaypolypolygon.hxx>
#include <svx/sdr/overlay/overlaymanager.hxx>
-#include <svx/sdr/overlay/overlaysdrobject.hxx>
#include <sdrpaintwindow.hxx>
-
-// #i72535#
#include "fmobj.hxx"
-
-// #i68562#
#include <svx/svdocirc.hxx>
+#include <svx/sdr/contact/viewcontact.hxx>
+#include <svx/sdr/overlay/overlayprimitive2dsequenceobject.hxx>
+#include <svx/sdr/overlay/overlaymanager.hxx>
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -172,7 +163,10 @@ void ImpSdrCreateViewExtraData::CreateAndShowOverlay(const SdrCreateView& rView,
{
if(pObject)
{
- ::sdr::overlay::OverlaySdrObject* pNew = new ::sdr::overlay::OverlaySdrObject(basegfx::B2DPoint(), *pObject);
+ const sdr::contact::ViewContact& rVC = pObject->GetViewContact();
+ const drawinglayer::primitive2d::Primitive2DSequence aSequence = rVC.getViewIndependentPrimitive2DSequence();
+ sdr::overlay::OverlayObject* pNew = new sdr::overlay::OverlayPrimitive2DSequenceObject(aSequence);
+
pOverlayManager->add(*pNew);
maObjects.append(*pNew);
}
@@ -799,6 +793,15 @@ void SdrCreateView::ShowCreateObj(/*OutputDevice* pOut, BOOL bFull*/)
// overlay objects instead.
sal_Bool bUseSolidDragging(IsSolidDragging());
+ // #i101648# check if dragged object is a naked SdrObject (no
+ // derivation of). This is e.g. used in SW Frame construction
+ // as placeholder. Do not use SolidDragging for naked SDrObjects,
+ // they cannot have a valid optical representation
+ if(bUseSolidDragging && OBJ_NONE == pAktCreate->GetObjIdentifier())
+ {
+ bUseSolidDragging = false;
+ }
+
// check for objects with no fill and no line
if(bUseSolidDragging)
{
@@ -821,13 +824,15 @@ void SdrCreateView::ShowCreateObj(/*OutputDevice* pOut, BOOL bFull*/)
}
}
- // #i68562# Force to non-solid dragging when not creating a full circle and up to step three
- if(bUseSolidDragging
- && pAktCreate->ISA(SdrCircObj)
- && OBJ_CIRC != (SdrObjKind)(static_cast< SdrCircObj* >(pAktCreate)->GetObjIdentifier())
- && aDragStat.GetPointAnz() < 4L)
+ // #i101781# force to non-solid dragging when not creating a full circle
+ if(bUseSolidDragging)
{
- bUseSolidDragging = false;
+ SdrCircObj* pCircObj = dynamic_cast< SdrCircObj* >(pAktCreate);
+
+ if(pCircObj && OBJ_CIRC != pCircObj->GetObjIdentifier())
+ {
+ bUseSolidDragging = false;
+ }
}
if(bUseSolidDragging)
@@ -869,6 +874,18 @@ void SdrCreateView::ShowCreateObj(/*OutputDevice* pOut, BOOL bFull*/)
{
mpCreateViewExtraData->CreateAndShowOverlay(*this, 0, pAktCreate->TakeCreatePoly(aDragStat));
}
+
+ // #i101679# Force changed overlay to be shown
+ for(sal_uInt32 a(0); a < PaintWindowCount(); a++)
+ {
+ SdrPaintWindow* pCandidate = GetPaintWindow(a);
+ sdr::overlay::OverlayManager* pOverlayManager = pCandidate->GetOverlayManager();
+
+ if(pOverlayManager)
+ {
+ pOverlayManager->flush();
+ }
+ }
}
aDragStat.SetShown(TRUE);
diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx
index f4a0f5225c..5c582541e2 100644
--- a/svx/source/svdraw/svddrgmt.cxx
+++ b/svx/source/svdraw/svddrgmt.cxx
@@ -2551,7 +2551,7 @@ bool SdrDragGradient::BeginSdrDrag()
{
basegfx::B2DPoint aPosition(DragStat().GetStart().X(), DragStat().GetStart().Y());
- if(pColHdl->getOverlayObjectList().isHit(aPosition))
+ if(pColHdl->getOverlayObjectList().isHitLogic(aPosition))
{
bHit = true;
pIAOHandle->SetMoveSingleHandle(true);
@@ -2566,7 +2566,7 @@ bool SdrDragGradient::BeginSdrDrag()
{
basegfx::B2DPoint aPosition(DragStat().GetStart().X(), DragStat().GetStart().Y());
- if(pColHdl->getOverlayObjectList().isHit(aPosition))
+ if(pColHdl->getOverlayObjectList().isHitLogic(aPosition))
{
bHit = true;
pIAOHandle->SetMoveSingleHandle(true);
@@ -2578,7 +2578,7 @@ bool SdrDragGradient::BeginSdrDrag()
{
basegfx::B2DPoint aPosition(DragStat().GetStart().X(), DragStat().GetStart().Y());
- if(pIAOHandle->getOverlayObjectList().isHit(aPosition))
+ if(pIAOHandle->getOverlayObjectList().isHitLogic(aPosition))
{
bHit = true;
}
diff --git a/svx/source/svdraw/svddrgv.cxx b/svx/source/svdraw/svddrgv.cxx
index 49c2038c52..36d78ffc97 100644
--- a/svx/source/svdraw/svddrgv.cxx
+++ b/svx/source/svdraw/svddrgv.cxx
@@ -51,6 +51,7 @@
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <svx/polypolygoneditor.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <svx/sdr/overlay/overlaymanager.hxx>
using namespace sdr;
@@ -844,6 +845,9 @@ void SdrDragView::ShowDragObj()
if(pOverlayManager)
{
mpCurrentSdrDragMethod->CreateOverlayGeometry(*pOverlayManager);
+
+ // #i101679# Force changed overlay to be shown
+ pOverlayManager->flush();
}
}
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 6c25af2441..adca082371 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -246,7 +246,7 @@ void SdrObjEditView::ModelHasChanged()
eNewAnchor=(EVAnchorMode)pTextObj->GetOutlinerViewAnchorMode();
bAnchorChg=eOldAnchor!=eNewAnchor;
Color aOldColor(pTextEditOutlinerView->GetBackgroundColor());
- aNewColor=ImpGetTextEditBackgroundColor();
+ aNewColor = GetTextEditBackgroundColor(*this);
bColorChg=aOldColor!=aNewColor;
}
// #104082# refresh always when it's a contour frame. That
@@ -425,52 +425,10 @@ void SdrObjEditView::ImpInvalidateOutlinerView(OutlinerView& rOutlView) const
}
}
-Color SdrObjEditView::ImpGetTextEditBackgroundColor() const
-{
- // #108759# Extracted significant parts to SdrPaintView::CalcBackgroundColor()
- svtools::ColorConfig aColorConfig;
- Color aBackground(aColorConfig.GetColorValue(svtools::DOCCOLOR).nColor);
- const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
-
- if(!rStyleSettings.GetHighContrastMode())
- {
- bool bFound=false;
- SdrTextObj* pText = dynamic_cast< SdrTextObj * >( mxTextEditObj.get());
- if (pText!=NULL && pText->IsClosedObj())
- {
- ::sdr::table::SdrTableObj* pTable = dynamic_cast< ::sdr::table::SdrTableObj * >( pText );
- if( pTable )
- bFound = GetDraftFillColor(pTable->GetActiveCellItemSet(), aBackground );
-
- if( !bFound )
- bFound=GetDraftFillColor(pText->GetMergedItemSet(), aBackground);
- }
- if (!bFound && pTextEditPV!=NULL && pText)
- {
- // #108784#
- Point aPvOfs(pText->GetTextEditOffset());
-
- const SdrPage* pPg=pTextEditPV->GetPage();
-
- // #112690#
- // Test existance of the page before using CalcBackgroundColor
- if(pPg)
- {
- Rectangle aSnapRect( pText->GetSnapRect() );
- aSnapRect.Move(aPvOfs.X(), aPvOfs.Y());
-
- return CalcBackgroundColor( aSnapRect, pTextEditPV->GetVisibleLayers(), *pPg );
- }
- }
- }
-
- return aBackground;
-}
-
OutlinerView* SdrObjEditView::ImpMakeOutlinerView(Window* pWin, BOOL /*bNoPaint*/, OutlinerView* pGivenView) const
{
// Hintergrund
- Color aBackground(ImpGetTextEditBackgroundColor());
+ Color aBackground(GetTextEditBackgroundColor(*this));
SdrTextObj* pText = dynamic_cast< SdrTextObj * >( mxTextEditObj.get() );
BOOL bTextFrame=pText!=NULL && pText->IsTextFrame();
BOOL bContourFrame=pText!=NULL && pText->IsContourTextFrame();
diff --git a/svx/source/svdraw/svdetc.cxx b/svx/source/svdraw/svdetc.cxx
index 7c7aef9e59..0487aafb3c 100644
--- a/svx/source/svdraw/svdetc.cxx
+++ b/svx/source/svdraw/svdetc.cxx
@@ -31,10 +31,8 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
#include "forbiddencharacterstable.hxx"
-
#include <com/sun/star/embed/XEmbeddedObject.hpp>
#include <com/sun/star/embed/EmbedStates.hpp>
-
#include <svx/svdetc.hxx>
#include "svditext.hxx"
#include <svx/svdmodel.hxx>
@@ -68,15 +66,14 @@
#include <i18npool/lang.h>
#include <unotools/charclass.hxx>
#include <svtools/syslocale.hxx>
-
-// #97870#
#include <svx/xflbckit.hxx>
#include <svx/extrusionbar.hxx>
#include <svx/fontworkbar.hxx>
#include <vcl/svapp.hxx> //add CHINA001
-
-//#i80528#
#include <svx/sdr/contact/viewcontact.hxx>
+#include <svx/svdpage.hxx>
+#include <svx/svdotable.hxx>
+#include <svx/sdrhittesthelper.hxx>
using namespace ::com::sun::star;
@@ -847,6 +844,258 @@ void SvdProgressInfo::ReportError()
}
////////////////////////////////////////////////////////////////////////////////////////////////////
+// #i101872# isolate GetTextEditBackgroundColor to tooling; it woll anyways only be used as long
+// as text edit is not running on overlay
+
+namespace
+{
+ bool impGetSdrObjListFillColor(
+ const SdrObjList& rList,
+ const Point& rPnt,
+ const SdrPageView& rTextEditPV,
+ const SetOfByte& rVisLayers,
+ Color& rCol)
+ {
+ if(!rList.GetModel())
+ return false;
+
+ bool bRet(false);
+ bool bMaster(rList.GetPage() ? rList.GetPage()->IsMasterPage() : false);
+
+ for(ULONG no(rList.GetObjCount()); !bRet && no > 0; )
+ {
+ no--;
+ SdrObject* pObj = rList.GetObj(no);
+ SdrObjList* pOL = pObj->GetSubList();
+
+ if(pOL)
+ {
+ // group object
+ bRet = impGetSdrObjListFillColor(*pOL, rPnt, rTextEditPV, rVisLayers, rCol);
+ }
+ else
+ {
+ SdrTextObj* pText = dynamic_cast< SdrTextObj * >(pObj);
+
+ // #108867# Exclude zero master page object (i.e. background shape) from color query
+ if(pText
+ && pObj->IsClosedObj()
+ && (!bMaster || (!pObj->IsNotVisibleAsMaster() && 0 != no))
+ && pObj->GetCurrentBoundRect().IsInside(rPnt)
+ && !pText->IsHideContour()
+ && SdrObjectPrimitiveHit(*pObj, rPnt, 0, rTextEditPV, &rVisLayers, false))
+ {
+ bRet = GetDraftFillColor(pObj->GetMergedItemSet(), rCol);
+ }
+ }
+ }
+
+ return bRet;
+ }
+
+ bool impGetSdrPageFillColor(
+ const SdrPage& rPage,
+ const Point& rPnt,
+ const SdrPageView& rTextEditPV,
+ const SetOfByte& rVisLayers,
+ Color& rCol,
+ bool bSkipBackgroundShape)
+ {
+ if(!rPage.GetModel())
+ return false;
+
+ bool bRet(impGetSdrObjListFillColor(rPage, rPnt, rTextEditPV, rVisLayers, rCol));
+
+ if(!bRet && !rPage.IsMasterPage())
+ {
+ if(rPage.TRG_HasMasterPage())
+ {
+ SetOfByte aSet(rVisLayers);
+ aSet &= rPage.TRG_GetMasterPageVisibleLayers();
+ SdrPage& rMasterPage = rPage.TRG_GetMasterPage();
+
+ // #108867# Don't fall back to background shape on
+ // master pages. This is later handled by
+ // GetBackgroundColor, and is necessary to cater for
+ // the silly ordering: 1. shapes, 2. master page
+ // shapes, 3. page background, 4. master page
+ // background.
+ bRet = impGetSdrPageFillColor(rMasterPage, rPnt, rTextEditPV, aSet, rCol, true);
+ }
+ }
+
+ // #108867# Only now determine background color from background shapes
+ if(!bRet && !bSkipBackgroundShape)
+ {
+ rCol = rPage.GetPageBackgroundColor();
+ return true;
+ }
+
+ return bRet;
+ }
+
+ Color impCalcBackgroundColor(
+ const Rectangle& rArea,
+ const SdrPageView& rTextEditPV,
+ const SdrPage& rPage)
+ {
+ svtools::ColorConfig aColorConfig;
+ Color aBackground(aColorConfig.GetColorValue(svtools::DOCCOLOR).nColor);
+ const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
+
+ if(!rStyleSettings.GetHighContrastMode())
+ {
+ // search in page
+ const USHORT SPOTCOUNT(5);
+ Point aSpotPos[SPOTCOUNT];
+ Color aSpotColor[SPOTCOUNT];
+ ULONG nHeight( rArea.GetSize().Height() );
+ ULONG nWidth( rArea.GetSize().Width() );
+ ULONG nWidth14 = nWidth / 4;
+ ULONG nHeight14 = nHeight / 4;
+ ULONG nWidth34 = ( 3 * nWidth ) / 4;
+ ULONG nHeight34 = ( 3 * nHeight ) / 4;
+
+ USHORT i;
+ for ( i = 0; i < SPOTCOUNT; i++ )
+ {
+ // five spots are used
+ switch ( i )
+ {
+ case 0 :
+ {
+ // Center-Spot
+ aSpotPos[i] = rArea.Center();
+ }
+ break;
+
+ case 1 :
+ {
+ // TopLeft-Spot
+ aSpotPos[i] = rArea.TopLeft();
+ aSpotPos[i].X() += nWidth14;
+ aSpotPos[i].Y() += nHeight14;
+ }
+ break;
+
+ case 2 :
+ {
+ // TopRight-Spot
+ aSpotPos[i] = rArea.TopLeft();
+ aSpotPos[i].X() += nWidth34;
+ aSpotPos[i].Y() += nHeight14;
+ }
+ break;
+
+ case 3 :
+ {
+ // BottomLeft-Spot
+ aSpotPos[i] = rArea.TopLeft();
+ aSpotPos[i].X() += nWidth14;
+ aSpotPos[i].Y() += nHeight34;
+ }
+ break;
+
+ case 4 :
+ {
+ // BottomRight-Spot
+ aSpotPos[i] = rArea.TopLeft();
+ aSpotPos[i].X() += nWidth34;
+ aSpotPos[i].Y() += nHeight34;
+ }
+ break;
+
+ }
+
+ aSpotColor[i] = Color( COL_WHITE );
+ impGetSdrPageFillColor(rPage, aSpotPos[i], rTextEditPV, rTextEditPV.GetVisibleLayers(), aSpotColor[i], false);
+ }
+
+ USHORT aMatch[SPOTCOUNT];
+
+ for ( i = 0; i < SPOTCOUNT; i++ )
+ {
+ // were same spot colors found?
+ aMatch[i] = 0;
+
+ for ( USHORT j = 0; j < SPOTCOUNT; j++ )
+ {
+ if( j != i )
+ {
+ if( aSpotColor[i] == aSpotColor[j] )
+ {
+ aMatch[i]++;
+ }
+ }
+ }
+ }
+
+ // highest weight to center spot
+ aBackground = aSpotColor[0];
+
+ for ( USHORT nMatchCount = SPOTCOUNT - 1; nMatchCount > 1; nMatchCount-- )
+ {
+ // which spot color was found most?
+ for ( i = 0; i < SPOTCOUNT; i++ )
+ {
+ if( aMatch[i] == nMatchCount )
+ {
+ aBackground = aSpotColor[i];
+ nMatchCount = 1; // break outer for-loop
+ break;
+ }
+ }
+ }
+ }
+
+ return aBackground;
+ }
+} // end of anonymous namespace
+
+Color GetTextEditBackgroundColor(const SdrObjEditView& rView)
+{
+ svtools::ColorConfig aColorConfig;
+ Color aBackground(aColorConfig.GetColorValue(svtools::DOCCOLOR).nColor);
+ const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
+
+ if(!rStyleSettings.GetHighContrastMode())
+ {
+ bool bFound(false);
+ SdrTextObj* pText = dynamic_cast< SdrTextObj * >(rView.GetTextEditObject());
+
+ if(pText && pText->IsClosedObj())
+ {
+ ::sdr::table::SdrTableObj* pTable = dynamic_cast< ::sdr::table::SdrTableObj * >( pText );
+
+ if( pTable )
+ bFound = GetDraftFillColor(pTable->GetActiveCellItemSet(), aBackground );
+
+ if( !bFound )
+ bFound=GetDraftFillColor(pText->GetMergedItemSet(), aBackground);
+ }
+ if(!bFound && pText)
+ {
+ SdrPageView* pTextEditPV = rView.GetTextEditPageView();
+
+ if(pTextEditPV)
+ {
+ Point aPvOfs(pText->GetTextEditOffset());
+ const SdrPage* pPg = pTextEditPV->GetPage();
+
+ if(pPg)
+ {
+ Rectangle aSnapRect( pText->GetSnapRect() );
+ aSnapRect.Move(aPvOfs.X(), aPvOfs.Y());
+
+ return impCalcBackgroundColor(aSnapRect, *pTextEditPV, *pPg);
+ }
+ }
+ }
+ }
+ return aBackground;
+}
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/source/svdraw/svdfmtf.cxx b/svx/source/svdraw/svdfmtf.cxx
index df52800ab4..52bfccdc0c 100644
--- a/svx/source/svdraw/svdfmtf.cxx
+++ b/svx/source/svdraw/svdfmtf.cxx
@@ -476,6 +476,12 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaChordAction& rAct)
bool ImpSdrGDIMetaFileImport::CheckLastLineMerge(const basegfx::B2DPolygon& rSrcPoly)
{
+ // #i102706# Do not merge closed polygons
+ if(rSrcPoly.isClosed())
+ {
+ return false;
+ }
+
// #i73407# reformulation to use new B2DPolygon classes
if(bLastObjWasLine && (aOldLineColor == aVD.GetLineColor()) && rSrcPoly.count())
{
@@ -489,6 +495,12 @@ bool ImpSdrGDIMetaFileImport::CheckLastLineMerge(const basegfx::B2DPolygon& rSrc
bool bOk(false);
basegfx::B2DPolygon aDstPoly(pLastPoly->GetPathPoly().getB2DPolygon(0L));
+ // #i102706# Do not merge closed polygons
+ if(aDstPoly.isClosed())
+ {
+ return false;
+ }
+
if(aDstPoly.count())
{
const sal_uInt32 nMaxDstPnt(aDstPoly.count() - 1L);
diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx
index 2a36ff870c..9606b6e594 100644
--- a/svx/source/svdraw/svdhdl.cxx
+++ b/svx/source/svdraw/svdhdl.cxx
@@ -34,7 +34,6 @@
#include <algorithm>
#include <svx/svdhdl.hxx>
-#include "svdtouch.hxx"
#include <svx/svdpagv.hxx>
#include <svx/svdetc.hxx>
#include <svx/svdmrkv.hxx>
@@ -62,8 +61,7 @@
#include <svx/sdr/overlay/overlaymanager.hxx>
#include <svx/sdr/overlay/overlayanimatedbitmapex.hxx>
#include <svx/sdr/overlay/overlaybitmapex.hxx>
-#include <svx/sdr/overlay/overlaybitmap.hxx>
-#include <svx/sdr/overlay/overlaylinestriped.hxx>
+#include <svx/sdr/overlay/overlayline.hxx>
#include <svx/sdr/overlay/overlaytriangle.hxx>
#include <svx/sdr/overlay/overlayhatchrect.hxx>
#include <svx/sdrpagewindow.hxx>
@@ -83,36 +81,63 @@
class SdrHdlBitmapSet
{
// the bitmap holding all infos
- BitmapEx maMarkersBitmap;
+ BitmapEx maMarkersBitmap;
+
+ // the cropped Bitmaps for reusage
+ ::std::vector< BitmapEx > maRealMarkers;
+
+ // elpers
+ BitmapEx& impGetOrCreateTargetBitmap(sal_uInt16 nIndex, const Rectangle& rRectangle);
public:
SdrHdlBitmapSet(UINT16 nResId);
~SdrHdlBitmapSet();
- BitmapEx GetBitmapEx(BitmapMarkerKind eKindOfMarker, UINT16 nInd=0);
+ const BitmapEx& GetBitmapEx(BitmapMarkerKind eKindOfMarker, UINT16 nInd=0);
};
////////////////////////////////////////////////////////////////////////////////////////////////////
+#define KIND_COUNT (14)
+#define INDEX_COUNT (6)
+#define INDIVIDUAL_COUNT (4)
SdrHdlBitmapSet::SdrHdlBitmapSet(UINT16 nResId)
+: maMarkersBitmap(),
+ // 14 kinds (BitmapMarkerKind) use index [0..5], 4 extra
+ maRealMarkers((KIND_COUNT * INDEX_COUNT) + INDIVIDUAL_COUNT)
{
// #101928# change color used for transparent parts to 0x00ff00ff (ImageList standard)
- Color aColTransparent(0x00ff00ff);
- Bitmap aBitmap(ResId(nResId, *ImpGetResMgr()));
- maMarkersBitmap = BitmapEx(aBitmap, aColTransparent);
+ const Color aColTransparent(0x00ff00ff);
+ const Bitmap aBitmap(ResId(nResId, *ImpGetResMgr()));
+ const Bitmap aMask(aBitmap.CreateMask(aColTransparent));
+
+ // create a real BitmapEx with an AlphaMask
+ maMarkersBitmap = BitmapEx(aBitmap, aMask);
+ // maMarkersBitmap = BitmapEx(aBitmap, aColTransparent);
}
SdrHdlBitmapSet::~SdrHdlBitmapSet()
{
}
-// #i15222#
+BitmapEx& SdrHdlBitmapSet::impGetOrCreateTargetBitmap(sal_uInt16 nIndex, const Rectangle& rRectangle)
+{
+ BitmapEx& rTargetBitmap = maRealMarkers[nIndex];
+
+ if(rTargetBitmap.IsEmpty())
+ {
+ rTargetBitmap = maMarkersBitmap;
+ rTargetBitmap.Crop(rRectangle);
+ }
+
+ return rTargetBitmap;
+}
+
// change getting of bitmap to use the big ressource bitmap
-BitmapEx SdrHdlBitmapSet::GetBitmapEx(BitmapMarkerKind eKindOfMarker, UINT16 nInd)
+const BitmapEx& SdrHdlBitmapSet::GetBitmapEx(BitmapMarkerKind eKindOfMarker, UINT16 nInd)
{
// fill in size and source position in maMarkersBitmap
const sal_uInt16 nYPos(nInd * 11);
- Rectangle aSourceRect;
switch(eKindOfMarker)
{
@@ -123,140 +148,135 @@ BitmapEx SdrHdlBitmapSet::GetBitmapEx(BitmapMarkerKind eKindOfMarker, UINT16 nIn
}
case Rect_7x7:
{
- aSourceRect = Rectangle(Point(0, nYPos), Size(7, 7));
- break;
+ return impGetOrCreateTargetBitmap((0 * INDEX_COUNT) + nInd, Rectangle(Point(0, nYPos), Size(7, 7)));
}
case Rect_9x9:
{
- aSourceRect = Rectangle(Point(7, nYPos), Size(9, 9));
- break;
+ return impGetOrCreateTargetBitmap((1 * INDEX_COUNT) + nInd, Rectangle(Point(7, nYPos), Size(9, 9)));
}
case Rect_11x11:
{
- aSourceRect = Rectangle(Point(16, nYPos), Size(11, 11));
- break;
+ return impGetOrCreateTargetBitmap((2 * INDEX_COUNT) + nInd, Rectangle(Point(16, nYPos), Size(11, 11)));
}
case Rect_13x13:
{
+ const sal_uInt16 nIndex((3 * INDEX_COUNT) + nInd);
+
switch(nInd)
{
- case 0: aSourceRect = Rectangle(Point(72, 66), Size(13, 13)); break;
- case 1: aSourceRect = Rectangle(Point(85, 66), Size(13, 13)); break;
- case 2: aSourceRect = Rectangle(Point(72, 78), Size(13, 13)); break;
- case 3: aSourceRect = Rectangle(Point(85, 78), Size(13, 13)); break;
- case 4: aSourceRect = Rectangle(Point(98, 78), Size(13, 13)); break;
- case 5: aSourceRect = Rectangle(Point(98, 66), Size(13, 13)); break;
+ case 0:
+ {
+ return impGetOrCreateTargetBitmap(nIndex, Rectangle(Point(72, 66), Size(13, 13)));
+ }
+ case 1:
+ {
+ return impGetOrCreateTargetBitmap(nIndex, Rectangle(Point(85, 66), Size(13, 13)));
+ }
+ case 2:
+ {
+ return impGetOrCreateTargetBitmap(nIndex, Rectangle(Point(72, 78), Size(13, 13)));
+ }
+ case 3:
+ {
+ return impGetOrCreateTargetBitmap(nIndex, Rectangle(Point(85, 78), Size(13, 13)));
+ }
+ case 4:
+ {
+ return impGetOrCreateTargetBitmap(nIndex, Rectangle(Point(98, 78), Size(13, 13)));
+ }
+ default: // case 5:
+ {
+ return impGetOrCreateTargetBitmap(nIndex, Rectangle(Point(98, 66), Size(13, 13)));
+ }
}
-
- break;
}
case Circ_7x7:
{
- aSourceRect = Rectangle(Point(27, nYPos), Size(7, 7));
- break;
+ return impGetOrCreateTargetBitmap((4 * INDEX_COUNT) + nInd, Rectangle(Point(27, nYPos), Size(7, 7)));
}
case Circ_9x9:
case Customshape1:
{
- aSourceRect = Rectangle(Point(34, nYPos), Size(9, 9));
- break;
+ return impGetOrCreateTargetBitmap((5 * INDEX_COUNT) + nInd, Rectangle(Point(34, nYPos), Size(9, 9)));
}
case Circ_11x11:
{
- aSourceRect = Rectangle(Point(43, nYPos), Size(11, 11));
- break;
+ return impGetOrCreateTargetBitmap((6 * INDEX_COUNT) + nInd, Rectangle(Point(43, nYPos), Size(11, 11)));
}
case Elli_7x9:
{
- aSourceRect = Rectangle(Point(54, nYPos), Size(7, 9));
- break;
+ return impGetOrCreateTargetBitmap((7 * INDEX_COUNT) + nInd, Rectangle(Point(54, nYPos), Size(7, 9)));
}
case Elli_9x11:
{
- aSourceRect = Rectangle(Point(61, nYPos), Size(9, 11));
- break;
+ return impGetOrCreateTargetBitmap((8 * INDEX_COUNT) + nInd, Rectangle(Point(61, nYPos), Size(9, 11)));
}
case Elli_9x7:
{
- aSourceRect = Rectangle(Point(70, nYPos), Size(9, 7));
- break;
+ return impGetOrCreateTargetBitmap((9 * INDEX_COUNT) + nInd, Rectangle(Point(70, nYPos), Size(9, 7)));
}
case Elli_11x9:
{
- aSourceRect = Rectangle(Point(79, nYPos), Size(11, 9));
- break;
+ return impGetOrCreateTargetBitmap((10 * INDEX_COUNT) + nInd, Rectangle(Point(79, nYPos), Size(11, 9)));
}
case RectPlus_7x7:
{
- aSourceRect = Rectangle(Point(90, nYPos), Size(7, 7));
- break;
+ return impGetOrCreateTargetBitmap((11 * INDEX_COUNT) + nInd, Rectangle(Point(90, nYPos), Size(7, 7)));
}
case RectPlus_9x9:
{
- aSourceRect = Rectangle(Point(97, nYPos), Size(9, 9));
- break;
+ return impGetOrCreateTargetBitmap((12 * INDEX_COUNT) + nInd, Rectangle(Point(97, nYPos), Size(9, 9)));
}
case RectPlus_11x11:
{
- aSourceRect = Rectangle(Point(106, nYPos), Size(11, 11));
- break;
+ return impGetOrCreateTargetBitmap((13 * INDEX_COUNT) + nInd, Rectangle(Point(106, nYPos), Size(11, 11)));
}
case Crosshair:
{
- aSourceRect = Rectangle(Point(0, 68), Size(15, 15));
- break;
+ return impGetOrCreateTargetBitmap((KIND_COUNT * INDEX_COUNT) + 0, Rectangle(Point(0, 68), Size(15, 15)));
}
case Glue:
{
- aSourceRect = Rectangle(Point(15, 74), Size(9, 9));
- break;
+ return impGetOrCreateTargetBitmap((KIND_COUNT * INDEX_COUNT) + 1, Rectangle(Point(15, 74), Size(9, 9)));
}
- case Anchor:
- // #101688# AnchorTR for SW
+ case Anchor: // #101688# AnchorTR for SW
case AnchorTR:
{
- aSourceRect = Rectangle(Point(24, 68), Size(24, 23));
- break;
+ return impGetOrCreateTargetBitmap((KIND_COUNT * INDEX_COUNT) + 2, Rectangle(Point(24, 68), Size(24, 23)));
}
// #98388# add AnchorPressed to be able to aninate anchor control
case AnchorPressed:
case AnchorPressedTR:
{
- aSourceRect = Rectangle(Point(48, 68), Size(24, 23));
- break;
+ return impGetOrCreateTargetBitmap((KIND_COUNT * INDEX_COUNT) + 3, Rectangle(Point(48, 68), Size(24, 23)));
}
}
- // construct return bitmap
- BitmapEx aRetval(maMarkersBitmap);
- aRetval.Crop(aSourceRect);
-
- return aRetval;
+ // cannot happen since all pathes return something; return Rect_7x7 as default (see switch)
+ return maRealMarkers[0];
}
////////////////////////////////////////////////////////////////////////////////////////////////////
SdrHdlBitmapSet* SdrHdl::pSimpleSet = NULL;
SdrHdlBitmapSet* SdrHdl::pModernSet = NULL;
-
-// #101928#
SdrHdlBitmapSet* SdrHdl::pHighContrastSet = NULL;
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -810,7 +830,7 @@ bool SdrHdl::IsHdlHit(const Point& rPnt) const
{
// OVERLAYMANAGER
basegfx::B2DPoint aPosition(rPnt.X(), rPnt.Y());
- return maOverlayGroup.isHit(aPosition);
+ return maOverlayGroup.isHitLogic(aPosition);
}
Pointer SdrHdl::GetPointer() const
@@ -984,8 +1004,9 @@ void SdrHdlColor::CreateB2dIAObject()
Bitmap aBmpCol(CreateColorDropper(aMarkerColor));
basegfx::B2DPoint aPosition(aPos.X(), aPos.Y());
::sdr::overlay::OverlayObject* pNewOverlayObject = new
- ::sdr::overlay::OverlayBitmap(
- aPosition, aBmpCol,
+ ::sdr::overlay::OverlayBitmapEx(
+ aPosition,
+ BitmapEx(aBmpCol),
(UINT16)(aBmpCol.GetSizePixel().Width() - 1) >> 1,
(UINT16)(aBmpCol.GetSizePixel().Height() - 1) >> 1
);
@@ -1183,11 +1204,13 @@ void SdrHdlGradient::CreateB2dIAObject()
pNewOverlayObject = new
::sdr::overlay::OverlayTriangle(
- aPositionLeft, aPosition2, aPositionRight
+ aPositionLeft,
+ aPosition2,
+ aPositionRight,
+ IsGradient() ? Color(COL_BLACK) : Color(COL_BLUE)
);
DBG_ASSERT(pNewOverlayObject, "Got NO new IAO!");
- pNewOverlayObject->setBaseColor(IsGradient() ? Color(COL_BLACK) : Color(COL_BLUE));
rPageWindow.GetOverlayManager()->add(*pNewOverlayObject);
maOverlayGroup.append(*pNewOverlayObject);
}
@@ -1331,13 +1354,6 @@ void SdrHdlLine::CreateB2dIAObject()
}
}
-bool SdrHdlLine::IsHdlHit(const Point& rPnt) const
-{
- // OVERLAYMANAGER
- basegfx::B2DPoint aPosition(rPnt.X(), rPnt.Y());
- return maOverlayGroup.isHit(aPosition);
-}
-
Pointer SdrHdlLine::GetPointer() const
{
return Pointer(POINTER_REFHAND);
@@ -1689,7 +1705,8 @@ void ImpTextframeHdl::CreateB2dIAObject()
aTopLeft,
aBottomRight,
aHatchCol,
- 6.0,
+ 3.0,
+ 3.0,
45 * F_PI180,
nDrehWink * -F_PI18000);
pNewOverlayObject->setHittable(false);
diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx
index e568e7ea93..991582d84b 100644
--- a/svx/source/svdraw/svdmodel.cxx
+++ b/svx/source/svdraw/svdmodel.cxx
@@ -1882,6 +1882,11 @@ uno::Reference< uno::XInterface > SdrModel::getUnoModel()
return mxUnoModel;
}
+void SdrModel::setUnoModel( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xModel )
+{
+ mxUnoModel = xModel;
+}
+
uno::Reference< uno::XInterface > SdrModel::createUnoModel()
{
DBG_ERROR( "SdrModel::createUnoModel() - base implementation should not be called!" );
diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index 37a7140941..d5afb80d15 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -48,26 +48,19 @@
#include <svx/svdoole2.hxx>
#include <svx/xgrad.hxx>
#include <svx/xflgrit.hxx>
-
#include "gradtrns.hxx"
#include <svx/xflftrit.hxx>
-
#include <svx/dialmgr.hxx>
#include "svdstr.hrc"
#include <svx/svdundo.hxx>
-
-// #105722#
#include <svx/svdopath.hxx>
-
-// #i13033#
#include <svx/scene3d.hxx>
-
-// OD 30.06.2003 #108784#
#include <svx/svdovirt.hxx>
#include <svx/sdr/overlay/overlayrollingrectangle.hxx>
#include <svx/sdr/overlay/overlaymanager.hxx>
#include <sdrpaintwindow.hxx>
#include <svx/sdrpagewindow.hxx>
+#include <svx/sdrhittesthelper.hxx>
////////////////////////////////////////////////////////////////////////////////////////////////////
// predefines
@@ -109,7 +102,7 @@ ImplMarkingOverlay::ImplMarkingOverlay(const SdrPaintView& rView, const basegfx:
if(pTargetOverlay)
{
::sdr::overlay::OverlayRollingRectangleStriped* pNew = new ::sdr::overlay::OverlayRollingRectangleStriped(
- rStartPos, rStartPos, sal_False);
+ rStartPos, rStartPos, false);
pTargetOverlay->add(*pNew);
maObjects.append(*pNew);
}
@@ -1290,7 +1283,7 @@ BOOL SdrMarkView::IsMarkedObjHit(const Point& rPnt, short nTol) const
Point aPt(rPnt);
for (ULONG nm=0; nm<GetMarkedObjectCount() && !bRet; nm++) {
SdrMark* pM=GetSdrMarkByIndex(nm);
- bRet=ImpIsObjHit(aPt,USHORT(nTol),pM->GetMarkedSdrObj(),pM->GetPageView(),0);
+ bRet = 0 != CheckSingleSdrObjectHit(aPt,USHORT(nTol),pM->GetMarkedSdrObj(),pM->GetPageView(),0,0);
}
return bRet;
}
@@ -1391,7 +1384,8 @@ BOOL SdrMarkView::MarkNextObj(const Point& rPnt, short nTol, BOOL bPrev)
for (nm=nMarkAnz; nm>0 && pTopMarkHit==NULL;) {
nm--;
SdrMark* pM=GetSdrMarkByIndex(nm);
- if (ImpIsObjHit(aPt,USHORT(nTol),pM->GetMarkedSdrObj(),pM->GetPageView(),0)) {
+ if(CheckSingleSdrObjectHit(aPt,USHORT(nTol),pM->GetMarkedSdrObj(),pM->GetPageView(),0,0))
+ {
pTopMarkHit=pM;
nTopMarkHit=nm;
}
@@ -1407,7 +1401,8 @@ BOOL SdrMarkView::MarkNextObj(const Point& rPnt, short nTol, BOOL bPrev)
for (nm=0; nm<nMarkAnz && pBtmMarkHit==NULL; nm++) {
SdrMark* pM=GetSdrMarkByIndex(nm);
SdrPageView* pPV2=pM->GetPageView();
- if (pPV2==pPV && ImpIsObjHit(aPt,USHORT(nTol),pM->GetMarkedSdrObj(),pPV2,0)) {
+ if (pPV2==pPV && CheckSingleSdrObjectHit(aPt,USHORT(nTol),pM->GetMarkedSdrObj(),pPV2,0,0))
+ {
pBtmMarkHit=pM;
nBtmMarkHit=nm;
}
@@ -1464,7 +1459,8 @@ BOOL SdrMarkView::MarkNextObj(const Point& rPnt, short nTol, BOOL bPrev)
pObj = pObjList->GetObj(no);
}
- if (ImpIsObjHit(aPt,USHORT(nTol),pObj,pPV,SDRSEARCH_TESTMARKABLE)) {
+ if (CheckSingleSdrObjectHit(aPt,USHORT(nTol),pObj,pPV,SDRSEARCH_TESTMARKABLE,0))
+ {
if (TryToFindMarkedObject(pObj)==CONTAINER_ENTRY_NOTFOUND) {
pFndObj=pObj;
} else {
@@ -1590,7 +1586,7 @@ void SdrMarkView::SetMarkHdlSizePixel(USHORT nSiz)
}
#define SDRSEARCH_IMPISMASTER 0x80000000 /* MasterPage wird gerade durchsucht */
-SdrObject* SdrMarkView::ImpCheckObjHit(const Point& rPnt, USHORT nTol, SdrObject* pObj, SdrPageView* pPV, ULONG nOptions, const SetOfByte* pMVisLay) const
+SdrObject* SdrMarkView::CheckSingleSdrObjectHit(const Point& rPnt, USHORT nTol, SdrObject* pObj, SdrPageView* pPV, ULONG nOptions, const SetOfByte* pMVisLay) const
{
if((nOptions & SDRSEARCH_IMPISMASTER) && pObj->IsNotVisibleAsMaster())
{
@@ -1636,15 +1632,13 @@ SdrObject* SdrMarkView::ImpCheckObjHit(const Point& rPnt, USHORT nTol, SdrObject
aPnt.Move( -aOffset.X(), -aOffset.Y() );
}
- pRet=ImpCheckObjHit(aPnt,nTol,pOL,pPV,nOptions,pMVisLay,pTmpObj);
+ pRet=CheckSingleSdrObjectHit(aPnt,nTol,pOL,pPV,nOptions,pMVisLay,pTmpObj);
}
else
{
- SdrLayerID nLay=pObj->GetLayer();
-
- if(pPV->GetVisibleLayers().IsSet(nLay) && (pMVisLay==NULL || pMVisLay->IsSet(nLay)))
+ if(!pMVisLay || pMVisLay->IsSet(pObj->GetLayer()))
{
- pRet=pObj->CheckHit(rPnt,nTol2,&pPV->GetVisibleLayers());
+ pRet = SdrObjectPrimitiveHit(*pObj, rPnt, nTol2, *pPV, &pPV->GetVisibleLayers(), false);
}
}
}
@@ -1658,7 +1652,7 @@ SdrObject* SdrMarkView::ImpCheckObjHit(const Point& rPnt, USHORT nTol, SdrObject
return pRet;
}
-SdrObject* SdrMarkView::ImpCheckObjHit(const Point& rPnt, USHORT nTol, SdrObjList* pOL, SdrPageView* pPV, ULONG nOptions, const SetOfByte* pMVisLay, SdrObject*& rpRootObj) const
+SdrObject* SdrMarkView::CheckSingleSdrObjectHit(const Point& rPnt, USHORT nTol, SdrObjList* pOL, SdrPageView* pPV, ULONG nOptions, const SetOfByte* pMVisLay, SdrObject*& rpRootObj) const
{
BOOL bBack=(nOptions & SDRSEARCH_BACKWARD)!=0;
SdrObject* pRet=NULL;
@@ -1685,7 +1679,7 @@ SdrObject* SdrMarkView::ImpCheckObjHit(const Point& rPnt, USHORT nTol, SdrObjLis
pObj = pOL->GetObj(nObjNum);
}
- pRet=ImpCheckObjHit(rPnt,nTol,pObj,pPV,nOptions,pMVisLay);
+ pRet=CheckSingleSdrObjectHit(rPnt,nTol,pObj,pPV,nOptions,pMVisLay);
if (pRet!=NULL) rpRootObj=pObj;
if (bBack) nObjNum++;
}
@@ -1733,7 +1727,7 @@ BOOL SdrMarkView::PickObj(const Point& rPnt, short nTol, SdrObject*& rpObj, SdrP
SdrMark* pM=GetSdrMarkByIndex(nMrkNum);
pObj=pM->GetMarkedSdrObj();
pPV=pM->GetPageView();
- pHitObj=ImpCheckObjHit(aPt,nTol,pObj,pPV,nOptions,NULL);
+ pHitObj=CheckSingleSdrObjectHit(aPt,nTol,pObj,pPV,nOptions,NULL);
if (bBack) nMrkNum++;
}
}
@@ -1778,7 +1772,7 @@ BOOL SdrMarkView::PickObj(const Point& rPnt, short nTol, SdrObject*& rpObj, SdrP
if (pnPassNum!=NULL) *pnPassNum|=SDRSEARCHPASS_MASTERPAGE;
nTmpOptions=nTmpOptions | SDRSEARCH_IMPISMASTER;
}
- pHitObj=ImpCheckObjHit(aPt,nTol,pObjList,pPV,nTmpOptions,pMVisLay,pObj);
+ pHitObj=CheckSingleSdrObjectHit(aPt,nTol,pObjList,pPV,nTmpOptions,pMVisLay,pObj);
if (bBack) nPgNum++;
}
}
@@ -1801,8 +1795,12 @@ BOOL SdrMarkView::PickObj(const Point& rPnt, short nTol, SdrObject*& rpObj, SdrP
if (!pObj->HasMacro() || !pObj->IsMacroHit(aHitRec)) pObj=NULL;
}
if (pObj!=NULL && (nOptions & SDRSEARCH_WITHTEXT) !=0 && pObj->GetOutlinerParaObject()==NULL) pObj=NULL;
- if (pObj!=NULL && (nOptions & SDRSEARCH_TESTTEXTAREA) !=0) {
- if (!pObj->IsTextEditHit(aPt,0/*nTol*/,NULL)) pObj=NULL;
+ if (pObj!=NULL && (nOptions & SDRSEARCH_TESTTEXTAREA) !=0)
+ {
+ if(!SdrObjectPrimitiveHit(*pObj, aPt, 0, *pPV, 0, true))
+ {
+ pObj = 0;
+ }
}
if (pObj!=NULL) {
rpObj=pObj;
@@ -1831,7 +1829,7 @@ BOOL SdrMarkView::PickMarkedObj(const Point& rPnt, SdrObject*& rpObj, SdrPageVie
SdrMark* pM=GetSdrMarkByIndex(nMarkNum);
SdrPageView* pPV=pM->GetPageView();
SdrObject* pObj=pM->GetMarkedSdrObj();
- bFnd=ImpIsObjHit(aPt,nTol,pObj,pPV,SDRSEARCH_TESTMARKABLE);
+ bFnd = 0 != CheckSingleSdrObjectHit(aPt,nTol,pObj,pPV,SDRSEARCH_TESTMARKABLE,0);
if (bFnd) {
rpObj=pObj;
rpPV=pPV;
diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx
index d4e1f7f7da..f8220ad472 100644
--- a/svx/source/svdraw/svdoashp.cxx
+++ b/svx/source/svdraw/svdoashp.cxx
@@ -3093,10 +3093,6 @@ void SdrObjCustomShape::TakeTextRect( SdrOutliner& rOutliner, Rectangle& rTextRe
rTextRect=Rectangle(aTextPos,aTextSiz);
}
-////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
void SdrObjCustomShape::NbcSetOutlinerParaObject(OutlinerParaObject* pTextObject)
{
SdrTextObj::NbcSetOutlinerParaObject( pTextObject );
@@ -3105,81 +3101,6 @@ void SdrObjCustomShape::NbcSetOutlinerParaObject(OutlinerParaObject* pTextObject
InvalidateRenderGeometry();
}
-////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-SdrObject* SdrObjCustomShape::CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const
-{
- SdrObject* pHitObj = NULL;
- const SdrObject* pSdrObject = GetSdrObjectFromCustomShape();
- if ( pSdrObject )
- {
- SdrObjList* pOL = pSdrObject->GetSubList();
- if ( pOL )
- {
- ULONG nObjNum = pOL->GetObjCount();
- while ( ( pHitObj == NULL ) && nObjNum )
- {
- nObjNum--;
- SdrObject* pObj = pOL->GetObj( nObjNum );
- if ( pObj->CheckHit( rPnt, nTol, pVisiLayer ) )
- pHitObj = (SdrObject*)this;
- }
- }
- else if ( pSdrObject->CheckHit( rPnt, nTol, pVisiLayer ) )
- pHitObj = (SdrObject*)this;
- }
-
- if ( !pHitObj && HasText() )
- {
- // paint text over object
- double fTextRotation = GetExtraTextRotation();
- if ( fTextRotation != 0.0 )
- {
- GeoStat aOldGeoStat( aGeo );
- Rectangle aOldRect( aRect );
- Rectangle aTextBound( aRect );
- GetTextBounds( aTextBound );
-
- // determining the correct refpoint
- Point aRef( aTextBound.Center() );
- Rectangle aUnrotatedSnapRect( aOutRect );
- RotatePoint( aRef, aUnrotatedSnapRect.Center(), -aGeo.nSin, -aGeo.nCos );
-
- long dx = aRect.Right()-aRect.Left();
- long dy = aRect.Bottom()-aRect.Top();
- Point aP( aRect.TopLeft() );
- double sn = sin( F_PI180 * fTextRotation );
- double cs = cos( F_PI180 * fTextRotation );
- RotatePoint( aP, aRef, sn, cs );
- ((SdrObjCustomShape*)this)->aRect.Left()=aP.X();
- ((SdrObjCustomShape*)this)->aRect.Top()=aP.Y();
- ((SdrObjCustomShape*)this)->aRect.Right()=aRect.Left()+dx;
- ((SdrObjCustomShape*)this)->aRect.Bottom()=aRect.Top()+dy;
- if ( aGeo.nDrehWink == 0 )
- {
- ((SdrObjCustomShape*)this)->aGeo.nDrehWink=NormAngle360( (sal_Int32)( fTextRotation * 100.0 ) );
- ((SdrObjCustomShape*)this)->aGeo.nSin = sn;
- ((SdrObjCustomShape*)this)->aGeo.nCos = cs;
- }
- else
- {
- ((SdrObjCustomShape*)this)->aGeo.nDrehWink=NormAngle360( aGeo.nDrehWink + (sal_Int32)( fTextRotation * 100.0 ) );
- ((SdrObjCustomShape*)this)->aGeo.RecalcSinCos();
- }
- pHitObj = SdrTextObj::CheckHit( rPnt, nTol, pVisiLayer );
- ((SdrObjCustomShape*)this)->aGeo = aOldGeoStat;
- ((SdrObjCustomShape*)this)->aRect = aOldRect;
-
- }
- else
- pHitObj = SdrTextObj::CheckHit( rPnt, nTol, pVisiLayer );
- }
-
- return pHitObj;
-}
-
void SdrObjCustomShape::operator=(const SdrObject& rObj)
{
SdrTextObj::operator=( rObj );
diff --git a/svx/source/svdraw/svdoattr.cxx b/svx/source/svdraw/svdoattr.cxx
index 6afdb11856..828cd948ff 100644
--- a/svx/source/svdraw/svdoattr.cxx
+++ b/svx/source/svdraw/svdoattr.cxx
@@ -34,7 +34,6 @@
#include <svx/svdoattr.hxx>
#include <svx/xpool.hxx>
#include "svditext.hxx"
-#include "svdtouch.hxx"
#include <svx/svdmodel.hxx>
#include <svx/svdpage.hxx>
#include <svx/svdattr.hxx>
@@ -171,26 +170,6 @@ sal_Int32 SdrAttrObj::ImpGetLineWdt() const
return nRetval;
}
-//////////////////////////////////////////////////////////////////////////////
-
-FASTBOOL SdrAttrObj::ImpGetShadowDist(sal_Int32& nXDist, sal_Int32& nYDist) const
-{
- const SfxItemSet& rSet = GetMergedItemSet();
-
- nXDist = 0L;
- nYDist = 0L;
-
- BOOL bShadOn = ((SdrShadowItem&)(rSet.Get(SDRATTR_SHADOW))).GetValue();
- if(bShadOn)
- {
- nXDist = ((SdrShadowXDistItem&)(rSet.Get(SDRATTR_SHADOWXDIST))).GetValue();
- nYDist = ((SdrShadowYDistItem&)(rSet.Get(SDRATTR_SHADOWYDIST))).GetValue();
- return TRUE;
- }
-
- return FALSE;
-}
-
BOOL SdrAttrObj::HasFill() const
{
return bClosedObj && ((XFillStyleItem&)(GetProperties().GetObjectItemSet().Get(XATTR_FILLSTYLE))).GetValue()!=XFILL_NONE;
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index 0935adba4f..ae5686b2c6 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -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
@@ -127,6 +127,11 @@
#include <svx/polysc3d.hxx>
#include "svx/svdotable.hxx"
#include "svx/shapepropertynotifier.hxx"
+#include <svx/sdrhittesthelper.hxx>
+
+// --> OD 2009-07-10 #i73249#
+#include <svx/svdundo.hxx>
+// <--
using namespace ::com::sun::star;
@@ -175,8 +180,15 @@ FASTBOOL SdrObjUserData::HasMacro(const SdrObject* /*pObj*/) const
SdrObject* SdrObjUserData::CheckMacroHit(const SdrObjMacroHitRec& rRec, const SdrObject* pObj) const
{
- if (pObj==NULL) return NULL;
- return pObj->CheckHit(rRec.aPos,rRec.nTol,rRec.pVisiLayer);
+ if(pObj)
+ {
+ if(rRec.pPageView)
+ {
+ return SdrObjectPrimitiveHit(*pObj, rRec.aPos, rRec.nTol, *rRec.pPageView, rRec.pVisiLayer, false);
+ }
+ }
+
+ return 0;
}
Pointer SdrObjUserData::GetMacroPointer(const SdrObjMacroHitRec& /*rRec*/, const SdrObject* /*pObj*/) const
@@ -186,7 +198,7 @@ Pointer SdrObjUserData::GetMacroPointer(const SdrObjMacroHitRec& /*rRec*/, const
void SdrObjUserData::PaintMacro(OutputDevice& rOut, const Rectangle& /*rDirtyRect*/, const SdrObjMacroHitRec& /*rRec*/, const SdrObject* pObj) const
{
- if(!pObj)
+ if(!pObj)
return;
const RasterOp eRop(rOut.GetRasterOp());
@@ -197,7 +209,7 @@ void SdrObjUserData::PaintMacro(OutputDevice& rOut, const Rectangle& /*rDirtyRec
rOut.SetFillColor();
rOut.SetRasterOp(ROP_INVERT);
- for(sal_uInt32 a(0); a < nCount; a++)
+ for(sal_uInt32 a(0); a < nCount; a++)
{
rOut.DrawPolyLine(aPolyPolygon.getB2DPolygon(a));
}
@@ -751,7 +763,29 @@ void SdrObject::SetName(const String& rStr)
if(pPlusData && pPlusData->aObjName != rStr)
{
+ // --> OD 2009-07-09 #i73249#
+ // Undo/Redo for setting object's name
+ bool bUndo( false );
+ if ( GetModel() && GetModel()->IsUndoEnabled() )
+ {
+ bUndo = true;
+ SdrUndoAction* pUndoAction =
+ GetModel()->GetSdrUndoFactory().CreateUndoObjectStrAttr(
+ *this,
+ SdrUndoObjStrAttr::OBJ_NAME,
+ GetName(),
+ rStr );
+ GetModel()->BegUndo( pUndoAction->GetComment() );
+ GetModel()->AddUndo( pUndoAction );
+ }
+ // <--
pPlusData->aObjName = rStr;
+ // --> OD 2009-07-09 #i73249#
+ if ( bUndo )
+ {
+ GetModel()->EndUndo();
+ }
+ // <--
SetChanged();
BroadcastObjectChange();
}
@@ -759,7 +793,7 @@ void SdrObject::SetName(const String& rStr)
String SdrObject::GetName() const
{
- if(pPlusData)
+ if(pPlusData)
{
return pPlusData->aObjName;
}
@@ -776,7 +810,29 @@ void SdrObject::SetTitle(const String& rStr)
if(pPlusData && pPlusData->aObjTitle != rStr)
{
+ // --> OD 2009-07-13 #i73249#
+ // Undo/Redo for setting object's title
+ bool bUndo( false );
+ if ( GetModel() && GetModel()->IsUndoEnabled() )
+ {
+ bUndo = true;
+ SdrUndoAction* pUndoAction =
+ GetModel()->GetSdrUndoFactory().CreateUndoObjectStrAttr(
+ *this,
+ SdrUndoObjStrAttr::OBJ_TITLE,
+ GetTitle(),
+ rStr );
+ GetModel()->BegUndo( pUndoAction->GetComment() );
+ GetModel()->AddUndo( pUndoAction );
+ }
+ // <--
pPlusData->aObjTitle = rStr;
+ // --> OD 2009-07-13 #i73249#
+ if ( bUndo )
+ {
+ GetModel()->EndUndo();
+ }
+ // <--
SetChanged();
BroadcastObjectChange();
}
@@ -784,7 +840,7 @@ void SdrObject::SetTitle(const String& rStr)
String SdrObject::GetTitle() const
{
- if(pPlusData)
+ if(pPlusData)
{
return pPlusData->aObjTitle;
}
@@ -801,7 +857,29 @@ void SdrObject::SetDescription(const String& rStr)
if(pPlusData && pPlusData->aObjDescription != rStr)
{
+ // --> OD 2009-07-13 #i73249#
+ // Undo/Redo for setting object's description
+ bool bUndo( false );
+ if ( GetModel() && GetModel()->IsUndoEnabled() )
+ {
+ bUndo = true;
+ SdrUndoAction* pUndoAction =
+ GetModel()->GetSdrUndoFactory().CreateUndoObjectStrAttr(
+ *this,
+ SdrUndoObjStrAttr::OBJ_DESCRIPTION,
+ GetDescription(),
+ rStr );
+ GetModel()->BegUndo( pUndoAction->GetComment() );
+ GetModel()->AddUndo( pUndoAction );
+ }
+ // <--
pPlusData->aObjDescription = rStr;
+ // --> OD 2009-07-13 #i73249#
+ if ( bUndo )
+ {
+ GetModel()->EndUndo();
+ }
+ // <--
SetChanged();
BroadcastObjectChange();
}
@@ -809,7 +887,7 @@ void SdrObject::SetDescription(const String& rStr)
String SdrObject::GetDescription() const
{
- if(pPlusData)
+ if(pPlusData)
{
return pPlusData->aObjDescription;
}
@@ -882,11 +960,11 @@ void SdrObject::SetNavigationPosition (const sal_uInt32 nNewPosition)
// GetCurrentBoundRect().
const Rectangle& SdrObject::GetCurrentBoundRect() const
{
- if(aOutRect.IsEmpty())
+ if(aOutRect.IsEmpty())
{
const_cast< SdrObject* >(this)->RecalcBoundRect();
}
-
+
return aOutRect;
}
@@ -902,8 +980,12 @@ const Rectangle& SdrObject::GetLastBoundRect() const
void SdrObject::RecalcBoundRect()
{
+ // #i101680# suppress BoundRect calculations on import(s)
+ if(pModel && pModel->isLocked() )
+ return;
+
// central new method which will calculate the BoundRect using primitive geometry
- if(aOutRect.IsEmpty())
+ if(aOutRect.IsEmpty())
{
const drawinglayer::primitive2d::Primitive2DSequence xPrimitives(GetViewContact().getViewIndependentPrimitive2DSequence());
@@ -916,7 +998,7 @@ void SdrObject::RecalcBoundRect()
if(!aRange.isEmpty())
{
aOutRect = Rectangle(
- (sal_Int32)floor(aRange.getMinX()), (sal_Int32)floor(aRange.getMinY()),
+ (sal_Int32)floor(aRange.getMinX()), (sal_Int32)floor(aRange.getMinY()),
(sal_Int32)ceil(aRange.getMaxX()), (sal_Int32)ceil(aRange.getMaxY()));
return;
}
@@ -982,19 +1064,6 @@ BOOL SdrObject::LineGeometryUsageIsNecessary() const
return (eXLS != XLINE_NONE);
}
-SdrObject* SdrObject::CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const
-{
- if(pVisiLayer && !pVisiLayer->IsSet(sal::static_int_cast< sal_uInt8 >(GetLayer())))
- {
- return 0L;
- }
-
- Rectangle aO(GetCurrentBoundRect());
- aO.Left()-=nTol; aO.Top()-=nTol; aO.Right()+=nTol; aO.Bottom()+=nTol;
- FASTBOOL bRet=aO.IsInside(rPnt);
- return bRet ? (SdrObject*)this : NULL;
-}
-
SdrObject* SdrObject::Clone() const
{
SdrObject* pObj=SdrObjFactory::MakeNewObject(GetObjInventor(),GetObjIdentifier(),NULL);
@@ -1129,7 +1198,7 @@ basegfx::B2DPolyPolygon SdrObject::TakeContour() const
{
basegfx::B2DPolyPolygon aRetval;
- // create cloned object without text, but with XLINE_SOLID,
+ // create cloned object without text, but with XLINE_SOLID,
// COL_BLACK as line color and XFILL_NONE
SdrObject* pClone = Clone();
@@ -1166,6 +1235,11 @@ basegfx::B2DPolyPolygon SdrObject::TakeContour() const
SfxItemSet aNewSet(*GetObjectItemPool());
+ // #i101980# ignore LineWidth; that's what the old implementation
+ // did. With linewidth, the result may be huge due to fat/thick
+ // line decompositions
+ aNewSet.Put(XLineWidthItem(0));
+
// solid black lines and no fill
aNewSet.Put(XLineStyleItem(XLINE_SOLID));
aNewSet.Put(XLineColorItem(String(), Color(COL_BLACK)));
@@ -1344,8 +1418,8 @@ bool SdrObject::beginSpecialDrag(SdrDragStat& rDrag) const
SdrHdlKind eHdl = (pHdl == NULL) ? HDL_MOVE : pHdl->GetKind();
if(eHdl==HDL_UPLFT || eHdl==HDL_UPPER || eHdl==HDL_UPRGT ||
- eHdl==HDL_LEFT || eHdl==HDL_RIGHT || eHdl==HDL_LWLFT ||
- eHdl==HDL_LOWER || eHdl==HDL_LWRGT)
+ eHdl==HDL_LEFT || eHdl==HDL_RIGHT || eHdl==HDL_LWLFT ||
+ eHdl==HDL_LOWER || eHdl==HDL_LWRGT)
{
return true;
}
@@ -1357,11 +1431,11 @@ bool SdrObject::applySpecialDrag(SdrDragStat& rDrag)
{
Rectangle aNewRect(ImpDragCalcRect(rDrag));
- if(aNewRect != GetSnapRect())
+ if(aNewRect != GetSnapRect())
{
NbcSetSnapRect(aNewRect);
}
-
+
return true;
}
@@ -1393,8 +1467,15 @@ FASTBOOL SdrObject::MovCreate(SdrDragStat& rStat)
rStat.TakeCreateRect(aOutRect);
rStat.SetActionRect(aOutRect);
aOutRect.Justify();
- SetBoundRectDirty();
- bSnapRectDirty=TRUE;
+
+ // #i101648# for naked (non-derived) SdrObjects, do not invalidate aOutRect
+ // by calling SetBoundRectDirty(); aOutRect IS the geometry for such objects.
+ // No derivation implementation calls the parent implementation, so this will
+ // cause no further prolems
+ //
+ // SetBoundRectDirty();
+ // bSnapRectDirty=TRUE;
+
return TRUE;
}
@@ -1402,7 +1483,11 @@ FASTBOOL SdrObject::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
{
rStat.TakeCreateRect(aOutRect);
aOutRect.Justify();
- SetRectsDirty();
+
+ // #i101648# see description at MovCreate
+ //
+ // SetRectsDirty();
+
return (eCmd==SDRCREATE_FORCEEND || rStat.GetPointAnz()>=2);
}
@@ -1730,11 +1815,6 @@ FASTBOOL SdrObject::HasTextEdit() const
return FALSE;
}
-SdrObject* SdrObject::CheckTextEditHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const
-{
- return CheckHit(rPnt,nTol,pVisiLayer);
-}
-
sal_Bool SdrObject::BegTextEdit(SdrOutliner& /*rOutl*/)
{
return FALSE;
@@ -1806,11 +1886,19 @@ FASTBOOL SdrObject::HasMacro() const
SdrObject* SdrObject::CheckMacroHit(const SdrObjMacroHitRec& rRec) const
{
- SdrObjUserData* pData=ImpGetMacroUserData();
- if (pData!=NULL) {
- return pData->CheckMacroHit(rRec,this);
+ SdrObjUserData* pData = ImpGetMacroUserData();
+
+ if(pData)
+ {
+ return pData->CheckMacroHit(rRec, this);
}
- return CheckHit(rRec.aPos,rRec.nTol,rRec.pVisiLayer);
+
+ if(rRec.pPageView)
+ {
+ return SdrObjectPrimitiveHit(*this, rRec.aPos, rRec.nTol, *rRec.pPageView, rRec.pVisiLayer, false);
+ }
+
+ return 0;
}
Pointer SdrObject::GetMacroPointer(const SdrObjMacroHitRec& rRec) const
@@ -1825,12 +1913,12 @@ Pointer SdrObject::GetMacroPointer(const SdrObjMacroHitRec& rRec) const
void SdrObject::PaintMacro(OutputDevice& rOut, const Rectangle& rDirtyRect, const SdrObjMacroHitRec& rRec) const
{
SdrObjUserData* pData=ImpGetMacroUserData();
-
- if(pData)
+
+ if(pData)
{
pData->PaintMacro(rOut,rDirtyRect,rRec,this);
- }
- else
+ }
+ else
{
const RasterOp eRop(rOut.GetRasterOp());
const basegfx::B2DPolyPolygon aPolyPolygon(TakeXorPoly());
@@ -1840,7 +1928,7 @@ void SdrObject::PaintMacro(OutputDevice& rOut, const Rectangle& rDirtyRect, cons
rOut.SetFillColor();
rOut.SetRasterOp(ROP_INVERT);
- for(sal_uInt32 a(0); a < nCount; a++)
+ for(sal_uInt32 a(0); a < nCount; a++)
{
rOut.DrawPolyLine(aPolyPolygon.getB2DPolygon(a));
}
@@ -2251,8 +2339,8 @@ SdrGluePoint SdrObject::GetVertexGluePoint(USHORT nPosNum) const
// #i41936# Use SnapRect for default GluePoints
const Rectangle aR(GetSnapRect());
Point aPt;
-
- switch(nPosNum)
+
+ switch(nPosNum)
{
case 0 : aPt = aR.TopCenter(); break;
case 1 : aPt = aR.RightCenter(); break;
@@ -2374,8 +2462,8 @@ SdrObject* SdrObject::ImpConvertToContourObj(SdrObject* pRet, BOOL bForceLineDas
if(pRet->LineGeometryUsageIsNecessary())
{
- basegfx::B2DPolyPolygon aAreaPolyPolygon;
- basegfx::B2DPolyPolygon aLinePolyPolygon;
+ basegfx::B2DPolyPolygon aMergedLineFillPolyPolygon;
+ basegfx::B2DPolyPolygon aMergedHairlinePolyPolygon;
const drawinglayer::primitive2d::Primitive2DSequence xSequence(pRet->GetViewContact().getViewIndependentPrimitive2DSequence());
if(xSequence.hasElements())
@@ -2386,37 +2474,32 @@ SdrObject* SdrObject::ImpConvertToContourObj(SdrObject* pRet, BOOL bForceLineDas
// create extractor, process and get result
drawinglayer::processor2d::LineGeometryExtractor2D aExtractor(aViewInformation2D);
aExtractor.process(xSequence);
-
- aAreaPolyPolygon = aExtractor.getExtractedLineFills();
- aLinePolyPolygon = aExtractor.getExtractedHairlines();
- }
- // Since this may in some cases lead to a count of 0 after
- // the merge i moved the merge to the front.
- if(aAreaPolyPolygon.count())
- {
- // bezier geometry got created, even for straight edges since the given
- // object is a result of DoConvertToPolyObj. For conversion to contour
- // this is not really needed and can be reduced again AFAP
- aAreaPolyPolygon = basegfx::tools::simplifyCurveSegments(aAreaPolyPolygon);
+ // #i102241# check for line results
+ const std::vector< basegfx::B2DPolygon >& rHairlineVector = aExtractor.getExtractedHairlines();
+
+ if(rHairlineVector.size())
+ {
+ // for SdrObject creation, just copy all to a single Hairline-PolyPolygon
+ for(sal_uInt32 a(0); a < rHairlineVector.size(); a++)
+ {
+ aMergedHairlinePolyPolygon.append(rHairlineVector[a]);
+ }
+ }
- // merge all to a decent result (try to use AND, but remember original)
- const basegfx::B2DPolyPolygon aTemp(aAreaPolyPolygon);
- aAreaPolyPolygon = basegfx::tools::solveCrossovers(aAreaPolyPolygon);
- aAreaPolyPolygon = basegfx::tools::stripNeutralPolygons(aAreaPolyPolygon);
- aAreaPolyPolygon = basegfx::tools::stripDispensablePolygons(aAreaPolyPolygon, false);
+ // #i102241# check for fill rsults
+ const std::vector< basegfx::B2DPolyPolygon >& rLineFillVector(aExtractor.getExtractedLineFills());
- if(!aAreaPolyPolygon.count())
+ if(rLineFillVector.size())
{
- // OOps, AND is empty, this means there were no overlapping parts. Use
- // remembered parts as result
- aAreaPolyPolygon = aTemp;
+ // merge to a single PolyPolygon (OR)
+ aMergedLineFillPolyPolygon = basegfx::tools::mergeToSinglePolyPolygon(rLineFillVector);
}
}
- // || aLinePolyPolygon.Count() removed; the conversion is ONLY
+ // || aMergedHairlinePolyPolygon.Count() removed; the conversion is ONLY
// useful when new closed filled polygons are created
- if(aAreaPolyPolygon.count() || (bForceLineDash && aLinePolyPolygon.count()))
+ if(aMergedLineFillPolyPolygon.count() || (bForceLineDash && aMergedHairlinePolyPolygon.count()))
{
SfxItemSet aSet(pRet->GetMergedItemSet());
XFillStyle eOldFillStyle = ((const XFillStyleItem&)(aSet.Get(XATTR_FILLSTYLE))).GetValue();
@@ -2424,10 +2507,10 @@ SdrObject* SdrObject::ImpConvertToContourObj(SdrObject* pRet, BOOL bForceLineDas
SdrPathObj* aLineHairlinePart = NULL;
bool bBuildGroup(false);
- if(aAreaPolyPolygon.count())
+ if(aMergedLineFillPolyPolygon.count())
{
// create SdrObject for filled line geometry
- aLinePolygonPart = new SdrPathObj(OBJ_PATHFILL, aAreaPolyPolygon);
+ aLinePolygonPart = new SdrPathObj(OBJ_PATHFILL, aMergedLineFillPolyPolygon);
aLinePolygonPart->SetModel(pRet->GetModel());
// correct item properties
@@ -2442,13 +2525,13 @@ SdrObject* SdrObject::ImpConvertToContourObj(SdrObject* pRet, BOOL bForceLineDas
aLinePolygonPart->SetMergedItemSet(aSet);
}
- if(aLinePolyPolygon.count())
+ if(aMergedHairlinePolyPolygon.count())
{
// create SdrObject for hairline geometry
// OBJ_PATHLINE is necessary here, not OBJ_PATHFILL. This is intended
// to get a non-filled object. If the poly is closed, the PathObj takes care for
// the correct closed state.
- aLineHairlinePart = new SdrPathObj(OBJ_PATHLINE, aLinePolyPolygon);
+ aLineHairlinePart = new SdrPathObj(OBJ_PATHLINE, aMergedHairlinePolyPolygon);
aLineHairlinePart->SetModel(pRet->GetModel());
aSet.Put(XLineWidthItem(0L));
@@ -2569,8 +2652,8 @@ SdrObject* SdrObject::ConvertToContourObj(SdrObject* pRet, BOOL bForceLineDash)
{
SdrPathObj* pPathObj = (SdrPathObj*)pRet;
- // bezier geometry got created, even for straight edges since the given
- // object is a result of DoConvertToPolyObj. For conversion to contour
+ // bezier geometry got created, even for straight edges since the given
+ // object is a result of DoConvertToPolyObj. For conversion to contour
// this is not really needed and can be reduced again AFAP
pPathObj->SetPathPoly(basegfx::tools::simplifyCurveSegments(pPathObj->GetPathPoly()));
}
@@ -2850,8 +2933,8 @@ void SdrObject::impl_setUnoShape( const uno::Reference< uno::XInterface >& _rxUn
{
maWeakUnoShape = _rxUnoShape;
mpSvxShape = SvxShape::getImplementation( _rxUnoShape );
- OSL_ENSURE( mpSvxShape || !_rxUnoShape.is(),
- "SdrObject::setUnoShape: not sure it's a good idea to have an XShape which is not implemented by SvxShape ..." );
+// OSL_ENSURE( mpSvxShape || !_rxUnoShape.is(),
+// "SdrObject::setUnoShape: not sure it's a good idea to have an XShape which is not implemented by SvxShape ..." );
}
/** only for internal use! */
@@ -2974,7 +3057,7 @@ sal_Bool SdrObject::TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B
// build matrix
rMatrix.identity();
-
+
if(1.0 != aScale.getX() || 1.0 != aScale.getY())
{
rMatrix.scale(aScale.getX(), aScale.getY());
diff --git a/svx/source/svdraw/svdocapt.cxx b/svx/source/svdraw/svdocapt.cxx
index a39926d84f..29488fc407 100644
--- a/svx/source/svdraw/svdocapt.cxx
+++ b/svx/source/svdraw/svdocapt.cxx
@@ -40,7 +40,6 @@
#include <svx/svdpool.hxx>
#include <svx/svdetc.hxx>
#include <svx/svdtrans.hxx>
-#include "svdtouch.hxx"
#include <svx/svdhdl.hxx>
#include <svx/svddrag.hxx>
#include <svx/svdmodel.hxx>
@@ -61,6 +60,7 @@
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/range/b2drange.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
+#include <svx/sdrhittesthelper.hxx>
// #i32599#
inline double ImplTwipsToMM(double fVal) { return (fVal * (127.0 / 72.0)); }
@@ -253,31 +253,6 @@ UINT16 SdrCaptionObj::GetObjIdentifier() const
return UINT16(OBJ_CAPTION);
}
-SdrObject* SdrCaptionObj::CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const
-{
- if(pVisiLayer && !pVisiLayer->IsSet(sal::static_int_cast< sal_uInt8 >(GetLayer())))
- {
- return NULL;
- }
-
- sal_Bool bHit(SdrRectObj::CheckHit(rPnt,nTol,pVisiLayer) != NULL);
- if (!bHit) {
- INT32 nMyTol=nTol;
- INT32 nWdt = ((XLineWidthItem&)(GetObjectItem(XATTR_LINEWIDTH))).GetValue();
- nWdt++;
- nWdt /= 2;
-
- if (nWdt>nMyTol) nMyTol=nWdt; // Bei dicker Linie keine Toleranz noetig
- Rectangle aR(rPnt,rPnt);
- aR.Left() -=nMyTol;
- aR.Right() +=nMyTol;
- aR.Top() -=nMyTol;
- aR.Bottom()+=nMyTol;
- bHit = IsRectTouchesLine(aTailPoly,aR);
- }
- return bHit ? (SdrObject*)this : NULL;
-}
-
void SdrCaptionObj::operator=(const SdrObject& rObj)
{
SdrRectObj::operator=(rObj);
@@ -377,8 +352,10 @@ bool SdrCaptionObj::beginSpecialDrag(SdrDragStat& rDrag) const
Point aHit(rDrag.GetStart());
- if(SdrRectObj::CheckHit(aHit, 0, NULL))
+ if(rDrag.GetPageView() && SdrObjectPrimitiveHit(*this, aHit, 0, *rDrag.GetPageView(), 0, false))
+ {
return true;
+ }
}
else
{
diff --git a/svx/source/svdraw/svdocirc.cxx b/svx/source/svdraw/svdocirc.cxx
index 251cbe6daf..b37e327ed1 100644
--- a/svx/source/svdraw/svdocirc.cxx
+++ b/svx/source/svdraw/svdocirc.cxx
@@ -40,7 +40,6 @@
#include <svx/svdocirc.hxx>
#include <math.h>
#include <svx/xpool.hxx>
-#include "svdtouch.hxx"
#include <svx/svdattr.hxx>
#include <svx/svdpool.hxx>
#include <svx/svdattrx.hxx>
@@ -312,127 +311,6 @@ void SdrCircObj::RecalcXPoly()
mpXPoly = new XPolygon(aPolyCirc);
}
-SdrObject* SdrCircObj::CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const
-{
- if(pVisiLayer && !pVisiLayer->IsSet(sal::static_int_cast< sal_uInt8 >(GetLayer())))
- {
- return NULL;
- }
-
- Point aPt(rPnt);
- Point aZero;
- aPt.X()-=aRect.Left();
- aPt.Y()-=aRect.Top();
-
- INT32 nMyTol=nTol;
- FASTBOOL bFilled=meCircleKind!=OBJ_CARC && (bTextFrame || HasFill());
-
- INT32 nWdt=ImpGetLineWdt()/2; // Halbe Strichstaerke
- long nBoundWdt=aRect.GetWidth()-1;
- long nBoundHgt=aRect.GetHeight()-1;
- if (meCircleKind==OBJ_SECT) {
- long nTmpWink=NormAngle360(nEndWink-nStartWink);
- if (nTmpWink<9000) {
- nBoundWdt=0;
- nBoundHgt=0;
- } else if (nTmpWink<27000) {
- nBoundWdt/=2;
- nBoundHgt/=2;
- }
- }
- if (bFilled && nBoundWdt>short(nTol) && nBoundHgt>short(nTol) && Abs(aGeo.nShearWink)<=4500) nMyTol=0; // Keine Toleranz noetig hier
- if (nWdt>nMyTol) nMyTol=nWdt; // Bei dicker Umrandung keine Toleranz noetig
-
- // Den uebergebenen Punkt auf den gedrehten, geshearten Kreis transformieren
- // Unrotate:
- if (aGeo.nDrehWink!=0) RotatePoint(aPt,aZero,-aGeo.nSin,aGeo.nCos); // -sin fuer Umkehrung
- // Unshear:
- if (aGeo.nShearWink!=0) ShearPoint(aPt,aZero,-aGeo.nTan); // -tan fuer Umkehrung
-
- long nXRad=aRect.GetWidth()/2; if (nXRad<1) nXRad=1;
- long nYRad=aRect.GetHeight()/2; if (nYRad<1) nYRad=1;
-
- // Die wirklichen Radien fuer spaeter merken
- long nXRadReal=nXRad;
- long nYRadReal=nYRad;
- aPt.X()-=nXRad;
- aPt.Y()-=nYRad;
- Point aPtNoStretch(aPt);
-
- if (nXRad>nYRad) {
- aPt.Y()=BigMulDiv(aPt.Y(),nXRad,nYRad);
- // Da die Strichstaerke bei Ellipsen ueberall gleich ist:
- if (Abs(aPt.X())<Abs(aPt.Y())) {
- nMyTol=BigMulDiv(nMyTol,nXRad,nYRad);
- }
- nYRad=nXRad;
- }
- if (nYRad>nXRad) {
- aPt.X()=BigMulDiv(aPt.X(),nYRad,nXRad);
- // Da die Strichstaerke bei Ellipsen ueberall gleich ist:
- if (Abs(aPt.Y())<Abs(aPt.X())) {
- nMyTol=BigMulDiv(nMyTol,nYRad,nXRad);
- }
- nXRad=nYRad;
- }
-
- // Die BigInts haben bei *= leider ein Vorzeichenproblem (a*=a;)
- // (SV250A), deshalb hier soviele Instanzen. (JOE)
- long nAussen=nXRad+nMyTol;
- BigInt nBigTmpA(nAussen);
- BigInt nAusRadQ(nBigTmpA*nBigTmpA);
- long nInnen=nXRad-nMyTol; if (nInnen<=0) nInnen=0;
- BigInt nBigTmpI(nInnen);
- // wird sonst nicht benoetigt, ggf. BugMul sparen:
- BigInt nInnRadQ((!bFilled && nInnen!=0) ? nBigTmpI*nBigTmpI : nBigTmpI);
-
- // Radius von aPt berechnen
- BigInt nBigTmpX(aPt.X());
- BigInt nBigTmpY(aPt.Y());
- BigInt nPntRadQ(nBigTmpX*nBigTmpX+nBigTmpY*nBigTmpY);
-
- sal_Bool bRet(sal_False);
- if (nPntRadQ<=nAusRadQ) { // sonst ausserhalb
- if (nInnen==0) bRet = sal_True;
- else if (meCircleKind==OBJ_CIRC) { // Vollkreis
- if (bFilled) bRet = sal_True;
- else if (nPntRadQ>=nInnRadQ) bRet = sal_True;
- } else { // Teilkreise
- long nWink=NormAngle360(GetAngle(aPt));
- long a=nStartWink;
- long e=nEndWink;
- if (e<a) e+=36000;
- if (nWink<a) nWink+=36000;
- if (nWink>=a && nWink<=e) {
- if (bFilled) bRet = sal_True;
- else if (nPntRadQ>=nInnRadQ) bRet = sal_True;
- }
- if (!bRet) {
- Rectangle aR(aPtNoStretch.X()-nMyTol,aPtNoStretch.Y()-nMyTol,
- aPtNoStretch.X()+nMyTol,aPtNoStretch.Y()+nMyTol);
- Point aP1(GetWinkPnt(aRect,nStartWink));
- aP1.X()-=aRect.Left()+nXRadReal;
- aP1.Y()-=aRect.Top()+nYRadReal;
- Point aP2(GetWinkPnt(aRect,nEndWink));
- aP2.X()-=aRect.Left()+nXRadReal;
- aP2.Y()-=aRect.Top()+nYRadReal;
- if (meCircleKind==OBJ_SECT) { // Kreissektor: nur noch die beiden Strecken testen
- bRet=IsRectTouchesLine(aZero,aP1,aR) || IsRectTouchesLine(aZero,aP2,aR);
- }
- if (meCircleKind==OBJ_CCUT) { // Kreisabschnitt noch die Sehne und die MaeuseEcke (Dreieck) testen
- if (IsRectTouchesLine(aP1,aP2,aR)) bRet = sal_True; // die Sehne
- else if (bFilled) { // und nun die Maeusescke
- const Polygon aPoly(GetXPoly().getB2DPolygon().getDefaultAdaptiveSubdivision());
- bRet=IsPointInsidePoly(aPoly,rPnt);
- }
- }
- }
- }
- }
- if (!bRet && HasText()) bRet=SdrTextObj::CheckHit(rPnt,nTol,pVisiLayer)!=NULL;
- return bRet ? (SdrObject*)this : NULL;
-}
-
void SdrCircObj::TakeObjNameSingul(XubString& rName) const
{
USHORT nID=STR_ObjNameSingulCIRC;
diff --git a/svx/source/svdraw/svdoedge.cxx b/svx/source/svdraw/svdoedge.cxx
index ef999fa9f6..002a0773b4 100644
--- a/svx/source/svdraw/svdoedge.cxx
+++ b/svx/source/svdraw/svdoedge.cxx
@@ -44,7 +44,6 @@
#include <svx/svddrgv.hxx>
#include "svddrgm1.hxx"
#include <svx/svdhdl.hxx>
-#include "svdtouch.hxx"
#include <svx/svdtrans.hxx>
#include <svx/svdetc.hxx>
#include "svdglob.hxx" // StringCache
@@ -58,6 +57,7 @@
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <svx/sdrhittesthelper.hxx>
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -417,30 +417,6 @@ void SdrEdgeObj::TakeUnrotatedSnapRect(Rectangle& rRect) const
rRect=GetSnapRect();
}
-SdrObject* SdrEdgeObj::CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const
-{
- if(pVisiLayer && !pVisiLayer->IsSet(sal::static_int_cast< sal_uInt8 >(GetLayer())))
- {
- return NULL;
- }
-
- INT32 nMyTol=nTol;
- INT32 nWdt=ImpGetLineWdt()/2; // Halbe Strichstaerke
- if (nWdt>nMyTol) nMyTol=nWdt; // Bei dicker Linie keine Toleranz noetig
- Rectangle aR(rPnt,rPnt);
- aR.Left() -=nMyTol;
- aR.Right() +=nMyTol;
- aR.Top() -=nMyTol;
- aR.Bottom()+=nMyTol;
-
- sal_Bool bHit(sal_False);
-
- const Polygon aPoly(pEdgeTrack->getB2DPolygon().getDefaultAdaptiveSubdivision());
- bHit = IsRectTouchesLine(aPoly,aR);
- if (!bHit && HasText()) bHit = SdrTextObj::CheckHit(rPnt,nTol,pVisiLayer)!=NULL;
- return bHit ? (SdrObject*)this : NULL;
-}
-
FASTBOOL SdrEdgeObj::IsNode() const
{
return TRUE;
@@ -2134,7 +2110,8 @@ FASTBOOL SdrEdgeObj::ImpFindConnector(const Point& rPt, const SdrPageView& rPV,
USHORT nGesAnz=nConAnz+9;
FASTBOOL bUserFnd=FALSE;
ULONG nBestDist=0xFFFFFFFF;
- for (USHORT i=0; i<nGesAnz; i++) {
+ for (USHORT i=0; i<nGesAnz; i++)
+ {
FASTBOOL bUser=i<nConAnz;
FASTBOOL bVertex=i>=nConAnz+0 && i<nConAnz+4;
FASTBOOL bCorner=i>=nConAnz+4 && i<nConAnz+8;
@@ -2191,7 +2168,9 @@ FASTBOOL SdrEdgeObj::ImpFindConnector(const Point& rPt, const SdrPageView& rPV,
}
// Falls kein Konnektor getroffen wird nochmal
// HitTest versucht fuer BestConnector (=bCenter)
- if (!bFnd && !bEdge && pObj->IsHit(rPt,nBoundHitTol,&rVisLayer))
+ if(!bFnd &&
+ !bEdge &&
+ SdrObjectPrimitiveHit(*pObj, rPt, nBoundHitTol, rPV, &rVisLayer, false))
{
// #109007#
// Suppress default connect at object inside bound
diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx
index a7e9d7e67f..67d02ac706 100644
--- a/svx/source/svdraw/svdograf.cxx
+++ b/svx/source/svdraw/svdograf.cxx
@@ -581,13 +581,6 @@ sal_Bool SdrGrafObj::ImpUpdateGraphicLink() const
// -----------------------------------------------------------------------------
-SdrObject* SdrGrafObj::CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const
-{
- return ImpCheckHit( rPnt, nTol, pVisiLayer, TRUE );
-}
-
-// -----------------------------------------------------------------------------
-
void SdrGrafObj::TakeObjNameSingul(XubString& rName) const
{
switch( pGraphic->GetType() )
@@ -666,6 +659,23 @@ void SdrGrafObj::TakeObjNamePlural( XubString& rName ) const
// -----------------------------------------------------------------------------
+SdrObject* SdrGrafObj::getFullDragClone() const
+{
+ // call parent
+ SdrGrafObj* pRetval = static_cast< SdrGrafObj* >(SdrRectObj::getFullDragClone());
+
+ // #i103116# the full drag clone leads to problems
+ // with linked graphics, so reset the link in this
+ // temporary interaction object and load graphic
+ if(pRetval && IsLinkedGraphic())
+ {
+ pRetval->ForceSwapIn();
+ pRetval->ReleaseGraphicLink();
+ }
+
+ return pRetval;
+}
+
void SdrGrafObj::operator=( const SdrObject& rObj )
{
SdrRectObj::operator=( rObj );
@@ -1097,6 +1107,14 @@ IMPL_LINK( SdrGrafObj, ImpSwapHdl, GraphicObject*, pO )
pRet = GRFMGR_AUTOSWAPSTREAM_TEMP;
pGraphic->SetUserData();
}
+
+ // #i102380#
+ sdr::contact::ViewContactOfGraphic* pVC = dynamic_cast< sdr::contact::ViewContactOfGraphic* >(&GetViewContact());
+
+ if(pVC)
+ {
+ pVC->flushGraphicObjects();
+ }
}
}
}
diff --git a/svx/source/svdraw/svdogrp.cxx b/svx/source/svdraw/svdogrp.cxx
index b8822b5ad8..d1966d1bfc 100644
--- a/svx/source/svdraw/svdogrp.cxx
+++ b/svx/source/svdraw/svdogrp.cxx
@@ -295,32 +295,6 @@ const Rectangle& SdrObjGroup::GetSnapRect() const
// <--
}
-SdrObject* SdrObjGroup::CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const
-{
- if (pSub->GetObjCount()!=0) {
- return pSub->CheckHit(rPnt,nTol,pVisiLayer);
- } else { // ansonsten ist es eine leere Gruppe
- if(!pVisiLayer || pVisiLayer->IsSet(sal::static_int_cast< sal_uInt8 >(GetLayer())))
- {
- Rectangle aAussen(aOutRect);
- aAussen.Top() -=nTol;
- aAussen.Left() -=nTol;
- aAussen.Bottom()+=nTol;
- aAussen.Right() +=nTol;
- nTol++;
- Rectangle aInnen(aOutRect);
- aInnen.Top() +=nTol;
- aInnen.Left() +=nTol;
- aInnen.Bottom()-=nTol;
- aInnen.Right() -=nTol;
- if (aAussen.IsInside(rPnt) && !aInnen.IsInside(rPnt)) {
- return (SdrObject*)this;
- }
- }
- }
- return NULL;
-}
-
void SdrObjGroup::operator=(const SdrObject& rObj)
{
if(rObj.IsGroupObject())
diff --git a/svx/source/svdraw/svdomeas.cxx b/svx/source/svdraw/svdomeas.cxx
index 51ada515a3..975d5dea92 100644
--- a/svx/source/svdraw/svdomeas.cxx
+++ b/svx/source/svdraw/svdomeas.cxx
@@ -36,7 +36,6 @@
#include "svditext.hxx" //
#include <svx/xpoly.hxx>
#include <svx/svdtrans.hxx>
-#include "svdtouch.hxx"
#include <svx/svdhdl.hxx>
#include <svx/svdoutl.hxx>
#include <svx/svddrag.hxx>
@@ -766,37 +765,6 @@ void SdrMeasureObj::TakeUnrotatedSnapRect(Rectangle& rRect) const
}
}
-SdrObject* SdrMeasureObj::CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const
-{
- if(pVisiLayer && !pVisiLayer->IsSet(sal::static_int_cast< sal_uInt8 >(GetLayer())))
- {
- return NULL;
- }
-
- sal_Bool bHit(sal_False);
- INT32 nMyTol=nTol;
- INT32 nWdt=ImpGetLineWdt()/2; // Halbe Strichstaerke
- if (nWdt>nMyTol) nMyTol=nWdt; // Bei dicker Linie keine Toleranz noetig
- Rectangle aR(rPnt,rPnt);
- aR.Left() -=nMyTol;
- aR.Right() +=nMyTol;
- aR.Top() -=nMyTol;
- aR.Bottom()+=nMyTol;
-
- if (bTextDirty) UndirtyText();
- ImpMeasureRec aRec;
- ImpMeasurePoly aMPol;
- ImpTakeAttr(aRec);
- ImpCalcGeometrics(aRec,aMPol);
- bHit=IsRectTouchesLine(aMPol.aMainline1.aP1,aMPol.aMainline1.aP2,aR) ||
- IsRectTouchesLine(aMPol.aMainline2.aP1,aMPol.aMainline2.aP2,aR) ||
- IsRectTouchesLine(aMPol.aHelpline1.aP1,aMPol.aHelpline1.aP2,aR) ||
- IsRectTouchesLine(aMPol.aHelpline2.aP1,aMPol.aHelpline2.aP2,aR);
- // und nun noch ggf. den Textbereich checken
- bHit=bHit || SdrTextObj::CheckHit(rPnt,nTol,pVisiLayer)!=NULL;
- return bHit ? (SdrObject*)this : NULL;
-}
-
void SdrMeasureObj::operator=(const SdrObject& rObj)
{
SdrTextObj::operator=(rObj);
@@ -1381,12 +1349,6 @@ void SdrMeasureObj::TakeTextEditArea(Size* pPaperMin, Size* pPaperMax, Rectangle
SdrTextObj::TakeTextEditArea(pPaperMin,pPaperMax,pViewInit,pViewMin);
}
-SdrObject* SdrMeasureObj::CheckTextEditHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const
-{
- if (bTextDirty) UndirtyText();
- return SdrTextObj::CheckTextEditHit(rPnt,nTol,pVisiLayer);
-}
-
USHORT SdrMeasureObj::GetOutlinerViewAnchorMode() const
{
if (bTextDirty) UndirtyText();
diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx
index dfd1ac243c..37281e107b 100644
--- a/svx/source/svdraw/svdoole2.cxx
+++ b/svx/source/svdraw/svdoole2.cxx
@@ -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
@@ -279,7 +279,7 @@ void SAL_CALL SdrLightEmbeddedClient_Impl::notifyEvent( const document::EventObj
Size aScaledSize( static_cast< long >( m_aScaleWidth * Fraction( aVisArea.GetWidth() ) ),
static_cast< long >( m_aScaleHeight * Fraction( aVisArea.GetHeight() ) ) );
Rectangle aLogicRect( mpObj->GetLogicRect() );
-
+
// react to the change if the difference is bigger than one pixel
Size aPixelDiff =
Application::GetDefaultDevice()->LogicToPixel(
@@ -398,7 +398,7 @@ void SAL_CALL SdrLightEmbeddedClient_Impl::activatingUI()
uno::Reference < frame::XFramesSupplier > xParentFrame( xOwnFrame->getCreator(), uno::UNO_QUERY );
if ( xParentFrame.is() )
xParentFrame->setActiveFrame( xOwnFrame );
-
+
OLEObjCache& rObjCache = GetSdrGlobalData().GetOLEObjCache();
const ULONG nCount = rObjCache.Count();
for(sal_Int32 i = nCount-1 ; i >= 0;--i)
@@ -471,7 +471,7 @@ uno::Reference< ::com::sun::star::frame::XLayoutManager > SAL_CALL SdrLightEmbed
{
throw uno::RuntimeException();
}
-
+
return xMan;
}
@@ -1094,7 +1094,7 @@ void SdrOle2Obj::Connect_Impl()
if ( pPers )
{
comphelper::EmbeddedObjectContainer& rContainer = pPers->getEmbeddedObjectContainer();
- if ( !rContainer.HasEmbeddedObject( mpImpl->aPersistName )
+ if ( !rContainer.HasEmbeddedObject( mpImpl->aPersistName )
|| ( xObjRef.is() && !rContainer.HasEmbeddedObject( xObjRef.GetObject() ) ) )
{
// object not known to container document
@@ -1578,13 +1578,6 @@ UINT16 SdrOle2Obj::GetObjIdentifier() const
// -----------------------------------------------------------------------------
-SdrObject* SdrOle2Obj::CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const
-{
- return ImpCheckHit(rPnt,nTol,pVisiLayer,TRUE,TRUE);
-}
-
-// -----------------------------------------------------------------------------
-
void SdrOle2Obj::TakeObjNameSingul(XubString& rName) const
{
rName = ImpGetResStr(bFrame ? STR_ObjNameSingulFrame : STR_ObjNameSingulOLE2);
@@ -2215,82 +2208,7 @@ sal_Bool SdrOle2Obj::AddOwnLightClient()
//////////////////////////////////////////////////////////////////////////////
-bool SdrOle2Obj::executeOldDoPaintPreparations(SdrPageView* pPageVew) const
-{
- bool bIsActive(false);
- // copy of the old SdrOle2Obj::Do_PaintObject stuff which evtl. needs
- // to be emulated.
-
- // //charts must be painted resolution dependent!! #i82893#, #i75867#
- // if( ChartPrettyPainter::IsChart(xObjRef) && ChartPrettyPainter::ShouldPrettyPaintChartOnThisDevice( rOut.GetOutDev() ) )
- // if( !rOut.GetOffset().nA && !rOut.GetOffset().nB )//offset!=0 is the scenario 'copy -> past special gdi metafile' which does not work with direct painting so far
- // if( ChartPrettyPainter::DoPrettyPaintChart( this->getXModel(), rOut.GetOutDev(), aRect ) )
- // return bOk;
- //
- // if( !GetGraphic() )
- // ( (SdrOle2Obj*) this)->GetObjRef_Impl(); // try to create embedded object
-
- // this one can be used directly, just reformatting a bit
- if(!GetGraphic())
- {
- // try to create embedded object
- const_cast< SdrOle2Obj* >(this)->GetObjRef_Impl();
- }
-
- // if ( xObjRef.is() )
- // {
- // sal_Int64 nMiscStatus = xObjRef->getStatus( GetAspect() );
- // if( !bSizProt && (nMiscStatus & embed::EmbedMisc::EMBED_NEVERRESIZE) )
- // ( (SdrOle2Obj*) this)->bSizProt = TRUE;
-
- // old stuff which relies on xObjRef and nMiscStatus
- if(xObjRef.is())
- {
- const sal_Int64 nMiscStatus(xObjRef->getStatus(GetAspect()));
-
- // this hack (to change model data during PAINT argh(!)) can also be reproduced
- // directly
- if(!IsResizeProtect() && (nMiscStatus & embed::EmbedMisc::EMBED_NEVERRESIZE))
- {
- const_cast< SdrOle2Obj* >(this)->SetResizeProtect(true);
- }
-
- // OutputDevice* pOut = rOut.GetOutDev();
- //
- // //TODO/LATER: currently it's not possible to compare the windows, the XOutDev contains a virtual device
- // sal_Int32 nState = xObjRef->getCurrentState();
- // //if ( ( nState != embed::EmbedStates::INPLACE_ACTIVE && nState != embed::EmbedStates::UI_ACTIVE ) ||
- // // pModel && SfxInPlaceClient::GetActiveWindow( pModel->GetPersist(), xObjRef ) != pOut )
- // {
- // if ( nMiscStatus & embed::EmbedMisc::MS_EMBED_ACTIVATEWHENVISIBLE )
- // {
- // // PlugIn-Objekt connecten
- // if (rInfoRec.pPV!=NULL)
- // {
- // SdrOle2Obj* pOle2Obj = (SdrOle2Obj*) this;
- // SdrView* pSdrView = (SdrView*) &rInfoRec.pPV->GetView();
- // pSdrView->DoConnect(pOle2Obj);
- // }
- // }
-
- // nState is used in old paint to see if OLE is activated and to do
- // a different paint
- const sal_Int32 nState(xObjRef->getCurrentState());
-
- bIsActive = (nState == embed::EmbedStates::ACTIVE);
-
- // for this one i need the view.
- if(pPageVew && (nMiscStatus & embed::EmbedMisc::MS_EMBED_ACTIVATEWHENVISIBLE))
- {
- // connect plugin object
- pPageVew->GetView().DoConnect(const_cast< SdrOle2Obj* >(this));
- }
- }
-
- return bIsActive;
-}
-
-Bitmap SdrOle2Obj::GetEmtyOLEReplacementBitmap() const
+Bitmap SdrOle2Obj::GetEmtyOLEReplacementBitmap()
{
return Bitmap(ResId(BMP_SVXOLEOBJ, *ImpGetResMgr()));
}
diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx
index a14e771dba..41c948f130 100644
--- a/svx/source/svdraw/svdopath.cxx
+++ b/svx/source/svdraw/svdopath.cxx
@@ -37,7 +37,6 @@
#include <svx/xpool.hxx>
#include <svx/xpoly.hxx>
#include <svx/svdattr.hxx>
-#include "svdtouch.hxx"
#include <svx/svdtrans.hxx>
#include <svx/svdetc.hxx>
#include <svx/svddrag.hxx>
@@ -79,6 +78,10 @@ inline double ImplMMToTwips(double fVal) { return (fVal * (72.0 / 127.0)); }
#include <basegfx/curve/b2dcubicbezier.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
+// #i89784#
+#include <svx/sdr/attribute/sdrtextattribute.hxx>
+#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
+
using namespace sdr;
inline USHORT GetPrevPnt(USHORT nPnt, USHORT nPntMax, FASTBOOL bClosed)
@@ -1746,7 +1749,10 @@ void SdrPathObj::ImpForceKind()
// was called, once here below and once on a 2nd place below.
// #i10659# for SdrTextObj, keep aRect up to date
- aRect = ImpGetBoundRect(GetPathPoly());
+ if(GetPathPoly().count())
+ {
+ aRect = ImpGetBoundRect(GetPathPoly());
+ }
}
// #i75974# adapt polygon state to object type. This may include a reinterpretation
@@ -1825,51 +1831,6 @@ UINT16 SdrPathObj::GetObjIdentifier() const
return USHORT(meKind);
}
-SdrObject* SdrPathObj::CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const
-{
- if(pVisiLayer && !pVisiLayer->IsSet(sal::static_int_cast< sal_uInt8 >(GetLayer())))
- {
- return NULL;
- }
-
- sal_Bool bHit(sal_False);
- const basegfx::B2DPoint aHitPoint(rPnt.X(), rPnt.Y());
-
- if(GetPathPoly().isClosed() && (bTextFrame || HasFill()))
- {
- // hit in filled polygon? Subdivbide needed for better precision
- if(GetPathPoly().areControlPointsUsed())
- {
- bHit = basegfx::tools::isInside(GetPathPoly().getDefaultAdaptiveSubdivision(), aHitPoint);
- }
- else
- {
- bHit = basegfx::tools::isInside(GetPathPoly(), aHitPoint);
- }
- }
-
- if(!bHit)
- {
- // hit polygon line?
- const double fHalfLineWidth(ImpGetLineWdt() / 2.0);
- double fDistance(nTol);
-
- if(fHalfLineWidth > fDistance)
- {
- fDistance = fHalfLineWidth;
- }
-
- bHit = basegfx::tools::isInEpsilonRange(GetPathPoly(), aHitPoint, fDistance);
- }
-
- if(!bHit && !IsTextFrame() && HasText())
- {
- bHit = (0L != SdrTextObj::CheckHit(rPnt,nTol,pVisiLayer));
- }
-
- return bHit ? (SdrObject*)this : 0L;
-}
-
void SdrPathObj::operator=(const SdrObject& rObj)
{
SdrTextObj::operator=(rObj);
@@ -2424,7 +2385,10 @@ void SdrPathObj::TakeUnrotatedSnapRect(Rectangle& rRect) const
void SdrPathObj::RecalcSnapRect()
{
- maSnapRect = ImpGetBoundRect(GetPathPoly());
+ if(GetPathPoly().count())
+ {
+ maSnapRect = ImpGetBoundRect(GetPathPoly());
+ }
}
void SdrPathObj::NbcSetSnapRect(const Rectangle& rRect)
@@ -2514,8 +2478,11 @@ void SdrPathObj::NbcSetPoint(const Point& rPnt, sal_uInt32 nHdlNum)
}
else
{
- // #i10659# for SdrTextObj, keep aRect up to date
- aRect = ImpGetBoundRect(GetPathPoly()); // fuer SdrTextObj
+ if(GetPathPoly().count())
+ {
+ // #i10659# for SdrTextObj, keep aRect up to date
+ aRect = ImpGetBoundRect(GetPathPoly()); // fuer SdrTextObj#
+ }
}
SetRectsDirty();
@@ -2717,7 +2684,19 @@ SdrObject* SdrPathObj::RipPoint(sal_uInt32 nHdlNum, sal_uInt32& rNewPt0Index)
SdrObject* SdrPathObj::DoConvertToPolyObj(BOOL bBezier) const
{
- SdrObject* pRet = ImpConvertMakeObj(GetPathPoly(), IsClosed(), bBezier);
+ // #i89784# check for FontWork with activated HideContour
+ bool bHideContour(false);
+
+ {
+ drawinglayer::attribute::SdrTextAttribute* pText = drawinglayer::primitive2d::createNewSdrTextAttribute(GetObjectItemSet(), *getText(0));
+ bHideContour = pText && pText->getSdrFormTextAttribute() && pText->isHideContour();
+ delete pText;
+ }
+
+ SdrObject* pRet = bHideContour ?
+ 0 :
+ ImpConvertMakeObj(GetPathPoly(), IsClosed(), bBezier);
+
SdrPathObj* pPath = PTR_CAST(SdrPathObj, pRet);
if(pPath)
diff --git a/svx/source/svdraw/svdorect.cxx b/svx/source/svdraw/svdorect.cxx
index c0aad5a1bf..858df2eda3 100644
--- a/svx/source/svdraw/svdorect.cxx
+++ b/svx/source/svdraw/svdorect.cxx
@@ -38,7 +38,6 @@
#include <svx/xpoly.hxx>
#include <svx/svdattr.hxx>
#include <svx/svdpool.hxx>
-#include "svdtouch.hxx"
#include <svx/svdtrans.hxx>
#include <svx/svdetc.hxx>
#include <svx/svddrag.hxx>
@@ -239,81 +238,6 @@ void SdrRectObj::TakeUnrotatedSnapRect(Rectangle& rRect) const
}
}
-SdrObject* SdrRectObj::ImpCheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer, FASTBOOL bForceFilled, FASTBOOL bForceTol) const
-{
- if(pVisiLayer && !pVisiLayer->IsSet(sal::static_int_cast< sal_uInt8 >(GetLayer())))
- {
- return NULL;
- }
-
- INT32 nMyTol=nTol;
- FASTBOOL bFilled=bForceFilled || HasFill();
- FASTBOOL bPickThrough=pModel!=NULL && pModel->IsPickThroughTransparentTextFrames();
- if (bTextFrame && !bPickThrough) bFilled=TRUE;
- FASTBOOL bLine=HasLine();
-
- INT32 nWdt=bLine ? ImpGetLineWdt() :0; // Halbe Strichstaerke
-
- // #i25616#
- if(nWdt && !LineIsOutsideGeometry())
- {
- nWdt /= 2;
- }
-
- long nBoundWdt=aRect.GetWidth()-1;
- long nBoundHgt=aRect.GetHeight()-1;
- if (bFilled && nBoundWdt>short(nTol) && nBoundHgt>short(nTol) && Abs(aGeo.nShearWink)<=4500) {
- if (!bForceTol && !bTextFrame ) nMyTol=0; // Keine Toleranz noetig hier
- }
- if (nWdt>nMyTol && (!bTextFrame || pEdtOutl==NULL)) nMyTol=nWdt; // Bei dicker Umrandung keine Toleranz noetig, ausser wenn bei TextEdit
- Rectangle aR(aRect);
- if (nMyTol!=0 && bFilled) {
- aR.Left ()-=nMyTol;
- aR.Top ()-=nMyTol;
- aR.Right ()+=nMyTol;
- aR.Bottom()+=nMyTol;
- }
-
- if (bFilled || bLine || bTextFrame) { // Bei TextFrame so tun, alsob Linie da
- unsigned nCnt=0;
- INT32 nXShad=0,nYShad=0;
- long nEckRad=/*bTextFrame ? 0 :*/ GetEckenradius();
- do { // 1 Durchlauf, bei Schatten 2 Durchlaeufe.
- if (nCnt!=0) aR.Move(nXShad,nYShad);
- if (aGeo.nDrehWink!=0 || aGeo.nShearWink!=0 || nEckRad!=0 || !bFilled) {
- Polygon aPol(aR);
- if (nEckRad!=0) {
- INT32 nRad=nEckRad;
- if (bFilled) nRad+=nMyTol; // um korrekt zu sein ...
- XPolygon aXPoly(ImpCalcXPoly(aR,nRad));
- aPol = Polygon(aXPoly.getB2DPolygon().getDefaultAdaptiveSubdivision());
- } else {
- if (aGeo.nShearWink!=0) ShearPoly(aPol,aRect.TopLeft(),aGeo.nTan);
- if (aGeo.nDrehWink!=0) RotatePoly(aPol,aRect.TopLeft(),aGeo.nSin,aGeo.nCos);
- }
- if (bFilled) {
- if (IsPointInsidePoly(aPol,rPnt)) return (SdrObject*)this;
- } else {
- Rectangle aTouchRect(rPnt.X()-nMyTol,rPnt.Y()-nMyTol,rPnt.X()+nMyTol,rPnt.Y()+nMyTol);
- if (IsRectTouchesLine(aPol,aTouchRect)) return (SdrObject*)this;
- }
- } else {
- if (aR.IsInside(rPnt)) return (SdrObject*)this;
- }
- } while (nCnt++==0 && ImpGetShadowDist(nXShad,nYShad));
- }
- FASTBOOL bCheckText=TRUE;
- if (bCheckText && HasText() && (!bTextFrame || bPickThrough)) {
- return SdrTextObj::CheckHit(rPnt,nTol,pVisiLayer);
- }
- return NULL;
-}
-
-SdrObject* SdrRectObj::CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const
-{
- return ImpCheckHit(rPnt,nTol,pVisiLayer,FALSE/*,bTextFrame*/);
-}
-
void SdrRectObj::TakeObjNameSingul(XubString& rName) const
{
if (IsTextFrame())
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index 043b38957c..a0116cd1d9 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -36,7 +36,6 @@
#include <svx/svdpagv.hxx> // fuer Abfrage im Paint, ob das
#include <svx/svdview.hxx> // Objekt gerade editiert wird
#include <svx/svdpage.hxx> // und fuer AnimationHandler (Laufschrift)
-#include "svdtouch.hxx"
#include <svx/svdetc.hxx>
#include <svx/svdoutl.hxx>
#include "svdscrol.hxx" // fuer Laufschrift
@@ -1129,101 +1128,6 @@ void SdrTextObj::StopTextAnimation(OutputDevice* /*pOutDev*/, long /*nExtraData*
SetTextAnimationAllowed(sal_False);
}
-SdrObject* SdrTextObj::CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const
-{
- if(!bTextFrame && !GetOutlinerParaObject() )
- {
- return NULL;
- }
-
- if(pVisiLayer && !pVisiLayer->IsSet(sal::static_int_cast< sal_uInt8 >(GetLayer())))
- {
- return NULL;
- }
-
- INT32 nMyTol=nTol;
- FASTBOOL bFontwork=IsFontwork();
- SdrFitToSizeType eFit=GetFitToSize();
- FASTBOOL bFitToSize=(eFit==SDRTEXTFIT_PROPORTIONAL || eFit==SDRTEXTFIT_ALLLINES);
- Rectangle aR(aRect);
- Rectangle aAnchor2(aR);
- Rectangle aTextRect(aR);
- SdrOutliner* pOutliner = NULL;
- pOutliner = &pModel->GetHitTestOutliner();
-
- if (bFontwork) {
- if (pFormTextBoundRect!=NULL) aR=*pFormTextBoundRect;
- else aR=GetCurrentBoundRect();
- }
- else
- {
- TakeTextRect( *pOutliner, aTextRect, FALSE, &aAnchor2, FALSE ); // EditText nicht mehr ignorieren! TRUE); // EditText ignorieren!
-
- if (bFitToSize)
- aR=aAnchor2;
- else
- aR=aTextRect;
- }
- if (aR.GetWidth()-1>short(nTol) && aR.GetHeight()-1>short(nTol)) nMyTol=0; // Keine Toleranz noetig hier
- if (nMyTol!=0) {
- aR.Left ()-=nMyTol;
- aR.Top ()-=nMyTol;
- aR.Right ()+=nMyTol;
- aR.Bottom()+=nMyTol;
- }
- FASTBOOL bRet=FALSE;
-
- if(bFontwork)
- {
- bRet = aR.IsInside(rPnt);
-
- // #105130# Include aRect here in measurements to be able to hit a
- // fontwork object on its border
- if(!bRet)
- {
- const Rectangle aSnapRect = GetSnapRect();
-
- if( (rPnt.X() >= aSnapRect.Left() - nTol && rPnt.X() <= aSnapRect.Left() + nTol)
- || (rPnt.X() >= aSnapRect.Right() - nTol && rPnt.X() <= aSnapRect.Right() + nTol)
- || (rPnt.Y() >= aSnapRect.Top() - nTol && rPnt.Y() <= aSnapRect.Top() + nTol)
- || (rPnt.Y() >= aSnapRect.Bottom() - nTol && rPnt.Y() <= aSnapRect.Bottom() + nTol))
- {
- bRet = TRUE;
- }
- }
- }
- else
- {
- if (aGeo.nDrehWink!=0) {
- Polygon aPol(aR);
- RotatePoly(aPol,aR.TopLeft(),aGeo.nSin,aGeo.nCos);
- bRet=IsPointInsidePoly(aPol,rPnt);
- } else {
- bRet=aR.IsInside(rPnt);
- }
- if (bRet) { // und nun noch checken, ob wirklich Buchstaben getroffen sind
- // Featurewunsch zur 4.0
- // Zunaechst meine Dok-Koordinaten in EE-Dok-Koordinaten umwandeln.
- Point aPt(rPnt); aPt-=aR.TopLeft();
- if (bFitToSize) { // #38214#: FitToSize berueksichtigen
- Fraction aX(aTextRect.GetWidth()-1,aAnchor2.GetWidth()-1);
- Fraction aY(aTextRect.GetHeight()-1,aAnchor2.GetHeight()-1);
- ResizePoint(aPt,Point(),aX,aY);
- }
- if (aGeo.nDrehWink!=0) RotatePoint(aPt,Point(),-aGeo.nSin,aGeo.nCos); // -sin fuer Unrotate
- // Und nun im EE-Dok auf Buchstabensuche gehen
- long nHitTol = 2000;
- OutputDevice* pRef = pOutliner->GetRefDevice();
- if( pRef )
- nHitTol = pRef->LogicToLogic( nHitTol, MAP_100TH_MM, pRef->GetMapMode().GetMapUnit() );
-
- bRet = pOutliner->IsTextPos( aPt, (sal_uInt16)nHitTol );
- }
- }
-
- return bRet ? (SdrObject*)this : NULL;
-}
-
void SdrTextObj::TakeObjNameSingul(XubString& rName) const
{
XubString aStr;
diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx
index 4ca4e02c90..cd760c7a44 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -657,7 +657,11 @@ namespace
bool SdrTextObj::impCheckSpellCheckForDecomposeTextPrimitive() const
{
- return false;
+ // #i102062# asked TL who killed this feature (CWS tl56). Obviously, there
+ // is no more support for EE_CNTRL_NOREDLINES anymore; redlining is always
+ // on nowadays. Unfortunately, not false, but true should be returned then.
+ // Trying if this is all...
+ return true;
}
bool SdrTextObj::impDecomposeContourTextPrimitive(
@@ -731,7 +735,9 @@ bool SdrTextObj::impDecomposeBlockTextPrimitive(
// prepare outliner
const bool bIsCell(rSdrBlockTextPrimitive.getCellText());
- const SfxItemSet& rTextItemSet = rSdrBlockTextPrimitive.getSdrText().GetItemSet();
+ const SfxItemSet& rTextItemSet = rSdrBlockTextPrimitive.getSdrText()
+ ? rSdrBlockTextPrimitive.getSdrText()->GetItemSet()
+ : GetObjectItemSet();
SdrOutliner& rOutliner = ImpGetDrawOutliner();
SdrTextVertAdjust eVAdj = GetTextVerticalAdjust(rTextItemSet);
SdrTextHorzAdjust eHAdj = GetTextHorizontalAdjust(rTextItemSet);
@@ -767,17 +773,40 @@ bool SdrTextObj::impDecomposeBlockTextPrimitive(
}
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);
+
if((rSdrBlockTextPrimitive.getWordWrap() || IsTextFrame()) && !rSdrBlockTextPrimitive.getUnlimitedPage())
{
- rOutliner.SetMaxAutoPaperSize(aAnchorTextSize);
+ // #i103454# maximal paper size hor/ver needs to be limited to text
+ // frame size. If it's block text, still allow the 'other' direction
+ // to grow to get a correct real text size when using GetPaperSize().
+ // When just using aAnchorTextSize as maximum, GetPaperSize()
+ // would just return aAnchorTextSize again: this means, the wanted
+ // 'measurement' of the real size of block text would not work
+ Size aMaxAutoPaperSize(aAnchorTextSize);
+
+ if(bHorizontalIsBlock)
+ {
+ // allow to grow vertical for horizontal blocks
+ aMaxAutoPaperSize.setHeight(1000000);
+ }
+ else if(bVerticalIsBlock)
+ {
+ // allow to grow horizontal for vertical blocks
+ aMaxAutoPaperSize.setWidth(1000000);
+ }
+
+ rOutliner.SetMaxAutoPaperSize(aMaxAutoPaperSize);
}
- if(SDRTEXTHORZADJUST_BLOCK == eHAdj && !bVerticalWritintg)
+ // set minimal paper size hor/ver if needed
+ if(bHorizontalIsBlock)
{
rOutliner.SetMinAutoPaperSize(Size(nAnchorTextWidth, 0));
}
-
- if(SDRTEXTVERTADJUST_BLOCK == eVAdj && bVerticalWritintg)
+ else if(bVerticalIsBlock)
{
rOutliner.SetMinAutoPaperSize(Size(0, nAnchorTextHeight));
}
@@ -903,7 +932,9 @@ bool SdrTextObj::impDecomposeStretchTextPrimitive(
// prepare outliner
SdrOutliner& rOutliner = ImpGetDrawOutliner();
const sal_uInt32 nOriginalControlWord(rOutliner.GetControlWord());
- const SfxItemSet& rTextItemSet = rSdrStretchTextPrimitive.getSdrText().GetItemSet();
+ const SfxItemSet& rTextItemSet = rSdrStretchTextPrimitive.getSdrText()
+ ? rSdrStretchTextPrimitive.getSdrText()->GetItemSet()
+ : GetObjectItemSet();
const Size aNullSize;
rOutliner.SetControlWord(nOriginalControlWord|EE_CNTRL_STRETCHING|EE_CNTRL_AUTOPAGESIZE);
@@ -927,6 +958,16 @@ bool SdrTextObj::impDecomposeStretchTextPrimitive(
basegfx::B2DHomMatrix aNewTransformA;
basegfx::B2DHomMatrix aNewTransformB;
+ // #i101957# Check for vertical text. If used, aNewTransformA
+ // needs to translate the text initially around object width to orient
+ // it relative to the topper right instead of the topper left
+ const bool bVertical(rSdrStretchTextPrimitive.getOutlinerParaObject().IsVertical());
+
+ if(bVertical)
+ {
+ aNewTransformA.translate(aScale.getX(), 0.0);
+ }
+
// calculate global char stretching scale parameters. Use non-mirrored sizes
// to layout without mirroring
const double fScaleX(fabs(aScale.getX()) / aOutlinerScale.getX());
@@ -1196,4 +1237,5 @@ void SdrTextObj::impGetScrollTextTiming(drawinglayer::animation::AnimationEntryL
}
}
+//////////////////////////////////////////////////////////////////////////////
// eof
diff --git a/svx/source/svdraw/svdotextpathdecomposition.cxx b/svx/source/svdraw/svdotextpathdecomposition.cxx
index 5379f525b0..af6413bb8d 100644
--- a/svx/source/svdraw/svdotextpathdecomposition.cxx
+++ b/svx/source/svdraw/svdotextpathdecomposition.cxx
@@ -70,6 +70,7 @@
#include <editstat.hxx>
#include <unoapi.hxx>
#include <drawinglayer/geometry/viewinformation2d.hxx>
+#include <svx/sdr/attribute/sdrformtextoutlineattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -223,65 +224,13 @@ namespace
} // end of anonymous namespace
//////////////////////////////////////////////////////////////////////////////
-// TextBreakup data helper
-
-namespace
-{
- class impFormTextValues
- {
- sal_Int32 mnFormTextDistance; // distance from line in upright direction
- sal_Int32 mnFormTextStart; // shift from polygon start
- sal_Int32 mnFormTextShdwXVal; // shadow distance or 10th degrees
- sal_Int32 mnFormTextShdwYVal; // shadow distance or scaling
- sal_uInt16 mnFormTextShdwTransp; // shadow transparence
- XFormTextStyle meFormTextStyle; // on/off and char orientation
- XFormTextAdjust meFormTextAdjust; // adjustment (left/right/center) and scale
- XFormTextShadow meFormTextShadow; // shadow mode
- Color maFormTextShdwColor; // shadow color
-
- // bitfield
- unsigned mbFormTextMirror : 1; // change orientation
- unsigned mbFormTextOutline : 1; // show contour of objects
-
- public:
- impFormTextValues(const SfxItemSet& rSet)
- : mnFormTextDistance(((const XFormTextDistanceItem&)rSet.Get(XATTR_FORMTXTDISTANCE)).GetValue()),
- mnFormTextStart(((const XFormTextStartItem&)rSet.Get(XATTR_FORMTXTSTART)).GetValue()),
- mnFormTextShdwXVal(((const XFormTextShadowXValItem&)rSet.Get(XATTR_FORMTXTSHDWXVAL)).GetValue()),
- mnFormTextShdwYVal(((const XFormTextShadowYValItem&)rSet.Get(XATTR_FORMTXTSHDWYVAL)).GetValue()),
- mnFormTextShdwTransp(((const XFormTextShadowTranspItem&)rSet.Get(XATTR_FORMTXTSHDWTRANSP)).GetValue()),
- meFormTextStyle(((const XFormTextStyleItem&)rSet.Get(XATTR_FORMTXTSTYLE)).GetValue()),
- meFormTextAdjust(((const XFormTextAdjustItem&)rSet.Get(XATTR_FORMTXTADJUST)).GetValue()),
- meFormTextShadow(((const XFormTextShadowItem&)rSet.Get(XATTR_FORMTXTSHADOW)).GetValue()),
- maFormTextShdwColor(((const XFormTextShadowColorItem&)rSet.Get(XATTR_FORMTXTSHDWCOLOR)).GetColorValue()),
- mbFormTextMirror(((const XFormTextMirrorItem&)rSet.Get(XATTR_FORMTXTMIRROR)).GetValue()),
- mbFormTextOutline(((const XFormTextOutlineItem&)rSet.Get(XATTR_FORMTXTOUTLINE)).GetValue())
- {
- }
-
- // data access
- sal_Int32 getFormTextDistance() const { return mnFormTextDistance; }
- sal_Int32 getFormTextStart() const { return mnFormTextStart; }
- sal_Int32 getFormTextShdwXVal() const { return mnFormTextShdwXVal; }
- sal_Int32 getFormTextShdwYVal() const { return mnFormTextShdwYVal; }
- sal_uInt16 getFormTextShdwTransp() const { return mnFormTextShdwTransp; }
- XFormTextStyle getFormTextStyle() const { return meFormTextStyle; }
- XFormTextAdjust getFormTextAdjust() const { return meFormTextAdjust; }
- XFormTextShadow getFormTextShadow() const { return meFormTextShadow; }
- Color getFormTextShdwColor() const { return maFormTextShdwColor; }
- bool getFormTextMirror() const { return mbFormTextMirror; }
- bool getFormTextOutline() const { return mbFormTextOutline; }
- };
-} // end of anonymous namespace
-
-//////////////////////////////////////////////////////////////////////////////
// TextBreakup one poly and one paragraph helper
namespace
{
class impPolygonParagraphHandler
{
- const impFormTextValues& mrVal; // FormText parameters
+ const drawinglayer::attribute::SdrFormTextAttribute& mrSdrFormTextAttribute; // FormText parameters
std::vector< drawinglayer::primitive2d::BasePrimitive2D* >& mrDecomposition; // destination primitive list
std::vector< drawinglayer::primitive2d::BasePrimitive2D* >& mrShadowDecomposition; // destination primitive list for shadow
Reference < com::sun::star::i18n::XBreakIterator > mxBreak; // break iterator
@@ -321,10 +270,10 @@ namespace
public:
impPolygonParagraphHandler(
- const impFormTextValues& rVal,
+ const drawinglayer::attribute::SdrFormTextAttribute& rSdrFormTextAttribute,
std::vector< drawinglayer::primitive2d::BasePrimitive2D* >& rDecomposition,
std::vector< drawinglayer::primitive2d::BasePrimitive2D* >& rShadowDecomposition)
- : mrVal(rVal),
+ : mrSdrFormTextAttribute(rSdrFormTextAttribute),
mrDecomposition(rDecomposition),
mrShadowDecomposition(rShadowDecomposition)
{
@@ -348,16 +297,18 @@ namespace
double fPolyStart(0.0);
double fScaleFactor(1.0);
- if(mrVal.getFormTextMirror())
+ if(mrSdrFormTextAttribute.getFormTextMirror())
{
aPolygonCandidate.flip();
}
- if(mrVal.getFormTextStart() && (XFT_LEFT == mrVal.getFormTextAdjust() || XFT_RIGHT == mrVal.getFormTextAdjust()))
+ if(mrSdrFormTextAttribute.getFormTextStart()
+ && (XFT_LEFT == mrSdrFormTextAttribute.getFormTextAdjust()
+ || XFT_RIGHT == mrSdrFormTextAttribute.getFormTextAdjust()))
{
- if(XFT_LEFT == mrVal.getFormTextAdjust())
+ if(XFT_LEFT == mrSdrFormTextAttribute.getFormTextAdjust())
{
- fPolyStart += mrVal.getFormTextStart();
+ fPolyStart += mrSdrFormTextAttribute.getFormTextStart();
if(fPolyStart > fPolyEnd)
{
@@ -366,7 +317,7 @@ namespace
}
else
{
- fPolyEnd -= mrVal.getFormTextStart();
+ fPolyEnd -= mrSdrFormTextAttribute.getFormTextStart();
if(fPolyEnd < fPolyStart)
{
@@ -375,7 +326,7 @@ namespace
}
}
- if(XFT_LEFT != mrVal.getFormTextAdjust())
+ if(XFT_LEFT != mrSdrFormTextAttribute.getFormTextAdjust())
{
// calculate total text length of this paragraph, some layout needs to be done
const double fParagraphTextLength(getParagraphTextLength(rTextPortions));
@@ -384,7 +335,7 @@ namespace
// but still take care of XFT_AUTOSIZE in that case
const bool bTextTooLong(fParagraphTextLength > (fPolyEnd - fPolyStart));
- if(XFT_RIGHT == mrVal.getFormTextAdjust())
+ if(XFT_RIGHT == mrSdrFormTextAttribute.getFormTextAdjust())
{
if(!bTextTooLong)
{
@@ -392,7 +343,7 @@ namespace
fPolyStart += ((fPolyEnd - fPolyStart) - fParagraphTextLength);
}
}
- else if(XFT_CENTER == mrVal.getFormTextAdjust())
+ else if(XFT_CENTER == mrSdrFormTextAttribute.getFormTextAdjust())
{
if(!bTextTooLong)
{
@@ -400,7 +351,7 @@ namespace
fPolyStart += ((fPolyEnd - fPolyStart) - fParagraphTextLength) / 2.0;
}
}
- else if(XFT_AUTOSIZE == mrVal.getFormTextAdjust())
+ else if(XFT_AUTOSIZE == mrSdrFormTextAttribute.getFormTextAdjust())
{
// if scale, prepare scale factor between curve length and text length
if(0.0 != fParagraphTextLength)
@@ -434,7 +385,7 @@ namespace
// prepare portion length. Takes RTL sections into account.
double fPortionLength(pCandidate->getDisplayLength(nUsedTextLength, nNextGlyphLen));
- if(XFT_AUTOSIZE == mrVal.getFormTextAdjust())
+ if(XFT_AUTOSIZE == mrSdrFormTextAttribute.getFormTextAdjust())
{
// when scaling, expand portion length
fPortionLength *= fScaleFactor;
@@ -449,25 +400,27 @@ namespace
aNewTransformA.scale(aSize.getX(), aSize.getY());
// prepare scaling of text primitive
- if(XFT_AUTOSIZE == mrVal.getFormTextAdjust())
+ if(XFT_AUTOSIZE == mrSdrFormTextAttribute.getFormTextAdjust())
{
// when scaling, expand text primitive scaling
aNewTransformA.scale(fScaleFactor, fScaleFactor);
}
// eventually create shadow primitives from aDecomposition and add to rDecomposition
- const bool bShadow(XFTSHADOW_NONE != mrVal.getFormTextShadow());
+ const bool bShadow(XFTSHADOW_NONE != mrSdrFormTextAttribute.getFormTextShadow());
if(bShadow)
{
- if(XFTSHADOW_NORMAL == mrVal.getFormTextShadow())
+ if(XFTSHADOW_NORMAL == mrSdrFormTextAttribute.getFormTextShadow())
{
- aNewShadowTransform.translate(mrVal.getFormTextShdwXVal(), -mrVal.getFormTextShdwYVal());
+ aNewShadowTransform.translate(
+ mrSdrFormTextAttribute.getFormTextShdwXVal(),
+ -mrSdrFormTextAttribute.getFormTextShdwYVal());
}
else // XFTSHADOW_SLANT
{
- double fScaleValue(mrVal.getFormTextShdwYVal() / 100.0);
- double fShearValue(-mrVal.getFormTextShdwXVal() * F_PI1800);
+ double fScaleValue(mrSdrFormTextAttribute.getFormTextShdwYVal() / 100.0);
+ double fShearValue(-mrSdrFormTextAttribute.getFormTextShdwXVal() * F_PI1800);
aNewShadowTransform.scale(1.0, fScaleValue);
aNewShadowTransform.shearX(sin(fShearValue));
@@ -475,7 +428,7 @@ namespace
}
}
- switch(mrVal.getFormTextStyle())
+ switch(mrSdrFormTextAttribute.getFormTextStyle())
{
case XFT_ROTATE :
{
@@ -533,7 +486,7 @@ namespace
}
// distance from path?
- if(mrVal.getFormTextDistance())
+ if(mrSdrFormTextAttribute.getFormTextDistance())
{
if(aEndPos.equal(aStartPos))
{
@@ -541,7 +494,9 @@ namespace
}
// use back vector (aStartPos - aEndPos) here to get mirrored perpendicular as in old stuff
- const basegfx::B2DVector aPerpendicular(basegfx::getNormalizedPerpendicular(aStartPos - aEndPos) * mrVal.getFormTextDistance());
+ const basegfx::B2DVector aPerpendicular(
+ basegfx::getNormalizedPerpendicular(aStartPos - aEndPos) *
+ mrSdrFormTextAttribute.getFormTextDistance());
aNewTransformB.translate(aPerpendicular.getX(), aPerpendicular.getY());
}
@@ -550,7 +505,7 @@ namespace
{
if(pCandidate->getText().Len() && nNextGlyphLen)
{
- const Color aShadowColor(mrVal.getFormTextShdwColor());
+ const Color aShadowColor(mrSdrFormTextAttribute.getFormTextShdwColor());
const basegfx::BColor aRGBShadowColor(aShadowColor.getBColor());
const xub_StrLen nPortionIndex(pCandidate->getPortionIndex(nUsedTextLength, nNextGlyphLen));
const ::std::vector< double > aNewDXArray(
@@ -611,101 +566,6 @@ namespace
namespace
{
- basegfx::B2DLineJoin impGetB2DLineJoin(XLineJoint eLineJoint)
- {
- switch(eLineJoint)
- {
- case XLINEJOINT_MIDDLE :
- {
- return basegfx::B2DLINEJOIN_MIDDLE;
- }
- case XLINEJOINT_BEVEL :
- {
- return basegfx::B2DLINEJOIN_BEVEL;
- }
- case XLINEJOINT_MITER :
- {
- return basegfx::B2DLINEJOIN_MITER;
- }
- case XLINEJOINT_ROUND :
- {
- return basegfx::B2DLINEJOIN_ROUND;
- }
- default :
- {
- return basegfx::B2DLINEJOIN_NONE; // XLINEJOINT_NONE
- }
- }
- }
-} // end of anonymous namespace
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace
-{
- sal_uInt8 impGetStrokeTransparence(bool bShadow, const SfxItemSet& rSet)
- {
- sal_uInt8 nRetval;
-
- if(bShadow)
- {
- nRetval = (sal_uInt8)((((SdrShadowTransparenceItem&)(rSet.Get(SDRATTR_SHADOWTRANSPARENCE))).GetValue() * 255) / 100);
- }
- else
- {
- nRetval = (sal_uInt8)((((XLineTransparenceItem&)(rSet.Get(XATTR_LINETRANSPARENCE))).GetValue() * 255) / 100);
- }
-
- return nRetval;
- }
-
- drawinglayer::attribute::LineAttribute impGetLineAttribute(bool bShadow, const SfxItemSet& rSet)
- {
- basegfx::BColor aColorAttribute;
-
- if(bShadow)
- {
- const Color aShadowColor(((SdrShadowColorItem&)(rSet.Get(SDRATTR_SHADOWCOLOR))).GetColorValue());
- aColorAttribute = aShadowColor.getBColor();
- }
- else
- {
- const Color aLineColor(((XLineColorItem&)(rSet.Get(XATTR_LINECOLOR))).GetColorValue());
- aColorAttribute = aLineColor.getBColor();
- }
-
- const sal_uInt32 nLineWidth = ((const XLineWidthItem&)(rSet.Get(XATTR_LINEWIDTH))).GetValue();
- const XLineJoint eLineJoint = ((const XLineJointItem&)(rSet.Get(XATTR_LINEJOINT))).GetValue();
-
- return drawinglayer::attribute::LineAttribute(aColorAttribute, (double)nLineWidth, impGetB2DLineJoin(eLineJoint));
- }
-
- drawinglayer::attribute::StrokeAttribute impGetStrokeAttribute(const SfxItemSet& rSet)
- {
- const XLineStyle eLineStyle = ((XLineStyleItem&)(rSet.Get(XATTR_LINESTYLE))).GetValue();
- double fFullDotDashLen(0.0);
- ::std::vector< double > aDotDashArray;
-
- if(XLINE_DASH == eLineStyle)
- {
- const XDash& rDash = ((const XLineDashItem&)(rSet.Get(XATTR_LINEDASH))).GetDashValue();
-
- if(rDash.GetDots() || rDash.GetDashes())
- {
- const sal_uInt32 nLineWidth = ((const XLineWidthItem&)(rSet.Get(XATTR_LINEWIDTH))).GetValue();
- fFullDotDashLen = rDash.CreateDotDashArray(aDotDashArray, (double)nLineWidth);
- }
- }
-
- return drawinglayer::attribute::StrokeAttribute(aDotDashArray, fFullDotDashLen);
- }
-} // end of anonymous namespace
-
-//////////////////////////////////////////////////////////////////////////////
-// primitive decomposition helpers
-
-namespace
-{
void impAddPolygonStrokePrimitives(
const basegfx::B2DPolyPolygonVector& rB2DPolyPolyVector,
const basegfx::B2DHomMatrix& rTransform,
@@ -732,8 +592,7 @@ namespace
drawinglayer::primitive2d::Primitive2DSequence impAddPathTextOutlines(
const std::vector< drawinglayer::primitive2d::BasePrimitive2D* >& rSource,
- bool bShadow,
- const SfxItemSet& rSet)
+ const drawinglayer::attribute::SdrFormTextOutlineAttribute& rOutlineAttribute)
{
std::vector< drawinglayer::primitive2d::BasePrimitive2D* > aNewPrimitives;
@@ -751,19 +610,19 @@ namespace
if(aB2DPolyPolyVector.size())
{
- // prepare Line and Stroke Attribute
- const drawinglayer::attribute::LineAttribute aLineAttribute(impGetLineAttribute(bShadow, rSet));
- const drawinglayer::attribute::StrokeAttribute aStrokeAttribute(impGetStrokeAttribute(rSet));
- const sal_uInt8 nTransparence(impGetStrokeTransparence(bShadow, rSet));
-
// create stroke primitives
std::vector< drawinglayer::primitive2d::BasePrimitive2D* > aStrokePrimitives;
- impAddPolygonStrokePrimitives(aB2DPolyPolyVector, aPolygonTransform, aLineAttribute, aStrokeAttribute, aStrokePrimitives);
+ impAddPolygonStrokePrimitives(
+ aB2DPolyPolyVector,
+ aPolygonTransform,
+ rOutlineAttribute.getLineAttribute(),
+ rOutlineAttribute.getStrokeAttribute(),
+ aStrokePrimitives);
const sal_uInt32 nStrokeCount(aStrokePrimitives.size());
if(nStrokeCount)
{
- if(nTransparence)
+ if(rOutlineAttribute.getTransparence())
{
// create UnifiedAlphaPrimitive2D
drawinglayer::primitive2d::Primitive2DSequence aStrokePrimitiveSequence(nStrokeCount);
@@ -773,7 +632,10 @@ namespace
aStrokePrimitiveSequence[b] = drawinglayer::primitive2d::Primitive2DReference(aStrokePrimitives[b]);
}
- drawinglayer::primitive2d::UnifiedAlphaPrimitive2D* pNew2 = new drawinglayer::primitive2d::UnifiedAlphaPrimitive2D(aStrokePrimitiveSequence, (double)nTransparence / 100.0);
+ drawinglayer::primitive2d::UnifiedAlphaPrimitive2D* pNew2 =
+ new drawinglayer::primitive2d::UnifiedAlphaPrimitive2D(
+ aStrokePrimitiveSequence,
+ (double)rOutlineAttribute.getTransparence() / 100.0);
aNewPrimitives.push_back(pNew2);
}
else
@@ -822,7 +684,7 @@ bool SdrTextObj::impDecomposePathTextPrimitive(
rOutliner.SetUpdateMode(true);
rOutliner.Clear();
rOutliner.SetPaperSize(Size(LONG_MAX,LONG_MAX));
- rOutliner.SetText(*rSdrPathTextPrimitive.getSdrText().GetOutlinerParaObject());
+ rOutliner.SetText(rSdrPathTextPrimitive.getOutlinerParaObject());
// set visualizing page at Outliner; needed e.g. for PageNumberField decomposition
rOutliner.setVisualizedPage(GetSdrPageFromXDrawPage(aViewInformation.getVisualizedPage()));
@@ -833,11 +695,8 @@ bool SdrTextObj::impDecomposePathTextPrimitive(
if(rPathTextPortions.size())
{
- // get FormText values
- const SfxItemSet& rSet = rSdrPathTextPrimitive.getSdrText().GetItemSet();
- const impFormTextValues aVal(rSet);
-
- // get polygon values
+ // get FormText and polygon values
+ const drawinglayer::attribute::SdrFormTextAttribute& rFormTextAttribute = rSdrPathTextPrimitive.getSdrFormTextAttribute();
const basegfx::B2DPolyPolygon& rPathPolyPolygon(rSdrPathTextPrimitive.getPathPolyPolygon());
// get loop count
@@ -848,12 +707,13 @@ bool SdrTextObj::impDecomposePathTextPrimitive(
nLoopCount = rOutliner.GetParagraphCount();
}
- if(nLoopCount && XFT_NONE != aVal.getFormTextStyle())
+ if(nLoopCount)
{
// prepare common decomposition stuff
std::vector< drawinglayer::primitive2d::BasePrimitive2D* > aRegularDecomposition;
std::vector< drawinglayer::primitive2d::BasePrimitive2D* > aShadowDecomposition;
- impPolygonParagraphHandler aPolygonParagraphHandler(aVal, aRegularDecomposition, aShadowDecomposition);
+ impPolygonParagraphHandler aPolygonParagraphHandler(
+ rFormTextAttribute, aRegularDecomposition, aShadowDecomposition);
sal_uInt32 a;
for(a = 0L; a < nLoopCount; a++)
@@ -892,10 +752,10 @@ bool SdrTextObj::impDecomposePathTextPrimitive(
}
// evtl. add shadow outlines
- if(aVal.getFormTextOutline())
+ if(rFormTextAttribute.getFormTextOutline() && rFormTextAttribute.getShadowOutline())
{
- const SfxItemSet& rLocalSet = rSdrPathTextPrimitive.getSdrText().GetObject().GetMergedItemSet();
- const drawinglayer::primitive2d::Primitive2DSequence aOutlines(impAddPathTextOutlines(aShadowDecomposition, true, rLocalSet));
+ const drawinglayer::primitive2d::Primitive2DSequence aOutlines(
+ impAddPathTextOutlines(aShadowDecomposition, *rFormTextAttribute.getShadowOutline()));
drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(aRetvalA, aOutlines);
}
}
@@ -911,10 +771,10 @@ bool SdrTextObj::impDecomposePathTextPrimitive(
}
// evtl. add outlines
- if(aVal.getFormTextOutline())
+ if(rFormTextAttribute.getFormTextOutline() && rFormTextAttribute.getOutline())
{
- const SfxItemSet& rLocalSet = rSdrPathTextPrimitive.getSdrText().GetObject().GetMergedItemSet();
- const drawinglayer::primitive2d::Primitive2DSequence aOutlines(impAddPathTextOutlines(aRegularDecomposition, false, rLocalSet));
+ const drawinglayer::primitive2d::Primitive2DSequence aOutlines(
+ impAddPathTextOutlines(aRegularDecomposition, *rFormTextAttribute.getOutline()));
drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(aRetvalB, aOutlines);
}
}
diff --git a/svx/source/svdraw/svdotxed.cxx b/svx/source/svdraw/svdotxed.cxx
index a3f5fb76d1..07258ef669 100644
--- a/svx/source/svdraw/svdotxed.cxx
+++ b/svx/source/svdraw/svdotxed.cxx
@@ -291,11 +291,6 @@ void SdrTextObj::EndTextEdit(SdrOutliner& rOutl)
mbInEditMode = FALSE;
}
-SdrObject* SdrTextObj::CheckTextEditHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const
-{
- return SdrTextObj::CheckHit(rPnt,nTol,pVisiLayer);
-}
-
USHORT SdrTextObj::GetOutlinerViewAnchorMode() const
{
SdrTextHorzAdjust eH=GetTextHorizontalAdjust();
diff --git a/svx/source/svdraw/svdotxtr.cxx b/svx/source/svdraw/svdotxtr.cxx
index 121e8dc1bb..9d4917efbc 100644
--- a/svx/source/svdraw/svdotxtr.cxx
+++ b/svx/source/svdraw/svdotxtr.cxx
@@ -43,9 +43,13 @@
#include <svx/sdr/properties/itemsettools.hxx>
#include <svx/sdr/properties/properties.hxx>
#include <basegfx/polygon/b2dpolypolygontools.hxx>
-#include "svdtxhdl.hxx"
#include <svtools/itemset.hxx>
#include <svditer.hxx>
+#include <drawinglayer/processor2d/textaspolygonextractor2d.hxx>
+#include <svx/sdr/contact/viewcontact.hxx>
+#include <svx/xflclit.hxx>
+#include <svx/xlnclit.hxx>
+#include <svx/xlnwtit.hxx>
////////////////////////////////////////////////////////////////////////////////////////////////////
//
@@ -335,37 +339,139 @@ void SdrTextObj::NbcMirror(const Point& rRef1, const Point& rRef2)
SetGlueReallyAbsolute(FALSE);
}
-SdrObject* SdrTextObj::ImpConvertObj(FASTBOOL bToPoly) const
+//////////////////////////////////////////////////////////////////////////////
+
+SdrObject* SdrTextObj::ImpConvertContainedTextToSdrPathObjs(bool bToPoly) const
{
- if (!ImpCanConvTextToCurve()) return NULL;
- SdrObjGroup* pGroup=new SdrObjGroup();
+ SdrObject* pRetval = 0;
- boost::shared_ptr< SdrOutliner > xOutl( const_cast< SdrTextObj* >(this)->CreateDrawOutliner() );
- xOutl->SetUpdateMode(TRUE);
- ImpTextPortionHandler aConverter(*(xOutl.get()),*this);
+ if(!ImpCanConvTextToCurve())
+ {
+ // suppress HelpTexts from PresObj's
+ return 0;
+ }
- aConverter.ConvertToPathObj(*pGroup,bToPoly);
+ // get primitives
+ const drawinglayer::primitive2d::Primitive2DSequence xSequence(GetViewContact().getViewIndependentPrimitive2DSequence());
- // Nachsehen, ob ueberhaupt was drin ist:
- SdrObjList* pOL=pGroup->GetSubList();
+ if(xSequence.hasElements())
+ {
+ // create an extractor with neutral ViewInformation
+ const drawinglayer::geometry::ViewInformation2D aViewInformation2D(0);
+ drawinglayer::processor2d::TextAsPolygonExtractor2D aExtractor(aViewInformation2D);
- if (pOL->GetObjCount()==0) {
- delete pGroup;
- return NULL;
- }
- // Ein einzelnes Objekt muss nicht gruppiert werden:
- if (pOL->GetObjCount()==1) {
- SdrObject* pObj=pOL->RemoveObject(0);
- delete pGroup;
- return pObj;
+ // extract text as polygons
+ aExtractor.process(xSequence);
+
+ // get results
+ const drawinglayer::processor2d::TextAsPolygonDataNodeVector& rResult = aExtractor.getTarget();
+ const sal_uInt32 nResultCount(rResult.size());
+
+ if(nResultCount)
+ {
+ // prepare own target
+ SdrObjGroup* pGroup = new SdrObjGroup();
+ SdrObjList* pObjectList = pGroup->GetSubList();
+
+ // process results
+ for(sal_uInt32 a(0); a < nResultCount; a++)
+ {
+ const drawinglayer::processor2d::TextAsPolygonDataNode& rCandidate = rResult[a];
+ basegfx::B2DPolyPolygon aPolyPolygon(rCandidate.getB2DPolyPolygon());
+
+ if(aPolyPolygon.count())
+ {
+ // take care of wanted polygon type
+ if(bToPoly)
+ {
+ if(aPolyPolygon.areControlPointsUsed())
+ {
+ aPolyPolygon = basegfx::tools::adaptiveSubdivideByAngle(aPolyPolygon);
+ }
+ }
+ else
+ {
+ if(!aPolyPolygon.areControlPointsUsed())
+ {
+ aPolyPolygon = basegfx::tools::expandToCurve(aPolyPolygon);
+ }
+ }
+
+ // create ItemSet with object attributes
+ SfxItemSet aAttributeSet(GetObjectItemSet());
+ SdrPathObj* pPathObj = 0;
+
+ // always clear objectshadow; this is included in the extraction
+ aAttributeSet.Put(SdrShadowItem(false));
+
+ if(rCandidate.getIsFilled())
+ {
+ // set needed items
+ aAttributeSet.Put(XFillColorItem(String(), Color(rCandidate.getBColor())));
+ aAttributeSet.Put(XLineStyleItem(XLINE_NONE));
+ aAttributeSet.Put(XFillStyleItem(XFILL_SOLID));
+
+ // create filled SdrPathObj
+ pPathObj = new SdrPathObj(OBJ_PATHFILL, aPolyPolygon);
+ }
+ else
+ {
+ // set needed items
+ aAttributeSet.Put(XLineColorItem(String(), Color(rCandidate.getBColor())));
+ aAttributeSet.Put(XLineStyleItem(XLINE_SOLID));
+ aAttributeSet.Put(XLineWidthItem(0));
+ aAttributeSet.Put(XFillStyleItem(XFILL_NONE));
+
+ // create line SdrPathObj
+ pPathObj = new SdrPathObj(OBJ_PATHLINE, aPolyPolygon);
+ }
+
+ // copy basic information from original
+ pPathObj->ImpSetAnchorPos(GetAnchorPos());
+ pPathObj->NbcSetLayer(GetLayer());
+
+ if(GetModel())
+ {
+ pPathObj->SetModel(GetModel());
+ pPathObj->NbcSetStyleSheet(GetStyleSheet(), true);
+ }
+
+ // apply prepared ItemSet and add to target
+ pPathObj->SetMergedItemSet(aAttributeSet);
+ pObjectList->InsertObject(pPathObj);
+ }
+ }
+
+ // postprocess; if no result and/or only one object, simplify
+ if(!pObjectList->GetObjCount())
+ {
+ delete pGroup;
+ }
+ else if(1 == pObjectList->GetObjCount())
+ {
+ pRetval = pObjectList->RemoveObject(0);
+ delete pGroup;
+ }
+ else
+ {
+ pRetval = pGroup;
+ }
+ }
}
- // Ansonsten die Gruppe zurueckgeben
- return pGroup;
+
+ return pRetval;
}
+//////////////////////////////////////////////////////////////////////////////
+
SdrObject* SdrTextObj::DoConvertToPolyObj(BOOL bBezier) const
{
- return ImpConvertObj(!bBezier);
+ return ImpConvertContainedTextToSdrPathObjs(!bBezier);
+}
+
+bool SdrTextObj::ImpCanConvTextToCurve() const
+{
+ return !IsOutlText();
}
SdrObject* SdrTextObj::ImpConvertMakeObj(const basegfx::B2DPolyPolygon& rPolyPolygon, sal_Bool bClosed, sal_Bool bBezier, sal_Bool bNoSetAttr) const
@@ -388,25 +494,23 @@ SdrObject* SdrTextObj::ImpConvertMakeObj(const basegfx::B2DPolyPolygon& rPolyPol
pPathObj->SetPathPoly(basegfx::tools::expandToCurve(pPathObj->GetPathPoly()));
}
+ if(pPathObj)
{
- if(pPathObj)
- {
- pPathObj->ImpSetAnchorPos(aAnchor);
- pPathObj->NbcSetLayer(SdrLayerID(GetLayer()));
+ pPathObj->ImpSetAnchorPos(aAnchor);
+ pPathObj->NbcSetLayer(SdrLayerID(GetLayer()));
- if(pModel)
+ if(pModel)
+ {
+ pPathObj->SetModel(pModel);
+
+ if(!bNoSetAttr)
{
- pPathObj->SetModel(pModel);
+ sdr::properties::ItemChangeBroadcaster aC(*pPathObj);
- if(!bNoSetAttr)
- {
- sdr::properties::ItemChangeBroadcaster aC(*pPathObj);
-
- pPathObj->ClearMergedItem();
- pPathObj->SetMergedItemSet(GetObjectItemSet());
- pPathObj->GetProperties().BroadcastItemChange(aC);
- pPathObj->NbcSetStyleSheet(GetStyleSheet(), sal_True);
- }
+ pPathObj->ClearMergedItem();
+ pPathObj->SetMergedItemSet(GetObjectItemSet());
+ pPathObj->GetProperties().BroadcastItemChange(aC);
+ pPathObj->NbcSetStyleSheet(GetStyleSheet(), sal_True);
}
}
}
@@ -421,7 +525,7 @@ SdrObject* SdrTextObj::ImpConvertAddText(SdrObject* pObj, FASTBOOL bBezier) cons
return pObj;
}
- SdrObject* pText = ImpConvertObj(!bBezier);
+ SdrObject* pText = ImpConvertContainedTextToSdrPathObjs(!bBezier);
if(!pText)
{
@@ -433,40 +537,6 @@ SdrObject* SdrTextObj::ImpConvertAddText(SdrObject* pObj, FASTBOOL bBezier) cons
return pText;
}
- // #i97874#
- // if shadow is set, apply it to created text, too
- const bool bShadowOn(((SdrShadowItem&)GetObjectItem(SDRATTR_SHADOW)).GetValue());
- SfxItemSet aShadowSet(*(GetObjectItemSet().GetPool()), SDRATTR_SHADOW_FIRST, SDRATTR_SHADOW_LAST);
-
- if(bShadowOn)
- {
- // filter shadow items
- aShadowSet.Put(GetObjectItemSet());
- }
-
- { // #i97874#
- // copy needed attributes from local object to all newly created objects
- SdrObjListIter aIter(*pText);
-
- while(aIter.IsMore())
- {
- SdrObject* pCandidate = aIter.Next();
-
- // make sure Layer and model are correct
- pCandidate->NbcSetLayer(SdrLayerID(GetLayer()));
- pCandidate->SetModel(pModel);
-
- // set shadow if needed
- if(bShadowOn)
- {
- pCandidate->SetMergedItemSet(aShadowSet);
- }
-
- // set used StyleSheet
- pCandidate->NbcSetStyleSheet(GetStyleSheet(), true);
- }
- }
-
if(pText->IsGroupObject())
{
// is already group object, add partial shape in front
@@ -487,4 +557,5 @@ SdrObject* SdrTextObj::ImpConvertAddText(SdrObject* pObj, FASTBOOL bBezier) cons
}
}
+//////////////////////////////////////////////////////////////////////////////
// eof
diff --git a/svx/source/svdraw/svdouno.cxx b/svx/source/svdraw/svdouno.cxx
index 3c6710f050..313de1087f 100644
--- a/svx/source/svdraw/svdouno.cxx
+++ b/svx/source/svdraw/svdouno.cxx
@@ -297,11 +297,6 @@ namespace
};
}
-SdrObject* SdrUnoObj::CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const
-{
- return ImpCheckHit(rPnt, nTol, pVisiLayer, TRUE, TRUE);
-}
-
void SdrUnoObj::TakeObjNameSingul(XubString& rName) const
{
rName = ImpGetResStr(STR_ObjNameSingulUno);
diff --git a/svx/source/svdraw/svdovirt.cxx b/svx/source/svdraw/svdovirt.cxx
index 23e443c8d8..63ff2ef669 100644
--- a/svx/source/svdraw/svdovirt.cxx
+++ b/svx/source/svdraw/svdovirt.cxx
@@ -161,13 +161,6 @@ void SdrVirtObj::SetChanged()
SdrObject::SetChanged();
}
-SdrObject* SdrVirtObj::CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer) const
-{
- Point aPnt(rPnt-aAnchor);
- FASTBOOL bRet=rRefObj.CheckHit(aPnt,nTol,pVisiLayer)!=NULL;
- return bRet ? (SdrObject*)this : NULL;
-}
-
SdrObject* SdrVirtObj::Clone() const
{
SdrObject* pObj=new SdrVirtObj(((SdrVirtObj*)this)->rRefObj); // Nur eine weitere Referenz
diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx
index 610c0e6afe..8f4d8cd94c 100644
--- a/svx/source/svdraw/svdpage.cxx
+++ b/svx/source/svdraw/svdpage.cxx
@@ -678,33 +678,6 @@ const Rectangle& SdrObjList::GetAllObjBoundRect() const
return aOutRect;
}
-SdrObject* SdrObjList::CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte* pVisiLayer, FASTBOOL bBackward) const
-{
- SdrObject* pHit=NULL;
- Rectangle R(rPnt.X()-nTol,rPnt.Y()-nTol,rPnt.X()+nTol,rPnt.Y()+nTol);
- if (R.IsOver(GetAllObjBoundRect())) {
- ULONG nObjAnz=GetObjCount();
- ULONG nObjNum=bBackward ? 0 : nObjAnz;
- while (pHit==NULL && (bBackward ? nObjNum<nObjAnz : nObjNum>0)) {
- if (!bBackward) nObjNum--;
- SdrObject* pObj=GetObj(nObjNum);
- if (R.IsOver(pObj->GetCurrentBoundRect())) {
- SdrObjList* pSubList=pObj->GetSubList();
- if (pSubList!=NULL || pVisiLayer==NULL) { // Gruppenobjekte beruecksichtigen sichtbare Layer selbst
- pHit=pObj->CheckHit(rPnt,nTol,pVisiLayer/*,bBackward*/);
- } else { // Ansonsten nur wenn Layer sichtbar
- SdrLayerID nLayer=pObj->GetLayer();
- if (pVisiLayer->IsSet(nLayer)) {
- pHit=pObj->CheckHit(rPnt,nTol,pVisiLayer/*,bBackward*/);
- }
- }
- }
- if (bBackward) nObjNum++;
- }
- }
- return pHit;
-}
-
void SdrObjList::NbcReformatAllTextObjects()
{
ULONG nAnz=GetObjCount();
@@ -773,42 +746,6 @@ void SdrObjList::BurnInStyleSheetAttributes()
}
}
-FASTBOOL SdrObjList::ImpGetFillColor(SdrObject* pObj, Color& rCol) const
-{
- return GetDraftFillColor(pObj->GetMergedItemSet(), rCol);
-}
-
-FASTBOOL SdrObjList::GetFillColor(const Point& rPnt, const SetOfByte& rVisLayers,
- /*FASTBOOL bLayerSorted,*/ Color& rCol) const
-{
- if (pModel==NULL) return FALSE;
- FASTBOOL bRet=FALSE;
- FASTBOOL bMaster=pPage!=NULL ? pPage->IsMasterPage() : FALSE;
- for (ULONG no=GetObjCount(); !bRet && no>0; ) {
- no--;
- SdrObject* pObj=GetObj(no);
- SdrObjList* pOL=pObj->GetSubList();
- if (pOL!=NULL) { // Aha, Gruppenobjekt
- bRet=pOL->GetFillColor(rPnt,rVisLayers,/*bLayerSorted,*/rCol);
- } else {
- SdrTextObj* pTextObj=PTR_CAST(SdrTextObj,pObj);
- // #108867# Exclude zero master page object (i.e. background
- // shape) from color query
- if (pTextObj!=NULL &&
- pObj->IsClosedObj() && rVisLayers.IsSet(pObj->GetLayer()) &&
- (!bMaster || (!pObj->IsNotVisibleAsMaster() && no!=0)) &&
- pObj->GetCurrentBoundRect().IsInside(rPnt) &&
- !pTextObj->IsHideContour() && pObj->IsHit(rPnt,0,NULL))
- { // Nachfolgend extra Funktion um Stack zu sparen,
- // da diese Methode hier rekursiv ist.
- bRet=ImpGetFillColor(pObj,rCol);
- }
- }
- }
- return bRet;
-}
-
-
ULONG SdrObjList::GetObjCount() const
{
return maList.size();
@@ -1706,56 +1643,6 @@ void SdrPage::TRG_ImpMasterPageRemoved(const SdrPage& rRemovedPage)
}
}
-// MasterPage interface
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-FASTBOOL SdrPage::ImplGetFillColor(const Point& rPnt, const SetOfByte& rVisLayers,
- /* FASTBOOL bLayerSorted,*/ Color& rCol, FASTBOOL bSkipBackgroundShape) const
-{
- if (pModel==NULL) return FALSE;
- FASTBOOL bRet=SdrObjList::GetFillColor(rPnt,rVisLayers,/*bLayerSorted,*/rCol);
- if (!bRet && !mbMaster)
- {
- // nun zu den Masterpages
- if(TRG_HasMasterPage())
- {
- SetOfByte aSet(rVisLayers);
- aSet &= TRG_GetMasterPageVisibleLayers();
- SdrPage& rMasterPage = TRG_GetMasterPage();
-
- // #108867# Don't fall back to background shape on
- // master pages. This is later handled by
- // GetBackgroundColor, and is necessary to cater for
- // the silly ordering: 1. shapes, 2. master page
- // shapes, 3. page background, 4. master page
- // background.
- bRet = rMasterPage.ImplGetFillColor(rPnt, aSet, rCol, TRUE);
- }
- }
-
- // #108867# Only now determine background color from background shapes
- if( !bRet && !bSkipBackgroundShape )
- {
- rCol = GetPageBackgroundColor();
- return TRUE;
- }
-
- return bRet;
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-FASTBOOL SdrPage::GetFillColor(const Point& rPnt, const SetOfByte& rVisLayers,
- /*FASTBOOL bLayerSorted,*/ Color& rCol) const
-{
- // #108867# Wrapper for ImplGetFillColor. Used to properly set the
- // bSkipBackgroundShape parameter. Never skip background shape on
- // first level of recursion
- return ImplGetFillColor(rPnt,rVisLayers,/*bLayerSorted,*/rCol,FALSE);
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
const SdrPageGridFrameList* SdrPage::GetGridFrameList(const SdrPageView* /*pPV*/, const Rectangle* /*pRect*/) const
{
return NULL;
diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx
index f9c71c9a74..cf0034903e 100644
--- a/svx/source/svdraw/svdpntv.cxx
+++ b/svx/source/svdraw/svdpntv.cxx
@@ -113,7 +113,7 @@ ImplEncirclementOverlay::ImplEncirclementOverlay(const SdrPaintView& rView, cons
if(pTargetOverlay)
{
::sdr::overlay::OverlayRollingRectangleStriped* aNew = new ::sdr::overlay::OverlayRollingRectangleStriped(
- rStartPos, rStartPos, sal_False);
+ rStartPos, rStartPos, false);
pTargetOverlay->add(*aNew);
maObjects.append(*aNew);
}
@@ -1466,130 +1466,6 @@ void SdrPaintView::SetApplicationDocumentColor(Color aDocumentColor)
}
}
-// declaration extracted from svdedxv.cxx
-#define SPOTCOUNT 5
-
-Color SdrPaintView::CalcBackgroundColor( const Rectangle& rArea,
- const SetOfByte& rVisibleLayers,
- const SdrPage& rCurrPage ) const
-{
- // code extracted from SdrObjEditView::ImpGetTextEditBackgroundColor
- svtools::ColorConfig aColorConfig;
- Color aBackground(aColorConfig.GetColorValue(svtools::DOCCOLOR).nColor);
-
- // #98988# test if we are in High contrast mode; if yes, take
- // application background color
- // #10049# wrong, always use svtools::DOCCOLOR as default and use document settings if
- // not hc mode
- const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
-
- if(!rStyleSettings.GetHighContrastMode())
- {
- // Ok, dann eben die Page durchsuchen!
- Point aSpotPos[SPOTCOUNT];
- Color aSpotColor[SPOTCOUNT];
- ULONG nHeight( rArea.GetSize().Height() );
- ULONG nWidth( rArea.GetSize().Width() );
- ULONG nWidth14 = nWidth / 4;
- ULONG nHeight14 = nHeight / 4;
- ULONG nWidth34 = ( 3 * nWidth ) / 4;
- ULONG nHeight34 = ( 3 * nHeight ) / 4;
-
- USHORT i;
- for ( i = 0; i < SPOTCOUNT; i++ )
- {
- // Es wird anhand von fuenf Spots die Farbe untersucht
- switch ( i )
- {
- case 0 :
- {
- // Center-Spot
- aSpotPos[i] = rArea.Center();
- }
- break;
-
- case 1 :
- {
- // TopLeft-Spot
- aSpotPos[i] = rArea.TopLeft();
- aSpotPos[i].X() += nWidth14;
- aSpotPos[i].Y() += nHeight14;
- }
- break;
-
- case 2 :
- {
- // TopRight-Spot
- aSpotPos[i] = rArea.TopLeft();
- aSpotPos[i].X() += nWidth34;
- aSpotPos[i].Y() += nHeight14;
- }
- break;
-
- case 3 :
- {
- // BottomLeft-Spot
- aSpotPos[i] = rArea.TopLeft();
- aSpotPos[i].X() += nWidth14;
- aSpotPos[i].Y() += nHeight34;
- }
- break;
-
- case 4 :
- {
- // BottomRight-Spot
- aSpotPos[i] = rArea.TopLeft();
- aSpotPos[i].X() += nWidth34;
- aSpotPos[i].Y() += nHeight34;
- }
- break;
-
- }
-
- aSpotColor[i] = Color( COL_WHITE );
- rCurrPage.GetFillColor(aSpotPos[i], rVisibleLayers, /*bLayerSortedRedraw,*/ aSpotColor[i]);
- }
-
- USHORT aMatch[SPOTCOUNT];
-
- for ( i = 0; i < SPOTCOUNT; i++ )
- {
- // Wurden gleiche Spot-Farben gefuden?
- aMatch[i] = 0;
-
- for ( USHORT j = 0; j < SPOTCOUNT; j++ )
- {
- if( j != i )
- {
- if( aSpotColor[i] == aSpotColor[j] )
- {
- aMatch[i]++;
- }
- }
- }
- }
-
- // Das hoechste Gewicht hat der Spot in der Mitte
- aBackground = aSpotColor[0];
-
- for ( USHORT nMatchCount = SPOTCOUNT - 1; nMatchCount > 1; nMatchCount-- )
- {
- // Welche Spot-Farbe wurde am haeufigsten gefunden?
- for ( i = 0; i < SPOTCOUNT; i++ )
- {
- if( aMatch[i] == nMatchCount )
- {
- aBackground = aSpotColor[i];
- nMatchCount = 1; // Abbruch auch der aeusseren for-Schleife
- break;
- }
- }
- }
- }
-
- return aBackground;
-}
-
// #114898#
bool SdrPaintView::IsBufferedOutputAllowed() const
{
diff --git a/svx/source/svdraw/svdsnpv.cxx b/svx/source/svdraw/svdsnpv.cxx
index 17fbd889ca..4f051f8ecb 100644
--- a/svx/source/svdraw/svdsnpv.cxx
+++ b/svx/source/svdraw/svdsnpv.cxx
@@ -93,11 +93,16 @@ void ImplPageOriginOverlay::SetPosition(const basegfx::B2DPoint& rNewPosition)
if(rNewPosition != maPosition)
{
// apply to OverlayObjects
- basegfx::B2DHomMatrix aMatrix;
- aMatrix.translate(
- rNewPosition.getX() - maPosition.getX(),
- rNewPosition.getY() - maPosition.getY());
- maObjects.transform(aMatrix);
+ for(sal_uInt32 a(0); a < maObjects.count(); a++)
+ {
+ sdr::overlay::OverlayCrosshairStriped* pCandidate =
+ static_cast< sdr::overlay::OverlayCrosshairStriped* >(&maObjects.getOverlayObject(a));
+
+ if(pCandidate)
+ {
+ pCandidate->setBasePosition(rNewPosition);
+ }
+ }
// remember new position
maPosition = rNewPosition;
@@ -167,11 +172,17 @@ void ImplHelpLineOverlay::SetPosition(const basegfx::B2DPoint& rNewPosition)
if(rNewPosition != maPosition)
{
// apply to OverlayObjects
- basegfx::B2DHomMatrix aMatrix;
- aMatrix.translate(
- rNewPosition.getX() - maPosition.getX(),
- rNewPosition.getY() - maPosition.getY());
- maObjects.transform(aMatrix);
+ // apply to OverlayObjects
+ for(sal_uInt32 a(0); a < maObjects.count(); a++)
+ {
+ sdr::overlay::OverlayHelplineStriped* pCandidate =
+ static_cast< sdr::overlay::OverlayHelplineStriped* >(&maObjects.getOverlayObject(a));
+
+ if(pCandidate)
+ {
+ pCandidate->setBasePosition(rNewPosition);
+ }
+ }
// remember new position
maPosition = rNewPosition;
diff --git a/svx/source/svdraw/svdstr.src b/svx/source/svdraw/svdstr.src
index f577928354..595ff95bcd 100644
--- a/svx/source/svdraw/svdstr.src
+++ b/svx/source/svdraw/svdstr.src
@@ -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
@@ -1127,6 +1127,20 @@ String STR_UndoMovLayer
{
Text [ en-US ] = "Change order of layers" ;
};
+// --> OD 2009-07-09 #i73249#
+String STR_UndoObjName
+{
+ Text [ en-US ] = "Change object name of %1 to" ;
+};
+String STR_UndoObjTitle
+{
+ Text [ en-US ] = "Change object title of %1" ;
+};
+String STR_UndoObjDescription
+{
+ Text [ en-US ] = "Change object description of %1" ;
+};
+// <--
String STR_StandardLayerName
{
Text [ en-US ] = "Standard" ;
diff --git a/svx/source/svdraw/svdtext.cxx b/svx/source/svdraw/svdtext.cxx
index 2d513942af..93c0024ecc 100644
--- a/svx/source/svdraw/svdtext.cxx
+++ b/svx/source/svdraw/svdtext.cxx
@@ -53,6 +53,7 @@ SdrText::SdrText( SdrTextObj& rObject, OutlinerParaObject* pOutlinerParaObject /
SdrText::~SdrText()
{
+ clearWeak();
delete mpOutlinerParaObject;
}
@@ -60,10 +61,19 @@ void SdrText::CheckPortionInfo( SdrOutliner& rOutliner )
{
if(!mbPortionInfoChecked)
{
+ // #i102062# no action when the Outliner is the HitTestOutliner,
+ // this will remove WrongList info at the OPO
+ if(mpModel && &rOutliner == &mpModel->GetHitTestOutliner())
+ return;
+
// Optimierung: ggf. BigTextObject erzeugen
mbPortionInfoChecked=true;
if(mpOutlinerParaObject!=NULL && rOutliner.ShouldCreateBigTextObject())
- mpOutlinerParaObject= rOutliner.CreateParaObject();
+ {
+ // #i102062# MemoryLeak closed
+ delete mpOutlinerParaObject;
+ mpOutlinerParaObject = rOutliner.CreateParaObject();
+ }
}
}
diff --git a/svx/source/svdraw/svdtouch.cxx b/svx/source/svdraw/svdtouch.cxx
deleted file mode 100644
index 6c3fa1ecc4..0000000000
--- a/svx/source/svdraw/svdtouch.cxx
+++ /dev/null
@@ -1,299 +0,0 @@
-/*************************************************************************
- *
- * 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: svdtouch.cxx,v $
- * $Revision: 1.11 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#include "svdtouch.hxx"
-#include <svx/xpoly.hxx>
-#include <tools/bigint.hxx>
-#include <tools/poly.hxx>
-#include <basegfx/polygon/b2dpolygon.hxx>
-#include <basegfx/polygon/b2dpolygontools.hxx>
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-class ImpPolyHitCalc {
-public:
- long x1,x2,y1,y2; // Koordinaten des Rect, muessen sortiert sein!
- FASTBOOL bEdge; // ein Punkt lag genau auf einer Kante
- FASTBOOL bIntersect; // mind. 2 Punkte auf verschiedenen Seiten einer Kante
- FASTBOOL bPntInRect; // mind. 1 Punkt war vollstaendig im Rect
- USHORT nOCnt; // wenn Counter ungerade, dann getroffen
- USHORT nUCnt; // wenn Counter ungerade, dann getroffen
- USHORT nLCnt; // wenn Counter ungerade, dann getroffen
- USHORT nRCnt; // wenn Counter ungerade, dann getroffen
- FASTBOOL bLine; // TRUE=PolyLine, kein Polygon
-public:
- ImpPolyHitCalc(const Rectangle& aR, FASTBOOL bIsLine=FALSE)
- {
- bLine=bIsLine;
- bEdge=FALSE;
- bIntersect=FALSE;
- bPntInRect=FALSE;
- x1=aR.Left();
- x2=aR.Right();
- y1=aR.Top();
- y2=aR.Bottom();
- nOCnt=0;
- nUCnt=0;
- nLCnt=0;
- nRCnt=0;
- }
- FASTBOOL IsDecided() { return bEdge || bIntersect || bPntInRect; }
- void CheckPntInRect(const Point& rP)
- {
- if (!bPntInRect) {
- bPntInRect=rP.X()>=x1 && rP.X()<=x2 && rP.Y()>=y1 && rP.Y()<=y2;
- }
- }
- bool IsHit() { return (!bLine && (nOCnt & 1)==1) || IsDecided(); }
-};
-
-#define CAREFUL_MULDIV(Res,Val,Mul,Div) { \
- if (Abs(Val)>0xB504 || Abs(Mul)>0xB504) { \
- BigInt aBigTemp(Val); \
- aBigTemp*=Mul; \
- aBigTemp/=Div; \
- Res=long(aBigTemp); \
- } else { \
- Res=Val*Mul/Div; \
- } \
-}
-
-void ImpCheckIt(ImpPolyHitCalc& rH, long lx1, long ly1, long lx2, long ly2,
- long rx1, long ry1, long rx2, long ry2, USHORT& nOCnt, USHORT& nUCnt)
-{
- if ((ly1>ly2) || ((ly1==ly2) && (lx1>lx2))) {
- long nTmp; // die 2 Punkte nach Y sortieren
- nTmp=lx1;
- lx1=lx2;
- lx2=nTmp;
- nTmp=ly1;
- ly1=ly2;
- ly2=nTmp;
- }
- FASTBOOL b1=FALSE,b2=FALSE,b3=FALSE,b4=FALSE; // je 1 Flag fuer jeden der 4 Punkte LO,RO,LU,RU
- FASTBOOL bx1,bx2;
- FASTBOOL by1=ly1<=ry1 && ly2>ry1;
- FASTBOOL by2=ly1<=ry2 && ly2>ry2;
- long dx(0),dy(0),a(0);
- if (by1 || by2) {
- dx=lx2-lx1;
- dy=ly2-ly1;
- }
- if (by1) { // Nur wer die Scanline schneidet
- bx1=lx1<rx1; // x1,y1
- bx2=lx2<rx1;
- FASTBOOL bA=FALSE; // Optimierung: ggf eine Division sparen
- if (bx1 && bx2) b1=TRUE;
- else if (bx1 || bx2) {
- long yTemp=ry1-ly1;
- CAREFUL_MULDIV(a,dx,yTemp,dy); // a=dx*yTemp/dy;
- a+=lx1;
- bA=TRUE;
- rH.bEdge=(a==rx1);
- if (a<rx1) b1=TRUE;
- } // x2,y1
- bx1=lx1<rx2;
- bx2=lx2<rx2;
- if (bx1 && bx2) b2=TRUE;
- else if (bx1 || bx2) {
- if (!bA) {
- long yTemp=ry1-ly1;
- CAREFUL_MULDIV(a,dx,yTemp,dy);
- a+=lx1;
- }
- rH.bEdge=(a==rx2);
- if (a<rx2) b2=TRUE;
- }
- }
- if (by2) { // Nur wer die Scanline schneidet
- bx1=lx1<rx1; // x1,y2
- bx2=lx2<rx1;
- FASTBOOL bA=FALSE; // Optimierung: ggf eine Division sparen
- if (bx1 && bx2) b3=TRUE;
- else if (bx1 || bx2) {
- long yTemp=ry2-ly1;
- CAREFUL_MULDIV(a,dx,yTemp,dy);
- a+=lx1;
- bA=TRUE;
- rH.bEdge=(a==rx1);
- if (a<rx1) b3=TRUE;
- }
- bx1=lx1<rx2; // x2,y2
- bx2=lx2<rx2;
- if (bx1 && bx2) b4=TRUE;
- else if (bx1 || bx2) {
- if (!bA) {
- long yTemp=ry2-ly1;
- CAREFUL_MULDIV(a,dx,yTemp,dy);
- a+=lx1;
- }
- rH.bEdge=(a==rx2);
- if (a<rx2) b4=TRUE;
- }
- }
- if (by1 || by2) { // nun die Ergebnisse auswerten
- if (by1 && by2) { // Linie durch beide Scanlines
- if (b1 && b2 && b3 && b4) { nOCnt++; nUCnt++; } // Rect komplett rechts neben der Linie
- else if (b1 || b2 || b3 || b4) rH.bIntersect=TRUE; // Nur zum Teil->Schnittpunkt
- } else { // ansonsten Ober- und Unterkante des Rects getrennt betrachten
- if (by1) { // Linie durch Oberkante
- if (b1 && b2) nOCnt++; // Oberkante komplett rechts neben der Linie
- else if (b1 || b2) rH.bIntersect=TRUE; // Nur zum Teil->Schnittpunkt
- }
- if (by2) { // Linie durch Unterkante
- if (b3 && b4) nUCnt++; // Unterkante komplett rechts neben der Linie
- else if (b3 || b4) rH.bIntersect=TRUE; // Nur zum Teil->Schnittpunkt
- }
- }
- }
-}
-
-void CheckPolyHit(const Polygon& rPoly, ImpPolyHitCalc& rH)
-{
- USHORT nAnz=rPoly.GetSize();
- if (nAnz==0) return;
- if (nAnz==1) { rH.CheckPntInRect(rPoly[0]); return; }
- Point aPt0=rPoly[USHORT(nAnz-1)];
- rH.CheckPntInRect(aPt0);
- USHORT i=0;
- if (rH.bLine) {
- aPt0=rPoly[0];
- i++;
- }
- for (; i<nAnz && !rH.IsDecided(); i++) {
- Point aP1(aPt0);
- Point aP2(rPoly[i]);
- rH.CheckPntInRect(aP2);
- if (!rH.IsDecided()) {
- ImpCheckIt(rH,aP1.X(),aP1.Y(),aP2.X(),aP2.Y(),rH.x1,rH.y1,rH.x2,rH.y2,rH.nOCnt,rH.nUCnt);
- ImpCheckIt(rH,aP1.Y(),aP1.X(),aP2.Y(),aP2.X(),rH.y1,rH.x1,rH.y2,rH.x2,rH.nLCnt,rH.nRCnt);
- }
- aPt0=rPoly[i];
- }
- if (!rH.bLine) { // Sicherheitshalber nochmal checken
- if ((rH.nOCnt&1)!=(rH.nUCnt&1)) rH.bIntersect=TRUE; // da wird wohl eine durchgegangen sein
- if ((rH.nLCnt&1)!=(rH.nRCnt&1)) rH.bIntersect=TRUE; // da wird wohl eine durchgegangen sein
- if ((rH.nOCnt&1)!=(rH.nLCnt&1)) rH.bIntersect=TRUE; // da wird wohl eine durchgegangen sein
- }
-}
-
-bool IsRectTouchesLine(const Point& rPt1, const Point& rPt2, const Rectangle& rHit)
-{
- Polygon aPol(2);
- aPol[0]=rPt1;
- aPol[1]=rPt2;
- ImpPolyHitCalc aHit(rHit,TRUE);
- CheckPolyHit(aPol,aHit);
- return aHit.IsHit();
-}
-
-bool IsRectTouchesLine(const Polygon& rLine, const Rectangle& rHit)
-{
- ImpPolyHitCalc aHit(rHit,TRUE);
- CheckPolyHit(rLine,aHit);
- return aHit.IsHit();
-}
-
-bool IsRectTouchesLine(const PolyPolygon& rLine, const Rectangle& rHit)
-{
- ImpPolyHitCalc aHit(rHit,TRUE);
- USHORT nAnz=rLine.Count();
- for (USHORT nNum=0; nNum<nAnz && !aHit.IsHit(); nNum++) {
- CheckPolyHit(rLine[nNum],aHit);
- }
- return aHit.IsHit();
-}
-
-BYTE CheckPointTouchesPoly(const Polygon& rPoly, const Point& rHit) // 0=Ausserhalb, 1=Innerhalb, 2=Beruehrung
-{
- USHORT nAnz=rPoly.GetSize();
- if (nAnz<2) return FALSE;
- FASTBOOL bEdge=FALSE;
- USHORT nCnt=0;
- Point aPt0=rPoly[USHORT(nAnz-1)];
- for (USHORT i=0; i<nAnz && !bEdge; i++) {
- Point aP1(rPoly[i]);
- Point aP2(aPt0);
- if ((aP1.Y()>aP2.Y()) || ((aP1.Y()==aP2.Y()) && (aP1.X()>aP2.X()))) { Point aTmp(aP1); aP1=aP2; aP2=aTmp; }
- bEdge=((aP1.X()==aP2.X()) && (rHit.X()==aP1.X()) && (rHit.Y()>=aP1.Y()) && (rHit.Y()<=aP2.Y())) ||
- ((aP1.Y()==aP2.Y()) && (rHit.Y()==aP1.Y()) && (rHit.X()>=aP1.X()) && (rHit.X()<=aP2.X())) ||
- (rHit.X()==aP1.X()) && (rHit.Y()==aP1.Y());
- if (!bEdge && aP1.Y()<=rHit.Y() && aP2.Y()>rHit.Y()) { // Nur wer die Scanline schneidet
- FASTBOOL bx1=aP1.X()<rHit.X();
- FASTBOOL bx2=aP2.X()<rHit.X();
- if (bx1 && bx2) nCnt++;
- else if (bx1 || bx2) {
- long dx=aP2.X()-aP1.X();
- long dy=aP2.Y()-aP1.Y();
- long yTemp=rHit.Y()-aP1.Y();
- long xTemp;
- if (Abs(dx)>0xB504 || Abs(yTemp)>0xB504) { // gegen Integerueberlaeufe
- BigInt aBigTemp(dx);
- aBigTemp*=yTemp;
- aBigTemp/=dy;
- xTemp=long(aBigTemp);
- } else {
- xTemp=dx*yTemp /dy;
- }
- xTemp+=aP1.X();
- bEdge=(xTemp==rHit.X());
- if (xTemp<rHit.X()) nCnt++;
- }
- }
- aPt0=rPoly[i];
- }
- if (bEdge) return 2;
- return (nCnt & 1)==1;
-}
-
-bool IsPointInsidePoly(const Polygon& rPoly, const Point& rHit)
-{
- return CheckPointTouchesPoly(rPoly,rHit)!=0;
-}
-
-bool IsPointInsidePoly(const PolyPolygon& rPoly, const Point& rHit)
-{
- FASTBOOL bInside=FALSE;
- FASTBOOL bEdge=FALSE;
- USHORT nAnz=rPoly.Count();
- for (USHORT i=0; i<nAnz && !bEdge; i++) {
- BYTE n=CheckPointTouchesPoly(rPoly.GetObject(i),rHit);
- bEdge=n==2;
- if (n==1) bInside=!bInside;
- }
- return bInside || bEdge;
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-
diff --git a/svx/source/svdraw/svdtxhdl.cxx b/svx/source/svdraw/svdtxhdl.cxx
deleted file mode 100644
index d64dcad177..0000000000
--- a/svx/source/svdraw/svdtxhdl.cxx
+++ /dev/null
@@ -1,400 +0,0 @@
-/*************************************************************************
- *
- * 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: svdtxhdl.cxx,v $
- * $Revision: 1.29 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#include "svdtxhdl.hxx"
-#include <limits.h>
-#include "svditext.hxx"
-#include <svx/svdmodel.hxx>
-#include <svx/svdpage.hxx>
-#include <svx/svdogrp.hxx>
-#include <svx/svdotext.hxx>
-#include <svx/svdoutl.hxx>
-#include <svx/outliner.hxx>
-#include <svx/outlobj.hxx>
-#include <svx/svxfont.hxx>
-#include <svx/xlnclit.hxx>
-#include <svx/xlnwtit.hxx>
-#include <svx/xflclit.hxx>
-#include <vcl/metric.hxx>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-
-#include <com/sun/star/i18n/ScriptType.hdl>
-#include <com/sun/star/i18n/XBreakIterator.hpp>
-#include <comphelper/processfactory.hxx>
-
-#include <com/sun/star/i18n/CharacterIteratorMode.hdl>
-#include "unolingu.hxx"
-#include <basegfx/polygon/b2dpolygon.hxx>
-#include <basegfx/polygon/b2dpolygontools.hxx>
-#include <basegfx/matrix/b2dhommatrix.hxx>
-#include <svtools/itemset.hxx>
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::i18n;
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-ImpTextPortionHandler::ImpTextPortionHandler(SdrOutliner& rOutln, const SdrTextObj& rTxtObj):
- rOutliner(rOutln),
- rTextObj(rTxtObj)
-{
- SdrModel* pModel = rTextObj.GetModel();
- MapMode aMap=aVDev.GetMapMode();
-
- aMap.SetMapUnit(pModel->GetScaleUnit());
- aMap.SetScaleX(pModel->GetScaleFraction());
- aMap.SetScaleY(pModel->GetScaleFraction());
- aVDev.SetMapMode(aMap);
-}
-
-void ImpTextPortionHandler::ConvertToPathObj(SdrObjGroup& rGroup, FASTBOOL bPoly)
-{
- bToPoly=bPoly;
- pGroup=&rGroup;
-
- Rectangle aAnchorRect;
- Rectangle aTextRect;
- SdrFitToSizeType eFit=rTextObj.GetFitToSize();
- FASTBOOL bFitToSize=(eFit==SDRTEXTFIT_PROPORTIONAL || eFit==SDRTEXTFIT_ALLLINES);
- // Bei TakeTextRect wird u.a. auch der Text in
- // den Outliner gesteckt
- rTextObj.TakeTextRect(rOutliner,aTextRect,FALSE,&aAnchorRect);
- maTextRect=aTextRect;
- if (bFitToSize) maTextRect=aAnchorRect;
- rOutliner.SetDrawPortionHdl(LINK(this,ImpTextPortionHandler,ConvertHdl));
- rOutliner.StripPortions();
- rOutliner.SetDrawPortionHdl(Link());
- rOutliner.Clear();
-
- if(bFitToSize)
- {
- Fraction nX(aAnchorRect.Right()-aAnchorRect.Left(),aTextRect.Right()-aTextRect.Left());
- Fraction nY(aAnchorRect.Bottom()-aAnchorRect.Top(),aTextRect.Bottom()-aTextRect.Top());
-
- // #95395# scale from top-right when vertical text
- if(rOutliner.IsVertical())
- pGroup->NbcResize(aAnchorRect.TopRight(),nX,nY);
- else
- pGroup->NbcResize(aAnchorRect.TopLeft(),nX,nY);
- }
- if (rTextObj.aGeo.nDrehWink!=0) { // #35825# Rotieren erst nach Resize (wg. FitToSize)
- pGroup->NbcRotate(maTextRect.TopLeft(),rTextObj.aGeo.nDrehWink,rTextObj.aGeo.nSin,rTextObj.aGeo.nCos);
- }
-}
-
-// #101498# Helper class to remember text portions in sorted manner
-class ImpRecordPortion
-{
-public:
- Point maPosition;
- String maText;
- xub_StrLen mnTextStart;
- xub_StrLen mnTextLength;
- sal_uInt16 mnPara;
- xub_StrLen mnIndex;
-
- // #102819# Here SvxFont needs to be used instead of Font
- SvxFont maFont;
-
- sal_Int32* mpDXArray;
- sal_uInt8 mnBiDiLevel;
-
- ImpRecordPortion(DrawPortionInfo* pInfo);
- ~ImpRecordPortion();
-
- sal_uInt8 GetBiDiLevel() const { return mnBiDiLevel; }
-};
-
-ImpRecordPortion::ImpRecordPortion(DrawPortionInfo* pInfo)
-: maPosition(pInfo->mrStartPos),
- maText(pInfo->mrText),
- mnTextStart((xub_StrLen)pInfo->mnTextStart),
- mnTextLength((xub_StrLen)pInfo->mnTextLen),
- mnPara(pInfo->mnPara),
- mnIndex(pInfo->mnIndex),
- maFont(pInfo->mrFont),
- mpDXArray(NULL),
- mnBiDiLevel(pInfo->GetBiDiLevel())
-{
- if(pInfo->mpDXArray)
- {
- mpDXArray = new sal_Int32[pInfo->mnTextLen];
-
- for(sal_uInt32 a(0L); a < pInfo->mnTextLen; a++)
- {
- mpDXArray[a] = pInfo->mpDXArray[a];
- }
- }
-}
-
-ImpRecordPortion::~ImpRecordPortion()
-{
- if(mpDXArray)
- {
- delete[] mpDXArray;
- }
-}
-
-IMPL_LINK(ImpTextPortionHandler,ConvertHdl,DrawPortionInfo*,pInfo)
-{
- // maTextRect enthaelt den Ausgabebereich des Textobjekts
- BOOL bIsVertical(rOutliner.IsVertical());
- Point aPos2(maTextRect.TopLeft() + pInfo->mrStartPos);
- Color aColor(pInfo->mrFont.GetColor());
-
- if(bIsVertical)
- aPos2 = maTextRect.TopRight() + pInfo->mrStartPos;
-
- Point aStartPos(aPos2);
- SfxItemSet aAttrSet((SfxItemPool&)(*rTextObj.GetObjectItemPool()));
- long nHochTief(pInfo->mrFont.GetEscapement());
- FontMetric aFontMetric(aVDev.GetFontMetric());
- sal_Int32 nLineLen(0L);
-
- Font aFont( pInfo->mrFont );
-
- if( nHochTief)
- {
- // shrink the font for sub-/superscripting
- long nPercent(pInfo->mrFont.GetPropr());
-
- if(nPercent != 100)
- {
- Size aSize(aFont.GetSize());
- aSize.Height() = (aSize.Height() * nPercent +50) / 100;
- aSize.Width() = (aSize.Width() * nPercent +50) / 100;
- aFont.SetSize(aSize);
- }
-
- sal_Bool bNeg(nHochTief < 0);
-
- if(bNeg)
- nHochTief = -nHochTief;
-
- nHochTief = (nHochTief * pInfo->mrFont.GetSize().Height() +50) /100;
-
- if(bNeg)
- nHochTief = -nHochTief;
- }
-
- aFont.SetOrientation( 0 );
- aVDev.SetFont( aFont );
-
- if(bIsVertical)
- // #83068#
- aPos2.X() += aFontMetric.GetAscent() + nHochTief;
- else
- aPos2.Y() -= aFontMetric.GetAscent() + nHochTief;
-
- if (pInfo->mrFont.IsOutline())
- {
- aAttrSet.Put(XLineColorItem(String(),aColor));
- aAttrSet.Put(XLineStyleItem(XLINE_SOLID));
- aAttrSet.Put(XLineWidthItem(0));
- aAttrSet.Put(XFillStyleItem(XFILL_NONE));
- }
- else
- {
- aAttrSet.Put(XFillColorItem(String(),aColor));
- aAttrSet.Put(XLineStyleItem(XLINE_NONE));
- aAttrSet.Put(XFillStyleItem(XFILL_SOLID));
- }
-
- // #100318# convert in a single step
- // #101499# Use GetTextOutlines and a PolyPolyVector now
- PolyPolyVector aPolyPolyVector;
- if(aVDev.GetTextOutlines(aPolyPolyVector, pInfo->mrText, pInfo->mnTextStart, pInfo->mnTextStart, pInfo->mnTextLen)
- && aPolyPolyVector.size())
- {
- for(sal_uInt32 a(0); a < aPolyPolyVector.size(); a++)
- {
- PolyPolygon aPolyPoly(aPolyPolyVector[a]);
-
- if(aPolyPoly.Count() > 0 && aPolyPoly[0].GetSize() > 0)
- {
- basegfx::B2DPolyPolygon aPolyPolygon(aPolyPoly.getB2DPolyPolygon());
- basegfx::B2DHomMatrix aMatrix;
-
- // rotate 270 degree if vertical since result is unrotated
- if(pInfo->mrFont.GetOrientation())
- {
- double fAngle(F_PI * (pInfo->mrFont.GetOrientation() % 3600) / 1800.0);
- aMatrix.rotate(fAngle);
- }
-
- // result is baseline oriented, thus move one line height, too
- if(bIsVertical)
- {
- aMatrix.translate(-aFontMetric.GetAscent(), 0.0);
- }
- else
- {
- aMatrix.translate(0.0, aFontMetric.GetAscent());
- }
-
- // move to output coordinates
- aMatrix.translate(aPos2.X(), aPos2.Y());
-
- // transform
- aPolyPolygon.transform(aMatrix);
-
- // create object
- SdrObject* pObj = rTextObj.ImpConvertMakeObj(aPolyPolygon, sal_True, !bToPoly, sal_True);
- pObj->SetMergedItemSet(aAttrSet);
- pGroup->GetSubList()->InsertObject(pObj);
- }
- }
-
- nLineLen = pInfo->mpDXArray[pInfo->mnTextLen - 1];
- }
-
- FontUnderline eUndl=pInfo->mrFont.GetUnderline();
- FontStrikeout eStrk=pInfo->mrFont.GetStrikeout();
- if (eUndl!=UNDERLINE_NONE) {
- FASTBOOL bDouble=eUndl==UNDERLINE_DOUBLE;
- long nDescent=aFontMetric.GetDescent();
- long nAscend=aFontMetric.GetAscent();
- long nDick=nDescent / (bDouble ? 5 : 3);
- long nDist=(nDescent-nDick*2)/3; // Linienabstand bei doppelt
- basegfx::B2DPolyPolygon aPolyPolygon;
-
- if (eUndl!=UNDERLINE_DOTTED) {
- Point aPoint(0,0);
- XPolygon aXP(Rectangle(aPoint,bIsVertical ? Point(nDick,nLineLen) : Point(nLineLen,nDick)));
- if(bIsVertical)
- aXP.Move(nAscend-nDist,0);
- aPolyPolygon.append(aXP.getB2DPolygon());
- if (bDouble) {
- if(bIsVertical)
- aXP.Move(-(nDick+nDist),0);
- else
- aXP.Move(0,nDick+nDist);
- aPolyPolygon.append(aXP.getB2DPolygon());
- }
- } else {
- Point aPoint(0,0);
- XPolygon aXP(Rectangle(aPoint,Point(nDick,nDick)));
- long n=0;
- while (n<=nLineLen) {
- if (n+nDick>nLineLen) { // ler letzte Dot ggf. etwas schmaler
- aXP=XPolygon(Rectangle(
- bIsVertical ? Point(0,n) : Point(n,0),
- bIsVertical ? Point(nDick,nLineLen) : Point(nLineLen,nDick)));
- }
- aPolyPolygon.append(aXP.getB2DPolygon());
- if(bIsVertical)
- aXP.Move(0,2*nDick);
- else
- aXP.Move(2*nDick,0);
- n+=2*nDick;
- }
- }
-
- long y=nDescent-nDick; // y-Position der Striche zur Baseline bestimmen
- if (bDouble) y-=nDick+nDist;
- y=(y+1)/2;
-
- basegfx::B2DHomMatrix aMatrix;
-
- if(bIsVertical)
- {
- aMatrix.translate(aStartPos.X() - (y - nHochTief), aStartPos.Y());
- }
- else
- {
- aMatrix.translate(aStartPos.X(), aStartPos.Y() + y - nHochTief);
- }
-
- aPolyPolygon.transform(aMatrix);
-
- // maTextRect enthaelt den Ausgabebereich des Textobjekts
- SdrObject* pObj=rTextObj.ImpConvertMakeObj(aPolyPolygon, sal_True, !bToPoly, sal_True);
- pObj->SetMergedItemSet(aAttrSet);
- pGroup->GetSubList()->InsertObject(pObj);
- }
- if (eStrk!=STRIKEOUT_NONE) {
- FASTBOOL bDouble=eStrk==STRIKEOUT_DOUBLE;
- long nDescent=aFontMetric.GetDescent();
- //long nAscend=aFontMetric.GetAscent();
- long nDick=nDescent / (bDouble ? 5 : 3);
- long nDist=(nDescent-nDick*2)/3; // Linienabstand bei doppelt
- basegfx::B2DPolyPolygon aPolyPolygon;
-
- const Point aPoint(0,0);
- const Rectangle aRect(aPoint,bIsVertical ? Point(nDick,nLineLen) : Point(nLineLen,nDick));
- const basegfx::B2DRange aRectRange(aRect.Left(), aRect.Top(), aRect.Right(), aRect.Bottom());
- basegfx::B2DPolygon aPolyFromRect(basegfx::tools::createPolygonFromRect(aRectRange));
- aPolyPolygon.append(aPolyFromRect);
-
- if (bDouble)
- {
- basegfx::B2DHomMatrix aMatrix;
-
- if(bIsVertical)
- aMatrix.translate(-(nDick+nDist), 0.0);
- else
- aMatrix.translate(0.0, nDick+nDist);
-
- aPolyFromRect.transform(aMatrix);
- aPolyPolygon.append(aPolyFromRect);
- }
-
- // y-Position der Striche zur Baseline bestimmen
- long y=-(long)(aFontMetric.GetAscent()-aFontMetric.GetIntLeading()+1)/3;
- if (!bDouble) y-=(nDick+1)/2;
- else y-=nDick+(nDist+1)/2;
-
- basegfx::B2DHomMatrix aMatrix;
-
- if(bIsVertical)
- {
- aMatrix.translate(aStartPos.X() - (y - nHochTief), aStartPos.Y());
- }
- else
- {
- aMatrix.translate(aStartPos.X(), aStartPos.Y() + y - nHochTief);
- }
-
- aPolyPolygon.transform(aMatrix);
-
- // maTextRect enthaelt den Ausgabebereich des Textobjekts
- SdrObject* pObj=rTextObj.ImpConvertMakeObj(aPolyPolygon, sal_True, !bToPoly, sal_True);
- pObj->SetMergedItemSet(aAttrSet);
- pGroup->GetSubList()->InsertObject(pObj);
- }
-
- return 0;
-}
-
-// eof
diff --git a/svx/source/svdraw/svdundo.cxx b/svx/source/svdraw/svdundo.cxx
index ab9c73ef8e..896e4d4aee 100644
--- a/svx/source/svdraw/svdundo.cxx
+++ b/svx/source/svdraw/svdundo.cxx
@@ -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
@@ -682,8 +682,8 @@ void SdrUndoGeoObj::Undo()
// #97172#
// only repaint, no objectchange
pObj->ActionChanged();
- }
- else
+ }
+ else
{
if (pRedoGeo!=NULL) delete pRedoGeo;
pRedoGeo=pObj->GetGeoData();
@@ -789,7 +789,7 @@ void SdrUndoRemoveObj::Undo()
void SdrUndoRemoveObj::Redo()
{
DBG_ASSERT(pObj->IsInserted(),"RedoRemoveObj: pObj ist nicht Inserted");
- if (pObj->IsInserted())
+ if (pObj->IsInserted())
{
ImplUnmarkObject( pObj );
E3DModifySceneSnapRectUpdater aUpdater(pObj);
@@ -808,7 +808,7 @@ void SdrUndoInsertObj::Undo()
ImpShowPageOfThisObject();
DBG_ASSERT(pObj->IsInserted(),"UndoInsertObj: pObj ist nicht Inserted");
- if (pObj->IsInserted())
+ if (pObj->IsInserted())
{
ImplUnmarkObject( pObj );
@@ -987,7 +987,7 @@ void SdrUndoReplaceObj::Redo()
DBG_ASSERT(pObj->IsInserted(),"SdrUndoReplaceObj::Redo(): Altes Objekt ist nicht inserted!");
SetOldOwner(TRUE);
SetNewOwner(FALSE);
-
+
ImplUnmarkObject( pObj );
pObjList->ReplaceObject(pNewObj,nOrdNum);
@@ -1146,7 +1146,7 @@ void SdrUndoObjSetText::Redo()
{
// Text fuer Undo kopieren, denn SetOutlinerParaObject() ist Eigentumsuebereignung
OutlinerParaObject* pText1 = pNewText;
-
+
if(pText1)
pText1 = new OutlinerParaObject(*pText1);
@@ -1193,7 +1193,7 @@ void SdrUndoObjSetText::SdrRepeat(SdrView& rView)
{
SdrObject* pObj2=rML.GetMark(nm)->GetMarkedSdrObj();
SdrTextObj* pTextObj=PTR_CAST(SdrTextObj,pObj2);
- if (pTextObj!=NULL)
+ if (pTextObj!=NULL)
{
if( bUndo )
rView.AddUndo(new SdrUndoObjSetText(*pTextObj,0));
@@ -1219,6 +1219,95 @@ bool SdrUndoObjSetText::CanSdrRepeat(SdrView& rView) const
return bOk;
}
+// --> OD 2009-07-09 #i73249#
+SdrUndoObjStrAttr::SdrUndoObjStrAttr( SdrObject& rNewObj,
+ const ObjStrAttrType eObjStrAttr,
+ const String& sOldStr,
+ const String& sNewStr)
+ : SdrUndoObj( rNewObj ),
+ meObjStrAttr( eObjStrAttr ),
+ msOldStr( sOldStr ),
+ msNewStr( sNewStr )
+{
+}
+
+void SdrUndoObjStrAttr::Undo()
+{
+ ImpShowPageOfThisObject();
+
+ switch ( meObjStrAttr )
+ {
+ case OBJ_NAME:
+ {
+ pObj->SetName( msOldStr );
+ }
+ break;
+ case OBJ_TITLE:
+ {
+ pObj->SetTitle( msOldStr );
+ }
+ break;
+ case OBJ_DESCRIPTION:
+ {
+ pObj->SetDescription( msOldStr );
+ }
+ break;
+ }
+}
+
+void SdrUndoObjStrAttr::Redo()
+{
+ switch ( meObjStrAttr )
+ {
+ case OBJ_NAME:
+ {
+ pObj->SetName( msNewStr );
+ }
+ break;
+ case OBJ_TITLE:
+ {
+ pObj->SetTitle( msNewStr );
+ }
+ break;
+ case OBJ_DESCRIPTION:
+ {
+ pObj->SetDescription( msNewStr );
+ }
+ break;
+ }
+
+ ImpShowPageOfThisObject();
+}
+
+String SdrUndoObjStrAttr::GetComment() const
+{
+ String aStr;
+ switch ( meObjStrAttr )
+ {
+ case OBJ_NAME:
+ {
+ ImpTakeDescriptionStr( STR_UndoObjName, aStr );
+ aStr += sal_Unicode(' ');
+ aStr += sal_Unicode('\'');
+ aStr += msNewStr;
+ aStr += sal_Unicode('\'');
+ }
+ break;
+ case OBJ_TITLE:
+ {
+ ImpTakeDescriptionStr( STR_UndoObjTitle, aStr );
+ }
+ break;
+ case OBJ_DESCRIPTION:
+ {
+ ImpTakeDescriptionStr( STR_UndoObjDescription, aStr );
+ }
+ break;
+ }
+
+ return aStr;
+}
+
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
//
@@ -1726,6 +1815,15 @@ SdrUndoAction* SdrUndoFactory::CreateUndoObjectSetText( SdrObject& rNewObj, sal_
return new SdrUndoObjSetText( rNewObj, nText );
}
+SdrUndoAction* SdrUndoFactory::CreateUndoObjectStrAttr( SdrObject& rObject,
+ SdrUndoObjStrAttr::ObjStrAttrType eObjStrAttrType,
+ String sOldStr,
+ String sNewStr )
+{
+ return new SdrUndoObjStrAttr( rObject, eObjStrAttrType, sOldStr, sNewStr );
+}
+
+
// layer
SdrUndoAction* SdrUndoFactory::CreateUndoNewLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel)
{
diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx
index bdc10c04ee..92b64f3501 100644
--- a/svx/source/svdraw/svdview.cxx
+++ b/svx/source/svdraw/svdview.cxx
@@ -55,13 +55,12 @@
#include "svx/svddrgmt.hxx"
#include "svx/svdoutl.hxx"
#include "svx/svdotable.hxx"
-
-// #90477#
#include <tools/tenccvt.hxx>
#include <svx/sdr/overlay/overlaypolypolygon.hxx>
#include <svx/sdr/overlay/overlaymanager.hxx>
#include <sdrpaintwindow.hxx>
#include <svx/sdrpagewindow.hxx>
+#include <svx/sdrhittesthelper.hxx>
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -489,7 +488,9 @@ SdrHitKind SdrView::PickAnything(const Point& rLogicPos, SdrViewEvent& rVEvt) co
SdrTextObj* pTextObj=PTR_CAST(SdrTextObj,pHitObj);
if (pTextObj!=NULL && pTextObj->HasText())
{
- BOOL bTEHit=pTextObj->IsTextEditHit(aLocalLogicPosition,0/*nHitTolLog*/,&pPV->GetVisibleLayers());
+ bool bTEHit(pPV &&
+ SdrObjectPrimitiveHit(*pTextObj, aLocalLogicPosition, 0, *pPV, &pPV->GetVisibleLayers(), true));
+
if (bTEHit)
{
Rectangle aTextRect;
@@ -566,11 +567,15 @@ SdrHitKind SdrView::PickAnything(const Point& rLogicPos, SdrViewEvent& rVEvt) co
if(!bBoundRectHit)
{
- BOOL bTEHit=pHitObj->IsTextEditHit(aLocalLogicPosition,0,&pPV->GetVisibleLayers());
+ bool bTEHit(pPV &&
+ SdrObjectPrimitiveHit(*pHitObj, aLocalLogicPosition, 0, *pPV, &pPV->GetVisibleLayers(), true));
// TextEdit an Objekten im gesperrten Layer
if (pPV->GetLockedLayers().IsSet(pHitObj->GetLayer()))
+ {
bTEHit=FALSE;
+ }
+
if (bTEHit)
{
rVEvt.pRootObj=pObj;
diff --git a/svx/source/svdraw/svdxcgv.cxx b/svx/source/svdraw/svdxcgv.cxx
index af00499280..4d717d4dfa 100644
--- a/svx/source/svdraw/svdxcgv.cxx
+++ b/svx/source/svdraw/svdxcgv.cxx
@@ -554,7 +554,17 @@ Bitmap SdrExchangeView::GetMarkedObjBitmap( BOOL bNoVDevIfOneBmpMarked ) const
if( !aBmp )
{
const Graphic aGraphic( GetMarkedObjMetaFile( bNoVDevIfOneBmpMarked ) );
- aBmp = aGraphic.GetBitmap();
+
+ // #i102089# support user's settings of AA and LineSnap when the MetaFile gets
+ // rasterconverted to a bitmap
+ const SvtOptionsDrawinglayer aDrawinglayerOpt;
+ const GraphicConversionParameters aParameters(
+ Size(),
+ false,
+ aDrawinglayerOpt.IsAntiAliasing(),
+ aDrawinglayerOpt.IsSnapHorVerLinesToDiscrete());
+
+ aBmp = aGraphic.GetBitmap(aParameters);
}
}
@@ -687,17 +697,16 @@ Graphic SdrExchangeView::GetObjGraphic( const SdrModel* pModel, const SdrObject*
aOut.EnableOutput( FALSE );
aOut.SetMapMode( aMap );
aMtf.Record( &aOut );
-
- // aXOut.SetOffset( Point( -aBoundRect.Left(), -aBoundRect.Top() ) );
- // #i92760# offset set in wrong direction, corrected
- MapMode aOffsetMapMode(aOut.GetMapMode());
- aOffsetMapMode.SetOrigin(Point(-aBoundRect.Left(), -aBoundRect.Top()));
- aOut.SetMapMode(aOffsetMapMode);
-
pObj->SingleObjectPainter( aOut ); // #110094#-17
-
aMtf.Stop();
aMtf.WindStart();
+
+ // #i99268# replace the original offset from using XOutDev's SetOffset
+ // NOT (as tried with #i92760#) with another MapMode which gets recorded
+ // by the Metafile itself (what always leads to problems), but by hardly
+ // moving the result
+ aMtf.Move(-aBoundRect.Left(), -aBoundRect.Top());
+
aMtf.SetPrefMapMode( aMap );
aMtf.SetPrefSize( aBoundRect.GetSize() );
diff --git a/svx/source/svrtf/makefile.mk b/svx/source/svrtf/makefile.mk
index 8dbbd79a82..950036034d 100644
--- a/svx/source/svrtf/makefile.mk
+++ b/svx/source/svrtf/makefile.mk
@@ -36,6 +36,7 @@ PROJECTPCHSOURCE=$(PRJ)$/util$/svxpch
PRJNAME=svx
TARGET=svxrtf
+LIBTARGET=NO
AUTOSEG=true
# --- Settings -----------------------------------------------------
@@ -48,11 +49,17 @@ AUTOSEG=true
EXCEPTIONSFILES= \
$(SLO)$/svxrtf.obj
-SLOFILES = \
- $(SLO)$/rtfgrf.obj \
+LIB1TARGET= $(SLB)$/$(TARGET)-core.lib
+LIB1OBJFILES= \
$(SLO)$/rtfitem.obj \
$(SLO)$/svxrtf.obj
+LIB2TARGET= $(SLB)$/$(TARGET).lib
+LIB2OBJFILES= \
+ $(SLO)$/rtfgrf.obj
+
+SLOFILES = $(LIB1OBJFILES) $(LIB2OBJFILES)
+
# ==========================================================================
.INCLUDE : target.mk
diff --git a/svx/source/svrtf/rtfgrf.cxx b/svx/source/svrtf/rtfgrf.cxx
index eb9ca01c67..4262daac92 100644
--- a/svx/source/svrtf/rtfgrf.cxx
+++ b/svx/source/svrtf/rtfgrf.cxx
@@ -559,17 +559,4 @@ BOOL SvxRTFParser::ReadBmpData( Graphic& rGrf, SvxRTFPictureType& rPicType )
return bValidBmp;
}
- // alle Werte auf default; wird nach einlesen der Bitmap aufgerufen !
-void SvxRTFPictureType::ResetValues()
-{ // setze alle Werte RTF-Defaults
- eStyle = RTF_BITMAP;
- nMode = HEX_MODE;
- nType = nGoalWidth = nGoalHeight = 0;
- nWidth = nHeight = nWidthBytes = 0;
- uPicLen = 0;
- nBitsPerPixel = nPlanes = 1;
- nScalX = nScalY = 100; // Skalierung in Prozent
- nCropT = nCropB = nCropL = nCropR = 0;
-}
-
/* vi:set tabstop=4 shiftwidth=4 expandtab: */
diff --git a/svx/source/svrtf/rtfitem.cxx b/svx/source/svrtf/rtfitem.cxx
index 45a0d0f461..471b00d497 100644
--- a/svx/source/svrtf/rtfitem.cxx
+++ b/svx/source/svrtf/rtfitem.cxx
@@ -1257,12 +1257,16 @@ ATTR_SETEMPHASIS:
ReadTabAttr( nToken, *pSet );
/*
- cmc: #i76140, he who reads the { must read the }
+ cmc: #i76140, he who consumed the { must consume the }
We rewound to a state of { being the current
- token so it is our responsibility to read the }
- token.
+ token so it is our responsibility to consume the }
+ token if we consumed the {. We will not have consumed
+ the { if it belonged to our caller, i.e. if the { we
+ are handling is the "firsttoken" passed to us then
+ the *caller* must consume it, not us. Otherwise *we*
+ should consume it.
*/
- if (nToken == BRACELEFT)
+ if (nToken == BRACELEFT && !bFirstToken)
{
nToken = GetNextToken();
DBG_ASSERT( nToken == BRACERIGHT,
diff --git a/svx/source/table/accessiblecell.cxx b/svx/source/table/accessiblecell.cxx
index a77e80a417..6066023eac 100644
--- a/svx/source/table/accessiblecell.cxx
+++ b/svx/source/table/accessiblecell.cxx
@@ -573,4 +573,15 @@ sal_Int32 SAL_CALL AccessibleCell::getAccessibleIndexInParent (void) throw (Runt
return mnIndexInParent;
}
+::rtl::OUString SAL_CALL AccessibleCell::getAccessibleName (void) throw (::com::sun::star::uno::RuntimeException)
+{
+ ThrowIfDisposed ();
+ ::vos::OGuard aSolarGuard (::Application::GetSolarMutex());
+
+ if( mxCell.is() )
+ return mxCell->getName();
+
+ return AccessibleCellBase::getAccessibleName();
+}
+
} // end of namespace accessibility
diff --git a/svx/source/table/accessiblecell.hxx b/svx/source/table/accessiblecell.hxx
index f09a66a5bd..6114b540bb 100644
--- a/svx/source/table/accessiblecell.hxx
+++ b/svx/source/table/accessiblecell.hxx
@@ -85,6 +85,7 @@ public:
virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL getAccessibleChild(sal_Int32 nIndex) throw(::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet> SAL_CALL getAccessibleStateSet(void) throw(::com::sun::star::uno::RuntimeException);
virtual sal_Int32 SAL_CALL getAccessibleIndexInParent(void) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getAccessibleName (void) throw (::com::sun::star::uno::RuntimeException);
// XAccessibleComponent
virtual sal_Bool SAL_CALL containsPoint( const ::com::sun::star::awt::Point& aPoint) throw (::com::sun::star::uno::RuntimeException);
diff --git a/svx/source/table/accessibletableshape.cxx b/svx/source/table/accessibletableshape.cxx
index ba7dd602c8..0c6beba822 100644
--- a/svx/source/table/accessibletableshape.cxx
+++ b/svx/source/table/accessibletableshape.cxx
@@ -160,6 +160,8 @@ Reference< XAccessible > AccessibleTableShapeImpl::getAccessibleChild( sal_Int32
maChildMap[xCell] = xAccessibleCell;
+ xAccessibleCell->Init();
+
Reference< XAccessible > xChild( xAccessibleCell.get() );
return xChild;
}
@@ -501,10 +503,11 @@ Reference< XAccessible > SAL_CALL AccessibleTableShape::getAccessibleCellAt( sal
::vos::OGuard aSolarGuard (::Application::GetSolarMutex());
checkCellPosition( nColumn, nRow );
- (void)nRow;
- (void)nColumn;
- Reference< XAccessible > xRet;
- return xRet;
+ sal_Int32 nChildIndex = 0;
+ if( mxImpl->mxTable.is() )
+ nChildIndex = mxImpl->mxTable->getColumnCount() * nRow + nColumn;
+
+ return getAccessibleChild( nChildIndex );
}
//--------------------------------------------------------------------
diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx
index 9b3bca602e..b63ce98791 100644
--- a/svx/source/table/cell.cxx
+++ b/svx/source/table/cell.cxx
@@ -1757,5 +1757,71 @@ void SAL_CALL Cell::disposing( const EventObject& /*Source*/ ) throw (RuntimeExc
dispose();
}
+static OUString getCellName( sal_Int32 nCol, sal_Int32 nRow )
+{
+ rtl::OUStringBuffer aBuf;
+
+ if (nCol < 26*26)
+ {
+ if (nCol < 26)
+ aBuf.append( static_cast<sal_Unicode>( 'A' +
+ static_cast<sal_uInt16>(nCol)));
+ else
+ {
+ aBuf.append( static_cast<sal_Unicode>( 'A' +
+ (static_cast<sal_uInt16>(nCol) / 26) - 1));
+ aBuf.append( static_cast<sal_Unicode>( 'A' +
+ (static_cast<sal_uInt16>(nCol) % 26)));
+ }
+ }
+ else
+ {
+ String aStr;
+ while (nCol >= 26)
+ {
+ sal_Int32 nC = nCol % 26;
+ aStr += static_cast<sal_Unicode>( 'A' +
+ static_cast<sal_uInt16>(nC));
+ nCol = nCol - nC;
+ nCol = nCol / 26 - 1;
+ }
+ aStr += static_cast<sal_Unicode>( 'A' +
+ static_cast<sal_uInt16>(nCol));
+ aStr.Reverse();
+ aBuf.append( aStr);
+ }
+ aBuf.append( OUString::valueOf(nRow+1) );
+ return aBuf.makeStringAndClear();
+}
+
+OUString Cell::getName()
+{
+ // todo: optimize!
+ OUString sName;
+ if( mxTable.is() ) try
+ {
+ Reference< XCell > xThis( static_cast< XCell* >( this ) );
+
+ sal_Int32 nRowCount = mxTable->getRowCount();
+ sal_Int32 nColCount = mxTable->getColumnCount();
+ for( sal_Int32 nRow = 0; nRow < nRowCount; nRow++ )
+ {
+ for( sal_Int32 nCol = 0; nCol < nColCount; nCol++ )
+ {
+ Reference< XCell > xCell( mxTable->getCellByPosition( nCol, nRow ) );
+ if( xCell == xThis )
+ {
+ return getCellName( nCol, nRow );
+ }
+ }
+ }
+ }
+ catch( Exception& )
+ {
+ }
+
+ return sName;
+}
+
} }
diff --git a/svx/source/table/cell.hxx b/svx/source/table/cell.hxx
index 7079471e84..dd79dd1f5f 100644
--- a/svx/source/table/cell.hxx
+++ b/svx/source/table/cell.hxx
@@ -58,7 +58,7 @@ namespace sdr { namespace table {
// -----------------------------------------------------------------------------
-class Cell : public SdrText,
+class SVX_DLLPUBLIC Cell : public SdrText,
public SvxUnoTextBase,
public ::com::sun::star::table::XMergeableCell,
public ::com::sun::star::awt::XLayoutConstrains,
@@ -68,156 +68,158 @@ class Cell : public SdrText,
friend class CellUndo;
public:
- static rtl::Reference< Cell > create( SdrTableObj& rTableObj, OutlinerParaObject* pOutlinerParaObject );
+ SVX_DLLPRIVATE static rtl::Reference< Cell > create( SdrTableObj& rTableObj, OutlinerParaObject* pOutlinerParaObject );
// private
- void dispose();
+ SVX_DLLPRIVATE void dispose();
// SdrTextShape proxy
bool IsTextEditActive();
- bool hasText() const;
+ SVX_DLLPRIVATE bool hasText() const;
- void cloneFrom( const CellRef& rCell );
+ SVX_DLLPRIVATE void cloneFrom( const CellRef& rCell );
- void setCellRect( ::Rectangle& rCellRect ) { maCellRect = rCellRect; }
- const ::Rectangle& getCellRect() const { return maCellRect; }
- ::Rectangle& getCellRect() { return maCellRect; }
+ SVX_DLLPRIVATE void setCellRect( ::Rectangle& rCellRect ) { maCellRect = rCellRect; }
+ SVX_DLLPRIVATE const ::Rectangle& getCellRect() const { return maCellRect; }
+ SVX_DLLPRIVATE ::Rectangle& getCellRect() { return maCellRect; }
OutlinerParaObject* GetEditOutlinerParaObject() const;
- void SetStyleSheet( SfxStyleSheet* pStyleSheet, sal_Bool bDontRemoveHardAttr );
- virtual SfxStyleSheet* GetStyleSheet() const;
+ SVX_DLLPRIVATE void SetStyleSheet( SfxStyleSheet* pStyleSheet, sal_Bool bDontRemoveHardAttr );
+ SVX_DLLPRIVATE virtual SfxStyleSheet* GetStyleSheet() const;
SfxStyleSheetPool* GetStyleSheetPool() const;
- virtual const Rectangle& GetCurrentBoundRect() const;
- virtual void TakeTextAnchorRect(Rectangle& rAnchorRect) const;
+ SVX_DLLPRIVATE virtual const Rectangle& GetCurrentBoundRect() const;
+ SVX_DLLPRIVATE virtual void TakeTextAnchorRect(Rectangle& rAnchorRect) const;
- virtual const SfxItemSet& GetItemSet() const;
- void SetMergedItemSetAndBroadcast(const SfxItemSet& rSet, sal_Bool bClearAllItems);
+ SVX_DLLPRIVATE virtual const SfxItemSet& GetItemSet() const;
+ SVX_DLLPRIVATE void SetMergedItemSetAndBroadcast(const SfxItemSet& rSet, sal_Bool bClearAllItems);
void SetMergedItem(const SfxPoolItem& rItem);
- sal_Int32 getMinimumWidth();
- sal_Int32 getMinimumHeight();
+ SVX_DLLPRIVATE sal_Int32 getMinimumWidth();
+ SVX_DLLPRIVATE sal_Int32 getMinimumHeight();
- long GetTextLeftDistance() const;
- long GetTextRightDistance() const;
- long GetTextUpperDistance() const;
- long GetTextLowerDistance() const;
+ SVX_DLLPRIVATE long GetTextLeftDistance() const;
+ SVX_DLLPRIVATE long GetTextRightDistance() const;
+ SVX_DLLPRIVATE long GetTextUpperDistance() const;
+ SVX_DLLPRIVATE long GetTextLowerDistance() const;
- SdrTextVertAdjust GetTextVerticalAdjust() const;
+ SVX_DLLPRIVATE SdrTextVertAdjust GetTextVerticalAdjust() const;
SdrTextHorzAdjust GetTextHorizontalAdjust() const;
- virtual void SetModel(SdrModel* pNewModel);
+ SVX_DLLPRIVATE virtual void SetModel(SdrModel* pNewModel);
- void merge( sal_Int32 nColumnSpan, sal_Int32 nRowSpan );
- void mergeContent( const CellRef& xSourceCell );
- void replaceContentAndFormating( const CellRef& xSourceCell );
+ SVX_DLLPRIVATE void merge( sal_Int32 nColumnSpan, sal_Int32 nRowSpan );
+ SVX_DLLPRIVATE void mergeContent( const CellRef& xSourceCell );
+ SVX_DLLPRIVATE void replaceContentAndFormating( const CellRef& xSourceCell );
- void setMerged();
+ SVX_DLLPRIVATE void setMerged();
// XInterface
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& Type ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL acquire() throw ();
- virtual void SAL_CALL release() throw ();
+ SVX_DLLPRIVATE virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& Type ) throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual void SAL_CALL acquire() throw ();
+ SVX_DLLPRIVATE virtual void SAL_CALL release() throw ();
// XTypeProvider
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw (::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::sal_Int8 > SAL_CALL getImplementationId( ) throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual ::com::sun::star::uno::Sequence< ::sal_Int8 > SAL_CALL getImplementationId( ) throw (::com::sun::star::uno::RuntimeException);
// XServiceInfo
- virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException);
- 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);
+ SVX_DLLPRIVATE virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException);
// XLayoutConstrains
- virtual ::com::sun::star::awt::Size SAL_CALL getMinimumSize( ) throw (::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::awt::Size SAL_CALL getPreferredSize( ) throw (::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& aNewSize ) throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual ::com::sun::star::awt::Size SAL_CALL getMinimumSize( ) throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual ::com::sun::star::awt::Size SAL_CALL getPreferredSize( ) throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& aNewSize ) throw (::com::sun::star::uno::RuntimeException);
// XMergeableCell
- virtual ::sal_Int32 SAL_CALL getRowSpan() throw (::com::sun::star::uno::RuntimeException);
- virtual ::sal_Int32 SAL_CALL getColumnSpan() throw (::com::sun::star::uno::RuntimeException);
- virtual ::sal_Bool SAL_CALL isMerged() throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual ::sal_Int32 SAL_CALL getRowSpan() throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual ::sal_Int32 SAL_CALL getColumnSpan() throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual ::sal_Bool SAL_CALL isMerged() throw (::com::sun::star::uno::RuntimeException);
// XCell
- virtual ::rtl::OUString SAL_CALL getFormula() throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setFormula( const ::rtl::OUString& aFormula ) throw (::com::sun::star::uno::RuntimeException);
- virtual double SAL_CALL getValue() throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setValue( double nValue ) throw (::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::table::CellContentType SAL_CALL getType() throw (::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getError() throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual ::rtl::OUString SAL_CALL getFormula() throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual void SAL_CALL setFormula( const ::rtl::OUString& aFormula ) throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual double SAL_CALL getValue() throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual void SAL_CALL setValue( double nValue ) throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual ::com::sun::star::table::CellContentType SAL_CALL getType() throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual sal_Int32 SAL_CALL getError() throw (::com::sun::star::uno::RuntimeException);
// ::com::sun::star::beans::XPropertySet
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
// XMultiPropertySet
- virtual void SAL_CALL setPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues ) throw (::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL addPropertiesChangeListener( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL removePropertiesChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL firePropertiesChangeEvent( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual void SAL_CALL setPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues ) throw (::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual void SAL_CALL addPropertiesChangeListener( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual void SAL_CALL removePropertiesChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual void SAL_CALL firePropertiesChangeEvent( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
// ::com::sun::star::beans::XPropertyState
- virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const ::rtl::OUString& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const ::rtl::OUString& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
// XMultiPropertyStates
- virtual void SAL_CALL setAllPropertiesToDefault( ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setPropertiesToDefault( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyDefaults( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual void SAL_CALL setAllPropertiesToDefault( ) throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual void SAL_CALL setPropertiesToDefault( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyDefaults( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
// XFastPropertySet
- virtual void SAL_CALL setFastPropertyValue( ::sal_Int32 nHandle, const ::com::sun::star::uno::Any& aValue ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Any SAL_CALL getFastPropertyValue( ::sal_Int32 nHandle ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual void SAL_CALL setFastPropertyValue( ::sal_Int32 nHandle, const ::com::sun::star::uno::Any& aValue ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual ::com::sun::star::uno::Any SAL_CALL getFastPropertyValue( ::sal_Int32 nHandle ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
// XText
- virtual void SAL_CALL insertTextContent( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xRange, const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent >& xContent, ::sal_Bool bAbsorb ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL removeTextContent( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent >& xContent ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual void SAL_CALL insertTextContent( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xRange, const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent >& xContent, ::sal_Bool bAbsorb ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual void SAL_CALL removeTextContent( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent >& xContent ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
// XSimpleText
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursor( ) throw (::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursorByRange( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& aTextPosition ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL insertString( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xRange, const ::rtl::OUString& aString, ::sal_Bool bAbsorb ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL insertControlCharacter( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xRange, ::sal_Int16 nControlCharacter, ::sal_Bool bAbsorb ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursor( ) throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursorByRange( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& aTextPosition ) throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual void SAL_CALL insertString( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xRange, const ::rtl::OUString& aString, ::sal_Bool bAbsorb ) throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual void SAL_CALL insertControlCharacter( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xRange, ::sal_Int16 nControlCharacter, ::sal_Bool bAbsorb ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
// XTextRange
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL getText( ) throw (::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getStart( ) throw (::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getEnd( ) throw (::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getString( ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setString( const ::rtl::OUString& aString ) throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL getText( ) throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getStart( ) throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getEnd( ) throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual ::rtl::OUString SAL_CALL getString( ) throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual void SAL_CALL setString( const ::rtl::OUString& aString ) throw (::com::sun::star::uno::RuntimeException);
// XEventListener
- virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
+ SVX_DLLPRIVATE virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SetOutlinerParaObject( OutlinerParaObject* pTextObject );
+ SVX_DLLPRIVATE virtual void SetOutlinerParaObject( OutlinerParaObject* pTextObject );
- void AddUndo();
+ SVX_DLLPRIVATE void AddUndo();
using SvxUnoTextRangeBase::setPropertyValue;
using SvxUnoTextRangeBase::getPropertyValue;
- sdr::properties::TextProperties* CloneProperties( SdrObject& rNewObj, Cell& rNewCell );
+ SVX_DLLPRIVATE sdr::properties::TextProperties* CloneProperties( SdrObject& rNewObj, Cell& rNewCell );
- static sdr::properties::TextProperties* CloneProperties( sdr::properties::TextProperties* pProperties, SdrObject& rNewObj, Cell& rNewCell );
+ SVX_DLLPRIVATE static sdr::properties::TextProperties* CloneProperties( sdr::properties::TextProperties* pProperties, SdrObject& rNewObj, Cell& rNewCell );
- void notifyModified();
+ SVX_DLLPRIVATE void notifyModified();
+
+ ::rtl::OUString getName();
protected:
- virtual const SfxItemSet& GetObjectItemSet();
- virtual void SetObjectItem(const SfxPoolItem& rItem);
+ SVX_DLLPRIVATE virtual const SfxItemSet& GetObjectItemSet();
+ SVX_DLLPRIVATE virtual void SetObjectItem(const SfxPoolItem& rItem);
- ::com::sun::star::uno::Any GetAnyForItem( SfxItemSet& aSet, const SfxItemPropertySimpleEntry* pMap );
+ SVX_DLLPRIVATE ::com::sun::star::uno::Any GetAnyForItem( SfxItemSet& aSet, const SfxItemPropertySimpleEntry* pMap );
private:
- Cell( SdrTableObj& rTableObj, OutlinerParaObject* pOutlinerParaObject ) throw();
- virtual ~Cell() throw();
+ SVX_DLLPRIVATE Cell( SdrTableObj& rTableObj, OutlinerParaObject* pOutlinerParaObject ) throw();
+ SVX_DLLPRIVATE virtual ~Cell() throw();
const SvxItemPropertySet* mpPropSet;
diff --git a/svx/source/table/celleditsource.hxx b/svx/source/table/celleditsource.hxx
index b2ea75c3b4..ebd991905b 100644
--- a/svx/source/table/celleditsource.hxx
+++ b/svx/source/table/celleditsource.hxx
@@ -73,7 +73,7 @@ public:
void lock();
void unlock();
- // the viewforwarder interface
+ // the SvxViewForwarder interface
virtual BOOL IsValid() const;
virtual Rectangle GetVisArea() const;
virtual Point LogicToPixel( const Point&, const MapMode& ) const;
diff --git a/svx/source/table/makefile.mk b/svx/source/table/makefile.mk
index 8789cd4da8..ae0dc5eb68 100644
--- a/svx/source/table/makefile.mk
+++ b/svx/source/table/makefile.mk
@@ -36,6 +36,7 @@ PROJECTPCHSOURCE=$(PRJ)$/util$/svxpch
PRJNAME=svx
TARGET=table
+LIBTARGET=NO
ENABLE_EXCEPTIONS=TRUE;
# --- Settings -----------------------------------------------------
@@ -45,9 +46,9 @@ ENABLE_EXCEPTIONS=TRUE;
# --- Files --------------------------------------------------------
-SLOFILES= \
+LIB1TARGET= $(SLB)$/$(TARGET)-core.lib
+LIB1OBJFILES= \
$(SLO)$/propertyset.obj\
- $(SLO)$/celleditsource.obj\
$(SLO)$/cell.obj\
$(SLO)$/cellrange.obj\
$(SLO)$/cellcursor.obj\
@@ -61,13 +62,19 @@ SLOFILES= \
$(SLO)$/tablelayouter.obj\
$(SLO)$/tablehandles.obj\
$(SLO)$/tablecontroller.obj\
- $(SLO)$/tabledesign.obj\
- $(SLO)$/tableundo.obj\
- $(SLO)$/accessibletableshape.obj\
+ $(SLO)$/tableundo.obj
+
+LIB2TARGET= $(SLB)$/$(TARGET).lib
+LIB2OBJFILES= \
+ $(SLO)$/celleditsource.obj \
+ $(SLO)$/tabledesign.obj \
+ $(SLO)$/accessibletableshape.obj \
$(SLO)$/accessiblecell.obj \
$(SLO)$/tablertfexporter.obj \
$(SLO)$/tablertfimporter.obj
+SLOFILES = $(LIB1OBJFILES) $(LIB2OBJFILES)
+
SRS1NAME=table
SRC1FILES= table.src
diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx
index 1a83e03611..d639b3e884 100644
--- a/svx/source/table/svdotable.cxx
+++ b/svx/source/table/svdotable.cxx
@@ -1930,21 +1930,6 @@ void lcl_VertLine( OutputDevice& rDev, const Point& rTop, const Point& rBottom,
// --------------------------------------------------------------------
-SdrObject* SdrTableObj::CheckHit(const Point& rPnt, USHORT /*nTol*/, const SetOfByte* pVisiLayer) const
-{
- if(pVisiLayer && !pVisiLayer->IsSet(sal::static_int_cast< sal_uInt8 >(GetLayer())))
- {
- return NULL;
- }
-
- if( (rPnt.X() >= aOutRect.Left()) && (rPnt.X() <= aOutRect.Right()) && (rPnt.Y() >= aOutRect.Top()) && rPnt.Y() <= aOutRect.Bottom() )
- return const_cast<SdrObject*>(static_cast<const SdrObject*>(this));
-
- return NULL;
-}
-
-// --------------------------------------------------------------------
-
void SdrTableObj::TakeObjNameSingul(XubString& rName) const
{
rName = ImpGetResStr(STR_ObjNameSingulTable);
diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx
index 2a9aa3ecdf..180485f3fc 100644
--- a/svx/source/table/tablecontroller.cxx
+++ b/svx/source/table/tablecontroller.cxx
@@ -493,7 +493,7 @@ void SvxTableController::GetState( SfxItemSet& rSet )
// --------------------------------------------------------------------
-void SvxTableController::onInsert( sal_uInt16 nSId )
+void SvxTableController::onInsert( sal_uInt16 nSId, const SfxItemSet* pArgs )
{
::sdr::table::SdrTableObj* pTableObj = dynamic_cast< ::sdr::table::SdrTableObj* >( mxTableObj.get() );
if( !pTableObj )
@@ -501,6 +501,21 @@ void SvxTableController::onInsert( sal_uInt16 nSId )
if( mxTable.is() ) try
{
+ //
+ bool bInsertAfter = true;
+ sal_uInt16 nCount = 0;
+ if( pArgs )
+ {
+ const SfxPoolItem* pItem = 0;
+ pArgs->GetItemState(nSId, FALSE, &pItem);
+ if (pItem)
+ {
+ nCount = ((const SfxInt16Item* )pItem)->GetValue();
+ if(SFX_ITEM_SET == pArgs->GetItemState(SID_TABLE_PARAM_INSERT_AFTER, TRUE, &pItem))
+ bInsertAfter = ((const SfxBoolItem* )pItem)->GetValue();
+ }
+ }
+
CellPos aStart, aEnd;
if( hasSelectedCells() )
{
@@ -508,15 +523,18 @@ void SvxTableController::onInsert( sal_uInt16 nSId )
}
else
{
- aStart.mnCol = mxTable->getColumnCount() - 1;
- aStart.mnRow = mxTable->getRowCount() - 1;
- aEnd = aStart;
+ if( bInsertAfter )
+ {
+ aStart.mnCol = mxTable->getColumnCount() - 1;
+ aStart.mnRow = mxTable->getRowCount() - 1;
+ aEnd = aStart;
+ }
}
if( pTableObj->IsTextEditActive() )
mpView->SdrEndTextEdit(sal_True);
- RemoveSelection();
+ RemoveSelection();
const OUString sSize( RTL_CONSTASCII_USTRINGPARAM( "Size" ) );
@@ -535,8 +553,9 @@ void SvxTableController::onInsert( sal_uInt16 nSId )
}
Reference< XTableColumns > xCols( mxTable->getColumns() );
- const sal_Int32 nNewColumns = aEnd.mnCol - aStart.mnCol + 1;
- xCols->insertByIndex( aEnd.mnCol + 1, nNewColumns );
+ const sal_Int32 nNewColumns = (nCount == 0) ? (aEnd.mnCol - aStart.mnCol + 1) : nCount;
+ const sal_Int32 nNewStartColumn = aEnd.mnCol + (bInsertAfter ? 1 : 0);
+ xCols->insertByIndex( nNewStartColumn, nNewColumns );
for( sal_Int32 nOffset = 0; nOffset < nNewColumns; nOffset++ )
{
@@ -552,7 +571,7 @@ void SvxTableController::onInsert( sal_uInt16 nSId )
if( mpModel )
mpModel->SetChanged();
- aStart.mnCol = aEnd.mnCol+1;
+ aStart.mnCol = nNewStartColumn;
aStart.mnRow = 0;
aEnd.mnCol = aStart.mnCol + nNewColumns - 1;
aEnd.mnRow = mxTable->getRowCount() - 1;
@@ -570,8 +589,9 @@ void SvxTableController::onInsert( sal_uInt16 nSId )
}
Reference< XTableRows > xRows( mxTable->getRows() );
- const sal_Int32 nNewRows = aEnd.mnRow - aStart.mnRow + 1;
- xRows->insertByIndex( aEnd.mnRow + 1, nNewRows );
+ const sal_Int32 nNewRows = (nCount == 0) ? (aEnd.mnRow - aStart.mnRow + 1) : nCount;
+ const sal_Int32 nNewRowStart = aEnd.mnRow + (bInsertAfter ? 1 : 0);
+ xRows->insertByIndex( nNewRowStart, nNewRows );
for( sal_Int32 nOffset = 0; nOffset < nNewRows; nOffset++ )
{
@@ -591,7 +611,7 @@ void SvxTableController::onInsert( sal_uInt16 nSId )
mpModel->SetChanged();
aStart.mnCol = 0;
- aStart.mnRow = aEnd.mnRow+1;
+ aStart.mnRow = nNewRowStart;
aEnd.mnCol = mxTable->getColumnCount() - 1;
aEnd.mnRow = aStart.mnRow + nNewRows - 1;
break;
@@ -759,7 +779,7 @@ void SvxTableController::Execute( SfxRequest& rReq )
{
case SID_TABLE_INSERT_ROW:
case SID_TABLE_INSERT_COL:
- onInsert( nSId );
+ onInsert( nSId, rReq.GetArgs() );
break;
case SID_TABLE_DELETE_ROW:
case SID_TABLE_DELETE_COL:
@@ -1490,7 +1510,7 @@ bool SvxTableController::executeAction( sal_uInt16 nAction, bool bSelect, Window
CellPos aNextCell( pTableObj->getNextCell( aSelectionEnd, true ) );
if( aSelectionEnd == aNextCell )
{
- onInsert( SID_TABLE_INSERT_ROW );
+ onInsert( SID_TABLE_INSERT_ROW, 0 );
aNextCell = pTableObj->getNextCell( aSelectionEnd, true );
}
gotoCell( aNextCell, false, pWindow, nAction );
@@ -1952,7 +1972,6 @@ void SvxTableController::updateSelectionOverlay()
if( pOverlayManager )
{
// sdr::overlay::CellOverlayType eType = sdr::overlay::CELL_OVERLAY_INVERT;
- // sdr::overlay::CellOverlayType eType = sdr::overlay::CELL_OVERLAY_HATCH;
sdr::overlay::CellOverlayType eType = sdr::overlay::CELL_OVERLAY_TRANSPARENT;
sdr::overlay::OverlayObjectCell* pOverlay = new sdr::overlay::OverlayObjectCell( eType, aHighlight, aRanges );
diff --git a/svx/source/table/tablecontroller.hxx b/svx/source/table/tablecontroller.hxx
index 2ea934eaed..b4eecf0902 100644
--- a/svx/source/table/tablecontroller.hxx
+++ b/svx/source/table/tablecontroller.hxx
@@ -43,6 +43,7 @@
class SdrObjEditView;
class SdrObject;
+class SfxItemSet;
namespace sdr { namespace table {
@@ -50,97 +51,97 @@ const sal_Int16 SELTYPE_NONE = 0;
const sal_Int16 SELTYPE_MOUSE = 1;
const sal_Int16 SELTYPE_KEYS = 2;
-class SvxTableController: public sdr::SelectionController
+class SVX_DLLPUBLIC SvxTableController: public sdr::SelectionController
{
public:
- SvxTableController( SdrObjEditView* pView, const SdrObject* pObj );
- virtual ~SvxTableController();
+ SVX_DLLPRIVATE SvxTableController( SdrObjEditView* pView, const SdrObject* pObj );
+ SVX_DLLPRIVATE virtual ~SvxTableController();
- virtual bool onKeyInput(const KeyEvent& rKEvt, Window* pWin);
- virtual bool onMouseButtonDown(const MouseEvent& rMEvt, Window* pWin);
- virtual bool onMouseButtonUp(const MouseEvent& rMEvt, Window* pWin);
- virtual bool onMouseMove(const MouseEvent& rMEvt, Window* pWin);
+ 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);
+ SVX_DLLPRIVATE virtual bool onMouseMove(const MouseEvent& rMEvt, Window* pWin);
- virtual bool DeleteMarked();
+ SVX_DLLPRIVATE virtual bool DeleteMarked();
- virtual void onSelectionHasChanged();
+ SVX_DLLPRIVATE virtual void onSelectionHasChanged();
- virtual void GetState( SfxItemSet& rSet );
- virtual void Execute( SfxRequest& rReq );
+ SVX_DLLPRIVATE virtual void GetState( SfxItemSet& rSet );
+ SVX_DLLPRIVATE virtual void Execute( SfxRequest& rReq );
- virtual bool GetStyleSheet( SfxStyleSheet* &rpStyleSheet ) const;
- virtual bool SetStyleSheet( SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAttr );
+ SVX_DLLPRIVATE virtual bool GetStyleSheet( SfxStyleSheet* &rpStyleSheet ) const;
+ SVX_DLLPRIVATE virtual bool SetStyleSheet( SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAttr );
// slots
- void onInsert( sal_uInt16 nSId );
- void onDelete( sal_uInt16 nSId );
- void onSelect( sal_uInt16 nSId );
- void onFormatTable( SfxRequest& rReq );
- void MergeMarkedCells();
- void SplitMarkedCells();
- void DistributeColumns();
- void DistributeRows();
- void SetVertical( sal_uInt16 nSId );
+ SVX_DLLPRIVATE void onInsert( sal_uInt16 nSId, const SfxItemSet* pArgs = 0 );
+ SVX_DLLPRIVATE void onDelete( sal_uInt16 nSId );
+ SVX_DLLPRIVATE void onSelect( sal_uInt16 nSId );
+ SVX_DLLPRIVATE void onFormatTable( SfxRequest& rReq );
+ SVX_DLLPRIVATE void MergeMarkedCells();
+ SVX_DLLPRIVATE void SplitMarkedCells();
+ SVX_DLLPRIVATE void DistributeColumns();
+ SVX_DLLPRIVATE void DistributeRows();
+ SVX_DLLPRIVATE void SetVertical( sal_uInt16 nSId );
- static rtl::Reference< sdr::SelectionController > create( SdrObjEditView* pView, const SdrObject* pObj, const rtl::Reference< sdr::SelectionController >& xRefController );
+ SVX_DLLPRIVATE static rtl::Reference< sdr::SelectionController > create( SdrObjEditView* pView, const SdrObject* pObj, const rtl::Reference< sdr::SelectionController >& xRefController );
- void MergeAttrFromSelectedCells(SfxItemSet& rAttr, bool bOnlyHardAttr) const;
- void SetAttrToSelectedCells(const SfxItemSet& rAttr, bool bReplaceAll);
+ SVX_DLLPRIVATE void MergeAttrFromSelectedCells(SfxItemSet& rAttr, bool bOnlyHardAttr) const;
+ SVX_DLLPRIVATE void SetAttrToSelectedCells(const SfxItemSet& rAttr, bool bReplaceAll);
- virtual bool GetAttributes(SfxItemSet& rTargetSet, bool bOnlyHardAttr) const;
- virtual bool SetAttributes(const SfxItemSet& rSet, bool bReplaceAll);
+ SVX_DLLPRIVATE virtual bool GetAttributes(SfxItemSet& rTargetSet, bool bOnlyHardAttr) const;
+ SVX_DLLPRIVATE virtual bool SetAttributes(const SfxItemSet& rSet, bool bReplaceAll);
- virtual bool GetMarkedObjModel( SdrPage* pNewPage );
- virtual bool PasteObjModel( const SdrModel& rModel );
+ SVX_DLLPRIVATE virtual bool GetMarkedObjModel( SdrPage* pNewPage );
+ SVX_DLLPRIVATE virtual bool PasteObjModel( const SdrModel& rModel );
- bool hasSelectedCells() const { return mbCellSelectionMode || mpView->IsTextEdit(); }
+ SVX_DLLPRIVATE bool hasSelectedCells() const { return mbCellSelectionMode || mpView->IsTextEdit(); }
void getSelectedCells( CellPos& rFirstPos, CellPos& rLastPos );
void setSelectedCells( const CellPos& rFirstPos, const CellPos& rLastPos );
void clearSelection();
void selectAll();
- void onTableModified();
+ SVX_DLLPRIVATE void onTableModified();
private:
SvxTableController(SvxTableController &); // not defined
void operator =(SvxTableController &); // not defined
// internals
- void ApplyBorderAttr( const SfxItemSet& rAttr );
- void UpdateTableShape();
+ SVX_DLLPRIVATE void ApplyBorderAttr( const SfxItemSet& rAttr );
+ SVX_DLLPRIVATE void UpdateTableShape();
- void SetTableStyle( const SfxItemSet* pArgs );
- void SetTableStyleSettings( const SfxItemSet* pArgs );
+ SVX_DLLPRIVATE void SetTableStyle( const SfxItemSet* pArgs );
+ SVX_DLLPRIVATE void SetTableStyleSettings( const SfxItemSet* pArgs );
- bool PasteObject( SdrTableObj* pPasteTableObj );
+ SVX_DLLPRIVATE bool PasteObject( SdrTableObj* pPasteTableObj );
- bool checkTableObject();
- bool updateTableObject();
- const CellPos& getSelectionStart();
- void setSelectionStart( const CellPos& rPos );
- const CellPos& getSelectionEnd();
- ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellCursor > getSelectionCursor();
- void checkCell( CellPos& rPos );
+ SVX_DLLPRIVATE bool checkTableObject();
+ SVX_DLLPRIVATE bool updateTableObject();
+ SVX_DLLPRIVATE const CellPos& getSelectionStart();
+ SVX_DLLPRIVATE void setSelectionStart( const CellPos& rPos );
+ SVX_DLLPRIVATE const CellPos& getSelectionEnd();
+ SVX_DLLPRIVATE ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellCursor > getSelectionCursor();
+ SVX_DLLPRIVATE void checkCell( CellPos& rPos );
- void MergeRange( sal_Int32 nFirstCol, sal_Int32 nFirstRow, sal_Int32 nLastCol, sal_Int32 nLastRow );
+ SVX_DLLPRIVATE void MergeRange( sal_Int32 nFirstCol, sal_Int32 nFirstRow, sal_Int32 nLastCol, sal_Int32 nLastRow );
- void EditCell( const CellPos& rPos, ::Window* pWindow, const ::com::sun::star::awt::MouseEvent* pMouseEvent = 0, sal_uInt16 nAction = 0 );
- bool StopTextEdit();
+ SVX_DLLPRIVATE void EditCell( const CellPos& rPos, ::Window* pWindow, const ::com::sun::star::awt::MouseEvent* pMouseEvent = 0, sal_uInt16 nAction = 0 );
+ SVX_DLLPRIVATE bool StopTextEdit();
- void DeleteTable();
+ SVX_DLLPRIVATE void DeleteTable();
- sal_uInt16 getKeyboardAction( const KeyEvent& rKEvt, Window* pWindow );
- bool executeAction( sal_uInt16 nAction, bool bSelect, Window* pWindow );
- void gotoCell( const CellPos& rCell, bool bSelect, Window* pWindow, sal_uInt16 nAction = 0 );
+ SVX_DLLPRIVATE sal_uInt16 getKeyboardAction( const KeyEvent& rKEvt, Window* pWindow );
+ SVX_DLLPRIVATE bool executeAction( sal_uInt16 nAction, bool bSelect, Window* pWindow );
+ SVX_DLLPRIVATE void gotoCell( const CellPos& rCell, bool bSelect, Window* pWindow, sal_uInt16 nAction = 0 );
- void StartSelection( const CellPos& rPos );
- void UpdateSelection( const CellPos& rPos );
- void RemoveSelection();
- void updateSelectionOverlay();
- void destroySelectionOverlay();
+ SVX_DLLPRIVATE void StartSelection( const CellPos& rPos );
+ SVX_DLLPRIVATE void UpdateSelection( const CellPos& rPos );
+ SVX_DLLPRIVATE void RemoveSelection();
+ SVX_DLLPRIVATE void updateSelectionOverlay();
+ SVX_DLLPRIVATE void destroySelectionOverlay();
- void findMergeOrigin( CellPos& rPos );
+ SVX_DLLPRIVATE void findMergeOrigin( CellPos& rPos );
DECL_LINK( UpdateHdl, void * );
diff --git a/svx/source/table/tablehandles.cxx b/svx/source/table/tablehandles.cxx
index 202908f65b..511616921c 100644
--- a/svx/source/table/tablehandles.cxx
+++ b/svx/source/table/tablehandles.cxx
@@ -38,60 +38,36 @@
#include <vcl/salbtype.hxx>
#include <vcl/canvastools.hxx>
#include <vcl/hatch.hxx>
-
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/polygon/b2dpolypolygontools.hxx>
#include <basegfx/range/b2drectangle.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
-
#include <svx/sdr/overlay/overlayobject.hxx>
#include <svx/sdr/overlay/overlaymanager.hxx>
#include <svx/sdrpagewindow.hxx>
#include <sdrpaintwindow.hxx>
#include <svx/svdmrkv.hxx>
#include <svx/svdpagv.hxx>
-
+#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
+#include <svx/sdr/overlay/overlayhatchrect.hxx>
+#include <drawinglayer/primitive2d/hittestprimitive2d.hxx>
namespace sdr { namespace table {
-class OverlayTableEdge : public sdr::overlay::OverlayObject
-{
-protected:
- basegfx::B2DPolyPolygon maPolyPolygon;
-
- // Draw geometry
- virtual void drawGeometry(OutputDevice& rOutputDevice);
-
- // Create the BaseRange. This method needs to calculate maBaseRange.
- virtual void createBaseRange(OutputDevice& rOutputDevice);
-
- virtual void transform(const basegfx::B2DHomMatrix& rMatrix);
-
-public:
- OverlayTableEdge( const basegfx::B2DPolyPolygon& rPolyPolygon );
- virtual ~OverlayTableEdge();
-};
-
// --------------------------------------------------------------------
-class OverlayTableBorder : public sdr::overlay::OverlayObject
+class OverlayTableEdge : public sdr::overlay::OverlayObject
{
protected:
basegfx::B2DPolyPolygon maPolyPolygon;
+ bool mbVisible;
- // Draw geometry
- virtual void drawGeometry(OutputDevice& rOutputDevice);
-
- // Create the BaseRange. This method needs to calculate maBaseRange.
- virtual void createBaseRange(OutputDevice& rOutputDevice);
-
- virtual void transform(const basegfx::B2DHomMatrix& rMatrix);
-
- virtual sal_Bool isHit(const basegfx::B2DPoint& rPos, double fTol = 0.0) const;
+ // geometry creation for OverlayObject
+ virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence();
public:
- OverlayTableBorder( const basegfx::B2DPolyPolygon& rPolyPolygon );
- virtual ~OverlayTableBorder();
+ OverlayTableEdge( const basegfx::B2DPolyPolygon& rPolyPolygon, bool bVisible );
+ virtual ~OverlayTableEdge();
};
// --------------------------------------------------------------------
@@ -134,40 +110,23 @@ sal_Int32 TableEdgeHdl::GetValidDragOffset( const SdrDragStat& rDrag ) const
basegfx::B2DPolyPolygon TableEdgeHdl::getSpecialDragPoly(const SdrDragStat& rDrag) const
{
- return GetPolyPolygon(false, &rDrag);
-}
+ basegfx::B2DPolyPolygon aVisible;
+ basegfx::B2DPolyPolygon aInvisible;
-bool TableEdgeHdl::IsHdlHit(const Point& rPnt) const
-{
- if( GetPointNum() != 0 )
- {
- double fTol = 0.0;
- if( pHdlList )
- {
- SdrMarkView* pView = pHdlList->GetView();
- if( pView )
- {
- OutputDevice* pOutDev = pView->GetFirstOutputDevice();
- if( pOutDev )
- {
- fTol = static_cast<double>(pOutDev->PixelToLogic(Size(3, 3)).Width());
- }
- }
- }
+ // create and return visible and non-visible parts for drag
+ getPolyPolygon(aVisible, aInvisible, &rDrag);
+ aVisible.append(aInvisible);
- basegfx::B2DPoint aPosition(rPnt.X(), rPnt.Y());
- if( basegfx::tools::isInEpsilonRange( maVisiblePolygon, aPosition, fTol ) )
- return sal_True;
- }
- return false;
+ return aVisible;
}
-
-basegfx::B2DPolyPolygon TableEdgeHdl::GetPolyPolygon( bool bOnlyVisible, const SdrDragStat* pDrag /*= 0*/ ) const
+void TableEdgeHdl::getPolyPolygon(basegfx::B2DPolyPolygon& rVisible, basegfx::B2DPolyPolygon& rInvisible, const SdrDragStat* pDrag) const
{
- basegfx::B2DPolyPolygon aRetValue;
-
+ // changed method to create visible and invisible partial polygons in one run in
+ // separate PolyPolygons; both kinds are used
basegfx::B2DPoint aOffset(aPos.X(), aPos.Y());
+ rVisible.clear();
+ rInvisible.clear();
if( pDrag )
{
@@ -176,37 +135,35 @@ basegfx::B2DPolyPolygon TableEdgeHdl::GetPolyPolygon( bool bOnlyVisible, const S
}
basegfx::B2DPoint aStart(aOffset), aEnd(aOffset);
-
int nPos = mbHorizontal ? 0 : 1;
-
- // base line hit, check for edges
TableEdgeVector::const_iterator aIter( maEdges.begin() );
+
while( aIter != maEdges.end() )
{
TableEdge aEdge(*aIter++);
- if( aEdge.meState == Visible || ( aEdge.meState == Invisible && !bOnlyVisible ) )
- {
- aStart[nPos] = aOffset[nPos] + aEdge.mnStart;
- aEnd[nPos] = aOffset[nPos] + aEdge.mnEnd;
+ aStart[nPos] = aOffset[nPos] + aEdge.mnStart;
+ aEnd[nPos] = aOffset[nPos] + aEdge.mnEnd;
- basegfx::B2DPolygon aPolygon;
- aPolygon.append( aStart );
- aPolygon.append( aEnd );
+ basegfx::B2DPolygon aPolygon;
+ aPolygon.append( aStart );
+ aPolygon.append( aEnd );
- aRetValue.append( aPolygon );
+ if(aEdge.meState == Visible)
+ {
+ rVisible.append(aPolygon);
+ }
+ else
+ {
+ rInvisible.append(aPolygon);
}
}
-
- return aRetValue;
}
void TableEdgeHdl::CreateB2dIAObject()
{
GetRidOfIAObject();
- maVisiblePolygon = GetPolyPolygon(false);
-
if(pHdlList && pHdlList->GetView() && !pHdlList->GetView()->areMarkHandlesHidden())
{
SdrMarkView* pView = pHdlList->GetView();
@@ -214,20 +171,40 @@ void TableEdgeHdl::CreateB2dIAObject()
if(pPageView)
{
- for(sal_uInt32 nWindow = 0; nWindow < pPageView->PageWindowCount(); nWindow++)
- {
- // const SdrPageViewWinRec& rPageViewWinRec = rPageViewWinList[b];
- const SdrPageWindow& rPageWindow = *pPageView->GetPageWindow(nWindow);
+ basegfx::B2DPolyPolygon aVisible;
+ basegfx::B2DPolyPolygon aInvisible;
- if(rPageWindow.GetPaintWindow().OutputToWindow())
+ // get visible and invisible parts
+ getPolyPolygon(aVisible, aInvisible, 0);
+
+ if(aVisible.count() || aInvisible.count())
+ {
+ for(sal_uInt32 nWindow = 0; nWindow < pPageView->PageWindowCount(); nWindow++)
{
- if(rPageWindow.GetOverlayManager())
- {
- ::sdr::overlay::OverlayObject* pOverlayObject =
- new OverlayTableEdge( GetPolyPolygon(true) );
+ const SdrPageWindow& rPageWindow = *pPageView->GetPageWindow(nWindow);
- rPageWindow.GetOverlayManager()->add(*pOverlayObject);
- maOverlayGroup.append(*pOverlayObject);
+ if(rPageWindow.GetPaintWindow().OutputToWindow())
+ {
+ if(rPageWindow.GetOverlayManager())
+ {
+ if(aVisible.count())
+ {
+ // create overlay object for visible parts
+ sdr::overlay::OverlayObject* pOverlayObject = new OverlayTableEdge(aVisible, true);
+ rPageWindow.GetOverlayManager()->add(*pOverlayObject);
+ maOverlayGroup.append(*pOverlayObject);
+ }
+
+ if(aInvisible.count())
+ {
+ // also create overlay object vor invisible parts to allow
+ // a standard HitTest using the primitives from that overlay object
+ // (see OverlayTableEdge implementation)
+ sdr::overlay::OverlayObject* pOverlayObject = new OverlayTableEdge(aInvisible, false);
+ rPageWindow.GetOverlayManager()->add(*pOverlayObject);
+ maOverlayGroup.append(*pOverlayObject);
+ }
+ }
}
}
}
@@ -237,9 +214,10 @@ void TableEdgeHdl::CreateB2dIAObject()
//////////////////////////////////////////////////////////////////////////////
-OverlayTableEdge::OverlayTableEdge( const basegfx::B2DPolyPolygon& rPolyPolygon )
+OverlayTableEdge::OverlayTableEdge( const basegfx::B2DPolyPolygon& rPolyPolygon, bool bVisible )
: OverlayObject(Color(COL_GRAY))
, maPolyPolygon( rPolyPolygon )
+, mbVisible(bVisible)
{
}
@@ -247,47 +225,35 @@ OverlayTableEdge::~OverlayTableEdge()
{
}
-void OverlayTableEdge::drawGeometry(OutputDevice& rOutputDevice)
+drawinglayer::primitive2d::Primitive2DSequence OverlayTableEdge::createOverlayObjectPrimitive2DSequence()
{
- rOutputDevice.SetLineColor(getBaseColor());
- rOutputDevice.SetFillColor();
+ drawinglayer::primitive2d::Primitive2DSequence aRetval;
- for(sal_uInt32 a(0L); a < maPolyPolygon.count();a ++)
+ if(maPolyPolygon.count())
{
-/*
- const basegfx::B2DPolygon aPolygon = maPolyPolygon.getB2DPolygon(a);
- const basegfx::B2DPoint aStart(aPolygon.getB2DPoint(0L));
- const basegfx::B2DPoint aEnd(aPolygon.getB2DPoint(aPolygon.count() - 1L));
- const Point aStartPoint(FRound(aStart.getX()), FRound(aStart.getY()));
- const Point aEndPoint(FRound(aEnd.getX()), FRound(aEnd.getY()));
- rOutputDevice.DrawLine(aStartPoint, aEndPoint);
-*/
- PolyPolygon aPolyPolygon( maPolyPolygon );
- rOutputDevice.DrawTransparent( aPolyPolygon, 50 );
- }
-}
-
-void OverlayTableEdge::transform(const basegfx::B2DHomMatrix& rMatrix)
-{
- maPolyPolygon.transform( rMatrix );
-}
-
-void OverlayTableEdge::createBaseRange(OutputDevice& /*rOutputDevice*/)
-{
- // reset range and expand it
- maBaseRange.reset();
-
- if(isHittable())
- {
- for(sal_uInt32 a(0L); a < maPolyPolygon.count();a ++)
+ // Discussed with CL. Currently i will leave the transparence out since this
+ // a little bit expensive. We may check the look with drag polygons later
+ const drawinglayer::primitive2d::Primitive2DReference aReference(
+ new drawinglayer::primitive2d::PolyPolygonHairlinePrimitive2D(
+ maPolyPolygon,
+ getBaseColor().getBColor()));
+
+ if(mbVisible)
+ {
+ // visible, just return as sequence
+ aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aReference, 1);
+ }
+ else
{
- const basegfx::B2DPolygon aPolygon = maPolyPolygon.getB2DPolygon(a);
- const basegfx::B2DPoint aStart(aPolygon.getB2DPoint(0L));
- const basegfx::B2DPoint aEnd(aPolygon.getB2DPoint(aPolygon.count() - 1L));
- maBaseRange.expand(aStart);
- maBaseRange.expand(aEnd);
+ // embed in HitTest primitive to support HitTest of this overlay object
+ const drawinglayer::primitive2d::Primitive2DSequence aSequence(&aReference, 1);
+ const drawinglayer::primitive2d::Primitive2DReference aNewReference(
+ new drawinglayer::primitive2d::HitTestPrimitive2D(aSequence));
+ aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aNewReference, 1);
}
}
+
+ return aRetval;
}
// ====================================================================
@@ -325,16 +291,15 @@ void TableBorderHdl::CreateB2dIAObject()
{
if(rPageWindow.GetOverlayManager())
{
- OutputDevice& rOutDev = rPageWindow.GetPaintWindow().GetOutputDevice();
-
- Size aBorderSize( rOutDev.PixelToLogic( Size( 6, 6 ) ) );
- basegfx::B2DRectangle aRect( vcl::unotools::b2DRectangleFromRectangle( maRectangle ) );
- basegfx::B2DPolyPolygon aPolyPolygon;
- aPolyPolygon.append(basegfx::tools::createPolygonFromRect( aRect ) );
- aRect.grow( aBorderSize.nA );
- aPolyPolygon.append(basegfx::tools::createPolygonFromRect( aRect ) );
-
- ::sdr::overlay::OverlayObject* pOverlayObject = new OverlayTableBorder( aPolyPolygon );
+ const basegfx::B2DRange aRange(vcl::unotools::b2DRectangleFromRectangle(maRectangle));
+ sdr::overlay::OverlayObject* pOverlayObject = new sdr::overlay::OverlayHatchRect(
+ aRange.getMinimum(),
+ aRange.getMaximum(),
+ Color(0x80, 0x80, 0x80),
+ 6.0,
+ 0.0,
+ 45 * F_PI180,
+ 0.0);
rPageWindow.GetOverlayManager()->add(*pOverlayObject);
maOverlayGroup.append(*pOverlayObject);
@@ -345,55 +310,7 @@ void TableBorderHdl::CreateB2dIAObject()
}
}
-OverlayTableBorder::OverlayTableBorder( const basegfx::B2DPolyPolygon& rPolyPolygon )
-: OverlayObject(Color(COL_GRAY))
-, maPolyPolygon( rPolyPolygon )
-{
-}
-
-OverlayTableBorder::~OverlayTableBorder()
-{
-}
-
-// Hittest with logical coordinates
-sal_Bool OverlayTableBorder::isHit(const basegfx::B2DPoint& rPos, double /*fTol = 0.0*/) const
-{
- if(isHittable())
- {
- if( basegfx::tools::isInside( maPolyPolygon.getB2DPolygon(1), rPos, true ) )
- if( !basegfx::tools::isInside( maPolyPolygon.getB2DPolygon(0), rPos, false ) )
- return sal_True;
- }
- return sal_False;
-}
-
-// Draw geometry
-void OverlayTableBorder::drawGeometry(OutputDevice& rOutputDevice)
-{
- svtools::ColorConfig aColorConfig;
- Color aHatchCol( aColorConfig.GetColorValue( svtools::FONTCOLOR ).nColor );
- const Hatch aHatch( HATCH_SINGLE, aHatchCol, 3, 450 );
- PolyPolygon aPolyPolygon( maPolyPolygon );
- rOutputDevice.DrawHatch( aPolyPolygon, aHatch );
-}
-
-// Create the BaseRange. This method needs to calculate maBaseRange.
-void OverlayTableBorder::createBaseRange(OutputDevice& /*rOutputDevice*/)
-{
- if(isHittable())
- {
- maBaseRange = basegfx::tools::getRange(maPolyPolygon);
- }
- else
- {
- maBaseRange.reset();
- }
-}
-
-void OverlayTableBorder::transform(const basegfx::B2DHomMatrix& rMatrix)
-{
- maPolyPolygon.transform( rMatrix );
-}
+//////////////////////////////////////////////////////////////////////////////
} // end of namespace table
} // end of namespace sdr
diff --git a/svx/source/table/tablehandles.hxx b/svx/source/table/tablehandles.hxx
index 9ce6e60f63..e1a9095118 100644
--- a/svx/source/table/tablehandles.hxx
+++ b/svx/source/table/tablehandles.hxx
@@ -57,8 +57,6 @@ class TableEdgeHdl : public SdrHdl
public:
TableEdgeHdl( const Point& rPnt, bool bHorizontal, sal_Int32 nMin, sal_Int32 nMax, sal_Int32 nEdges );
- virtual bool IsHdlHit(const Point& rPnt) const;
-
sal_Int32 GetValidDragOffset( const SdrDragStat& rDrag ) const;
virtual Pointer GetPointer() const;
@@ -68,7 +66,7 @@ public:
bool IsHorizontalEdge() const { return mbHorizontal; }
basegfx::B2DPolyPolygon getSpecialDragPoly(const SdrDragStat& rDrag) const;
- basegfx::B2DPolyPolygon GetPolyPolygon( bool bOnlyVisible, const SdrDragStat* pDrag = 0 ) const;
+ void getPolyPolygon(basegfx::B2DPolyPolygon& rVisible, basegfx::B2DPolyPolygon& rInvisible, const SdrDragStat* pDrag) const;
protected:
// create marker for this kind
@@ -77,7 +75,6 @@ protected:
private:
bool mbHorizontal;
sal_Int32 mnMin, mnMax;
- basegfx::B2DPolyPolygon maVisiblePolygon;
TableEdgeVector maEdges;
};
diff --git a/svx/source/table/tablelayouter.cxx b/svx/source/table/tablelayouter.cxx
index 00402e9f75..9818f0ad39 100644
--- a/svx/source/table/tablelayouter.cxx
+++ b/svx/source/table/tablelayouter.cxx
@@ -118,6 +118,7 @@ basegfx::B2ITuple TableLayouter::getCellSize( const CellPos& rPos ) const
width += maColumns[aPos.mnCol++].mnSize;
nColSpan--;
+ nColSpan--;
}
}
}
@@ -128,6 +129,7 @@ basegfx::B2ITuple TableLayouter::getCellSize( const CellPos& rPos ) const
return basegfx::B2ITuple( width, height );
}
+
// -----------------------------------------------------------------------------
bool TableLayouter::getCellArea( const CellPos& rPos, basegfx::B2IRectangle& rArea ) const
diff --git a/svx/source/table/viewcontactoftableobj.cxx b/svx/source/table/viewcontactoftableobj.cxx
index 0af6d2f2be..ffc23078b1 100644
--- a/svx/source/table/viewcontactoftableobj.cxx
+++ b/svx/source/table/viewcontactoftableobj.cxx
@@ -599,7 +599,30 @@ namespace sdr
const SfxItemSet& rCellItemSet = xCurrentCell->GetItemSet();
const sal_uInt32 nTextIndex(nColCount * aCellPos.mnRow + aCellPos.mnCol);
const SdrText* pSdrText = rTableObj.getText(nTextIndex);
- drawinglayer::attribute::SdrFillTextAttribute* pAttribute = drawinglayer::primitive2d::createNewSdrFillTextAttribute(rCellItemSet, pSdrText);
+ drawinglayer::attribute::SdrFillTextAttribute* pAttribute = 0;
+
+ if(pSdrText)
+ {
+ // #i101508# take cell's local text frame distances into account
+ const sal_Int32 nLeft(xCurrentCell->GetTextLeftDistance());
+ const sal_Int32 nRight(xCurrentCell->GetTextRightDistance());
+ const sal_Int32 nUpper(xCurrentCell->GetTextUpperDistance());
+ const sal_Int32 nLower(xCurrentCell->GetTextLowerDistance());
+
+ pAttribute = drawinglayer::primitive2d::createNewSdrFillTextAttribute(
+ rCellItemSet,
+ pSdrText,
+ &nLeft,
+ &nUpper,
+ &nRight,
+ &nLower);
+ }
+ else
+ {
+ pAttribute = drawinglayer::primitive2d::createNewSdrFillTextAttribute(
+ rCellItemSet,
+ pSdrText);
+ }
if(pAttribute)
{
@@ -664,17 +687,7 @@ namespace sdr
if(pNewShadowAttribute)
{
- // attention: shadow is added BEFORE object stuff to render it BEHIND object (!)
- const drawinglayer::primitive2d::Primitive2DReference xShadow(drawinglayer::primitive2d::createShadowPrimitive(xRetval, *pNewShadowAttribute));
-
- if(xShadow.is())
- {
- drawinglayer::primitive2d::Primitive2DSequence xContentWithShadow(2);
- xContentWithShadow[0] = xShadow;
- xContentWithShadow[1] = drawinglayer::primitive2d::Primitive2DReference(new drawinglayer::primitive2d::GroupPrimitive2D(xRetval));
- xRetval = xContentWithShadow;
- }
-
+ xRetval = drawinglayer::primitive2d::createEmbeddedShadowPrimitive(xRetval, *pNewShadowAttribute);
delete pNewShadowAttribute;
}
}
diff --git a/svx/source/tbxctrls/makefile.mk b/svx/source/tbxctrls/makefile.mk
index 02bbd865d4..9bca3b9798 100644
--- a/svx/source/tbxctrls/makefile.mk
+++ b/svx/source/tbxctrls/makefile.mk
@@ -33,6 +33,7 @@ PRJ=..$/..
PRJNAME=svx
TARGET=tbxctrls
+LIBTARGET=NO
ENABLE_EXCEPTIONS=TRUE
# --- Settings -----------------------------------------------------
@@ -42,10 +43,17 @@ ENABLE_EXCEPTIONS=TRUE
# --- Files --------------------------------------------------------
-SLOFILES= \
- $(SLO)$/formatpaintbrushctrl.obj\
+LIB1TARGET= $(SLB)$/$(TARGET)-core.lib
+LIB1OBJFILES= \
$(SLO)$/fontworkgallery.obj\
$(SLO)$/extrusioncontrols.obj \
+ $(SLO)$/tbcontrl.obj \
+ $(SLO)$/toolbarmenu.obj \
+ $(SLO)$/tbxcolorupdate.obj
+
+LIB2TARGET= $(SLB)$/$(TARGET).lib
+LIB2OBJFILES= \
+ $(SLO)$/formatpaintbrushctrl.obj\
$(SLO)$/colrctrl.obj \
$(SLO)$/fillctrl.obj \
$(SLO)$/grafctrl.obj \
@@ -53,16 +61,15 @@ SLOFILES= \
$(SLO)$/layctrl.obj \
$(SLO)$/lboxctrl.obj \
$(SLO)$/linectrl.obj \
- $(SLO)$/tbcontrl.obj \
$(SLO)$/tbxalign.obj \
$(SLO)$/tbxdrctl.obj \
$(SLO)$/verttexttbxctrl.obj \
- $(SLO)$/toolbarmenu.obj \
$(SLO)$/subtoolboxcontrol.obj \
$(SLO)$/tbxcolor.obj \
- $(SLO)$/tbxcolorupdate.obj \
$(SLO)$/tbunocontroller.obj
+SLOFILES = $(LIB1OBJFILES) $(LIB2OBJFILES)
+
SRS1NAME=$(TARGET)
SRC1FILES = \
fontworkgallery.src \
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 1d0b4c155c..94494aa3aa 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -292,6 +292,7 @@ class SvxLineWindow_Impl : public SfxPopupWindow
{
private:
ValueSet aLineSet;
+ bool m_bIsWriter;
#if _SOLAR__PRIVATE
void MakeLineBitmap( USHORT nNo, Bitmap& rBmp, const Size& rSize, String& rStr,
@@ -1335,6 +1336,14 @@ SvxLineWindow_Impl::SvxLineWindow_Impl( USHORT nId, const Reference< XFrame >& r
aLineSet( this, WinBits( WB_3DLOOK | WB_ITEMBORDER | WB_DOUBLEBORDER | WB_NAMEFIELD | WB_NONEFIELD | WB_NO_DIRECTSELECT ) )
{
+ try
+ {
+ Reference< lang::XServiceInfo > xServices( rFrame->getController()->getModel(), UNO_QUERY_THROW );
+ m_bIsWriter = xServices->supportsService(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextDocument")));
+ }
+ catch(const uno::Exception& )
+ {
+ }
Size aBmpSize( 55, 12 );
CreateBitmaps();
@@ -1598,7 +1607,7 @@ IMPL_LINK( SvxLineWindow_Impl, SelectHdl, void *, EMPTYARG )
Any a;
Sequence< PropertyValue > aArgs( 1 );
aArgs[0].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "LineStyle" ));
- aLineItem.QueryValue( a );
+ aLineItem.QueryValue( a, m_bIsWriter ? CONVERT_TWIPS : 0 );
aArgs[0].Value = a;
/* #i33380# DR 2004-09-03 Moved the following line above the Dispatch() call.
@@ -2631,7 +2640,6 @@ SfxPopupWindowType SvxFrameLineStyleToolBoxControl::GetPopupWindowType() const
SfxPopupWindow* SvxFrameLineStyleToolBoxControl::CreatePopupWindow()
{
SvxLineWindow_Impl* pLineWin = new SvxLineWindow_Impl( GetSlotId(), m_xFrame, &GetToolBox() );
-
pLineWin->StartPopupMode( &GetToolBox(), TRUE );
pLineWin->StartSelection();
SetPopupWindow( pLineWin );
diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.src b/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.src
index 9bd251bcb4..dcc74b99e7 100644
--- a/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.src
+++ b/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.src
@@ -40,7 +40,7 @@
#define FULL_WIDTH (220)
#define FULL_HEIGHT (120)
-#define EDITBUTTON_WIDTH (70)
+#define EDITBUTTON_WIDTH (75)
#define COL_1 (RSC_SP_DLG_INNERBORDER_LEFT)
#define COL_2 (COL_1+RSC_SP_FLGR_SPACE_X)
diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx
index 2dcd3c1a89..691d23ab43 100644
--- a/svx/source/unodraw/UnoGraphicExporter.cxx
+++ b/svx/source/unodraw/UnoGraphicExporter.cxx
@@ -104,6 +104,9 @@ using namespace ::com::sun::star::task;
#include <svx/sdr/contact/viewobjectcontact.hxx>
#include <svx/sdr/contact/viewcontact.hxx>
+// #i102251#
+#include <editstat.hxx>
+
//////////////////////////////////////////////////////////////////////////////
namespace svx
@@ -198,13 +201,13 @@ namespace svx
SdrModel* mpDoc;
};
- Reference< XInterface > SAL_CALL GraphicExporter_createInstance(const Reference< XMultiServiceFactory > & )
+ SVX_DLLPUBLIC Reference< XInterface > SAL_CALL GraphicExporter_createInstance(const Reference< XMultiServiceFactory > & )
throw( Exception )
{
return (XWeak*)new GraphicExporter();
}
- Sequence< OUString > SAL_CALL GraphicExporter_getSupportedServiceNames()
+ SVX_DLLPUBLIC Sequence< OUString > SAL_CALL GraphicExporter_getSupportedServiceNames()
throw()
{
Sequence< OUString > aSupportedServiceNames( 1 );
@@ -212,7 +215,7 @@ namespace svx
return aSupportedServiceNames;
}
- OUString SAL_CALL GraphicExporter_getImplementationName()
+ SVX_DLLPUBLIC OUString SAL_CALL GraphicExporter_getImplementationName()
throw()
{
return OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Draw.GraphicExporter" ) );
@@ -225,16 +228,27 @@ namespace svx
Graphic aGraphic( rMtf );
BitmapEx aBmpEx;
+ // #i102089# support user's settings of AA and LineSnap when the MetaFile gets
+ // rasterconverted to a bitmap
+ const SvtOptionsDrawinglayer aDrawinglayerOpt;
+ const GraphicConversionParameters aParameters(
+ pSize ? *pSize : Size(0, 0),
+ true, // allow unlimited size
+ aDrawinglayerOpt.IsAntiAliasing(),
+ aDrawinglayerOpt.IsSnapHorVerLinesToDiscrete());
+
if( bTransparent )
{
- Graphic aMaskGraphic( rMtf.GetMonochromeMtf( COL_BLACK ) );
- Bitmap aMaskBmp( aMaskGraphic.GetUnlimitedBitmap( pSize ) );
+ Graphic aMaskGraphic(rMtf.GetMonochromeMtf(COL_BLACK));
+ Bitmap aMaskBmp(aMaskGraphic.GetBitmap(aParameters));
- aMaskBmp.Convert( BMP_CONVERSION_1BIT_THRESHOLD );
- aBmpEx = BitmapEx( aGraphic.GetUnlimitedBitmap( pSize ), aMaskBmp );
+ aMaskBmp.Convert(BMP_CONVERSION_1BIT_THRESHOLD);
+ aBmpEx = BitmapEx(aGraphic.GetBitmap(aParameters), aMaskBmp);
}
else
- aBmpEx = BitmapEx( aGraphic.GetUnlimitedBitmap( pSize ) );
+ {
+ aBmpEx = BitmapEx(aGraphic.GetBitmap(aParameters));
+ }
aBmpEx.SetPrefMapMode( rMtf.GetPrefMapMode() );
aBmpEx.SetPrefSize( rMtf.GetPrefSize() );
@@ -625,8 +639,12 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic,
rOutl.SetCalcFieldValueHdl( LINK(this, GraphicExporter, CalcFieldValueHdl) );
rOutl.SetBackgroundColor( pPage->GetPageBackgroundColor(pView->GetSdrPageView()) );
+ // #i102251#
+ const sal_uInt32 nOldCntrl(rOutl.GetControlWord());
+ sal_uInt32 nCntrl = nOldCntrl & ~EE_CNTRL_ONLINESPELLING;
+ rOutl.SetControlWord(nCntrl);
+
std::vector< SdrObject* > aShapes;
-
bool bRet = true;
// export complete page?
@@ -977,6 +995,9 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic,
rOutl.SetCalcFieldValueHdl( maOldCalcFieldValueHdl );
+ // #i102251#
+ rOutl.SetControlWord(nOldCntrl);
+
return bRet;
}
diff --git a/svx/source/unodraw/UnoGraphicExporter.hxx b/svx/source/unodraw/UnoGraphicExporter.hxx
index 1c83eff327..5a755af937 100644
--- a/svx/source/unodraw/UnoGraphicExporter.hxx
+++ b/svx/source/unodraw/UnoGraphicExporter.hxx
@@ -35,9 +35,9 @@
namespace svx
{
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL GraphicExporter_createInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr) throw( ::com::sun::star::uno::Exception );
- ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL GraphicExporter_getSupportedServiceNames() throw();
- ::rtl::OUString SAL_CALL GraphicExporter_getImplementationName() throw();
+ SVX_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL GraphicExporter_createInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr) throw( ::com::sun::star::uno::Exception );
+ SVX_DLLPUBLIC ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL GraphicExporter_getSupportedServiceNames() throw();
+ SVX_DLLPUBLIC ::rtl::OUString SAL_CALL GraphicExporter_getImplementationName() throw();
}
#endif
diff --git a/svx/source/unodraw/gluepts.cxx b/svx/source/unodraw/gluepts.cxx
index d511dbea25..ca41fa9fe5 100644
--- a/svx/source/unodraw/gluepts.cxx
+++ b/svx/source/unodraw/gluepts.cxx
@@ -49,19 +49,15 @@ using namespace ::cppu;
const USHORT NON_USER_DEFINED_GLUE_POINTS = 4;
-class SvxUnoGluePointAccess : public WeakImplHelper2< container::XIndexContainer, container::XIdentifierContainer >,
- public SfxListener
+class SvxUnoGluePointAccess : public WeakImplHelper2< container::XIndexContainer, container::XIdentifierContainer >
{
private:
- SdrObject* mpObject;
+ SdrObjectWeakRef mpObject;
public:
SvxUnoGluePointAccess( SdrObject* pObject ) throw();
virtual ~SvxUnoGluePointAccess() throw();
- // SfxListener
- virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) throw ();
-
// XIdentifierContainer
virtual sal_Int32 SAL_CALL insert( const uno::Any& aElement ) throw (lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException);
virtual void SAL_CALL removeByIdentifier( sal_Int32 Identifier ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException);
@@ -223,52 +219,16 @@ static void convert( const drawing::GluePoint2& rUnoGlue, SdrGluePoint& rSdrGlue
SvxUnoGluePointAccess::SvxUnoGluePointAccess( SdrObject* pObject ) throw()
: mpObject( pObject )
{
- StartListening( *mpObject->GetModel() );
-
}
SvxUnoGluePointAccess::~SvxUnoGluePointAccess() throw()
{
- if( mpObject && mpObject->GetModel())
- EndListening( *mpObject->GetModel() );
-}
-
-void SvxUnoGluePointAccess::Notify( SfxBroadcaster&, const SfxHint& rHint ) throw()
-{
- const SdrHint* pSdrHint = PTR_CAST( SdrHint, &rHint );
-
- if( pSdrHint && mpObject)
- {
- if( pSdrHint->GetKind() == HINT_OBJREMOVED )
- {
- if( mpObject == pSdrHint->GetObject() )
- mpObject = NULL;
- }
- else if( pSdrHint->GetKind() == HINT_MODELCLEARED )
- {
- mpObject = NULL;
- }
- // #110094#-9
- //else if( pSdrHint->GetKind() == HINT_OBJLISTCLEAR )
- //{
- // SdrObjList* pObjList = mpObject ? mpObject->GetObjList() : NULL;
- // while( pObjList )
- // {
- // if( pSdrHint->GetObjList() == pObjList )
- // {
- // mpObject = NULL;
- // break;
- // }
- // pObjList = pObjList->GetUpList();
- // }
- //}
- }
}
// XIdentifierContainer
sal_Int32 SAL_CALL SvxUnoGluePointAccess::insert( const uno::Any& aElement ) throw (lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
{
- if( mpObject )
+ if( mpObject.is() )
{
SdrGluePointList* pList = mpObject->ForceGluePointList();
if( pList )
@@ -298,7 +258,7 @@ sal_Int32 SAL_CALL SvxUnoGluePointAccess::insert( const uno::Any& aElement ) thr
void SAL_CALL SvxUnoGluePointAccess::removeByIdentifier( sal_Int32 Identifier ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
{
- if( mpObject && ( Identifier >= NON_USER_DEFINED_GLUE_POINTS ))
+ if( mpObject.is() && ( Identifier >= NON_USER_DEFINED_GLUE_POINTS ))
{
const USHORT nId = (USHORT)(Identifier - NON_USER_DEFINED_GLUE_POINTS) + 1;
@@ -327,7 +287,7 @@ void SAL_CALL SvxUnoGluePointAccess::removeByIdentifier( sal_Int32 Identifier )
// XIdentifierReplace
void SAL_CALL SvxUnoGluePointAccess::replaceByIdentifer( sal_Int32 Identifier, const uno::Any& aElement ) throw (lang::IllegalArgumentException, container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
{
- if( mpObject && mpObject->IsNode() )
+ if( mpObject.is() && mpObject->IsNode() )
{
struct drawing::GluePoint2 aGluePoint;
if( (Identifier < NON_USER_DEFINED_GLUE_POINTS) || !(aElement >>= aGluePoint))
@@ -361,7 +321,7 @@ void SAL_CALL SvxUnoGluePointAccess::replaceByIdentifer( sal_Int32 Identifier, c
// XIdentifierAccess
uno::Any SAL_CALL SvxUnoGluePointAccess::getByIdentifier( sal_Int32 Identifier ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
{
- if( mpObject && mpObject->IsNode() )
+ if( mpObject.is() && mpObject->IsNode() )
{
struct drawing::GluePoint2 aGluePoint;
@@ -401,21 +361,29 @@ uno::Any SAL_CALL SvxUnoGluePointAccess::getByIdentifier( sal_Int32 Identifier )
uno::Sequence< sal_Int32 > SAL_CALL SvxUnoGluePointAccess::getIdentifiers() throw (uno::RuntimeException)
{
- const SdrGluePointList* pList = mpObject->GetGluePointList();
- const USHORT nCount = pList ? pList->GetCount() : 0;
+ if( mpObject.is() )
+ {
+ const SdrGluePointList* pList = mpObject->GetGluePointList();
+ const USHORT nCount = pList ? pList->GetCount() : 0;
- USHORT i;
+ USHORT i;
- uno::Sequence< sal_Int32 > aIdSequence( nCount + NON_USER_DEFINED_GLUE_POINTS );
- sal_Int32 *pIdentifier = aIdSequence.getArray();
-
- for( i = 0; i < NON_USER_DEFINED_GLUE_POINTS; i++ )
- *pIdentifier++ = (sal_Int32)i;
+ uno::Sequence< sal_Int32 > aIdSequence( nCount + NON_USER_DEFINED_GLUE_POINTS );
+ sal_Int32 *pIdentifier = aIdSequence.getArray();
+
+ for( i = 0; i < NON_USER_DEFINED_GLUE_POINTS; i++ )
+ *pIdentifier++ = (sal_Int32)i;
- for( i = 0; i < nCount; i++ )
- *pIdentifier++ = (sal_Int32) ( (*pList)[i].GetId() + NON_USER_DEFINED_GLUE_POINTS ) - 1;
+ for( i = 0; i < nCount; i++ )
+ *pIdentifier++ = (sal_Int32) ( (*pList)[i].GetId() + NON_USER_DEFINED_GLUE_POINTS ) - 1;
- return aIdSequence;
+ return aIdSequence;
+ }
+ else
+ {
+ uno::Sequence< sal_Int32 > aEmpty;
+ return aEmpty;
+ }
}
/* deprecated */
@@ -425,7 +393,7 @@ void SAL_CALL SvxUnoGluePointAccess::insertByIndex( sal_Int32, const uno::Any& E
throw(lang::IllegalArgumentException, lang::IndexOutOfBoundsException,
lang::WrappedTargetException, uno::RuntimeException)
{
- if( mpObject )
+ if( mpObject.is() )
{
SdrGluePointList* pList = mpObject->ForceGluePointList();
if( pList )
@@ -455,7 +423,7 @@ void SAL_CALL SvxUnoGluePointAccess::insertByIndex( sal_Int32, const uno::Any& E
void SAL_CALL SvxUnoGluePointAccess::removeByIndex( sal_Int32 Index )
throw(lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
{
- if( mpObject )
+ if( mpObject.is() )
{
SdrGluePointList* pList = mpObject->ForceGluePointList();
if( pList )
@@ -487,7 +455,7 @@ void SAL_CALL SvxUnoGluePointAccess::replaceByIndex( sal_Int32 Index, const uno:
throw lang::IllegalArgumentException();
Index -= 4;
- if( mpObject && Index >= 0 )
+ if( mpObject.is() && Index >= 0 )
{
SdrGluePointList* pList = const_cast< SdrGluePointList* >( mpObject->GetGluePointList() );
if( pList && Index < pList->GetCount() )
@@ -509,7 +477,7 @@ sal_Int32 SAL_CALL SvxUnoGluePointAccess::getCount()
throw(uno::RuntimeException)
{
sal_Int32 nCount = 0;
- if( mpObject )
+ if( mpObject.is() )
{
// each node has a default of 4 glue points
// and any number of user defined glue points
@@ -529,7 +497,7 @@ sal_Int32 SAL_CALL SvxUnoGluePointAccess::getCount()
uno::Any SAL_CALL SvxUnoGluePointAccess::getByIndex( sal_Int32 Index )
throw(lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
{
- if( Index >= 0 && mpObject && mpObject->IsNode() )
+ if( Index >= 0 && mpObject.is() && mpObject->IsNode() )
{
struct drawing::GluePoint2 aGluePoint;
@@ -571,7 +539,7 @@ uno::Type SAL_CALL SvxUnoGluePointAccess::getElementType()
sal_Bool SAL_CALL SvxUnoGluePointAccess::hasElements()
throw( uno::RuntimeException)
{
- return mpObject && mpObject->IsNode();
+ return mpObject.is() && mpObject->IsNode();
}
/**
diff --git a/svx/source/unodraw/makefile.mk b/svx/source/unodraw/makefile.mk
index 9b71d644f3..4b8ecb093d 100644
--- a/svx/source/unodraw/makefile.mk
+++ b/svx/source/unodraw/makefile.mk
@@ -33,6 +33,7 @@ PRJ=..$/..
PRJNAME=svx
TARGET=unodraw
+LIBTARGET=NO
ENABLE_EXCEPTIONS=TRUE
# --- Settings -----------------------------------------------------
@@ -42,21 +43,18 @@ ENABLE_EXCEPTIONS=TRUE
# --- Files --------------------------------------------------------
-SLOFILES = \
- $(SLO)$/UnoNamespaceMap.obj \
+LIB1TARGET= $(SLB)$/$(TARGET)-core.lib
+LIB1OBJFILES= \
$(SLO)$/UnoGraphicExporter.obj \
- $(SLO)$/unopool.obj \
$(SLO)$/XPropertyTable.obj \
$(SLO)$/UnoNameItemTable.obj \
$(SLO)$/unoshape.obj \
$(SLO)$/unoipset.obj \
- $(SLO)$/unoctabl.obj \
$(SLO)$/unoshap2.obj \
$(SLO)$/unoshap3.obj \
$(SLO)$/unoshap4.obj \
$(SLO)$/unopage.obj \
$(SLO)$/unoshtxt.obj \
- $(SLO)$/unoshcol.obj \
$(SLO)$/unoprov.obj \
$(SLO)$/unomod.obj \
$(SLO)$/unonrule.obj \
@@ -69,10 +67,19 @@ SLOFILES = \
$(SLO)$/unomtabl.obj \
$(SLO)$/unodtabl.obj \
$(SLO)$/gluepts.obj \
- $(SLO)$/recoveryui.obj \
$(SLO)$/tableshape.obj \
$(SLO)$/shapepropertynotifier.obj
+LIB2TARGET= $(SLB)$/$(TARGET).lib
+LIB2OBJFILES= \
+ $(SLO)$/UnoNamespaceMap.obj \
+ $(SLO)$/unopool.obj \
+ $(SLO)$/unoctabl.obj \
+ $(SLO)$/unoshcol.obj \
+ $(SLO)$/recoveryui.obj
+
+SLOFILES = $(LIB1OBJFILES) $(LIB2OBJFILES)
+
SRS1NAME=unodraw
SRC1FILES = \
unodraw.src
diff --git a/svx/source/unodraw/unomod.cxx b/svx/source/unodraw/unomod.cxx
index 3d455fbec2..9b3a4ec7df 100644
--- a/svx/source/unodraw/unomod.cxx
+++ b/svx/source/unodraw/unomod.cxx
@@ -215,9 +215,14 @@ uno::Reference< uno::XInterface > SAL_CALL SvxUnoDrawMSFactory::createTextField(
{
uno::Reference< uno::XInterface > xRet;
- const OUString aTextFieldPrexit( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextField.") );
-
- if( ServiceSpecifier.compareTo( aTextFieldPrexit, aTextFieldPrexit.getLength() ) == 0 )
+ const OUString aTextFieldPrexit( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.textfield.") );
+
+ // #i93308# up to OOo 3.2 we used this wrong namespace name with the capital T & F. This is
+ // fixed since OOo 3.2 but for compatibility we will still provide support for the wrong notation.
+ const OUString aTextFieldPrexit2( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextField.") );
+
+ if( (ServiceSpecifier.compareTo( aTextFieldPrexit, aTextFieldPrexit.getLength() ) == 0) ||
+ (ServiceSpecifier.compareTo( aTextFieldPrexit2, aTextFieldPrexit2.getLength() ) == 0) )
{
OUString aFieldType( ServiceSpecifier.copy( aTextFieldPrexit.getLength() ) );
diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx
index 1f5a375d9c..1d3b94ebe9 100644
--- a/svx/source/unodraw/unoshap2.cxx
+++ b/svx/source/unodraw/unoshap2.cxx
@@ -65,6 +65,7 @@
#include "shapeimpl.hxx"
#include "svx/unoshprp.hxx"
#include <svx/svdoashp.hxx>
+#include "unopolyhelper.hxx"
// #i29181#
#include "svdviter.hxx"
@@ -1833,7 +1834,7 @@ bool SvxGraphicObject::getPropertyValueImpl( const ::rtl::OUString& rName, const
}
else
{
- const GraphicObject& rGrafObj = static_cast< SdrGrafObj*>( mpObj.get() )->GetGraphicObject();
+ const GraphicObject& rGrafObj = static_cast< SdrGrafObj*>( mpObj.get() )->GetGraphicObject(true);
OUString aURL( RTL_CONSTASCII_USTRINGPARAM(UNO_NAME_GRAPHOBJ_URLPREFIX));
aURL += OUString::createFromAscii( rGrafObj.GetUniqueID().GetBuffer() );
rValue <<= aURL;
diff --git a/svx/source/unodraw/unoshap3.cxx b/svx/source/unodraw/unoshap3.cxx
index 79a28a9804..cb59ca37e4 100644
--- a/svx/source/unodraw/unoshap3.cxx
+++ b/svx/source/unodraw/unoshap3.cxx
@@ -760,7 +760,10 @@ Svx3DLatheObject::~Svx3DLatheObject() throw()
{
}
-static bool PolyPolygonShape3D_to_B3dPolyPolygon( const Any& rValue, basegfx::B3DPolyPolygon& rResultPolygon )
+bool PolyPolygonShape3D_to_B3dPolyPolygon(
+ const Any& rValue,
+ basegfx::B3DPolyPolygon& rResultPolygon,
+ bool bCorrectPolygon)
{
drawing::PolyPolygonShape3D aSourcePolyPolygon;
if( !(rValue >>= aSourcePolyPolygon) )
@@ -791,7 +794,14 @@ static bool PolyPolygonShape3D_to_B3dPolyPolygon( const Any& rValue, basegfx::B3
pInnerSequenceX++;
pInnerSequenceY++;
pInnerSequenceZ++;
- basegfx::tools::checkClosed(aNewPolygon);
+
+ // #i101520# correction is needed for imported polygons of old format,
+ // see callers
+ if(bCorrectPolygon)
+ {
+ basegfx::tools::checkClosed(aNewPolygon);
+ }
+
rResultPolygon.append(aNewPolygon);
}
return true;
@@ -855,7 +865,9 @@ bool Svx3DLatheObject::setPropertyValueImpl( const ::rtl::OUString& rName, const
{
// Polygondefinition in das Objekt packen
basegfx::B3DPolyPolygon aNewB3DPolyPolygon;
- if( PolyPolygonShape3D_to_B3dPolyPolygon( rValue, aNewB3DPolyPolygon ) )
+
+ // #i101520# Probably imported
+ if( PolyPolygonShape3D_to_B3dPolyPolygon( rValue, aNewB3DPolyPolygon, true ) )
{
// #105127# SetPolyPoly3D sets the Svx3DVerticalSegmentsItem to the number
// of points of the polygon. Thus, value gets lost. To avoid this, rescue
@@ -973,7 +985,9 @@ bool Svx3DExtrudeObject::setPropertyValueImpl( const ::rtl::OUString& rName, con
{
// Polygondefinition in das Objekt packen
basegfx::B3DPolyPolygon aNewB3DPolyPolygon;
- if( PolyPolygonShape3D_to_B3dPolyPolygon( rValue, aNewB3DPolyPolygon ) )
+
+ // #i101520# Probably imported
+ if( PolyPolygonShape3D_to_B3dPolyPolygon( rValue, aNewB3DPolyPolygon, true ) )
{
// Polygon setzen
const basegfx::B3DHomMatrix aIdentity;
@@ -1082,7 +1096,9 @@ bool Svx3DPolygonObject::setPropertyValueImpl( const ::rtl::OUString& rName, con
{
// Polygondefinition in das Objekt packen
basegfx::B3DPolyPolygon aNewB3DPolyPolygon;
- if( PolyPolygonShape3D_to_B3dPolyPolygon( rValue, aNewB3DPolyPolygon ) )
+
+ // #i101520# Direct API data (e.g. from chart)
+ if( PolyPolygonShape3D_to_B3dPolyPolygon( rValue, aNewB3DPolyPolygon, false ) )
{
// Polygon setzen
static_cast<E3dPolygonObj*>(mpObj.get())->SetPolyPolygon3D(aNewB3DPolyPolygon);
@@ -1094,7 +1110,9 @@ bool Svx3DPolygonObject::setPropertyValueImpl( const ::rtl::OUString& rName, con
{
// Normalendefinition in das Objekt packen
basegfx::B3DPolyPolygon aNewB3DPolyPolygon;
- if( PolyPolygonShape3D_to_B3dPolyPolygon( rValue, aNewB3DPolyPolygon ) )
+
+ // #i101520# Direct API data (e.g. from chart)
+ if( PolyPolygonShape3D_to_B3dPolyPolygon( rValue, aNewB3DPolyPolygon, false ) )
{
// Polygon setzen
static_cast<E3dPolygonObj*>(mpObj.get())->SetPolyNormals3D(aNewB3DPolyPolygon);
@@ -1106,7 +1124,9 @@ bool Svx3DPolygonObject::setPropertyValueImpl( const ::rtl::OUString& rName, con
{
// Texturdefinition in das Objekt packen
basegfx::B3DPolyPolygon aNewB3DPolyPolygon;
- if( PolyPolygonShape3D_to_B3dPolyPolygon( rValue, aNewB3DPolyPolygon ) )
+
+ // #i101520# Direct API data (e.g. from chart)
+ if( PolyPolygonShape3D_to_B3dPolyPolygon( rValue, aNewB3DPolyPolygon, false ) )
{
// Polygon setzen
const basegfx::B3DHomMatrix aIdentity;
diff --git a/svx/source/unodraw/unoshtxt.cxx b/svx/source/unodraw/unoshtxt.cxx
index 465e911dda..75c4d7ab68 100644
--- a/svx/source/unodraw/unoshtxt.cxx
+++ b/svx/source/unodraw/unoshtxt.cxx
@@ -620,25 +620,29 @@ SvxTextForwarder* SvxTextEditSourceImpl::GetBackgroundTextForwarder()
mpTextForwarder->flushCache();
OutlinerParaObject* pOutlinerParaObject = NULL;
- bool bTextEditActive = false;
SdrTextObj* pTextObj = PTR_CAST( SdrTextObj, mpObject );
if( pTextObj && pTextObj->getActiveText() == mpText )
pOutlinerParaObject = pTextObj->GetEditOutlinerParaObject(); // Get the OutlinerParaObject if text edit is active
+ bool bOwnParaObj(false);
if( pOutlinerParaObject )
- bTextEditActive = true; // text edit active
+ bOwnParaObj = true; // text edit active
else
pOutlinerParaObject = mpText->GetOutlinerParaObject();
- if( pOutlinerParaObject && ( bTextEditActive || !mpObject->IsEmptyPresObj() || mpObject->GetPage()->IsMasterPage() ) )
+ if( pOutlinerParaObject && ( bOwnParaObj || !mpObject->IsEmptyPresObj() || mpObject->GetPage()->IsMasterPage() ) )
{
mpOutliner->SetText( *pOutlinerParaObject );
// #91254# put text to object and set EmptyPresObj to FALSE
- if( mpText && bTextEditActive && pOutlinerParaObject && mpObject->IsEmptyPresObj() && pTextObj->IsRealyEdited() )
+ if( mpText && bOwnParaObj && pOutlinerParaObject && mpObject->IsEmptyPresObj() && pTextObj->IsRealyEdited() )
{
mpObject->SetEmptyPresObj( FALSE );
static_cast< SdrTextObj* >( mpObject)->NbcSetOutlinerParaObjectForText( pOutlinerParaObject, mpText );
+
+ // #i103982# Here, due to mpObject->NbcSetOutlinerParaObjectForText, we LOSE ownership of the
+ // OPO, so do NOT delete it when leaving this method (!)
+ bOwnParaObj = false;
}
}
else
@@ -676,7 +680,7 @@ SvxTextForwarder* SvxTextEditSourceImpl::GetBackgroundTextForwarder()
mbDataValid = TRUE;
- if( bTextEditActive )
+ if( bOwnParaObj )
delete pOutlinerParaObject;
}
diff --git a/svx/source/unoedit/makefile.mk b/svx/source/unoedit/makefile.mk
index e808dbe027..802ded5aa7 100644
--- a/svx/source/unoedit/makefile.mk
+++ b/svx/source/unoedit/makefile.mk
@@ -33,6 +33,7 @@ PRJ=..$/..
PRJNAME=svx
TARGET=unoedit
+LIBTARGET=NO
ENABLE_EXCEPTIONS=TRUE
# --- Settings -----------------------------------------------------
@@ -42,13 +43,10 @@ ENABLE_EXCEPTIONS=TRUE
# --- Files --------------------------------------------------------
-SLOFILES = \
- $(SLO)$/UnoForbiddenCharsTable.obj \
+LIB1TARGET= $(SLB)$/$(TARGET)-core.lib
+LIB1OBJFILES= \
$(SLO)$/unoedsrc.obj \
$(SLO)$/unoedhlp.obj \
- $(SLO)$/unopracc.obj \
- $(SLO)$/unoedprx.obj \
- $(SLO)$/unoviwed.obj \
$(SLO)$/unoviwou.obj \
$(SLO)$/unofored.obj \
$(SLO)$/unoforou.obj \
@@ -56,6 +54,15 @@ SLOFILES = \
$(SLO)$/unotext2.obj \
$(SLO)$/unofield.obj
+LIB2TARGET= $(SLB)$/$(TARGET).lib
+LIB2OBJFILES= \
+ $(SLO)$/UnoForbiddenCharsTable.obj \
+ $(SLO)$/unopracc.obj \
+ $(SLO)$/unoedprx.obj \
+ $(SLO)$/unoviwed.obj
+
+SLOFILES = $(LIB1OBJFILES) $(LIB2OBJFILES)
+
# --- Tagets -------------------------------------------------------
.INCLUDE : target.mk
diff --git a/svx/source/unoedit/unoedprx.cxx b/svx/source/unoedit/unoedprx.cxx
index 06d8ce00e5..2b500aeac6 100644
--- a/svx/source/unoedit/unoedprx.cxx
+++ b/svx/source/unoedit/unoedprx.cxx
@@ -1044,6 +1044,16 @@ USHORT SvxAccessibleTextAdapter::GetLineLen( USHORT nPara, USHORT nLine ) const
return static_cast< USHORT >(aEndIndex.GetIndex());
}
+void SvxAccessibleTextAdapter::GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT nParagraph, USHORT nLine ) const
+{
+ mrTextForwarder->GetLineBoundaries( rStart, rEnd, nParagraph, nLine );
+}
+
+USHORT SvxAccessibleTextAdapter::GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const
+{
+ return mrTextForwarder->GetLineNumberAtIndex( nPara, nIndex );
+}
+
sal_Bool SvxAccessibleTextAdapter::Delete( const ESelection& rSel )
{
DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
@@ -1215,7 +1225,7 @@ Point SvxAccessibleTextEditViewAdapter::PixelToLogic( const Point& rPoint, const
return mrViewForwarder->PixelToLogic(rPoint, rMapMode);
}
-
+
sal_Bool SvxAccessibleTextEditViewAdapter::GetSelection( ESelection& rSel ) const
{
DBG_ASSERT(mrViewForwarder, "SvxAccessibleTextEditViewAdapter: no forwarder");
diff --git a/svx/source/unoedit/unofored.cxx b/svx/source/unoedit/unofored.cxx
index e6761cc6bb..20807d46ff 100644
--- a/svx/source/unoedit/unofored.cxx
+++ b/svx/source/unoedit/unofored.cxx
@@ -470,6 +470,17 @@ USHORT SvxEditEngineForwarder::GetLineLen( USHORT nPara, USHORT nLine ) const
{
return rEditEngine.GetLineLen(nPara, nLine);
}
+
+void SvxEditEngineForwarder::GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT nPara, USHORT nLine ) const
+{
+ rEditEngine.GetLineBoundaries(rStart, rEnd, nPara, nLine);
+}
+
+USHORT SvxEditEngineForwarder::GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const
+{
+ return rEditEngine.GetLineNumberAtIndex(nPara, nIndex);
+}
+
sal_Bool SvxEditEngineForwarder::QuickFormatDoc( BOOL )
{
diff --git a/svx/source/unoedit/unoforou.cxx b/svx/source/unoedit/unoforou.cxx
index 8e9aea00b2..94bcd342a8 100644
--- a/svx/source/unoedit/unoforou.cxx
+++ b/svx/source/unoedit/unoforou.cxx
@@ -429,6 +429,16 @@ USHORT SvxOutlinerForwarder::GetLineLen( USHORT nPara, USHORT nLine ) const
{
return rOutliner.GetLineLen(nPara, nLine);
}
+
+void SvxOutlinerForwarder::GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT nPara, USHORT nLine ) const
+{
+ return rOutliner.GetEditEngine().GetLineBoundaries( rStart, rEnd, nPara, nLine );
+}
+
+USHORT SvxOutlinerForwarder::GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const
+{
+ return rOutliner.GetEditEngine().GetLineNumberAtIndex( nPara, nIndex );
+}
sal_Bool SvxOutlinerForwarder::QuickFormatDoc( BOOL )
{
diff --git a/svx/source/unoedit/unotext.cxx b/svx/source/unoedit/unotext.cxx
index a568a548f7..0706db84a9 100644
--- a/svx/source/unoedit/unotext.cxx
+++ b/svx/source/unoedit/unotext.cxx
@@ -2647,6 +2647,16 @@ USHORT SvxDummyTextSource::GetLineLen( USHORT, USHORT ) const
return 0;
}
+void SvxDummyTextSource::GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT /*nParagraph*/, USHORT /*nLine*/ ) const
+{
+ rStart = rEnd = 0;
+}
+
+USHORT SvxDummyTextSource::GetLineNumberAtIndex( USHORT /*nPara*/, USHORT /*nIndex*/ ) const
+{
+ return 0;
+}
+
sal_Bool SvxDummyTextSource::QuickFormatDoc( BOOL )
{
return sal_False;
diff --git a/svx/source/unoedit/unoviwou.cxx b/svx/source/unoedit/unoviwou.cxx
index b339f25706..9825d6db53 100644
--- a/svx/source/unoedit/unoviwou.cxx
+++ b/svx/source/unoedit/unoviwou.cxx
@@ -35,6 +35,7 @@
#include <svx/unoviwou.hxx>
#include <svx/outliner.hxx>
+#include <svx/editeng.hxx>
#include <svx/svdotext.hxx>
diff --git a/svx/source/unogallery/makefile.mk b/svx/source/unogallery/makefile.mk
index a63b79bb6f..a699208f4f 100755
--- a/svx/source/unogallery/makefile.mk
+++ b/svx/source/unogallery/makefile.mk
@@ -38,14 +38,10 @@ ENABLE_EXCEPTIONS=TRUE
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
+.INCLUDE : $(PRJ)$/util$/makefile.pmk
# --- Files --------------------------------------------------------
-CXXFILES= \
- unogalthemeprovider.cxx \
- unogaltheme.cxx \
- unogalitem.cxx
-
SLOFILES= \
$(SLO)$/unogalthemeprovider.obj \
$(SLO)$/unogaltheme.obj \
diff --git a/svx/source/unogallery/unogalthemeprovider.cxx b/svx/source/unogallery/unogalthemeprovider.cxx
index f014431c86..f96d569b75 100644
--- a/svx/source/unogallery/unogalthemeprovider.cxx
+++ b/svx/source/unogallery/unogalthemeprovider.cxx
@@ -92,7 +92,7 @@ GalleryThemeProvider::~GalleryThemeProvider()
// ------------------------------------------------------------------------------
-::rtl::OUString GalleryThemeProvider::getImplementationName_Static()
+SVX_DLLPUBLIC ::rtl::OUString GalleryThemeProvider::getImplementationName_Static()
throw()
{
return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.gallery.GalleryThemeProvider" ) );
@@ -100,7 +100,7 @@ GalleryThemeProvider::~GalleryThemeProvider()
// ------------------------------------------------------------------------------
-uno::Sequence< ::rtl::OUString > GalleryThemeProvider::getSupportedServiceNames_Static()
+SVX_DLLPUBLIC uno::Sequence< ::rtl::OUString > GalleryThemeProvider::getSupportedServiceNames_Static()
throw()
{
uno::Sequence< ::rtl::OUString > aSeq( 1 );
diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx
index 356b98777d..1ba98b3e79 100644
--- a/svx/source/xml/xmlgrhlp.cxx
+++ b/svx/source/xml/xmlgrhlp.cxx
@@ -670,17 +670,16 @@ sal_Bool SvXMLGraphicHelper::ImplWriteGraphic( const ::rtl::OUString& rPictureSt
// -----------------------------------------------------------------------------
-void SvXMLGraphicHelper::ImplInsertGraphicURL( const ::rtl::OUString& rURLStr, sal_uInt32 nInsertPos )
+void SvXMLGraphicHelper::ImplInsertGraphicURL( const ::rtl::OUString& rURLStr, sal_uInt32 nInsertPos, rtl::OUString& rRequestedFileName )
{
+ rtl::OUString aURLString( rURLStr );
::rtl::OUString aPictureStorageName, aPictureStreamName;
-
- if( ( maURLSet.find( rURLStr ) != maURLSet.end() ) )
+ if( ( maURLSet.find( aURLString ) != maURLSet.end() ) )
{
URLPairVector::iterator aIter( maGrfURLs.begin() ), aEnd( maGrfURLs.end() );
-
while( aIter != aEnd )
{
- if( rURLStr == (*aIter).first )
+ if( aURLString == (*aIter).first )
{
maGrfURLs[ nInsertPos ].second = (*aIter).second;
aIter = aEnd;
@@ -689,7 +688,7 @@ void SvXMLGraphicHelper::ImplInsertGraphicURL( const ::rtl::OUString& rURLStr, s
aIter++;
}
}
- else if( ImplGetStreamNames( rURLStr, aPictureStorageName, aPictureStreamName ) )
+ else if( ImplGetStreamNames( aURLString, aPictureStorageName, aPictureStreamName ) )
{
URLPair& rURLPair = maGrfURLs[ nInsertPos ];
@@ -718,22 +717,23 @@ void SvXMLGraphicHelper::ImplInsertGraphicURL( const ::rtl::OUString& rURLStr, s
String aStreamName( aGraphicObjectId );
Graphic aGraphic( (Graphic&) aGrfObject.GetGraphic() );
const GfxLink aGfxLink( aGraphic.GetLink() );
+ String aExtension;
if( aGfxLink.GetDataSize() )
{
switch( aGfxLink.GetType() )
{
- case( GFX_LINK_TYPE_EPS_BUFFER ): aStreamName += String( RTL_CONSTASCII_USTRINGPARAM( ".eps" ) ); break;
- case( GFX_LINK_TYPE_NATIVE_GIF ): aStreamName += String( RTL_CONSTASCII_USTRINGPARAM( ".gif" ) ); break;
- case( GFX_LINK_TYPE_NATIVE_JPG ): aStreamName += String( RTL_CONSTASCII_USTRINGPARAM( ".jpg" ) ); break;
- case( GFX_LINK_TYPE_NATIVE_PNG ): aStreamName += String( RTL_CONSTASCII_USTRINGPARAM( ".png" ) ); break;
- case( GFX_LINK_TYPE_NATIVE_TIF ): aStreamName += String( RTL_CONSTASCII_USTRINGPARAM( ".tif" ) ); break;
- case( GFX_LINK_TYPE_NATIVE_WMF ): aStreamName += String( RTL_CONSTASCII_USTRINGPARAM( ".wmf" ) ); break;
- case( GFX_LINK_TYPE_NATIVE_MET ): aStreamName += String( RTL_CONSTASCII_USTRINGPARAM( ".met" ) ); break;
- case( GFX_LINK_TYPE_NATIVE_PCT ): aStreamName += String( RTL_CONSTASCII_USTRINGPARAM( ".pct" ) ); break;
+ case( GFX_LINK_TYPE_EPS_BUFFER ): aExtension = String( RTL_CONSTASCII_USTRINGPARAM( ".eps" ) ); break;
+ case( GFX_LINK_TYPE_NATIVE_GIF ): aExtension = String( RTL_CONSTASCII_USTRINGPARAM( ".gif" ) ); break;
+ case( GFX_LINK_TYPE_NATIVE_JPG ): aExtension = String( RTL_CONSTASCII_USTRINGPARAM( ".jpg" ) ); break;
+ case( GFX_LINK_TYPE_NATIVE_PNG ): aExtension = String( RTL_CONSTASCII_USTRINGPARAM( ".png" ) ); break;
+ case( GFX_LINK_TYPE_NATIVE_TIF ): aExtension = String( RTL_CONSTASCII_USTRINGPARAM( ".tif" ) ); break;
+ case( GFX_LINK_TYPE_NATIVE_WMF ): aExtension = String( RTL_CONSTASCII_USTRINGPARAM( ".wmf" ) ); break;
+ case( GFX_LINK_TYPE_NATIVE_MET ): aExtension = String( RTL_CONSTASCII_USTRINGPARAM( ".met" ) ); break;
+ case( GFX_LINK_TYPE_NATIVE_PCT ): aExtension = String( RTL_CONSTASCII_USTRINGPARAM( ".pct" ) ); break;
default:
- aStreamName += String( RTL_CONSTASCII_USTRINGPARAM( ".grf" ) );
+ aExtension = String( RTL_CONSTASCII_USTRINGPARAM( ".grf" ) );
break;
}
}
@@ -742,30 +742,52 @@ void SvXMLGraphicHelper::ImplInsertGraphicURL( const ::rtl::OUString& rURLStr, s
if( aGrfObject.GetType() == GRAPHIC_BITMAP )
{
if( aGrfObject.IsAnimated() )
- aStreamName += String( RTL_CONSTASCII_USTRINGPARAM( ".gif" ) );
+ aExtension = String( RTL_CONSTASCII_USTRINGPARAM( ".gif" ) );
else
- aStreamName += String( RTL_CONSTASCII_USTRINGPARAM( ".png" ) );
+ aExtension = String( RTL_CONSTASCII_USTRINGPARAM( ".png" ) );
}
else if( aGrfObject.GetType() == GRAPHIC_GDIMETAFILE )
{
// SJ: first check if this metafile is just a eps file, then we will store the eps instead of svm
GDIMetaFile& rMtf( (GDIMetaFile&)aGraphic.GetGDIMetaFile() );
if ( ImplCheckForEPS( rMtf ) )
- aStreamName += String( RTL_CONSTASCII_USTRINGPARAM( ".eps" ) );
+ aExtension = String( RTL_CONSTASCII_USTRINGPARAM( ".eps" ) );
else
- aStreamName += String( RTL_CONSTASCII_USTRINGPARAM( ".svm" ) );
+ aExtension = String( RTL_CONSTASCII_USTRINGPARAM( ".svm" ) );
}
}
+ rtl::OUString aURLEntry;
+ const String sPictures( RTL_CONSTASCII_USTRINGPARAM( "Pictures/" ) );
+
+ if ( rRequestedFileName.getLength() )
+ {
+ aURLEntry = sPictures;
+ aURLEntry += rRequestedFileName;
+ aURLEntry += aExtension;
+
+ URLPairVector::iterator aIter( maGrfURLs.begin() ), aEnd( maGrfURLs.end() );
+ while( aIter != aEnd )
+ {
+ if( aURLEntry == (*aIter).second )
+ break;
+ aIter++;
+ }
+ if ( aIter == aEnd )
+ aStreamName = rRequestedFileName;
+ }
+
+ aStreamName += aExtension;
+
if( mbDirect && aStreamName.Len() )
ImplWriteGraphic( aPictureStorageName, aStreamName, aGraphicObjectId );
- rURLPair.second = String( RTL_CONSTASCII_USTRINGPARAM( "Pictures/" ) );
+ rURLPair.second = sPictures;
rURLPair.second += aStreamName;
}
}
- maURLSet.insert( rURLStr );
+ maURLSet.insert( aURLString );
}
}
@@ -820,14 +842,45 @@ void SvXMLGraphicHelper::Destroy( SvXMLGraphicHelper* pSvXMLGraphicHelper )
// -----------------------------------------------------------------------------
// XGraphicObjectResolver
-::rtl::OUString SAL_CALL SvXMLGraphicHelper::resolveGraphicObjectURL( const ::rtl::OUString& aURL )
+::rtl::OUString SAL_CALL SvXMLGraphicHelper::resolveGraphicObjectURL( const ::rtl::OUString& rURL )
throw(uno::RuntimeException)
{
::osl::MutexGuard aGuard( maMutex );
const sal_Int32 nIndex = maGrfURLs.size();
+ rtl::OUString aURL( rURL );
+ rtl::OUString aUserData;
+ rtl::OUString aRequestedFileName;
+
+ sal_Int32 nUser = rURL.indexOf( '?', 0 );
+ if ( nUser >= 0 )
+ {
+ aURL = rtl::OUString( rURL.copy( 0, nUser ) );
+ nUser++;
+ aUserData = rURL.copy( nUser, rURL.getLength() - nUser );
+ }
+ if ( aUserData.getLength() )
+ {
+ sal_Int32 nIndex2 = 0;
+ do
+ {
+ rtl::OUString aToken = aUserData.getToken( 0, ';', nIndex2 );
+ sal_Int32 n = aToken.indexOf( '=' );
+ if ( ( n > 0 ) && ( ( n + 1 ) < aToken.getLength() ) )
+ {
+ rtl::OUString aParam( aToken.copy( 0, n ) );
+ rtl::OUString aValue( aToken.copy( n + 1, aToken.getLength() - ( n + 1 ) ) );
+
+ const rtl::OUString sRequestedName( RTL_CONSTASCII_USTRINGPARAM("requestedName") );
+ if ( aParam.match( sRequestedName ) )
+ aRequestedFileName = aValue;
+ }
+ }
+ while ( nIndex2 >= 0 );
+ }
+
maGrfURLs.push_back( ::std::make_pair( aURL, ::rtl::OUString() ) );
- ImplInsertGraphicURL( aURL, nIndex );
+ ImplInsertGraphicURL( aURL, nIndex, aRequestedFileName );
return maGrfURLs[ nIndex ].second;
}
diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx
index dca95ac457..1e527885b7 100644
--- a/svx/source/xoutdev/xattr.cxx
+++ b/svx/source/xoutdev/xattr.cxx
@@ -66,6 +66,8 @@
#include <basegfx/point/b2dpoint.hxx>
#include <basegfx/vector/b2dvector.hxx>
+#include <stdio.h>
+
using namespace ::rtl;
using namespace ::com::sun::star;
@@ -108,7 +110,7 @@ long ScaleMetricValue( long nVal, long nMul, long nDiv )
/*************************************************************************
|*
-|* NameOrIndex::NameOrIndex(USHORT nWhich, long nIndex)
+|* NameOrIndex::NameOrIndex(USHORT nWhich, INT32 nIndex)
|*
|* Beschreibung
|* Ersterstellung 14.11.94
@@ -116,7 +118,7 @@ long ScaleMetricValue( long nVal, long nMul, long nDiv )
|*
*************************************************************************/
-NameOrIndex::NameOrIndex(USHORT _nWhich, long nIndex) :
+NameOrIndex::NameOrIndex(USHORT _nWhich, INT32 nIndex) :
SfxStringItem(_nWhich, aNameOrIndexEmptyString),
nPalIndex(nIndex)
{
@@ -134,7 +136,7 @@ NameOrIndex::NameOrIndex(USHORT _nWhich, long nIndex) :
NameOrIndex::NameOrIndex(USHORT _nWhich, const XubString& rName) :
SfxStringItem(_nWhich, rName),
- nPalIndex((long)-1)
+ nPalIndex(-1)
{
}
@@ -230,7 +232,7 @@ SfxPoolItem* NameOrIndex::Create(SvStream& rIn, USHORT /*nVer*/) const
SvStream& NameOrIndex::Store( SvStream& rOut, USHORT nItemVersion ) const
{
SfxStringItem::Store( rOut, nItemVersion );
- rOut << (INT32)nPalIndex;
+ rOut << nPalIndex;
return rOut;
}
@@ -369,11 +371,11 @@ TYPEINIT1_AUTOFACTORY(XColorItem, NameOrIndex);
/*************************************************************************
|*
-|* XColorItem::XColorItem(USHORT nWhich, long nIndex, const Color& rTheColor)
+|* XColorItem::XColorItem(USHORT nWhich, INT32 nIndex, const Color& rTheColor)
|*
\************************************************************************/
-XColorItem::XColorItem(USHORT _nWhich, long nIndex, const Color& rTheColor) :
+XColorItem::XColorItem(USHORT _nWhich, INT32 nIndex, const Color& rTheColor) :
NameOrIndex(_nWhich, nIndex),
aColor(rTheColor)
{
@@ -884,7 +886,7 @@ TYPEINIT1_AUTOFACTORY(XLineDashItem, NameOrIndex);
/*************************************************************************
|*
-|* XLineDashItem::XLineDashItem(long nIndex, const XDash& rTheDash)
+|* XLineDashItem::XLineDashItem(INT32 nIndex, const XDash& rTheDash)
|*
|* Beschreibung
|* Ersterstellung 15.11.94
@@ -892,7 +894,7 @@ TYPEINIT1_AUTOFACTORY(XLineDashItem, NameOrIndex);
|*
*************************************************************************/
-XLineDashItem::XLineDashItem(long nIndex, const XDash& rTheDash) :
+XLineDashItem::XLineDashItem(INT32 nIndex, const XDash& rTheDash) :
NameOrIndex(XATTR_LINEDASH, nIndex),
aDash(rTheDash)
{
@@ -1501,7 +1503,7 @@ TYPEINIT1_AUTOFACTORY(XLineColorItem, XColorItem);
/*************************************************************************
|*
-|* XLineColorItem::XLineColorItem(long nIndex, const Color& rTheColor)
+|* XLineColorItem::XLineColorItem(INT32 nIndex, const Color& rTheColor)
|*
|* Beschreibung
|* Ersterstellung 15.11.94
@@ -1509,7 +1511,7 @@ TYPEINIT1_AUTOFACTORY(XLineColorItem, XColorItem);
|*
*************************************************************************/
-XLineColorItem::XLineColorItem(long nIndex, const Color& rTheColor) :
+XLineColorItem::XLineColorItem(INT32 nIndex, const Color& rTheColor) :
XColorItem(XATTR_LINECOLOR, nIndex, rTheColor)
{
}
@@ -1720,7 +1722,7 @@ TYPEINIT1_AUTOFACTORY(XLineStartItem, NameOrIndex);
/*************************************************************************
|*
-|* XLineStartItem::XLineStartItem(long nIndex)
+|* XLineStartItem::XLineStartItem(INT32 nIndex)
|*
|* Beschreibung
|* Ersterstellung 15.11.94
@@ -1728,7 +1730,7 @@ TYPEINIT1_AUTOFACTORY(XLineStartItem, NameOrIndex);
|*
*************************************************************************/
-XLineStartItem::XLineStartItem(long nIndex)
+XLineStartItem::XLineStartItem(INT32 nIndex)
: NameOrIndex(XATTR_LINESTART, nIndex)
{
}
@@ -2192,7 +2194,7 @@ TYPEINIT1_AUTOFACTORY(XLineEndItem, NameOrIndex);
/*************************************************************************
|*
-|* XLineEndItem::XLineEndItem(long nIndex)
+|* XLineEndItem::XLineEndItem(INT32 nIndex)
|*
|* Beschreibung
|* Ersterstellung 15.11.94
@@ -2200,7 +2202,7 @@ TYPEINIT1_AUTOFACTORY(XLineEndItem, NameOrIndex);
|*
*************************************************************************/
-XLineEndItem::XLineEndItem(long nIndex)
+XLineEndItem::XLineEndItem(INT32 nIndex)
: NameOrIndex(XATTR_LINEEND, nIndex)
{
}
@@ -2664,7 +2666,7 @@ TYPEINIT1_AUTOFACTORY(XLineStartWidthItem, SfxMetricItem);
/*************************************************************************
|*
-|* XLineStartWidthItem::XLineStartWidthItem(long nWidth)
+|* XLineStartWidthItem::XLineStartWidthItem(INT32 nWidth)
|*
|* Beschreibung
|* Ersterstellung 15.11.94
@@ -3249,7 +3251,7 @@ TYPEINIT1_AUTOFACTORY(XFillColorItem, XColorItem);
/*************************************************************************
|*
-|* XFillColorItem::XFillColorItem(long nIndex, const Color& rTheColor)
+|* XFillColorItem::XFillColorItem(INT32 nIndex, const Color& rTheColor)
|*
|* Beschreibung
|* Ersterstellung 15.11.94
@@ -3257,7 +3259,7 @@ TYPEINIT1_AUTOFACTORY(XFillColorItem, XColorItem);
|*
*************************************************************************/
-XFillColorItem::XFillColorItem(long nIndex, const Color& rTheColor) :
+XFillColorItem::XFillColorItem(INT32 nIndex, const Color& rTheColor) :
XColorItem(XATTR_FILLCOLOR, nIndex, rTheColor)
{
}
@@ -3372,7 +3374,7 @@ sal_Bool XFillColorItem::PutValue( const ::com::sun::star::uno::Any& rVal, BYTE
// -----------------------------
TYPEINIT1_AUTOFACTORY(XSecondaryFillColorItem, XColorItem);
-XSecondaryFillColorItem::XSecondaryFillColorItem(long nIndex, const Color& rTheColor) :
+XSecondaryFillColorItem::XSecondaryFillColorItem(INT32 nIndex, const Color& rTheColor) :
XColorItem(XATTR_SECONDARYFILLCOLOR, nIndex, rTheColor)
{
}
@@ -3510,7 +3512,7 @@ TYPEINIT1_AUTOFACTORY(XFillGradientItem, NameOrIndex);
/*************************************************************************
|*
-|* XFillGradientItem::XFillGradientItem(long nIndex,
+|* XFillGradientItem::XFillGradientItem(INT32 nIndex,
|* const XGradient& rTheGradient)
|*
|* Beschreibung
@@ -3519,7 +3521,7 @@ TYPEINIT1_AUTOFACTORY(XFillGradientItem, NameOrIndex);
|*
*************************************************************************/
-XFillGradientItem::XFillGradientItem(long nIndex,
+XFillGradientItem::XFillGradientItem(INT32 nIndex,
const XGradient& rTheGradient) :
NameOrIndex(XATTR_FILLGRADIENT, nIndex),
aGradient(rTheGradient)
@@ -4042,7 +4044,7 @@ XFillFloatTransparenceItem::XFillFloatTransparenceItem() :
//------------------------------------------------------------------------
-XFillFloatTransparenceItem::XFillFloatTransparenceItem( long nIndex, const XGradient& rGradient, BOOL bEnable ) :
+XFillFloatTransparenceItem::XFillFloatTransparenceItem( INT32 nIndex, const XGradient& rGradient, BOOL bEnable ) :
XFillGradientItem ( nIndex, rGradient ),
bEnabled ( bEnable )
{
@@ -4246,7 +4248,7 @@ TYPEINIT1_AUTOFACTORY(XFillHatchItem, NameOrIndex);
/*************************************************************************
|*
-|* XFillHatchItem::XFillHatchItem(long nIndex,
+|* XFillHatchItem::XFillHatchItem(INT32 nIndex,
|* const XHatch& rTheHatch)
|*
|* Beschreibung
@@ -4255,7 +4257,7 @@ TYPEINIT1_AUTOFACTORY(XFillHatchItem, NameOrIndex);
|*
*************************************************************************/
-XFillHatchItem::XFillHatchItem(long nIndex,
+XFillHatchItem::XFillHatchItem(INT32 nIndex,
const XHatch& rTheHatch) :
NameOrIndex(XATTR_FILLHATCH, nIndex),
aHatch(rTheHatch)
@@ -5258,7 +5260,7 @@ TYPEINIT1_AUTOFACTORY(XFormTextShadowColorItem, XColorItem);
|*
*************************************************************************/
-XFormTextShadowColorItem::XFormTextShadowColorItem(long nIndex,
+XFormTextShadowColorItem::XFormTextShadowColorItem(INT32 nIndex,
const Color& rTheColor) :
XColorItem(XATTR_FORMTXTSHDWCOLOR, nIndex, rTheColor)
{
diff --git a/svx/util/makefile.mk b/svx/util/makefile.mk
index f212284fa4..898629299e 100644
--- a/svx/util/makefile.mk
+++ b/svx/util/makefile.mk
@@ -52,11 +52,6 @@ RSCLOCINC+=-I$(PRJ)$/source$/svdraw
LIB1TARGET= $(SLB)$/$(TARGET).lib
LIB1FILES=\
- $(SLB)$/animation.lib \
- $(SLB)$/overlay.lib \
- $(SLB)$/attribute.lib \
- $(SLB)$/primitive2d.lib \
- $(SLB)$/primitive3d.lib \
$(SLB)$/svdraw.lib \
$(SLB)$/form.lib
@@ -67,10 +62,6 @@ LIB1FILES+=$(SLB)$/ibrwimp.lib
LIB2TARGET= $(SLB)$/$(TARGET)_2.lib
LIB2FILES=\
$(SLB)$/items.lib \
- $(SLB)$/svxlink.lib \
- $(SLB)$/svxrtf.lib \
- $(SLB)$/editeng.lib \
- $(SLB)$/outliner.lib \
$(SLB)$/dialogs.lib \
$(SLB)$/mnuctrls.lib \
$(SLB)$/options.lib \
@@ -83,40 +74,112 @@ LIB3TARGET= $(SLB)$/$(TARGET)_3.lib
LIB3FILES=\
$(SLB)$/unodraw.lib \
$(SLB)$/unogallery.lib\
- $(SLB)$/gal.lib \
$(SLB)$/accessibility.lib \
- $(SLB)$/customshapes.lib\
- $(SLB)$/toolbars.lib \
- $(SLB)$/properties.lib \
- $(SLB)$/contact.lib \
- $(SLB)$/event.lib
+ $(SLB)$/customshapes.lib
LIB4TARGET= $(SLB)$/$(TARGET)_4.lib
LIB4FILES=\
$(SLB)$/fmcomp.lib \
$(SLB)$/engine3d.lib \
- $(SLB)$/msfilter.lib \
- $(SLB)$/xout.lib \
- $(SLB)$/xml.lib \
$(SLB)$/table.lib
+# Objects needed for the svxcore library.
+LIB5TARGET= $(SLB)$/$(TARGET)_5.lib
+LIB5FILES=\
+ $(SLB)$/accessibility-core.lib \
+ $(SLB)$/animation.lib \
+ $(SLB)$/attribute.lib \
+ $(SLB)$/contact.lib \
+ $(SLB)$/customshapes-core.lib \
+ $(SLB)$/dialogs-core.lib \
+ $(SLB)$/editeng.lib \
+ $(SLB)$/engine3d-core.lib \
+ $(SLB)$/event.lib \
+ $(SLB)$/fmcomp-core.lib \
+ $(SLB)$/form-core.lib \
+ $(SLB)$/gal.lib \
+ $(SLB)$/items-core.lib \
+ $(SLB)$/msfilter-core.lib \
+ $(SLB)$/options-core.lib
+
+LIB6TARGET= $(SLB)$/$(TARGET)_6.lib
+LIB6FILES=\
+ $(SLB)$/outliner.lib \
+ $(SLB)$/overlay.lib \
+ $(SLB)$/primitive2d.lib \
+ $(SLB)$/primitive3d.lib \
+ $(SLB)$/properties.lib \
+ $(SLB)$/svdraw-core.lib \
+ $(SLB)$/svxlink.lib \
+ $(SLB)$/svxrtf-core.lib \
+ $(SLB)$/table-core.lib \
+ $(SLB)$/tbxctrls-core.lib \
+ $(SLB)$/toolbars.lib \
+ $(SLB)$/unodraw-core.lib \
+ $(SLB)$/unoedit-core.lib \
+ $(SLB)$/xml.lib \
+ $(SLB)$/xout.lib
+
+# Objects needed for the svxmsfilter library.
+LIB7TARGET= $(SLB)$/$(TARGET)_7.lib
+LIB7FILES=\
+ $(SLB)$/msfilter-msfilter.lib \
+ $(SLB)$/svdraw-msfilter.lib \
+ $(SLB)$/svxrtf.lib
+
HELPIDFILES= ..$/inc$/helpid.hrc
-# svx
-SHL1TARGET= svx$(DLLPOSTFIX)
-SHL1IMPLIB= i$(TARGET)
+# svxcore
+SHL1TARGET= svxcore$(DLLPOSTFIX)
+SHL1IMPLIB= isvxcore
SHL1USE_EXPORTS=name
+SHL1LIBS= $(LIB5TARGET) $(LIB6TARGET)
-SHL1LIBS= $(LIB1TARGET) $(LIB2TARGET) $(LIB3TARGET) $(LIB4TARGET)
SHL1STDLIBS= \
- $(AVMEDIALIB) \
+ $(AVMEDIALIB) \
+ $(SFX2LIB) \
+ $(XMLOFFLIB) \
+ $(GOODIESLIB) \
+ $(BASEGFXLIB) \
+ $(DRAWINGLAYERLIB) \
+ $(LNGLIB) \
+ $(BASICLIB) \
+ $(SVTOOLLIB) \
+ $(TKLIB) \
+ $(VCLLIB) \
+ $(SVLLIB) \
+ $(SOTLIB) \
+ $(UNOTOOLSLIB) \
+ $(TOOLSLIB) \
+ $(I18NISOLANGLIB) \
+ $(I18NPAPERLIB) \
+ $(COMPHELPERLIB) \
+ $(UCBHELPERLIB) \
+ $(CPPUHELPERLIB) \
+ $(CPPULIB) \
+ $(VOSLIB) \
+ $(SALLIB) \
+ $(ICUUCLIB)
+
+SHL1DEF= $(MISC)$/$(SHL1TARGET).def
+DEF1NAME= $(SHL1TARGET)
+DEFLIB1NAME=$(TARGET)_5
+
+# svx
+SHL2TARGET= svx$(DLLPOSTFIX)
+SHL2IMPLIB= i$(TARGET)
+SHL2USE_EXPORTS=name
+SHL2DEPN=$(SHL1TARGETN)
+
+SHL2LIBS= $(LIB1TARGET) $(LIB2TARGET) $(LIB3TARGET) $(LIB4TARGET)
+SHL2STDLIBS= \
+ $(SVXCORELIB) \
$(SFX2LIB) \
$(XMLOFFLIB) \
$(GOODIESLIB) \
$(BASEGFXLIB) \
$(DRAWINGLAYERLIB) \
$(BASICLIB) \
- $(LNGLIB) \
$(SVTOOLLIB) \
$(TKLIB) \
$(VCLLIB) \
@@ -125,7 +188,6 @@ SHL1STDLIBS= \
$(UNOTOOLSLIB) \
$(TOOLSLIB) \
$(I18NISOLANGLIB) \
- $(I18NPAPERLIB) \
$(XMLSCRIPTLIB) \
$(COMPHELPERLIB) \
$(UCBHELPERLIB) \
@@ -136,25 +198,26 @@ SHL1STDLIBS= \
$(ICUUCLIB)
.IF "$(GUI)"=="WNT"
-SHL1STDLIBS+=$(SHELLLIB)
+SHL2STDLIBS+=$(SHELLLIB)
.ENDIF # WNT
-SHL1DEF= $(MISC)$/$(SHL1TARGET).def
-DEF1NAME= $(SHL1TARGET)
-DEFLIB1NAME=$(TARGET) $(TARGET)_2 $(TARGET)_3 $(TARGET)_4
+SHL2DEF= $(MISC)$/$(SHL2TARGET).def
+DEF2NAME= $(SHL2TARGET)
+DEFLIB2NAME=$(TARGET) $(TARGET)_2 $(TARGET)_3 $(TARGET)_4
# cui
-SHL2TARGET= cui$(DLLPOSTFIX)
-SHL2VERSIONMAP= cui.map
-SHL2IMPLIB=icui
-SHL2DEPN=$(SHL1TARGETN)
+SHL3TARGET= cui$(DLLPOSTFIX)
+SHL3VERSIONMAP= cui.map
+SHL3IMPLIB=icui
+SHL3DEPN=$(SHL2TARGETN)
-SHL2DEF= $(MISC)$/$(SHL2TARGET).def
-DEF2NAME= $(SHL2TARGET)
+SHL3DEF= $(MISC)$/$(SHL3TARGET).def
+DEF3NAME= $(SHL3TARGET)
-SHL2LIBS= $(SLB)$/cui.lib
+SHL3LIBS= $(SLB)$/cui.lib
-SHL2STDLIBS= \
+SHL3STDLIBS= \
+ $(SVXCORELIB) \
$(SVXLIB) \
$(AVMEDIALIB) \
$(SFX2LIB) \
@@ -175,18 +238,50 @@ SHL2STDLIBS= \
$(CPPULIB) \
$(VOSLIB) \
$(SALLIB) \
- $(JVMFWKLIB)
+ $(JVMFWKLIB) \
+ $(ICUUCLIB)
.IF "$(debug)$(dbgutil)"!=""
SHL2STDLIBS += $(CPPUHELPERLIB)
.ENDIF # "$(debug)$(dbgutil)"!=""
.IF "$(GUI)"=="WNT"
-SHL2STDLIBS+= \
+SHL3STDLIBS+= \
$(SHLWAPILIB) \
$(ADVAPI32LIB)
.ENDIF # WNT
+# svxmsfilter library
+SHL4TARGET= svxmsfilter$(DLLPOSTFIX)
+SHL4IMPLIB= isvxmsfilter
+SHL4USE_EXPORTS=name
+SHL4DEPN=$(SHL1TARGETN)
+SHL4LIBS= $(LIB7TARGET)
+
+SHL4STDLIBS= \
+ $(SVXCORELIB) \
+ $(SFX2LIB) \
+ $(XMLOFFLIB) \
+ $(GOODIESLIB) \
+ $(BASEGFXLIB) \
+ $(BASICLIB) \
+ $(SVTOOLLIB) \
+ $(TKLIB) \
+ $(VCLLIB) \
+ $(SVLLIB) \
+ $(SOTLIB) \
+ $(UNOTOOLSLIB) \
+ $(TOOLSLIB) \
+ $(XMLSCRIPTLIB) \
+ $(COMPHELPERLIB) \
+ $(CPPUHELPERLIB) \
+ $(CPPULIB) \
+ $(SALLIB)
+
+SHL4DEF= $(MISC)$/$(SHL4TARGET).def
+DEF4NAME= $(SHL4TARGET)
+DEFLIB4NAME=$(TARGET)_6
+
# ------------------------------------------------------------------------------
# Resource files
diff --git a/svx/util/makefile.pmk b/svx/util/makefile.pmk
index 27f185e936..b2aae33291 100644
--- a/svx/util/makefile.pmk
+++ b/svx/util/makefile.pmk
@@ -36,4 +36,12 @@ CDEFS += -DSVX_DLLIMPLEMENTATION
CFLAGS+=-DENABLE_GTK
.ENDIF
+.IF "$(ENABLE_KDE)" != ""
+CFLAGS+=-DENABLE_KDE
+.ENDIF
+
+.IF "$(ENABLE_KDE4)" != ""
+CFLAGS+=-DENABLE_KDE4
+.ENDIF
+
VISIBILITY_HIDDEN=TRUE
diff --git a/sysui/util/checksize.pl b/sysui/util/checksize.pl
index 9fc6a27e09..3ecea2cb68 100644
--- a/sysui/util/checksize.pl
+++ b/sysui/util/checksize.pl
@@ -82,8 +82,8 @@ sub check #04.02.2005 13:40
my $path = shift;
my $file = shift;
print "$path$file\n" if ((-e "$path$file") && $is_debug);
- # don't check dpc,flag,rpmflag, [obj for UNX] files, or etc subdirectory
- return if ( ($file =~ /.+\.(dpc|\w*?flag)/) || ($file =~ /.+\.obj/ && $ENV{GUI} eq 'UNX') || ($path =~ /.+etc/) || ($path =~ /.+logs/) );
+ # don't check dpc,flag,rpmflag,sdf [obj for UNX] files, or etc subdirectory
+ return if ( ($file =~ /.+\.(dpc|\w*?flag)/) || ($file =~ /.+\.obj/ && $ENV{GUI} eq 'UNX') || ($path =~ /.+etc/) || ($path =~ /.+logs/) || ($path =~ /.+sdf/) );
if ( -z "$path$file" ) {
print "Error: $path$file 0 Bytes!\n";
$err++;
diff --git a/ucb/source/ucp/webdav/NeonSession.cxx b/ucb/source/ucp/webdav/NeonSession.cxx
index 128606b7ac..292884c3db 100644
--- a/ucb/source/ucp/webdav/NeonSession.cxx
+++ b/ucb/source/ucp/webdav/NeonSession.cxx
@@ -32,6 +32,7 @@
#include "precompiled_ucb.hxx"
#include <hash_map>
+#include <vector>
#include <string.h>
#include <rtl/string.h>
#include <ne_socket.h>
@@ -41,6 +42,8 @@
#include <ne_ssl.h>
#include "libxml/parser.h"
#include <rtl/ustrbuf.hxx>
+#include "comphelper/sequence.hxx"
+
#include "DAVAuthListener.hxx"
#include "NeonTypes.hxx"
#include "NeonSession.hxx"
@@ -395,6 +398,7 @@ extern "C" int NeonSession_CertificationNotify( void *userdata,
int failures,
const ne_ssl_certificate *cert )
{
+ OSL_ASSERT(cert);
NeonSession * pSession = static_cast< NeonSession * >( userdata );
uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment > xSecurityEnv;
uno::Reference< ::com::sun::star::security::XCertificateContainer > xCertificateContainer;
@@ -442,18 +446,44 @@ extern "C" int NeonSession_CertificationNotify( void *userdata,
xSecurityEnv = mxSecurityContext->getSecurityEnvironment();
- char * rawCert;
-
- rawCert = ne_ssl_cert_export( cert );
+ //The end entity certificate
+ char * eeCertB64 = ne_ssl_cert_export( cert );
- ::rtl::OString sRawCert( rawCert );
+ ::rtl::OString sEECertB64( eeCertB64 );
- uno::Reference< com::sun::star::security::XCertificate> xCert = xSecurityEnv->createCertificateFromAscii( ::rtl::OStringToOUString( sRawCert, RTL_TEXTENCODING_ASCII_US ) );
+ uno::Reference< com::sun::star::security::XCertificate> xEECert =
+ xSecurityEnv->createCertificateFromAscii(
+ ::rtl::OStringToOUString( sEECertB64, RTL_TEXTENCODING_ASCII_US ) );
- sal_Int64 certValidity = xSecurityEnv->verifyCertificate( xCert );
+ free(eeCertB64);
+ eeCertB64 = NULL;
+
+ std::vector<uno::Reference<com::sun::star::security::XCertificate> > vecCerts;
+ const ne_ssl_certificate * issuerCert = cert;
+ do
+ {
+ //get the intermediate certificate
+ //the returned value is const ! Therfore it does not need to be freed
+ //with ne_ssl_cert_free, which takes a non-const argument
+ issuerCert = ne_ssl_cert_signedby(issuerCert);
+ if (NULL == issuerCert)
+ break;
+
+ char * imCertB64 = ne_ssl_cert_export(issuerCert);
+ ::rtl::OString sInterMediateCertB64(imCertB64);
+ free(imCertB64);
+ uno::Reference< com::sun::star::security::XCertificate> xImCert =
+ xSecurityEnv->createCertificateFromAscii(
+ ::rtl::OStringToOUString( sInterMediateCertB64, RTL_TEXTENCODING_ASCII_US ) );
+ if (xImCert.is())
+ vecCerts.push_back(xImCert);
+ }while (1);
+
+ sal_Int64 certValidity = xSecurityEnv->verifyCertificate( xEECert,
+ ::comphelper::containerToSequence(vecCerts) );
- if ( pSession->isDomainMatch( GetHostnamePart( xCert.get()->getSubjectName())) )
+ if ( pSession->isDomainMatch( GetHostnamePart( xEECert.get()->getSubjectName())) )
{
//if host name matched with certificate then look if the certificate was ok
if( certValidity == ::security::CertificateValidity::VALID )
@@ -472,7 +502,7 @@ extern "C" int NeonSession_CertificationNotify( void *userdata,
if ( xIH.is() )
{
rtl::Reference< ucbhelper::SimpleCertificateValidationRequest > xRequest
- = new ucbhelper::SimpleCertificateValidationRequest((sal_Int32)failures, xCert, pSession->getHostName() );
+ = new ucbhelper::SimpleCertificateValidationRequest((sal_Int32)failures, xEECert, pSession->getHostName() );
xIH->handle( xRequest.get() );
rtl::Reference< ucbhelper::InteractionContinuation > xSelection
diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx
index 46f7ebef3a..c58794c3ca 100644
--- a/uui/source/iahndl.cxx
+++ b/uui/source/iahndl.cxx
@@ -63,6 +63,7 @@
#include "com/sun/star/task/XInteractionHandler.hpp"
#include "com/sun/star/task/XInteractionHandler2.hpp"
#include "com/sun/star/task/DocumentPasswordRequest.hpp"
+#include "com/sun/star/task/DocumentMSPasswordRequest.hpp"
#include "com/sun/star/task/ErrorCodeIOException.hpp"
#include "com/sun/star/task/ErrorCodeRequest.hpp"
#include "com/sun/star/task/MasterPasswordRequest.hpp"
@@ -1132,6 +1133,15 @@ bool UUIInteractionHelper::handleDialogRequests(
return true;
}
+ star::task::DocumentMSPasswordRequest aDocumentMSPasswordRequest;
+ if (aAnyRequest >>= aDocumentMSPasswordRequest)
+ {
+ handleMSPasswordRequest(aDocumentMSPasswordRequest.Mode,
+ rRequest->getContinuations(),
+ aDocumentMSPasswordRequest.Name);
+ return true;
+ }
+
star::task::PasswordRequest aPasswordRequest;
if (aAnyRequest >>= aPasswordRequest)
{
@@ -1839,6 +1849,48 @@ UUIInteractionHelper::executePasswordDialog(
}
void
+UUIInteractionHelper::executeMSPasswordDialog(
+ LoginErrorInfo & rInfo,
+ star::task::PasswordRequestMode nMode,
+ ::rtl::OUString aDocName)
+ SAL_THROW((star::uno::RuntimeException))
+{
+ try
+ {
+ vos::OGuard aGuard(Application::GetSolarMutex());
+
+ std::auto_ptr< ResMgr >
+ xManager(ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui)));
+ if( nMode == star::task::PasswordRequestMode_PASSWORD_CREATE )
+ {
+ std::auto_ptr< PasswordCreateDialog >
+ xDialog(new PasswordCreateDialog(
+ getParentProperty(), xManager.get(), true));
+
+ rInfo.SetResult(xDialog->Execute() == RET_OK ? ERRCODE_BUTTON_OK :
+ ERRCODE_BUTTON_CANCEL);
+ rInfo.SetPassword( xDialog->GetPassword() );
+ }
+ else
+ {
+ std::auto_ptr< PasswordDialog >
+ xDialog(new PasswordDialog(
+ getParentProperty(), nMode, xManager.get(), aDocName ));
+
+ rInfo.SetResult(xDialog->Execute() == RET_OK ? ERRCODE_BUTTON_OK :
+ ERRCODE_BUTTON_CANCEL);
+ rInfo.SetPassword( xDialog->GetPassword() );
+ }
+ }
+ catch (std::bad_alloc const &)
+ {
+ throw star::uno::RuntimeException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")),
+ star::uno::Reference< star::uno::XInterface>());
+ }
+}
+
+void
UUIInteractionHelper::executeCookieDialog(CntHTTPCookieRequest & rRequest)
SAL_THROW((star::uno::RuntimeException))
{
@@ -2558,6 +2610,47 @@ UUIInteractionHelper::handlePasswordRequest(
}
void
+UUIInteractionHelper::handleMSPasswordRequest(
+ star::task::PasswordRequestMode nMode,
+ star::uno::Sequence< star::uno::Reference<
+ star::task::XInteractionContinuation > > const &
+ rContinuations,
+ ::rtl::OUString aDocumentName )
+ SAL_THROW((star::uno::RuntimeException))
+{
+ star::uno::Reference< star::task::XInteractionRetry > xRetry;
+ star::uno::Reference< star::task::XInteractionAbort > xAbort;
+ star::uno::Reference< star::task::XInteractionPassword >
+ xPassword;
+ getContinuations(
+ rContinuations, 0, 0, &xRetry, &xAbort, 0, &xPassword, 0, 0);
+ LoginErrorInfo aInfo;
+
+ executeMSPasswordDialog(aInfo, nMode, aDocumentName);
+
+ switch (aInfo.GetResult())
+ {
+ case ERRCODE_BUTTON_OK:
+ if (xPassword.is())
+ {
+ xPassword->setPassword(aInfo.GetPassword());
+ xPassword->select();
+ }
+ break;
+
+ case ERRCODE_BUTTON_RETRY:
+ if (xRetry.is())
+ xRetry->select();
+ break;
+
+ default:
+ if (xAbort.is())
+ xAbort->select();
+ break;
+ }
+}
+
+void
UUIInteractionHelper::handleCookiesRequest(
star::ucb::HandleCookiesRequest const & rRequest,
star::uno::Sequence< star::uno::Reference<
diff --git a/uui/source/iahndl.hxx b/uui/source/iahndl.hxx
index f173f59778..9475e7227d 100644
--- a/uui/source/iahndl.hxx
+++ b/uui/source/iahndl.hxx
@@ -201,6 +201,12 @@ private:
::rtl::OUString aDocumentName)
SAL_THROW((com::sun::star::uno::RuntimeException));
+ void
+ executeMSPasswordDialog(LoginErrorInfo & rInfo,
+ com::sun::star::task::PasswordRequestMode nMode,
+ ::rtl::OUString aDocumentName)
+ SAL_THROW((com::sun::star::uno::RuntimeException));
+
void executeCookieDialog(CntHTTPCookieRequest & rRequest)
SAL_THROW((com::sun::star::uno::RuntimeException));
@@ -280,6 +286,16 @@ private:
::rtl::OUString aDocumentName = ::rtl::OUString())
SAL_THROW((com::sun::star::uno::RuntimeException));
+ void
+ handleMSPasswordRequest(
+ com::sun::star::task::PasswordRequestMode nMode,
+ com::sun::star::uno::Sequence<
+ com::sun::star::uno::Reference<
+ com::sun::star::task::XInteractionContinuation > > const &
+ rContinuations,
+ ::rtl::OUString aDocumentName = ::rtl::OUString())
+ SAL_THROW((com::sun::star::uno::RuntimeException));
+
void
handleCookiesRequest(
com::sun::star::ucb::HandleCookiesRequest const & rRequest,
diff --git a/uui/source/passcrtdlg.cxx b/uui/source/passcrtdlg.cxx
index c3aa59761f..878802d322 100644
--- a/uui/source/passcrtdlg.cxx
+++ b/uui/source/passcrtdlg.cxx
@@ -69,19 +69,19 @@ IMPL_LINK( PasswordCreateDialog, OKHdl_Impl, OKButton *, EMPTYARG )
// -----------------------------------------------------------------------
-PasswordCreateDialog::PasswordCreateDialog( Window* _pParent, ResMgr * pResMgr )
+PasswordCreateDialog::PasswordCreateDialog( Window* _pParent, ResMgr * pResMgr, bool bMSCryptoMode)
:ModalDialog( _pParent, ResId( DLG_UUI_PASSWORD_CRT, *pResMgr ) )
,aFTPasswordCrt ( this, ResId( FT_PASSWORD_CRT, *pResMgr ) )
,aEDPasswordCrt ( this, ResId( ED_PASSWORD_CRT, *pResMgr ) )
,aFTPasswordRepeat ( this, ResId( FT_PASSWORD_REPEAT, *pResMgr ) )
,aEDPasswordRepeat ( this, ResId( ED_PASSWORD_REPEAT, *pResMgr ) )
- ,aFTWarning ( this, ResId( FT_PASSWORD_WARNING, *pResMgr ) )
+ ,aFTWarning ( this, ResId( bMSCryptoMode ? FT_MSPASSWORD_WARNING : FT_PASSWORD_WARNING, *pResMgr ) )
,aFixedLine1 ( this, ResId( FL_FIXED_LINE_1, *pResMgr ) )
,aOKBtn ( this, ResId( BTN_PASSCRT_OK, *pResMgr ) )
,aCancelBtn ( this, ResId( BTN_PASSCRT_CANCEL, *pResMgr ) )
,aHelpBtn ( this, ResId( BTN_PASSCRT_HELP, *pResMgr ) )
,pResourceMgr ( pResMgr )
- ,nMinLen(5)
+ ,nMinLen( bMSCryptoMode ? 1 : 5 )
{
FreeResource();
@@ -90,6 +90,12 @@ PasswordCreateDialog::PasswordCreateDialog( Window* _pParent, ResMgr * pResMgr )
aOKBtn.Enable( sal_False );
+ if ( bMSCryptoMode )
+ {
+ aEDPasswordCrt.SetMaxTextLen( 15 );
+ aEDPasswordRepeat.SetMaxTextLen( 15 );
+ }
+
long nLabelWidth = aFTWarning.GetSizePixel().Width();
long nLabelHeight = aFTWarning.GetSizePixel().Height();
long nTextWidth = aFTWarning.GetCtrlTextWidth( aFTWarning.GetText() );
diff --git a/uui/source/passcrtdlg.hrc b/uui/source/passcrtdlg.hrc
index a899f98853..7add4dcbaf 100644
--- a/uui/source/passcrtdlg.hrc
+++ b/uui/source/passcrtdlg.hrc
@@ -28,19 +28,20 @@
*
************************************************************************/
-#ifndef UUI_PASSCRTDLG_HRC
-#define UUI_PASSCRTDLG_HRC
+#ifndef UUI_PASSCRTDLG_HRC
+#define UUI_PASSCRTDLG_HRC
-// local identifiers
-#define BTN_PASSCRT_CANCEL 1
-#define ED_PASSWORD_CRT 2
-#define FT_PASSWORD_REPEAT 3
-#define FT_PASSWORD_WARNING 4
-#define ED_PASSWORD_REPEAT 5
-#define FL_FIXED_LINE_1 6
-#define BTN_PASSCRT_OK 7
-#define BTN_PASSCRT_HELP 8
-#define FT_PASSWORD_CRT 9
+// local identifiers
+#define BTN_PASSCRT_CANCEL 1
+#define ED_PASSWORD_CRT 2
+#define FT_PASSWORD_REPEAT 3
+#define FT_PASSWORD_WARNING 4
+#define ED_PASSWORD_REPEAT 5
+#define FL_FIXED_LINE_1 6
+#define BTN_PASSCRT_OK 7
+#define BTN_PASSCRT_HELP 8
+#define FT_PASSWORD_CRT 9
+#define FT_MSPASSWORD_WARNING 10
-#endif // UUI_PASSCRTDLG_HRC
+#endif // UUI_PASSCRTDLG_HRC
diff --git a/uui/source/passcrtdlg.hxx b/uui/source/passcrtdlg.hxx
index eeb2ca3a68..76f0435fc7 100644
--- a/uui/source/passcrtdlg.hxx
+++ b/uui/source/passcrtdlg.hxx
@@ -58,7 +58,7 @@ class PasswordCreateDialog : public ModalDialog
DECL_LINK( EditHdl_Impl, Edit * );
public:
- PasswordCreateDialog( Window* pParent, ResMgr * pResMgr );
+ PasswordCreateDialog( Window* pParent, ResMgr * pResMgr, bool bMSCryptoMode = false );
String GetPassword() const { return aEDPasswordCrt.GetText(); }
};
diff --git a/uui/source/passcrtdlg.src b/uui/source/passcrtdlg.src
index 719d13a794..8afff12518 100644
--- a/uui/source/passcrtdlg.src
+++ b/uui/source/passcrtdlg.src
@@ -34,7 +34,7 @@
#include <ids.hrc>
#endif
#ifndef UUI_PASSCRTDLG_HRC
-#include "passcrtdlg.hrc"
+#include "passcrtdlg.hrc"
#endif
ModalDialog DLG_UUI_PASSWORD_CRT
@@ -44,61 +44,68 @@ ModalDialog DLG_UUI_PASSWORD_CRT
Moveable = TRUE ;
OutputSize = TRUE ;
SVLook = TRUE ;
- Size = MAP_APPFONT( 145, 129 );
+ Size = MAP_APPFONT( 145, 129 );
FixedText FT_PASSWORD_CRT
{
- Pos = MAP_APPFONT( 3, 4 );
- Size = MAP_APPFONT( 139, 9 );
- Text [ en-US ] = "Enter password";
+ Pos = MAP_APPFONT( 3, 4 );
+ Size = MAP_APPFONT( 139, 9 );
+ Text [ en-US ] = "Enter password";
};
Edit ED_PASSWORD_CRT
{
Border = TRUE ;
- Pos = MAP_APPFONT( 3, 17 );
+ Pos = MAP_APPFONT( 3, 17 );
Size = MAP_APPFONT( 139, 13 );
PassWord = TRUE ;
};
Edit ED_PASSWORD_REPEAT
{
Border = TRUE ;
- Pos = MAP_APPFONT( 3, 47 );
+ Pos = MAP_APPFONT( 3, 47 );
Size = MAP_APPFONT( 139, 13 );
PassWord = TRUE ;
};
OKButton BTN_PASSCRT_OK
{
- Pos = MAP_APPFONT( 27, 110 );
+ Pos = MAP_APPFONT( 27, 110 );
Size = MAP_APPFONT( 37, 15 );
DefButton = TRUE ;
};
CancelButton BTN_PASSCRT_CANCEL
{
- Pos = MAP_APPFONT( 66, 110 );
- Size = MAP_APPFONT( 37, 15 );
+ Pos = MAP_APPFONT( 66, 110 );
+ Size = MAP_APPFONT( 37, 15 );
};
HelpButton BTN_PASSCRT_HELP
{
- Pos = MAP_APPFONT( 105, 110 );
- Size = MAP_APPFONT( 37, 15 );
+ Pos = MAP_APPFONT( 105, 110 );
+ Size = MAP_APPFONT( 37, 15 );
};
- FixedText FT_PASSWORD_REPEAT
- {
- Pos = MAP_APPFONT( 3, 34 );
- Size = MAP_APPFONT( 139, 9 );
- Text [ en-US ] = "Reenter password";
- };
- FixedText FT_PASSWORD_WARNING
- {
- Pos = MAP_APPFONT( 4, 64 );
- Size = MAP_APPFONT( 137, 40 );
- Text [ en-US ] = "WARNING: If you lose or forget the password, it cannot be recovered. It is advisable to keep passwords in a safe place. Passwords are case-sensitive and at least five characters long.";
- WordBreak = TRUE;
- };
- FixedLine FL_FIXED_LINE_1
- {
- Pos = MAP_APPFONT( 0, 104 );
- Size = MAP_APPFONT( 145, 6 );
+ FixedText FT_PASSWORD_REPEAT
+ {
+ Pos = MAP_APPFONT( 3, 34 );
+ Size = MAP_APPFONT( 139, 9 );
+ Text [ en-US ] = "Reenter password";
+ };
+ FixedText FT_PASSWORD_WARNING
+ {
+ Pos = MAP_APPFONT( 4, 64 );
+ Size = MAP_APPFONT( 137, 40 );
+ Text [ en-US ] = "WARNING: If you lose or forget the password, it cannot be recovered. It is advisable to keep passwords in a safe place. Passwords are case-sensitive and at least five characters long.";
+ WordBreak = TRUE;
+ };
+ FixedText FT_MSPASSWORD_WARNING
+ {
+ Pos = MAP_APPFONT( 4, 64 );
+ Size = MAP_APPFONT( 137, 40 );
+ Text [ en-US ] = "WARNING: If you lose or forget the password, it cannot be recovered. It is advisable to keep passwords in a safe place. Passwords are case-sensitive and at most fifteen characters long.";
+ WordBreak = TRUE;
+ };
+ FixedLine FL_FIXED_LINE_1
+ {
+ Pos = MAP_APPFONT( 0, 104 );
+ Size = MAP_APPFONT( 145, 6 );
};
- Text [ en-US ] = "Enter Password";
+ Text [ en-US ] = "Enter Password";
};
diff --git a/xmloff/inc/RDFaExportHelper.hxx b/xmloff/inc/RDFaExportHelper.hxx
new file mode 100644
index 0000000000..1578dba90c
--- /dev/null
+++ b/xmloff/inc/RDFaExportHelper.hxx
@@ -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: RDFaExportHelper.hxx,v $
+ * $Revision: 1.1.2.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 RDFAEXPORTHELPER_HXX
+#define RDFAEXPORTHELPER_HXX
+
+#include <com/sun/star/uno/Reference.h>
+
+#include <rtl/ustring.hxx>
+
+#include <map>
+
+
+namespace com { namespace sun { namespace star {
+ namespace rdf { class XBlankNode; }
+ namespace rdf { class XMetadatable; }
+ namespace rdf { class XDocumentRepository; }
+} } }
+
+class SvXMLExport;
+
+namespace xmloff {
+
+class SAL_DLLPRIVATE RDFaExportHelper
+{
+private:
+ SvXMLExport & m_rExport;
+
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::rdf::XDocumentRepository> m_xRepository;
+
+ ::rtl::OUString m_RDFsLabel;
+
+ typedef ::std::map< ::rtl::OUString, ::rtl::OUString >
+ BlankNodeMap_t;
+
+ BlankNodeMap_t m_BlankNodeMap;
+
+ long m_Counter;
+
+ ::rtl::OUString
+ LookupBlankNode( ::com::sun::star::uno::Reference<
+ ::com::sun::star::rdf::XBlankNode> const & i_xBlankNode);
+
+public:
+ RDFaExportHelper(SvXMLExport & i_rExport);
+
+ void
+ AddRDFa(::com::sun::star::uno::Reference<
+ ::com::sun::star::rdf::XMetadatable> const & i_xMetadatable);
+};
+
+} // namespace xmloff
+
+#endif // RDFAEXPORTHELPER_HXX
+
diff --git a/xmloff/inc/RDFaImportHelper.hxx b/xmloff/inc/RDFaImportHelper.hxx
new file mode 100644
index 0000000000..431bf18807
--- /dev/null
+++ b/xmloff/inc/RDFaImportHelper.hxx
@@ -0,0 +1,91 @@
+/*************************************************************************
+ *
+ * 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: RDFaImportHelper.hxx,v $
+ * $Revision: 1.1.2.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 RDFAIMPORTHELPER_HXX
+#define RDFAIMPORTHELPER_HXX
+
+#include <com/sun/star/uno/Reference.h>
+
+#include <vector>
+
+
+namespace rtl { class OUString; }
+
+namespace com { namespace sun { namespace star {
+ namespace uno { class XComponentContext; }
+ namespace rdf { class XMetadatable; }
+ namespace rdf { class XRepositorySupplier; }
+} } }
+
+class SvXMLImport;
+
+namespace xmloff {
+
+struct RDFaEntry;
+
+class SAL_DLLPRIVATE RDFaImportHelper
+{
+
+private:
+ const SvXMLImport & m_rImport;
+
+ typedef ::std::vector< RDFaEntry > RDFaEntries_t;
+
+ RDFaEntries_t m_RDFaEntries;
+
+ const SvXMLImport & GetImport() const { return m_rImport; }
+
+
+public:
+ RDFaImportHelper(const SvXMLImport & i_rImport);
+
+ ~RDFaImportHelper();
+
+ /** Add a RDFa statement; parameters are XML attribute values */
+ void AddRDFa(
+ ::com::sun::star::uno::Reference< ::com::sun::star::rdf::XMetadatable>
+ i_xObject,
+ ::rtl::OUString const & i_rAbout,
+ ::rtl::OUString const & i_rProperty,
+ ::rtl::OUString const & i_rContent,
+ ::rtl::OUString const & i_rDatatype);
+
+ /** Insert all added statements into the RDF repository.
+ <p> This is done <em>after</em> the input file has been read,
+ to prevent collision between generated ids and ids in the file.</p>
+ */
+ void InsertRDFa( ::com::sun::star::uno::Reference<
+ ::com::sun::star::rdf::XRepositorySupplier > const & i_xModel);
+};
+
+} // namespace xmloff
+
+#endif // RDFAIMPORTHELPER_HXX
+
diff --git a/xmloff/inc/SchXMLImport.hxx b/xmloff/inc/SchXMLImport.hxx
index ed1c501569..396a2ba5d2 100644
--- a/xmloff/inc/SchXMLImport.hxx
+++ b/xmloff/inc/SchXMLImport.hxx
@@ -102,6 +102,7 @@ enum SchXMLAxisElemTokenMap
enum SchXMLChartAttrMap
{
+ XML_TOK_CHART_HREF,
XML_TOK_CHART_CLASS,
XML_TOK_CHART_WIDTH,
XML_TOK_CHART_HEIGHT,
diff --git a/xmloff/inc/txtflde.hxx b/xmloff/inc/txtflde.hxx
index a87b01b721..fe988a8773 100644
--- a/xmloff/inc/txtflde.hxx
+++ b/xmloff/inc/txtflde.hxx
@@ -38,9 +38,7 @@
#include <com/sun/star/uno/Reference.h>
#include "xmlnmspe.hxx"
-#ifndef _RTL_USTRING
#include <rtl/ustring.hxx>
-#endif
#include <xmloff/xmltoken.hxx>
#include <map>
@@ -148,6 +146,8 @@ enum FieldIdEnum {
FIELD_ID_COMBINED_CHARACTERS, // combined characters (asian typography)
+ FIELD_ID_META, // text:meta-field (RDF metadata)
+
FIELD_ID_MEASURE, // for measure shapes
FIELD_ID_TABLE_FORMULA, // DEPRECATED: table formulas (Writer 2.0)
@@ -182,14 +182,16 @@ public:
/// Export this field and the surrounding span element with the formatting.
/// To be called for every field in the document body.
void ExportField(const ::com::sun::star::uno::Reference <
- ::com::sun::star::text::XTextField > & rTextField );
+ ::com::sun::star::text::XTextField > & rTextField,
+ sal_Bool bProgress );
/// collect styles (character styles, data styles, ...) for this field
/// (if appropriate).
/// Also collect used field masters (if pUsedMasters is set)
/// to be called for every field during style export.
void ExportFieldAutoStyle(const ::com::sun::star::uno::Reference <
- ::com::sun::star::text::XTextField > & rTextField );
+ ::com::sun::star::text::XTextField > & rTextField,
+ sal_Bool bProgress );
/// export field declarations.
/// to be called once at beginning of document body.
@@ -239,7 +241,8 @@ protected:
::com::sun::star::beans::XPropertySet> & rPropSet,
const ::com::sun::star::uno::Reference<
::com::sun::star::beans::XPropertySet> & rRangePropSet,
- enum FieldIdEnum nToken);
+ enum FieldIdEnum nToken,
+ sal_Bool bProgress );
/// export an empty element
void ExportElement(enum ::xmloff::token::XMLTokenEnum eElement, /// element token
@@ -257,6 +260,11 @@ protected:
::com::sun::star::beans::XPropertySet> & rPropSet,
const ::rtl::OUString& rContent);
+ /// export text:meta-field (RDF metadata)
+ void ExportMetaField( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet> & i_xMeta,
+ bool i_bAutoStyles, sal_Bool i_bProgress );
+
/// export a boolean attribute
void ProcessBoolean(
enum ::xmloff::token::XMLTokenEnum eXmlName, /// attribute token (namespace text)
diff --git a/xmloff/inc/xmlkywd.hxx b/xmloff/inc/xmlkywd.hxx
index b398007c01..fbc8165cfc 100644
--- a/xmloff/inc/xmlkywd.hxx
+++ b/xmloff/inc/xmlkywd.hxx
@@ -1991,4 +1991,11 @@ XML_CONSTASCII_ACTION( sXML_readonly, "readonly" );
XML_CONSTASCII_ACTION( sXML_page_continuation, "page-continuation" );
+XML_CONSTASCII_ACTION( sXML_contains, "contains" );
+XML_CONSTASCII_ACTION( sXML_does_not_contain, "does-not-contain" );
+XML_CONSTASCII_ACTION( sXML_begins_with, "begins-with" );
+XML_CONSTASCII_ACTION( sXML_does_not_begin_with, "does-not-begin-with" );
+XML_CONSTASCII_ACTION( sXML_ends_with, "ends-with" );
+XML_CONSTASCII_ACTION( sXML_does_not_end_with, "does-not-end-with" );
+
#endif
diff --git a/xmloff/inc/xmlnmspe.hxx b/xmloff/inc/xmlnmspe.hxx
index a3212f2477..86fc13ba31 100644
--- a/xmloff/inc/xmlnmspe.hxx
+++ b/xmloff/inc/xmlnmspe.hxx
@@ -79,9 +79,10 @@ XML_NAMESPACE( ANIMATION, 31U )
XML_NAMESPACE( XML, 32U )
XML_NAMESPACE( REPORT, 33U )
XML_NAMESPACE( OF, 34U ) // OpenFormula aka ODFF
-XML_NAMESPACE( RDFA, 35U )
+XML_NAMESPACE( XHTML, 35U )
+XML_NAMESPACE( GRDDL, 36U )
-#define _XML_OLD_NAMESPACE_BASE 36U
+#define _XML_OLD_NAMESPACE_BASE 37U
// namespaces used in the technical preview (SO 5.2)
XML_OLD_NAMESPACE( FO, 0U )
diff --git a/xmloff/inc/xmloff/SchXMLExportHelper.hxx b/xmloff/inc/xmloff/SchXMLExportHelper.hxx
index 284c6d9662..37b7af0840 100644
--- a/xmloff/inc/xmloff/SchXMLExportHelper.hxx
+++ b/xmloff/inc/xmloff/SchXMLExportHelper.hxx
@@ -233,13 +233,6 @@ public:
const ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XChartDocument > & xChartDoc );
- // if no data provider exists by, now the model (as XChild) is asked for its
- // parent which creates the data provider that is finally set at the chart
- // document
- static ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataProvider >
- GetDataProvider( const ::com::sun::star::uno::Reference<
- ::com::sun::star::chart2::XChartDocument > & xChartDoc );
-
::com::sun::star::awt::Size getPageSize(
const ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XChartDocument > & xChartDoc ) const;
diff --git a/xmloff/inc/xmloff/SchXMLImportHelper.hxx b/xmloff/inc/xmloff/SchXMLImportHelper.hxx
index 7630c8e453..e89c1d667e 100644
--- a/xmloff/inc/xmloff/SchXMLImportHelper.hxx
+++ b/xmloff/inc/xmloff/SchXMLImportHelper.hxx
@@ -143,13 +143,6 @@ public:
sal_Int32 GetLengthOfSeries();
void ResizeChartData( sal_Int32 nSeries, sal_Int32 nDataPoints = -1 );
- // if no data provider exists by, now the model (as XChild) is asked for its
- // parent which creates the data provider that is finally set at the chart
- // document
- static ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataProvider >
- GetDataProvider( const ::com::sun::star::uno::Reference<
- ::com::sun::star::chart2::XChartDocument > & xChartDoc );
-
/** @param bPushLastChartType If </FALSE>, in case a new chart type has to
be added (because it does not exist yet), it is appended at the
end of the chart-type container. When </TRUE>, a new chart type
diff --git a/xmloff/inc/xmloff/table/XMLTableExport.hxx b/xmloff/inc/xmloff/table/XMLTableExport.hxx
index 9d42ffc109..041c96d194 100644
--- a/xmloff/inc/xmloff/table/XMLTableExport.hxx
+++ b/xmloff/inc/xmloff/table/XMLTableExport.hxx
@@ -75,7 +75,7 @@ typedef ::std::map< const ::com::sun::star::uno::Reference< com::sun::star::tabl
class XMLOFF_DLLPUBLIC XMLTableExport : public UniRefBase
{
public:
- XMLTableExport(SvXMLExport& rExp, const rtl::Reference< XMLPropertySetMapper >& xCellPropertySetMapper, const rtl::Reference< XMLPropertyHandlerFactory >& xFactoryRef );
+ XMLTableExport(SvXMLExport& rExp, const rtl::Reference< SvXMLExportPropertyMapper >& xCellExportPropertySetMapper, const rtl::Reference< XMLPropertyHandlerFactory >& xFactoryRef );
virtual ~XMLTableExport();
// This method collects all automatic styles for the given table
diff --git a/xmloff/inc/xmloff/txtimp.hxx b/xmloff/inc/xmloff/txtimp.hxx
index e2544ec345..381973917d 100644
--- a/xmloff/inc/xmloff/txtimp.hxx
+++ b/xmloff/inc/xmloff/txtimp.hxx
@@ -253,6 +253,10 @@ enum XMLTextPElemTokens
enum XMLTextPAttrTokens
{
XML_TOK_TEXT_P_XMLID,
+ XML_TOK_TEXT_P_ABOUT,
+ XML_TOK_TEXT_P_PROPERTY,
+ XML_TOK_TEXT_P_CONTENT,
+ XML_TOK_TEXT_P_DATATYPE,
XML_TOK_TEXT_P_STYLE_NAME,
XML_TOK_TEXT_P_COND_STYLE_NAME,
XML_TOK_TEXT_P_LEVEL,
diff --git a/xmloff/inc/xmloff/txtparae.hxx b/xmloff/inc/xmloff/txtparae.hxx
index 2794f26991..d8ee1a3846 100644
--- a/xmloff/inc/xmloff/txtparae.hxx
+++ b/xmloff/inc/xmloff/txtparae.hxx
@@ -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
@@ -38,9 +38,7 @@
#include <com/sun/star/beans/PropertyValue.hpp>
#include <xmloff/uniref.hxx>
#include <xmloff/xmlexppr.hxx>
-#ifndef _XMLOFF_STYLEEXP_HXX
#include <xmloff/styleexp.hxx>
-#endif
#include <xmloff/xmltoken.hxx>
#include <xmloff/SinglePropertySetInfoCache.hxx>
#include <xmloff/XMLStringVector.hxx>
@@ -125,7 +123,11 @@ class XMLOFF_DLLPUBLIC XMLTextParagraphExport : public XMLStyleExport
protected:
const ::rtl::OUString sActualSize;
- const ::rtl::OUString sAlternativeText;
+ // --> OD 2009-07-22 #i73249#
+// const ::rtl::OUString sAlternativeText;
+ const ::rtl::OUString sTitle;
+ const ::rtl::OUString sDescription;
+ // <--
const ::rtl::OUString sAnchorCharStyleName;
const ::rtl::OUString sAnchorPageNo;
const ::rtl::OUString sAnchorType;
@@ -264,6 +266,12 @@ public:
const ::com::sun::star::uno::Reference <
::com::sun::star::beans::XPropertySetInfo > & rPropSetInfo );
+ void exportTextRangeEnumeration(
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::container::XEnumeration > & rRangeEnum,
+ sal_Bool bAutoStyles, sal_Bool bProgress,
+ sal_Bool bPrvChrIsSpc = sal_True );
+
protected:
sal_Int32 addTextFrameAttributes(
@@ -316,16 +324,11 @@ protected:
const ::com::sun::star::uno::Reference <
::com::sun::star::text::XTextContent > & rTextContent,
sal_Bool bAutoStyles, sal_Bool bProgress );
- void exportTextRangeEnumeration(
- const ::com::sun::star::uno::Reference <
- ::com::sun::star::container::XEnumeration > & rRangeEnum,
- sal_Bool bAutoStyles, sal_Bool bProgress,
- sal_Bool bPrvChrIsSpc = sal_True );
void exportTextField(
const ::com::sun::star::uno::Reference <
::com::sun::star::text::XTextRange > & rTextRange,
- sal_Bool bAutoStyles );
+ sal_Bool bAutoStyles, sal_Bool bProgress );
void exportAnyTextFrame(
const ::com::sun::star::uno::Reference <
@@ -484,6 +487,12 @@ protected:
::com::sun::star::beans::XPropertySet> & rPortionPropSet,
sal_Bool bAutoStyles );
+ /// export a text:meta
+ void exportMeta(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet> & i_xMeta,
+ sal_Bool i_bAutoStyles, sal_Bool i_isProgress );
+
public:
XMLTextParagraphExport(
@@ -600,8 +609,12 @@ public:
virtual void exportTextAutoStyles();
void exportEvents( const ::com::sun::star::uno::Reference < com::sun::star::beans::XPropertySet > & rPropSet );
- void exportAlternativeText( const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet > & rPropSet,
- const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySetInfo > & rPropSetInfo );
+ // --> OD 2009-07-22 #i73249#
+// void exportAlternativeText( const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet > & rPropSet,
+// const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySetInfo > & rPropSetInfo );
+ void exportTitleAndDescription( const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet > & rPropSet,
+ const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySetInfo > & rPropSetInfo );
+ // <--
// This method exports the given XText
void exportText(
diff --git a/xmloff/inc/xmloff/txtprmap.hxx b/xmloff/inc/xmloff/txtprmap.hxx
index 3cbdeaa98e..c1dbb2bba1 100644
--- a/xmloff/inc/xmloff/txtprmap.hxx
+++ b/xmloff/inc/xmloff/txtprmap.hxx
@@ -71,7 +71,7 @@
#define CTF_FONTFAMILY (XML_TEXT_CTF_START + 36)
#define CTF_FONTPITCH (XML_TEXT_CTF_START + 37)
#define CTF_FONTCHARSET (XML_TEXT_CTF_START + 38)
-// (XML_TEXT_CTF_START + 39)
+#define CTF_TEXTWRITINGMODE (XML_TEXT_CTF_START + 39)
#define CTF_SYNCHEIGHT_MIN (XML_TEXT_CTF_START + 40)
#define CTF_FRAMEHEIGHT_ABS (XML_TEXT_CTF_START + 41)
#define CTF_FRAMEHEIGHT_REL (XML_TEXT_CTF_START + 42)
diff --git a/xmloff/inc/xmloff/xmlexp.hxx b/xmloff/inc/xmloff/xmlexp.hxx
index ffc08fa856..8f487b8556 100644
--- a/xmloff/inc/xmloff/xmlexp.hxx
+++ b/xmloff/inc/xmloff/xmlexp.hxx
@@ -92,6 +92,7 @@ class XMLErrors;
namespace rtl { class OUString; }
namespace com { namespace sun { namespace star {
+ namespace uno { class XComponentContext; }
namespace frame { class XModel; }
namespace container { class XIndexContainer; }
} } }
@@ -362,6 +363,22 @@ public:
// XUnoTunnel
virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
+ /** ensures that the given namespace is in scope at the next started
+ element.
+
+ <p>If the namespace is not yet declared, the necessary attribute will
+ be added, as well.</p>
+
+ @param i_rNamespace the namespace to be declared
+ @param i_rPreferredPrefix (opt.) preferred prefix for the namespace
+
+ @returns the actual prefix that the namespace is associated with
+ */
+ ::rtl::OUString
+ EnsureNamespace(::rtl::OUString const & i_rNamespace,
+ ::rtl::OUString const & i_rPreferredPrefix
+ = ::rtl::OUString::createFromAscii("gen") );
+
// Check if common attribute list is empty.
#ifndef DBG_UTIL
void CheckAttrList() {}
@@ -553,6 +570,9 @@ public:
// #110680#
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > getServiceFactory();
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
+ GetComponentContext() const;
+
// --> OD 2006-03-10 #i51726#
SvtModuleOptions::EFactory GetModelType() const
{
@@ -570,13 +590,17 @@ public:
/// returns the currently configured default version for odf export
SvtSaveOptions::ODFDefaultVersion getDefaultVersion() const;
- /// relative path of stream in package, e.g. "someobject/content.xml"
- ::rtl::OUString GetStreamPath() const;
+ /// name of stream in package, e.g., "content.xml"
+ ::rtl::OUString GetStreamName() const;
/// add xml:id attribute (for RDF metadata)
void AddAttributeXmlId(::com::sun::star::uno::Reference<
::com::sun::star::uno::XInterface> const & i_xIfc);
+ /// add RDFa attributes for a metadatable text content
+ void AddAttributesRDFa( ::com::sun::star::uno::Reference<
+ ::com::sun::star::text::XTextContent> const & i_xTextContent);
+
// --> OD 2008-11-26 #158694#
sal_Bool exportTextNumberElement() const;
// <--
diff --git a/xmloff/inc/xmloff/xmlimp.hxx b/xmloff/inc/xmloff/xmlimp.hxx
index 3ca4633a66..5cc2734cf9 100644
--- a/xmloff/inc/xmloff/xmlimp.hxx
+++ b/xmloff/inc/xmloff/xmlimp.hxx
@@ -61,8 +61,10 @@
namespace rtl { class OUString; }
namespace com { namespace sun { namespace star {
+ namespace uno { class XComponentContext; }
namespace frame { class XModel; }
namespace io { class XOutputStream; }
+ namespace rdf { class XMetadatable; }
} } }
namespace comphelper { class UnoInterfaceToUniqueIdentifierMapper; }
@@ -346,7 +348,7 @@ public:
sal_uInt16 getImportFlags() const { return mnImportFlags; }
sal_Bool IsFormsSupported() const { return mbIsFormsSupported; }
- rtl::OUString GetAbsoluteReference(const rtl::OUString& rValue);
+ rtl::OUString GetAbsoluteReference(const rtl::OUString& rValue) const;
sal_Unicode ConvStarBatsCharToStarSymbol( sal_Unicode c );
sal_Unicode ConvStarMathCharToStarSymbol( sal_Unicode c );
@@ -400,6 +402,9 @@ public:
// #110680#
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > getServiceFactory();
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
+ GetComponentContext() const;
+
// --> OD 2004-08-10 #i28749#
sal_Bool IsShapePositionInHoriL2R() const;
// <--
@@ -411,14 +416,23 @@ public:
String GetBaseURL() const;
String GetDocumentBase() const;
- /// relative path of stream in package, e.g. "someobject/content.xml"
- ::rtl::OUString GetStreamPath() const;
+ /// name of stream in package, e.g., "content.xml"
+ ::rtl::OUString GetStreamName() const;
/// set the XmlId attribute of given UNO object (for RDF metadata)
void SetXmlId(::com::sun::star::uno::Reference<
::com::sun::star::uno::XInterface> const & i_xIfc,
::rtl::OUString const & i_rXmlId);
+ /// Add a RDFa statement; parameters are XML attribute values
+ void AddRDFa(
+ ::com::sun::star::uno::Reference< ::com::sun::star::rdf::XMetadatable>
+ i_xObject,
+ ::rtl::OUString const & i_rAbout,
+ ::rtl::OUString const & i_rProperty,
+ ::rtl::OUString const & i_rContent,
+ ::rtl::OUString const & i_rDatatype);
+
// #i31958# XForms helper method
// (to be implemented by applications suporting XForms)
virtual void initXForms();
diff --git a/xmloff/inc/xmloff/xmlimppr.hxx b/xmloff/inc/xmloff/xmlimppr.hxx
index 6d1e07ea56..243c050117 100644
--- a/xmloff/inc/xmloff/xmlimppr.hxx
+++ b/xmloff/inc/xmloff/xmlimppr.hxx
@@ -80,6 +80,7 @@ class XMLOFF_DLLPUBLIC SvXMLImportPropertyMapper : public UniRefBase
protected:
UniReference< XMLPropertySetMapper > maPropMapper;
+ SvXMLImport& GetImport() const { return rImport;}
public:
diff --git a/xmloff/inc/xmloff/xmlmetai.hxx b/xmloff/inc/xmloff/xmlmetai.hxx
index 5c279274f3..d525c74636 100644
--- a/xmloff/inc/xmloff/xmlmetai.hxx
+++ b/xmloff/inc/xmloff/xmlmetai.hxx
@@ -35,6 +35,7 @@
#include "xmloff/dllapi.h"
#include <xmloff/xmlictxt.hxx>
+#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/document/XDocumentProperties.hpp>
#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
@@ -76,6 +77,10 @@ protected:
void initDocumentProperties();
// set the BuildId property at the importer
void setBuildId(const ::rtl::OUString & i_rBuildId);
+
+public:
+ static void setBuildId(const ::rtl::OUString & rGenerator,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& xImportInfo );
};
#endif // _XMLOFF_XMLMETAI_HXX
diff --git a/xmloff/inc/xmloff/xmltoken.hxx b/xmloff/inc/xmloff/xmltoken.hxx
index 14ccf7a3a9..0010b61069 100644
--- a/xmloff/inc/xmloff/xmltoken.hxx
+++ b/xmloff/inc/xmloff/xmltoken.hxx
@@ -138,9 +138,11 @@ namespace xmloff { namespace token {
XML_NP_OF,
XML_N_OF,
- // ODF 1.2 metadata: RDFa
- XML_NP_RDFA,
- XML_N_RDFA,
+ // ODF 1.2 metadata: RDFa and GRDDL
+ XML_NP_XHTML,
+ XML_N_XHTML,
+ XML_NP_GRDDL,
+ XML_N_GRDDL,
// units
XML_UNIT_MM,
@@ -3041,6 +3043,7 @@ namespace xmloff { namespace token {
XML_META_FIELD,
XML_ABOUT,
XML_DATATYPE,
+ XML_TRANSFORMATION,
// ODF 1.2 numbered-paragraph
XML_LIST_ID,
@@ -3071,6 +3074,7 @@ namespace xmloff { namespace token {
XML_AT_LABELS,
XML_AT_AXIS,
XML_AT_LABELS_AND_AXIS,
+ XML_FILLED_RADAR,
// MathML only
XML_MATHVARIANT,
@@ -3078,6 +3082,13 @@ namespace xmloff { namespace token {
XML_MATHWEIGHT,
XML_MATHCOLOR,
+ XML_CONTAINS,
+ XML_DOES_NOT_CONTAIN,
+ XML_BEGINS_WITH,
+ XML_DOES_NOT_BEGIN_WITH,
+ XML_ENDS_WITH,
+ XML_DOES_NOT_END_WITH,
+
XML_TOKEN_END
};
diff --git a/xmloff/source/chart/SchXMLChartContext.cxx b/xmloff/source/chart/SchXMLChartContext.cxx
index 44f1fdf27f..f44f23a939 100644
--- a/xmloff/source/chart/SchXMLChartContext.cxx
+++ b/xmloff/source/chart/SchXMLChartContext.cxx
@@ -228,6 +228,57 @@ void lcl_removeEmptyChartTypeGroups( const uno::Reference< chart2::XChartDocumen
}
}
+uno::Sequence< sal_Int32 > lcl_getNumberSequenceFromString( const ::rtl::OUString& rStr, bool bAddOneToEachOldIndex )
+{
+ const sal_Unicode aSpace( ' ' );
+
+ // count number of entries
+ ::std::vector< sal_Int32 > aVec;
+ sal_Int32 nLastPos = 0;
+ sal_Int32 nPos = 0;
+ while( nPos != -1 )
+ {
+ nPos = rStr.indexOf( aSpace, nLastPos );
+ if( nPos > nLastPos )
+ {
+ aVec.push_back( rStr.copy( nLastPos, (nPos - nLastPos) ).toInt32() );
+ }
+ if( nPos != -1 )
+ nLastPos = nPos + 1;
+ }
+ // last entry
+ if( nLastPos != 0 &&
+ rStr.getLength() > nLastPos )
+ {
+ aVec.push_back( rStr.copy( nLastPos, (rStr.getLength() - nLastPos) ).toInt32() );
+ }
+
+ const sal_Int32 nVecSize = aVec.size();
+ uno::Sequence< sal_Int32 > aSeq( nVecSize );
+
+ if(!bAddOneToEachOldIndex)
+ {
+ sal_Int32* pSeqArr = aSeq.getArray();
+ for( nPos = 0; nPos < nVecSize; ++nPos )
+ {
+ pSeqArr[ nPos ] = aVec[ nPos ];
+ }
+ }
+ else if( bAddOneToEachOldIndex )
+ {
+ aSeq.realloc( nVecSize+1 );
+ aSeq[0]=0;
+
+ sal_Int32* pSeqArr = aSeq.getArray();
+ for( nPos = 0; nPos < nVecSize; ++nPos )
+ {
+ pSeqArr[ nPos+1 ] = aVec[ nPos ]+1;
+ }
+ }
+
+ return aSeq;
+}
+
} // anonymous namespace
static __FAR_DATA SvXMLEnumMapEntry aXMLLegendAlignmentMap[] =
@@ -249,7 +300,8 @@ SchXMLChartContext::SchXMLChartContext( SchXMLImportHelper& rImpHelper,
SvXMLImport& rImport, const rtl::OUString& rLocalName ) :
SvXMLImportContext( rImport, XML_NAMESPACE_CHART, rLocalName ),
mrImportHelper( rImpHelper ),
- mbHasOwnTable( sal_True ),
+ m_bHasRangeAtPlotArea( false ),
+ m_bHasTableElement( false ),
mbAllRangeAddressesAvailable( sal_True ),
mbColHasLabels( sal_False ),
mbRowHasLabels( sal_False ),
@@ -269,7 +321,6 @@ void SchXMLChartContext::StartElement( const uno::Reference< xml::sax::XAttribut
awt::Size aChartSize;
// this flag is necessarry for pie charts in the core
sal_Bool bSetSwitchData = sal_False;
- sal_Bool bDomainForDefaultDataNeeded = sal_False;
::rtl::OUString sAutoStyleName;
::rtl::OUString aOldChartTypeName;
@@ -284,6 +335,10 @@ void SchXMLChartContext::StartElement( const uno::Reference< xml::sax::XAttribut
switch( rAttrTokenMap.Get( nPrefix, aLocalName ))
{
+ case XML_TOK_CHART_HREF:
+ m_aXLinkHRefAttributeToIndicateDataProvider = aValue;
+ break;
+
case XML_TOK_CHART_CLASS:
{
rtl::OUString sClassName;
@@ -302,15 +357,9 @@ void SchXMLChartContext::StartElement( const uno::Reference< xml::sax::XAttribut
case XML_CHART_CLASS_CIRCLE:
bSetSwitchData = sal_True;
break;
- case XML_CHART_CLASS_SCATTER:
- bDomainForDefaultDataNeeded = sal_True;
- break;
case XML_CHART_CLASS_STOCK:
mbIsStockChart = true;
break;
- case XML_CHART_CLASS_BUBBLE:
- DBG_ERROR( "Bubble chart not supported yet" );
- break;
default:
break;
}
@@ -321,10 +370,6 @@ void SchXMLChartContext::StartElement( const uno::Reference< xml::sax::XAttribut
// service is taken from add-in-name attribute
bHasAddin = true;
- // for service charts assume domain in base type
- // if base type doesn't use a domain this is ok,
- // the data just grows bigger
- bDomainForDefaultDataNeeded = sal_True;
aOldChartTypeName = sClassName;
maChartTypeServiceName = sClassName;
}
@@ -361,7 +406,7 @@ void SchXMLChartContext::StartElement( const uno::Reference< xml::sax::XAttribut
maChartTypeServiceName = SchXMLTools::GetChartTypeByClassName( aChartClass_Bar, false /* bUseOldNames */ );
}
- InitChart (aChartSize, bDomainForDefaultDataNeeded, aOldChartTypeName, bSetSwitchData);
+ InitChart (aChartSize, aOldChartTypeName, bSetSwitchData);
if( bHasAddin )
{
@@ -617,14 +662,21 @@ bool lcl_SpecialHandlingForDonutChartNeeded(
} // anonymous namespace
-void SchXMLChartContext::ChangeDiagramAccordingToTemplate(
- const uno::Reference< chart2::XChartDocument >& xNewDoc )
+
+void lcl_ApplyDataFromRectangularRangeToDiagram(
+ const uno::Reference< chart2::XChartDocument >& xNewDoc
+ , const rtl::OUString& rRectangularRange
+ , ::com::sun::star::chart::ChartDataRowSource eDataRowSource
+ , bool bRowHasLabels, bool bColHasLabels
+ , bool bSwitchOnLabelsAndCategoriesForOwnData
+ , const rtl::OUString& sColTrans
+ , const rtl::OUString& sRowTrans )
{
if( !xNewDoc.is() )
return;
uno::Reference< chart2::XDiagram > xNewDia( xNewDoc->getFirstDiagram());
- uno::Reference< chart2::data::XDataProvider > xDataProvider( mrImportHelper.GetDataProvider( xNewDoc ) );
+ uno::Reference< chart2::data::XDataProvider > xDataProvider( xNewDoc->getDataProvider() );
if( !xNewDia.is() || !xDataProvider.is() )
return;
@@ -633,11 +685,11 @@ void SchXMLChartContext::ChangeDiagramAccordingToTemplate(
return;
sal_Bool bFirstCellAsLabel =
- (meDataRowSource==chart::ChartDataRowSource_COLUMNS)? mbRowHasLabels : mbColHasLabels;
+ (eDataRowSource==chart::ChartDataRowSource_COLUMNS)? bRowHasLabels : bColHasLabels;
sal_Bool bHasCateories =
- (meDataRowSource==chart::ChartDataRowSource_COLUMNS)? mbColHasLabels : mbRowHasLabels;
+ (eDataRowSource==chart::ChartDataRowSource_COLUMNS)? bColHasLabels : bRowHasLabels;
- if( mbHasOwnTable )
+ if( bSwitchOnLabelsAndCategoriesForOwnData )
{
bFirstCellAsLabel = true;
bHasCateories = true;
@@ -646,25 +698,25 @@ void SchXMLChartContext::ChangeDiagramAccordingToTemplate(
uno::Sequence< beans::PropertyValue > aArgs( 3 );
aArgs[0] = beans::PropertyValue(
::rtl::OUString::createFromAscii("CellRangeRepresentation"),
- -1, uno::makeAny( msChartAddress ),
+ -1, uno::makeAny( rRectangularRange ),
beans::PropertyState_DIRECT_VALUE );
aArgs[1] = beans::PropertyValue(
::rtl::OUString::createFromAscii("DataRowSource"),
- -1, uno::makeAny( meDataRowSource ),
+ -1, uno::makeAny( eDataRowSource ),
beans::PropertyState_DIRECT_VALUE );
aArgs[2] = beans::PropertyValue(
::rtl::OUString::createFromAscii("FirstCellAsLabel"),
-1, uno::makeAny( bFirstCellAsLabel ),
beans::PropertyState_DIRECT_VALUE );
- if( msColTrans.getLength() || msRowTrans.getLength() )
+ if( sColTrans.getLength() || sRowTrans.getLength() )
{
aArgs.realloc( aArgs.getLength() + 1 );
aArgs[ aArgs.getLength() - 1 ] = beans::PropertyValue(
::rtl::OUString::createFromAscii("SequenceMapping"),
- -1, uno::makeAny( msColTrans.getLength()
- ? GetNumberSequenceFromString( msColTrans, bHasCateories && !xNewDoc->hasInternalDataProvider() )
- : GetNumberSequenceFromString( msRowTrans, bHasCateories && !xNewDoc->hasInternalDataProvider() ) ),
+ -1, uno::makeAny( sColTrans.getLength()
+ ? lcl_getNumberSequenceFromString( sColTrans, bHasCateories && !xNewDoc->hasInternalDataProvider() )
+ : lcl_getNumberSequenceFromString( sRowTrans, bHasCateories && !xNewDoc->hasInternalDataProvider() ) ),
beans::PropertyState_DIRECT_VALUE );
}
@@ -777,21 +829,36 @@ void SchXMLChartContext::EndElement()
if(!xNewDoc.is())
return;
- // if we already have an internal data provider, we know that we cannot have
- // external data here. If we can have external data but know that we have
- // internal data due to missing ranges, we must create an internal data
- // provider
+ bool bHasOwnData = false;
+ if( m_aXLinkHRefAttributeToIndicateDataProvider.equalsAscii( "." ) ) //data comes from the chart itself
+ bHasOwnData = true;
+ else if( m_aXLinkHRefAttributeToIndicateDataProvider.equalsAscii( ".." ) ) //data comes from the parent application
+ bHasOwnData = false;
+ else if( m_aXLinkHRefAttributeToIndicateDataProvider.getLength() ) //not supported so far to get the data by sibling objects -> fall back to chart itself if data are available
+ bHasOwnData = m_bHasTableElement;
+ else
+ bHasOwnData = !m_bHasRangeAtPlotArea;
+
if( xNewDoc->hasInternalDataProvider())
- mbHasOwnTable = true;
- else if( mbHasOwnTable )
+ {
+ if( !m_bHasTableElement && !m_aXLinkHRefAttributeToIndicateDataProvider.equalsAscii( "." ) )
+ {
+ //#i103147# ODF, workaround broken files with a missing table:cell-range-address at the plot-area
+ bool bSwitchSuccessful = SchXMLTools::switchBackToDataProviderFromParent( xNewDoc, maLSequencesPerIndex );
+ bHasOwnData = !bSwitchSuccessful;
+ }
+ else
+ bHasOwnData = true;//e.g. in case of copy->paste from calc to impress
+ }
+ else if( bHasOwnData )
{
xNewDoc->createInternalDataProvider( sal_False /* bCloneExistingData */ );
}
- if( mbHasOwnTable )
+ if( bHasOwnData )
msChartAddress = ::rtl::OUString::createFromAscii("all");
- bool bPostProcessTable = false;
- if( !mbHasOwnTable && mbAllRangeAddressesAvailable )
+ bool bSwitchRangesFromOuterToInternalIfNecessary = false;
+ if( !bHasOwnData && mbAllRangeAddressesAvailable )
{
// special handling for stock chart (merge series together)
if( mbIsStockChart )
@@ -799,24 +866,28 @@ void SchXMLChartContext::EndElement()
}
else if( msChartAddress.getLength() )
{
- // in this case there are range addresses that are simply wrong.
+ //own data or only rectangular range available
+
bool bOlderThan2_3 = SchXMLTools::isDocumentGeneratedWithOpenOfficeOlderThan2_3( Reference< frame::XModel >( xNewDoc, uno::UNO_QUERY ));
- bool bOldFileWithOwnDataFromRows = (bOlderThan2_3 && mbHasOwnTable && (meDataRowSource==chart::ChartDataRowSource_ROWS));
+ bool bOldFileWithOwnDataFromRows = (bOlderThan2_3 && bHasOwnData && (meDataRowSource==chart::ChartDataRowSource_ROWS)); // in this case there are range addresses that are simply wrong.
+
if( mbAllRangeAddressesAvailable && !bSpecialHandlingForDonutChart && !mbIsStockChart &&
!bOldFileWithOwnDataFromRows )
{
- // note: mbRowHasLabels means the first row contains labels, that
- // means we have "column-descriptions", (analogously mbColHasLabels
- // means we have "row-descriptions")
- SchXMLTableHelper::applyTable( maTable, xNewDoc );
- bPostProcessTable = true;
+ //bHasOwnData is true in this case!
+ //e.g. for normal files with own data or also in case of copy paste scenario (e.g. calc to impress)
+ if( xNewDoc->hasInternalDataProvider() )
+ SchXMLTableHelper::applyTableToInternalDataProvider( maTable, xNewDoc );
+ bSwitchRangesFromOuterToInternalIfNecessary = true;
}
else
{
+ //apply data from rectangular range
+
// apply data read from the table sub-element to the chart
// if the data provider supports the XChartDataArray interface like
// the internal data provider
- uno::Reference< chart::XChartDataArray > xChartData( mrImportHelper.GetDataProvider( xNewDoc ), uno::UNO_QUERY );
+ uno::Reference< chart::XChartDataArray > xChartData( xNewDoc->getDataProvider(), uno::UNO_QUERY );
if( xChartData.is())
SchXMLTableHelper::applyTableSimple( maTable, xChartData );
@@ -826,29 +897,32 @@ void SchXMLChartContext::EndElement()
{
if( bOlderThan2_3 && xDiaProp.is() )//for older charts the hidden cells were removed by calc on the fly
xDiaProp->setPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IncludeHiddenCells")),uno::makeAny(false));
- ChangeDiagramAccordingToTemplate( xNewDoc );
+
+ // note: mbRowHasLabels means the first row contains labels, that means we have "column-descriptions",
+ // (analogously mbColHasLabels means we have "row-descriptions")
+ lcl_ApplyDataFromRectangularRangeToDiagram( xNewDoc, msChartAddress, meDataRowSource, mbRowHasLabels, mbColHasLabels, bHasOwnData, msColTrans, msRowTrans );
}
catch( uno::Exception & )
{
//try to fallback to internal data
- DBG_ERROR( "Exception during import SchXMLChartContext::ChangeDiagramAccordingToTemplate try to fallback to internal data" );
- if(!mbHasOwnTable)
+ DBG_ERROR( "Exception during import SchXMLChartContext::lcl_ApplyDataFromRectangularRangeToDiagram try to fallback to internal data" );
+ if(!bHasOwnData)
{
- mbHasOwnTable = true;
+ bHasOwnData = true;
msChartAddress = ::rtl::OUString::createFromAscii("all");
if( !xNewDoc->hasInternalDataProvider() )
{
xNewDoc->createInternalDataProvider( sal_False /* bCloneExistingData */ );
- xChartData = uno::Reference< chart::XChartDataArray >( mrImportHelper.GetDataProvider( xNewDoc ), uno::UNO_QUERY );
+ xChartData = uno::Reference< chart::XChartDataArray >( xNewDoc->getDataProvider(), uno::UNO_QUERY );
if( xChartData.is())
SchXMLTableHelper::applyTableSimple( maTable, xChartData );
try
{
- ChangeDiagramAccordingToTemplate( xNewDoc );
+ lcl_ApplyDataFromRectangularRangeToDiagram( xNewDoc, msChartAddress, meDataRowSource, mbRowHasLabels, mbColHasLabels, bHasOwnData, msColTrans, msRowTrans );
}
catch( uno::Exception & )
{
- DBG_ERROR( "Exception during import SchXMLChartContext::ChangeDiagramAccordingToTemplate fallback to internal data failed also" );
+ DBG_ERROR( "Exception during import SchXMLChartContext::lcl_ApplyDataFromRectangularRangeToDiagram fallback to internal data failed also" );
}
}
}
@@ -904,16 +978,23 @@ void SchXMLChartContext::EndElement()
SchXMLSeries2Context::setStylesToStatisticsObjects( maSeriesDefaultsAndStyles
, pStylesCtxt, pStyle, sCurrStyleName );
}
+ }
+
+ //#i98319# call switchRangesFromOuterToInternalIfNecessary before the data point styles are applied, otherwise in copy->paste scenario the data point styles do get lost
+ if( bSwitchRangesFromOuterToInternalIfNecessary )
+ {
+ if( xNewDoc->hasInternalDataProvider() )
+ SchXMLTableHelper::switchRangesFromOuterToInternalIfNecessary( maTable, maLSequencesPerIndex, xNewDoc, meDataRowSource );
+ }
+ if( pStylesCtxt )
+ {
// ... then iterate over data-point attributes, so the latter are not overwritten
SchXMLSeries2Context::setStylesToDataPoints( maSeriesDefaultsAndStyles
, pStylesCtxt, pStyle, sCurrStyleName, mrImportHelper, GetImport(), mbIsStockChart, bSpecialHandlingForDonutChart, bSwitchOffLinesForScatter );
}
}
- if( bPostProcessTable )
- SchXMLTableHelper::postProcessTable( maTable, maLSequencesPerIndex, xNewDoc, meDataRowSource );
-
if( xProp.is())
xProp->setPropertyValue( rtl::OUString::createFromAscii( "RefreshAddInAllowed" ) , uno::makeAny( sal_True) );
}
@@ -1014,8 +1095,9 @@ SvXMLImportContext* SchXMLChartContext::CreateChildContext(
{
case XML_TOK_CHART_PLOT_AREA:
pContext = new SchXMLPlotAreaContext( mrImportHelper, GetImport(), rLocalName,
+ m_aXLinkHRefAttributeToIndicateDataProvider,
maSeriesAddresses, msCategoriesAddress,
- msChartAddress, mbHasOwnTable, mbAllRangeAddressesAvailable,
+ msChartAddress, m_bHasRangeAtPlotArea, mbAllRangeAddressesAvailable,
mbColHasLabels, mbRowHasLabels,
meDataRowSource,
maSeriesDefaultsAndStyles,
@@ -1057,6 +1139,7 @@ SvXMLImportContext* SchXMLChartContext::CreateChildContext(
{
SchXMLTableContext * pTableContext =
new SchXMLTableContext( mrImportHelper, GetImport(), rLocalName, maTable );
+ m_bHasTableElement = true;
// #i85913# take into account column- and row- mapping for
// charts with own data only for those which were not copied
// from a place where they got data from the container. Note,
@@ -1071,12 +1154,12 @@ SvXMLImportContext* SchXMLChartContext::CreateChildContext(
if( msColTrans.getLength() > 0 )
{
OSL_ASSERT( msRowTrans.getLength() == 0 );
- pTableContext->setColumnPermutation( GetNumberSequenceFromString( msColTrans, true ));
+ pTableContext->setColumnPermutation( lcl_getNumberSequenceFromString( msColTrans, true ));
msColTrans = OUString();
}
else if( msRowTrans.getLength() > 0 )
{
- pTableContext->setRowPermutation( GetNumberSequenceFromString( msRowTrans, true ));
+ pTableContext->setRowPermutation( lcl_getNumberSequenceFromString( msRowTrans, true ));
msRowTrans = OUString();
}
}
@@ -1116,7 +1199,6 @@ SvXMLImportContext* SchXMLChartContext::CreateChildContext(
*/
void SchXMLChartContext::InitChart(
awt::Size aChartSize,
- sal_Bool /* bDomainForDefaultDataNeeded */,
const OUString & rChartTypeServiceName, // currently the old service name
sal_Bool /* bSetSwitchData */ )
{
@@ -1155,57 +1237,6 @@ void SchXMLChartContext::InitChart(
}
}
-uno::Sequence< sal_Int32 > SchXMLChartContext::GetNumberSequenceFromString( const ::rtl::OUString& rStr, bool bAddOneToEachOldIndex )
-{
- const sal_Unicode aSpace( ' ' );
-
- // count number of entries
- ::std::vector< sal_Int32 > aVec;
- sal_Int32 nLastPos = 0;
- sal_Int32 nPos = 0;
- while( nPos != -1 )
- {
- nPos = rStr.indexOf( aSpace, nLastPos );
- if( nPos > nLastPos )
- {
- aVec.push_back( rStr.copy( nLastPos, (nPos - nLastPos) ).toInt32() );
- }
- if( nPos != -1 )
- nLastPos = nPos + 1;
- }
- // last entry
- if( nLastPos != 0 &&
- rStr.getLength() > nLastPos )
- {
- aVec.push_back( rStr.copy( nLastPos, (rStr.getLength() - nLastPos) ).toInt32() );
- }
-
- const sal_Int32 nVecSize = aVec.size();
- uno::Sequence< sal_Int32 > aSeq( nVecSize );
-
- if(!bAddOneToEachOldIndex)
- {
- sal_Int32* pSeqArr = aSeq.getArray();
- for( nPos = 0; nPos < nVecSize; ++nPos )
- {
- pSeqArr[ nPos ] = aVec[ nPos ];
- }
- }
- else if( bAddOneToEachOldIndex )
- {
- aSeq.realloc( nVecSize+1 );
- aSeq[0]=0;
-
- sal_Int32* pSeqArr = aSeq.getArray();
- for( nPos = 0; nPos < nVecSize; ++nPos )
- {
- pSeqArr[ nPos+1 ] = aVec[ nPos ]+1;
- }
- }
-
- return aSeq;
-}
-
// ----------------------------------------
SchXMLTitleContext::SchXMLTitleContext( SchXMLImportHelper& rImpHelper, SvXMLImport& rImport,
diff --git a/xmloff/source/chart/SchXMLChartContext.hxx b/xmloff/source/chart/SchXMLChartContext.hxx
index 9949cf1cff..bfb823fa94 100644
--- a/xmloff/source/chart/SchXMLChartContext.hxx
+++ b/xmloff/source/chart/SchXMLChartContext.hxx
@@ -114,7 +114,9 @@ private:
::rtl::OUString maMainTitle, maSubTitle;
com::sun::star::awt::Point maMainTitlePos, maSubTitlePos, maLegendPos;
- sal_Bool mbHasOwnTable;
+ ::rtl::OUString m_aXLinkHRefAttributeToIndicateDataProvider;
+ bool m_bHasRangeAtPlotArea;
+ bool m_bHasTableElement;
sal_Bool mbAllRangeAddressesAvailable;
sal_Bool mbColHasLabels;
sal_Bool mbRowHasLabels;
@@ -139,20 +141,14 @@ private:
a locked controller. This includes setting the draw page size and setting
the chart type.
@param aChartSize The size the draw page will be set to.
- @param bDomainForDefaultDataNeeded This flag indicates wether the chart's data set
- has to contain a domain value.
@param aServiceName The name of the service the diagram is initialized with.
@param bSetWitchData Indicates wether the data set takes it's data series from
rows or from columns.
*/
void InitChart (com::sun::star::awt::Size aChartSize,
- sal_Bool bDomainForDefaultDataNeeded,
const ::rtl::OUString & rChartTypeServiceName,
sal_Bool bSetSwitchData);
- void ChangeDiagramAccordingToTemplate(
- const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument >& xNewDoc );
- ::com::sun::star::uno::Sequence< sal_Int32 > GetNumberSequenceFromString( const ::rtl::OUString& rStr, bool bAddOneToEachOldIndex );
void MergeSeriesForStockChart();
};
diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx
index 6c94921114..25bcf43171 100644
--- a/xmloff/source/chart/SchXMLExport.cxx
+++ b/xmloff/source/chart/SchXMLExport.cxx
@@ -353,8 +353,10 @@ bool lcl_isSeriesAttachedToFirstAxis(
OUString lcl_ConvertRange( const ::rtl::OUString & rRange, const Reference< chart2::XChartDocument > & xDoc )
{
OUString aResult = rRange;
+ if( !xDoc.is() )
+ return aResult;
Reference< chart2::data::XRangeXMLConversion > xConversion(
- SchXMLExportHelper::GetDataProvider( xDoc ), uno::UNO_QUERY );
+ xDoc->getDataProvider(), uno::UNO_QUERY );
if( xConversion.is())
aResult = xConversion->convertRangeToXML( rRange );
return aResult;
@@ -837,6 +839,28 @@ void lcl_exportNumberFormat( const OUString& rPropertyName, const Reference< bea
return aResult;
}
+bool lcl_exportDomainForThisSequence( const Reference< chart2::data::XDataSequence > xValues, rtl::OUString& rFirstRangeForThisDomainIndex, SvXMLExport& rExport )
+{
+ bool bDomainExported = false;
+ if( xValues.is())
+ {
+ Reference< chart2::XChartDocument > xNewDoc( rExport.GetModel(), uno::UNO_QUERY );
+ OUString aRange( lcl_ConvertRange( xValues->getSourceRangeRepresentation(), xNewDoc ) );
+
+ //work around error in OOo 2.0 (problems with multiple series having a domain element)
+ if( !rFirstRangeForThisDomainIndex.getLength() || !aRange.equals(rFirstRangeForThisDomainIndex) )
+ {
+ rExport.AddAttribute( XML_NAMESPACE_TABLE, XML_CELL_RANGE_ADDRESS, aRange);
+ SvXMLElementExport aDomain( rExport, XML_NAMESPACE_CHART, XML_DOMAIN, sal_True, sal_True );
+ bDomainExported = true;
+ }
+
+ if( !rFirstRangeForThisDomainIndex.getLength() )
+ rFirstRangeForThisDomainIndex = aRange;
+ }
+ return bDomainExported;
+}
+
} // anonymous namespace
struct SchXMLDataPointStruct
@@ -1092,6 +1116,16 @@ void SchXMLExportHelper::parseDocument( Reference< chart::XChartDocument >& rCha
if( bExportContent )
{
+ //export data provider in xlink:href attribute
+ const SvtSaveOptions::ODFDefaultVersion nCurrentODFVersion( SvtSaveOptions().GetODFDefaultVersion() );
+ if( nCurrentODFVersion >= SvtSaveOptions::ODFVER_012 )
+ {
+ OUString aDataProviderURL( RTL_CONSTASCII_USTRINGPARAM( ".." ) );
+ if( xNewDoc->hasInternalDataProvider() )
+ aDataProviderURL = OUString( RTL_CONSTASCII_USTRINGPARAM( "." ) );
+ mrExport.AddAttribute( XML_NAMESPACE_XLINK, XML_HREF, aDataProviderURL );
+ }
+
OUString sChartType( xDiagram->getDiagramType() );
// attributes
@@ -2488,7 +2522,8 @@ void SchXMLExportHelper::exportSeries(
return;
Reference< chart2::XChartDocument > xNewDoc( mrExport.GetModel(), uno::UNO_QUERY );
- OUString aFirstXRange;
+ OUString aFirstXDomainRange;
+ OUString aFirstYDomainRange;
std::vector< XMLPropertyState > aPropertyStates;
@@ -2537,7 +2572,6 @@ void SchXMLExportHelper::exportSeries(
xSource->getDataSequences());
sal_Int32 nMainSequenceIndex = -1;
sal_Int32 nSeriesLength = 0;
- sal_Int32 nSeqIdx=0;
sal_Int32 nAttachedAxis = chart::ChartAxisAssign::PRIMARY_Y;
sal_Bool bHasMeanValueLine = false;
chart::ChartRegressionCurveType eRegressionType( chart::ChartRegressionCurveType_NONE );
@@ -2550,29 +2584,32 @@ void SchXMLExportHelper::exportSeries(
{
Reference< chart2::data::XDataSequence > xValuesSeq;
Reference< chart2::data::XDataSequence > xLabelSeq;
- for( ;nMainSequenceIndex==-1 && nSeqIdx<aSeqCnt.getLength();
- ++nSeqIdx )
+ sal_Int32 nSeqIdx=0;
+ for( ; nSeqIdx<aSeqCnt.getLength(); ++nSeqIdx )
{
OUString aRole;
Reference< chart2::data::XDataSequence > xTempValueSeq( aSeqCnt[nSeqIdx]->getValues() );
- Reference< beans::XPropertySet > xSeqProp( xTempValueSeq, uno::UNO_QUERY );
- if( xSeqProp.is())
- xSeqProp->getPropertyValue(OUString::createFromAscii("Role")) >>= aRole;
- // "main" sequence
- if( aRole.equals( aLabelRole ))
+ if( nMainSequenceIndex==-1 )
{
- xValuesSeq.set( xTempValueSeq );
- xLabelSeq.set( aSeqCnt[nSeqIdx]->getLabel());
- // "main" sequence attributes exported, now go on with domains
- nMainSequenceIndex = nSeqIdx;
- break;
+ Reference< beans::XPropertySet > xSeqProp( xTempValueSeq, uno::UNO_QUERY );
+ if( xSeqProp.is())
+ xSeqProp->getPropertyValue(OUString::createFromAscii("Role")) >>= aRole;
+ // "main" sequence
+ if( aRole.equals( aLabelRole ))
+ {
+ xValuesSeq.set( xTempValueSeq );
+ xLabelSeq.set( aSeqCnt[nSeqIdx]->getLabel());
+ nMainSequenceIndex = nSeqIdx;
+ }
}
+ sal_Int32 nSequenceLength = (xTempValueSeq.is()? xTempValueSeq->getData().getLength() : sal_Int32(0));
+ if( nSeriesLength < nSequenceLength )
+ nSeriesLength = nSequenceLength;
}
// have found the main sequence, then xValuesSeq and
// xLabelSeq contain those. Otherwise both are empty
{
- nSeriesLength = (xValuesSeq.is()? xValuesSeq->getData().getLength() : sal_Int32(0));
// get property states for autostyles
try
{
@@ -2688,46 +2725,36 @@ void SchXMLExportHelper::exportSeries(
}
// export domain elements if we have a series parent element
- if( nMainSequenceIndex>-1 )
+ if( pSeries )
{
// domain elements
if( bExportContent )
{
- for( nSeqIdx=0; nSeqIdx<aSeqCnt.getLength(); ++nSeqIdx )
+ bool bIsScatterChart = aChartType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.chart2.ScatterChartType"));
+ bool bIsBubbleChart = aChartType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.chart2.BubbleChartType"));
+ Reference< chart2::data::XDataSequence > xYValuesForBubbleChart;
+ if( bIsBubbleChart )
+ {
+ Reference< chart2::data::XLabeledDataSequence > xSequence( lcl_getDataSequenceByRole( aSeqCnt, OUString::createFromAscii("values-y" ) ) );
+ if( xSequence.is() )
+ {
+ xYValuesForBubbleChart = xSequence->getValues();
+ if( !lcl_exportDomainForThisSequence( xYValuesForBubbleChart, aFirstYDomainRange, mrExport ) )
+ xYValuesForBubbleChart = 0;
+ }
+ }
+ if( bIsScatterChart || bIsBubbleChart )
{
- if( nSeqIdx != nMainSequenceIndex )
+ Reference< chart2::data::XLabeledDataSequence > xSequence( lcl_getDataSequenceByRole( aSeqCnt, OUString::createFromAscii("values-x" ) ) );
+ if( xSequence.is() )
{
- bool bExportDomain = false;
- //@todo: roles should be exported
- Reference< chart2::data::XDataSequence > xSeq( aSeqCnt[nSeqIdx]->getValues() );
- if( xSeq.is())
- {
- OUString aXRange( lcl_ConvertRange(
- xSeq->getSourceRangeRepresentation(), xNewDoc ) );
- //work around error in OOo 2.0 (problems with multiple series having a domain element)
- if( !aFirstXRange.getLength() || !aXRange.equals(aFirstXRange) )
- {
- bExportDomain = true;
- mrExport.AddAttribute( XML_NAMESPACE_TABLE, XML_CELL_RANGE_ADDRESS, aXRange);
- m_aDataSequencesToExport.push_back( tLabelValuesDataPair( 0, xSeq ));
- }
-
- if( !aFirstXRange.getLength() )
- aFirstXRange = aXRange;
- }
-// xSeq.set( aSeqCnt[nSeqIdx]->getLabel());
-// if( xSeq.is())
-// mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_LABEL_CELL_ADDRESS,
-// lcl_ConvertRange(
-// xSeq->getSourceRangeRepresentation(),
-// xNewDoc ));
- if( bExportDomain )
- {
- SvXMLElementExport aDomain( mrExport, XML_NAMESPACE_CHART,
- XML_DOMAIN, sal_True, sal_True );
- }
+ Reference< chart2::data::XDataSequence > xValues( xSequence->getValues() );
+ if( lcl_exportDomainForThisSequence( xValues, aFirstXDomainRange, mrExport ) )
+ m_aDataSequencesToExport.push_back( tLabelValuesDataPair( 0, xValues ));
}
}
+ if( xYValuesForBubbleChart.is() )
+ m_aDataSequencesToExport.push_back( tLabelValuesDataPair( 0, xYValuesForBubbleChart ));
}
}
@@ -3506,7 +3533,7 @@ void SchXMLExport::_ExportContent()
// check if we have own data. If so we must not export the complete
// range string, as this is our only indicator for having own or
// external data. @todo: fix this in the file format!
- Reference< lang::XServiceInfo > xDPServiceInfo( maExportHelper.GetDataProvider( xNewDoc ), uno::UNO_QUERY );
+ Reference< lang::XServiceInfo > xDPServiceInfo( xNewDoc->getDataProvider(), uno::UNO_QUERY );
if( ! (xDPServiceInfo.is() &&
xDPServiceInfo->getImplementationName().equalsAsciiL(
RTL_CONSTASCII_STRINGPARAM( "com.sun.star.comp.chart.InternalDataProvider" ))))
@@ -3566,45 +3593,12 @@ void SchXMLExport::SetProgress( sal_Int32 nPercentage )
mxStatusIndicator->setValue( nPercentage );
}
-// static
-Reference< chart2::data::XDataProvider > SchXMLExportHelper::GetDataProvider(
- const Reference< chart2::XChartDocument > & xDoc )
-{
- Reference< chart2::data::XDataProvider > xResult;
- if( xDoc.is())
- {
- xResult.set( xDoc->getDataProvider());
- // allowed to attach a new data provider in export?
-// if( ! xResult.is())
-// {
-// Reference< container::XChild > xChild( xDoc, uno::UNO_QUERY );
-// if( xChild.is())
-// {
-// Reference< lang::XMultiServiceFactory > xFact( xChild->getParent(), uno::UNO_QUERY );
-// if( xFact.is())
-// {
-// xResult.set(
-// xFact->createInstance( OUString::createFromAscii("com.sun.star.chart2.data.DataProvider")),
-// uno::UNO_QUERY );
-// if( xResult.is())
-// {
-// Reference< chart2::data::XDataReceiver > xReceiver( xDoc, uno::UNO_QUERY );
-// if( xReceiver.is())
-// xReceiver->attachDataProvider( xResult );
-// }
-// }
-// }
-// }
- }
- return xResult;
-}
-
void SchXMLExportHelper::InitRangeSegmentationProperties( const Reference< chart2::XChartDocument > & xChartDoc )
{
if( xChartDoc.is())
try
{
- Reference< chart2::data::XDataProvider > xDataProvider( GetDataProvider( xChartDoc ));
+ Reference< chart2::data::XDataProvider > xDataProvider( xChartDoc->getDataProvider() );
OSL_ENSURE( xDataProvider.is(), "No DataProvider" );
if( xDataProvider.is())
{
diff --git a/xmloff/source/chart/SchXMLImport.cxx b/xmloff/source/chart/SchXMLImport.cxx
index 1576bd263c..9a8779630c 100644
--- a/xmloff/source/chart/SchXMLImport.cxx
+++ b/xmloff/source/chart/SchXMLImport.cxx
@@ -35,6 +35,8 @@
#include "SchXMLChartContext.hxx"
#include "contexts.hxx"
#include "XMLChartPropertySetMapper.hxx"
+#include "SchXMLTools.hxx"
+
#include <tools/debug.hxx>
#include <rtl/ustrbuf.hxx>
// header for class ByteString
@@ -346,6 +348,7 @@ const SvXMLTokenMap& SchXMLImportHelper::GetChartAttrTokenMap()
{
static __FAR_DATA SvXMLTokenMapEntry aChartAttrTokenMap[] =
{
+ { XML_NAMESPACE_XLINK, XML_HREF, XML_TOK_CHART_HREF },
{ XML_NAMESPACE_CHART, XML_CLASS, XML_TOK_CHART_CLASS },
{ XML_NAMESPACE_SVG, XML_WIDTH, XML_TOK_CHART_WIDTH },
{ XML_NAMESPACE_SVG, XML_HEIGHT, XML_TOK_CHART_HEIGHT },
@@ -614,38 +617,6 @@ void SchXMLImportHelper::ResizeChartData( sal_Int32 nSeries, sal_Int32 nDataPoin
}
}
-// static
-Reference< chart2::data::XDataProvider > SchXMLImportHelper::GetDataProvider(
- const Reference< chart2::XChartDocument > & xDoc )
-{
- Reference< chart2::data::XDataProvider > xResult;
- if( xDoc.is())
- {
- try
- {
- xResult.set( xDoc->getDataProvider());
-// if( ! xResult.is())
-// {
-// Reference< container::XChild > xChild( xDoc, uno::UNO_QUERY_THROW );
-// Reference< lang::XMultiServiceFactory > xFact( xChild->getParent(), uno::UNO_QUERY );
-// if( xFact.is())
-// {
-// Reference< chart2::data::XDataReceiver > xReceiver( xDoc, uno::UNO_QUERY_THROW );
-// xResult.set(
-// xFact->createInstance( OUString::createFromAscii("com.sun.star.chart2.data.DataProvider")),
-// uno::UNO_QUERY_THROW );
-// xReceiver->attachDataProvider( xResult );
-// }
-// }
- }
- catch( const uno::Exception & )
- {
- // didn't get a data provider from the container
- }
- }
- return xResult;
-}
-
//static
void SchXMLImportHelper::DeleteDataSeries(
const Reference< chart2::XDataSeries > & xSeries,
@@ -796,6 +767,8 @@ SchXMLImport::SchXMLImport(
sal_uInt16 nImportFlags ) :
SvXMLImport( xServiceFactory, nImportFlags )
{
+ GetNamespaceMap().Add( GetXMLToken(XML_NP_XLINK), GetXMLToken(XML_N_XLINK), XML_NAMESPACE_XLINK );
+
mbIsGraphicLoadOnDemandSupported = false;
}
@@ -807,6 +780,8 @@ SchXMLImport::SchXMLImport(
sal_Bool /*bLoadDoc*/, sal_Bool bShowProgress )
: SvXMLImport( xServiceFactory, xModel, rGrfContainer )
{
+ GetNamespaceMap().Add( GetXMLToken(XML_NP_XLINK), GetXMLToken(XML_N_XLINK), XML_NAMESPACE_XLINK );
+
// get status indicator (if requested)
if( bShowProgress )
{
@@ -899,6 +874,9 @@ SvXMLImportContext* SchXMLImport::CreateStylesContext(
const OUString& rLocalName,
const Reference<xml::sax::XAttributeList>& xAttrList )
{
+ //#i103287# make sure that the version information is set before importing all the properties (especially stroke-opacity!)
+ SchXMLTools::setBuildIDAtImportInfo( GetModel(), getImportInfo() );
+
SvXMLStylesContext* pStylesCtxt =
new SvXMLStylesContext( *(this), XML_NAMESPACE_OFFICE, rLocalName, xAttrList );
diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.cxx b/xmloff/source/chart/SchXMLPlotAreaContext.cxx
index 485b2da121..3d8a8495f4 100644
--- a/xmloff/source/chart/SchXMLPlotAreaContext.cxx
+++ b/xmloff/source/chart/SchXMLPlotAreaContext.cxx
@@ -108,8 +108,10 @@ struct lcl_AxisHasCategories : public ::std::unary_function< SchXMLAxis, bool >
OUString lcl_ConvertRange( const ::rtl::OUString & rRange, const uno::Reference< chart2::XChartDocument > & xDoc )
{
OUString aResult = rRange;
+ if(!xDoc.is())
+ return aResult;
uno::Reference< chart2::data::XRangeXMLConversion > xConversion(
- SchXMLImportHelper::GetDataProvider( xDoc ), uno::UNO_QUERY );
+ xDoc->getDataProvider(), uno::UNO_QUERY );
if( xConversion.is())
aResult = xConversion->convertRangeFromXML( rRange );
return aResult;
@@ -177,10 +179,11 @@ SchXML3DSceneAttributesHelper::~SchXML3DSceneAttributesHelper()
SchXMLPlotAreaContext::SchXMLPlotAreaContext(
SchXMLImportHelper& rImpHelper,
SvXMLImport& rImport, const rtl::OUString& rLocalName,
+ const rtl::OUString& rXLinkHRefAttributeToIndicateDataProvider,
uno::Sequence< chart::ChartSeriesAddress >& rSeriesAddresses,
::rtl::OUString& rCategoriesAddress,
::rtl::OUString& rChartAddress,
- sal_Bool & rHasOwnTable,
+ bool& rbHasRangeAtPlotArea,
sal_Bool & rAllRangeAddressesAvailable,
sal_Bool & rColHasLabels,
sal_Bool & rRowHasLabels,
@@ -195,28 +198,27 @@ SchXMLPlotAreaContext::SchXMLPlotAreaContext(
mrCategoriesAddress( rCategoriesAddress ),
mrSeriesDefaultsAndStyles( rSeriesDefaultsAndStyles ),
mnNumOfLinesProp( 0 ),
- mnNumOfLinesReadBySeries( 0 ),
mbStockHasVolume( sal_False ),
mnSeries( 0 ),
- mnMaxSeriesLength( 0 ),
+ m_aGlobalSeriesImportInfo( rAllRangeAddressesAvailable ),
maSceneImportHelper( rImport ),
mbHasSize(false),
mbHasPosition(false),
mbPercentStacked(false),
m_bAxisPositionAttributeImported(false),
+ m_rXLinkHRefAttributeToIndicateDataProvider(rXLinkHRefAttributeToIndicateDataProvider),
mrChartAddress( rChartAddress ),
- mrHasOwnTable( rHasOwnTable ),
- mrAllRangeAddressesAvailable( rAllRangeAddressesAvailable ),
+ m_rbHasRangeAtPlotArea( rbHasRangeAtPlotArea ),
mrColHasLabels( rColHasLabels ),
mrRowHasLabels( rRowHasLabels ),
mrDataRowSource( rDataRowSource ),
- mnFirstFirstDomainIndex( -1 ),
maChartTypeServiceName( aChartTypeServiceName ),
mrLSequencesPerIndex( rLSequencesPerIndex ),
- mnCurrentDataIndex( 0 ),
mbGlobalChartTypeUsedBySeries( false ),
maChartSize( rChartSize )
{
+ m_rbHasRangeAtPlotArea = false;
+
// get Diagram
uno::Reference< chart::XChartDocument > xDoc( rImpHelper.GetChartDocument(), uno::UNO_QUERY );
if( xDoc.is())
@@ -342,7 +344,7 @@ void SchXMLPlotAreaContext::StartElement( const uno::Reference< xml::sax::XAttri
case XML_TOK_PA_CHART_ADDRESS:
mrChartAddress = lcl_ConvertRange( aValue, xNewDoc );
// indicator for getting data from the outside
- mrHasOwnTable = sal_False;
+ m_rbHasRangeAtPlotArea = true;
break;
case XML_TOK_PA_DS_HAS_LABELS:
{
@@ -518,7 +520,17 @@ void SchXMLPlotAreaContext::StartElement( const uno::Reference< xml::sax::XAttri
}
//
- if( mrHasOwnTable && mxNewDoc.is())
+ bool bCreateInternalDataProvider = false;
+ if( m_rXLinkHRefAttributeToIndicateDataProvider.equalsAscii( "." ) ) //data comes from the chart itself
+ bCreateInternalDataProvider = true;
+ else if( m_rXLinkHRefAttributeToIndicateDataProvider.equalsAscii( ".." ) ) //data comes from the parent application
+ bCreateInternalDataProvider = false;
+ else if( m_rXLinkHRefAttributeToIndicateDataProvider.getLength() ) //not supported so far to get the data by sibling objects -> fall back to chart itself
+ bCreateInternalDataProvider = true;
+ else if( !m_rbHasRangeAtPlotArea )
+ bCreateInternalDataProvider = true;
+
+ if( bCreateInternalDataProvider && mxNewDoc.is() )
{
// we have no complete range => we have own data, so switch the data
// provider to internal. Clone is not necessary, as we don't have any
@@ -578,14 +590,11 @@ SvXMLImportContext* SchXMLPlotAreaContext::CreateChildContext(
mrImportHelper, GetImport(), rLocalName,
mxNewDoc, maAxes,
mrSeriesDefaultsAndStyles.maSeriesStyleList,
- mnSeries, mnMaxSeriesLength,
- mnNumOfLinesReadBySeries, mbStockHasVolume,
- maFirstFirstDomainAddress,
- mnFirstFirstDomainIndex,
- mrAllRangeAddressesAvailable,
+ mnSeries,
+ mbStockHasVolume,
+ m_aGlobalSeriesImportInfo,
maChartTypeServiceName,
mrLSequencesPerIndex,
- mnCurrentDataIndex,
mbGlobalChartTypeUsedBySeries, maChartSize );
}
mnSeries++;
@@ -632,7 +641,7 @@ void SchXMLPlotAreaContext::EndElement()
if( mrCategoriesAddress.getLength() && mxNewDoc.is())
{
uno::Reference< chart2::data::XDataProvider > xDataProvider(
- mrImportHelper.GetDataProvider( mxNewDoc ));
+ mxNewDoc->getDataProvider() );
// @todo: correct coordinate system index
sal_Int32 nDimension( 0 );
::std::vector< SchXMLAxis >::const_iterator aIt(
@@ -659,15 +668,8 @@ void SchXMLPlotAreaContext::EndElement()
maSceneImportHelper.setSceneAttributes( xDiaProp );
}
- // if the property NumberOfLines and the number of series containing
- // class="chart:line" as attribute are both different from 0 they must
- // be equal
- OSL_ASSERT( mnNumOfLinesProp == 0 || mnNumOfLinesReadBySeries == 0 ||
- mnNumOfLinesProp == mnNumOfLinesReadBySeries );
-
// set correct number of lines at series
- if( ! mrAllRangeAddressesAvailable &&
- mnNumOfLinesReadBySeries == 0 &&
+ if( ! m_aGlobalSeriesImportInfo.rbAllRangeAddressesAvailable &&
mnNumOfLinesProp > 0 &&
maChartTypeServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart2.ColumnChartType" )))
{
@@ -1533,7 +1535,7 @@ SvXMLImportContext* SchXMLAxisContext::CreateChildContext(
break;
case XML_TOK_AXIS_CATEGORIES:
- pContext = new SchXMLCategoriesDomainContext( mrImportHelper, GetImport(),
+ pContext = new SchXMLCategoriesContext( mrImportHelper, GetImport(),
p_nPrefix, rLocalName,
mrCategoriesAddress );
maCurrentAxis.bHasCategories = true;
@@ -1640,7 +1642,7 @@ void SchXMLDataPointContext::StartElement( const uno::Reference< xml::sax::XAttr
// ========================================
-SchXMLCategoriesDomainContext::SchXMLCategoriesDomainContext(
+SchXMLCategoriesContext::SchXMLCategoriesContext(
SchXMLImportHelper& rImpHelper,
SvXMLImport& rImport,
sal_uInt16 nPrefix,
@@ -1652,11 +1654,11 @@ SchXMLCategoriesDomainContext::SchXMLCategoriesDomainContext(
{
}
-SchXMLCategoriesDomainContext::~SchXMLCategoriesDomainContext()
+SchXMLCategoriesContext::~SchXMLCategoriesContext()
{
}
-void SchXMLCategoriesDomainContext::StartElement( const uno::Reference< xml::sax::XAttributeList >& xAttrList )
+void SchXMLCategoriesContext::StartElement( const uno::Reference< xml::sax::XAttributeList >& xAttrList )
{
sal_Int16 nAttrCount = xAttrList.is()? xAttrList->getLength(): 0;
diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.hxx b/xmloff/source/chart/SchXMLPlotAreaContext.hxx
index 0503216a2e..9ec09f3f07 100644
--- a/xmloff/source/chart/SchXMLPlotAreaContext.hxx
+++ b/xmloff/source/chart/SchXMLPlotAreaContext.hxx
@@ -74,11 +74,12 @@ class SchXMLPlotAreaContext : public SvXMLImportContext
public:
SchXMLPlotAreaContext( SchXMLImportHelper& rImpHelper,
SvXMLImport& rImport, const rtl::OUString& rLocalName,
+ const rtl::OUString& rXLinkHRefAttributeToIndicateDataProvider,
::com::sun::star::uno::Sequence<
::com::sun::star::chart::ChartSeriesAddress >& rSeriesAddresses,
::rtl::OUString& rCategoriesAddress,
::rtl::OUString& rChartAddress,
- sal_Bool & rHasOwnTable,
+ bool& bHasRangeAtPlotArea,
sal_Bool & rAllRangeAddressesAvailable,
sal_Bool & rColHasLabels,
sal_Bool & rRowHasLabels,
@@ -107,10 +108,10 @@ private:
rtl::OUString& mrCategoriesAddress;
SeriesDefaultsAndStyles& mrSeriesDefaultsAndStyles;
sal_Int32 mnNumOfLinesProp;
- sal_Int32 mnNumOfLinesReadBySeries;
sal_Bool mbStockHasVolume;
sal_Int32 mnSeries;
- sal_Int32 mnMaxSeriesLength;
+ GlobalSeriesImportInfo m_aGlobalSeriesImportInfo;
+
SchXML3DSceneAttributesHelper maSceneImportHelper;
::com::sun::star::awt::Size maSize;
::com::sun::star::awt::Point maPosition;
@@ -119,19 +120,16 @@ private:
bool mbPercentStacked;
bool m_bAxisPositionAttributeImported;
::rtl::OUString msAutoStyleName;
+ const ::rtl::OUString& m_rXLinkHRefAttributeToIndicateDataProvider;
::rtl::OUString& mrChartAddress;
- sal_Bool & mrHasOwnTable;
- sal_Bool & mrAllRangeAddressesAvailable;
+ bool& m_rbHasRangeAtPlotArea;
sal_Bool & mrColHasLabels;
sal_Bool & mrRowHasLabels;
::com::sun::star::chart::ChartDataRowSource & mrDataRowSource;
- ::rtl::OUString maFirstFirstDomainAddress;
- sal_Int32 mnFirstFirstDomainIndex;
-
::rtl::OUString maChartTypeServiceName;
tSchXMLLSequencesPerIndex & mrLSequencesPerIndex;
- sal_Int32 mnCurrentDataIndex;
+
bool mbGlobalChartTypeUsedBySeries;
::com::sun::star::awt::Size maChartSize;
};
@@ -203,19 +201,19 @@ public:
// ----------------------------------------
-class SchXMLCategoriesDomainContext : public SvXMLImportContext
+class SchXMLCategoriesContext : public SvXMLImportContext
{
private:
SchXMLImportHelper& mrImportHelper;
rtl::OUString& mrAddress;
public:
- SchXMLCategoriesDomainContext( SchXMLImportHelper& rImpHelper,
+ SchXMLCategoriesContext( SchXMLImportHelper& rImpHelper,
SvXMLImport& rImport,
sal_uInt16 nPrefix,
const rtl::OUString& rLocalName,
rtl::OUString& rAddress );
- virtual ~SchXMLCategoriesDomainContext();
+ virtual ~SchXMLCategoriesContext();
virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
};
diff --git a/xmloff/source/chart/SchXMLSeries2Context.cxx b/xmloff/source/chart/SchXMLSeries2Context.cxx
index 42dacf4920..82a8973408 100644
--- a/xmloff/source/chart/SchXMLSeries2Context.cxx
+++ b/xmloff/source/chart/SchXMLSeries2Context.cxx
@@ -81,11 +81,10 @@ using ::rtl::OUStringBuffer;
namespace
{
-OUString lcl_ConvertRange( const ::rtl::OUString & rRange, const Reference< chart2::XChartDocument > & xDoc )
+OUString lcl_ConvertRange( const ::rtl::OUString & rRange, const Reference< chart2::data::XDataProvider >& xDataProvider )
{
OUString aResult = rRange;
- Reference< chart2::data::XRangeXMLConversion > xConversion(
- SchXMLImportHelper::GetDataProvider( xDoc ), uno::UNO_QUERY );
+ Reference< chart2::data::XRangeXMLConversion > xConversion( xDataProvider, uno::UNO_QUERY );
if( xConversion.is())
aResult = xConversion->convertRangeFromXML( rRange );
return aResult;
@@ -234,6 +233,54 @@ void lcl_insertErrorBarLSequencesToMap(
}
}
+Reference< chart2::data::XLabeledDataSequence > lcl_createAndAddSequenceToSeries( const rtl::OUString& rRole
+ , const rtl::OUString& rRange
+ , const Reference< chart2::data::XDataProvider >& xDataProvider
+ , const Reference< chart2::XDataSeries >& xSeries )
+{
+ Reference< chart2::data::XLabeledDataSequence > xLabeledSeq;
+
+ Reference< chart2::data::XDataSource > xSeriesSource( xSeries,uno::UNO_QUERY );
+ Reference< chart2::data::XDataSink > xSeriesSink( xSeries, uno::UNO_QUERY );
+
+ if( !(rRange.getLength() && xDataProvider.is() && xSeriesSource.is() && xSeriesSink.is()) )
+ return xLabeledSeq;
+
+ // create a new sequence
+ xLabeledSeq = SchXMLTools::GetNewLabeledDataSequence();
+
+ // set values at the new sequence
+ Reference< chart2::data::XDataSequence > xSeq;
+ try
+ {
+ xSeq.set( xDataProvider->createDataSequenceByRangeRepresentation( lcl_ConvertRange( rRange, xDataProvider )));
+ SchXMLTools::setXMLRangePropertyAtDataSequence( xSeq, rRange );
+ }
+ catch( const lang::IllegalArgumentException & ex )
+ {
+ (void)ex; // avoid warning for pro build
+ OSL_ENSURE( false, ::rtl::OUStringToOString(
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IllegalArgumentException caught, Message: " )) +
+ ex.Message, RTL_TEXTENCODING_ASCII_US ).getStr());
+ }
+
+ Reference< beans::XPropertySet > xSeqProp( xSeq, uno::UNO_QUERY );
+ if( xSeqProp.is())
+ xSeqProp->setPropertyValue(OUString::createFromAscii("Role"), uno::makeAny( rRole));
+ xLabeledSeq->setValues( xSeq );
+
+ // add new sequence to data series / push to front to have the correct sequence order if charttype is changed afterwards
+ Sequence< Reference< chart2::data::XLabeledDataSequence > > aOldSeq( xSeriesSource->getDataSequences());
+ sal_Int32 nOldCount = aOldSeq.getLength();
+ Sequence< Reference< chart2::data::XLabeledDataSequence > > aNewSeq( nOldCount + 1 );
+ aNewSeq[0]=xLabeledSeq;
+ for( sal_Int32 nN=0; nN<nOldCount; nN++ )
+ aNewSeq[nN+1] = aOldSeq[nN];
+ xSeriesSink->setData( aNewSeq );
+
+ return xLabeledSeq;
+}
+
} // anonymous namespace
// ================================================================================
@@ -245,15 +292,10 @@ SchXMLSeries2Context::SchXMLSeries2Context(
std::vector< SchXMLAxis >& rAxes,
::std::list< DataRowPointStyle >& rStyleList,
sal_Int32 nSeriesIndex,
- sal_Int32& rMaxSeriesLength,
- sal_Int32& rNumOfLines,
- sal_Bool& rStockHasVolume,
- ::rtl::OUString& rFirstFirstDomainAddress,
- sal_Int32& rFirstFirstDomainIndex,
- sal_Bool& rAllRangeAddressesAvailable,
+ sal_Bool bStockHasVolume,
+ GlobalSeriesImportInfo& rGlobalSeriesImportInfo,
const OUString & aGlobalChartTypeName,
tSchXMLLSequencesPerIndex & rLSequencesPerIndex,
- sal_Int32& rCurrentDataIndex,
bool& rGlobalChartTypeUsedBySeries,
const awt::Size & rChartSize ) :
SvXMLImportContext( rImport, XML_NAMESPACE_CHART, rLocalName ),
@@ -264,18 +306,13 @@ SchXMLSeries2Context::SchXMLSeries2Context(
m_xSeries(0),
mnSeriesIndex( nSeriesIndex ),
mnDataPointIndex( 0 ),
- mrMaxSeriesLength( rMaxSeriesLength ),
- mrNumOfLines( rNumOfLines ),
- mrStockHasVolume( rStockHasVolume ),
- mrFirstFirstDomainAddress(rFirstFirstDomainAddress),
- mrFirstFirstDomainIndex(rFirstFirstDomainIndex),
- mrAllRangeAddressesAvailable( rAllRangeAddressesAvailable ),
+ m_bStockHasVolume( bStockHasVolume ),
+ m_rGlobalSeriesImportInfo(rGlobalSeriesImportInfo),
mpAttachedAxis( NULL ),
maGlobalChartTypeName( aGlobalChartTypeName ),
maSeriesChartTypeName( aGlobalChartTypeName ),
m_bHasDomainContext(false),
mrLSequencesPerIndex( rLSequencesPerIndex ),
- mrCurrentDataIndex( rCurrentDataIndex ),
mrGlobalChartTypeUsedBySeries( rGlobalChartTypeUsedBySeries ),
mbSymbolSizeIsMissingInFile(false),
maChartSize( rChartSize )
@@ -304,7 +341,7 @@ void SchXMLSeries2Context::StartElement( const uno::Reference< xml::sax::XAttrib
Reference< chart2::data::XRangeXMLConversion > xRangeConversion;
if( mxNewDoc.is())
- xRangeConversion.set( mrImportHelper.GetDataProvider( mxNewDoc ), uno::UNO_QUERY );
+ xRangeConversion.set( mxNewDoc->getDataProvider(), uno::UNO_QUERY );
for( sal_Int16 i = 0; i < nAttrCount; i++ )
{
@@ -369,10 +406,10 @@ void SchXMLSeries2Context::StartElement( const uno::Reference< xml::sax::XAttrib
OSL_ASSERT( mxNewDoc.is());
if( mxNewDoc.is())
{
- if( mrAllRangeAddressesAvailable && ! bHasRange )
- mrAllRangeAddressesAvailable = sal_False;
+ if( m_rGlobalSeriesImportInfo.rbAllRangeAddressesAvailable && ! bHasRange )
+ m_rGlobalSeriesImportInfo.rbAllRangeAddressesAvailable = sal_False;
- Reference< chart2::data::XDataProvider > xDataProvider( mrImportHelper.GetDataProvider( mxNewDoc ));
+ Reference< chart2::data::XDataProvider > xDataProvider( mxNewDoc->getDataProvider() );
if( xDataProvider.is())
{
bool bIsCandleStick = maGlobalChartTypeName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.chart2.CandleStickChartType"));
@@ -383,7 +420,7 @@ void SchXMLSeries2Context::StartElement( const uno::Reference< xml::sax::XAttrib
else
{
if( bIsCandleStick
- && mrStockHasVolume
+ && m_bStockHasVolume
&& mnSeriesIndex == 0 )
{
maSeriesChartTypeName = OUString::createFromAscii( "com.sun.star.chart2.ColumnChartType" );
@@ -424,7 +461,7 @@ void SchXMLSeries2Context::StartElement( const uno::Reference< xml::sax::XAttrib
if( bHasRange )
try
{
- xSeq.set( xDataProvider->createDataSequenceByRangeRepresentation( lcl_ConvertRange( m_aSeriesRange, mxNewDoc )));
+ xSeq.set( xDataProvider->createDataSequenceByRangeRepresentation( lcl_ConvertRange( m_aSeriesRange, xDataProvider )));
SchXMLTools::setXMLRangePropertyAtDataSequence( xSeq, m_aSeriesRange );
}
catch( const lang::IllegalArgumentException & ex )
@@ -438,16 +475,17 @@ void SchXMLSeries2Context::StartElement( const uno::Reference< xml::sax::XAttrib
Reference< beans::XPropertySet > xSeqProp( xSeq, uno::UNO_QUERY );
if( xSeqProp.is())
{
- //@todo: set correct role ("main role" dependent on chart type)
- xSeqProp->setPropertyValue(OUString::createFromAscii("Role"),
- uno::makeAny( OUString::createFromAscii("values-y")));
+ OUString aMainRole( OUString::createFromAscii("values-y") );
+ if( maSeriesChartTypeName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.chart2.BubbleChartType") ) )
+ aMainRole = OUString::createFromAscii("values-size");
+ xSeqProp->setPropertyValue(OUString::createFromAscii("Role"), uno::makeAny( aMainRole ));
}
xLabeledSeq->setValues( xSeq );
// register for setting local data if external data provider is not present
maPostponedSequences.insert(
tSchXMLLSequencesPerIndex::value_type(
- tSchXMLIndexWithPart( mrCurrentDataIndex, SCH_XML_PART_VALUES ), xLabeledSeq ));
+ tSchXMLIndexWithPart( m_rGlobalSeriesImportInfo.nCurrentDataIndex, SCH_XML_PART_VALUES ), xLabeledSeq ));
// label
if( bHasLabelRange )
@@ -456,7 +494,7 @@ void SchXMLSeries2Context::StartElement( const uno::Reference< xml::sax::XAttrib
{
Reference< chart2::data::XDataSequence > xLabelSequence(
xDataProvider->createDataSequenceByRangeRepresentation(
- lcl_ConvertRange( m_aSeriesLabelRange, mxNewDoc )));
+ lcl_ConvertRange( m_aSeriesLabelRange, xDataProvider )));
xLabeledSeq->setLabel( xLabelSequence );
SchXMLTools::setXMLRangePropertyAtDataSequence( xLabelSequence, m_aSeriesLabelRange );
}
@@ -475,7 +513,7 @@ void SchXMLSeries2Context::StartElement( const uno::Reference< xml::sax::XAttrib
// used for the internal data.
maPostponedSequences.insert(
tSchXMLLSequencesPerIndex::value_type(
- tSchXMLIndexWithPart( mrCurrentDataIndex, SCH_XML_PART_LABEL ), xLabeledSeq ));
+ tSchXMLIndexWithPart( m_rGlobalSeriesImportInfo.nCurrentDataIndex, SCH_XML_PART_LABEL ), xLabeledSeq ));
Sequence< Reference< chart2::data::XLabeledDataSequence > > aSeq( &xLabeledSeq, 1 );
@@ -519,47 +557,91 @@ void SchXMLSeries2Context::StartElement( const uno::Reference< xml::sax::XAttrib
}
}
+struct DomainInfo
+{
+ DomainInfo( const rtl::OUString& rRole, const rtl::OUString& rRange, sal_Int32 nIndex )
+ : aRole(rRole), aRange(rRange), nIndexForLocalData(nIndex)
+ {}
+
+ rtl::OUString aRole;
+ rtl::OUString aRange;
+ sal_Int32 nIndexForLocalData;
+};
+
void SchXMLSeries2Context::EndElement()
{
// special handling for different chart types. This is necessary as the
// roles are not yet saved in the file format
- OUString aXValuesRange( mrFirstFirstDomainAddress );
- sal_Int32 nCurrentDataIndexBeforeDomains = mrCurrentDataIndex;
- sal_Int32 nDomainOffset = 0;
- bool bCreateXValues = false;
- bool bHasOwnDomains = false;
+ sal_Int32 nDomainCount = maDomainAddresses.size();
+ bool bIsScatterChart = maSeriesChartTypeName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.chart2.ScatterChartType"));
+ bool bIsBubbleChart = maSeriesChartTypeName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.chart2.BubbleChartType"));
bool bDeleteSeries = false;
- if( maDomainAddresses.size() == 1 ||
- maSeriesChartTypeName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.chart2.ScatterChartType")) )
+ std::vector< DomainInfo > aDomainInfos;
+
+ //different handling for different chart types necessary
+ if( bIsScatterChart || ( nDomainCount==1 && !bIsBubbleChart ) )
{
- bCreateXValues = true;
+ DomainInfo aDomainInfo( OUString::createFromAscii("values-x"), m_rGlobalSeriesImportInfo.aFirstFirstDomainAddress, m_rGlobalSeriesImportInfo.nFirstFirstDomainIndex ) ;
+ bool bCreateXValues = true;
if( !maDomainAddresses.empty() )
{
- aXValuesRange = maDomainAddresses.front();
- bHasOwnDomains = true;
- if(!mrFirstFirstDomainAddress.getLength())
+ if( !m_rGlobalSeriesImportInfo.aFirstFirstDomainAddress.getLength() )
{
- mrFirstFirstDomainAddress=aXValuesRange;
- mrFirstFirstDomainIndex=mrCurrentDataIndex;
+ m_rGlobalSeriesImportInfo.aFirstFirstDomainAddress = maDomainAddresses.front();
+ m_rGlobalSeriesImportInfo.nFirstFirstDomainIndex = m_rGlobalSeriesImportInfo.nCurrentDataIndex;
}
+ aDomainInfo.aRange = maDomainAddresses.front();
+ aDomainInfo.nIndexForLocalData = m_rGlobalSeriesImportInfo.nCurrentDataIndex;
+ m_rGlobalSeriesImportInfo.nCurrentDataIndex++;
}
- else if( !mrFirstFirstDomainAddress.getLength() && !m_bHasDomainContext && mnSeriesIndex==0 )
+ else if( !m_rGlobalSeriesImportInfo.aFirstFirstDomainAddress.getLength() && !m_bHasDomainContext && mnSeriesIndex==0 )
{
if( SchXMLTools::isDocumentGeneratedWithOpenOfficeOlderThan2_3( GetImport().GetModel() ) ) //wrong old chart files:
{
//for xy charts the first series needs to have a domain
//if this by error iss not the case the first series is taken s x values
//needed for wrong files created while having an addin (e.g. BoxPlot)
- mrFirstFirstDomainAddress = m_aSeriesRange;
- mrFirstFirstDomainIndex = mrCurrentDataIndex;
+ m_rGlobalSeriesImportInfo.aFirstFirstDomainAddress = m_aSeriesRange;
+ m_rGlobalSeriesImportInfo.nFirstFirstDomainIndex = m_rGlobalSeriesImportInfo.nCurrentDataIndex++;
bDeleteSeries = true;
bCreateXValues = false;//they will be created for the next series
}
}
+ if( bCreateXValues )
+ aDomainInfos.push_back( aDomainInfo );
+ }
+ else if( bIsBubbleChart )
+ {
+ if( nDomainCount>1 )
+ {
+ DomainInfo aDomainInfo( OUString::createFromAscii("values-x"), maDomainAddresses[1], m_rGlobalSeriesImportInfo.nCurrentDataIndex ) ;
+ if( !m_rGlobalSeriesImportInfo.aFirstSecondDomainAddress.getLength() )
+ {
+ //for bubble chart the second domain contains the x values which should become an index smaller than y values for own data table
+ //->so second first
+ m_rGlobalSeriesImportInfo.aFirstSecondDomainAddress = maDomainAddresses[1];
+ m_rGlobalSeriesImportInfo.nFirstSecondDomainIndex = m_rGlobalSeriesImportInfo.nCurrentDataIndex;
+ }
+ aDomainInfos.push_back( aDomainInfo );
+ m_rGlobalSeriesImportInfo.nCurrentDataIndex++;
+ }
+ else if( m_rGlobalSeriesImportInfo.aFirstSecondDomainAddress.getLength() )
+ {
+ DomainInfo aDomainInfo( OUString::createFromAscii("values-x"), m_rGlobalSeriesImportInfo.aFirstSecondDomainAddress, m_rGlobalSeriesImportInfo.nFirstSecondDomainIndex ) ;
+ aDomainInfos.push_back( aDomainInfo );
+ }
+ if( nDomainCount>0)
+ {
+ DomainInfo aDomainInfo( OUString::createFromAscii("values-y"), maDomainAddresses.front(), m_rGlobalSeriesImportInfo.nCurrentDataIndex ) ;
+ if( !m_rGlobalSeriesImportInfo.aFirstFirstDomainAddress.getLength() )
+ {
+ m_rGlobalSeriesImportInfo.aFirstFirstDomainAddress = maDomainAddresses.front();
+ m_rGlobalSeriesImportInfo.nFirstFirstDomainIndex = m_rGlobalSeriesImportInfo.nCurrentDataIndex;
+ }
+ aDomainInfos.push_back( aDomainInfo );
+ m_rGlobalSeriesImportInfo.nCurrentDataIndex++;
+ }
}
-
- if( mrMaxSeriesLength < mnDataPointIndex )
- mrMaxSeriesLength = mnDataPointIndex;
if( bDeleteSeries )
{
@@ -582,72 +664,23 @@ void SchXMLSeries2Context::EndElement()
mrStyleList.push_back( aStyle );
}
}
-
- if( bCreateXValues && aXValuesRange.getLength())
+
+ Reference< chart2::data::XDataProvider > xDataProvider;
+ if ( mxNewDoc.is() ) {
+ xDataProvider = mxNewDoc->getDataProvider();
+ }
+ for( std::vector< DomainInfo >::reverse_iterator aIt( aDomainInfos.rbegin() ); aIt!= aDomainInfos.rend(); ++aIt )
{
- Reference< chart2::data::XDataProvider > xDataProvider( mrImportHelper.GetDataProvider( mxNewDoc ));
- if( !(m_xSeries.is() && xDataProvider.is()))
- return;
-
- Reference< chart2::data::XDataSource > xSeriesSource( m_xSeries,uno::UNO_QUERY );
- if( ! xSeriesSource.is())
- return;
-
- // assume we have a scatter chart
-
- // create new sequence for x-values
- Reference< chart2::data::XLabeledDataSequence > xLabeledSeq(
- SchXMLTools::GetNewLabeledDataSequence());
-
- // values
- Reference< chart2::data::XDataSequence > xSeq;
- try
- {
- xSeq.set( xDataProvider->createDataSequenceByRangeRepresentation( lcl_ConvertRange( aXValuesRange, mxNewDoc )));
- SchXMLTools::setXMLRangePropertyAtDataSequence( xSeq, aXValuesRange );
- }
- catch( const lang::IllegalArgumentException & ex )
- {
- (void)ex; // avoid warning for pro build
- OSL_ENSURE( false, ::rtl::OUStringToOString(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IllegalArgumentException caught, Message: " )) +
- ex.Message, RTL_TEXTENCODING_ASCII_US ).getStr());
- }
-
- Reference< beans::XPropertySet > xSeqProp( xSeq, uno::UNO_QUERY );
- if( xSeqProp.is())
- {
- xSeqProp->setPropertyValue(OUString::createFromAscii("Role"),
- uno::makeAny( OUString::createFromAscii("values-x")));
- }
- xLabeledSeq->setValues( xSeq );
-
- // register for setting local data if external data provider is not present
- if( bHasOwnDomains )
+ DomainInfo aDomainInfo( *aIt );
+ Reference< chart2::data::XLabeledDataSequence > xLabeledSeq =
+ lcl_createAndAddSequenceToSeries( aDomainInfo.aRole, aDomainInfo.aRange, xDataProvider, m_xSeries );
+ if( xLabeledSeq.is() )
{
+ // register for setting local data if external data provider is not present
mrLSequencesPerIndex.insert(
tSchXMLLSequencesPerIndex::value_type(
- tSchXMLIndexWithPart( mrCurrentDataIndex, SCH_XML_PART_VALUES ), xLabeledSeq ));
- ++mrCurrentDataIndex;
-
- nDomainOffset = mrCurrentDataIndex - nCurrentDataIndexBeforeDomains;
+ tSchXMLIndexWithPart( aDomainInfo.nIndexForLocalData, SCH_XML_PART_VALUES ), xLabeledSeq ));
}
- else
- {
- mrLSequencesPerIndex.insert(
- tSchXMLLSequencesPerIndex::value_type(
- tSchXMLIndexWithPart( mrFirstFirstDomainIndex, SCH_XML_PART_VALUES ), xLabeledSeq ));
- }
-
- // @todo? export and import labels for domains?
-
- // add new sequence to data series
- Sequence< Reference< chart2::data::XLabeledDataSequence > > aSeq( xSeriesSource->getDataSequences());
- aSeq.realloc( aSeq.getLength() + 1 );
- aSeq[aSeq.getLength()-1] = xLabeledSeq;
- Reference< chart2::data::XDataSink > xSink( xSeriesSource, uno::UNO_QUERY );
- if( xSink.is())
- xSink->setData( aSeq );
}
if( !bDeleteSeries )
@@ -655,18 +688,14 @@ void SchXMLSeries2Context::EndElement()
for( tSchXMLLSequencesPerIndex::const_iterator aIt( maPostponedSequences.begin());
aIt != maPostponedSequences.end(); ++aIt )
{
- sal_Int32 nNewIndex = aIt->first.first + nDomainOffset;
+ sal_Int32 nNewIndex = aIt->first.first + nDomainCount;
mrLSequencesPerIndex.insert(
tSchXMLLSequencesPerIndex::value_type(
tSchXMLIndexWithPart( nNewIndex, aIt->first.second ), aIt->second ));
}
+ m_rGlobalSeriesImportInfo.nCurrentDataIndex++;
}
maPostponedSequences.clear();
-
- if( bHasOwnDomains )
- mrCurrentDataIndex += nDomainOffset;
- else
- ++mrCurrentDataIndex;
}
SvXMLImportContext* SchXMLSeries2Context::CreateChildContext(
diff --git a/xmloff/source/chart/SchXMLSeries2Context.hxx b/xmloff/source/chart/SchXMLSeries2Context.hxx
index ef87835184..cb5a841974 100644
--- a/xmloff/source/chart/SchXMLSeries2Context.hxx
+++ b/xmloff/source/chart/SchXMLSeries2Context.hxx
@@ -62,12 +62,10 @@ private:
::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries > m_xSeries;
sal_Int32 mnSeriesIndex;
sal_Int32 mnDataPointIndex;
- sal_Int32& mrMaxSeriesLength;
- sal_Int32& mrNumOfLines;
- sal_Bool& mrStockHasVolume;
- ::rtl::OUString& mrFirstFirstDomainAddress;
- sal_Int32& mrFirstFirstDomainIndex;
- sal_Bool& mrAllRangeAddressesAvailable;
+ sal_Bool m_bStockHasVolume;
+
+ GlobalSeriesImportInfo& m_rGlobalSeriesImportInfo;
+
SchXMLAxis* mpAttachedAxis;
sal_Int32 mnAttachedAxis;
::rtl::OUString msAutoStyleName;
@@ -78,7 +76,6 @@ private:
::rtl::OUString m_aSeriesLabelRange;
bool m_bHasDomainContext;
tSchXMLLSequencesPerIndex & mrLSequencesPerIndex;
- sal_Int32& mrCurrentDataIndex;
tSchXMLLSequencesPerIndex maPostponedSequences;
bool& mrGlobalChartTypeUsedBySeries;
bool mbSymbolSizeIsMissingInFile;
@@ -92,15 +89,10 @@ public:
std::vector< SchXMLAxis >& rAxes,
::std::list< DataRowPointStyle >& rStyleList,
sal_Int32 nSeriesIndex,
- sal_Int32& rMaxSeriesLength,
- sal_Int32& rNumOfLines,
- sal_Bool& rStockHasVolume,
- ::rtl::OUString& rFirstFirstDomainAddress,
- sal_Int32& rFirstFirstDomainIndex,
- sal_Bool& rAllRangeAddressesAvailable,
+ sal_Bool bStockHasVolume,
+ GlobalSeriesImportInfo& rGlobalSeriesImportInfo,
const ::rtl::OUString & aGlobalChartTypeName,
tSchXMLLSequencesPerIndex & rLSequencesPerIndex,
- sal_Int32& rCurrentDataIndex,
bool& rGlobalChartTypeUsedBySeries,
const ::com::sun::star::awt::Size & rChartSize );
virtual ~SchXMLSeries2Context();
diff --git a/xmloff/source/chart/SchXMLTableContext.cxx b/xmloff/source/chart/SchXMLTableContext.cxx
index cacdc1307e..2e0aad2997 100644
--- a/xmloff/source/chart/SchXMLTableContext.cxx
+++ b/xmloff/source/chart/SchXMLTableContext.cxx
@@ -343,37 +343,6 @@ void lcl_fillRangeMapping(
}
}
-void lcl_copyProperties(
- const Reference< beans::XPropertySet > & xSource,
- const Reference< beans::XPropertySet > & xDestination )
-{
- if( ! (xSource.is() && xDestination.is()))
- return;
-
- try
- {
- Reference< beans::XPropertySetInfo > xSrcInfo( xSource->getPropertySetInfo(), uno::UNO_QUERY_THROW );
- Reference< beans::XPropertySetInfo > xDestInfo( xDestination->getPropertySetInfo(), uno::UNO_QUERY_THROW );
- Sequence< beans::Property > aProperties( xSrcInfo->getProperties());
- const sal_Int32 nLength = aProperties.getLength();
- for( sal_Int32 i = 0; i < nLength; ++i )
- {
- OUString aName( aProperties[i].Name);
- if( xDestInfo->hasPropertyByName( aName ))
- {
- beans::Property aProp( xDestInfo->getPropertyByName( aName ));
- if( (aProp.Attributes & beans::PropertyAttribute::READONLY) == 0 )
- xDestination->setPropertyValue(
- aName, xSource->getPropertyValue( aName ));
- }
- }
- }
- catch( const uno::Exception & )
- {
- OSL_ENSURE( false, "Copying property sets failed!" );
- }
-}
-
Reference< chart2::data::XDataSequence >
lcl_reassignDataSequence(
const Reference< chart2::data::XDataSequence > & xSequence,
@@ -967,7 +936,15 @@ void SchXMLTableHelper::applyTableSimple(
sal_Int32 nColumnCount = 0;
sal_Int32 nCol = 0, nRow = 0;
if( nRowCount )
+ {
nColumnCount = rTable.aData[ 0 ].size();
+ ::std::vector< ::std::vector< SchXMLCell > >::const_iterator iRow = rTable.aData.begin();
+ while( iRow != rTable.aData.end() )
+ {
+ nColumnCount = ::std::max( nColumnCount, static_cast<sal_Int32>(iRow->size()) );
+ iRow++;
+ }
+ }
// #i27909# avoid illegal index access for empty tables
if( nColumnCount == 0 || nRowCount == 0 )
@@ -981,7 +958,8 @@ void SchXMLTableHelper::applyTableSimple(
// set labels
::std::vector< ::std::vector< SchXMLCell > >::const_iterator iRow = rTable.aData.begin();
- for( nCol = 1; nCol < nColumnCount; nCol++ )
+ sal_Int32 nColumnCountOnFirstRow = iRow->size();
+ for( nCol = 1; nCol < nColumnCountOnFirstRow; nCol++ )
{
aLabels[ nCol - 1 ] = (*iRow)[ nCol ].aString;
}
@@ -1016,7 +994,7 @@ void SchXMLTableHelper::applyTableSimple(
// ----------------------------------------
-void SchXMLTableHelper::applyTable(
+void SchXMLTableHelper::applyTableToInternalDataProvider(
const SchXMLTable& rTable,
uno::Reference< chart2::XChartDocument > xChartDoc )
{
@@ -1031,19 +1009,12 @@ void SchXMLTableHelper::applyTable(
// prerequisite for this method: all objects (data series, domains, etc.)
// need their own range string.
- // If the range-strings are valid (starting with "local-table") they should
- // be interpreted like given, otherwise (when the ranges refer to Calc- or
- // Writer-ranges, but the container is not available like when pasting a
- // chart from Calc to Impress) the range is ignored, and every object gets
- // one table column in the order of appearance, which is: 1. categories,
- // 2. data series: 2.a) domains, 2.b) values (main-role, usually y-values)
-
// apply all data read in the table to the chart data-array of the internal
// data provider
lcl_applyXMLTableToInternalDataprovider( rTable, xDataArray );
}
-void SchXMLTableHelper::postProcessTable(
+void SchXMLTableHelper::switchRangesFromOuterToInternalIfNecessary(
const SchXMLTable& rTable,
const tSchXMLLSequencesPerIndex & rLSequencesPerIndex,
uno::Reference< chart2::XChartDocument > xChartDoc,
@@ -1051,6 +1022,14 @@ void SchXMLTableHelper::postProcessTable(
{
if( ! (xChartDoc.is() && xChartDoc->hasInternalDataProvider()))
return;
+
+ // If the range-strings are valid (starting with "local-table") they should
+ // be interpreted like given, otherwise (when the ranges refer to Calc- or
+ // Writer-ranges, but the container is not available like when pasting a
+ // chart from Calc to Impress) the range is ignored, and every object gets
+ // one table column in the order of appearance, which is: 1. categories,
+ // 2. data series: 2.a) domains, 2.b) values (main-role, usually y-values)
+
Reference< chart2::data::XDataProvider > xDataProv( xChartDoc->getDataProvider());
// create a mapping from original ranges to new ranges
@@ -1079,7 +1058,7 @@ void SchXMLTableHelper::postProcessTable(
lcl_reassignDataSequence( xSeq, xDataProv, aRangeMap, aRange ));
if( xNewSeq != xSeq )
{
- lcl_copyProperties( Reference< beans::XPropertySet >( xSeq, uno::UNO_QUERY ),
+ SchXMLTools::copyProperties( Reference< beans::XPropertySet >( xSeq, uno::UNO_QUERY ),
Reference< beans::XPropertySet >( xNewSeq, uno::UNO_QUERY ));
aLSeqIt->second->setValues( xNewSeq );
}
@@ -1099,7 +1078,7 @@ void SchXMLTableHelper::postProcessTable(
Reference< chart2::data::XDataSequence > xNewSequence(
xDataProv->createDataSequenceByRangeRepresentation(
OUString(RTL_CONSTASCII_USTRINGPARAM("categories"))));
- lcl_copyProperties(
+ SchXMLTools::copyProperties(
xOldSequenceProp, Reference< beans::XPropertySet >( xNewSequence, uno::UNO_QUERY ));
aLSeqIt->second->setValues( xNewSequence );
bCategoriesApplied = true;
@@ -1110,7 +1089,7 @@ void SchXMLTableHelper::postProcessTable(
OUString aRep( OUString::valueOf( aLSeqIt->first.first ));
Reference< chart2::data::XDataSequence > xNewSequence(
xDataProv->createDataSequenceByRangeRepresentation( aRep ));
- lcl_copyProperties(
+ SchXMLTools::copyProperties(
xOldSequenceProp, Reference< beans::XPropertySet >( xNewSequence, uno::UNO_QUERY ));
aLSeqIt->second->setValues( xNewSequence );
}
@@ -1131,7 +1110,7 @@ void SchXMLTableHelper::postProcessTable(
lcl_reassignDataSequence( xSeq, xDataProv, aRangeMap, aRange ));
if( xNewSeq != xSeq )
{
- lcl_copyProperties( Reference< beans::XPropertySet >( xSeq, uno::UNO_QUERY ),
+ SchXMLTools::copyProperties( Reference< beans::XPropertySet >( xSeq, uno::UNO_QUERY ),
Reference< beans::XPropertySet >( xNewSeq, uno::UNO_QUERY ));
aLSeqIt->second->setLabel( xNewSeq );
}
@@ -1143,7 +1122,7 @@ void SchXMLTableHelper::postProcessTable(
Reference< chart2::data::XDataSequence > xNewSeq(
xDataProv->createDataSequenceByRangeRepresentation( aRep ));
- lcl_copyProperties( Reference< beans::XPropertySet >( xSeq, uno::UNO_QUERY ),
+ SchXMLTools::copyProperties( Reference< beans::XPropertySet >( xSeq, uno::UNO_QUERY ),
Reference< beans::XPropertySet >( xNewSeq, uno::UNO_QUERY ));
aLSeqIt->second->setLabel( xNewSeq );
}
diff --git a/xmloff/source/chart/SchXMLTableContext.hxx b/xmloff/source/chart/SchXMLTableContext.hxx
index 461426f118..a49c70b8a8 100644
--- a/xmloff/source/chart/SchXMLTableContext.hxx
+++ b/xmloff/source/chart/SchXMLTableContext.hxx
@@ -108,14 +108,14 @@ public:
table, the addresses of series, the addresses of labels,
the cell-range-address for the categories
*/
- static void applyTable( const SchXMLTable& rTable,
+ static void applyTableToInternalDataProvider( const SchXMLTable& rTable,
com::sun::star::uno::Reference< com::sun::star::chart2::XChartDocument > xChartDoc );
- /** Second part of applyTable that has to be called after the data series
+ /** Second part of applyTableToInternalDataProvider that has to be called after the data series
got their styles set. This function reorders local data to fit the
correct data structure.
*/
- static void postProcessTable( const SchXMLTable& rTable,
+ static void switchRangesFromOuterToInternalIfNecessary( const SchXMLTable& rTable,
const tSchXMLLSequencesPerIndex & rLSequencesPerIndex,
com::sun::star::uno::Reference< com::sun::star::chart2::XChartDocument > xChartDoc,
::com::sun::star::chart::ChartDataRowSource eDataRowSource );
diff --git a/xmloff/source/chart/SchXMLTools.cxx b/xmloff/source/chart/SchXMLTools.cxx
index 29e0978006..40828bf400 100644
--- a/xmloff/source/chart/SchXMLTools.cxx
+++ b/xmloff/source/chart/SchXMLTools.cxx
@@ -53,9 +53,12 @@
#include <xmloff/xmlprmap.hxx>
#include <xmloff/xmlexp.hxx>
#include "xmlnmspe.hxx"
+#include <xmloff/xmlmetai.hxx>
+#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/chart2/data/XDataProvider.hpp>
+#include <com/sun/star/chart2/data/XDataReceiver.hpp>
#include <com/sun/star/chart2/data/XRangeXMLConversion.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
@@ -101,9 +104,19 @@ rtl::OUString lcl_getGeneratorFromModel( const uno::Reference< frame::XModel >&
uno::Reference< document::XDocumentProperties > xChartDocumentProperties(
xChartDocumentPropertiesSupplier->getDocumentProperties());
if( xChartDocumentProperties.is() )
- {
aGenerator = xChartDocumentProperties->getGenerator();
- }
+ }
+ return aGenerator;
+}
+
+rtl::OUString lcl_getGeneratorFromModelOrItsParent( const uno::Reference< frame::XModel >& xChartModel )
+{
+ ::rtl::OUString aGenerator( lcl_getGeneratorFromModel(xChartModel) );
+ if( !aGenerator.getLength() ) //try to get the missing info from the parent document
+ {
+ uno::Reference< container::XChild > xChild( xChartModel, uno::UNO_QUERY );
+ if( xChild.is() )
+ aGenerator = lcl_getGeneratorFromModel( uno::Reference< frame::XModel >( xChild->getParent(), uno::UNO_QUERY) );
}
return aGenerator;
}
@@ -123,6 +136,24 @@ sal_Int32 lcl_getBuildIDFromGenerator( const ::rtl::OUString& rGenerator )
return nBuildId;
}
+Reference< chart2::data::XDataSequence > lcl_createNewSequenceFromCachedXMLRange( const Reference< chart2::data::XDataSequence >& xSeq, const Reference< chart2::data::XDataProvider >& xDataProvider )
+{
+ Reference< chart2::data::XDataSequence > xRet;
+ OUString aRange;
+ Reference< chart2::data::XRangeXMLConversion > xRangeConversion( xDataProvider, uno::UNO_QUERY );
+ if( xRangeConversion.is() )
+ {
+ if( xSeq.is() && SchXMLTools::getXMLRangePropertyFromDataSequence( xSeq, aRange, /* bClearProp = */ true ) )
+ {
+ xRet.set( xDataProvider->createDataSequenceByRangeRepresentation(
+ xRangeConversion->convertRangeFromXML( aRange )) );
+ SchXMLTools::copyProperties( Reference< beans::XPropertySet >( xSeq, uno::UNO_QUERY ),
+ Reference< beans::XPropertySet >( xRet, uno::UNO_QUERY ));
+ }
+ }
+ return xRet;
+}
+
} // anonymous namespace
// ----------------------------------------
@@ -138,6 +169,7 @@ static __FAR_DATA SvXMLEnumMapEntry aXMLChartClassMap[] =
{ XML_RING, XML_CHART_CLASS_RING },
{ XML_SCATTER, XML_CHART_CLASS_SCATTER },
{ XML_RADAR, XML_CHART_CLASS_RADAR },
+ { XML_FILLED_RADAR, XML_CHART_CLASS_FILLED_RADAR },
{ XML_BAR, XML_CHART_CLASS_BAR },
{ XML_STOCK, XML_CHART_CLASS_STOCK },
{ XML_BUBBLE, XML_CHART_CLASS_BUBBLE },
@@ -182,8 +214,14 @@ const tMakeStringStringMap& lcl_getChartTypeNameMap()
( ::rtl::OUString::createFromAscii( "com.sun.star.chart.NetDiagram" )
, ::rtl::OUString::createFromAscii( "com.sun.star.chart2.NetChartType" ) )
+ ( ::rtl::OUString::createFromAscii( "com.sun.star.chart.FilledNetDiagram" )
+ , ::rtl::OUString::createFromAscii( "com.sun.star.chart2.FilledNetChartType" ) )
+
( ::rtl::OUString::createFromAscii( "com.sun.star.chart.StockDiagram" )
, ::rtl::OUString::createFromAscii( "com.sun.star.chart2.CandleStickChartType" ) )
+
+ ( ::rtl::OUString::createFromAscii( "com.sun.star.chart.BubbleDiagram" )
+ , ::rtl::OUString::createFromAscii( "com.sun.star.chart2.BubbleChartType" ) )
;
return g_aChartTypeNameMap;
@@ -241,8 +279,13 @@ OUString GetChartTypeByClassName(
else
aResultBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM("Scatter"));
}
+
+ else if( IsXMLToken( rClassName, XML_BUBBLE ))
+ aResultBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM("Bubble"));
else if( IsXMLToken( rClassName, XML_RADAR ))
aResultBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM("Net"));
+ else if( IsXMLToken( rClassName, XML_FILLED_RADAR ))
+ aResultBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM("FilledNet"));
else if( IsXMLToken( rClassName, XML_STOCK ))
{
if( bUseOldNames )
@@ -306,8 +349,12 @@ XMLTokenEnum getTokenByChartType(
else if( (bUseOldNames && aServiceName.equalsAscii("XY")) ||
(!bUseOldNames && aServiceName.equalsAscii("Scatter")))
eResult = XML_SCATTER;
+ else if( aServiceName.equalsAscii("Bubble"))
+ eResult = XML_BUBBLE;
else if( aServiceName.equalsAscii("Net"))
eResult = XML_RADAR;
+ else if( aServiceName.equalsAscii("FilledNet"))
+ eResult = XML_FILLED_RADAR;
else if( (bUseOldNames && aServiceName.equalsAscii("Stock")) ||
(!bUseOldNames && aServiceName.equalsAscii("CandleStick")))
eResult = XML_STOCK;
@@ -583,6 +630,75 @@ bool getXMLRangePropertyFromDataSequence(
return bResult;
}
+void copyProperties(
+ const Reference< beans::XPropertySet > & xSource,
+ const Reference< beans::XPropertySet > & xDestination )
+{
+ if( ! (xSource.is() && xDestination.is()) )
+ return;
+
+ try
+ {
+ Reference< beans::XPropertySetInfo > xSrcInfo( xSource->getPropertySetInfo(), uno::UNO_QUERY_THROW );
+ Reference< beans::XPropertySetInfo > xDestInfo( xDestination->getPropertySetInfo(), uno::UNO_QUERY_THROW );
+ Sequence< beans::Property > aProperties( xSrcInfo->getProperties());
+ const sal_Int32 nLength = aProperties.getLength();
+ for( sal_Int32 i = 0; i < nLength; ++i )
+ {
+ OUString aName( aProperties[i].Name);
+ if( xDestInfo->hasPropertyByName( aName ))
+ {
+ beans::Property aProp( xDestInfo->getPropertyByName( aName ));
+ if( (aProp.Attributes & beans::PropertyAttribute::READONLY) == 0 )
+ xDestination->setPropertyValue(
+ aName, xSource->getPropertyValue( aName ));
+ }
+ }
+ }
+ catch( const uno::Exception & )
+ {
+ OSL_ENSURE( false, "Copying property sets failed!" );
+ }
+}
+
+bool switchBackToDataProviderFromParent( const Reference< chart2::XChartDocument >& xChartDoc, const tSchXMLLSequencesPerIndex & rLSequencesPerIndex )
+{
+ //return whether the switch is successful
+ if( !xChartDoc.is() || !xChartDoc->hasInternalDataProvider() )
+ return false;
+ Reference< chart2::data::XDataProvider > xDataProviderFromParent( SchXMLTools::getDataProviderFromParent( xChartDoc ) );
+ if( !xDataProviderFromParent.is() )
+ return false;
+ uno::Reference< chart2::data::XDataReceiver > xDataReceiver( xChartDoc, uno::UNO_QUERY );
+ if( !xDataReceiver.is() )
+ return false;
+
+ xDataReceiver->attachDataProvider( xDataProviderFromParent );
+
+ for( tSchXMLLSequencesPerIndex::const_iterator aLSeqIt( rLSequencesPerIndex.begin() );
+ aLSeqIt != rLSequencesPerIndex.end(); ++aLSeqIt )
+ {
+ Reference< chart2::data::XLabeledDataSequence > xLabeledSeq( aLSeqIt->second );
+ if( !xLabeledSeq.is() )
+ continue;
+ Reference< chart2::data::XDataSequence > xNewSeq;
+ xNewSeq = lcl_createNewSequenceFromCachedXMLRange( xLabeledSeq->getValues(), xDataProviderFromParent );
+ if( xNewSeq.is() )
+ xLabeledSeq->setValues( xNewSeq );
+ xNewSeq = lcl_createNewSequenceFromCachedXMLRange( xLabeledSeq->getLabel(), xDataProviderFromParent );
+ if( xNewSeq.is() )
+ xLabeledSeq->setLabel( xNewSeq );
+ }
+ return true;
+}
+
+void setBuildIDAtImportInfo( uno::Reference< frame::XModel > xModel, Reference< beans::XPropertySet > xImportInfo )
+{
+ ::rtl::OUString aGenerator( lcl_getGeneratorFromModelOrItsParent(xModel) );
+ if( aGenerator.getLength() )
+ SvXMLMetaDocumentContext::setBuildId( aGenerator, xImportInfo );
+}
+
bool isDocumentGeneratedWithOpenOfficeOlderThan3_0( const uno::Reference< frame::XModel >& xChartModel )
{
bool bResult = isDocumentGeneratedWithOpenOfficeOlderThan2_3( xChartModel );
@@ -616,29 +732,62 @@ bool isDocumentGeneratedWithOpenOfficeOlderThan2_3( const uno::Reference< frame:
//if there is a meta stream at the chart object it was not written with an older OpenOffice version < 2.3
if( !aGenerator.getLength() )
{
- //if there is no meta stream at the chart object we need to check the version from the parent document
- //and we need to check whether the document was created with OpenOffice.org at all
+ //if there is no meta stream at the chart object we need to check whether the parent document is OpenOffice at all
uno::Reference< container::XChild > xChild( xChartModel, uno::UNO_QUERY );
if( xChild.is() )
{
- ::rtl::OUString aParentGenerator( lcl_getGeneratorFromModel( uno::Reference< frame::XModel >( xChild->getParent(), uno::UNO_QUERY) ) );
- if( aParentGenerator.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("OpenOffice.org_project") ) ) != -1 )
+ aGenerator = lcl_getGeneratorFromModel( uno::Reference< frame::XModel >( xChild->getParent(), uno::UNO_QUERY) );
+ if( aGenerator.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("OpenOffice.org_project") ) ) != -1 )
{
- sal_Int32 nBuilId = lcl_getBuildIDFromGenerator( aParentGenerator );
- if( nBuilId<=9161 ) //9161 is build id of OpenOffice.org 2.2.1
- bResult= true;
+ //the chart application has not created files without a meta stream since OOo 2.3 (OOo 2.3 has written a metastream already)
+ //only the report builder extension has created some files with OOo 3.1 that do not have a meta stream
+ if( aGenerator.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("OpenOffice.org_project/31") ) ) != -1 )
+ bResult = false;//#i100102# probably generated with OOo 3.1 by the report designer
+ else
+ bResult= true; //in this case the OLE chart was created by an older version, as OLE objects are sometimes stream copied the version can differ from the parents version, so the parents version is not a reliable indicator
}
- else if(
- ( aParentGenerator.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("OpenOffice.org 1") ) ) == 0 )
- || ( aParentGenerator.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("StarOffice 6") ) ) == 0 )
- || ( aParentGenerator.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("StarOffice 7") ) ) == 0 )
- || ( aParentGenerator.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("StarSuite 6") ) ) == 0 )
- || ( aParentGenerator.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("StarSuite 7") ) ) == 0 )
- )
+ else if( isDocumentGeneratedWithOpenOfficeOlderThan2_0(xChartModel) )
bResult= true;
}
}
return bResult;
}
+bool isDocumentGeneratedWithOpenOfficeOlderThan2_0( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xChartModel)
+{
+ bool bResult = false;
+ ::rtl::OUString aGenerator( lcl_getGeneratorFromModelOrItsParent(xChartModel) );
+ if( ( aGenerator.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("OpenOffice.org 1") ) ) == 0 )
+ || ( aGenerator.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("StarOffice 6") ) ) == 0 )
+ || ( aGenerator.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("StarOffice 7") ) ) == 0 )
+ || ( aGenerator.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("StarSuite 6") ) ) == 0 )
+ || ( aGenerator.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("StarSuite 7") ) ) == 0 )
+ )
+ bResult= true;
+ return bResult;
+}
+
+Reference< chart2::data::XDataProvider > getDataProviderFromParent( const Reference< chart2::XChartDocument >& xChartDoc )
+{
+ Reference< chart2::data::XDataProvider > xRet;
+ uno::Reference< container::XChild > xChild( xChartDoc, uno::UNO_QUERY );
+ if( xChild.is() )
+ {
+ Reference< lang::XMultiServiceFactory > xFact( xChild->getParent(), uno::UNO_QUERY );
+ if( xFact.is() )
+ {
+ const OUString aDataProviderServiceName( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.chart2.data.DataProvider"));
+ const uno::Sequence< OUString > aServiceNames( xFact->getAvailableServiceNames());
+ const OUString * pBegin = aServiceNames.getConstArray();
+ const OUString * pEnd = pBegin + aServiceNames.getLength();
+ if( ::std::find( pBegin, pEnd, aDataProviderServiceName ) != pEnd )
+ {
+ xRet = Reference< chart2::data::XDataProvider >(
+ xFact->createInstance( aDataProviderServiceName ), uno::UNO_QUERY );
+ }
+ }
+ }
+ return xRet;
+}
+
} // namespace SchXMLTools
diff --git a/xmloff/source/chart/SchXMLTools.hxx b/xmloff/source/chart/SchXMLTools.hxx
index bdbf1f71d9..8be5df2ddb 100644
--- a/xmloff/source/chart/SchXMLTools.hxx
+++ b/xmloff/source/chart/SchXMLTools.hxx
@@ -53,10 +53,14 @@ class SvXMLExport;
namespace SchXMLTools
{
+ bool isDocumentGeneratedWithOpenOfficeOlderThan2_0( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xChartModel);
bool isDocumentGeneratedWithOpenOfficeOlderThan2_3( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xChartModel);
bool isDocumentGeneratedWithOpenOfficeOlderThan2_4( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xChartModel);
bool isDocumentGeneratedWithOpenOfficeOlderThan3_0( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xChartModel);
+ void setBuildIDAtImportInfo( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > xModel
+ , ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > xImportInfo );
+
enum SchXMLChartTypeEnum
{
XML_CHART_CLASS_LINE,
@@ -65,9 +69,10 @@ namespace SchXMLTools
XML_CHART_CLASS_RING,
XML_CHART_CLASS_SCATTER,
XML_CHART_CLASS_RADAR,
+ XML_CHART_CLASS_FILLED_RADAR,
XML_CHART_CLASS_BAR,
XML_CHART_CLASS_STOCK,
- XML_CHART_CLASS_BUBBLE, // not yet implemented
+ XML_CHART_CLASS_BUBBLE,
XML_CHART_CLASS_ADDIN,
XML_CHART_CLASS_UNKNOWN
};
@@ -127,6 +132,16 @@ namespace SchXMLTools
::com::sun::star::chart2::data::XDataSequence > & xDataSequence,
::rtl::OUString & rOutXMLRange,
bool bClearProp = false );
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataProvider > getDataProviderFromParent( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument >& xChartDoc );
+
+ bool switchBackToDataProviderFromParent( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XChartDocument >& xChartDoc
+ , const tSchXMLLSequencesPerIndex & rLSequencesPerIndex );
+
+ void copyProperties(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & xSource,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & xDestination );
}
#endif // SCH_XML_TOOLS_HXX_
diff --git a/xmloff/source/chart/transporttypes.hxx b/xmloff/source/chart/transporttypes.hxx
index 7e4d790a78..90e8b48333 100644
--- a/xmloff/source/chart/transporttypes.hxx
+++ b/xmloff/source/chart/transporttypes.hxx
@@ -136,9 +136,25 @@ struct SchXMLAxis
// ----------------------------------------
-// struct PostponedStyleObject
-// {
-// };
+struct GlobalSeriesImportInfo
+{
+ GlobalSeriesImportInfo( sal_Bool& rAllRangeAddressesAvailable )
+ : rbAllRangeAddressesAvailable( rAllRangeAddressesAvailable )
+ , nCurrentDataIndex( 0 )
+ , nFirstFirstDomainIndex( -1 )
+ , nFirstSecondDomainIndex( -1 )
+ {}
+
+ sal_Bool& rbAllRangeAddressesAvailable;
+
+ sal_Int32 nCurrentDataIndex;
+
+ ::rtl::OUString aFirstFirstDomainAddress;
+ sal_Int32 nFirstFirstDomainIndex;
+
+ ::rtl::OUString aFirstSecondDomainAddress;
+ sal_Int32 nFirstSecondDomainIndex;
+};
struct DataRowPointStyle
{
diff --git a/xmloff/source/core/RDFaExportHelper.cxx b/xmloff/source/core/RDFaExportHelper.cxx
new file mode 100644
index 0000000000..e803c7dc1c
--- /dev/null
+++ b/xmloff/source/core/RDFaExportHelper.cxx
@@ -0,0 +1,218 @@
+/*************************************************************************
+ *
+ * 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: RDFaExportHelper.cxx,v $
+ * $Revision: 1.1.2.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 "precompiled_xmloff.hxx"
+
+#include "RDFaExportHelper.hxx"
+
+#include "xmlnmspe.hxx"
+
+#include <xmloff/xmlexp.hxx>
+#include <xmloff/xmltoken.hxx>
+
+#include <comphelper/stlunosequence.hxx>
+#include <comphelper/stl_types.hxx>
+
+#include <com/sun/star/rdf/Statement.hpp>
+#include <com/sun/star/rdf/URIs.hpp>
+#include <com/sun/star/rdf/URI.hpp>
+#include <com/sun/star/rdf/XLiteral.hpp>
+#include <com/sun/star/rdf/XRepositorySupplier.hpp>
+#include <com/sun/star/rdf/XDocumentRepository.hpp>
+
+#include <rtl/ustrbuf.hxx>
+
+#include <boost/bind.hpp>
+#include <boost/iterator_adaptors.hpp>
+#ifndef BOOST_ITERATOR_ADAPTOR_DWA053000_HPP_ // from iterator_adaptors.hpp
+// N.B.: the check for the header guard _of a specific version of boost_
+// is here so this may work on different versions of boost,
+// which sadly put the goods in different header files
+#include <boost/iterator/transform_iterator.hpp>
+#endif
+
+#include <functional>
+#include <algorithm>
+
+
+using namespace ::com::sun::star;
+
+namespace xmloff {
+
+static const char s_prefix [] = "_:b";
+
+static ::rtl::OUString
+makeCURIE(SvXMLExport * i_pExport,
+ uno::Reference<rdf::XURI> const & i_xURI)
+{
+ OSL_ENSURE(i_xURI.is(), "makeCURIE: null URI");
+ if (!i_xURI.is()) throw uno::RuntimeException();
+
+ const ::rtl::OUString Namespace( i_xURI->getNamespace() );
+ OSL_ENSURE(Namespace.getLength(), "makeCURIE: no namespace");
+ if (!Namespace.getLength()) throw uno::RuntimeException();
+
+ ::rtl::OUStringBuffer buf;
+ buf.append( i_pExport->EnsureNamespace(Namespace) );
+ buf.append( static_cast<sal_Unicode>(':') );
+ // N.B.: empty LocalName is valid!
+ buf.append( i_xURI->getLocalName() );
+
+ return buf.makeStringAndClear();
+}
+
+////////////////////////////////////////////////////////////////////////////
+
+RDFaExportHelper::RDFaExportHelper(SvXMLExport & i_rExport)
+ : m_rExport(i_rExport), m_xRepository(0), m_Counter(0)
+{
+ const uno::Reference<rdf::XRepositorySupplier> xRS( m_rExport.GetModel(),
+ uno::UNO_QUERY);
+ OSL_ENSURE(xRS.is(), "AddRDFa: model is no rdf::XRepositorySupplier");
+ if (!xRS.is()) throw uno::RuntimeException();
+ m_xRepository.set(xRS->getRDFRepository(), uno::UNO_QUERY_THROW);
+
+ const uno::Reference<rdf::XURI> xLabel(
+ rdf::URI::createKnown(m_rExport.GetComponentContext(),
+ rdf::URIs::RDFS_LABEL));
+ m_RDFsLabel = xLabel->getStringValue();
+}
+
+::rtl::OUString
+RDFaExportHelper::LookupBlankNode(
+ uno::Reference<rdf::XBlankNode> const & i_xBlankNode)
+{
+ OSL_ENSURE(i_xBlankNode.is(), "null BlankNode?");
+ if (!i_xBlankNode.is()) throw uno::RuntimeException();
+ ::rtl::OUString & rEntry(
+ m_BlankNodeMap[ i_xBlankNode->getStringValue() ] );
+ if (!rEntry.getLength())
+ {
+ ::rtl::OUStringBuffer buf;
+ buf.appendAscii(s_prefix);
+ buf.append(++m_Counter);
+ rEntry = buf.makeStringAndClear();
+ }
+ return rEntry;
+}
+
+////////////////////////////////////////////////////////////////////////////
+
+void
+RDFaExportHelper::AddRDFa(
+ uno::Reference<rdf::XMetadatable> const & i_xMetadatable)
+{
+ try
+ {
+ uno::Sequence<rdf::Statement> stmts(
+ m_xRepository->getStatementRDFa(i_xMetadatable) );
+
+ if (0 == stmts.getLength())
+ {
+ return; // no RDFa
+ }
+
+ // all stmts have the same subject, so we only handle first one
+ const uno::Reference<rdf::XURI> xSubjectURI(stmts[0].Subject,
+ uno::UNO_QUERY);
+ const uno::Reference<rdf::XBlankNode> xSubjectBNode(stmts[0].Subject,
+ uno::UNO_QUERY);
+ if (!xSubjectURI.is() && !xSubjectBNode.is())
+ {
+ throw uno::RuntimeException();
+ }
+ static const sal_Unicode s_OpenBracket ('[');
+ static const sal_Unicode s_CloseBracket(']');
+ const ::rtl::OUString about( xSubjectURI.is()
+ ? m_rExport.GetRelativeReference(xSubjectURI->getStringValue())
+ : ::rtl::OUStringBuffer().append(s_OpenBracket).append(
+ LookupBlankNode(xSubjectBNode)).append(s_CloseBracket)
+ .makeStringAndClear()
+ );
+
+ rdf::Statement* const iter
+ ( ::std::partition( ::comphelper::stl_begin(stmts),
+ ::comphelper::stl_end(stmts),
+ ::boost::bind(&::rtl::OUString::equals, m_RDFsLabel,
+ ::boost::bind(&rdf::XNode::getStringValue,
+ ::boost::bind(&rdf::Statement::Predicate, _1))) ) );
+
+ if (iter != ::comphelper::stl_end(stmts))
+ {
+ // from iter to end, all stmts should have same object
+ const uno::Reference<rdf::XLiteral> xContent(
+ (*iter).Object, uno::UNO_QUERY_THROW );
+ const uno::Reference<rdf::XURI> xDatatype(xContent->getDatatype());
+ if (xDatatype.is())
+ {
+ const ::rtl::OUString datatype(
+ makeCURIE(&m_rExport, xDatatype) );
+ m_rExport.AddAttribute(XML_NAMESPACE_XHTML,
+ token::XML_DATATYPE, datatype);
+ }
+ if (iter != ::comphelper::stl_begin(stmts)) // there is rdfs:label
+ {
+ m_rExport.AddAttribute(XML_NAMESPACE_XHTML, token::XML_CONTENT,
+ xContent->getValue());
+ }
+ }
+ else
+ {
+ OSL_ENSURE(false,"invalid RDFa: every property is rdfs:label");
+ return;
+ }
+
+ ::rtl::OUStringBuffer property;
+ ::comphelper::intersperse(
+ ::boost::make_transform_iterator(
+ iter, // omit RDFsLabel predicates!
+ ::boost::bind(&makeCURIE, &m_rExport,
+ ::boost::bind(&rdf::Statement::Predicate, _1))),
+ // argh, this must be the same type :(
+ ::boost::make_transform_iterator(
+ ::comphelper::stl_end(stmts),
+ ::boost::bind(&makeCURIE, &m_rExport,
+ ::boost::bind(&rdf::Statement::Predicate, _1))),
+ ::comphelper::OUStringBufferAppender(property),
+ ::rtl::OUString::createFromAscii(" "));
+
+ m_rExport.AddAttribute(XML_NAMESPACE_XHTML, token::XML_PROPERTY,
+ property.makeStringAndClear());
+
+ m_rExport.AddAttribute(XML_NAMESPACE_XHTML, token::XML_ABOUT, about);
+ }
+ catch (uno::Exception &)
+ {
+ OSL_ENSURE(false, "AddRDFa: exception");
+ }
+}
+
+} // namespace xmloff
+
diff --git a/xmloff/source/core/RDFaImportHelper.cxx b/xmloff/source/core/RDFaImportHelper.cxx
new file mode 100644
index 0000000000..2846042177
--- /dev/null
+++ b/xmloff/source/core/RDFaImportHelper.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: RDFaImportHelper.cxx,v $
+ * $Revision: 1.1.2.6 $
+ *
+ * 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_xmloff.hxx"
+
+#include "RDFaImportHelper.hxx"
+
+#include <xmloff/xmlimp.hxx>
+#include <xmloff/nmspmap.hxx>
+
+#include <comphelper/sequenceasvector.hxx>
+
+#include <tools/string.hxx> // for GetAbsoluteReference
+
+#include <com/sun/star/rdf/URI.hpp>
+#include <com/sun/star/rdf/XDocumentMetadataAccess.hpp>
+#include <com/sun/star/rdf/XDocumentRepository.hpp>
+
+#include <rtl/ustring.hxx>
+
+#include <boost/bind.hpp>
+#include <boost/iterator_adaptors.hpp>
+#ifndef BOOST_ITERATOR_ADAPTOR_DWA053000_HPP_ // from iterator_adaptors.hpp
+// N.B.: the check for the header guard _of a specific version of boost_
+// is here so this may work on different versions of boost,
+// which sadly put the goods in different header files
+#include <boost/iterator/transform_iterator.hpp>
+#endif
+
+#include <map>
+#include <iterator>
+#include <functional>
+#include <algorithm>
+
+
+using namespace ::com::sun::star;
+
+namespace xmloff {
+
+/** a bit of context for parsing RDFa attributes */
+class SAL_DLLPRIVATE RDFaReader
+{
+ const SvXMLImport & m_rImport;
+
+ const SvXMLImport & GetImport() const { return m_rImport; }
+
+ //FIXME: this is an ugly hack to workaround buggy SvXMLImport::GetAbsolute
+ ::rtl::OUString GetAbsoluteReference(::rtl::OUString const & i_rURI) const
+ {
+ if (!i_rURI.getLength() || i_rURI[0] == '#')
+ {
+ return GetImport().GetBaseURL() + i_rURI;
+ }
+ else
+ {
+ return GetImport().GetAbsoluteReference(i_rURI);
+ }
+ }
+
+public:
+ RDFaReader(SvXMLImport const & i_rImport)
+ : m_rImport(i_rImport)
+ { }
+
+ // returns URI or blank node!
+ ::rtl::OUString ReadCURIE(::rtl::OUString const & i_rCURIE) const;
+
+ std::vector< ::rtl::OUString >
+ ReadCURIEs(::rtl::OUString const & i_rCURIEs) const;
+
+ ::rtl::OUString
+ ReadURIOrSafeCURIE( ::rtl::OUString const & i_rURIOrSafeCURIE) const;
+};
+
+/** helper to insert RDFa statements into the RDF repository */
+class SAL_DLLPRIVATE RDFaInserter
+{
+ const uno::Reference<uno::XComponentContext> m_xContext;
+ uno::Reference< rdf::XDocumentRepository > m_xRepository;
+
+ typedef ::std::map< ::rtl::OUString, uno::Reference< rdf::XBlankNode > >
+ BlankNodeMap_t;
+
+ BlankNodeMap_t m_BlankNodeMap;
+
+public:
+ RDFaInserter(uno::Reference<uno::XComponentContext> const & i_xContext,
+ uno::Reference< rdf::XDocumentRepository > const & i_xRepository)
+ : m_xContext(i_xContext)
+ , m_xRepository(i_xRepository)
+ {}
+
+ uno::Reference< rdf::XBlankNode >
+ LookupBlankNode(::rtl::OUString const & i_rNodeId );
+
+ uno::Reference< rdf::XURI >
+ MakeURI( ::rtl::OUString const & i_rURI) const;
+
+ uno::Reference< rdf::XResource>
+ MakeResource( ::rtl::OUString const & i_rResource);
+
+ void InsertRDFaEntry(struct RDFaEntry const & i_rEntry);
+};
+
+/** store metadatable object and its RDFa attributes */
+struct SAL_DLLPRIVATE RDFaEntry
+{
+ uno::Reference<rdf::XMetadatable> m_xObject;
+ ::rtl::OUString m_About;
+ ::std::vector< ::rtl::OUString > m_Properties;
+ ::rtl::OUString m_Content;
+ ::rtl::OUString m_Datatype;
+
+ RDFaEntry(uno::Reference<rdf::XMetadatable> i_xObject,
+ ::rtl::OUString const & i_rAbout,
+ ::std::vector< ::rtl::OUString > const & i_rProperties,
+ ::rtl::OUString const & i_rContent,
+ ::rtl::OUString const & i_rDatatype)
+ : m_xObject(i_xObject)
+ , m_About(i_rAbout)
+ , m_Properties(i_rProperties)
+ , m_Content(i_rContent)
+ , m_Datatype(i_rDatatype)
+ { }
+};
+
+////////////////////////////////////////////////////////////////////////////
+
+
+static inline bool isWS(const sal_Unicode i_Char)
+{
+ return ('\t' == i_Char) || ('\n' == i_Char) || ('\r' == i_Char)
+ || (' ' == i_Char);
+}
+
+static ::rtl::OUString splitAtWS(::rtl::OUString & io_rString)
+{
+ const sal_Int32 len( io_rString.getLength() );
+ sal_Int32 idxstt(0);
+ while ((idxstt < len) && ( isWS(io_rString[idxstt])))
+ ++idxstt; // skip leading ws
+ sal_Int32 idxend(idxstt);
+ while ((idxend < len) && (!isWS(io_rString[idxend])))
+ ++idxend; // the CURIE
+ const ::rtl::OUString ret(io_rString.copy(idxstt, idxend - idxstt));
+ io_rString = io_rString.copy(idxend); // rest
+ return ret;
+}
+
+::rtl::OUString
+RDFaReader::ReadCURIE(::rtl::OUString const & i_rCURIE) const
+{
+ // the RDFa spec says that a prefix is required (it may be empty: ":foo")
+ const sal_Int32 idx( i_rCURIE.indexOf(':') );
+ if (idx >= 0)
+ {
+ ::rtl::OUString Prefix;
+ ::rtl::OUString LocalName;
+ ::rtl::OUString Namespace;
+ sal_uInt16 nKey( GetImport().GetNamespaceMap()._GetKeyByAttrName(
+ i_rCURIE, &Prefix, &LocalName, &Namespace) );
+ if (Prefix.equalsAscii("_"))
+ {
+ // eeek, it's a bnode!
+ // "_" is not a valid URI scheme => we can identify bnodes
+ return i_rCURIE;
+ }
+ else
+ {
+ OSL_ENSURE(XML_NAMESPACE_NONE != nKey, "no namespace?");
+ if ((XML_NAMESPACE_UNKNOWN != nKey) &&
+ (XML_NAMESPACE_XMLNS != nKey))
+ {
+ // N.B.: empty LocalName is valid!
+ const ::rtl::OUString URI(Namespace + LocalName);
+// return GetImport().GetAbsoluteReference(URI);
+ return GetAbsoluteReference(URI);
+ }
+ else
+ {
+ OSL_TRACE( "ReadCURIE: invalid CURIE: invalid prefix" );
+ return ::rtl::OUString();
+ }
+ }
+ }
+ else
+ {
+ OSL_TRACE( "ReadCURIE: invalid CURIE: no prefix" );
+ return ::rtl::OUString();
+ }
+}
+
+::std::vector< ::rtl::OUString >
+RDFaReader::ReadCURIEs(::rtl::OUString const & i_rCURIEs) const
+{
+ std::vector< ::rtl::OUString > vec;
+ ::rtl::OUString CURIEs(i_rCURIEs);
+ do {
+ ::rtl::OUString curie( splitAtWS(CURIEs) );
+ if (curie.getLength())
+ {
+ const ::rtl::OUString uri(ReadCURIE(curie));
+ if (uri.getLength())
+ {
+ vec.push_back(uri);
+ }
+ }
+ }
+ while (CURIEs.getLength());
+ if (!vec.size())
+ {
+ OSL_TRACE( "ReadCURIEs: invalid CURIEs" );
+ }
+ return vec;
+}
+
+::rtl::OUString
+RDFaReader::ReadURIOrSafeCURIE(::rtl::OUString const & i_rURIOrSafeCURIE) const
+{
+ const sal_Int32 len(i_rURIOrSafeCURIE.getLength());
+ if (len && (i_rURIOrSafeCURIE[0] == '['))
+ {
+ if ((len >= 2) && (i_rURIOrSafeCURIE[len - 1] == ']'))
+ {
+ return ReadCURIE(i_rURIOrSafeCURIE.copy(1, len - 2));
+ }
+ else
+ {
+ OSL_TRACE( "ReadURIOrSafeCURIE: invalid SafeCURIE" );
+ return ::rtl::OUString();
+ }
+ }
+ else
+ {
+ if (i_rURIOrSafeCURIE.matchAsciiL("_:", 2)) // blank node
+ {
+ OSL_TRACE( "ReadURIOrSafeCURIE: invalid URI: scheme is _" );
+ return ::rtl::OUString();
+ }
+ else
+ {
+// return GetImport().GetAbsoluteReference(i_rURIOrSafeCURIE);
+ return GetAbsoluteReference(i_rURIOrSafeCURIE);
+ }
+ }
+}
+
+////////////////////////////////////////////////////////////////////////////
+
+uno::Reference< rdf::XBlankNode >
+RDFaInserter::LookupBlankNode(::rtl::OUString const & i_rNodeId )
+{
+ uno::Reference< rdf::XBlankNode > & rEntry( m_BlankNodeMap[ i_rNodeId ] );
+ if (!rEntry.is())
+ {
+ rEntry = m_xRepository->createBlankNode();
+ }
+ return rEntry;
+}
+
+uno::Reference< rdf::XURI >
+RDFaInserter::MakeURI( ::rtl::OUString const & i_rURI) const
+{
+ if (i_rURI.matchAsciiL("_:", 2)) // blank node
+ {
+ OSL_TRACE("MakeURI: cannot create URI for blank node");
+ return 0;
+ }
+ else
+ {
+ try
+ {
+ return rdf::URI::create( m_xContext, i_rURI );
+ }
+ catch (uno::Exception &)
+ {
+ OSL_ENSURE(false, "MakeURI: cannot create URI");
+ return 0;
+ }
+ }
+}
+
+uno::Reference< rdf::XResource>
+RDFaInserter::MakeResource( ::rtl::OUString const & i_rResource)
+{
+ if (i_rResource.matchAsciiL("_:", 2)) // blank node
+ {
+ // we cannot use the blank node label as-is: it must be distinct
+ // from labels in other graphs, so create fresh ones per XML stream
+ // N.B.: content.xml and styles.xml are distinct graphs
+ ::rtl::OUString name( i_rResource.copy(2) );
+ const uno::Reference< rdf::XBlankNode > xBNode( LookupBlankNode(name) );
+ OSL_ENSURE(xBNode.is(), "no blank node?");
+ return uno::Reference<rdf::XResource>( xBNode, uno::UNO_QUERY);
+ }
+ else
+ {
+ return uno::Reference<rdf::XResource>( MakeURI( i_rResource ),
+ uno::UNO_QUERY);
+ }
+}
+
+/** i wrote this because c++ implementations cannot agree on which variant
+ of boost::bind and std::mem_fun_ref applied to Reference::is compiles */
+class ref_is_null :
+ public ::std::unary_function<sal_Bool, const uno::Reference<rdf::XURI> & >
+{
+public:
+ sal_Bool operator() (const uno::Reference<rdf::XURI> & i_rRef)
+ {
+ return !i_rRef.is();
+ }
+};
+
+void RDFaInserter::InsertRDFaEntry(
+ struct RDFaEntry const & i_rEntry)
+{
+ OSL_ENSURE(i_rEntry.m_xObject.is(),
+ "InsertRDFaEntry: invalid arg: null object");
+ if (!i_rEntry.m_xObject.is()) return;
+
+ const uno::Reference< rdf::XResource > xSubject(
+ MakeResource( i_rEntry.m_About ) );
+ if (!xSubject.is())
+ {
+ return; // invalid
+ }
+
+ ::comphelper::SequenceAsVector< uno::Reference< rdf::XURI > > predicates;
+
+ predicates.reserve(i_rEntry.m_Properties.size());
+
+ ::std::remove_copy_if(
+ ::boost::make_transform_iterator(i_rEntry.m_Properties.begin(),
+ ::boost::bind(&RDFaInserter::MakeURI, this, _1)),
+ // argh, this must be the same type :(
+ ::boost::make_transform_iterator(i_rEntry.m_Properties.end(),
+ ::boost::bind(&RDFaInserter::MakeURI, this, _1)),
+ ::std::back_inserter(predicates),
+ ref_is_null() );
+ // compiles only on wntmsci12
+// ::boost::bind( ::std::logical_not<sal_Bool>(), ::boost::bind<sal_Bool>(&uno::Reference<rdf::XURI>::is, _1)));
+ // compiles on unxsoli4, wntsci12, but not unxlngi6
+// ::boost::bind( ::std::logical_not<sal_Bool>(), ::boost::bind<sal_Bool, com::sun::star::uno::Reference<rdf::XURI> >(&uno::Reference<rdf::XURI>::is, _1)));
+ // compiles on unxsoli4, unxlngi6, but not wntsci12
+// ::std::not1( ::std::mem_fun_ref(&uno::Reference<rdf::XURI>::is)) );
+
+ if (!predicates.size())
+ {
+ return; // invalid
+ }
+
+ uno::Reference<rdf::XURI> xDatatype;
+ if (i_rEntry.m_Datatype.getLength())
+ {
+ xDatatype = MakeURI( i_rEntry.m_Datatype );
+ }
+
+ try
+ {
+ // N.B.: this will call xMeta->ensureMetadataReference, which is why
+ // this must be done _after_ importing the whole XML file,
+ // to prevent collision between generated ids and ids in the file
+ m_xRepository->setStatementRDFa(xSubject, predicates.getAsConstList(),
+ i_rEntry.m_xObject, i_rEntry.m_Content, xDatatype);
+ }
+ catch (uno::Exception &)
+ {
+ OSL_ENSURE(false, "InsertRDFaEntry: setStatementRDFa failed?");
+ }
+}
+
+////////////////////////////////////////////////////////////////////////////
+
+RDFaImportHelper::RDFaImportHelper(const SvXMLImport & i_rImport)
+ : m_rImport(i_rImport)
+{
+}
+
+RDFaImportHelper::~RDFaImportHelper()
+{
+}
+
+void
+RDFaImportHelper::AddRDFa(
+ uno::Reference<rdf::XMetadatable> i_xObject,
+ ::rtl::OUString const & i_rAbout,
+ ::rtl::OUString const & i_rProperty,
+ ::rtl::OUString const & i_rContent,
+ ::rtl::OUString const & i_rDatatype)
+{
+ if (!i_rProperty.getLength())
+ {
+ OSL_TRACE("AddRDFa: invalid input: xhtml:property empty");
+ return;
+ }
+ if (!i_xObject.is())
+ {
+ OSL_ENSURE(false, "AddRDFa: invalid arg: null textcontent");
+ return;
+ }
+ // must parse CURIEs here: need namespace declaration context
+ RDFaReader reader(GetImport());
+ const ::rtl::OUString about( reader.ReadURIOrSafeCURIE(i_rAbout) );
+ if (!about.getLength()) return;
+ const ::std::vector< ::rtl::OUString > properties(
+ reader.ReadCURIEs(i_rProperty) );
+ if (!properties.size()) return;
+ const ::rtl::OUString datatype( i_rDatatype.getLength()
+ ? reader.ReadCURIE(i_rDatatype)
+ : ::rtl::OUString() );
+ m_RDFaEntries.push_back(RDFaEntry(i_xObject,
+ about, properties, i_rContent, datatype));
+}
+
+void RDFaImportHelper::InsertRDFa(
+ uno::Reference< rdf::XRepositorySupplier> const & i_xModel)
+{
+ OSL_ENSURE(i_xModel.is(), "InsertRDFa: invalid arg: model null");
+ if (!i_xModel.is()) return;
+ const uno::Reference< rdf::XDocumentRepository > xRepository(
+ i_xModel->getRDFRepository(), uno::UNO_QUERY);
+ OSL_ENSURE(xRepository.is(), "InsertRDFa: no DocumentRepository?");
+ if (!xRepository.is()) return;
+ RDFaInserter inserter(GetImport().GetComponentContext(), xRepository);
+ ::std::for_each(m_RDFaEntries.begin(), m_RDFaEntries.end(),
+ ::boost::bind(&RDFaInserter::InsertRDFaEntry, &inserter, _1));
+}
+
+} // namespace xmloff
+
diff --git a/xmloff/source/core/makefile.mk b/xmloff/source/core/makefile.mk
index c68981c274..b9cb8e9c1b 100644
--- a/xmloff/source/core/makefile.mk
+++ b/xmloff/source/core/makefile.mk
@@ -77,7 +77,10 @@ SLOFILES = \
$(SLO)$/XMLEmbeddedObjectImportContext.obj \
$(SLO)$/XMLBase64Export.obj \
$(SLO)$/XMLBase64ImportContext.obj \
- $(SLO)$/XMLBasicExportFilter.obj
+ $(SLO)$/XMLBasicExportFilter.obj \
+ $(SLO)$/RDFaImportHelper.obj \
+ $(SLO)$/RDFaExportHelper.obj \
+
# --- Targets -------------------------------------------------------
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx
index 99f76bfb36..7733f81183 100644
--- a/xmloff/source/core/xmlexp.cxx
+++ b/xmloff/source/core/xmlexp.cxx
@@ -63,9 +63,7 @@
#include <xmloff/SettingsExportHelper.hxx>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/container/XIndexContainer.hpp>
-#ifndef _COM_SUN_STAR_DOCUMENT_XEVENTSSUPPLIER_HPP
#include <com/sun/star/document/XEventsSupplier.hpp>
-#endif
#include <com/sun/star/document/XViewDataSupplier.hpp>
#include <GradientStyle.hxx>
#include <HatchStyle.hxx>
@@ -73,16 +71,10 @@
#include <TransGradientStyle.hxx>
#include <MarkerStyle.hxx>
#include <DashStyle.hxx>
-#ifndef _XMLOFF_XMLFONTAUTOSTYLEPOOL_HXX
-#include <xmloff/XMLFontAutoStylePool>
-#endif
+#include <xmloff/XMLFontAutoStylePool.hxx>
#include "XMLImageMapExport.hxx"
-#ifndef _XMLOFF_XMLBASE64EXPORT_HXX_
#include "XMLBase64Export.hxx"
-#endif
-#ifndef _XMLOFF_XMLERROR_HXX_
#include "xmlerror.hxx"
-#endif
#include <com/sun/star/lang/ServiceNotRegisteredException.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include "XMLFilterServiceNames.h"
@@ -105,6 +97,7 @@
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
#include <com/sun/star/rdf/XMetadatable.hpp>
+#include "RDFaExportHelper.hxx"
using ::rtl::OUString;
@@ -126,6 +119,9 @@ sal_Char __READONLY_DATA sXML_1_2[] = "1.2";
const sal_Char *sOpenOfficeOrgProject ="OpenOffice.org_project";
+const sal_Char s_grddl_xsl[] =
+ "http://docs.oasis-open.org/office/1.2/xslt/odf2rdf.xsl";
+
#define LOGFILE_AUTHOR "mb93740"
#define XML_MODEL_SERVICE_WRITER "com.sun.star.text.TextDocument"
@@ -223,6 +219,19 @@ public:
/// relative path of stream in package, e.g. "someobject/content.xml"
::rtl::OUString mStreamPath;
+ const uno::Reference< uno::XComponentContext > mxComponentContext;
+
+ /// name of stream in package, e.g., "content.xml"
+ ::rtl::OUString mStreamName;
+
+ /// stack of backed up namespace maps
+ /// long: depth at which namespace map has been backed up into the stack
+ ::std::stack< ::std::pair< SvXMLNamespaceMap *, long > > mNamespaceMaps;
+ /// counts depth (number of open elements/start tags)
+ long mDepth;
+
+ ::std::auto_ptr< ::xmloff::RDFaExportHelper> mpRDFaHelper;
+
// --> OD 2008-11-26 #158694#
sal_Bool mbExportTextNumberElement;
// <--
@@ -243,14 +252,20 @@ SvXMLExport_Impl::SvXMLExport_Impl()
// --> PB 2007-07-06 #i146851#
,mbSaveBackwardCompatibleODF( sal_True )
// <--
- ,mStreamPath()
+ ,mxComponentContext( ::comphelper::getProcessComponentContext() )
+ ,mStreamName()
+ ,mNamespaceMaps()
+ ,mDepth(0)
+ ,mpRDFaHelper() // lazy
// --> OD 2008-11-26 #158694#
,mbExportTextNumberElement( sal_False )
// <--
,mbNullDateInitialized( sal_False )
{
+ OSL_ENSURE(mxComponentContext.is(), "SvXMLExport: no ComponentContext");
+ if (!mxComponentContext.is()) throw uno::RuntimeException();
mxUriReferenceFactory = uri::UriReferenceFactory::create(
- comphelper_getProcessComponentContext());
+ mxComponentContext );
}
//==============================================================================
@@ -325,9 +340,17 @@ void SvXMLExport::_InitCtor()
mpNamespaceMap->Add( GetXMLToken(XML_NP_XSI), GetXMLToken(XML_N_XSI), XML_NAMESPACE_XSI );
mpNamespaceMap->Add( GetXMLToken(XML_NP_FIELD), GetXMLToken(XML_N_FIELD), XML_NAMESPACE_FIELD );
}
+ // RDFa: needed for content and header/footer styles
if( (getExportFlags() & (EXPORT_STYLES|EXPORT_AUTOSTYLES|EXPORT_MASTERSTYLES|EXPORT_CONTENT) ) != 0 )
{
- mpNamespaceMap->Add( GetXMLToken(XML_NP_RDFA), GetXMLToken(XML_N_RDFA), XML_NAMESPACE_RDFA );
+ mpNamespaceMap->Add( GetXMLToken(XML_NP_XHTML),
+ GetXMLToken(XML_N_XHTML), XML_NAMESPACE_XHTML );
+ }
+ // GRDDL: to convert RDFa and meta.xml to RDF
+ if( (getExportFlags() & (EXPORT_META|EXPORT_STYLES|EXPORT_AUTOSTYLES|EXPORT_MASTERSTYLES|EXPORT_CONTENT) ) != 0 )
+ {
+ mpNamespaceMap->Add( GetXMLToken(XML_NP_GRDDL),
+ GetXMLToken(XML_N_GRDDL), XML_NAMESPACE_GRDDL );
}
mxAttrList = (xml::sax::XAttributeList*)mpAttrList;
@@ -762,9 +785,7 @@ void SAL_CALL SvXMLExport::initialize( const uno::Sequence< uno::Any >& aArgumen
aBaseURL.insertName( sName );
msOrigFileName = aBaseURL.GetMainURL(INetURLObject::DECODE_TO_IURI);
}
- OSL_ENSURE(sName.getLength(), "no StreamName ???");
- mpImpl->mStreamPath = sRelPath.getLength() ? sRelPath +
- ::rtl::OUString::createFromAscii("/") + sName : sName;
+ mpImpl->mStreamName = sName; // Note: may be empty (XSLT)
// --> OD 2006-09-26 #i69627#
const ::rtl::OUString sOutlineStyleAsNormalListStyle(
@@ -914,6 +935,54 @@ uno::Sequence< OUString > SAL_CALL SvXMLExport::getSupportedServiceNames( )
///////////////////////////////////////////////////////////////////////
+::rtl::OUString
+SvXMLExport::EnsureNamespace(::rtl::OUString const & i_rNamespace,
+ ::rtl::OUString const & i_rPreferredPrefix)
+{
+ ::rtl::OUString sPrefix;
+ sal_uInt16 nKey( _GetNamespaceMap().GetKeyByName( i_rNamespace ) );
+ if( XML_NAMESPACE_UNKNOWN == nKey )
+ {
+ // There is no prefix for the namespace, so
+ // we have to generate one and have to add it.
+ sPrefix = i_rPreferredPrefix;
+ nKey = _GetNamespaceMap().GetKeyByPrefix( sPrefix );
+ sal_Int32 n( 0 );
+ ::rtl::OUStringBuffer buf;
+ while( nKey != USHRT_MAX )
+ {
+ buf.append( i_rPreferredPrefix );
+ buf.append( ++n );
+ sPrefix = buf.makeStringAndClear();
+ nKey = _GetNamespaceMap().GetKeyByPrefix( sPrefix );
+ }
+
+ if (mpImpl->mNamespaceMaps.empty()
+ || (mpImpl->mNamespaceMaps.top().second != mpImpl->mDepth))
+ {
+ // top was created for lower depth... need a new namespace map!
+ mpImpl->mNamespaceMaps.push(
+ ::std::make_pair(mpNamespaceMap, mpImpl->mDepth) );
+ mpNamespaceMap = new SvXMLNamespaceMap( *mpNamespaceMap );
+ }
+
+ // add the namespace to the map and as attribute
+ mpNamespaceMap->Add( sPrefix, i_rNamespace );
+ buf.append( GetXMLToken(XML_XMLNS) );
+ buf.append( sal_Unicode(':') );
+ buf.append( sPrefix );
+ AddAttribute( buf.makeStringAndClear(), i_rNamespace );
+ }
+ else
+ {
+ // If there is a prefix for the namespace, reuse that.
+ sPrefix = _GetNamespaceMap().GetPrefixByKey( nKey );
+ }
+ return sPrefix;
+}
+
+///////////////////////////////////////////////////////////////////////
+
void SvXMLExport::AddAttributeASCII( sal_uInt16 nPrefixKey,
const sal_Char *pName,
const sal_Char *pValue )
@@ -921,9 +990,8 @@ void SvXMLExport::AddAttributeASCII( sal_uInt16 nPrefixKey,
OUString sName( OUString::createFromAscii( pName ) );
OUString sValue( OUString::createFromAscii( pValue ) );
- mpAttrList->AddAttribute( mpNamespaceMap->GetQNameByKey( nPrefixKey,
- sName ),
- sValue );
+ mpAttrList->AddAttribute(
+ _GetNamespaceMap().GetQNameByKey( nPrefixKey, sName ), sValue );
}
void SvXMLExport::AddAttribute( sal_uInt16 nPrefixKey, const sal_Char *pName,
@@ -931,16 +999,15 @@ void SvXMLExport::AddAttribute( sal_uInt16 nPrefixKey, const sal_Char *pName,
{
OUString sName( OUString::createFromAscii( pName ) );
- mpAttrList->AddAttribute( mpNamespaceMap->GetQNameByKey( nPrefixKey,
- sName ),
- rValue );
+ mpAttrList->AddAttribute(
+ _GetNamespaceMap().GetQNameByKey( nPrefixKey, sName ), rValue );
}
void SvXMLExport::AddAttribute( sal_uInt16 nPrefixKey, const OUString& rName,
const OUString& rValue )
{
- mpAttrList->AddAttribute( mpNamespaceMap->GetQNameByKey( nPrefixKey, rName ),
- rValue );
+ mpAttrList->AddAttribute(
+ _GetNamespaceMap().GetQNameByKey( nPrefixKey, rName ), rValue );
}
void SvXMLExport::AddAttribute( sal_uInt16 nPrefixKey,
@@ -948,7 +1015,7 @@ void SvXMLExport::AddAttribute( sal_uInt16 nPrefixKey,
const OUString& rValue )
{
mpAttrList->AddAttribute(
- mpNamespaceMap->GetQNameByKey( nPrefixKey, GetXMLToken(eName) ),
+ _GetNamespaceMap().GetQNameByKey( nPrefixKey, GetXMLToken(eName) ),
rValue );
}
@@ -957,7 +1024,7 @@ void SvXMLExport::AddAttribute( sal_uInt16 nPrefixKey,
enum XMLTokenEnum eValue)
{
mpAttrList->AddAttribute(
- mpNamespaceMap->GetQNameByKey( nPrefixKey, GetXMLToken(eName) ),
+ _GetNamespaceMap().GetQNameByKey( nPrefixKey, GetXMLToken(eName) ),
GetXMLToken(eValue) );
}
@@ -1307,6 +1374,13 @@ sal_uInt32 SvXMLExport::exportDoc( enum ::xmloff::token::XMLTokenEnum eClass )
{
enum XMLTokenEnum eRootService = XML_TOKEN_INVALID;
const sal_Int32 nExportMode = mnExportFlags & (EXPORT_META|EXPORT_STYLES|EXPORT_CONTENT|EXPORT_SETTINGS);
+
+ if ( EXPORT_SETTINGS != nExportMode ) // meta, content, styles
+ {
+ AddAttribute( XML_NAMESPACE_GRDDL, XML_TRANSFORMATION,
+ OUString::createFromAscii(s_grddl_xsl) );
+ }
+
if( EXPORT_META == nExportMode )
{
// export only meta
@@ -2159,7 +2233,8 @@ void SvXMLExport::StartElement(sal_uInt16 nPrefix,
enum ::xmloff::token::XMLTokenEnum eName,
sal_Bool bIgnWSOutside )
{
- StartElement(mpNamespaceMap->GetQNameByKey( nPrefix, GetXMLToken(eName) ), bIgnWSOutside);
+ StartElement(_GetNamespaceMap().GetQNameByKey( nPrefix,
+ GetXMLToken(eName) ), bIgnWSOutside);
}
void SvXMLExport::StartElement(const OUString& rName,
@@ -2188,6 +2263,7 @@ void SvXMLExport::StartElement(const OUString& rName,
}
}
ClearAttrList();
+ ++mpImpl->mDepth; // increment nesting depth counter
}
void SvXMLExport::Characters(const ::rtl::OUString& rChars)
@@ -2218,12 +2294,26 @@ void SvXMLExport::EndElement(sal_uInt16 nPrefix,
enum ::xmloff::token::XMLTokenEnum eName,
sal_Bool bIgnWSInside )
{
- EndElement(mpNamespaceMap->GetQNameByKey( nPrefix, GetXMLToken(eName) ), bIgnWSInside);
+ EndElement(_GetNamespaceMap().GetQNameByKey( nPrefix, GetXMLToken(eName) ),
+ bIgnWSInside);
}
void SvXMLExport::EndElement(const OUString& rName,
sal_Bool bIgnWSInside )
{
+ // decrement nesting depth counter & (maybe) restore namespace map
+ --mpImpl->mDepth;
+ if (!mpImpl->mNamespaceMaps.empty() &&
+ (mpImpl->mNamespaceMaps.top().second == mpImpl->mDepth))
+ {
+ delete mpNamespaceMap;
+ mpNamespaceMap = mpImpl->mNamespaceMaps.top().first;
+ mpImpl->mNamespaceMaps.pop();
+ }
+ OSL_ENSURE(mpImpl->mNamespaceMaps.empty() ||
+ (mpImpl->mNamespaceMaps.top().second < mpImpl->mDepth),
+ "SvXMLExport: NamespaceMaps corrupted");
+
if ((mnErrorFlags & ERROR_DO_NOTHING) != ERROR_DO_NOTHING)
{
try
@@ -2319,6 +2409,12 @@ void SvXMLExport::DisposingModel()
return mxServiceFactory;
}
+uno::Reference< uno::XComponentContext >
+SvXMLExport::GetComponentContext() const
+{
+ return mpImpl->mxComponentContext;
+}
+
::comphelper::UnoInterfaceToUniqueIdentifierMapper& SvXMLExport::getInterfaceToIdentifierMapper()
{
return mpImpl->maInterfaceToIdentifierMapper;
@@ -2346,23 +2442,9 @@ SvtSaveOptions::ODFDefaultVersion SvXMLExport::getDefaultVersion() const
return SvtSaveOptions::ODFVER_012;
}
-::rtl::OUString SvXMLExport::GetStreamPath() const
-{
- return mpImpl->mStreamPath;
-}
-
-//FIXME: where to put this???
-static bool splitXmlId(::rtl::OUString const & i_XmlId,
- ::rtl::OUString & o_StreamName, ::rtl::OUString& o_Idref )
+::rtl::OUString SvXMLExport::GetStreamName() const
{
- const sal_Int32 idx(i_XmlId.indexOf(static_cast<sal_Unicode>('#')));
- if ((idx <= 0) || (idx >= i_XmlId.getLength() - 1)) {
- return false;
- } else {
- o_StreamName = (i_XmlId.copy(0, idx));
- o_Idref = (i_XmlId.copy(idx+1));
- return true;
- }
+ return mpImpl->mStreamName;
}
void
@@ -2380,30 +2462,69 @@ SvXMLExport::AddAttributeXmlId(uno::Reference<uno::XInterface> const & i_xIfc)
// OSL_ENSURE(xMeta.is(), "xml:id: not XMetadatable");
if ( xMeta.is() )
{
- const ::rtl::OUString XmlId( xMeta->getXmlId() );
- if ( !XmlId.equalsAscii("") )
+ const beans::StringPair mdref( xMeta->getMetadataReference() );
+ if ( !mdref.Second.equalsAscii("") )
{
- ::rtl::OUString StreamName;
- ::rtl::OUString Idref;
- if( splitXmlId(XmlId, StreamName, Idref) )
+ const ::rtl::OUString streamName( GetStreamName() );
+ if ( streamName.getLength() )
{
- if ( GetStreamPath().equals(StreamName) )
+ if ( streamName.equals(mdref.First) )
{
- AddAttribute( XML_NAMESPACE_XML, XML_ID, Idref );
+ AddAttribute( XML_NAMESPACE_XML, XML_ID, mdref.Second );
}
else
{
- OSL_ENSURE(false, "xml:id: invalid stream name");
+ OSL_ENSURE(false, "SvXMLExport::AddAttributeXmlId: "
+ "invalid stream name");
}
}
else
{
- OSL_ENSURE(false, "xml:id invalid?");
+ // FIXME: this is ugly
+ // there is no stream name (e.g. XSLT, flat-xml format)!
+ // but how do we ensure uniqueness in this case?
+ // a) just omit styles.xml ids -- they are unlikely anyway...
+ // b) somehow find out whether we are currently exporting styles
+ // or content, and prefix "s" or "c" => unique
+ if ( mdref.First.equalsAscii("content.xml") )
+ {
+ AddAttribute( XML_NAMESPACE_XML, XML_ID, mdref.Second );
+ }
+ else
+ {
+ OSL_TRACE("SvXMLExport::AddAttributeXmlId: "
+ "no stream name given: dropping styles.xml xml:id");
+ }
}
}
}
}
+void
+SvXMLExport::AddAttributesRDFa(
+ uno::Reference<text::XTextContent> const & i_xTextContent)
+{
+ // check version >= 1.2
+ switch (getDefaultVersion()) {
+ case SvtSaveOptions::ODFVER_011: // fall thru
+ case SvtSaveOptions::ODFVER_010: return;
+ default: break;
+ }
+
+ const uno::Reference<rdf::XMetadatable> xMeta(
+ i_xTextContent, uno::UNO_QUERY);
+ if (!xMeta.is() || !xMeta->getMetadataReference().Second.getLength())
+ {
+ return; // no xml:id => no RDFa
+ }
+
+ if (!mpImpl->mpRDFaHelper.get())
+ {
+ mpImpl->mpRDFaHelper.reset( new ::xmloff::RDFaExportHelper(*this) );
+ }
+ mpImpl->mpRDFaHelper->AddRDFa(xMeta);
+}
+
// --> OD 2008-11-26 #158694#
sal_Bool SvXMLExport::exportTextNumberElement() const
{
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx
index e2648b3a5e..bd3dac462b 100644
--- a/xmloff/source/core/xmlimp.cxx
+++ b/xmloff/source/core/xmlimp.cxx
@@ -64,9 +64,12 @@
#include <tools/string.hxx> // used in StartElement for logging
#include <cppuhelper/implbase1.hxx>
#include <comphelper/extract.hxx>
+#include <comphelper/processfactory.hxx>
#include <vcl/fontcvt.hxx>
#include <com/sun/star/rdf/XMetadatable.hpp>
+#include <com/sun/star/rdf/XRepositorySupplier.hpp>
+#include "RDFaImportHelper.hxx"
#define LOGFILE_AUTHOR "unknown"
@@ -111,6 +114,7 @@ sal_Char __READONLY_DATA sXML_np__xforms[] = "_xforms";
sal_Char __READONLY_DATA sXML_np__xsd[] = "_xsd";
sal_Char __READONLY_DATA sXML_np__xsi[] = "_xsi";
sal_Char __READONLY_DATA sXML_np__field[] = "_field";
+sal_Char __READONLY_DATA sXML_np__xhtml[] = "_xhtml";
sal_Char __READONLY_DATA sXML_np__fo_old[] = "__fo";
sal_Char __READONLY_DATA sXML_np__xlink_old[] = "__xlink";
@@ -169,8 +173,8 @@ public:
INetURLObject aBaseURL;
INetURLObject aDocBase;
- /// relative path of stream in package, e.g. "someobject/content.xml"
- ::rtl::OUString mStreamPath;
+ /// name of stream in package, e.g., "content.xml"
+ ::rtl::OUString mStreamName;
::rtl::OUString aODFVersion;
@@ -183,18 +187,28 @@ public:
sal_Bool mbTextDocInOOoFileFormat;
// <--
+ const uno::Reference< uno::XComponentContext > mxComponentContext;
+
+ std::auto_ptr< xmloff::RDFaImportHelper > mpRDFaHelper;
+
SvXMLImport_Impl() :
hBatsFontConv( 0 ), hMathFontConv( 0 ),
mbOwnGraphicResolver( false ),
mbOwnEmbeddedResolver( false ),
- mStreamPath(),
+ mStreamName(),
// --> OD 2004-08-11 #i28749#
mbShapePositionInHoriL2R( sal_False ),
// <--
// --> OD 2007-12-19 #152540#
- mbTextDocInOOoFileFormat( sal_False )
+ mbTextDocInOOoFileFormat( sal_False ),
// <--
- {}
+ mxComponentContext( ::comphelper::getProcessComponentContext() ),
+ mpRDFaHelper() // lazy
+ {
+ OSL_ENSURE(mxComponentContext.is(), "SvXMLImport: no ComponentContext");
+ if (!mxComponentContext.is()) throw uno::RuntimeException();
+ }
+
~SvXMLImport_Impl()
{
if( hBatsFontConv )
@@ -222,7 +236,6 @@ void SvXMLImport::_InitCtor()
if( mnImportFlags != 0 )
{
// implicit "xml" namespace prefix
- const ::rtl::OUString Xml;
mpNamespaceMap->Add( GetXMLToken(XML_XML), GetXMLToken(XML_N_XML),
XML_NAMESPACE_XML );
mpNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__office ) ),
@@ -294,6 +307,9 @@ void SvXMLImport::_InitCtor()
mpNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__field ) ), GetXMLToken(XML_N_FIELD), XML_NAMESPACE_FIELD );
mpNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__of ) ),
GetXMLToken(XML_N_OF), XML_NAMESPACE_OF );
+ mpNamespaceMap->Add(
+ OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__xhtml ) ),
+ GetXMLToken(XML_N_XHTML), XML_NAMESPACE_XHTML );
}
msPackageProtocol = OUString( RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.Package:" ) );
@@ -527,6 +543,16 @@ void SAL_CALL SvXMLImport::endDocument( void )
// #i9518# All the stuff that accesses the document has to be done here, not in the dtor,
// because the SvXMLImport dtor might not be called until after the document has been closed.
+ if (mpImpl->mpRDFaHelper.get())
+ {
+ const uno::Reference<rdf::XRepositorySupplier> xRS(mxModel,
+ uno::UNO_QUERY);
+ if (xRS.is())
+ {
+ mpImpl->mpRDFaHelper->InsertRDFa( xRS );
+ }
+ }
+
if (mpNumImport)
{
delete mpNumImport;
@@ -935,9 +961,7 @@ void SAL_CALL SvXMLImport::initialize( const uno::Sequence< uno::Any >& aArgumen
mpImpl->aBaseURL.insertName( sRelPath );
mpImpl->aBaseURL.insertName( sName );
}
- OSL_ENSURE(sName.getLength(), "no StreamName ???");
- mpImpl->mStreamPath = sRelPath.getLength() ? sRelPath +
- ::rtl::OUString::createFromAscii("/") + sName : sName;
+ mpImpl->mStreamName = sName; // Note: may be empty (XSLT)
// --> OD 2004-08-10 #i28749# - retrieve property <ShapePositionInHoriL2R>
sPropName = OUString( RTL_CONSTASCII_USTRINGPARAM("ShapePositionInHoriL2R" ) );
if( xPropertySetInfo->hasPropertyByName(sPropName) )
@@ -1562,7 +1586,7 @@ const SvXMLStylesContext *SvXMLImport::GetMasterStyles() const
return (const SvXMLStylesContext *)&mxMasterStyles;
}
-OUString SvXMLImport::GetAbsoluteReference(const OUString& rValue)
+OUString SvXMLImport::GetAbsoluteReference(const OUString& rValue) const
{
if( rValue.getLength() == 0 || rValue[0] == '#' )
return rValue;
@@ -1753,6 +1777,13 @@ void SvXMLImport::DisposingModel()
// #110680#
return mxServiceFactory;
}
+
+uno::Reference< uno::XComponentContext >
+SvXMLImport::GetComponentContext() const
+{
+ return mpImpl->mxComponentContext;
+}
+
String SvXMLImport::GetBaseURL() const
{
return mpImpl->aBaseURL.GetMainURL( INetURLObject::NO_DECODE );
@@ -1763,9 +1794,9 @@ String SvXMLImport::GetDocumentBase() const
return mpImpl->aDocBase.GetMainURL( INetURLObject::NO_DECODE );
}
-::rtl::OUString SvXMLImport::GetStreamPath() const
+::rtl::OUString SvXMLImport::GetStreamName() const
{
- return mpImpl->mStreamPath;
+ return mpImpl->mStreamName;
}
// --> OD 2004-08-10 #i28749#
@@ -1854,13 +1885,12 @@ void SvXMLImport::SetXmlId(uno::Reference<uno::XInterface> const & i_xIfc,
//FIXME: not yet
// OSL_ENSURE(xMeta.is(), "xml:id: not XMetadatable");
if (xMeta.is()) {
- ::rtl::OUStringBuffer XmlId( GetStreamPath() );
- XmlId.appendAscii("#");
- XmlId.append(i_rXmlId);
+ const beans::StringPair mdref( GetStreamName(), i_rXmlId );
try {
- xMeta->setXmlId(XmlId.makeStringAndClear());
+ xMeta->setMetadataReference(mdref);
} catch (lang::IllegalArgumentException &) {
// probably duplicate; ignore
+ OSL_TRACE("SvXMLImport::SetXmlId: cannot set xml:id");
}
}
} catch (uno::Exception &) {
@@ -1868,3 +1898,20 @@ void SvXMLImport::SetXmlId(uno::Reference<uno::XInterface> const & i_xIfc,
}
}
+void
+SvXMLImport::AddRDFa(uno::Reference<rdf::XMetadatable> i_xObject,
+ ::rtl::OUString const & i_rAbout,
+ ::rtl::OUString const & i_rProperty,
+ ::rtl::OUString const & i_rContent,
+ ::rtl::OUString const & i_rDatatype)
+{
+ // N.B.: we only get called if i_xObject had xhtml:about attribute
+ // (an empty attribute value is valid)
+ if (!mpImpl->mpRDFaHelper.get())
+ {
+ mpImpl->mpRDFaHelper.reset( new ::xmloff::RDFaImportHelper(*this) );
+ }
+ mpImpl->mpRDFaHelper->AddRDFa(i_xObject,
+ i_rAbout, i_rProperty, i_rContent, i_rDatatype);
+}
+
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index fdb378fb83..70319b4864 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -146,9 +146,11 @@ namespace xmloff { namespace token {
TOKEN( "of", XML_NP_OF ),
TOKEN( "urn:oasis:names:tc:opendocument:xmlns:of:1.2", XML_N_OF ),
- // ODF 1.2 metadata: RDFa
- TOKEN( "rdfa", XML_NP_RDFA ),
- TOKEN( "http://docs.oasis-open.org/opendocument/meta/rdfa#", XML_N_RDFA ),
+ // ODF 1.2 metadata: RDFa and GRDDL
+ TOKEN( "xhtml", XML_NP_XHTML ),
+ TOKEN( "http://www.w3.org/1999/xhtml", XML_N_XHTML ),
+ TOKEN( "grddl", XML_NP_GRDDL ),
+ TOKEN( "http://www.w3.org/2003/g/data-view#", XML_N_GRDDL ),
// units
TOKEN( "mm", XML_UNIT_MM ),
@@ -3043,6 +3045,7 @@ namespace xmloff { namespace token {
TOKEN( "meta-field", XML_META_FIELD ),
TOKEN( "about", XML_ABOUT ),
TOKEN( "datatype", XML_DATATYPE ),
+ TOKEN( "transformation", XML_TRANSFORMATION ),
// ODF 1.2 numbered-paragraph
TOKEN( "list-id", XML_LIST_ID ),
@@ -3073,12 +3076,20 @@ namespace xmloff { namespace token {
TOKEN( "at-labels", XML_AT_LABELS ),
TOKEN( "at-axis", XML_AT_AXIS ),
TOKEN( "at-labels-and-axis", XML_AT_LABELS_AND_AXIS ),
+ TOKEN( "filled-radar", XML_FILLED_RADAR ),
TOKEN( "mathvariant", XML_MATHVARIANT ),
TOKEN( "mathsize", XML_MATHSIZE ),
TOKEN( "mathweight", XML_MATHWEIGHT ),
TOKEN( "mathcolor", XML_MATHCOLOR ),
+ TOKEN( "contains", XML_CONTAINS ),
+ TOKEN( "does-not-contain", XML_DOES_NOT_CONTAIN ),
+ TOKEN( "begins-with", XML_BEGINS_WITH ),
+ TOKEN( "does-not-begin-with", XML_DOES_NOT_BEGIN_WITH ),
+ TOKEN( "ends-with", XML_ENDS_WITH ),
+ TOKEN( "does-not-end-with", XML_DOES_NOT_END_WITH ),
+
#if OSL_DEBUG_LEVEL > 0
{ 0, NULL, NULL, XML_TOKEN_END }
#else
diff --git a/xmloff/source/draw/sdpropls.cxx b/xmloff/source/draw/sdpropls.cxx
index 42d3ab356b..fb440dc11e 100644
--- a/xmloff/source/draw/sdpropls.cxx
+++ b/xmloff/source/draw/sdpropls.cxx
@@ -268,7 +268,7 @@ const XMLPropertyMapEntry aXMLSDProperties[] =
GMAP( "ControlDataStyle", XML_NAMESPACE_STYLE,XML_DATA_STYLE_NAME, XML_TYPE_STRING|MID_FLAG_NO_PROPERTY_EXPORT|MID_FLAG_SPECIAL_ITEM, CTF_SD_CONTROL_SHAPE_DATA_STYLE ),
GMAP( "ControlTextEmphasis", XML_NAMESPACE_STYLE,XML_TEXT_EMPHASIZE, XML_TYPE_CONTROL_TEXT_EMPHASIZE, 0 ),
GMAP( "ImageScaleMode", XML_NAMESPACE_STYLE,XML_REPEAT, XML_SD_TYPE_IMAGE_SCALE_MODE|MID_FLAG_MULTI_PROPERTY, 0 ),
- GMAP( "ControlWritingMode", XML_NAMESPACE_STYLE,XML_WRITING_MODE, XML_TYPE_TEXT_WRITING_MODE_WITH_DEFAULT|MID_FLAG_MULTI_PROPERTY, 0 ),
+ GMAP( "ControlWritingMode", XML_NAMESPACE_STYLE,XML_WRITING_MODE, XML_TYPE_TEXT_WRITING_MODE_WITH_DEFAULT|MID_FLAG_MULTI_PROPERTY, CTF_CONTROLWRITINGMODE ),
// special entries for floating frames
GMAP( "FrameIsAutoScroll", XML_NAMESPACE_DRAW, XML_FRAME_DISPLAY_SCROLLBAR, XML_TYPE_BOOL|MID_FLAG_MULTI_PROPERTY, CTF_FRAME_DISPLAY_SCROLLBAR ),
@@ -1230,6 +1230,10 @@ void XMLShapeExportPropertyMapper::ContextFilter(
XMLPropertyState* pClip11State = NULL;
XMLPropertyState* pClipState = NULL;
+ XMLPropertyState* pShapeWritingMode = NULL;
+ XMLPropertyState* pTextWritingMode = NULL;
+ XMLPropertyState* pControlWritingMode = NULL;
+
// filter properties
for( std::vector< XMLPropertyState >::iterator aIter = rProperties.begin();
aIter != rProperties.end();
@@ -1261,14 +1265,24 @@ void XMLShapeExportPropertyMapper::ContextFilter(
break;
case CTF_WRITINGMODE:
{
+ pShapeWritingMode = property;
text::WritingMode eWritingMode;
if( property->maValue >>= eWritingMode )
{
if( text::WritingMode_LR_TB == eWritingMode )
+ {
property->mnIndex = -1;
+ pShapeWritingMode = 0;
+ }
}
}
break;
+ case CTF_CONTROLWRITINGMODE:
+ pControlWritingMode = property;
+ break;
+ case CTF_TEXTWRITINGMODE:
+ pTextWritingMode = property;
+ break;
case CTF_REPEAT_OFFSET_X:
pRepeatOffsetX = property;
break;
@@ -1353,6 +1367,19 @@ void XMLShapeExportPropertyMapper::ContextFilter(
}
}
+ // check for duplicate writing mode
+ if( pShapeWritingMode && (pTextWritingMode || pControlWritingMode) )
+ {
+ if( pTextWritingMode )
+ pTextWritingMode->mnIndex = -1;
+ if( pControlWritingMode )
+ pControlWritingMode->mnIndex = -1;
+ }
+ else if( pTextWritingMode && pControlWritingMode )
+ {
+ pControlWritingMode->mnIndex = -1;
+ }
+
// do not export visual area for internal ole objects
if( pOLEIsInternal )
{
diff --git a/xmloff/source/draw/sdpropls.hxx b/xmloff/source/draw/sdpropls.hxx
index 9664f4b6a6..569340c8c3 100644
--- a/xmloff/source/draw/sdpropls.hxx
+++ b/xmloff/source/draw/sdpropls.hxx
@@ -142,7 +142,7 @@ extern const XMLPropertyMapEntry aXMLSDPresPageProps_onlyHeadersFooter[];
//////////////////////////////////////////////////////////////////////////////
#define CTF_NUMBERINGRULES 1000
-//#define CTF_NUMBERINGRULES_NAME 1001
+#define CTF_CONTROLWRITINGMODE 1001
#define CTF_WRITINGMODE 1002
#define CTF_REPEAT_OFFSET_X 1003
#define CTF_REPEAT_OFFSET_Y 1004
diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx
index 61ea32c9cf..7415fed326 100644
--- a/xmloff/source/draw/shapeexport.cxx
+++ b/xmloff/source/draw/shapeexport.cxx
@@ -1213,7 +1213,8 @@ const rtl::Reference< XMLTableExport >& XMLShapeExport::GetShapeTableExport()
if( !mxShapeTableExport.is() )
{
rtl::Reference< XMLPropertyHandlerFactory > xFactory( new XMLSdPropHdlFactory( mrExport.GetModel(), mrExport ) );
- rtl::Reference< XMLPropertySetMapper > xPropertySetMapper( new XMLShapePropertySetMapper( xFactory.get() ) );
+ UniReference < XMLPropertySetMapper > xMapper( new XMLShapePropertySetMapper( xFactory.get() ) );
+ rtl::Reference< SvXMLExportPropertyMapper > xPropertySetMapper( new XMLShapeExportPropertyMapper( xMapper, (XMLTextListAutoStylePool*)&mrExport.GetTextParagraphExport()->GetListAutoStylePool(), mrExport ) );
mxShapeTableExport = new XMLTableExport( mrExport, xPropertySetMapper, xFactory );
}
diff --git a/xmloff/source/draw/shapeexport2.cxx b/xmloff/source/draw/shapeexport2.cxx
index 39927fbc59..af04a6e533 100644
--- a/xmloff/source/draw/shapeexport2.cxx
+++ b/xmloff/source/draw/shapeexport2.cxx
@@ -49,6 +49,7 @@
#endif
#include "sdpropls.hxx"
#include <tools/debug.hxx>
+#include <tools/urlobj.hxx>
#include <rtl/ustrbuf.hxx>
#include <xmloff/xmlexp.hxx>
#include <xmloff/xmluconv.hxx>
@@ -1166,8 +1167,30 @@ void XMLShapeExport::ImpExportGraphicObjectShape(
OUString aStreamURL;
OUString aStr;
+ xPropSet->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("GraphicStreamURL"))) >>= aStreamURL;
xPropSet->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("GraphicURL"))) >>= sImageURL;
- aStr = mrExport.AddEmbeddedGraphicObject( sImageURL );
+
+ OUString aResolveURL( sImageURL );
+ const rtl::OUString sPackageURL( RTL_CONSTASCII_USTRINGPARAM("vnd.sun.star.Package:") );
+
+ // sj: trying to preserve the filename
+ if ( aStreamURL.match( sPackageURL, 0 ) )
+ {
+ rtl::OUString sRequestedName( aStreamURL.copy( sPackageURL.getLength(), aStreamURL.getLength() - sPackageURL.getLength() ) );
+ sal_Int32 nLastIndex = sRequestedName.lastIndexOf( '/' ) + 1;
+ if ( ( nLastIndex > 0 ) && ( nLastIndex < sRequestedName.getLength() ) )
+ sRequestedName = sRequestedName.copy( nLastIndex, sRequestedName.getLength() - nLastIndex );
+ nLastIndex = sRequestedName.lastIndexOf( '.' );
+ if ( nLastIndex >= 0 )
+ sRequestedName = sRequestedName.copy( 0, nLastIndex );
+ if ( sRequestedName.getLength() )
+ {
+ aResolveURL = aResolveURL.concat( OUString(RTL_CONSTASCII_USTRINGPARAM("?requestedName=")));
+ aResolveURL = aResolveURL.concat( sRequestedName );
+ }
+ }
+
+ aStr = mrExport.AddEmbeddedGraphicObject( aResolveURL );
mrExport.AddAttribute(XML_NAMESPACE_XLINK, XML_HREF, aStr );
if( aStr.getLength() )
diff --git a/xmloff/source/draw/shapeexport4.cxx b/xmloff/source/draw/shapeexport4.cxx
index d3025e031b..a8587489d5 100644
--- a/xmloff/source/draw/shapeexport4.cxx
+++ b/xmloff/source/draw/shapeexport4.cxx
@@ -1130,21 +1130,21 @@ void XMLShapeExport::ImpExportTableShape( const uno::Reference< drawing::XShape
{
mrExport.AddAttribute(XML_NAMESPACE_TABLE, XML_TEMPLATE_NAME, sTemplate );
- const XMLPropertyMapEntry* pEntry = &aXMLTableShapeAttributes[0];
-
- while( pEntry->msApiName ) try
+ for( const XMLPropertyMapEntry* pEntry = &aXMLTableShapeAttributes[0]; pEntry->msApiName; pEntry++ )
{
- sal_Bool bBool = sal_False;
- const OUString sAPIPropertyName( OUString(pEntry->msApiName, pEntry->nApiNameLength, RTL_TEXTENCODING_ASCII_US ) );
+ try
+ {
+ sal_Bool bBool = sal_False;
+ const OUString sAPIPropertyName( OUString(pEntry->msApiName, pEntry->nApiNameLength, RTL_TEXTENCODING_ASCII_US ) );
- xPropSet->getPropertyValue( sAPIPropertyName ) >>= bBool;
- if( bBool )
- mrExport.AddAttribute(pEntry->mnNameSpace, pEntry->meXMLName, XML_TRUE );
- pEntry++;
- }
- catch( uno::Exception& )
- {
- DBG_ERROR("XMLShapeExport::ImpExportTableShape(), exception caught!");
+ xPropSet->getPropertyValue( sAPIPropertyName ) >>= bBool;
+ if( bBool )
+ mrExport.AddAttribute(pEntry->mnNameSpace, pEntry->meXMLName, XML_TRUE );
+ }
+ catch( uno::Exception& )
+ {
+ DBG_ERROR("XMLShapeExport::ImpExportTableShape(), exception caught!");
+ }
}
}
}
diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx
index f826488864..6b6aedbfa9 100644
--- a/xmloff/source/draw/ximpshap.cxx
+++ b/xmloff/source/draw/ximpshap.cxx
@@ -3584,17 +3584,18 @@ void SdXMLTableShapeContext::StartElement( const ::com::sun::star::uno::Referenc
}
const XMLPropertyMapEntry* pEntry = &aXMLTableShapeAttributes[0];
- int i = 0;
- while( pEntry->msApiName && (i < 6) ) try
+ for( int i = 0; pEntry->msApiName && (i < 6); i++, pEntry++ )
{
- const OUString sAPIPropertyName( OUString(pEntry->msApiName, pEntry->nApiNameLength, RTL_TEXTENCODING_ASCII_US ) );
- xProps->setPropertyValue( sAPIPropertyName, Any( maTemplateStylesUsed[i++] ) );
- pEntry++;
+ try
+ {
+ const OUString sAPIPropertyName( OUString(pEntry->msApiName, pEntry->nApiNameLength, RTL_TEXTENCODING_ASCII_US ) );
+ xProps->setPropertyValue( sAPIPropertyName, Any( maTemplateStylesUsed[i] ) );
+ }
+ catch( Exception& )
+ {
+ DBG_ERROR("SdXMLTableShapeContext::StartElement(), exception caught!");
+ }
}
- catch( Exception& )
- {
- DBG_ERROR("SdXMLTableShapeContext::StartElement(), exception caught!");
- }
}
GetImport().GetShapeImport()->finishShape( mxShape, mxAttrList, mxShapes );
diff --git a/xmloff/source/forms/elementexport.cxx b/xmloff/source/forms/elementexport.cxx
index d695be34cc..8b6abaf992 100644
--- a/xmloff/source/forms/elementexport.cxx
+++ b/xmloff/source/forms/elementexport.cxx
@@ -529,15 +529,15 @@ namespace xmloff
{
static sal_Int32 nBooleanPropertyAttributeIds[] =
{ // attribute flags
- CCA_CURRENT_SELECTED, CCA_DISABLED, CCA_DROPDOWN, CCA_PRINTABLE, CCA_READONLY, CCA_SELECTED, CCA_TAB_STOP
+ CCA_CURRENT_SELECTED, CCA_DISABLED, CCA_DROPDOWN, CCA_PRINTABLE, CCA_READONLY, CCA_SELECTED, CCA_TAB_STOP, CCA_ENABLEVISIBLE
};
static const ::rtl::OUString* pBooleanPropertyNames[] =
{ // property names
- &PROPERTY_STATE, &PROPERTY_ENABLED, &PROPERTY_DROPDOWN, &PROPERTY_PRINTABLE, &PROPERTY_READONLY, &PROPERTY_DEFAULT_STATE, &PROPERTY_TABSTOP
+ &PROPERTY_STATE, &PROPERTY_ENABLED, &PROPERTY_DROPDOWN, &PROPERTY_PRINTABLE, &PROPERTY_READONLY, &PROPERTY_DEFAULT_STATE, &PROPERTY_TABSTOP, &PROPERTY_ENABLEVISIBLE
};
static sal_Bool nBooleanPropertyAttrFlags[] =
{ // attribute defaults
- BOOLATTR_DEFAULT_FALSE, BOOLATTR_DEFAULT_FALSE | BOOLATTR_INVERSE_SEMANTICS, BOOLATTR_DEFAULT_FALSE, BOOLATTR_DEFAULT_TRUE, BOOLATTR_DEFAULT_FALSE, BOOLATTR_DEFAULT_FALSE, BOOLATTR_DEFAULT_VOID
+ BOOLATTR_DEFAULT_FALSE, BOOLATTR_DEFAULT_FALSE | BOOLATTR_INVERSE_SEMANTICS, BOOLATTR_DEFAULT_FALSE, BOOLATTR_DEFAULT_TRUE, BOOLATTR_DEFAULT_FALSE, BOOLATTR_DEFAULT_FALSE, BOOLATTR_DEFAULT_VOID, BOOLATTR_DEFAULT_FALSE
};
#if OSL_DEBUG_LEVEL > 0
sal_Int32 nIdCount = sizeof(nBooleanPropertyAttributeIds) / sizeof(nBooleanPropertyAttributeIds[0]);
diff --git a/xmloff/source/forms/formattributes.cxx b/xmloff/source/forms/formattributes.cxx
index a082c0a897..75a44b1ffe 100644
--- a/xmloff/source/forms/formattributes.cxx
+++ b/xmloff/source/forms/formattributes.cxx
@@ -60,6 +60,7 @@ namespace xmloff
case CCA_CURRENT_SELECTED: return "current-selected";
case CCA_CURRENT_VALUE: return "current-value";
case CCA_DISABLED: return "disabled";
+ case CCA_ENABLEVISIBLE: return "visible";
case CCA_DROPDOWN: return "dropdown";
case CCA_FOR: return "for";
case CCA_IMAGE_DATA: return "image-data";
diff --git a/xmloff/source/forms/formattributes.hxx b/xmloff/source/forms/formattributes.hxx
index 69eff4c95e..fcadbecd3c 100644
--- a/xmloff/source/forms/formattributes.hxx
+++ b/xmloff/source/forms/formattributes.hxx
@@ -69,6 +69,7 @@ namespace xmloff
#define CCA_VALUE 0x00200000
#define CCA_ORIENTATION 0x00400000
#define CCA_VISUAL_EFFECT 0x00800000
+ #define CCA_ENABLEVISIBLE 0x01000000
// flags for database control atttributes
#define DA_BOUND_COLUMN 0x00000001
diff --git a/xmloff/source/forms/strings.hxx b/xmloff/source/forms/strings.hxx
index 4db1c3a066..57bf81f620 100644
--- a/xmloff/source/forms/strings.hxx
+++ b/xmloff/source/forms/strings.hxx
@@ -115,6 +115,7 @@ namespace xmloff
XMLFORM_CONSTASCII_STRING( PROPERTY_TABSTOP, "Tabstop" );
XMLFORM_CONSTASCII_STRING( PROPERTY_STATE, "State" );
XMLFORM_CONSTASCII_STRING( PROPERTY_ENABLED, "Enabled" );
+ XMLFORM_CONSTASCII_STRING( PROPERTY_ENABLEVISIBLE, "EnableVisible" );
XMLFORM_CONSTASCII_STRING( PROPERTY_MAXTEXTLENGTH, "MaxTextLen" );
XMLFORM_CONSTASCII_STRING( PROPERTY_LINECOUNT, "LineCount" );
XMLFORM_CONSTASCII_STRING( PROPERTY_TABINDEX, "TabIndex" );
diff --git a/xmloff/source/meta/xmlmetai.cxx b/xmloff/source/meta/xmlmetai.cxx
index faef92dd6a..26a96378a1 100644
--- a/xmloff/source/meta/xmlmetai.cxx
+++ b/xmloff/source/meta/xmlmetai.cxx
@@ -209,7 +209,13 @@ void SvXMLMetaDocumentContext::initDocumentProperties()
}
}
-void SvXMLMetaDocumentContext::setBuildId(::rtl::OUString const& i_rBuildId)
+void SvXMLMetaDocumentContext::setBuildId(const ::rtl::OUString & i_rBuildId)
+{
+ SvXMLMetaDocumentContext::setBuildId( i_rBuildId, GetImport().getImportInfo() );
+}
+
+//static
+void SvXMLMetaDocumentContext::setBuildId(::rtl::OUString const& i_rBuildId, const uno::Reference<beans::XPropertySet>& xImportInfo )
{
OUString sBuildId;
// skip to second product
@@ -258,14 +264,13 @@ void SvXMLMetaDocumentContext::setBuildId(::rtl::OUString const& i_rBuildId)
if ( sBuildId.getLength() ) try
{
- uno::Reference<beans::XPropertySet> xSet(GetImport().getImportInfo());
- if( xSet.is() )
+ if( xImportInfo.is() )
{
const OUString aPropName(RTL_CONSTASCII_USTRINGPARAM("BuildId"));
uno::Reference< beans::XPropertySetInfo > xSetInfo(
- xSet->getPropertySetInfo());
+ xImportInfo->getPropertySetInfo());
if( xSetInfo.is() && xSetInfo->hasPropertyByName( aPropName ) )
- xSet->setPropertyValue( aPropName, uno::makeAny( sBuildId ) );
+ xImportInfo->setPropertyValue( aPropName, uno::makeAny( sBuildId ) );
}
}
catch( uno::Exception& )
diff --git a/xmloff/source/table/XMLTableExport.cxx b/xmloff/source/table/XMLTableExport.cxx
index e7d0915b72..7c8d3c5c2a 100644
--- a/xmloff/source/table/XMLTableExport.cxx
+++ b/xmloff/source/table/XMLTableExport.cxx
@@ -150,7 +150,7 @@ sal_Int32 StringStatisticHelper::getModeString( OUString& rStyleName )
// class XMLTableExport
// --------------------------------------------------------------------
-XMLTableExport::XMLTableExport(SvXMLExport& rExp, const rtl::Reference< XMLPropertySetMapper >& xCellPropertySetMapper, const rtl::Reference< XMLPropertyHandlerFactory >& xFactoryRef )
+XMLTableExport::XMLTableExport(SvXMLExport& rExp, const rtl::Reference< SvXMLExportPropertyMapper >& xExportPropertyMapper, const rtl::Reference< XMLPropertyHandlerFactory >& xFactoryRef )
: mrExport( rExp )
, mbExportTables( false )
{
@@ -174,7 +174,7 @@ XMLTableExport::XMLTableExport(SvXMLExport& rExp, const rtl::Reference< XMLPrope
(void)e;
}
- mxCellExportPropertySetMapper = new SvXMLExportPropertyMapper( xCellPropertySetMapper.get() );
+ mxCellExportPropertySetMapper = xExportPropertyMapper;
mxCellExportPropertySetMapper->ChainExportMapper(XMLTextParagraphExport::CreateParaExtPropMapper(rExp));
mxRowExportPropertySetMapper = new SvXMLExportPropertyMapper( new XMLPropertySetMapper( getRowPropertiesMap(), xFactoryRef.get() ) );
diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx
index c3aaba7e12..14776996b7 100644
--- a/xmloff/source/text/XMLTextFrameContext.cxx
+++ b/xmloff/source/text/XMLTextFrameContext.cxx
@@ -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
@@ -124,44 +124,45 @@ inline XMLTextFrameContextHyperlink_Impl::XMLTextFrameContextHyperlink_Impl(
{
}
-class XMLTextFrameDescContext_Impl : public SvXMLImportContext
+// --> OD 2009-07-22 #i73249#
+class XMLTextFrameTitleOrDescContext_Impl : public SvXMLImportContext
{
- OUString& rDesc;
+ OUString& mrTitleOrDesc;
public:
TYPEINFO();
- XMLTextFrameDescContext_Impl( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const ::rtl::OUString& rLName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList > & xAttrList,
- OUString& rD );
- virtual ~XMLTextFrameDescContext_Impl();
+ XMLTextFrameTitleOrDescContext_Impl( SvXMLImport& rImport,
+ sal_uInt16 nPrfx,
+ const ::rtl::OUString& rLName,
+ OUString& rTitleOrDesc );
+ virtual ~XMLTextFrameTitleOrDescContext_Impl();
virtual void Characters( const OUString& rText );
};
-TYPEINIT1( XMLTextFrameDescContext_Impl, SvXMLImportContext );
+TYPEINIT1( XMLTextFrameTitleOrDescContext_Impl, SvXMLImportContext );
-XMLTextFrameDescContext_Impl::XMLTextFrameDescContext_Impl(
+XMLTextFrameTitleOrDescContext_Impl::XMLTextFrameTitleOrDescContext_Impl(
SvXMLImport& rImport,
- sal_uInt16 nPrfx, const OUString& rLName,
- const Reference< XAttributeList > &,
- OUString& rD ) :
- SvXMLImportContext( rImport, nPrfx, rLName ),
- rDesc( rD )
+ sal_uInt16 nPrfx,
+ const OUString& rLName,
+ OUString& rTitleOrDesc )
+ : SvXMLImportContext( rImport, nPrfx, rLName )
+ , mrTitleOrDesc( rTitleOrDesc )
{
}
-XMLTextFrameDescContext_Impl::~XMLTextFrameDescContext_Impl()
+XMLTextFrameTitleOrDescContext_Impl::~XMLTextFrameTitleOrDescContext_Impl()
{
}
-void XMLTextFrameDescContext_Impl::Characters( const OUString& rText )
+void XMLTextFrameTitleOrDescContext_Impl::Characters( const OUString& rText )
{
- rDesc += rText;
+ mrTitleOrDesc += rText;
}
+// <--
// ------------------------------------------------------------------------
@@ -385,7 +386,11 @@ class XMLTextFrameContext_Impl : public SvXMLImportContext
const ::rtl::OUString sAnchorPageNo;
const ::rtl::OUString sGraphicURL;
const ::rtl::OUString sGraphicFilter;
- const ::rtl::OUString sAlternativeText;
+ // --> OD 2009-07-22 #i73249#
+// const ::rtl::OUString sAlternativeText;
+ const ::rtl::OUString sTitle;
+ const ::rtl::OUString sDescription;
+ // <--
const ::rtl::OUString sFrameStyleName;
const ::rtl::OUString sGraphicRotation;
const ::rtl::OUString sTextBoxServiceName;
@@ -461,6 +466,9 @@ public:
const ::rtl::OUString& rName,
const ::rtl::OUString& rTargetFrameName,
sal_Bool bMap );
+ // --> OD 2009-07-22 #i73249#
+ void SetTitle( const ::rtl::OUString& rTitle );
+ // <--
void SetDesc( const ::rtl::OUString& rDesc );
::com::sun::star::text::TextContentAnchorType GetAnchorType() const { return eAnchorType; }
@@ -829,7 +837,11 @@ XMLTextFrameContext_Impl::XMLTextFrameContext_Impl(
, sAnchorPageNo(RTL_CONSTASCII_USTRINGPARAM("AnchorPageNo"))
, sGraphicURL(RTL_CONSTASCII_USTRINGPARAM("GraphicURL"))
, sGraphicFilter(RTL_CONSTASCII_USTRINGPARAM("GraphicFilter"))
-, sAlternativeText(RTL_CONSTASCII_USTRINGPARAM("AlternativeText"))
+// --> OD 2009-07-22 #i73249#
+//, sAlternativeText(RTL_CONSTASCII_USTRINGPARAM("AlternativeText"))
+, sTitle(RTL_CONSTASCII_USTRINGPARAM("Title"))
+, sDescription(RTL_CONSTASCII_USTRINGPARAM("Description"))
+// <--
, sFrameStyleName(RTL_CONSTASCII_USTRINGPARAM("FrameStyleName"))
, sGraphicRotation(RTL_CONSTASCII_USTRINGPARAM("GraphicRotation"))
, sTextBoxServiceName(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextFrame"))
@@ -1135,12 +1147,15 @@ SvXMLImportContext *XMLTextFrameContext_Impl::CreateChildContext(
}
}
}
+ // --> OD 2009-08-17 #i100480#
+ // correction of condition which also avoids warnings.
if( !pContext &&
- ( XML_TEXT_FRAME_OBJECT == nType &&
- (XML_NAMESPACE_OFFICE == nPrefix &&
- IsXMLToken( rLocalName, XML_DOCUMENT )) ||
- (XML_NAMESPACE_MATH == nPrefix &&
- IsXMLToken(rLocalName, XML_MATH) ) ) )
+ ( XML_TEXT_FRAME_OBJECT == nType &&
+ ( ( XML_NAMESPACE_OFFICE == nPrefix &&
+ IsXMLToken( rLocalName, XML_DOCUMENT ) ) ||
+ ( XML_NAMESPACE_MATH == nPrefix &&
+ IsXMLToken( rLocalName, XML_MATH ) ) ) ) )
+ // <--
{
if( !xPropSet.is() && !bCreateFailed )
{
@@ -1262,18 +1277,31 @@ void XMLTextFrameContext_Impl::SetHyperlink( const OUString& rHRef,
}
}
+// --> OD 2009-07-22 #i73249#
+void XMLTextFrameContext_Impl::SetTitle( const OUString& rTitle )
+{
+ if ( xPropSet.is() )
+ {
+ Reference< XPropertySetInfo > xPropSetInfo = xPropSet->getPropertySetInfo();
+ if( xPropSetInfo->hasPropertyByName( sTitle ) )
+ {
+ xPropSet->setPropertyValue( sTitle, makeAny( rTitle ) );
+ }
+ }
+}
+
void XMLTextFrameContext_Impl::SetDesc( const OUString& rDesc )
{
if ( xPropSet.is() )
{
- Reference< XPropertySetInfo > xPropSetInfo =
- xPropSet->getPropertySetInfo();
- if( xPropSetInfo->hasPropertyByName( sAlternativeText ) )
+ Reference< XPropertySetInfo > xPropSetInfo = xPropSet->getPropertySetInfo();
+ if( xPropSetInfo->hasPropertyByName( sDescription ) )
{
- xPropSet->setPropertyValue( sAlternativeText, makeAny( rDesc ) );
+ xPropSet->setPropertyValue( sDescription, makeAny( rDesc ) );
}
}
}
+// <--
//-----------------------------------------------------------------------------------------------------
@@ -1312,6 +1340,10 @@ XMLTextFrameContext::XMLTextFrameContext(
: SvXMLImportContext( rImport, nPrfx, rLName )
, m_xAttrList( new SvXMLAttributeList( xAttrList ) )
, m_pHyperlink( 0 )
+// --> OD 2009-07-22 #i73249#
+, m_sTitle()
+, m_sDesc()
+// <--
, m_eDefaultAnchorType( eATyp )
// --> OD 2006-03-10 #i51726#
, m_HasAutomaticStyleWithoutParentStyle( sal_False )
@@ -1374,9 +1406,20 @@ void XMLTextFrameContext::EndElement()
{
pImpl->CreateIfNotThere();
- // alternative text
+ // --> OD 2009-07-22 #i73249#
+// // alternative text
+// if( m_sDesc.getLength() )
+// pImpl->SetDesc( m_sDesc );
+ // svg:title
+ if( m_sTitle.getLength() )
+ {
+ pImpl->SetTitle( m_sTitle );
+ }
if( m_sDesc.getLength() )
+ {
pImpl->SetDesc( m_sDesc );
+ }
+ // <--
if( m_pHyperlink )
{
@@ -1484,7 +1527,7 @@ SvXMLImportContext *XMLTextFrameContext::CreateChildContext(
Reference < XPropertySet > xPropSet;
if( CreateIfNotThere( xPropSet ) )
{
- pContext = new XMLReplacementImageContext( GetImport(),
+ pContext = new XMLReplacementImageContext( GetImport(),
p_nPrefix, rLocalName, xAttrList, xPropSet );
m_xReplImplContext = pContext;
}
@@ -1494,10 +1537,40 @@ SvXMLImportContext *XMLTextFrameContext::CreateChildContext(
// the child is a writer frame
if( XML_NAMESPACE_SVG == p_nPrefix )
{
- bool bOld = SvXMLImport::OOo_2x >= GetImport().getGeneratorVersion();
- if( IsXMLToken( rLocalName, bOld ? XML_DESC : XML_TITLE ) )
- pContext = new XMLTextFrameDescContext_Impl( GetImport(), p_nPrefix, rLocalName,
- xAttrList, m_sDesc );
+ // --> OD 2009-07-22 #i73249#
+// bool bOld = SvXMLImport::OOo_2x >= GetImport().getGeneratorVersion();
+// if( IsXMLToken( rLocalName, bOld ? XML_DESC : XML_TITLE ) )
+// pContext = new XMLTextFrameDescContext_Impl( GetImport(), p_nPrefix, rLocalName,
+// xAttrList, m_sDesc );
+ const bool bOld = SvXMLImport::OOo_2x >= GetImport().getGeneratorVersion();
+ if ( bOld )
+ {
+ if ( IsXMLToken( rLocalName, XML_DESC ) )
+ {
+ pContext = new XMLTextFrameTitleOrDescContext_Impl( GetImport(),
+ p_nPrefix,
+ rLocalName,
+ m_sTitle );
+ }
+ }
+ else
+ {
+ if( IsXMLToken( rLocalName, XML_TITLE ) )
+ {
+ pContext = new XMLTextFrameTitleOrDescContext_Impl( GetImport(),
+ p_nPrefix,
+ rLocalName,
+ m_sTitle );
+ }
+ else if ( IsXMLToken( rLocalName, XML_DESC ) )
+ {
+ pContext = new XMLTextFrameTitleOrDescContext_Impl( GetImport(),
+ p_nPrefix,
+ rLocalName,
+ m_sDesc );
+ }
+ }
+ // <--
}
else if( XML_NAMESPACE_DRAW == p_nPrefix )
{
diff --git a/xmloff/source/text/XMLTextFrameContext.hxx b/xmloff/source/text/XMLTextFrameContext.hxx
index 39d979a69e..4b3eece040 100644
--- a/xmloff/source/text/XMLTextFrameContext.hxx
+++ b/xmloff/source/text/XMLTextFrameContext.hxx
@@ -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
@@ -53,6 +53,9 @@ class XMLTextFrameContext : public SvXMLImportContext
SvXMLAttributeList *m_pAttrList;
XMLTextFrameContextHyperlink_Impl *m_pHyperlink;
+ // --> OD 2009-07-22 #i73249#
+ ::rtl::OUString m_sTitle;
+ // <--
::rtl::OUString m_sDesc;
::com::sun::star::text::TextContentAnchorType m_eDefaultAnchorType;
diff --git a/xmloff/source/text/XMLTextMarkImportContext.cxx b/xmloff/source/text/XMLTextMarkImportContext.cxx
index f9af71e899..75bc4c8c3c 100644
--- a/xmloff/source/text/XMLTextMarkImportContext.cxx
+++ b/xmloff/source/text/XMLTextMarkImportContext.cxx
@@ -308,39 +308,57 @@ Reference<XInterface> XMLTextMarkImportContext::CreateAndInsertMark(
const OUString& i_rXmlId)
{
// create mark
- Reference<XMultiServiceFactory> xFactory(rImport.GetModel(),UNO_QUERY);
- if( xFactory.is() )
+ const Reference<XMultiServiceFactory> xFactory(rImport.GetModel(),
+ UNO_QUERY);
+ Reference<XInterface> xIfc;
+
+ if (xFactory.is())
{
- Reference<XInterface> xIfc = xFactory->createInstance(sServiceName);
+ xIfc = xFactory->createInstance(sServiceName);
- // set name
- Reference<XNamed> xNamed(xIfc, UNO_QUERY);
+ if (!xIfc.is())
+ {
+ OSL_ENSURE(false, "CreateAndInsertMark: cannot create service?");
+ return 0;
+ }
+
+ // set name (unless there is no name (text:meta))
+ const Reference<XNamed> xNamed(xIfc, UNO_QUERY);
if (xNamed.is())
{
xNamed->setName(sMarkName);
+ }
+ else
+ {
+ if (sMarkName.getLength())
+ {
+ OSL_ENSURE(false, "name given, but XNamed not supported?");
+ return 0;
+ }
+ }
- // xml:id for RDF metadata
- rImport.SetXmlId(xIfc, i_rXmlId);
+ // xml:id for RDF metadata
+ rImport.SetXmlId(xIfc, i_rXmlId);
- // cast to XTextContent and attach to document
- Reference<XTextContent> xTextContent(xIfc, UNO_QUERY);
- if (xTextContent.is())
+ // cast to XTextContent and attach to document
+ const Reference<XTextContent> xTextContent(xIfc, UNO_QUERY);
+ if (xTextContent.is())
+ {
+ try
{
- try
- {
// if inserting marks, bAbsorb==sal_False will cause
// collapsing of the given XTextRange.
- rImport.GetTextImport()->GetText()->insertTextContent(rRange,
- xTextContent, sal_True);
- }
- catch (com::sun::star::lang::IllegalArgumentException e)
- {
- // ignore
- }
+ rImport.GetTextImport()->GetText()->insertTextContent(rRange,
+ xTextContent, sal_True);
+ }
+ catch (com::sun::star::lang::IllegalArgumentException &)
+ {
+ OSL_ENSURE(false, "CreateAndInsertMark: cannot insert?");
+ return 0;
}
}
- return xIfc;
- } else return NULL;
+ }
+ return xIfc;
}
sal_Bool XMLTextMarkImportContext::FindName(
diff --git a/xmloff/source/text/txtflde.cxx b/xmloff/source/text/txtflde.cxx
index 49b2e74222..18b7325c77 100644
--- a/xmloff/source/text/txtflde.cxx
+++ b/xmloff/source/text/txtflde.cxx
@@ -44,9 +44,6 @@
#include <xmloff/xmlnume.hxx>
#include "numehelp.hxx"
-#ifndef _XMLOFF_PROPMAPPINGTYPES_HXX
-#include <xmloff/maptypes.hxx>
-#endif
#include <xmloff/families.hxx>
#include <xmloff/XMLEventExport.hxx>
#include "XMLTextCharStyleNamesElementExport.hxx"
@@ -65,9 +62,7 @@
#include <com/sun/star/text/XDependentTextField.hpp>
#include <com/sun/star/text/XTextFieldsSupplier.hpp>
-#ifndef _COM_SUN_STAR_TEXT_SETVARIABLETYPE_HPP
#include <com/sun/star/text/SetVariableType.hpp>
-#endif
#include <com/sun/star/text/PlaceholderType.hpp>
#include <com/sun/star/text/FilenameDisplayFormat.hpp>
#include <com/sun/star/text/ChapterFormat.hpp>
@@ -78,6 +73,7 @@
#include <com/sun/star/util/NumberFormat.hpp>
#include <com/sun/star/text/BibliographyDataType.hpp>
#include <com/sun/star/sdb/CommandType.hpp>
+#include <com/sun/star/rdf/XMetadatable.hpp>
#include <rtl/ustrbuf.hxx>
#include <tools/debug.hxx>
#include <rtl/math.hxx>
@@ -152,6 +148,7 @@ static sal_Char __READONLY_DATA FIELD_SERVICE_BIBLIOGRAPHY[] = "Bibliography";
static sal_Char __READONLY_DATA FIELD_SERVICE_SCRIPT[] = "Script";
static sal_Char __READONLY_DATA FIELD_SERVICE_ANNOTATION[] = "Annotation";
static sal_Char __READONLY_DATA FIELD_SERVICE_COMBINED_CHARACTERS[] = "CombinedCharacters";
+static sal_Char __READONLY_DATA FIELD_SERVICE_META[] = "MetaField";
static sal_Char __READONLY_DATA FIELD_SERVICE_MEASURE[] = "Measure";
static sal_Char __READONLY_DATA FIELD_SERVICE_TABLE_FORMULA[] = "TableFormula";
static sal_Char __READONLY_DATA FIELD_SERVICE_DROP_DOWN[] = "DropDown";
@@ -219,6 +216,7 @@ SvXMLEnumStringMapEntry __READONLY_DATA aFieldServiceNameMapping[] =
ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_ANNOTATION, FIELD_ID_ANNOTATION ),
ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_COMBINED_CHARACTERS, FIELD_ID_COMBINED_CHARACTERS ),
+ ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_META, FIELD_ID_META ),
// non-writer fields
ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_SHEET_NAME, FIELD_ID_SHEET_NAME ),
@@ -604,6 +602,7 @@ enum FieldIdEnum XMLTextFieldExport::MapFieldName(
case FIELD_ID_TEMPLATE_NAME:
case FIELD_ID_CHAPTER:
case FIELD_ID_FILE_NAME:
+ case FIELD_ID_META:
case FIELD_ID_SHEET_NAME:
case FIELD_ID_MEASURE:
case FIELD_ID_URL:
@@ -646,6 +645,9 @@ sal_Bool XMLTextFieldExport::IsStringField(
return !bRet;
}
+ case FIELD_ID_META://FIXME ?????? no idea...
+ return 0 > GetIntProperty(sPropertyNumberFormat, xPropSet);
+
case FIELD_ID_DATABASE_DISPLAY:
// TODO: depends on... ???
// workaround #no-bug#: no data type
@@ -738,7 +740,7 @@ sal_Bool XMLTextFieldExport::IsStringField(
/// export the styles needed by the given field. Called on first pass
/// through document
void XMLTextFieldExport::ExportFieldAutoStyle(
- const Reference<XTextField> & rTextField)
+ const Reference<XTextField> & rTextField, sal_Bool bProgress )
{
// get property set
Reference<XPropertySet> xPropSet(rTextField, UNO_QUERY);
@@ -831,6 +833,10 @@ void XMLTextFieldExport::ExportFieldAutoStyle(
}
break;
+ case FIELD_ID_META:
+ // recurse into content (does not export element, so can be done first)
+ ExportMetaField(xPropSet, true, bProgress);
+ // fall-through: for the meta-field itself!
case FIELD_ID_DOCINFO_PRINT_TIME:
case FIELD_ID_DOCINFO_PRINT_DATE:
case FIELD_ID_DOCINFO_CREATION_DATE:
@@ -948,7 +954,8 @@ void XMLTextFieldExport::ExportFieldAutoStyle(
}
/// export the given field to XML. Called on second pass through document
-void XMLTextFieldExport::ExportField(const Reference<XTextField> & rTextField )
+void XMLTextFieldExport::ExportField(
+ const Reference<XTextField> & rTextField, sal_Bool bProgress )
{
// get property set
Reference<XPropertySet> xPropSet(rTextField, UNO_QUERY);
@@ -1026,7 +1033,8 @@ void XMLTextFieldExport::ExportField(const Reference<XTextField> & rTextField )
sal_False, sal_False);
// finally, export the field itself
- ExportFieldHelper( rTextField, xPropSet, xRangePropSet, nToken );
+ ExportFieldHelper( rTextField, xPropSet, xRangePropSet, nToken,
+ bProgress );
}
}
@@ -1035,7 +1043,8 @@ void XMLTextFieldExport::ExportFieldHelper(
const Reference<XTextField> & rTextField,
const Reference<XPropertySet> & rPropSet,
const Reference<XPropertySet> &,
- enum FieldIdEnum nToken)
+ enum FieldIdEnum nToken,
+ sal_Bool bProgress )
{
// get property set info (because some attributes are not support
// in all implementations)
@@ -1738,11 +1747,17 @@ void XMLTextFieldExport::ExportFieldHelper(
{
// The style with the combined characters attribute has
// already been handled in the ExportField method. So all that
- // is left to do now is to exprot the characters.
+ // is left to do now is to export the characters.
GetExport().Characters(sPresentation);
break;
}
+ case FIELD_ID_META:
+ {
+ ExportMetaField(rPropSet, false, bProgress);
+ break;
+ }
+
case FIELD_ID_MEASURE:
{
ProcessString(XML_KIND, MapMeasureKind(GetInt16Property(sPropertyMeasureKind, rPropSet)));
@@ -2248,6 +2263,47 @@ void XMLTextFieldExport::ExportMacro(
GetExport().Characters(rContent);
}
+// FIXME: this is untested
+void XMLTextFieldExport::ExportMetaField(
+ const Reference<XPropertySet> & i_xMeta,
+ bool i_bAutoStyles, sal_Bool i_bProgress )
+{
+ bool doExport(!i_bAutoStyles); // do not export element if autostyles
+ // check version >= 1.2
+ switch (GetExport().getDefaultVersion()) {
+ case SvtSaveOptions::ODFVER_011: // fall thru
+ case SvtSaveOptions::ODFVER_010: doExport = false; break;
+ default: break;
+ }
+
+ const Reference < XEnumerationAccess > xEA( i_xMeta, UNO_QUERY_THROW );
+ const Reference < XEnumeration > xTextEnum( xEA->createEnumeration() );
+
+ if (doExport)
+ {
+ const Reference<rdf::XMetadatable> xMeta( i_xMeta, UNO_QUERY_THROW );
+
+ // style:data-style-name
+ ProcessValueAndType(sal_False,
+ GetIntProperty(sPropertyNumberFormat, i_xMeta),
+ sEmpty, sEmpty, 0.0, sal_False, sal_False, sal_True,
+ sal_False, sal_False /*, sal_False*/ );
+
+ // text:meta-field without xml:id is invalid
+ xMeta->ensureMetadataReference();
+
+ // xml:id for RDF metadata
+ GetExport().AddAttributeXmlId(xMeta);
+ }
+
+ SvXMLElementExport aElem( GetExport(), doExport,
+ XML_NAMESPACE_TEXT, XML_META_FIELD, sal_False, sal_False );
+
+ // recurse to export content
+ GetExport().GetTextParagraphExport()->
+ exportTextRangeEnumeration( xTextEnum, i_bAutoStyles, i_bProgress );
+}
+
/// export all data-style related attributes
void XMLTextFieldExport::ProcessValueAndType(
sal_Bool bIsString, /// do we process a string or a number?
diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx
index 533e93bb53..0f5f3384e9 100644
--- a/xmloff/source/text/txtimp.cxx
+++ b/xmloff/source/text/txtimp.cxx
@@ -327,7 +327,11 @@ static __FAR_DATA SvXMLTokenMapEntry aTextPElemTokenMap[] =
static __FAR_DATA SvXMLTokenMapEntry aTextPAttrTokenMap[] =
{
- { XML_NAMESPACE_XML , XML_ID, XML_TOK_TEXT_P_XMLID },
+ { XML_NAMESPACE_XML , XML_ID, XML_TOK_TEXT_P_XMLID },
+ { XML_NAMESPACE_XHTML, XML_ABOUT, XML_TOK_TEXT_P_ABOUT },
+ { XML_NAMESPACE_XHTML, XML_PROPERTY, XML_TOK_TEXT_P_PROPERTY },
+ { XML_NAMESPACE_XHTML, XML_CONTENT, XML_TOK_TEXT_P_CONTENT },
+ { XML_NAMESPACE_XHTML, XML_DATATYPE, XML_TOK_TEXT_P_DATATYPE },
{ XML_NAMESPACE_TEXT, XML_STYLE_NAME, XML_TOK_TEXT_P_STYLE_NAME },
{ XML_NAMESPACE_TEXT, XML_COND_STYLE_NAME,
XML_TOK_TEXT_P_COND_STYLE_NAME },
@@ -927,6 +931,134 @@ OUString XMLTextImportHelper::ConvertStarFonts( const OUString& rChars,
return bConverted ? sChars.makeStringAndClear() : rChars;
}
+// --> OD 2006-10-12 #i69629#
+// helper method to determine, if a paragraph style has a list style (inclusive
+// an empty one) inherits a list style (inclusive an empty one) from one of its parents
+// --> OD 2007-01-29 #i73973#
+// apply special case, that found list style equals the chapter numbering, also
+// to the found list styles of the parent styles.
+sal_Bool lcl_HasListStyle( OUString sStyleName,
+ const Reference < XNameContainer >& xParaStyles,
+ SvXMLImport& rImport,
+ const OUString& sNumberingStyleName,
+ const OUString& sOutlineStyleName )
+{
+ sal_Bool bRet( sal_False );
+
+ if ( !xParaStyles->hasByName( sStyleName ) )
+ {
+ // error case
+ return sal_True;
+ }
+
+ Reference< XPropertyState > xPropState( xParaStyles->getByName( sStyleName ),
+ UNO_QUERY );
+ if ( !xPropState.is() )
+ {
+ // error case
+ return sal_False;
+ }
+
+ if ( xPropState->getPropertyState( sNumberingStyleName ) == PropertyState_DIRECT_VALUE )
+ {
+ // list style found
+ bRet = sal_True;
+ // special case: the set list style equals the chapter numbering
+ Reference< XPropertySet > xPropSet( xPropState, UNO_QUERY );
+ if ( xPropSet.is() )
+ {
+ OUString sListStyle;
+ xPropSet->getPropertyValue( sNumberingStyleName ) >>= sListStyle;
+ if ( sListStyle.getLength() != 0 &&
+ sListStyle == sOutlineStyleName )
+ {
+ bRet = sal_False;
+ }
+ }
+ }
+ else
+ {
+ // --> OD 2007-12-07 #i77708#
+ sal_Int32 nUPD( 0 );
+ sal_Int32 nBuild( 0 );
+ // --> OD 2008-03-19 #i86058#
+// rImport.getBuildIds( nUPD, nBuild );
+ const bool bBuildIdFound = rImport.getBuildIds( nUPD, nBuild );
+ // <--
+ // <--
+ // search list style at parent
+ Reference<XStyle> xStyle( xPropState, UNO_QUERY );
+ while ( xStyle.is() )
+ {
+ OUString aParentStyle( xStyle->getParentStyle() );
+ if ( aParentStyle.getLength() > 0 )
+ {
+ aParentStyle =
+ rImport.GetStyleDisplayName( XML_STYLE_FAMILY_TEXT_PARAGRAPH,
+ aParentStyle );
+ }
+ if ( aParentStyle.getLength() == 0 ||
+ !xParaStyles->hasByName( aParentStyle ) )
+ {
+ // no list style found
+ break;
+ }
+ else
+ {
+ xPropState = Reference< XPropertyState >(
+ xParaStyles->getByName( aParentStyle ),
+ UNO_QUERY );
+ if ( !xPropState.is() )
+ {
+ // error case
+ return sal_True;
+ }
+ if ( xPropState->getPropertyState( sNumberingStyleName ) == PropertyState_DIRECT_VALUE )
+ {
+ // list style found
+ bRet = sal_True;
+ // --> OD 2007-01-29 #i73973#
+ // special case: the found list style equals the chapter numbering
+ Reference< XPropertySet > xPropSet( xPropState, UNO_QUERY );
+ if ( xPropSet.is() )
+ {
+ OUString sListStyle;
+ xPropSet->getPropertyValue( sNumberingStyleName ) >>= sListStyle;
+ if ( sListStyle.getLength() != 0 &&
+ sListStyle == sOutlineStyleName )
+ {
+ bRet = sal_False;
+ }
+ // --> OD 2007-12-07 #i77708#
+ // special handling for text documents from OOo version prior OOo 2.4
+ // --> OD 2008-03-19 #i86058#
+ // check explicitly on certain versions and on import of
+ // text documents in OpenOffice.org file format
+ else if ( sListStyle.getLength() == 0 &&
+ ( rImport.IsTextDocInOOoFileFormat() ||
+ ( bBuildIdFound &&
+ ( ( nUPD == 641 ) || ( nUPD == 645 ) || // prior OOo 2.0
+ ( nUPD == 680 && nBuild <= 9238 ) ) ) ) ) // OOo 2.0 - OOo 2.3.1
+ {
+ bRet = sal_False;
+ }
+ // <--
+ }
+ // <--
+ break;
+ }
+ else
+ {
+ // search list style at parent
+ xStyle = Reference<XStyle>( xPropState, UNO_QUERY );
+ }
+ }
+ }
+ }
+
+ return bRet;
+}
+// <--
OUString XMLTextImportHelper::SetStyleAndAttrs(
SvXMLImport& rImport,
const Reference < XTextCursor >& rCursor,
@@ -1237,14 +1369,20 @@ OUString XMLTextImportHelper::SetStyleAndAttrs(
// Some minor rework and adjust access to paragraph styles
if ( bPara )
{
+ // --> OD 2009-08-18 #i103817#
+ sal_Int16 nCurrentOutlineLevelInheritedFromParagraphStyle = 0;
+ const bool bHasOutlineLevelProp( xPropSetInfo->hasPropertyByName( sOutlineLevel ) );
+ if ( bHasOutlineLevelProp )
+ {
+ xPropSet->getPropertyValue( sOutlineLevel ) >>= nCurrentOutlineLevelInheritedFromParagraphStyle;
+ }
+ // <--
//if ( bPara && nOutlineLevel != -1 ) //#outline level,removed by zhaojianwei
if ( nOutlineLevel > 0 ) //add by zhaojianwei
{
//#outline level,removed by zhaojianwei
- if ( xPropSetInfo->hasPropertyByName( sOutlineLevel ) )
+ if ( bHasOutlineLevelProp )
{
- sal_Int16 nCurrentOutlineLevelInheritedFromParagraphStyle = 0;
- xPropSet->getPropertyValue( sOutlineLevel ) >>= nCurrentOutlineLevelInheritedFromParagraphStyle;
// In case that the value equals the value of its paragraph style
// attribute outline level, the paragraph attribute value is left unset
if ( nCurrentOutlineLevelInheritedFromParagraphStyle != nOutlineLevel )
@@ -1323,15 +1461,33 @@ OUString XMLTextImportHelper::SetStyleAndAttrs(
{
AddOutlineStyleCandidate( nOutlineLevel, sStyleName );
}
+ // --> OD 2009-08-18 #i103817#
+ // Assure that heading applies the outline style
+ if ( ( !pStyle || !pStyle->IsListStyleSet() ) &&
+ !bOutlineStyleCandidate &&
+ xChapterNumbering.is() )
+ {
+ OUString sEmptyStr;
+ if ( !lcl_HasListStyle( sStyleName,
+ xParaStyles, GetXMLImport(),
+ sNumberingStyleName,
+ sEmptyStr ) )
+ {
+ // heading not in a list --> apply outline style
+ xPropSet->setPropertyValue( sNumberingRules,
+ makeAny(xChapterNumbering) );
+ xPropSet->setPropertyValue( sNumberingLevel,
+ makeAny( static_cast<sal_Int8>(nOutlineLevel - 1) ) );
+ }
+ }
+ // <--
}
// <--
}
//-> #outlinelevel added by zhaojianwei
//handle for text:p,if the paragraphstyle outlinelevel is set to[1~10]
- else if( xPropSetInfo->hasPropertyByName( sOutlineLevel ) )
+ else if( bHasOutlineLevelProp )
{
- sal_Int16 nCurrentOutlineLevelInheritedFromParagraphStyle = 0;
- xPropSet->getPropertyValue( sOutlineLevel ) >>= nCurrentOutlineLevelInheritedFromParagraphStyle;
if ( nCurrentOutlineLevelInheritedFromParagraphStyle != 0 )
{
sal_Int16 nZero = 0;
@@ -1424,132 +1580,6 @@ void XMLTextImportHelper::AddOutlineStyleCandidate( const sal_Int8 nOutlineLevel
// <--
// --> OD 2006-10-12 #i69629#
-// helper method to determine, if a paragraph style has a list style (inclusive
-// an empty one) inherits a list style (inclusive an empty one) from one of its parents
-// --> OD 2007-01-29 #i73973#
-// apply special case, that found list style equals the chapter numbering, also
-// to the found list styles of the parent styles.
-sal_Bool lcl_HasListStyle( OUString sStyleName,
- const Reference < XNameContainer >& xParaStyles,
- SvXMLImport& rImport,
- const OUString& sNumberingStyleName,
- const OUString& sOutlineStyleName )
-{
- sal_Bool bRet( sal_False );
-
- if ( !xParaStyles->hasByName( sStyleName ) )
- {
- // error case
- return sal_True;
- }
-
- Reference< XPropertyState > xPropState( xParaStyles->getByName( sStyleName ),
- UNO_QUERY );
- if ( !xPropState.is() )
- {
- // error case
- return sal_False;
- }
-
- if ( xPropState->getPropertyState( sNumberingStyleName ) == PropertyState_DIRECT_VALUE )
- {
- // list style found
- bRet = sal_True;
- // special case: the set list style equals the chapter numbering
- Reference< XPropertySet > xPropSet( xPropState, UNO_QUERY );
- if ( xPropSet.is() )
- {
- OUString sListStyle;
- xPropSet->getPropertyValue( sNumberingStyleName ) >>= sListStyle;
- if ( sListStyle == sOutlineStyleName )
- {
- bRet = sal_False;
- }
- }
- }
- else
- {
- // --> OD 2007-12-07 #i77708#
- sal_Int32 nUPD( 0 );
- sal_Int32 nBuild( 0 );
- // --> OD 2008-03-19 #i86058#
-// rImport.getBuildIds( nUPD, nBuild );
- const bool bBuildIdFound = rImport.getBuildIds( nUPD, nBuild );
- // <--
- // <--
- // search list style at parent
- Reference<XStyle> xStyle( xPropState, UNO_QUERY );
- while ( xStyle.is() )
- {
- OUString aParentStyle( xStyle->getParentStyle() );
- if ( aParentStyle.getLength() > 0 )
- {
- aParentStyle =
- rImport.GetStyleDisplayName( XML_STYLE_FAMILY_TEXT_PARAGRAPH,
- aParentStyle );
- }
- if ( aParentStyle.getLength() == 0 ||
- !xParaStyles->hasByName( aParentStyle ) )
- {
- // no list style found
- break;
- }
- else
- {
- xPropState = Reference< XPropertyState >(
- xParaStyles->getByName( aParentStyle ),
- UNO_QUERY );
- if ( !xPropState.is() )
- {
- // error case
- return sal_True;
- }
- if ( xPropState->getPropertyState( sNumberingStyleName ) == PropertyState_DIRECT_VALUE )
- {
- // list style found
- bRet = sal_True;
- // --> OD 2007-01-29 #i73973#
- // special case: the found list style equals the chapter numbering
- Reference< XPropertySet > xPropSet( xPropState, UNO_QUERY );
- if ( xPropSet.is() )
- {
- OUString sListStyle;
- xPropSet->getPropertyValue( sNumberingStyleName ) >>= sListStyle;
- if ( sListStyle == sOutlineStyleName )
- {
- bRet = sal_False;
- }
- // --> OD 2007-12-07 #i77708#
- // special handling for text documents from OOo version prior OOo 2.4
- // --> OD 2008-03-19 #i86058#
- // check explicitly on certain versions and on import of
- // text documents in OpenOffice.org file format
- else if ( sListStyle.getLength() == 0 &&
- ( rImport.IsTextDocInOOoFileFormat() ||
- ( bBuildIdFound &&
- ( ( nUPD == 641 ) || ( nUPD == 645 ) || // prior OOo 2.0
- ( nUPD == 680 && nBuild <= 9238 ) ) ) ) ) // OOo 2.0 - OOo 2.3.1
- {
- bRet = sal_False;
- }
- // <--
- }
- // <--
- break;
- }
- else
- {
- // search list style at parent
- xStyle = Reference<XStyle>( xPropState, UNO_QUERY );
- }
- }
- }
- }
-
- return bRet;
-}
-// <--
-// --> OD 2006-10-12 #i69629#
void XMLTextImportHelper::SetOutlineStyles( sal_Bool bSetEmptyLevels )
{
if ( ( mpOutlineStylesCandidates != NULL || bSetEmptyLevels ) &&
diff --git a/xmloff/source/text/txtimppr.cxx b/xmloff/source/text/txtimppr.cxx
index d26130bb1d..218f2fa793 100644
--- a/xmloff/source/text/txtimppr.cxx
+++ b/xmloff/source/text/txtimppr.cxx
@@ -39,6 +39,7 @@
#include <tools/string.hxx>
#include <xmloff/XMLFontStylesContext.hxx>
#include <xmloff/txtprmap.hxx>
+#include <xmloff/xmlimp.hxx>
#include "txtimppr.hxx"
#define XML_LINE_LEFT 0
@@ -120,11 +121,21 @@ sal_Bool XMLTextImportPropertyMapper::handleSpecialItem(
case CTF_FONTFAMILYNAME:
case CTF_FONTFAMILYNAME_CJK:
case CTF_FONTFAMILYNAME_CTL:
- case CTF_TEXT_DISPLAY:
bRet = getPropertySetMapper()->importXML( rValue, rProperty,
rUnitConverter );
break;
+ case CTF_TEXT_DISPLAY:
+ bRet = getPropertySetMapper()->importXML( rValue, rProperty,
+ rUnitConverter );
+ if( SvXMLImport::OOo_2x == GetImport().getGeneratorVersion() )
+ {
+ sal_Bool bHidden;
+ rProperty.maValue >>= bHidden;
+ bHidden = !bHidden;
+ rProperty.maValue <<= bHidden;
+ }
+ break;
default:
bRet = SvXMLImportPropertyMapper::handleSpecialItem( rProperty,
rProperties, rValue, rUnitConverter, rNamespaceMap );
diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx
index 0760aaa115..81562c5f65 100644
--- a/xmloff/source/text/txtparae.cxx
+++ b/xmloff/source/text/txtparae.cxx
@@ -65,15 +65,11 @@
#include <com/sun/star/container/XNamed.hpp>
#include <com/sun/star/container/XContentEnumerationAccess.hpp>
#include <com/sun/star/text/XTextFrame.hpp>
-#ifndef _COM_SUN_STAR_CONTAINER_XNAMED_HPP_
#include <com/sun/star/container/XNameAccess.hpp>
-#endif
#include <com/sun/star/text/SizeType.hpp>
#include <com/sun/star/text/HoriOrientation.hpp>
#include <com/sun/star/text/VertOrientation.hpp>
-#ifndef _COM_SUN_STAR_TEXT_TEXTCONTENTANCHORTYPE_HPP
#include <com/sun/star/text/TextContentAnchorType.hpp>
-#endif
#include <com/sun/star/text/XTextFramesSupplier.hpp>
#include <com/sun/star/text/XTextGraphicObjectsSupplier.hpp>
#include <com/sun/star/text/XTextEmbeddedObjectsSupplier.hpp>
@@ -111,28 +107,23 @@
#include <xmloff/nmspmap.hxx>
#include <xmloff/xmlexp.hxx>
#include "txtflde.hxx"
-#ifndef _XMLOFF_TXTPRMAP_HXX
#include <xmloff/txtprmap.hxx>
-#endif
#include "XMLImageMapExport.hxx"
#include "XMLTextNumRuleInfo.hxx"
#include "XMLTextListAutoStylePool.hxx"
-#ifndef _XMLOFF_TXTPARAE_HXX
#include <xmloff/txtparae.hxx>
-#endif
#include "XMLSectionExport.hxx"
#include "XMLIndexMarkExport.hxx"
#include <xmloff/XMLEventExport.hxx>
#include "XMLRedlineExport.hxx"
-#ifndef _XMLOFF_MULTIPROPERTYSETHELPER_HXX
#include "MultiPropertySetHelper.hxx"
-#endif
#include <xmloff/formlayerexport.hxx>
#include "XMLTextCharStyleNamesElementExport.hxx"
// --> OD 2008-04-25 #refactorlists#
#include <txtlists.hxx>
// <--
+#include <com/sun/star/rdf/XMetadatable.hpp>
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
@@ -975,23 +966,29 @@ void XMLTextParagraphExport::exportListChange(
// <text:list-header> or <text:list-item>
GetExport().CheckAttrList();
- if ( nListLevelsToBeOpened == 1 &&
- rNextInfo.HasStartValue() )
+ // --> OD 2009-06-24 #i97309#
+ // export start value in case of <bRestartNumberingAtContinuedRootList>
+ // at correct list item
+ if ( nListLevelsToBeOpened == 1 )
{
- OUStringBuffer aBuffer;
- aBuffer.append( (sal_Int32)rNextInfo.GetStartValue() );
- GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_START_VALUE,
- aBuffer.makeStringAndClear() );
- }
- else if ( bRestartNumberingAtContinuedRootList )
- {
- OUStringBuffer aBuffer;
- aBuffer.append( (sal_Int32)nRestartValueForContinuedRootList );
- GetExport().AddAttribute( XML_NAMESPACE_TEXT,
- XML_START_VALUE,
- aBuffer.makeStringAndClear() );
- bRestartNumberingAtContinuedRootList = false;
+ if ( rNextInfo.HasStartValue() )
+ {
+ OUStringBuffer aBuffer;
+ aBuffer.append( (sal_Int32)rNextInfo.GetStartValue() );
+ GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_START_VALUE,
+ aBuffer.makeStringAndClear() );
+ }
+ else if ( bRestartNumberingAtContinuedRootList )
+ {
+ OUStringBuffer aBuffer;
+ aBuffer.append( (sal_Int32)nRestartValueForContinuedRootList );
+ GetExport().AddAttribute( XML_NAMESPACE_TEXT,
+ XML_START_VALUE,
+ aBuffer.makeStringAndClear() );
+ bRestartNumberingAtContinuedRootList = false;
+ }
}
+ // <--
eLName = ( rNextInfo.IsNumbered() || nListLevelsToBeOpened > 1 )
? XML_LIST_ITEM
@@ -1131,7 +1128,11 @@ XMLTextParagraphExport::XMLTextParagraphExport(
// <--
sActualSize(RTL_CONSTASCII_USTRINGPARAM("ActualSize")),
- sAlternativeText(RTL_CONSTASCII_USTRINGPARAM("AlternativeText")),
+ // --> OD 2009-07-22 #i73249#
+// sAlternativeText(RTL_CONSTASCII_USTRINGPARAM("AlternativeText")),
+ sTitle(RTL_CONSTASCII_USTRINGPARAM("Title")),
+ sDescription(RTL_CONSTASCII_USTRINGPARAM("Description")),
+ // <--
sAnchorCharStyleName(RTL_CONSTASCII_USTRINGPARAM("AnchorCharStyleName")),
sAnchorPageNo(RTL_CONSTASCII_USTRINGPARAM("AnchorPageNo")),
sAnchorType(RTL_CONSTASCII_USTRINGPARAM("AnchorType")),
@@ -1460,7 +1461,8 @@ bool XMLTextParagraphExport::collectTextAutoStylesOptimized( sal_Bool bIsProgres
{
Any aAny = xTextFieldsEnum->nextElement();
Reference< XTextField > xTextField = *(Reference<XTextField>*)aAny.getValue();
- exportTextField( xTextField->getAnchor(), bAutoStyles );
+ exportTextField( xTextField->getAnchor(), bAutoStyles,
+ bIsProgress );
try
{
Reference < XPropertySet > xSet( xTextField, UNO_QUERY );
@@ -1905,6 +1907,7 @@ void XMLTextParagraphExport::exportParagraph(
{
// xml:id for RDF metadata
GetExport().AddAttributeXmlId(rTextContent);
+ GetExport().AddAttributesRDFa(rTextContent);
OUString sStyle;
if( rPropSetHelper.hasProperty( PARA_STYLE_NAME ) )
@@ -2142,6 +2145,7 @@ void XMLTextParagraphExport::exportTextRangeEnumeration(
sal_Bool bAutoStyles, sal_Bool bIsProgress,
sal_Bool bPrvChrIsSpc )
{
+ static OUString sMeta(RTL_CONSTASCII_USTRINGPARAM("Meta")); // FIXME
sal_Bool bPrevCharIsSpace = bPrvChrIsSpc;
while( rTextEnum->hasMoreElements() )
@@ -2162,7 +2166,7 @@ void XMLTextParagraphExport::exportTextRangeEnumeration(
}
else if( sType.equals(sTextField))
{
- exportTextField( xTxtRange, bAutoStyles );
+ exportTextField( xTxtRange, bAutoStyles, bIsProgress );
bPrevCharIsSpace = sal_False;
}
else if( sType.equals( sFrame ) )
@@ -2217,6 +2221,10 @@ void XMLTextParagraphExport::exportTextRangeEnumeration(
{
exportRuby(xPropSet, bAutoStyles);
}
+ else if (sType.equals(sMeta))
+ {
+ exportMeta(xPropSet, bAutoStyles, bIsProgress);
+ }
else if (sType.equals(sTextFieldStart))
{
Reference<XNamed> xBookmark(xPropSet->getPropertyValue(sBookmark), UNO_QUERY);
@@ -2286,7 +2294,7 @@ void XMLTextParagraphExport::exportTextRangeEnumeration(
Reference<XServiceInfo> xServiceInfo( xTxtRange, UNO_QUERY );
if( xServiceInfo->supportsService( sTextFieldService ) )
{
- exportTextField( xTxtRange, bAutoStyles );
+ exportTextField( xTxtRange, bAutoStyles, bIsProgress );
bPrevCharIsSpace = sal_False;
}
else
@@ -2308,7 +2316,7 @@ void XMLTextParagraphExport::exportTable(
void XMLTextParagraphExport::exportTextField(
const Reference < XTextRange > & rTextRange,
- sal_Bool bAutoStyles )
+ sal_Bool bAutoStyles, sal_Bool bIsProgress )
{
Reference < XPropertySet > xPropSet( rTextRange, UNO_QUERY );
// non-Writer apps need not support Property TextField, so test first
@@ -2320,11 +2328,11 @@ void XMLTextParagraphExport::exportTextField(
{
if( bAutoStyles )
{
- pFieldExport->ExportFieldAutoStyle( xTxtFld );
+ pFieldExport->ExportFieldAutoStyle( xTxtFld, bIsProgress );
}
else
{
- pFieldExport->ExportField( xTxtFld );
+ pFieldExport->ExportField( xTxtFld, bIsProgress );
}
}
else
@@ -2778,6 +2786,10 @@ void XMLTextParagraphExport::_exportTextFrame(
// image map
GetExport().GetImageMapExport().Export( rPropSet );
+ // --> OD 2009-07-22 #i73249#
+ // svg:title and svg:desc
+ exportTitleAndDescription( rPropSet, rPropSetInfo );
+ // <--
}
void XMLTextParagraphExport::exportContour(
@@ -2969,8 +2981,10 @@ void XMLTextParagraphExport::_exportTextGraphic(
// image map
GetExport().GetImageMapExport().Export( rPropSet );
- // svg:desc
- exportAlternativeText( rPropSet, rPropSetInfo );
+ // --> OD 2009-07-22 #i73249#
+ // svg:title and svg:desc
+ exportTitleAndDescription( rPropSet, rPropSetInfo );
+ // <--
// draw:contour
exportContour( rPropSet, rPropSetInfo );
@@ -2999,23 +3013,39 @@ void XMLTextParagraphExport::exportEvents( const Reference < XPropertySet > & rP
if (rPropSet->getPropertySetInfo()->hasPropertyByName(sImageMap))
GetExport().GetImageMapExport().Export( rPropSet );
}
-void XMLTextParagraphExport::exportAlternativeText(
+
+// --> OD 2009-07-22 #i73249#
+void XMLTextParagraphExport::exportTitleAndDescription(
const Reference < XPropertySet > & rPropSet,
const Reference < XPropertySetInfo > & rPropSetInfo )
{
// svg:title
- if( rPropSetInfo->hasPropertyByName( sAlternativeText ) )
+ if( rPropSetInfo->hasPropertyByName( sTitle ) )
{
- OUString sAltText;
- rPropSet->getPropertyValue( sAlternativeText ) >>= sAltText;
- if( sAltText.getLength() )
+ OUString sObjTitle;
+ rPropSet->getPropertyValue( sTitle ) >>= sObjTitle;
+ if( sObjTitle.getLength() )
{
SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_SVG,
XML_TITLE, sal_True, sal_False );
- GetExport().Characters( sAltText );
+ GetExport().Characters( sObjTitle );
+ }
+ }
+
+ // svg:description
+ if( rPropSetInfo->hasPropertyByName( sDescription ) )
+ {
+ OUString sObjDesc;
+ rPropSet->getPropertyValue( sDescription ) >>= sObjDesc;
+ if( sObjDesc.getLength() )
+ {
+ SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_SVG,
+ XML_DESC, sal_True, sal_False );
+ GetExport().Characters( sObjDesc );
}
}
}
+// <--
void XMLTextParagraphExport::setTextEmbeddedGraphicURL(
const Reference < XPropertySet >&,
@@ -3634,7 +3664,41 @@ void XMLTextParagraphExport::exportRuby(
}
}
+// FIXME: this is untested
+void XMLTextParagraphExport::exportMeta(
+ const Reference<XPropertySet> & i_xMeta,
+ sal_Bool i_bAutoStyles, sal_Bool i_isProgress)
+{
+ bool doExport(!i_bAutoStyles); // do not export element if autostyles
+ // check version >= 1.2
+ switch (GetExport().getDefaultVersion()) {
+ case SvtSaveOptions::ODFVER_011: // fall thru
+ case SvtSaveOptions::ODFVER_010: doExport = false; break;
+ default: break;
+ }
+
+ const Reference < XEnumerationAccess > xEA( i_xMeta, UNO_QUERY_THROW );
+ const Reference < XEnumeration > xTextEnum( xEA->createEnumeration() );
+
+ if (doExport)
+ {
+ const Reference<rdf::XMetadatable> xMeta( i_xMeta, UNO_QUERY_THROW );
+ const Reference<XTextContent> xTextContent( i_xMeta, UNO_QUERY_THROW );
+
+ // text:meta with neither xml:id nor RDFa is invalid
+ xMeta->ensureMetadataReference();
+ // xml:id and RDFa for RDF metadata
+ GetExport().AddAttributeXmlId(xMeta);
+ GetExport().AddAttributesRDFa(xTextContent);
+ }
+
+ SvXMLElementExport aElem( GetExport(), doExport,
+ XML_NAMESPACE_TEXT, XML_META, sal_False, sal_False );
+
+ // recurse to export content
+ exportTextRangeEnumeration( xTextEnum, i_bAutoStyles, i_isProgress );
+}
void XMLTextParagraphExport::PreventExportOfControlsInMuteSections(
diff --git a/xmloff/source/text/txtparai.cxx b/xmloff/source/text/txtparai.cxx
index 52e58377b7..3397477d25 100644
--- a/xmloff/source/text/txtparai.cxx
+++ b/xmloff/source/text/txtparai.cxx
@@ -671,34 +671,33 @@ SvXMLImportContext *XMLImpRubyContext_Impl::CreateChildContext(
// ---------------------------------------------------------------------
-/** text:meta and text:meta-field
-//FIXME neither finished nor tested
+/** for text:meta and text:meta-field
+//FIXME not tested
*/
-class XMLMetaImportContext : public SvXMLImportContext
+class XMLMetaImportContextBase : public SvXMLImportContext
{
- XMLHints_Impl& mrHints;
-// XMLStyleHint_Impl *pHint;
+ XMLHints_Impl& m_rHints;
- sal_Bool& mrIgnoreLeadingSpace;
+ sal_Bool& m_rIgnoreLeadingSpace;
/// start position
- Reference<XTextRange> mxStart;
+ Reference<XTextRange> m_xStart;
- OUString mXmlId;
+protected:
+ OUString m_XmlId;
public:
TYPEINFO();
- XMLMetaImportContext(
+ XMLMetaImportContextBase(
SvXMLImport& i_rImport,
sal_uInt16 i_nPrefix,
const OUString& i_rLocalName,
const Reference< xml::sax::XAttributeList > & i_xAttrList,
-// enum XMLTextPElemTokens nTok,
XMLHints_Impl& i_rHints,
sal_Bool & i_rIgnoreLeadingSpace );
- virtual ~XMLMetaImportContext();
+ virtual ~XMLMetaImportContextBase();
virtual void EndElement();
@@ -707,25 +706,30 @@ public:
const Reference< xml::sax::XAttributeList > & i_xAttrList );
virtual void Characters( const OUString& i_rChars );
+
+ virtual void ProcessAttribute(sal_uInt16 const i_nPrefix,
+ OUString const & i_rLocalName, OUString const & i_rValue);
+
+ virtual void InsertMeta(const Reference<XTextRange> & i_xInsertionRange)
+ = 0;
};
-TYPEINIT1( XMLMetaImportContext , SvXMLImportContext );
+TYPEINIT1( XMLMetaImportContextBase, SvXMLImportContext );
-XMLMetaImportContext::XMLMetaImportContext(
+XMLMetaImportContextBase::XMLMetaImportContextBase(
SvXMLImport& i_rImport,
sal_uInt16 i_nPrefix,
const OUString& i_rLocalName,
const Reference< xml::sax::XAttributeList > & i_xAttrList,
XMLHints_Impl& i_rHints,
sal_Bool & i_rIgnoreLeadingSpace )
- : SvXMLImportContext( i_rImport, i_nPrefix, i_rLocalName ),
- mrHints( i_rHints ),
- mrIgnoreLeadingSpace( i_rIgnoreLeadingSpace ),
- mxStart()
+ : SvXMLImportContext( i_rImport, i_nPrefix, i_rLocalName )
+ , m_rHints( i_rHints )
+ , m_rIgnoreLeadingSpace( i_rIgnoreLeadingSpace )
+ , m_xStart()
{
-//FIXME: RDFa (text:meta)
const sal_Int16 nAttrCount(i_xAttrList.is() ? i_xAttrList->getLength() : 0);
- for( sal_Int16 i=0; i < nAttrCount; i++ )
+ for ( sal_Int16 i=0; i < nAttrCount; i++ )
{
const OUString& rAttrName( i_xAttrList->getNameByIndex( i ) );
const OUString& rValue( i_xAttrList->getValueByIndex( i ) );
@@ -734,49 +738,61 @@ XMLMetaImportContext::XMLMetaImportContext(
sal_uInt16 nPrefix =
GetImport().GetNamespaceMap().GetKeyByAttrName( rAttrName,
&sLocalName );
-// FIXME: only meta-field
- if( XML_NAMESPACE_TEXT == nPrefix &&
- IsXMLToken( sLocalName, XML_DATA_STYLE_NAME ) )
- {
-// pHint->SetStyleName( rValue );
- break;
- }
- else if ( (XML_NAMESPACE_XML == nPrefix) &&
- IsXMLToken(sLocalName, XML_ID) )
- {
- mXmlId = rValue;
- }
+ ProcessAttribute(nPrefix, sLocalName, rValue);
}
- //FIXME meta-field xml:id mandatory
- mxStart = GetImport().GetTextImport()->GetCursorAsRange()->getStart();
+ m_xStart = GetImport().GetTextImport()->GetCursorAsRange()->getStart();
}
-XMLMetaImportContext::~XMLMetaImportContext()
+XMLMetaImportContextBase::~XMLMetaImportContextBase()
{
}
-void XMLMetaImportContext::EndElement()
+void XMLMetaImportContextBase::EndElement()
{
- OSL_ENSURE(mxStart.is(), "no mxStart?");
+ OSL_ENSURE(m_xStart.is(), "no mxStart?");
+ if (!m_xStart.is()) return;
- Reference<XTextRange> xEndRange(
+ const Reference<XTextRange> xEndRange(
GetImport().GetTextImport()->GetCursorAsRange()->getStart() );
// create range for insertion
- Reference<XTextCursor> xInsertionCursor(
+ const Reference<XTextCursor> xInsertionCursor(
GetImport().GetTextImport()->GetText()->createTextCursorByRange(
xEndRange) );
- xInsertionCursor->gotoRange(mxStart, sal_True);
+ xInsertionCursor->gotoRange(m_xStart, sal_True);
- Reference<XTextRange> xInsertionRange(xInsertionCursor, UNO_QUERY);
+ const Reference<XTextRange> xInsertionRange(xInsertionCursor, UNO_QUERY);
- OUString sName;
+ InsertMeta(xInsertionRange);
//FIXME
- // insert bookmark
-// XMLTextMarkImportContext::CreateAndInsertMark
+#if 0
+ Reference<XMultiServiceFactory> xFactory(rImport.GetModel(), UNO_QUERY);
+ if ( xFactory.is() )
+ {
+ Reference<XInterface> xIfc = xFactory->createInstance(sServiceName);
+
+ // xml:id for RDF metadata
+ rImport.SetXmlId(xIfc, i_rXmlId);
+
+ // cast to XTextContent and attach to document
+ Reference<XTextContent> xTextContent(xIfc, UNO_QUERY);
+ if (xTextContent.is())
+ {
+ try
+ {
+ rImport.GetTextImport()->GetText()->insertTextContent(
+ xInsertionRange, xTextContent, sal_True);
+ }
+ catch (com::sun::star::lang::IllegalArgumentException &)
+ {
+ OSL_ENSURE(false, "XMLMetaImportContext::EndElement: iae");
+ }
+ }
+ }
+#endif
}
-SvXMLImportContext * XMLMetaImportContext::CreateChildContext(
+SvXMLImportContext * XMLMetaImportContextBase::CreateChildContext(
sal_uInt16 i_nPrefix, const OUString& i_rLocalName,
const Reference< xml::sax::XAttributeList > & i_xAttrList )
{
@@ -785,15 +801,236 @@ SvXMLImportContext * XMLMetaImportContext::CreateChildContext(
sal_uInt16 nToken = rTokenMap.Get( i_nPrefix, i_rLocalName );
return XMLImpSpanContext_Impl::CreateChildContext( GetImport(), i_nPrefix,
- i_rLocalName, i_xAttrList, nToken, mrHints, mrIgnoreLeadingSpace );
+ i_rLocalName, i_xAttrList, nToken, m_rHints, m_rIgnoreLeadingSpace );
}
-void XMLMetaImportContext::Characters( const OUString& i_rChars )
+void XMLMetaImportContextBase::Characters( const OUString& i_rChars )
{
- //FIXME do we need to call ConvertStarFonts?
- GetImport().GetTextImport()->InsertString( i_rChars, mrIgnoreLeadingSpace );
+ GetImport().GetTextImport()->InsertString(i_rChars, m_rIgnoreLeadingSpace);
}
+void XMLMetaImportContextBase::ProcessAttribute(sal_uInt16 const i_nPrefix,
+ OUString const & i_rLocalName, OUString const & i_rValue)
+{
+ if ( (XML_NAMESPACE_XML == i_nPrefix) &&
+ IsXMLToken(i_rLocalName, XML_ID) )
+ {
+ m_XmlId = i_rValue;
+ }
+}
+
+
+// ---------------------------------------------------------------------
+
+/** text:meta
+//FIXME not tested
+ */
+class XMLMetaImportContext : public XMLMetaImportContextBase
+{
+ // RDFa
+ bool m_bHaveAbout;
+ ::rtl::OUString m_sAbout;
+ ::rtl::OUString m_sProperty;
+ ::rtl::OUString m_sContent;
+ ::rtl::OUString m_sDatatype;
+
+public:
+ TYPEINFO();
+
+ XMLMetaImportContext(
+ SvXMLImport& i_rImport,
+ sal_uInt16 i_nPrefix,
+ const OUString& i_rLocalName,
+ const Reference< xml::sax::XAttributeList > & i_xAttrList,
+ XMLHints_Impl& i_rHints,
+ sal_Bool & i_rIgnoreLeadingSpace );
+
+ virtual void ProcessAttribute(sal_uInt16 const i_nPrefix,
+ OUString const & i_rLocalName, OUString const & i_rValue);
+
+ virtual void InsertMeta(const Reference<XTextRange> & i_xInsertionRange);
+};
+
+TYPEINIT1( XMLMetaImportContext, XMLMetaImportContextBase );
+
+XMLMetaImportContext::XMLMetaImportContext(
+ SvXMLImport& i_rImport,
+ sal_uInt16 i_nPrefix,
+ const OUString& i_rLocalName,
+ const Reference< xml::sax::XAttributeList > & i_xAttrList,
+ XMLHints_Impl& i_rHints,
+ sal_Bool & i_rIgnoreLeadingSpace )
+ : XMLMetaImportContextBase( i_rImport, i_nPrefix, i_rLocalName,
+ i_xAttrList, i_rHints, i_rIgnoreLeadingSpace )
+ , m_bHaveAbout(false)
+{
+}
+
+void XMLMetaImportContext::ProcessAttribute(sal_uInt16 const i_nPrefix,
+ OUString const & i_rLocalName, OUString const & i_rValue)
+{
+ if ( XML_NAMESPACE_XHTML == i_nPrefix )
+ {
+ // RDFa
+ if ( IsXMLToken( i_rLocalName, XML_ABOUT) )
+ {
+ m_sAbout = i_rValue;
+ m_bHaveAbout = true;
+ }
+ else if ( IsXMLToken( i_rLocalName, XML_PROPERTY) )
+ {
+ m_sProperty = i_rValue;
+ }
+ else if ( IsXMLToken( i_rLocalName, XML_CONTENT) )
+ {
+ m_sContent = i_rValue;
+ }
+ else if ( IsXMLToken( i_rLocalName, XML_DATATYPE) )
+ {
+ m_sDatatype = i_rValue;
+ }
+ }
+ else
+ {
+ XMLMetaImportContextBase::ProcessAttribute(
+ i_nPrefix, i_rLocalName, i_rValue);
+ }
+}
+
+void XMLMetaImportContext::InsertMeta(
+ const Reference<XTextRange> & i_xInsertionRange)
+{
+ OSL_ENSURE(!m_bHaveAbout == !m_sProperty.getLength(),
+ "XMLMetaImportContext::InsertMeta: invalid RDFa?");
+ if (m_XmlId.getLength() || (m_bHaveAbout && m_sProperty.getLength()))
+ {
+ // insert mark
+ const uno::Reference<rdf::XMetadatable> xMeta(
+ XMLTextMarkImportContext::CreateAndInsertMark(
+ GetImport(),
+ OUString::createFromAscii(
+ "com.sun.star.text.InContentMetadata"),
+ OUString(),
+ i_xInsertionRange, m_XmlId),
+ uno::UNO_QUERY);
+ OSL_ENSURE(xMeta.is(), "cannot insert Meta?");
+
+ if (xMeta.is() && m_bHaveAbout)
+ {
+ GetImport().AddRDFa(xMeta,
+ m_sAbout, m_sProperty, m_sContent, m_sDatatype);
+ }
+ }
+ else
+ {
+ OSL_TRACE("invalid <text:meta>: no xml:id, no valid RDFa");
+ }
+}
+
+// ---------------------------------------------------------------------
+
+/** text:meta-field
+//FIXME not tested
+ */
+class XMLMetaFieldImportContext : public XMLMetaImportContextBase
+{
+ OUString m_DataStyleName;
+
+public:
+ TYPEINFO();
+
+ XMLMetaFieldImportContext(
+ SvXMLImport& i_rImport,
+ sal_uInt16 i_nPrefix,
+ const OUString& i_rLocalName,
+ const Reference< xml::sax::XAttributeList > & i_xAttrList,
+ XMLHints_Impl& i_rHints,
+ sal_Bool & i_rIgnoreLeadingSpace );
+
+ virtual void ProcessAttribute(sal_uInt16 const i_nPrefix,
+ OUString const & i_rLocalName, OUString const & i_rValue);
+
+ virtual void InsertMeta(const Reference<XTextRange> & i_xInsertionRange);
+};
+
+TYPEINIT1( XMLMetaFieldImportContext, XMLMetaImportContextBase );
+
+XMLMetaFieldImportContext::XMLMetaFieldImportContext(
+ SvXMLImport& i_rImport,
+ sal_uInt16 i_nPrefix,
+ const OUString& i_rLocalName,
+ const Reference< xml::sax::XAttributeList > & i_xAttrList,
+ XMLHints_Impl& i_rHints,
+ sal_Bool & i_rIgnoreLeadingSpace )
+ : XMLMetaImportContextBase( i_rImport, i_nPrefix, i_rLocalName,
+ i_xAttrList, i_rHints, i_rIgnoreLeadingSpace )
+{
+}
+
+void XMLMetaFieldImportContext::ProcessAttribute(sal_uInt16 const i_nPrefix,
+ OUString const & i_rLocalName, OUString const & i_rValue)
+{
+ if( XML_NAMESPACE_STYLE == i_nPrefix &&
+ IsXMLToken( i_rLocalName, XML_DATA_STYLE_NAME ) )
+ {
+ m_DataStyleName = i_rValue;
+ }
+ else
+ {
+ XMLMetaImportContextBase::ProcessAttribute(
+ i_nPrefix, i_rLocalName, i_rValue);
+ }
+}
+
+void XMLMetaFieldImportContext::InsertMeta(
+ const Reference<XTextRange> & i_xInsertionRange)
+{
+ if (m_XmlId.getLength()) // valid?
+ {
+ // insert mark
+ const Reference<XPropertySet> xPropertySet(
+ XMLTextMarkImportContext::CreateAndInsertMark(
+ GetImport(),
+ OUString::createFromAscii(
+ "com.sun.star.text.textfield.MetadataField"),
+ OUString(),
+ i_xInsertionRange, m_XmlId),
+ UNO_QUERY);
+ OSL_ENSURE(xPropertySet.is(), "cannot insert MetaField?");
+ if (!xPropertySet.is()) return;
+
+ if (m_DataStyleName.getLength())
+ {
+ sal_Bool isDefaultLanguage(sal_True);
+
+ const sal_Int32 nKey( GetImport().GetTextImport()->GetDataStyleKey(
+ m_DataStyleName, & isDefaultLanguage) );
+
+ if (-1 != nKey)
+ {
+ static ::rtl::OUString sPropertyIsFixedLanguage(
+ ::rtl::OUString::createFromAscii("IsFixedLanguage") );
+ Any any;
+ any <<= nKey;
+ xPropertySet->setPropertyValue(
+ OUString::createFromAscii("NumberFormat"), any);
+ if ( xPropertySet->getPropertySetInfo()->
+ hasPropertyByName( sPropertyIsFixedLanguage ) )
+ {
+ any <<= static_cast<bool>(!isDefaultLanguage);
+ xPropertySet->setPropertyValue( sPropertyIsFixedLanguage,
+ any );
+ }
+ }
+ }
+ }
+ else
+ {
+ OSL_TRACE("invalid <text:meta-field>: no xml:id");
+ }
+}
+
+
// ---------------------------------------------------------------------
@@ -1574,13 +1811,17 @@ SvXMLImportContext *XMLImpSpanContext_Impl::CreateChildContext(
sal_False);
break;
- case XML_TOK_TEXT_META:
- case XML_TOK_TEXT_META_FIELD:
// FIXME: should test before enabling...
#if 0
+ case XML_TOK_TEXT_META:
pContext = new XMLMetaImportContext(rImport, nPrefix, rLocalName,
xAttrList, rHints, rIgnoreLeadingSpace );
break;
+
+ case XML_TOK_TEXT_META_FIELD:
+ pContext = new XMLMetaFieldImportContext(rImport, nPrefix, rLocalName,
+ xAttrList, rHints, rIgnoreLeadingSpace );
+ break;
#endif
default:
@@ -1657,6 +1898,7 @@ XMLParaContext::XMLParaContext(
sal_Bool bHead ) :
SvXMLImportContext( rImport, nPrfx, rLName ),
xStart( rImport.GetTextImport()->GetCursorAsRange()->getStart() ),
+ m_bHaveAbout(false),
nOutlineLevel( IsXMLToken( rLName, XML_H ) ? 1 : -1 ),
pHints( 0 ),
// --> OD 2007-07-25 #i73509#
@@ -1686,9 +1928,21 @@ XMLParaContext::XMLParaContext(
&aLocalName );
switch( rTokenMap.Get( nPrefix, aLocalName ) )
{
-//FIXME: RDFa
case XML_TOK_TEXT_P_XMLID:
- sXmlId = rValue;
+ m_sXmlId = rValue;
+ break;
+ case XML_TOK_TEXT_P_ABOUT:
+ m_sAbout = rValue;
+ m_bHaveAbout = true;
+ break;
+ case XML_TOK_TEXT_P_PROPERTY:
+ m_sProperty = rValue;
+ break;
+ case XML_TOK_TEXT_P_CONTENT:
+ m_sContent = rValue;
+ break;
+ case XML_TOK_TEXT_P_DATATYPE:
+ m_sDatatype = rValue;
break;
case XML_TOK_TEXT_P_STYLE_NAME:
sStyleName = rValue;
@@ -1785,7 +2039,8 @@ XMLParaContext::~XMLParaContext()
xAttrCursor->gotoRange( xEnd, sal_True );
// xml:id for RDF metadata
- if (sXmlId.getLength() > 0) {
+ if (m_sXmlId.getLength() || m_bHaveAbout || m_sProperty.getLength())
+ {
try {
const uno::Reference<container::XEnumerationAccess> xEA
(xAttrCursor, uno::UNO_QUERY_THROW);
@@ -1795,12 +2050,17 @@ XMLParaContext::~XMLParaContext()
if (xEnum->hasMoreElements()) {
uno::Reference<rdf::XMetadatable> xMeta;
xEnum->nextElement() >>= xMeta;
-//FIXME not yet
-// OSL_ENSURE(xMeta.is(), "xml:id: not XMetadatable");
- GetImport().SetXmlId(xMeta, sXmlId);
+ OSL_ENSURE(xMeta.is(), "xml:id: not XMetadatable");
+ GetImport().SetXmlId(xMeta, m_sXmlId);
+ if (m_bHaveAbout)
+ {
+ GetImport().AddRDFa(xMeta,
+ m_sAbout, m_sProperty, m_sContent, m_sDatatype);
+ }
OSL_ENSURE(!xEnum->hasMoreElements(), "xml:id: > 1 paragraph?");
}
} catch (uno::Exception &) {
+ OSL_TRACE("XMLParaContext::~XMLParaContext: exception");
}
}
diff --git a/xmloff/source/text/txtparai.hxx b/xmloff/source/text/txtparai.hxx
index c799540588..274c212d7f 100644
--- a/xmloff/source/text/txtparai.hxx
+++ b/xmloff/source/text/txtparai.hxx
@@ -50,7 +50,12 @@ class XMLParaContext : public SvXMLImportContext
::com::sun::star::text::XTextRange > xStart; // xub_StrLen nStart;
::rtl::OUString sStyleName;
::rtl::OUString sId;
- ::rtl::OUString sXmlId;
+ ::rtl::OUString m_sXmlId;
+ ::rtl::OUString m_sAbout;
+ ::rtl::OUString m_sProperty;
+ ::rtl::OUString m_sContent;
+ ::rtl::OUString m_sDatatype;
+ bool m_bHaveAbout;
sal_Int8 nOutlineLevel;
XMLHints_Impl *pHints;
// --> OD 2007-07-25 #i73509#
diff --git a/xmloff/source/text/txtprmap.cxx b/xmloff/source/text/txtprmap.cxx
index 1a7b3631e5..e68469f561 100644
--- a/xmloff/source/text/txtprmap.cxx
+++ b/xmloff/source/text/txtprmap.cxx
@@ -372,7 +372,7 @@ XMLPropertyMapEntry aXMLParaPropMap[] =
// RES_PARATR_SNAPTOGRID
MP_E( "SnapToGrid", STYLE, SNAP_TO_LAYOUT_GRID, XML_TYPE_BOOL, 0 ),
- MP_ED( "WritingMode", STYLE, WRITING_MODE, XML_TYPE_TEXT_WRITING_MODE_WITH_DEFAULT, 0 ),
+ MP_ED( "WritingMode", STYLE, WRITING_MODE, XML_TYPE_TEXT_WRITING_MODE_WITH_DEFAULT, CTF_TEXTWRITINGMODE ),
MP_E( "ParaIsConnectBorder", STYLE, JOIN_BORDER, XML_TYPE_BOOL, 0 ),
diff --git a/xmloff/source/text/txtstyli.cxx b/xmloff/source/text/txtstyli.cxx
index bef97fefa9..1e4dab709f 100644
--- a/xmloff/source/text/txtstyli.cxx
+++ b/xmloff/source/text/txtstyli.cxx
@@ -547,30 +547,6 @@ void XMLTextStyleContext::FillPropertySet(
struct XMLPropertyState& rState = GetProperties()[nIndex];
Any rAny = rState.maValue;
sal_Int32 nMapperIndex = rState.mnIndex;
- if( i == 3 )
- {
- if( SvXMLImport::OOo_2x != GetImport().getGeneratorVersion() )
- continue;
- sal_Bool bHidden;
- rAny >>= bHidden;
- bHidden = !bHidden;
- Any aAny( rAny );
- aAny <<= bHidden;
- // get property set mapper
- UniReference<XMLPropertySetMapper> rPropMapper =
- xImpPrMap->getPropertySetMapper();
-
- // set property
- OUString rPropertyName(
- rPropMapper->GetEntryAPIName(nMapperIndex) );
- if( !xInfo.is() )
- xInfo = rPropSet->getPropertySetInfo();
- if ( xInfo->hasPropertyByName( rPropertyName ) )
- {
- rPropSet->setPropertyValue( rPropertyName, aAny );
- }
- continue;
- }
// Now check for font name in rState and set corrected value,
// if necessary.
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
index d43366cfba..f5c660c53e 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
@@ -33,6 +33,7 @@
#include "exp_share.hxx"
#include <rtl/ustrbuf.hxx>
+#include <tools/diagnose_ex.h>
#include <com/sun/star/awt/CharSet.hpp>
#include <com/sun/star/awt/FontFamily.hpp>
@@ -996,6 +997,24 @@ void ElementDescriptor::readDefaults( bool supportPrintable )
OSL_ENSURE( 0, "unexpected property type for \"Enabled\": not bool!" );
}
+ sal_Bool bVisible = sal_True;
+ try
+ {
+ if (_xProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("EnableVisible") ) ) >>= bVisible)
+ {
+
+ // only write out the non default case
+ if (! bVisible)
+ {
+ addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":visible") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("false") ) );
+ }
+ }
+ }
+ catch( Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
// force writing of pos/size
a = _xProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("PositionX") ) );
if (a.getValueTypeClass() == TypeClass_LONG)
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx
index a873f43437..99a8361141 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx
@@ -33,6 +33,7 @@
#include "imp_share.hxx"
#include <osl/diagnose.h>
+#include <tools/diagnose_ex.h>
#include <osl/mutex.hxx>
#include <rtl/ustrbuf.hxx>
@@ -1612,6 +1613,23 @@ void ImportContext::importDefaults(
OUString( RTL_CONSTASCII_USTRINGPARAM("Enabled") ), makeAny( sal_False ) );
}
+ sal_Bool bVisible = sal_True;
+ if (getBoolAttr(
+ &bVisible, OUString( RTL_CONSTASCII_USTRINGPARAM("visible") ),
+ xAttributes, _pImport->XMLNS_DIALOGS_UID ) && !bVisible)
+ {
+ try
+ {
+
+ _xControlModel->setPropertyValue(
+ OUString( RTL_CONSTASCII_USTRINGPARAM("EnableVisible") ), makeAny( sal_False ) );
+ }
+ catch( Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+
if (!importLongProperty( nBaseX,
OUString( RTL_CONSTASCII_USTRINGPARAM("PositionX") ),
OUString( RTL_CONSTASCII_USTRINGPARAM("left") ),