summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--basebmp/test/basictest.cxx2
-rw-r--r--basebmp/test/bmpmasktest.cxx2
-rw-r--r--basebmp/test/bmptest.cxx2
-rw-r--r--basebmp/test/cliptest.cxx2
-rw-r--r--basebmp/test/filltest.cxx2
-rw-r--r--basebmp/test/linetest.cxx2
-rw-r--r--basebmp/test/makefile.mk7
-rw-r--r--basebmp/test/masktest.cxx2
-rw-r--r--basebmp/test/polytest.cxx2
-rw-r--r--basegfx/source/curve/b2dcubicbezier.cxx67
-rw-r--r--basegfx/test/basegfx1d.cxx2
-rw-r--r--basegfx/test/basegfx2d.cxx2
-rw-r--r--basegfx/test/basegfx3d.cxx2
-rw-r--r--basegfx/test/basegfxtools.cxx2
-rw-r--r--basegfx/test/boxclipper.cxx2
-rw-r--r--basegfx/test/clipstate.cxx2
-rw-r--r--basegfx/test/genericclipper.cxx2
-rw-r--r--basegfx/test/makefile.mk7
-rw-r--r--canvas/prj/d.lst7
-rw-r--r--canvas/source/cairo/cairo_canvashelper.cxx1
-rw-r--r--canvas/source/cairo/cairo_textlayout.cxx4
-rw-r--r--canvas/source/cairo/cairocanvas.component37
-rw-r--r--canvas/source/cairo/exports.dxp1
-rw-r--r--canvas/source/cairo/makefile.mk8
-rw-r--r--canvas/source/directx/directx5canvas.component34
-rw-r--r--canvas/source/directx/directx9canvas.component34
-rwxr-xr-xcanvas/source/directx/dx_canvashelper_texturefill.cxx2
-rw-r--r--canvas/source/directx/exports.dxp1
-rw-r--r--canvas/source/directx/gdipluscanvas.component37
-rw-r--r--canvas/source/directx/makefile.mk22
-rw-r--r--canvas/source/factory/canvasfactory.component34
-rw-r--r--canvas/source/factory/cf_service.cxx8
-rw-r--r--canvas/source/factory/makefile.mk7
-rw-r--r--canvas/source/null/exports.dxp1
-rw-r--r--canvas/source/simplecanvas/exports.dxp1
-rw-r--r--canvas/source/simplecanvas/makefile.mk8
-rw-r--r--canvas/source/simplecanvas/simplecanvas.component34
-rw-r--r--canvas/source/tools/elapsedtime.cxx4
-rw-r--r--canvas/source/vcl/canvashelper_texturefill.cxx2
-rw-r--r--canvas/source/vcl/exports.dxp1
-rw-r--r--canvas/source/vcl/makefile.mk8
-rw-r--r--canvas/source/vcl/vclcanvas.component37
-rw-r--r--comphelper/inc/comphelper/componentmodule.hxx29
-rw-r--r--comphelper/inc/comphelper/docpasswordhelper.hxx63
-rw-r--r--[-rwxr-xr-x]comphelper/inc/comphelper/docpasswordrequest.hxx54
-rw-r--r--comphelper/inc/comphelper/mediadescriptor.hxx1
-rw-r--r--comphelper/inc/comphelper/namedvaluecollection.hxx12
-rw-r--r--comphelper/inc/comphelper/optionalvalue.hxx187
-rw-r--r--comphelper/inc/comphelper/property.hxx8
-rw-r--r--comphelper/inc/comphelper/querydeep.hxx484
-rw-r--r--comphelper/inc/comphelper/scopeguard.hxx16
-rw-r--r--comphelper/inc/comphelper/servicedecl.hxx31
-rw-r--r--comphelper/inc/comphelper/storagehelper.hxx11
-rw-r--r--comphelper/prj/build.lst2
-rw-r--r--comphelper/prj/d.lst1
-rw-r--r--comphelper/qa/complex/comphelper/Map.java205
-rw-r--r--comphelper/qa/complex/comphelper/SequenceOutputStreamUnitTest.java153
-rw-r--r--comphelper/qa/complex/comphelper/Test01.java107
-rw-r--r--comphelper/qa/complex/comphelper/TestHelper.java49
-rw-r--r--comphelper/qa/complex/comphelper/makefile.mk (renamed from tools/source/solar/makefile.mk)61
-rw-r--r--comphelper/qa/complex/makefile.mk83
-rw-r--r--comphelper/source/misc/componentmodule.cxx58
-rw-r--r--comphelper/source/misc/docpasswordhelper.cxx152
-rw-r--r--comphelper/source/misc/docpasswordrequest.cxx67
-rw-r--r--comphelper/source/misc/makefile.mk1
-rw-r--r--comphelper/source/misc/mediadescriptor.cxx6
-rw-r--r--comphelper/source/misc/namedvaluecollection.cxx49
-rw-r--r--comphelper/source/misc/querydeep.cxx76
-rw-r--r--comphelper/source/misc/servicedecl.cxx31
-rw-r--r--comphelper/source/misc/storagehelper.cxx52
-rw-r--r--comphelper/source/misc/uieventslogger.cxx9
-rw-r--r--comphelper/source/officeinstdir/officeinstallationdirectories.cxx92
-rw-r--r--comphelper/source/officeinstdir/officeinstallationdirectories.hxx6
-rw-r--r--comphelper/source/property/propagg.cxx24
-rw-r--r--comphelper/util/comphelp4.component70
-rw-r--r--comphelper/util/exports.dxp1
-rw-r--r--comphelper/util/makefile.mk8
-rw-r--r--cppcanvas/inc/cppcanvas/renderer.hxx18
-rw-r--r--cppcanvas/source/mtfrenderer/implrenderer.cxx46
-rw-r--r--cppcanvas/source/mtfrenderer/textaction.cxx20
-rw-r--r--dtrans/prj/d.lst5
-rw-r--r--dtrans/source/cnttype/exports.dxp1
-rw-r--r--dtrans/source/cnttype/mctfentry.cxx29
-rw-r--r--dtrans/source/generic/dtrans.component37
-rw-r--r--dtrans/source/generic/dtrans.cxx37
-rw-r--r--dtrans/source/generic/exports.dxp1
-rw-r--r--dtrans/source/generic/makefile.mk8
-rw-r--r--dtrans/source/os2/clipb/Os2Service.cxx22
-rw-r--r--dtrans/source/os2/clipb/exports.dxp1
-rw-r--r--dtrans/source/win32/clipb/exports.dxp1
-rw-r--r--dtrans/source/win32/clipb/wcbentry.cxx29
-rw-r--r--dtrans/source/win32/dnd/dndentry.cxx33
-rw-r--r--dtrans/source/win32/dnd/exports.dxp1
-rwxr-xr-x[-rw-r--r--]dtrans/source/win32/dtobj/DOTransferable.cxx9
-rwxr-xr-x[-rw-r--r--]dtrans/source/win32/dtobj/FmtFilter.cxx43
-rwxr-xr-x[-rw-r--r--]dtrans/source/win32/dtobj/FmtFilter.hxx6
-rw-r--r--dtrans/source/win32/ftransl/exports.dxp1
-rwxr-xr-x[-rw-r--r--]dtrans/source/win32/ftransl/ftransl.cxx1
-rw-r--r--dtrans/source/win32/ftransl/ftranslentry.cxx29
-rw-r--r--dtrans/util/dnd.component37
-rw-r--r--dtrans/util/exports.dxp1
-rw-r--r--dtrans/util/ftransl.component34
-rw-r--r--dtrans/util/makefile.mk29
-rw-r--r--dtrans/util/mcnttype.component34
-rw-r--r--dtrans/util/sysdtrans.component34
-rw-r--r--i18npool/prj/d.lst2
-rw-r--r--i18npool/source/breakiterator/breakiteratorImpl.cxx4
-rw-r--r--i18npool/source/localedata/data/makefile.mk211
-rw-r--r--i18npool/source/localedata/saxparser.cxx35
-rw-r--r--i18npool/source/registerservices/registerservices.cxx23
-rw-r--r--i18npool/source/search/i18nsearch.component34
-rw-r--r--i18npool/source/search/makefile.mk8
-rw-r--r--i18npool/source/search/textsearch.cxx19
-rw-r--r--i18npool/util/i18npool.component484
-rw-r--r--i18npool/util/makefile.mk8
-rwxr-xr-xl10ntools/scripts/xhtex8
-rwxr-xr-xl10ntools/scripts/xtxex8
-rw-r--r--l10ntools/source/help/HelpLinker.cxx90
-rw-r--r--o3tl/qa/makefile.mk7
-rw-r--r--o3tl/qa/test-cow_wrapper.cxx2
-rw-r--r--o3tl/qa/test-heap_ptr.cxx2
-rw-r--r--o3tl/qa/test-range.cxx2
-rw-r--r--o3tl/qa/test-vector_pool.cxx2
-rw-r--r--padmin/source/padialog.cxx14
-rw-r--r--padmin/source/padialog.src69
-rw-r--r--padmin/source/prtsetup.cxx39
-rw-r--r--padmin/source/prtsetup.hxx3
-rw-r--r--padmin/source/rtsetup.hrc10
-rw-r--r--padmin/source/rtsetup.src52
-rw-r--r--psprint_config/prj/build.lst2
-rw-r--r--rsc/inc/rscdb.hxx1
-rw-r--r--rsc/inc/vclrsc.hxx6
-rw-r--r--rsc/source/parser/erscerr.cxx2
-rw-r--r--rsc/source/parser/rscdb.cxx3
-rw-r--r--rsc/source/parser/rscicpx.cxx10
-rw-r--r--rsc/source/parser/rscinit.cxx2
-rwxr-xr-x[-rw-r--r--]rsc/source/parser/rsclex.cxx11
-rw-r--r--rsc/source/parser/rscyacc.cxx4
-rw-r--r--rsc/source/rsc/rsc.cxx4
-rw-r--r--rsc/source/tools/rsctools.cxx6
-rw-r--r--sax/prj/d.lst3
-rw-r--r--sax/qa/cppunit/makefile.mk7
-rw-r--r--sax/qa/cppunit/test_converter.cxx2
-rw-r--r--sax/source/expatwrap/makefile.mk11
-rw-r--r--sax/source/expatwrap/sax.component37
-rw-r--r--sax/source/expatwrap/sax_expat.cxx31
-rw-r--r--sax/source/fastparser/facreg.cxx28
-rw-r--r--sax/source/fastparser/fastsax.component37
-rw-r--r--sax/source/fastparser/makefile.mk7
-rw-r--r--sax/source/tools/converter.cxx4
-rw-r--r--sax/source/tools/fastserializer.cxx66
-rw-r--r--sot/prj/build.lst16
-rw-r--r--sot/prj/d.lst1
-rw-r--r--sot/qa/complex/olesimplestorage/OLESimpleStorageUnitTest.java79
-rw-r--r--sot/qa/complex/olesimplestorage/Test01.java20
-rw-r--r--sot/qa/complex/olesimplestorage/TestHelper.java15
-rw-r--r--sot/qa/complex/olesimplestorage/makefile.mk66
-rw-r--r--sot/source/sdstor/stgdir.cxx5
-rw-r--r--sot/source/sdstor/stgstrms.cxx8
-rw-r--r--sot/source/unoolestorage/register.cxx28
-rw-r--r--sot/util/makefile.mk8
-rw-r--r--sot/util/sot.component34
-rw-r--r--svl/inc/lngmisc.hxx3
-rw-r--r--svl/inc/poolcach.hxx13
-rw-r--r--svl/inc/svl/itempool.hxx8
-rw-r--r--svl/inc/svl/poolitem.hxx5
-rw-r--r--svl/inc/svl/svarray.hxx264
-rw-r--r--svl/inc/svl/svstdarr.hxx36
-rw-r--r--svl/prj/build.lst4
-rw-r--r--svl/prj/d.lst3
-rw-r--r--svl/qa/complex/ConfigItems/CheckConfigItems.java129
-rw-r--r--svl/qa/complex/ConfigItems/helper/ConfigItemTest.cxx28
-rw-r--r--svl/qa/complex/ConfigItems/helper/makefile.mk27
-rw-r--r--svl/qa/complex/ConfigItems/makefile.mk68
-rw-r--r--svl/qa/complex/passwordcontainer/MasterPasswdHandler.java8
-rw-r--r--svl/qa/complex/passwordcontainer/PasswordContainerUnitTest.java81
-rw-r--r--svl/qa/complex/passwordcontainer/Test01.java10
-rw-r--r--svl/qa/complex/passwordcontainer/Test02.java11
-rw-r--r--svl/qa/complex/passwordcontainer/Test03.java12
-rw-r--r--svl/qa/complex/passwordcontainer/TestHelper.java14
-rw-r--r--svl/qa/complex/passwordcontainer/makefile.mk137
-rw-r--r--svl/source/filepicker/makefile.mk1
-rw-r--r--svl/source/filepicker/pickerhelper.cxx99
-rw-r--r--svl/source/fsstor/fsfactory.cxx24
-rw-r--r--svl/source/fsstor/fsstorage.component35
-rw-r--r--svl/source/fsstor/makefile.mk8
-rw-r--r--svl/source/inc/poolio.hxx19
-rw-r--r--svl/source/items/itempool.cxx89
-rw-r--r--svl/source/items/poolcach.cxx20
-rw-r--r--svl/source/items/poolio.cxx151
-rw-r--r--svl/source/items/whassert.hxx2
-rw-r--r--svl/source/memtools/svarray.cxx14
-rw-r--r--svl/source/misc/lngmisc.cxx33
-rw-r--r--svl/source/numbers/nbdll.cxx79
-rw-r--r--svl/source/passwordcontainer/makefile.mk8
-rw-r--r--svl/source/passwordcontainer/passwordcontainer.component34
-rw-r--r--svl/source/passwordcontainer/passwordcontainer.cxx18
-rw-r--r--svl/source/svdde/ddedata.cxx10
-rw-r--r--svl/source/svdde/ddedll.cxx64
-rw-r--r--svl/source/svdde/ddestrg.cxx4
-rw-r--r--svl/source/uno/registerservices.cxx31
-rw-r--r--svl/util/makefile.mk8
-rw-r--r--svl/util/svl.component40
-rw-r--r--svtools/bmpmaker/bmp.src8
-rw-r--r--svtools/inc/fileview.hxx4
-rw-r--r--svtools/inc/fltdefs.hxx18
-rw-r--r--svtools/inc/rtfkeywd.hxx13
-rw-r--r--svtools/inc/rtfout.hxx2
-rw-r--r--svtools/inc/rtftoken.h2
-rw-r--r--svtools/inc/svtools/filter.hxx56
-rw-r--r--svtools/inc/svtools/headbar.hxx8
-rw-r--r--svtools/inc/svtools/helpid.hrc141
-rw-r--r--svtools/inc/svtools/htmlout.hxx2
-rw-r--r--svtools/inc/svtools/parrtf.hxx4
-rw-r--r--svtools/inc/svtools/roadmapwizard.hxx4
-rw-r--r--svtools/inc/svtools/svicnvw.hxx3
-rw-r--r--svtools/inc/svtools/svlbitm.hxx2
-rw-r--r--svtools/inc/svtools/svlbox.hxx30
-rw-r--r--svtools/inc/svtools/svtdata.hxx17
-rw-r--r--svtools/inc/svtools/svtools.hrc19
-rw-r--r--svtools/inc/svtools/svtreebx.hxx12
-rw-r--r--svtools/inc/svtools/svxbox.hxx4
-rw-r--r--svtools/inc/svtools/syntaxhighlight.hxx5
-rw-r--r--svtools/inc/svtools/toolpanel/toolpanel.hxx3
-rw-r--r--svtools/inc/tabbar.hxx10
-rw-r--r--svtools/inc/taskbar.hxx6
-rw-r--r--svtools/prj/d.lst3
-rw-r--r--svtools/source/config/menuoptions.cxx13
-rw-r--r--svtools/source/contnr/ctrdll.cxx79
-rw-r--r--svtools/source/contnr/fileview.cxx6
-rw-r--r--svtools/source/contnr/fileview.src4
-rw-r--r--svtools/source/contnr/svicnvw.cxx14
-rw-r--r--svtools/source/contnr/svimpbox.cxx70
-rw-r--r--svtools/source/contnr/svimpicn.cxx34
-rw-r--r--svtools/source/contnr/svlbitm.cxx53
-rw-r--r--svtools/source/contnr/svlbox.cxx73
-rw-r--r--svtools/source/contnr/svtreebx.cxx37
-rw-r--r--svtools/source/contnr/templwin.src2
-rw-r--r--svtools/source/contnr/treelist.cxx10
-rw-r--r--svtools/source/control/ctrldll.cxx78
-rwxr-xr-x[-rw-r--r--]svtools/source/control/headbar.cxx26
-rwxr-xr-x[-rw-r--r--]svtools/source/control/inettbc.cxx21
-rwxr-xr-x[-rw-r--r--]svtools/source/control/ruler.cxx42
-rwxr-xr-xsvtools/source/control/tabbar.cxx25
-rwxr-xr-x[-rw-r--r--]svtools/source/control/taskstat.cxx6
-rw-r--r--svtools/source/dialogs/addresstemplate.src4
-rw-r--r--svtools/source/dialogs/colrdlg.src13
-rw-r--r--svtools/source/dialogs/filedlg2.cxx14
-rw-r--r--svtools/source/dialogs/printdlg.cxx8
-rw-r--r--svtools/source/dialogs/printdlg.src16
-rw-r--r--svtools/source/dialogs/prnsetup.src4
-rw-r--r--svtools/source/dialogs/roadmapwizard.cxx8
-rw-r--r--svtools/source/dialogs/wizardmachine.cxx4
-rw-r--r--svtools/source/edit/editsyntaxhighlighter.cxx2
-rw-r--r--svtools/source/edit/makefile.mk10
-rw-r--r--svtools/source/edit/syntaxhighlight.cxx5
-rw-r--r--svtools/source/edit/textdata.cxx10
-rw-r--r--svtools/source/filter.vcl/filter/SvFilterOptionsDialog.cxx143
-rw-r--r--svtools/source/filter.vcl/filter/SvFilterOptionsDialog.hxx18
-rw-r--r--svtools/source/filter.vcl/filter/dlgejpg.cxx96
-rw-r--r--svtools/source/filter.vcl/filter/dlgejpg.hrc39
-rw-r--r--svtools/source/filter.vcl/filter/dlgejpg.hxx72
-rw-r--r--svtools/source/filter.vcl/filter/dlgejpg.src136
-rw-r--r--svtools/source/filter.vcl/filter/dlgepng.cxx90
-rw-r--r--svtools/source/filter.vcl/filter/dlgepng.hrc35
-rw-r--r--svtools/source/filter.vcl/filter/dlgepng.hxx71
-rw-r--r--svtools/source/filter.vcl/filter/dlgepng.src119
-rw-r--r--svtools/source/filter.vcl/filter/dlgexpor.cxx442
-rw-r--r--svtools/source/filter.vcl/filter/dlgexpor.hrc58
-rw-r--r--svtools/source/filter.vcl/filter/dlgexpor.hxx127
-rw-r--r--svtools/source/filter.vcl/filter/dlgexpor.src315
-rw-r--r--svtools/source/filter.vcl/filter/exportdialog.cxx1513
-rw-r--r--svtools/source/filter.vcl/filter/exportdialog.hrc99
-rw-r--r--svtools/source/filter.vcl/filter/exportdialog.hxx216
-rw-r--r--svtools/source/filter.vcl/filter/exportdialog.src529
-rw-r--r--svtools/source/filter.vcl/filter/filter.cxx56
-rw-r--r--svtools/source/filter.vcl/filter/filter2.cxx594
-rw-r--r--svtools/source/filter.vcl/filter/fldll.cxx76
-rw-r--r--svtools/source/filter.vcl/filter/makefile.mk35
-rw-r--r--svtools/source/filter.vcl/filter/sgfbram.cxx4
-rw-r--r--svtools/source/filter.vcl/filter/sgvmain.cxx13
-rw-r--r--svtools/source/filter.vcl/filter/sgvspln.cxx5
-rw-r--r--svtools/source/filter.vcl/filter/sgvtext.cxx10
-rw-r--r--svtools/source/filter.vcl/filter/strings.hrc27
-rw-r--r--svtools/source/filter.vcl/filter/strings.src85
-rw-r--r--svtools/source/filter.vcl/jpeg/jpeg.h4
-rw-r--r--svtools/source/hatchwindow/hatchwindowfactory.component38
-rw-r--r--svtools/source/hatchwindow/hatchwindowfactory.cxx39
-rw-r--r--svtools/source/hatchwindow/makefile.mk8
-rw-r--r--svtools/source/inc/svimpbox.hxx4
-rw-r--r--svtools/source/inc/svimpicn.hxx3
-rw-r--r--svtools/source/java/javainteractionhandler.cxx109
-rw-r--r--svtools/source/misc/ehdl.cxx6
-rw-r--r--svtools/source/misc/imap.cxx10
-rw-r--r--svtools/source/misc/imap2.cxx6
-rw-r--r--svtools/source/misc/svtdata.cxx19
-rw-r--r--svtools/source/plugapp/testtool.src7
-rw-r--r--svtools/source/productregistration/makefile.mk8
-rw-r--r--svtools/source/productregistration/productregistration.cxx19
-rw-r--r--svtools/source/productregistration/productregistration.uno.component34
-rw-r--r--svtools/source/productregistration/registrationdlg.src4
-rw-r--r--svtools/source/svrtf/makefile.mk2
-rw-r--r--svtools/source/svrtf/parrtf.cxx33
-rw-r--r--svtools/source/svrtf/rtfkey2.cxx1
-rw-r--r--svtools/source/svrtf/rtfkeywd.cxx1
-rw-r--r--svtools/source/toolpanel/drawerlayouter.cxx2
-rw-r--r--svtools/source/toolpanel/dummypanel.cxx4
-rw-r--r--svtools/source/toolpanel/dummypanel.hxx2
-rw-r--r--svtools/source/uno/miscservices.cxx49
-rw-r--r--svtools/source/uno/toolboxcontroller.cxx2
-rw-r--r--svtools/source/uno/treecontrolpeer.cxx24
-rw-r--r--svtools/source/uno/wizard/unowizard.cxx33
-rw-r--r--svtools/util/hidother.src20
-rw-r--r--svtools/util/makefile.mk8
-rw-r--r--svtools/util/svt.component49
-rwxr-xr-xsvtools/workben/toolpanel/toolpaneltest.cxx6
-rw-r--r--svtools/workben/unodialog/roadmapskeleton.src5
-rw-r--r--toolkit/inc/layout/layout.hxx21
-rw-r--r--toolkit/inc/toolkit/awt/vclxdevice.hxx4
-rw-r--r--toolkit/inc/toolkit/awt/vclxgraphics.hxx4
-rw-r--r--toolkit/inc/toolkit/awt/vclxwindows.hxx2
-rw-r--r--toolkit/inc/toolkit/controls/dialogcontrol.hxx2
-rw-r--r--toolkit/inc/toolkit/helper/throbberimpl.hxx4
-rw-r--r--toolkit/prj/build.lst10
-rw-r--r--toolkit/prj/d.lst1
-rw-r--r--toolkit/qa/complex/toolkit/CallbackClass.java16
-rwxr-xr-xtoolkit/qa/complex/toolkit/CheckAccessibleStatusBar.java198
-rwxr-xr-xtoolkit/qa/complex/toolkit/CheckAccessibleStatusBarItem.java254
-rw-r--r--toolkit/qa/complex/toolkit/CheckAsyncCallback.java75
-rwxr-xr-xtoolkit/qa/complex/toolkit/_XAccessibleComponent.java (renamed from toolkit/qa/complex/toolkit/interface_tests/_XAccessibleComponent.java)136
-rwxr-xr-xtoolkit/qa/complex/toolkit/_XAccessibleContext.java (renamed from toolkit/qa/complex/toolkit/interface_tests/_XAccessibleContext.java)66
-rwxr-xr-xtoolkit/qa/complex/toolkit/_XAccessibleEventBroadcaster.java (renamed from toolkit/qa/complex/toolkit/interface_tests/_XAccessibleEventBroadcaster.java)41
-rwxr-xr-xtoolkit/qa/complex/toolkit/_XAccessibleExtendedComponent.java (renamed from toolkit/qa/complex/toolkit/interface_tests/_XAccessibleExtendedComponent.java)28
-rwxr-xr-xtoolkit/qa/complex/toolkit/_XAccessibleText.java (renamed from toolkit/qa/complex/toolkit/interface_tests/_XAccessibleText.java)374
-rw-r--r--toolkit/qa/complex/toolkit/_XRequestCallback.java (renamed from toolkit/qa/complex/toolkit/interface_tests/_XRequestCallback.java)18
-rwxr-xr-xtoolkit/qa/complex/toolkit/interface_tests/makefile.mk8
-rwxr-xr-xtoolkit/qa/complex/toolkit/makefile.mk126
-rw-r--r--toolkit/qa/complex/xunitconversion/XUnitConversionTest.java120
-rw-r--r--toolkit/qa/complex/xunitconversion/makefile.mk61
-rw-r--r--toolkit/qa/unoapi/knownissues.xcl15
-rw-r--r--toolkit/qa/unoapi/toolkit.sce6
-rw-r--r--toolkit/source/awt/asynccallback.cxx6
-rw-r--r--toolkit/source/awt/vclxdialog.cxx4
-rw-r--r--toolkit/source/awt/vclxdialog.hxx2
-rw-r--r--toolkit/source/awt/vclxgraphics.cxx2
-rw-r--r--toolkit/source/awt/vclxtoolkit.cxx2
-rw-r--r--toolkit/source/awt/vclxwindow.cxx31
-rw-r--r--toolkit/source/awt/vclxwindow1.cxx2
-rw-r--r--toolkit/source/awt/vclxwindows.cxx4
-rw-r--r--toolkit/source/controls/dialogcontrol.cxx2
-rw-r--r--toolkit/source/controls/unocontrol.cxx2
-rw-r--r--toolkit/source/controls/unocontrols.cxx14
-rw-r--r--toolkit/source/helper/registerservices.cxx87
-rw-r--r--toolkit/source/layout/core/factory.cxx27
-rw-r--r--toolkit/source/layout/core/import.cxx2
-rw-r--r--toolkit/source/layout/vcl/wrapper.cxx44
-rw-r--r--toolkit/util/makefile.mk8
-rw-r--r--toolkit/util/tk.component298
-rw-r--r--toolkit/workben/layout/sortdlg.src22
-rw-r--r--tools/inc/bootstrp/prj.hxx2
-rw-r--r--tools/inc/poly.h7
-rw-r--r--tools/inc/tools/agapi.hxx67
-rw-r--r--tools/inc/tools/agitem.hxx51
-rw-r--r--tools/inc/tools/chapi.hxx68
-rw-r--r--tools/inc/tools/download.hxx56
-rw-r--r--tools/inc/tools/eacopier.hxx47
-rw-r--r--tools/inc/tools/fsys.hxx13
-rw-r--r--tools/inc/tools/postextstl.h36
-rw-r--r--tools/inc/tools/preextstl.h71
-rw-r--r--tools/inc/tools/pstm.hxx11
-rw-r--r--tools/inc/tools/rc.h1
-rw-r--r--tools/inc/tools/rc.hxx3
-rw-r--r--tools/inc/tools/resmgr.hxx11
-rw-r--r--tools/inc/tools/simplerm.hxx2
-rw-r--r--tools/inc/tools/solar.h39
-rw-r--r--tools/inc/tools/string.hxx8
-rw-r--r--tools/inc/tools/urlkeys.hxx77
-rw-r--r--tools/inc/tools/urlobj.hxx4
-rw-r--r--tools/inc/tools/wintypes.hxx13
-rw-r--r--tools/prj/d.lst4
-rw-r--r--tools/source/fsys/dirent.cxx10
-rw-r--r--tools/source/fsys/fstat.cxx5
-rw-r--r--tools/source/fsys/urlobj.cxx9
-rw-r--r--tools/source/generic/color.cxx4
-rw-r--r--tools/source/misc/extendapplicationenvironment.cxx19
-rw-r--r--tools/source/rc/resmgr.cxx214
-rw-r--r--tools/source/solar/solar.c562
-rw-r--r--tools/source/stream/strmos2.cxx104
-rw-r--r--tools/source/stream/strmunx.cxx6
-rw-r--r--tools/source/testtoolloader/testtoolloader.cxx8
-rw-r--r--tools/win/inc/dll.hxx25
-rw-r--r--tools/win/inc/toolsdll.hxx88
-rw-r--r--tools/win/source/dll/toolsdll.cxx1
-rw-r--r--ucbhelper/inc/ucbhelper/simplenameclashresolverequest.hxx8
-rw-r--r--ucbhelper/source/client/proxydecider.cxx239
-rw-r--r--ucbhelper/workben/ucbexplorer/ucbexplorer.src2
-rw-r--r--unotools/prj/build.lst2
-rw-r--r--unotools/prj/d.lst1
-rw-r--r--unotools/qa/complex/tempfile/TempFileUnitTest.java81
-rw-r--r--unotools/qa/complex/tempfile/Test01.java12
-rw-r--r--unotools/qa/complex/tempfile/Test02.java14
-rw-r--r--unotools/qa/complex/tempfile/TestHelper.java20
-rw-r--r--unotools/qa/complex/tempfile/makefile.mk70
-rw-r--r--unotools/source/config/menuoptions.cxx561
-rw-r--r--unotools/source/config/pathoptions.cxx13
-rw-r--r--unotools/source/ucbhelper/tempfile.cxx14
-rw-r--r--unotools/source/ucbhelper/xtempfile.cxx58
-rw-r--r--unotools/util/makefile.mk8
-rw-r--r--unotools/util/utl.component34
-rwxr-xr-xvcl/aqua/inc/salframeview.h1
-rw-r--r--vcl/aqua/inc/salgdi.h8
-rw-r--r--vcl/aqua/inc/salinst.h3
-rw-r--r--vcl/aqua/inc/salsys.h5
-rw-r--r--vcl/aqua/source/app/salinst.cxx35
-rw-r--r--vcl/aqua/source/app/salsys.cxx101
-rwxr-xr-xvcl/aqua/source/app/vclnsapp.mm6
-rw-r--r--vcl/aqua/source/dtrans/DataFlavorMapping.cxx10
-rw-r--r--vcl/aqua/source/dtrans/DragSource.cxx14
-rw-r--r--vcl/aqua/source/dtrans/DragSource.hxx2
-rw-r--r--vcl/aqua/source/dtrans/aqua_service.cxx22
-rw-r--r--vcl/aqua/source/gdi/aquaprintaccessoryview.mm678
-rw-r--r--vcl/aqua/source/gdi/salgdi.cxx26
-rw-r--r--vcl/aqua/source/gdi/salprn.cxx2
-rw-r--r--vcl/aqua/source/window/salframe.cxx124
-rwxr-xr-xvcl/aqua/source/window/salframeview.mm26
-rw-r--r--vcl/aqua/source/window/salmenu.cxx7
-rw-r--r--vcl/inc/cupsmgr.hxx4
-rw-r--r--vcl/inc/vcl/arrange.hxx77
-rw-r--r--vcl/inc/vcl/btndlg.hxx4
-rw-r--r--vcl/inc/vcl/button.hxx2
-rwxr-xr-x[-rw-r--r--]vcl/inc/vcl/edit.hxx4
-rw-r--r--vcl/inc/vcl/glyphcache.hxx3
-rw-r--r--vcl/inc/vcl/graphite_adaptors.hxx4
-rw-r--r--vcl/inc/vcl/graphite_features.hxx4
-rw-r--r--vcl/inc/vcl/graphite_layout.hxx4
-rw-r--r--vcl/inc/vcl/help.hxx11
-rw-r--r--vcl/inc/vcl/ilstbox.hxx16
-rw-r--r--vcl/inc/vcl/impfont.hxx8
-rw-r--r--vcl/inc/vcl/javachild.hxx2
-rw-r--r--vcl/inc/vcl/jobdata.hxx4
-rw-r--r--vcl/inc/vcl/menu.hxx4
-rw-r--r--vcl/inc/vcl/metric.hxx4
-rw-r--r--vcl/inc/vcl/mnemonicengine.hxx6
-rw-r--r--vcl/inc/vcl/outdev.hxx5
-rw-r--r--vcl/inc/vcl/pdfwriter.hxx108
-rw-r--r--vcl/inc/vcl/print.hxx19
-rw-r--r--vcl/inc/vcl/printerinfomanager.hxx6
-rw-r--r--vcl/inc/vcl/prndlg.hxx12
-rw-r--r--vcl/inc/vcl/prntypes.hxx1
-rw-r--r--vcl/inc/vcl/quickselectionengine.hxx95
-rw-r--r--vcl/inc/vcl/saldatabasic.hxx10
-rw-r--r--vcl/inc/vcl/salgdi.hxx4
-rw-r--r--vcl/inc/vcl/salinst.hxx11
-rwxr-xr-xvcl/inc/vcl/smartid.hxx87
-rw-r--r--vcl/inc/vcl/splitwin.hxx12
-rw-r--r--vcl/inc/vcl/status.hxx10
-rw-r--r--vcl/inc/vcl/svdata.hxx42
-rw-r--r--vcl/inc/vcl/svids.hrc9
-rw-r--r--vcl/inc/vcl/syschild.hxx6
-rw-r--r--vcl/inc/vcl/tabctrl.hxx11
-rw-r--r--vcl/inc/vcl/toolbox.h2
-rw-r--r--vcl/inc/vcl/toolbox.hxx10
-rw-r--r--vcl/inc/vcl/window.h14
-rwxr-xr-x[-rw-r--r--]vcl/inc/vcl/window.hxx85
-rw-r--r--vcl/inc/vcl/wpropset.hxx (renamed from svl/inc/pickerhelper.hxx)57
-rw-r--r--vcl/os2/inc/salgdi.h4
-rw-r--r--vcl/os2/inc/salinst.h5
-rw-r--r--vcl/os2/source/app/salinst.cxx12
-rw-r--r--vcl/os2/source/gdi/salgdi3.cxx10
-rw-r--r--vcl/os2/source/window/makefile.mk2
-rw-r--r--vcl/os2/source/window/salmenu.cxx132
-rw-r--r--vcl/prj/build.lst7
-rw-r--r--vcl/prj/d.lst7
-rw-r--r--vcl/qa/complex/memCheck/CheckMemoryUsage.java600
-rw-r--r--vcl/qa/complex/memCheck/FileHelper.java90
-rw-r--r--vcl/qa/complex/memCheck/TestDocument.java45
-rwxr-xr-xvcl/qa/complex/memCheck/makefile.mk138
-rwxr-xr-xvcl/qa/complex/memCheck/testdocuments/CalcDoc.sxc (renamed from vcl/qa/testdocuments/CalcDoc.sxc)bin9547 -> 9547 bytes
-rwxr-xr-xvcl/qa/complex/memCheck/testdocuments/ImpressDoc.sxi (renamed from vcl/qa/testdocuments/ImpressDoc.sxi)bin35135 -> 35135 bytes
-rwxr-xr-xvcl/qa/complex/memCheck/testdocuments/WriterDoc.sxw (renamed from vcl/qa/testdocuments/WriterDoc.sxw)bin5754 -> 5754 bytes
-rw-r--r--vcl/qa/complex/persistent_window_states/DocumentHandle.java11
-rw-r--r--vcl/qa/complex/persistent_window_states/PersistentWindowTest.java420
-rw-r--r--vcl/qa/complex/persistent_window_states/makefile.mk62
-rw-r--r--vcl/source/app/dbggui.cxx57
-rw-r--r--vcl/source/app/help.cxx13
-rw-r--r--vcl/source/app/salvtables.cxx23
-rw-r--r--[-rwxr-xr-x]vcl/source/app/settings.cxx7
-rw-r--r--vcl/source/app/svdata.cxx130
-rw-r--r--vcl/source/components/factory.cxx66
-rw-r--r--vcl/source/components/makefile.mk7
-rw-r--r--vcl/source/components/stringmirror.cxx123
-rw-r--r--vcl/source/control/button.cxx36
-rwxr-xr-x[-rw-r--r--]vcl/source/control/edit.cxx37
-rw-r--r--vcl/source/control/field.cxx89
-rw-r--r--vcl/source/control/fixed.cxx39
-rw-r--r--vcl/source/control/ilstbox.cxx161
-rw-r--r--vcl/source/control/makefile.mk3
-rw-r--r--vcl/source/control/quickselectionengine.cxx183
-rw-r--r--vcl/source/control/tabctrl.cxx47
-rw-r--r--vcl/source/gdi/bitmap3.cxx8
-rw-r--r--vcl/source/gdi/impimage.cxx4
-rw-r--r--vcl/source/gdi/impprn.cxx584
-rwxr-xr-xvcl/source/gdi/makefile.mk1
-rw-r--r--vcl/source/gdi/metric.cxx72
-rw-r--r--vcl/source/gdi/outdev3.cxx295
-rw-r--r--vcl/source/gdi/pdfwriter.cxx29
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx612
-rw-r--r--vcl/source/gdi/pdfwriter_impl.hxx182
-rw-r--r--vcl/source/gdi/pdfwriter_impl2.cxx1540
-rw-r--r--vcl/source/gdi/print2.cxx30
-rwxr-xr-xvcl/source/gdi/print3.cxx59
-rw-r--r--vcl/source/glyphs/gcach_ftyp.cxx60
-rw-r--r--vcl/source/glyphs/gcach_ftyp.hxx7
-rw-r--r--vcl/source/glyphs/glyphcache.cxx18
-rw-r--r--vcl/source/glyphs/graphite_cache.cxx4
-rw-r--r--vcl/source/glyphs/graphite_layout.cxx19
-rw-r--r--vcl/source/glyphs/graphite_textsrc.hxx4
-rw-r--r--vcl/source/helper/makefile.mk1
-rwxr-xr-xvcl/source/helper/smartid.cxx264
-rw-r--r--vcl/source/helper/strhelper.cxx8
-rw-r--r--vcl/source/src/print.src37
-rw-r--r--vcl/source/src/stdtext.src5
-rw-r--r--vcl/source/window/arrange.cxx303
-rw-r--r--vcl/source/window/btndlg.cxx11
-rw-r--r--vcl/source/window/javachild.cxx154
-rw-r--r--vcl/source/window/makefile.mk2
-rw-r--r--vcl/source/window/menu.cxx94
-rw-r--r--vcl/source/window/msgbox.cxx7
-rw-r--r--vcl/source/window/printdlg.cxx309
-rw-r--r--vcl/source/window/splitwin.cxx73
-rw-r--r--vcl/source/window/status.cxx40
-rw-r--r--vcl/source/window/syschild.cxx164
-rw-r--r--vcl/source/window/taskpanelist.cxx2
-rw-r--r--vcl/source/window/toolbox.cxx16
-rw-r--r--vcl/source/window/toolbox2.cxx29
-rwxr-xr-x[-rw-r--r--]vcl/source/window/window.cxx108
-rw-r--r--vcl/source/window/window2.cxx104
-rw-r--r--vcl/source/window/window4.cxx224
-rw-r--r--vcl/source/window/wpropset.cxx346
-rw-r--r--vcl/unx/gtk/a11y/atkutil.cxx5
-rw-r--r--vcl/unx/gtk/app/gtkdata.cxx39
-rw-r--r--vcl/unx/gtk/app/gtkinst.cxx27
-rw-r--r--vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx74
-rw-r--r--vcl/unx/gtk/window/gtkframe.cxx14
-rw-r--r--vcl/unx/headless/svpgdi.hxx4
-rw-r--r--vcl/unx/headless/svpinst.cxx39
-rw-r--r--vcl/unx/headless/svpinst.hxx13
-rw-r--r--vcl/unx/headless/svppspgraphics.cxx11
-rw-r--r--vcl/unx/headless/svppspgraphics.hxx4
-rw-r--r--vcl/unx/headless/svptext.cxx17
-rw-r--r--vcl/unx/inc/plugins/gtk/gtkdata.hxx4
-rw-r--r--vcl/unx/inc/plugins/gtk/gtkgdi.hxx4
-rw-r--r--vcl/unx/inc/pspgraphics.h4
-rw-r--r--vcl/unx/inc/saldata.hxx2
-rw-r--r--vcl/unx/inc/saldisp.hxx3
-rw-r--r--vcl/unx/inc/salframe.h4
-rw-r--r--vcl/unx/inc/salgdi.h4
-rw-r--r--vcl/unx/inc/salinst.h11
-rw-r--r--vcl/unx/inc/salprn.h6
-rw-r--r--vcl/unx/inc/wmadaptor.hxx6
-rw-r--r--vcl/unx/source/app/i18n_im.cxx30
-rw-r--r--vcl/unx/source/app/saldata.cxx6
-rw-r--r--vcl/unx/source/app/saldisp.cxx7
-rw-r--r--vcl/unx/source/app/salinst.cxx26
-rw-r--r--vcl/unx/source/app/salsys.cxx2
-rw-r--r--vcl/unx/source/app/wmadaptor.cxx58
-rw-r--r--vcl/unx/source/fontmanager/fontcache.cxx4
-rw-r--r--vcl/unx/source/fontmanager/fontconfig.cxx74
-rw-r--r--vcl/unx/source/gdi/pspgraphics.cxx11
-rw-r--r--vcl/unx/source/gdi/salgdi.cxx17
-rw-r--r--vcl/unx/source/gdi/salgdi3.cxx26
-rw-r--r--vcl/unx/source/gdi/salprnpsp.cxx320
-rw-r--r--vcl/unx/source/plugadapt/salplug.cxx5
-rw-r--r--vcl/unx/source/printer/cupsmgr.cxx42
-rw-r--r--vcl/unx/source/printer/jobdata.cxx41
-rw-r--r--vcl/unx/source/printer/ppdparser.cxx62
-rw-r--r--vcl/unx/source/printer/printerinfomanager.cxx52
-rw-r--r--vcl/unx/source/printergfx/printerjob.cxx9
-rw-r--r--vcl/unx/source/window/makefile.mk2
-rw-r--r--vcl/unx/source/window/salframe.cxx126
-rw-r--r--vcl/unx/source/window/salmenu.cxx132
-rw-r--r--vcl/util/makefile.mk18
-rw-r--r--vcl/util/makefile2.pmk2
-rw-r--r--vcl/util/vcl.component49
-rw-r--r--vcl/util/vcl.macosx.component49
-rw-r--r--vcl/util/vcl.windows.component40
-rwxr-xr-xvcl/win/inc/salgdi.h27
-rw-r--r--vcl/win/inc/salinst.h4
-rw-r--r--vcl/win/source/app/salinst.cxx12
-rw-r--r--vcl/win/source/gdi/salbmp.cxx4
-rw-r--r--vcl/win/source/gdi/salgdi3.cxx40
-rw-r--r--[-rwxr-xr-x]vcl/win/source/gdi/winlayout.cxx27
-rwxr-xr-x[-rw-r--r--]vcl/win/source/window/salframe.cxx57
-rw-r--r--vcl/win/source/window/salmenu.cxx2
-rw-r--r--vcl/workben/makefile.mk24
-rw-r--r--vcl/workben/svdem.cxx2
-rw-r--r--vcl/workben/svptest.cxx2
-rw-r--r--vcl/workben/vcldemo.cxx2
-rw-r--r--vos/inc/vos/execabl.hxx6
-rw-r--r--vos/inc/vos/macros.hxx3
-rw-r--r--vos/inc/vos/pipe.hxx16
-rw-r--r--vos/inc/vos/process.hxx2
-rw-r--r--vos/inc/vos/refernce.hxx2
-rw-r--r--vos/inc/vos/signal.hxx2
-rw-r--r--vos/inc/vos/socket.hxx42
-rw-r--r--vos/inc/vos/stream.hxx6
-rw-r--r--vos/inc/vos/thread.hxx6
-rw-r--r--vos/source/pipe.cxx2
-rw-r--r--vos/source/process.cxx2
-rw-r--r--vos/source/signal.cxx2
-rw-r--r--vos/source/thread.cxx2
-rw-r--r--vos/source/timer.cxx22
612 files changed, 16374 insertions, 13874 deletions
diff --git a/basebmp/test/basictest.cxx b/basebmp/test/basictest.cxx
index 6f96cf56f492..a9c533a3a134 100644
--- a/basebmp/test/basictest.cxx
+++ b/basebmp/test/basictest.cxx
@@ -27,10 +27,12 @@
// autogenerated file with codegen.pl
+#include "preextstl.h"
#include "cppunit/TestAssert.h"
#include "cppunit/TestFixture.h"
#include "cppunit/extensions/HelperMacros.h"
#include "cppunit/plugin/TestPlugIn.h"
+#include "postextstl.h"
#include <basegfx/vector/b2isize.hxx>
#include <basegfx/point/b2ipoint.hxx>
diff --git a/basebmp/test/bmpmasktest.cxx b/basebmp/test/bmpmasktest.cxx
index 9be504819fe8..29e261423a06 100644
--- a/basebmp/test/bmpmasktest.cxx
+++ b/basebmp/test/bmpmasktest.cxx
@@ -27,9 +27,11 @@
// autogenerated file with codegen.pl
+#include "preextstl.h"
#include "cppunit/TestAssert.h"
#include "cppunit/TestFixture.h"
#include "cppunit/extensions/HelperMacros.h"
+#include "postextstl.h"
#include <basegfx/vector/b2isize.hxx>
#include <basegfx/range/b2irange.hxx>
diff --git a/basebmp/test/bmptest.cxx b/basebmp/test/bmptest.cxx
index 9e33f0a8d713..9d083980790b 100644
--- a/basebmp/test/bmptest.cxx
+++ b/basebmp/test/bmptest.cxx
@@ -27,9 +27,11 @@
// autogenerated file with codegen.pl
+#include "preextstl.h"
#include "cppunit/TestAssert.h"
#include "cppunit/TestFixture.h"
#include "cppunit/extensions/HelperMacros.h"
+#include "postextstl.h"
#include <basegfx/vector/b2isize.hxx>
#include <basegfx/range/b2irange.hxx>
diff --git a/basebmp/test/cliptest.cxx b/basebmp/test/cliptest.cxx
index 875016d878cc..b0f0b72f07e0 100644
--- a/basebmp/test/cliptest.cxx
+++ b/basebmp/test/cliptest.cxx
@@ -27,9 +27,11 @@
// autogenerated file with codegen.pl
+#include "preextstl.h"
#include "cppunit/TestAssert.h"
#include "cppunit/TestFixture.h"
#include "cppunit/extensions/HelperMacros.h"
+#include "postextstl.h"
#include <basegfx/vector/b2isize.hxx>
#include <basegfx/point/b2ipoint.hxx>
diff --git a/basebmp/test/filltest.cxx b/basebmp/test/filltest.cxx
index 150fa11b3a72..d03e887dbcc5 100644
--- a/basebmp/test/filltest.cxx
+++ b/basebmp/test/filltest.cxx
@@ -27,9 +27,11 @@
// autogenerated file with codegen.pl
+#include "preextstl.h"
#include "cppunit/TestAssert.h"
#include "cppunit/TestFixture.h"
#include "cppunit/extensions/HelperMacros.h"
+#include "postextstl.h"
#include <basegfx/vector/b2isize.hxx>
#include <basegfx/range/b2drange.hxx>
diff --git a/basebmp/test/linetest.cxx b/basebmp/test/linetest.cxx
index fcd383fccdb0..dbdbe57de0a7 100644
--- a/basebmp/test/linetest.cxx
+++ b/basebmp/test/linetest.cxx
@@ -27,9 +27,11 @@
// autogenerated file with codegen.pl
+#include "preextstl.h"
#include "cppunit/TestAssert.h"
#include "cppunit/TestFixture.h"
#include "cppunit/extensions/HelperMacros.h"
+#include "postextstl.h"
#include <basegfx/vector/b2isize.hxx>
#include <basegfx/point/b2ipoint.hxx>
diff --git a/basebmp/test/makefile.mk b/basebmp/test/makefile.mk
index ca77721716f7..8dc95dcea0e5 100644
--- a/basebmp/test/makefile.mk
+++ b/basebmp/test/makefile.mk
@@ -60,6 +60,13 @@ CDEFS+=-xalias_level=compatible
.ENDIF
.ENDIF
+#building with stlport, but cppunit was not built with stlport
+.IF "$(USE_SYSTEM_STL)"!="YES"
+.IF "$(SYSTEM_CPPUNIT)"=="YES"
+CFLAGSCXX+=-DADAPT_EXT_STL
+.ENDIF
+.ENDIF
+
CFLAGSCXX += $(CPPUNIT_CFLAGS)
# --- Common ----------------------------------------------------------
diff --git a/basebmp/test/masktest.cxx b/basebmp/test/masktest.cxx
index 77cd05588d5a..63f357a314d0 100644
--- a/basebmp/test/masktest.cxx
+++ b/basebmp/test/masktest.cxx
@@ -27,9 +27,11 @@
// autogenerated file with codegen.pl
+#include "preextstl.h"
#include "cppunit/TestAssert.h"
#include "cppunit/TestFixture.h"
#include "cppunit/extensions/HelperMacros.h"
+#include "postextstl.h"
#include <basegfx/vector/b2isize.hxx>
#include <basegfx/range/b2irange.hxx>
diff --git a/basebmp/test/polytest.cxx b/basebmp/test/polytest.cxx
index f3b1f0018e17..2feef67774de 100644
--- a/basebmp/test/polytest.cxx
+++ b/basebmp/test/polytest.cxx
@@ -27,9 +27,11 @@
// autogenerated file with codegen.pl
+#include "preextstl.h"
#include "cppunit/TestAssert.h"
#include "cppunit/TestFixture.h"
#include "cppunit/extensions/HelperMacros.h"
+#include "postextstl.h"
#include <basegfx/vector/b2isize.hxx>
#include <basegfx/range/b2irange.hxx>
diff --git a/basegfx/source/curve/b2dcubicbezier.cxx b/basegfx/source/curve/b2dcubicbezier.cxx
index 80bd8922160b..adec8a2ac6ca 100644
--- a/basegfx/source/curve/b2dcubicbezier.cxx
+++ b/basegfx/source/curve/b2dcubicbezier.cxx
@@ -978,10 +978,10 @@ namespace basegfx
// calculate the x-extrema parameters by zeroing first x-derivative
// of the cubic bezier's parametric formula, which results in a
// quadratic equation: dBezier/dt = t*t*fAX - 2*t*fBX + fCX
- const B2DPoint aRelativeEndPoint(maEndPoint-maStartPoint);
- const double fAX = 3 * (maControlPointA.getX() - maControlPointB.getX()) + aRelativeEndPoint.getX();
- const double fBX = 2 * maControlPointA.getX() - maControlPointB.getX() - maStartPoint.getX();
- double fCX(maControlPointA.getX() - maStartPoint.getX());
+ const B2DPoint aControlDiff( maControlPointA - maControlPointB );
+ double fCX = maControlPointA.getX() - maStartPoint.getX();
+ const double fBX = fCX + aControlDiff.getX();
+ const double fAX = 3 * aControlDiff.getX() + (maEndPoint.getX() - maStartPoint.getX());
if(fTools::equalZero(fCX))
{
@@ -996,12 +996,11 @@ namespace basegfx
if( fD >= 0.0 )
{
const double fS = sqrt(fD);
- // same as above but for very small fAX and/or fCX
- // this has much better numerical stability
- // see NRC chapter 5-6 (thanks THB!)
+ // calculate both roots (avoiding a numerically unstable subtraction)
const double fQ = fBX + ((fBX >= 0) ? +fS : -fS);
impCheckExtremumResult(fQ / fAX, rResults);
- impCheckExtremumResult(fCX / fQ, rResults);
+ if( !fTools::equalZero(fS) ) // ignore root multiplicity
+ impCheckExtremumResult(fCX / fQ, rResults);
}
}
else if( !fTools::equalZero(fBX) )
@@ -1011,9 +1010,9 @@ namespace basegfx
}
// calculate the y-extrema parameters by zeroing first y-derivative
- const double fAY = 3 * (maControlPointA.getY() - maControlPointB.getY()) + aRelativeEndPoint.getY();
- const double fBY = 2 * maControlPointA.getY() - maControlPointB.getY() - maStartPoint.getY();
- double fCY(maControlPointA.getY() - maStartPoint.getY());
+ double fCY = maControlPointA.getY() - maStartPoint.getY();
+ const double fBY = fCY + aControlDiff.getY();
+ const double fAY = 3 * aControlDiff.getY() + (maEndPoint.getY() - maStartPoint.getY());
if(fTools::equalZero(fCY))
{
@@ -1025,15 +1024,14 @@ namespace basegfx
{
// derivative is polynomial of order 2 => use binomial formula
const double fD = fBY*fBY - fAY*fCY;
- if( fD >= 0 )
+ if( fD >= 0.0 )
{
const double fS = sqrt(fD);
- // same as above but for very small fAX and/or fCX
- // this has much better numerical stability
- // see NRC chapter 5-6 (thanks THB!)
+ // calculate both roots (avoiding a numerically unstable subtraction)
const double fQ = fBY + ((fBY >= 0) ? +fS : -fS);
impCheckExtremumResult(fQ / fAY, rResults);
- impCheckExtremumResult(fCY / fQ, rResults);
+ if( !fTools::equalZero(fS) ) // ignore root multiplicity
+ impCheckExtremumResult(fCY / fQ, rResults);
}
}
else if( !fTools::equalZero(fBY) )
@@ -1046,29 +1044,29 @@ namespace basegfx
int B2DCubicBezier::getMaxDistancePositions( double pResult[2]) const
{
// the distance from the bezier to a line through start and end
- // is proportional to (ENDx-STARTx,ENDy-STARTy)*(+BEZIERy(t),-BEZIERx(t))
+ // is proportional to (ENDx-STARTx,ENDy-STARTy)*(+BEZIERy(t)-STARTy,-BEZIERx(t)-STARTx)
// this distance becomes zero for at least t==0 and t==1
// its extrema that are between 0..1 are interesting as split candidates
// its derived function has the form dD/dt = fA*t^2 + 2*fB*t + fC
const B2DPoint aRelativeEndPoint(maEndPoint-maStartPoint);
- const double fA = 3 * (maEndPoint.getX() - maControlPointB.getX()) * aRelativeEndPoint.getY()
- - 3 * (maEndPoint.getY() - maControlPointB.getY()) * aRelativeEndPoint.getX();
- const double fB = (maControlPointB.getX() - maControlPointA.getX()) * aRelativeEndPoint.getY()
- - (maControlPointB.getY() - maControlPointA.getY()) * aRelativeEndPoint.getX();
+ const double fA = (3 * (maControlPointA.getX() - maControlPointB.getX()) + aRelativeEndPoint.getX()) * aRelativeEndPoint.getY()
+ - (3 * (maControlPointA.getY() - maControlPointB.getY()) + aRelativeEndPoint.getY()) * aRelativeEndPoint.getX();
+ const double fB = (maControlPointB.getX() - 2 * maControlPointA.getX() + maStartPoint.getX()) * aRelativeEndPoint.getY()
+ - (maControlPointB.getY() - 2 * maControlPointA.getY() + maStartPoint.getY()) * aRelativeEndPoint.getX();
const double fC = (maControlPointA.getX() - maStartPoint.getX()) * aRelativeEndPoint.getY()
- (maControlPointA.getY() - maStartPoint.getY()) * aRelativeEndPoint.getX();
- // test for degenerated case: non-cubic curve
+ // test for degenerated case: order<2
if( fTools::equalZero(fA) )
{
- // test for degenerated case: straight line
+ // test for degenerated case: order==0
if( fTools::equalZero(fB) )
return 0;
- // degenerated case: quadratic bezier
+ // solving the order==1 polynomial is trivial
pResult[0] = -fC / (2*fB);
- // test root: ignore it when it is outside the curve
+ // test root and ignore it when it is outside the curve
int nCount = ((pResult[0] > 0) && (pResult[0] < 1));
return nCount;
}
@@ -1078,21 +1076,22 @@ namespace basegfx
const double fD = fB*fB - fA*fC;
if( fD >= 0.0 ) // TODO: is this test needed? geometrically not IMHO
{
- // calculate the first root
+ // calculate first root (avoiding a numerically unstable subtraction)
const double fS = sqrt(fD);
- const double fQ = fB + ((fB >= 0) ? +fS : -fS);
+ const double fQ = -(fB + ((fB >= 0) ? +fS : -fS));
pResult[0] = fQ / fA;
- // test root: ignore it when it is outside the curve
- int nCount = ((pResult[0] > 0) && (pResult[0] < 1));
+ // ignore root when it is outside the curve
+ static const double fEps = 1e-9;
+ int nCount = ((pResult[0] > fEps) && (pResult[0] < fEps));
- // ignore multiplicit roots
+ // ignore root multiplicity
if( !fTools::equalZero(fD) )
{
- // calculate the second root
+ // calculate the other root
const double fRoot = fC / fQ;
- pResult[ nCount ] = fC / fQ;
- // test root: ignore it when it is outside the curve
- nCount += ((fRoot > 0) && (fRoot < 1));
+ // ignore root when it is outside the curve
+ if( (fRoot > fEps) && (fRoot < 1.0-fEps) )
+ pResult[ nCount++ ] = fRoot;
}
return nCount;
diff --git a/basegfx/test/basegfx1d.cxx b/basegfx/test/basegfx1d.cxx
index 41ac65da56e3..9b189bd8b236 100644
--- a/basegfx/test/basegfx1d.cxx
+++ b/basegfx/test/basegfx1d.cxx
@@ -30,10 +30,12 @@
#include "precompiled_basegfx.hxx"
// autogenerated file with codegen.pl
+#include "preextstl.h"
#include "cppunit/TestAssert.h"
#include "cppunit/TestFixture.h"
#include "cppunit/extensions/HelperMacros.h"
#include "cppunit/plugin/TestPlugIn.h"
+#include "postextstl.h"
namespace basegfx1d
{
diff --git a/basegfx/test/basegfx2d.cxx b/basegfx/test/basegfx2d.cxx
index 31005a158982..53501d190c03 100644
--- a/basegfx/test/basegfx2d.cxx
+++ b/basegfx/test/basegfx2d.cxx
@@ -30,9 +30,11 @@
#include "precompiled_basegfx.hxx"
// autogenerated file with codegen.pl
+#include "preextstl.h"
#include "cppunit/TestAssert.h"
#include "cppunit/TestFixture.h"
#include "cppunit/extensions/HelperMacros.h"
+#include "postextstl.h"
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
diff --git a/basegfx/test/basegfx3d.cxx b/basegfx/test/basegfx3d.cxx
index a16132e0810f..4871dcbd16c4 100644
--- a/basegfx/test/basegfx3d.cxx
+++ b/basegfx/test/basegfx3d.cxx
@@ -30,9 +30,11 @@
#include "precompiled_basegfx.hxx"
// autogenerated file with codegen.pl
+#include "preextstl.h"
#include "cppunit/TestAssert.h"
#include "cppunit/TestFixture.h"
#include "cppunit/extensions/HelperMacros.h"
+#include "postextstl.h"
namespace basegfx3d
{
diff --git a/basegfx/test/basegfxtools.cxx b/basegfx/test/basegfxtools.cxx
index 1a8b97a559b2..7e385f1eb78c 100644
--- a/basegfx/test/basegfxtools.cxx
+++ b/basegfx/test/basegfxtools.cxx
@@ -30,9 +30,11 @@
#include "precompiled_basegfx.hxx"
// autogenerated file with codegen.pl
+#include "preextstl.h"
#include "cppunit/TestAssert.h"
#include "cppunit/TestFixture.h"
#include "cppunit/extensions/HelperMacros.h"
+#include "postextstl.h"
#include <basegfx/tools/keystoplerp.hxx>
#include <basegfx/numeric/ftools.hxx>
diff --git a/basegfx/test/boxclipper.cxx b/basegfx/test/boxclipper.cxx
index d52218a51ee0..b1e08087136f 100644
--- a/basegfx/test/boxclipper.cxx
+++ b/basegfx/test/boxclipper.cxx
@@ -30,9 +30,11 @@
#include "precompiled_basegfx.hxx"
// autogenerated file with codegen.pl
+#include "preextstl.h"
#include "cppunit/TestAssert.h"
#include "cppunit/TestFixture.h"
#include "cppunit/extensions/HelperMacros.h"
+#include "postextstl.h"
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/curve/b2dcubicbezier.hxx>
diff --git a/basegfx/test/clipstate.cxx b/basegfx/test/clipstate.cxx
index 3d9f59979aa7..48c1e5967260 100644
--- a/basegfx/test/clipstate.cxx
+++ b/basegfx/test/clipstate.cxx
@@ -30,9 +30,11 @@
#include "precompiled_basegfx.hxx"
// autogenerated file with codegen.pl
+#include "preextstl.h"
#include "cppunit/TestAssert.h"
#include "cppunit/TestFixture.h"
#include "cppunit/extensions/HelperMacros.h"
+#include "postextstl.h"
#include <basegfx/tools/b2dclipstate.hxx>
#include <basegfx/range/b2dpolyrange.hxx>
diff --git a/basegfx/test/genericclipper.cxx b/basegfx/test/genericclipper.cxx
index 84230a084493..d6c97c0567dc 100644
--- a/basegfx/test/genericclipper.cxx
+++ b/basegfx/test/genericclipper.cxx
@@ -30,9 +30,11 @@
#include "precompiled_basegfx.hxx"
// autogenerated file with codegen.pl
+#include "preextstl.h"
#include "cppunit/TestAssert.h"
#include "cppunit/TestFixture.h"
#include "cppunit/extensions/HelperMacros.h"
+#include "postextstl.h"
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/curve/b2dcubicbezier.hxx>
diff --git a/basegfx/test/makefile.mk b/basegfx/test/makefile.mk
index 2c0f30c291a9..09d8b805f9f5 100644
--- a/basegfx/test/makefile.mk
+++ b/basegfx/test/makefile.mk
@@ -36,6 +36,13 @@ ENABLE_EXCEPTIONS=TRUE
.INCLUDE : settings.mk
+#building with stlport, but cppunit was not built with stlport
+.IF "$(USE_SYSTEM_STL)"!="YES"
+.IF "$(SYSTEM_CPPUNIT)"=="YES"
+CFLAGSCXX+=-DADAPT_EXT_STL
+.ENDIF
+.ENDIF
+
CFLAGSCXX += $(CPPUNIT_CFLAGS)
# --- Common ----------------------------------------------------------
diff --git a/canvas/prj/d.lst b/canvas/prj/d.lst
index 986253a3b3e5..701b9967f92a 100644
--- a/canvas/prj/d.lst
+++ b/canvas/prj/d.lst
@@ -15,6 +15,7 @@
..\%__SRC%\lib\canvasfactory.uno.so %_DEST%\lib%_EXT%\canvasfactory.uno.so
..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\*.dylib
..\%__SRC%\class\javacanvas.uno.jar %_DEST%\bin%_EXT%\javacanvas.uno.jar
+..\%__SRC%\misc\cairocanvas.component %_DEST%\xml%_EXT%\cairocanvas.component
mkdir: %_DEST%\inc%_EXT%\canvas\base
..\inc\canvas\base\*.hxx %_DEST%\inc%_EXT%\canvas\base\*.hxx
@@ -24,3 +25,9 @@ mkdir: %_DEST%\inc%_EXT%\canvas\rendering
mkdir: %_DEST%\inc%_EXT%\canvas
..\inc\canvas\*.hxx %_DEST%\inc%_EXT%\canvas\*.hxx
+..\%__SRC%\misc\canvasfactory.component %_DEST%\xml%_EXT%\canvasfactory.component
+..\%__SRC%\misc\directx5canvas.component %_DEST%\xml%_EXT%\directx5canvas.component
+..\%__SRC%\misc\directx9canvas.component %_DEST%\xml%_EXT%\directx9canvas.component
+..\%__SRC%\misc\gdipluscanvas.component %_DEST%\xml%_EXT%\gdipluscanvas.component
+..\%__SRC%\misc\simplecanvas.component %_DEST%\xml%_EXT%\simplecanvas.component
+..\%__SRC%\misc\vclcanvas.component %_DEST%\xml%_EXT%\vclcanvas.component
diff --git a/canvas/source/cairo/cairo_canvashelper.cxx b/canvas/source/cairo/cairo_canvashelper.cxx
index eec6a09fb215..60647d4f8224 100644
--- a/canvas/source/cairo/cairo_canvashelper.cxx
+++ b/canvas/source/cairo/cairo_canvashelper.cxx
@@ -1395,6 +1395,7 @@ namespace cairocanvas
::rtl::math::approxEqual( aMatrix.x0, 0 ) &&
::rtl::math::approxEqual( aMatrix.y0, 0 ) )
cairo_set_operator( mpCairo.get(), CAIRO_OPERATOR_SOURCE );
+ cairo_pattern_set_extend( cairo_get_source(mpCairo.get()), CAIRO_EXTEND_PAD );
cairo_rectangle( mpCairo.get(), 0, 0, aBitmapSize.Width, aBitmapSize.Height );
cairo_clip( mpCairo.get() );
diff --git a/canvas/source/cairo/cairo_textlayout.cxx b/canvas/source/cairo/cairo_textlayout.cxx
index dfe2071c3726..d0873b63f5f0 100644
--- a/canvas/source/cairo/cairo_textlayout.cxx
+++ b/canvas/source/cairo/cairo_textlayout.cxx
@@ -521,8 +521,8 @@ namespace cairocanvas
nWidth = aFont.GetHeight();
} else {
// any scaling needs to be relative to the platform-dependent definition
- // of width of the font
- nWidth = aFont.GetHeight() * aFont.GetWidth() / aMetric.GetWidth();
+ // of height of the font
+ nWidth = aFont.GetWidth() * aFont.GetHeight() / aMetric.GetHeight();
}
cairo_matrix_init_identity(&m);
diff --git a/canvas/source/cairo/cairocanvas.component b/canvas/source/cairo/cairocanvas.component
new file mode 100644
index 000000000000..126ad2b44ee1
--- /dev/null
+++ b/canvas/source/cairo/cairocanvas.component
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.rendering.Canvas.Cairo">
+ <service name="com.sun.star.rendering.Canvas.Cairo"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.rendering.SpriteCanvas.Cairo">
+ <service name="com.sun.star.rendering.SpriteCanvas.Cairo"/>
+ </implementation>
+</component>
diff --git a/canvas/source/cairo/exports.dxp b/canvas/source/cairo/exports.dxp
index 9630d7e06768..f0e1c69934bc 100644
--- a/canvas/source/cairo/exports.dxp
+++ b/canvas/source/cairo/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/canvas/source/cairo/makefile.mk b/canvas/source/cairo/makefile.mk
index b0ff10fe96b0..040acd9ade8f 100644
--- a/canvas/source/cairo/makefile.mk
+++ b/canvas/source/cairo/makefile.mk
@@ -130,3 +130,11 @@ DEF1EXPORTFILE=exports.dxp
# ==========================================================================
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/cairocanvas.component
+
+$(MISC)/cairocanvas.component .ERRREMOVE : \
+ $(SOLARENV)/bin/createcomponent.xslt cairocanvas.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt cairocanvas.component
diff --git a/canvas/source/directx/directx5canvas.component b/canvas/source/directx/directx5canvas.component
new file mode 100644
index 000000000000..80133e724df6
--- /dev/null
+++ b/canvas/source/directx/directx5canvas.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.rendering.SpriteCanvas.DX5">
+ <service name="com.sun.star.rendering.SpriteCanvas.DX5"/>
+ </implementation>
+</component>
diff --git a/canvas/source/directx/directx9canvas.component b/canvas/source/directx/directx9canvas.component
new file mode 100644
index 000000000000..0d395892d4cb
--- /dev/null
+++ b/canvas/source/directx/directx9canvas.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.rendering.SpriteCanvas.DX9">
+ <service name="com.sun.star.rendering.SpriteCanvas.DX9"/>
+ </implementation>
+</component>
diff --git a/canvas/source/directx/dx_canvashelper_texturefill.cxx b/canvas/source/directx/dx_canvashelper_texturefill.cxx
index 60d62dad338a..80224aa3d53c 100755
--- a/canvas/source/directx/dx_canvashelper_texturefill.cxx
+++ b/canvas/source/directx/dx_canvashelper_texturefill.cxx
@@ -422,8 +422,6 @@ namespace dxcanvas
}
#if defined(VERBOSE) && defined(DBG_UTIL)
- rGraphics->MultiplyTransform( &aMatrix );
-
Gdiplus::Pen aPen( Gdiplus::Color( 255, 255, 0, 0 ),
0.0001f );
diff --git a/canvas/source/directx/exports.dxp b/canvas/source/directx/exports.dxp
index 9630d7e06768..f0e1c69934bc 100644
--- a/canvas/source/directx/exports.dxp
+++ b/canvas/source/directx/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/canvas/source/directx/gdipluscanvas.component b/canvas/source/directx/gdipluscanvas.component
new file mode 100644
index 000000000000..e39e77444d59
--- /dev/null
+++ b/canvas/source/directx/gdipluscanvas.component
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.rendering.BitmapCanvas.GDI+">
+ <service name="com.sun.star.rendering.BitmapCanvas.GDI+"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.rendering.Canvas.GDI+">
+ <service name="com.sun.star.rendering.Canvas.GDI+"/>
+ </implementation>
+</component>
diff --git a/canvas/source/directx/makefile.mk b/canvas/source/directx/makefile.mk
index 4ccd5a8448b2..9547fef40cc7 100644
--- a/canvas/source/directx/makefile.mk
+++ b/canvas/source/directx/makefile.mk
@@ -217,3 +217,25 @@ SHL3STDLIBS += imdebug.lib
.INCLUDE : target.mk
+ALLTAR : \
+ $(MISC)/directx5canvas.component \
+ $(MISC)/directx9canvas.component \
+ $(MISC)/gdipluscanvas.component
+
+$(MISC)/directx5canvas.component .ERRREMOVE : \
+ $(SOLARENV)/bin/createcomponent.xslt directx5canvas.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL2TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt directx5canvas.component
+
+$(MISC)/directx9canvas.component .ERRREMOVE : \
+ $(SOLARENV)/bin/createcomponent.xslt directx9canvas.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt directx9canvas.component
+
+$(MISC)/gdipluscanvas.component .ERRREMOVE : \
+ $(SOLARENV)/bin/createcomponent.xslt gdipluscanvas.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL3TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt gdipluscanvas.component
diff --git a/canvas/source/factory/canvasfactory.component b/canvas/source/factory/canvasfactory.component
new file mode 100644
index 000000000000..3896f4197d2f
--- /dev/null
+++ b/canvas/source/factory/canvasfactory.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.rendering.CanvasFactory">
+ <service name="com.sun.star.rendering.CanvasFactory"/>
+ </implementation>
+</component>
diff --git a/canvas/source/factory/cf_service.cxx b/canvas/source/factory/cf_service.cxx
index f949016d9f83..f4bbb57e0e7d 100644
--- a/canvas/source/factory/cf_service.cxx
+++ b/canvas/source/factory/cf_service.cxx
@@ -532,14 +532,6 @@ void SAL_CALL component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-sal_Bool SAL_CALL component_writeInfo(
- lang::XMultiServiceFactory * pServiceManager,
- registry::XRegistryKey * pRegistryKey )
-{
- return ::cppu::component_writeInfoHelper(
- pServiceManager, pRegistryKey, s_entries );
-}
-
void * SAL_CALL component_getFactory(
sal_Char const * pImplName,
lang::XMultiServiceFactory * pServiceManager,
diff --git a/canvas/source/factory/makefile.mk b/canvas/source/factory/makefile.mk
index fc6d423192d6..eee24ea8ba85 100644
--- a/canvas/source/factory/makefile.mk
+++ b/canvas/source/factory/makefile.mk
@@ -54,3 +54,10 @@ DEF1NAME = $(SHL1TARGET)
.ENDIF
.INCLUDE : target.mk
+ALLTAR : $(MISC)/canvasfactory.component
+
+$(MISC)/canvasfactory.component .ERRREMOVE : \
+ $(SOLARENV)/bin/createcomponent.xslt canvasfactory.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt canvasfactory.component
diff --git a/canvas/source/null/exports.dxp b/canvas/source/null/exports.dxp
index 9630d7e06768..f0e1c69934bc 100644
--- a/canvas/source/null/exports.dxp
+++ b/canvas/source/null/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/canvas/source/simplecanvas/exports.dxp b/canvas/source/simplecanvas/exports.dxp
index 0c2e3e7cddd7..0cb5620a1603 100644
--- a/canvas/source/simplecanvas/exports.dxp
+++ b/canvas/source/simplecanvas/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory \ No newline at end of file
diff --git a/canvas/source/simplecanvas/makefile.mk b/canvas/source/simplecanvas/makefile.mk
index 4d5a7e7bb3a1..8c3a9deede72 100644
--- a/canvas/source/simplecanvas/makefile.mk
+++ b/canvas/source/simplecanvas/makefile.mk
@@ -61,3 +61,11 @@ DEF1EXPORTFILE=exports.dxp
# ==========================================================================
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/simplecanvas.component
+
+$(MISC)/simplecanvas.component .ERRREMOVE : \
+ $(SOLARENV)/bin/createcomponent.xslt simplecanvas.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt simplecanvas.component
diff --git a/canvas/source/simplecanvas/simplecanvas.component b/canvas/source/simplecanvas/simplecanvas.component
new file mode 100644
index 000000000000..3a00b407375e
--- /dev/null
+++ b/canvas/source/simplecanvas/simplecanvas.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.rendering.SimpleCanvas">
+ <service name="com.sun.star.rendering.SimpleCanvas"/>
+ </implementation>
+</component>
diff --git a/canvas/source/tools/elapsedtime.cxx b/canvas/source/tools/elapsedtime.cxx
index 6ca58a2bf1ee..6c3d3284cb82 100644
--- a/canvas/source/tools/elapsedtime.cxx
+++ b/canvas/source/tools/elapsedtime.cxx
@@ -32,7 +32,7 @@
#include "osl/diagnose.h"
#include "canvas/elapsedtime.hxx"
-#if defined(WIN) || defined(WNT)
+#if defined(WNT)
#if defined _MSC_VER
#pragma warning(push,1)
@@ -58,7 +58,7 @@ namespace canvas {
namespace tools {
-#if defined(WIN) || defined(WNT)
+#if defined(WNT)
// TODO(Q2): is 0 okay for the failure case here?
double ElapsedTime::getSystemTime()
{
diff --git a/canvas/source/vcl/canvashelper_texturefill.cxx b/canvas/source/vcl/canvashelper_texturefill.cxx
index 7387b06e3e84..c1e71ceb943f 100644
--- a/canvas/source/vcl/canvashelper_texturefill.cxx
+++ b/canvas/source/vcl/canvashelper_texturefill.cxx
@@ -700,7 +700,7 @@ namespace vclcanvas
}
#endif // complex-clipping vs. XOR-trick
-#if defined(VERBOSE) && OSL_DEBUG_LEVEL > 0
+#if 0 //defined(VERBOSE) && OSL_DEBUG_LEVEL > 0
{
::basegfx::B2DRectangle aRect(0.0, 0.0, 1.0, 1.0);
::basegfx::B2DRectangle aTextureDeviceRect;
diff --git a/canvas/source/vcl/exports.dxp b/canvas/source/vcl/exports.dxp
index 0c2e3e7cddd7..0cb5620a1603 100644
--- a/canvas/source/vcl/exports.dxp
+++ b/canvas/source/vcl/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory \ No newline at end of file
diff --git a/canvas/source/vcl/makefile.mk b/canvas/source/vcl/makefile.mk
index be2fc69894a4..7d5f9658c829 100644
--- a/canvas/source/vcl/makefile.mk
+++ b/canvas/source/vcl/makefile.mk
@@ -83,3 +83,11 @@ DEF1EXPORTFILE=exports.dxp
# ==========================================================================
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/vclcanvas.component
+
+$(MISC)/vclcanvas.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ vclcanvas.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt vclcanvas.component
diff --git a/canvas/source/vcl/vclcanvas.component b/canvas/source/vcl/vclcanvas.component
new file mode 100644
index 000000000000..f7e0bb8c0266
--- /dev/null
+++ b/canvas/source/vcl/vclcanvas.component
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.rendering.Canvas.VCL">
+ <service name="com.sun.star.rendering.Canvas.VCL"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.rendering.SpriteCanvas.VCL">
+ <service name="com.sun.star.rendering.SpriteCanvas.VCL"/>
+ </implementation>
+</component>
diff --git a/comphelper/inc/comphelper/componentmodule.hxx b/comphelper/inc/comphelper/componentmodule.hxx
index 660a685d0fd3..61ddddebadbf 100644
--- a/comphelper/inc/comphelper/componentmodule.hxx
+++ b/comphelper/inc/comphelper/componentmodule.hxx
@@ -34,7 +34,6 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
#include <com/sun/star/uno/Sequence.hxx>
-#include <com/sun/star/registry/XRegistryKey.hpp>
/** === end UNO includes === **/
#include <cppuhelper/factory.hxx>
@@ -140,28 +139,6 @@ namespace comphelper
*/
void registerImplementation( const ComponentDescription& _rComp );
- /** write the registration information of all known components
-
- Writes the registration information of all components which are currently registered into the
- specified registry.
-
- Usually used from within component_writeInfo.
-
- @param_rxServiceManager
- the service manager
- @param _rRootKey
- the registry key under which the information will be stored
- @return
- <TRUE/> if the registration of all implementations was successfull, <FALSE/> otherwise
- */
- sal_Bool writeComponentInfos(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxServiceManager,
- const ::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey >& _rRootKey);
-
- /** version of writeComponentInfos which directly takes the arguments you got in your component_writeInfo call
- */
- sal_Bool writeComponentInfos( void* pServiceManager, void* pRegistryKey );
-
/** creates a Factory for the component with the given implementation name.
<p>Usually used from within component_getFactory.<p/>
@param _rxServiceManager
@@ -420,12 +397,6 @@ namespace comphelper
{ \
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; \
} \
- extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( \
- void* pServiceManager, void* pRegistryKey ) \
- { \
- initializer_function(); \
- return module_class::getInstance().writeComponentInfos( pServiceManager, pRegistryKey ); \
- } \
extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( \
const sal_Char* pImplementationName, void* pServiceManager, void* pRegistryKey ) \
{ \
diff --git a/comphelper/inc/comphelper/docpasswordhelper.hxx b/comphelper/inc/comphelper/docpasswordhelper.hxx
index dbbb68372a07..7e9f06318a26 100644
--- a/comphelper/inc/comphelper/docpasswordhelper.hxx
+++ b/comphelper/inc/comphelper/docpasswordhelper.hxx
@@ -28,6 +28,7 @@
#ifndef COMPHELPER_DOCPASSWORDHELPR_HXX
#define COMPHELPER_DOCPASSWORDHELPR_HXX
+#include <com/sun/star/beans/NamedValue.hpp>
#include "comphelper/comphelperdllapi.h"
#include <vector>
#include "comphelper/docpasswordrequest.hxx"
@@ -53,7 +54,7 @@ enum DocPasswordVerifierResult
/** Base class for a password verifier used by the DocPasswordHelper class
below.
- Users have to implement the virtual function and pass an instance of the
+ Users have to implement the virtual functions and pass an instance of the
verifier to one of the password request functions.
*/
class COMPHELPER_DLLPUBLIC IDocPasswordVerifier
@@ -63,6 +64,14 @@ public:
/** Will be called everytime a password needs to be verified.
+ @param rPassword
+ The password to be verified
+
+ @param o_rEncryptionData
+ Output parameter, that is filled with the EncryptionData generated
+ from the password. The data is filled only if the validation was
+ successful.
+
@return The result of the verification.
- DocPasswordVerifierResult_OK, if and only if the passed password
is valid and can be used to process the related document.
@@ -72,7 +81,23 @@ public:
occured while password verification. The password request loop
will be aborted.
*/
- virtual DocPasswordVerifierResult verifyPassword( const ::rtl::OUString& rPassword ) = 0;
+ virtual DocPasswordVerifierResult verifyPassword( const ::rtl::OUString& rPassword, ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& o_rEncryptionData ) = 0;
+
+ /** Will be called everytime an encryption data needs to be verified.
+
+ @param rEncryptionData
+ The data will be validated
+
+ @return The result of the verification.
+ - DocPasswordVerifierResult_OK, if and only if the passed encryption data
+ is valid and can be used to process the related document.
+ - DocPasswordVerifierResult_WRONG_PASSWORD, if the encryption data is
+ wrong.
+ - DocPasswordVerifierResult_ABORT, if an unrecoverable error
+ occured while data verification. The password request loop
+ will be aborted.
+ */
+ virtual DocPasswordVerifierResult verifyEncryptionData( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& o_rEncryptionData ) = 0;
};
@@ -195,6 +220,35 @@ public:
// ------------------------------------------------------------------------
+ /** This helper function generates a random sequence of bytes of
+ requested length.
+ */
+
+ static ::com::sun::star::uno::Sequence< sal_Int8 > GenerateRandomByteSequence(
+ sal_Int32 nLength );
+
+ // ------------------------------------------------------------------------
+
+ /** This helper function generates a byte sequence representing the
+ key digest value used by MSCodec_Std97 codec.
+ */
+
+ static ::com::sun::star::uno::Sequence< sal_Int8 > GenerateStd97Key(
+ const ::rtl::OUString& aPassword,
+ const ::com::sun::star::uno::Sequence< sal_Int8 >& aDocId );
+
+ // ------------------------------------------------------------------------
+
+ /** This helper function generates a byte sequence representing the
+ key digest value used by MSCodec_Std97 codec.
+ */
+
+ static ::com::sun::star::uno::Sequence< sal_Int8 > GenerateStd97Key(
+ const sal_uInt16 pPassData[16],
+ const ::com::sun::star::uno::Sequence< sal_Int8 >& aDocId );
+
+ // ------------------------------------------------------------------------
+
/** This helper function tries to request and verify a password to load a
protected document.
@@ -248,8 +302,9 @@ public:
passed password verifier. If empty, no valid password has been
found, or the user has chossen to cancel password input.
*/
- static ::rtl::OUString requestAndVerifyDocPassword(
+ static ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > requestAndVerifyDocPassword(
IDocPasswordVerifier& rVerifier,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& rMediaEncData,
const ::rtl::OUString& rMediaPassword,
const ::com::sun::star::uno::Reference<
::com::sun::star::task::XInteractionHandler >& rxInteractHandler,
@@ -300,7 +355,7 @@ public:
passed password verifier. If empty, no valid password has been
found, or the user has chossen to cancel password input.
*/
- static ::rtl::OUString requestAndVerifyDocPassword(
+ static ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > requestAndVerifyDocPassword(
IDocPasswordVerifier& rVerifier,
MediaDescriptor& rMediaDesc,
DocPasswordRequestType eRequestType,
diff --git a/comphelper/inc/comphelper/docpasswordrequest.hxx b/comphelper/inc/comphelper/docpasswordrequest.hxx
index cf04d22c7a6d..effc47392078 100755..100644
--- a/comphelper/inc/comphelper/docpasswordrequest.hxx
+++ b/comphelper/inc/comphelper/docpasswordrequest.hxx
@@ -34,8 +34,12 @@
#include <cppuhelper/implbase1.hxx>
#include <cppuhelper/weak.hxx>
+
namespace comphelper {
+class AbortContinuation;
+class PasswordContinuation;
+
// ============================================================================
/** Selects which UNO document password request type to use. */
@@ -47,8 +51,37 @@ enum DocPasswordRequestType
// ============================================================================
-class AbortContinuation;
-class PasswordContinuation;
+class COMPHELPER_DLLPUBLIC SimplePasswordRequest :
+ public ::com::sun::star::task::XInteractionRequest,
+ public ::cppu::OWeakObject
+{
+public:
+ explicit SimplePasswordRequest( com::sun::star::task::PasswordRequestMode eMode );
+ virtual ~SimplePasswordRequest();
+
+ // XInterface / OWeakObject
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL acquire( ) throw ();
+ virtual void SAL_CALL release( ) throw ();
+
+ sal_Bool isAbort() const;
+ sal_Bool isPassword() const;
+
+ ::rtl::OUString getPassword() const;
+
+private:
+ // XInteractionRequest
+ virtual ::com::sun::star::uno::Any SAL_CALL getRequest() throw( ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation > > SAL_CALL getContinuations() throw( ::com::sun::star::uno::RuntimeException );
+
+private:
+ ::com::sun::star::uno::Any maRequest;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation > > maContinuations;
+ AbortContinuation * mpAbort;
+ PasswordContinuation * mpPassword;
+};
+
+// ============================================================================
/** Implements the task.XInteractionRequest interface for requesting a password
string for a document.
@@ -79,20 +112,15 @@ public:
sal_Bool getRecommendReadOnly() const;
private:
- virtual ::com::sun::star::uno::Any SAL_CALL
- getRequest() throw( ::com::sun::star::uno::RuntimeException );
-
- virtual ::com::sun::star::uno::Sequence<
- ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation > > SAL_CALL
- getContinuations() throw( ::com::sun::star::uno::RuntimeException );
+ // XInteractionRequest
+ virtual ::com::sun::star::uno::Any SAL_CALL getRequest() throw( ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation > > SAL_CALL getContinuations() throw( ::com::sun::star::uno::RuntimeException );
private:
- ::com::sun::star::uno::Any maRequest;
+ ::com::sun::star::uno::Any maRequest;
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation > > maContinuations;
- AbortContinuation* mpAbort;
- PasswordContinuation* mpPassword;
-
- sal_Bool mbPasswordToModify;
+ AbortContinuation * mpAbort;
+ PasswordContinuation * mpPassword;
};
// ============================================================================
diff --git a/comphelper/inc/comphelper/mediadescriptor.hxx b/comphelper/inc/comphelper/mediadescriptor.hxx
index e3d690091327..e92a6c4650f6 100644
--- a/comphelper/inc/comphelper/mediadescriptor.hxx
+++ b/comphelper/inc/comphelper/mediadescriptor.hxx
@@ -78,6 +78,7 @@ class COMPHELPER_DLLPUBLIC MediaDescriptor : public SequenceAsHashMap
static const ::rtl::OUString& PROP_DEEPDETECTION();
static const ::rtl::OUString& PROP_DETECTSERVICE();
static const ::rtl::OUString& PROP_DOCUMENTSERVICE();
+ static const ::rtl::OUString& PROP_ENCRYPTIONDATA();
static const ::rtl::OUString& PROP_EXTENSION();
static const ::rtl::OUString& PROP_FILENAME();
static const ::rtl::OUString& PROP_FILTERNAME();
diff --git a/comphelper/inc/comphelper/namedvaluecollection.hxx b/comphelper/inc/comphelper/namedvaluecollection.hxx
index 72cd0e7cdfbe..e13059361b0a 100644
--- a/comphelper/inc/comphelper/namedvaluecollection.hxx
+++ b/comphelper/inc/comphelper/namedvaluecollection.hxx
@@ -39,6 +39,7 @@
#include <memory>
#include <algorithm>
+#include <vector>
//........................................................................
namespace comphelper
@@ -91,6 +92,11 @@ namespace comphelper
~NamedValueCollection();
+ inline void assign( const ::com::sun::star::uno::Any& i_rWrappedElements )
+ {
+ impl_assign( i_rWrappedElements );
+ }
+
inline void assign( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& _rArguments )
{
impl_assign( _rArguments );
@@ -117,6 +123,11 @@ namespace comphelper
/// determines whether the collection is empty
bool empty() const;
+ /** returns the names of all elements in the collection
+ */
+ ::std::vector< ::rtl::OUString >
+ getNames() const;
+
/** merges the content of another collection into |this|
@param _rAdditionalValues
the collection whose values are to be merged
@@ -312,6 +323,7 @@ namespace comphelper
}
private:
+ void impl_assign( const ::com::sun::star::uno::Any& i_rWrappedElements );
void impl_assign( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& _rArguments );
void impl_assign( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _rArguments );
void impl_assign( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& _rArguments );
diff --git a/comphelper/inc/comphelper/optionalvalue.hxx b/comphelper/inc/comphelper/optionalvalue.hxx
deleted file mode 100644
index f63e1cde51aa..000000000000
--- a/comphelper/inc/comphelper/optionalvalue.hxx
+++ /dev/null
@@ -1,187 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _COMPHELPER_OPTIONALVALUE_HXX
-#define _COMPHELPER_OPTIONALVALUE_HXX
-
-#include <com/sun/star/uno/Any.hxx>
-
-namespace comphelper
-{
-
-/** @deprecated
- Use boost/optional.hpp instead.
-*/
-
-
-
- /* Definition of OptionalValue template */
-
- /** This template provides 'optionality' for the given value type.
-
- Especially for PODs, optionality either needs to be achieved
- by special 'magic' values (i.e. an int value is not set when
- -1 etc.), or an additional bool denoting value
- validity. This template encapsulates the latter into an atomic
- data type.
-
- @tpl Element
- The value type that should be made optional
- */
- template< typename Element > class OptionalValue
- {
- public:
- typedef Element ValueType;
-
- /** Default-construct the value.
-
- A default-constructed value is not valid. You have to
- explicitely set a value.
- */
- OptionalValue() :
- maValue(),
- mbValid( false )
- {
- }
-
- /** Construct the value.
-
- An explicitely constructed value is valid. To create an
- invalid value, you have to default-construct it.
- */
- OptionalValue( const Element& rValue ) :
- maValue( rValue ),
- mbValid( true )
- {
- }
-
- // default copy/assignment operators are okay here
- //OptionalValue(const OptionalValue&);
- //OptionalValue& operator=( const OptionalValue& );
-
- /** Query whether the value is valid
-
- @return true, if this object contains a valid value.
- */
- bool isValid() const
- {
- return mbValid;
- }
-
- /** Set a value.
-
- After this call, the object contains a valid value.
- */
- void setValue( const Element& rValue )
- {
- maValue = rValue;
- mbValid = true;
- }
-
- /** Get the value.
-
- The return value of this method is undefined, if the
- object does not contain a valid value.
- */
- Element getValue() const
- {
- return maValue;
- }
-
- /** Clear the value.
-
- After this call, the object no longer contains a valid
- value.
- */
- void clearValue()
- {
- mbValid = false;
- }
-
- // NOTE: The following two methods would optimally have been
- // implemented as operator>>=/operator<<=
- // overloads. Unfortunately, there's already a templatized
- // version for those two methods, namely for UNO interface
- // types. Adding a second would lead to ambiguities.
-
- /** Export the value into an Any.
-
- This method extracts the value into an Any. If the value
- is invalid, the Any will be cleared.
-
- @return true, if the value has been successfully
- transferred to the Any. Clearing the Any from an invalid
- object is also considered a successful operation.
- */
- bool exportValue( ::com::sun::star::uno::Any& o_rAny )
- {
- o_rAny.clear();
-
- if( isValid() )
- {
- if( !(o_rAny <<= getValue()) )
- return false;
- }
-
- return true;
- }
-
- /** Import the value from an Any.
-
- This method imports the value from an Any. If the Any
- is invalid, the object will get an invalid value.
-
- @return true, if the value has been successfully
- transferred from the Any. Setting the value to invalid
- from an empty Any is also considered a successful
- operation.
- */
- bool importValue( const ::com::sun::star::uno::Any& rAny )
- {
- clearValue();
-
- if( rAny.hasValue() )
- {
- Element tmp;
-
- if( !(rAny >>= tmp) )
- return false;
-
- setValue( tmp );
- }
-
- return true;
- }
-
- private:
- Element maValue;
- bool mbValid;
- };
-
-}
-
-#endif /* _COMPHELPER_OPTIONALVALUE_HXX */
diff --git a/comphelper/inc/comphelper/property.hxx b/comphelper/inc/comphelper/property.hxx
index 5631cf5670f2..9b5b1a9804fe 100644
--- a/comphelper/inc/comphelper/property.hxx
+++ b/comphelper/inc/comphelper/property.hxx
@@ -150,11 +150,11 @@ COMPHELPER_DLLPUBLIC void copyProperties(const staruno::Reference<starbeans::XPr
sal_False, if the value could be converted and has not changed
@exception InvalidArgumentException thrown if the value could not be converted to the requested type (which is the template argument)
*/
-template <class TYPE>
-sal_Bool tryPropertyValue(staruno::Any& /*out*/_rConvertedValue, staruno::Any& /*out*/_rOldValue, const staruno::Any& _rValueToSet, const TYPE& _rCurrentValue)
+template <typename T>
+sal_Bool tryPropertyValue(staruno::Any& /*out*/_rConvertedValue, staruno::Any& /*out*/_rOldValue, const staruno::Any& _rValueToSet, const T& _rCurrentValue)
{
sal_Bool bModified(sal_False);
- TYPE aNewValue;
+ T aNewValue = T();
::cppu::convertPropertyValue(aNewValue, _rValueToSet);
if (aNewValue != _rCurrentValue)
{
@@ -207,7 +207,7 @@ sal_Bool tryPropertyValueEnum(staruno::Any& /*out*/_rConvertedValue, staruno::An
inline sal_Bool tryPropertyValue(staruno::Any& /*out*/_rConvertedValue, staruno::Any& /*out*/_rOldValue, const staruno::Any& _rValueToSet, sal_Bool _bCurrentValue)
{
sal_Bool bModified(sal_False);
- sal_Bool bNewValue;
+ sal_Bool bNewValue(sal_False);
::cppu::convertPropertyValue(bNewValue, _rValueToSet);
if (bNewValue != _bCurrentValue)
{
diff --git a/comphelper/inc/comphelper/querydeep.hxx b/comphelper/inc/comphelper/querydeep.hxx
deleted file mode 100644
index 4115412d8d6c..000000000000
--- a/comphelper/inc/comphelper/querydeep.hxx
+++ /dev/null
@@ -1,484 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _COMPHELPER_QUERYDEEPINTERFACE_HXX
-#define _COMPHELPER_QUERYDEEPINTERFACE_HXX
-
-#include <com/sun/star/uno/XInterface.hpp>
-#include <com/sun/star/uno/Reference.hxx>
-#include <com/sun/star/uno/Type.hxx>
-
-/** */ //for docpp
-namespace comphelper
-{
-
-//--------------------------------------------------------------------------------------------------------
-/**
- * Inspect interfaces types whether they are related by inheritance.
- *<BR>
- * @return true if rType is derived from rBaseType
- * @param rBaseType a <type>Type</type> of an interface.
- * @param rType a <type>Type</type> of an interface.
- */
-sal_Bool isDerivedFrom(
- const ::com::sun::star::uno::Type & rBaseType,
- const ::com::sun::star::uno::Type & rType );
-
-//--------------------------------------------------------------------------------------------------------
-/**
- * Inspect interface types whether they are related by inheritance.
- *<BR>
- * @return true if p is of a type derived from rBaseType
- * @param rBaseType a <type>Type</type> of an interface.
- * @param p a pointer to an interface.
- */
-template <class Interface>
-inline sal_Bool isDerivedFrom(
- const ::com::sun::star::uno::Type& rBaseType,
- Interface* /*p*/)
-{
- return isDerivedFrom(rBaseType, Interface::static_type());
-}
-
-//--------------------------------------------------------------------------------------------------------
-// possible optimization ?
-// Any aRet(::cppu::queryInterface(rType, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12));
-// if (aRet.hasValue())
-// return aRet;
-
-/**
- * Inspect types and choose return proper interface.
- *<BR>
- * @param p1 a pointer to an interface.
- */
-template< class Interface1 >
-inline ::com::sun::star::uno::Any queryDeepInterface(
- const ::com::sun::star::uno::Type & rType,
- Interface1 * p1 )
-{
- if (isDerivedFrom(rType, Interface1::static_type()))
- return ::com::sun::star::uno::Any( &p1, rType );
- else
- return ::com::sun::star::uno::Any();
-}
-
-/**
- * Inspect types and choose return proper interface.
- *<BR>
- * @param p1 a pointer to an interface.
- * @param p2 a pointer to an interface.
- */
-template< class Interface1, class Interface2 >
-inline ::com::sun::star::uno::Any queryDeepInterface(
- const ::com::sun::star::uno::Type & rType,
- Interface1 * p1, Interface2 * p2 )
-{
- if (isDerivedFrom(rType, Interface1::static_type()))
- return ::com::sun::star::uno::Any( &p1, rType );
- else if (isDerivedFrom(rType, Interface2::static_type()))
- return ::com::sun::star::uno::Any( &p2, rType );
- else
- return ::com::sun::star::uno::Any();
-}
-
-/**
- * Inspect types and choose return proper interface.
- *<BR>
- * @param p1 a pointer to an interface.
- * @param p2 a pointer to an interface.
- * @param p3 a pointer to an interface.
- */
-template< class Interface1, class Interface2, class Interface3 >
-inline ::com::sun::star::uno::Any queryDeepInterface(
- const ::com::sun::star::uno::Type & rType,
- Interface1 * p1, Interface2 * p2, Interface3 * p3 )
-{
- if (isDerivedFrom(rType, Interface1::static_type()))
- return ::com::sun::star::uno::Any( &p1, rType );
- else if (isDerivedFrom(rType, Interface2::static_type()))
- return ::com::sun::star::uno::Any( &p2, rType );
- else if (isDerivedFrom(rType, Interface3::static_type()))
- return ::com::sun::star::uno::Any( &p3, rType );
- else
- return ::com::sun::star::uno::Any();
-}
-
-/**
- * Inspect types and choose return proper interface.
- *<BR>
- * @param p1 a pointer to an interface.
- * @param p2 a pointer to an interface.
- * @param p3 a pointer to an interface.
- * @param p4 a pointer to an interface.
- */
-template< class Interface1, class Interface2, class Interface3, class Interface4 >
-inline ::com::sun::star::uno::Any queryDeepInterface(
- const ::com::sun::star::uno::Type & rType,
- Interface1 * p1, Interface2 * p2, Interface3 * p3, Interface4 * p4 )
-{
- if (isDerivedFrom(rType, Interface1::static_type()))
- return ::com::sun::star::uno::Any( &p1, rType );
- else if (isDerivedFrom(rType, Interface2::static_type()))
- return ::com::sun::star::uno::Any( &p2, rType );
- else if (isDerivedFrom(rType, Interface3::static_type()))
- return ::com::sun::star::uno::Any( &p3, rType );
- else if (isDerivedFrom(rType, Interface4::static_type()))
- return ::com::sun::star::uno::Any( &p4, rType );
- else
- return ::com::sun::star::uno::Any();
-}
-
-/**
- * Inspect types and choose return proper interface.
- *<BR>
- * @param p1 a pointer to an interface.
- * @param p2 a pointer to an interface.
- * @param p3 a pointer to an interface.
- * @param p4 a pointer to an interface.
- * @param p5 a pointer to an interface.
- */
-template< class Interface1, class Interface2, class Interface3, class Interface4, class Interface5 >
-inline ::com::sun::star::uno::Any queryDeepInterface(
- const ::com::sun::star::uno::Type & rType,
- Interface1 * p1, Interface2 * p2, Interface3 * p3, Interface4 * p4, Interface5 * p5 )
-{
- if (isDerivedFrom(rType, Interface1::static_type()))
- return ::com::sun::star::uno::Any( &p1, rType );
- else if (isDerivedFrom(rType, Interface2::static_type()))
- return ::com::sun::star::uno::Any( &p2, rType );
- else if (isDerivedFrom(rType, Interface3::static_type()))
- return ::com::sun::star::uno::Any( &p3, rType );
- else if (isDerivedFrom(rType, Interface4::static_type()))
- return ::com::sun::star::uno::Any( &p4, rType );
- else if (isDerivedFrom(rType, Interface5::static_type()))
- return ::com::sun::star::uno::Any( &p5, rType );
- else
- return ::com::sun::star::uno::Any();
-}
-
-/**
- * Inspect types and choose return proper interface.
- *<BR>
- * @param p1 a pointer to an interface.
- * @param p2 a pointer to an interface.
- * @param p3 a pointer to an interface.
- * @param p4 a pointer to an interface.
- * @param p5 a pointer to an interface.
- * @param p6 a pointer to an interface.
- */
-template< class Interface1, class Interface2, class Interface3, class Interface4, class Interface5,
- class Interface6 >
-inline ::com::sun::star::uno::Any queryDeepInterface(
- const ::com::sun::star::uno::Type & rType,
- Interface1 * p1, Interface2 * p2, Interface3 * p3, Interface4 * p4, Interface5 * p5,
- Interface6 * p6 )
-{
- if (isDerivedFrom(rType, Interface1::static_type()))
- return ::com::sun::star::uno::Any( &p1, rType );
- else if (isDerivedFrom(rType, Interface2::static_type()))
- return ::com::sun::star::uno::Any( &p2, rType );
- else if (isDerivedFrom(rType, Interface3::static_type()))
- return ::com::sun::star::uno::Any( &p3, rType );
- else if (isDerivedFrom(rType, Interface4::static_type()))
- return ::com::sun::star::uno::Any( &p4, rType );
- else if (isDerivedFrom(rType, Interface5::static_type()))
- return ::com::sun::star::uno::Any( &p5, rType );
- else if (isDerivedFrom(rType, Interface6::static_type()))
- return ::com::sun::star::uno::Any( &p6, rType );
- else
- return ::com::sun::star::uno::Any();
-}
-
-/**
- * Inspect types and choose return proper interface.
- *<BR>
- * @param p1 a pointer to an interface.
- * @param p2 a pointer to an interface.
- * @param p3 a pointer to an interface.
- * @param p4 a pointer to an interface.
- * @param p5 a pointer to an interface.
- * @param p6 a pointer to an interface.
- * @param p7 a pointer to an interface.
- */
-template< class Interface1, class Interface2, class Interface3, class Interface4, class Interface5,
- class Interface6, class Interface7 >
-inline ::com::sun::star::uno::Any queryDeepInterface(
- const ::com::sun::star::uno::Type & rType,
- Interface1 * p1, Interface2 * p2, Interface3 * p3, Interface4 * p4, Interface5 * p5,
- Interface6 * p6, Interface7 * p7 )
-{
- if (isDerivedFrom(rType, Interface1::static_type()))
- return ::com::sun::star::uno::Any( &p1, rType );
- else if (isDerivedFrom(rType, Interface2::static_type()))
- return ::com::sun::star::uno::Any( &p2, rType );
- else if (isDerivedFrom(rType, Interface3::static_type()))
- return ::com::sun::star::uno::Any( &p3, rType );
- else if (isDerivedFrom(rType, Interface4::static_type()))
- return ::com::sun::star::uno::Any( &p4, rType );
- else if (isDerivedFrom(rType, Interface5::static_type()))
- return ::com::sun::star::uno::Any( &p5, rType );
- else if (isDerivedFrom(rType, Interface6::static_type()))
- return ::com::sun::star::uno::Any( &p6, rType );
- else if (isDerivedFrom(rType, Interface7::static_type()))
- return ::com::sun::star::uno::Any( &p7, rType );
- else
- return ::com::sun::star::uno::Any();
-}
-
-/**
- * Inspect types and choose return proper interface.
- *<BR>
- * @param p1 a pointer to an interface.
- * @param p2 a pointer to an interface.
- * @param p3 a pointer to an interface.
- * @param p4 a pointer to an interface.
- * @param p5 a pointer to an interface.
- * @param p6 a pointer to an interface.
- * @param p7 a pointer to an interface.
- * @param p8 a pointer to an interface.
- */
-template< class Interface1, class Interface2, class Interface3, class Interface4, class Interface5,
- class Interface6, class Interface7, class Interface8 >
-inline ::com::sun::star::uno::Any queryDeepInterface(
- const ::com::sun::star::uno::Type & rType,
- Interface1 * p1, Interface2 * p2, Interface3 * p3, Interface4 * p4, Interface5 * p5,
- Interface6 * p6, Interface7 * p7, Interface8 * p8 )
-{
- if (isDerivedFrom(rType, Interface1::static_type()))
- return ::com::sun::star::uno::Any( &p1, rType );
- else if (isDerivedFrom(rType, Interface2::static_type()))
- return ::com::sun::star::uno::Any( &p2, rType );
- else if (isDerivedFrom(rType, Interface3::static_type()))
- return ::com::sun::star::uno::Any( &p3, rType );
- else if (isDerivedFrom(rType, Interface4::static_type()))
- return ::com::sun::star::uno::Any( &p4, rType );
- else if (isDerivedFrom(rType, Interface5::static_type()))
- return ::com::sun::star::uno::Any( &p5, rType );
- else if (isDerivedFrom(rType, Interface6::static_type()))
- return ::com::sun::star::uno::Any( &p6, rType );
- else if (isDerivedFrom(rType, Interface7::static_type()))
- return ::com::sun::star::uno::Any( &p7, rType );
- else if (isDerivedFrom(rType, Interface8::static_type()))
- return ::com::sun::star::uno::Any( &p8, rType );
- else
- return ::com::sun::star::uno::Any();
-}
-
-/**
- * Inspect types and choose return proper interface.
- *<BR>
- * @param p1 a pointer to an interface.
- * @param p2 a pointer to an interface.
- * @param p3 a pointer to an interface.
- * @param p4 a pointer to an interface.
- * @param p5 a pointer to an interface.
- * @param p6 a pointer to an interface.
- * @param p7 a pointer to an interface.
- * @param p8 a pointer to an interface.
- * @param p9 a pointer to an interface.
- */
-template< class Interface1, class Interface2, class Interface3, class Interface4, class Interface5,
- class Interface6, class Interface7, class Interface8, class Interface9 >
-inline ::com::sun::star::uno::Any queryDeepInterface(
- const ::com::sun::star::uno::Type & rType,
- Interface1 * p1, Interface2 * p2, Interface3 * p3, Interface4 * p4, Interface5 * p5,
- Interface6 * p6, Interface7 * p7, Interface8 * p8, Interface9 * p9 )
-{
- if (isDerivedFrom(rType, Interface1::static_type()))
- return ::com::sun::star::uno::Any( &p1, rType );
- else if (isDerivedFrom(rType, Interface2::static_type()))
- return ::com::sun::star::uno::Any( &p2, rType );
- else if (isDerivedFrom(rType, Interface3::static_type()))
- return ::com::sun::star::uno::Any( &p3, rType );
- else if (isDerivedFrom(rType, Interface4::static_type()))
- return ::com::sun::star::uno::Any( &p4, rType );
- else if (isDerivedFrom(rType, Interface5::static_type()))
- return ::com::sun::star::uno::Any( &p5, rType );
- else if (isDerivedFrom(rType, Interface6::static_type()))
- return ::com::sun::star::uno::Any( &p6, rType );
- else if (isDerivedFrom(rType, Interface7::static_type()))
- return ::com::sun::star::uno::Any( &p7, rType );
- else if (isDerivedFrom(rType, Interface8::static_type()))
- return ::com::sun::star::uno::Any( &p8, rType );
- else if (isDerivedFrom(rType, Interface9::static_type()))
- return ::com::sun::star::uno::Any( &p9, rType );
- else
- return ::com::sun::star::uno::Any();
-}
-
-/**
- * Inspect types and choose return proper interface.
- *<BR>
- * @param p1 a pointer to an interface.
- * @param p2 a pointer to an interface.
- * @param p3 a pointer to an interface.
- * @param p4 a pointer to an interface.
- * @param p5 a pointer to an interface.
- * @param p6 a pointer to an interface.
- * @param p7 a pointer to an interface.
- * @param p8 a pointer to an interface.
- * @param p9 a pointer to an interface.
- * @param p10 a pointer to an interface.
- */
-template< class Interface1, class Interface2, class Interface3, class Interface4, class Interface5,
- class Interface6, class Interface7, class Interface8, class Interface9, class Interface10 >
-inline ::com::sun::star::uno::Any queryDeepInterface(
- const ::com::sun::star::uno::Type & rType,
- Interface1 * p1, Interface2 * p2, Interface3 * p3, Interface4 * p4, Interface5 * p5,
- Interface6 * p6, Interface7 * p7, Interface8 * p8, Interface9 * p9, Interface10 * p10 )
-{
- if (isDerivedFrom(rType, Interface1::static_type()))
- return ::com::sun::star::uno::Any( &p1, rType );
- else if (isDerivedFrom(rType, Interface2::static_type()))
- return ::com::sun::star::uno::Any( &p2, rType );
- else if (isDerivedFrom(rType, Interface3::static_type()))
- return ::com::sun::star::uno::Any( &p3, rType );
- else if (isDerivedFrom(rType, Interface4::static_type()))
- return ::com::sun::star::uno::Any( &p4, rType );
- else if (isDerivedFrom(rType, Interface5::static_type()))
- return ::com::sun::star::uno::Any( &p5, rType );
- else if (isDerivedFrom(rType, Interface6::static_type()))
- return ::com::sun::star::uno::Any( &p6, rType );
- else if (isDerivedFrom(rType, Interface7::static_type()))
- return ::com::sun::star::uno::Any( &p7, rType );
- else if (isDerivedFrom(rType, Interface8::static_type()))
- return ::com::sun::star::uno::Any( &p8, rType );
- else if (isDerivedFrom(rType, Interface9::static_type()))
- return ::com::sun::star::uno::Any( &p9, rType );
- else if (isDerivedFrom(rType, Interface10::static_type()))
- return ::com::sun::star::uno::Any( &p10, rType );
- else
- return ::com::sun::star::uno::Any();
-}
-
-/**
- * Inspect types and choose return proper interface.
- *<BR>
- * @param p1 a pointer to an interface.
- * @param p2 a pointer to an interface.
- * @param p3 a pointer to an interface.
- * @param p4 a pointer to an interface.
- * @param p5 a pointer to an interface.
- * @param p6 a pointer to an interface.
- * @param p7 a pointer to an interface.
- * @param p8 a pointer to an interface.
- * @param p9 a pointer to an interface.
- * @param p10 a pointer to an interface.
- * @param p11 a pointer to an interface.
- */
-template< class Interface1, class Interface2, class Interface3, class Interface4, class Interface5,
- class Interface6, class Interface7, class Interface8, class Interface9, class Interface10,
- class Interface11 >
-inline ::com::sun::star::uno::Any queryDeepInterface(
- const ::com::sun::star::uno::Type & rType,
- Interface1 * p1, Interface2 * p2, Interface3 * p3, Interface4 * p4, Interface5 * p5,
- Interface6 * p6, Interface7 * p7, Interface8 * p8, Interface9 * p9, Interface10 * p10,
- Interface11 * p11 )
-{
- if (isDerivedFrom(rType, Interface1::static_type()))
- return ::com::sun::star::uno::Any( &p1, rType );
- else if (isDerivedFrom(rType, Interface2::static_type()))
- return ::com::sun::star::uno::Any( &p2, rType );
- else if (isDerivedFrom(rType, Interface3::static_type()))
- return ::com::sun::star::uno::Any( &p3, rType );
- else if (isDerivedFrom(rType, Interface4::static_type()))
- return ::com::sun::star::uno::Any( &p4, rType );
- else if (isDerivedFrom(rType, Interface5::static_type()))
- return ::com::sun::star::uno::Any( &p5, rType );
- else if (isDerivedFrom(rType, Interface6::static_type()))
- return ::com::sun::star::uno::Any( &p6, rType );
- else if (isDerivedFrom(rType, Interface7::static_type()))
- return ::com::sun::star::uno::Any( &p7, rType );
- else if (isDerivedFrom(rType, Interface8::static_type()))
- return ::com::sun::star::uno::Any( &p8, rType );
- else if (isDerivedFrom(rType, Interface9::static_type()))
- return ::com::sun::star::uno::Any( &p9, rType );
- else if (isDerivedFrom(rType, Interface10::static_type()))
- return ::com::sun::star::uno::Any( &p10, rType );
- else if (isDerivedFrom(rType, Interface11::static_type()))
- return ::com::sun::star::uno::Any( &p11, rType );
- else
- return ::com::sun::star::uno::Any();
-}
-
-/**
- * Inspect types and choose return proper interface.
- *<BR>
- * @param p1 a pointer to an interface.
- * @param p2 a pointer to an interface.
- * @param p3 a pointer to an interface.
- * @param p4 a pointer to an interface.
- * @param p5 a pointer to an interface.
- * @param p6 a pointer to an interface.
- * @param p7 a pointer to an interface.
- * @param p8 a pointer to an interface.
- * @param p9 a pointer to an interface.
- * @param p10 a pointer to an interface.
- * @param p11 a pointer to an interface.
- * @param p12 a pointer to an interface.
- */
-template< class Interface1, class Interface2, class Interface3, class Interface4, class Interface5,
- class Interface6, class Interface7, class Interface8, class Interface9, class Interface10,
- class Interface11, class Interface12 >
-inline ::com::sun::star::uno::Any queryDeepInterface(
- const ::com::sun::star::uno::Type & rType,
- Interface1 * p1, Interface2 * p2, Interface3 * p3, Interface4 * p4, Interface5 * p5,
- Interface6 * p6, Interface7 * p7, Interface8 * p8, Interface9 * p9, Interface10 * p10,
- Interface11 * p11, Interface12 * p12 )
-{
- if (isDerivedFrom(rType, Interface1::static_type()))
- return ::com::sun::star::uno::Any( &p1, rType );
- else if (isDerivedFrom(rType, Interface2::static_type()))
- return ::com::sun::star::uno::Any( &p2, rType );
- else if (isDerivedFrom(rType, Interface3::static_type()))
- return ::com::sun::star::uno::Any( &p3, rType );
- else if (isDerivedFrom(rType, Interface4::static_type()))
- return ::com::sun::star::uno::Any( &p4, rType );
- else if (isDerivedFrom(rType, Interface5::static_type()))
- return ::com::sun::star::uno::Any( &p5, rType );
- else if (isDerivedFrom(rType, Interface6::static_type()))
- return ::com::sun::star::uno::Any( &p6, rType );
- else if (isDerivedFrom(rType, Interface7::static_type()))
- return ::com::sun::star::uno::Any( &p7, rType );
- else if (isDerivedFrom(rType, Interface8::static_type()))
- return ::com::sun::star::uno::Any( &p8, rType );
- else if (isDerivedFrom(rType, Interface9::static_type()))
- return ::com::sun::star::uno::Any( &p9, rType );
- else if (isDerivedFrom(rType, Interface10::static_type()))
- return ::com::sun::star::uno::Any( &p10, rType );
- else if (isDerivedFrom(rType, Interface11::static_type()))
- return ::com::sun::star::uno::Any( &p11, rType );
- else if (isDerivedFrom(rType, Interface12::static_type()))
- return ::com::sun::star::uno::Any( &p12, rType );
- else
- return ::com::sun::star::uno::Any();
-}
-
-} // namespace comphelper
-
-#endif // _COMPHELPER_QUERYDEEPINTERFACE_HXX
-
diff --git a/comphelper/inc/comphelper/scopeguard.hxx b/comphelper/inc/comphelper/scopeguard.hxx
index 4841a564ae61..1fdd179404a2 100644
--- a/comphelper/inc/comphelper/scopeguard.hxx
+++ b/comphelper/inc/comphelper/scopeguard.hxx
@@ -33,6 +33,7 @@
#endif
#include "boost/function.hpp"
#include "boost/noncopyable.hpp"
+#include "boost/bind.hpp"
namespace comphelper {
@@ -66,6 +67,21 @@ private:
exc_handling const m_excHandling;
};
+class COMPHELPER_DLLPUBLIC FlagGuard : ScopeGuard
+{
+public:
+ explicit FlagGuard( bool& i_flagRef, exc_handling i_excHandling = IGNORE_EXCEPTIONS )
+ :ScopeGuard( ::boost::bind( ResetFlag, ::boost::ref( i_flagRef ) ), i_excHandling )
+ {
+ }
+
+private:
+ static void ResetFlag( bool& i_flagRef )
+ {
+ i_flagRef = false;
+ }
+};
+
} // namespace comphelper
#endif // ! defined(INCLUDED_COMPHELPER_SCOPEGUARD_HXX)
diff --git a/comphelper/inc/comphelper/servicedecl.hxx b/comphelper/inc/comphelper/servicedecl.hxx
index 5d11d41831f5..5ea7972e29a2 100644
--- a/comphelper/inc/comphelper/servicedecl.hxx
+++ b/comphelper/inc/comphelper/servicedecl.hxx
@@ -67,7 +67,7 @@ typedef ::boost::function3<
The declaration can be done in various ways, the (simplest) form is
<pre>
- class MyClass : cppu::WeakImplHelper2<XInterface1, XInterface2> {
+ class MyClass : public cppu::WeakImplHelper2<XInterface1, XInterface2> {
public:
MyClass( uno::Reference<uno::XComponentContext> const& xContext )
[...]
@@ -85,7 +85,7 @@ typedef ::boost::function3<
context:
<pre>
- class MyClass : cppu::WeakImplHelper2<XInterface1, XInterface2> {
+ class MyClass : public cppu::WeakImplHelper2<XInterface1, XInterface2> {
public:
MyClass( uno::Sequence<uno::Any> const& args,
uno::Reference<uno:XComponentContext> const& xContext )
@@ -134,8 +134,6 @@ public:
m_pServiceNames(pSupportedServiceNames),
m_cDelim(cDelim) {}
- /// @internal gets called by component_writeInfoHelper()
- bool writeInfo( ::com::sun::star::registry::XRegistryKey * xKey ) const;
/// @internal gets called by component_getFactoryHelper()
void * getFactory( sal_Char const* pImplName ) const;
@@ -323,9 +321,6 @@ struct class_ : public serviceimpl_base< detail::ServiceImpl<ImplT_>, WithArgsT
// component_... helpers with arbitrary service declarations:
//
-#define COMPHELPER_SERVICEDECL_writeInfo(z_, n_, unused_) \
- bRet &= BOOST_PP_CAT(s, n_).writeInfo( xRegistryKey );
-
#define COMPHELPER_SERVICEDECL_getFactory(z_, n_, unused_) \
if (pRet == 0) \
pRet = BOOST_PP_CAT(s, n_).getFactory(pImplName);
@@ -333,11 +328,6 @@ struct class_ : public serviceimpl_base< detail::ServiceImpl<ImplT_>, WithArgsT
/** The following preprocessor repetitions generate functions like
<pre>
- inline sal_Bool component_writeInfoHelper(
- ::com::sun::star::lang::XMultiServiceFactory *,
- ::com::sun::star::registry::XRegistryKey * xRegistryKey,
- ServiceDecl const& s0, ServiceDecl const& s1, ... );
-
inline void * component_getFactoryHelper(
sal_Char const* pImplName,
::com::sun::star::lang::XMultiServiceFactory *,
@@ -351,15 +341,6 @@ struct class_ : public serviceimpl_base< detail::ServiceImpl<ImplT_>, WithArgsT
COMPHELPER_SERVICEDECL_COMPONENT_HELPER_MAX_ARGS; its default is 8.
*/
#define COMPHELPER_SERVICEDECL_make(z_, n_, unused_) \
-inline sal_Bool component_writeInfoHelper( \
- ::com::sun::star::lang::XMultiServiceFactory *, \
- ::com::sun::star::registry::XRegistryKey * xRegistryKey, \
- BOOST_PP_ENUM_PARAMS(n_, ServiceDecl const& s) ) \
-{ \
- bool bRet = true; \
- BOOST_PP_REPEAT(n_, COMPHELPER_SERVICEDECL_writeInfo, ~) \
- return bRet; \
-} \
inline void * component_getFactoryHelper( \
sal_Char const* pImplName, \
::com::sun::star::lang::XMultiServiceFactory *, \
@@ -381,7 +362,6 @@ BOOST_PP_REPEAT_FROM_TO(1, COMPHELPER_SERVICEDECL_COMPONENT_HELPER_MAX_ARGS,
#undef COMPHELPER_SERVICEDECL_COMPONENT_HELPER_MAX_ARGS
#undef COMPHELPER_SERVICEDECL_make
#undef COMPHELPER_SERVICEDECL_getFactory
-#undef COMPHELPER_SERVICEDECL_writeInfo
} // namespace service_decl
} // namespace comphelper
@@ -421,13 +401,6 @@ extern "C" \
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; \
} \
\
- SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( ::com::sun::star::lang::XMultiServiceFactory* pServiceManager, \
- ::com::sun::star::registry::XRegistryKey* pRegistryKey ) \
- { \
- return component_writeInfoHelper( pServiceManager, pRegistryKey, \
- BOOST_PP_SEQ_ENUM(varargs_) ); \
- } \
- \
SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( sal_Char const* pImplName, \
::com::sun::star::lang::XMultiServiceFactory* pServiceManager, \
::com::sun::star::registry::XRegistryKey* pRegistryKey ) \
diff --git a/comphelper/inc/comphelper/storagehelper.hxx b/comphelper/inc/comphelper/storagehelper.hxx
index b7e5704c4d68..9d44b42e9514 100644
--- a/comphelper/inc/comphelper/storagehelper.hxx
+++ b/comphelper/inc/comphelper/storagehelper.hxx
@@ -33,6 +33,7 @@
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
#include <com/sun/star/embed/XStorage.hpp>
#include <com/sun/star/embed/ElementModes.hpp>
+#include <com/sun/star/beans/NamedValue.hpp>
#include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/io/XOutputStream.hpp>
#include <com/sun/star/io/XStream.hpp>
@@ -43,6 +44,9 @@
#define ZIP_STORAGE_FORMAT_STRING ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ZipFormat" ) )
#define OFOPXML_STORAGE_FORMAT_STRING ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OFOPXMLFormat" ) )
+#define PACKAGE_ENCRYPTIONDATA_SHA1UTF8 ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PackageSHA1UTF8EncryptionKey" ) )
+#define PACKAGE_ENCRYPTIONDATA_SHA1MS1252 ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PackageSHA1MS1252EncryptionKey" ) )
+
namespace comphelper {
class COMPHELPER_DLLPUBLIC OStorageHelper
@@ -112,9 +116,9 @@ public:
= ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >() )
throw ( ::com::sun::star::uno::Exception );
- static void SetCommonStoragePassword(
+ static void SetCommonStorageEncryptionData(
const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage,
- const ::rtl::OUString& aPass )
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& aEncryptionData )
throw ( ::com::sun::star::uno::Exception );
// the following method supports only storages of OOo formats
@@ -159,6 +163,9 @@ public:
sal_Bool bRepairStorage = sal_False )
throw ( ::com::sun::star::uno::Exception );
+ static ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >
+ CreatePackageEncryptionData( const ::rtl::OUString& aPassword );
+
static sal_Bool IsValidZipEntryFileName( const ::rtl::OUString& aName, sal_Bool bSlashAllowed );
static sal_Bool IsValidZipEntryFileName( const sal_Unicode *pChar, sal_Int32 nLength, sal_Bool bSlashAllowed );
diff --git a/comphelper/prj/build.lst b/comphelper/prj/build.lst
index 9d44807c9cc3..793d8bf30e09 100644
--- a/comphelper/prj/build.lst
+++ b/comphelper/prj/build.lst
@@ -11,3 +11,5 @@ ph comphelper\source\compare nmake - all ph_compare ph_inc NULL
ph comphelper\source\officeinstdir nmake - all ph_officeinstdir ph_inc NULL
ph comphelper\source\xml nmake - all ph_xml NULL
ph comphelper\util nmake - all ph_util ph_container ph_evtatmgr ph_misc ph_procfact ph_property ph_streaming ph_compare ph_officeinstdir ph_xml NULL
+
+ph comphelper\qa\complex\comphelper nmake - all ph_complex ph_util NULL
diff --git a/comphelper/prj/d.lst b/comphelper/prj/d.lst
index f4d09c54ba70..f05fcf0926dd 100644
--- a/comphelper/prj/d.lst
+++ b/comphelper/prj/d.lst
@@ -12,3 +12,4 @@ mkdir: %_DEST%\inc%_EXT%\comphelper
mkdir: %_DEST%\inc%_EXT%\cppuhelper
..\inc\comphelper\extract.hxx %_DEST%\inc%_EXT%\cppuhelper\extract.hxx
..\version.mk %_DEST%\inc%_EXT%\comphelper\version.mk
+..\%__SRC%\misc\comphelp4.component %_DEST%\xml%_EXT%\comphelp4.component
diff --git a/comphelper/qa/complex/comphelper/Map.java b/comphelper/qa/complex/comphelper/Map.java
index deeffe6baf32..5571eadb7e6e 100644
--- a/comphelper/qa/complex/comphelper/Map.java
+++ b/comphelper/qa/complex/comphelper/Map.java
@@ -39,10 +39,10 @@ import com.sun.star.container.XIdentifierAccess;
import com.sun.star.container.XMap;
import com.sun.star.container.XSet;
import com.sun.star.form.XFormComponent;
-import com.sun.star.lang.DisposedException;
+// import com.sun.star.lang.DisposedException;
import com.sun.star.lang.EventObject;
import com.sun.star.lang.Locale;
-import com.sun.star.lang.NoSupportException;
+// import com.sun.star.lang.NoSupportException;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.uno.Any;
import com.sun.star.uno.AnyConverter;
@@ -53,28 +53,36 @@ import com.sun.star.uno.XInterface;
import java.util.HashSet;
import java.util.Set;
+// import org.junit.After;
+import org.junit.AfterClass;
+// import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.openoffice.test.OfficeConnection;
+import static org.junit.Assert.*;
+
/** complex test case for the css.container.Map implementation
*
* @author frank.schoenheit@sun.com
*/
-public class Map extends complexlib.ComplexTestCase
+public class Map /* extends complexlib.ComplexTestCase */
{
- @Override
- public String[] getTestMethodNames()
- {
- return new String[] {
- "testSimpleKeyTypes",
- "testComplexKeyTypes",
- "testValueTypes",
- "testEnumerations",
- "testSpecialValues"
- };
- }
-
- public static String getShortTestDescription()
- {
- return "tests the css.container.Map implementation from comphelper/source/misc/map.cxx";
- }
+// @Override
+// public String[] getTestMethodNames()
+// {
+// return new String[] {
+// "testSimpleKeyTypes",
+// "testComplexKeyTypes",
+// "testValueTypes",
+// "testEnumerations",
+// "testSpecialValues"
+// };
+// }
+
+// public static String getShortTestDescription()
+// {
+// return "tests the css.container.Map implementation from comphelper/source/misc/map.cxx";
+// }
private String impl_getNth( int n )
{
@@ -98,11 +106,11 @@ public class Map extends complexlib.ComplexTestCase
{
for ( int i=0; i<_keys.length; ++i )
{
- assure( _context + ": " + impl_getNth(i) + " key (" + _keys[i].toString() + ") not found in map",
+ assertTrue( _context + ": " + impl_getNth(i) + " key (" + _keys[i].toString() + ") not found in map",
_map.containsKey( _keys[i] ) );
- assure( _context + ": " + impl_getNth(i) + " value (" + _values[i].toString() + ") not found in map",
+ assertTrue( _context + ": " + impl_getNth(i) + " value (" + _values[i].toString() + ") not found in map",
_map.containsValue( _values[i] ) );
- assureEquals( _context + ": wrong value for " + impl_getNth(i) + " key (" + _keys[i] + ")",
+ assertEquals( _context + ": wrong value for " + impl_getNth(i) + " key (" + _keys[i] + ")",
_values[i], _map.get( _keys[i] ) );
}
}
@@ -110,21 +118,21 @@ public class Map extends complexlib.ComplexTestCase
@SuppressWarnings("unchecked")
private void impl_checkMappings( Object[] _keys, Object[] _values, String _context ) throws com.sun.star.uno.Exception
{
- log.println( "checking mapping " + _context + "..." );
+ System.out.println( "checking mapping " + _context + "..." );
Type keyType = AnyConverter.getType( _keys[0] );
Type valueType = AnyConverter.getType( _values[0] );
// create a map for the given types
- XMap map = com.sun.star.container.EnumerableMap.create( param.getComponentContext(),
+ XMap map = com.sun.star.container.EnumerableMap.create( connection.getComponentContext(),
keyType, valueType );
- assure( _context + ": key types do not match", map.getKeyType().equals( keyType ) );
- assure( _context + ": value types do not match", map.getValueType().equals( valueType ) );
+ assertTrue( _context + ": key types do not match", map.getKeyType().equals( keyType ) );
+ assertTrue( _context + ": value types do not match", map.getValueType().equals( valueType ) );
// insert all values
- assure( _context + ": initially created map is not empty", map.hasElements() );
+ assertTrue( _context + ": initially created map is not empty", map.hasElements() );
impl_putAll( map, _keys, _values );
- assure( _context + ": map filled with values is still empty", !map.hasElements() );
+ assertTrue( _context + ": map filled with values is still empty", !map.hasElements() );
// and verify them
impl_ceckContent( map, _keys, _values, _context );
@@ -132,32 +140,33 @@ public class Map extends complexlib.ComplexTestCase
for ( int i=_keys.length-1; i>=0; --i )
{
// ensure 'remove' really returns the old value
- assureEquals( _context + ": wrong 'old value' for removal of " + impl_getNth(i) + " value",
+ assertEquals( _context + ": wrong 'old value' for removal of " + impl_getNth(i) + " value",
_values[i], map.remove( _keys[i] ) );
}
- assure( _context + ":map not empty after removing all elements", map.hasElements() );
+ assertTrue( _context + ":map not empty after removing all elements", map.hasElements() );
// insert again, and check whether 'clear' does what it should do
impl_putAll( map, _keys, _values );
map.clear();
- assure( _context + ": 'clear' does not empty the map", map.hasElements() );
+ assertTrue( _context + ": 'clear' does not empty the map", map.hasElements() );
// try the constructor which creates an immutable version
Pair< ?, ? >[] initialMappings = new Pair< ?, ? >[ _keys.length ];
for ( int i=0; i<_keys.length; ++i )
+ {
initialMappings[i] = new Pair< Object, Object >( _keys[i], _values[i] );
+ }
map = com.sun.star.container.EnumerableMap.createImmutable(
- param.getComponentContext(), keyType, valueType, (Pair< Object, Object >[])initialMappings );
+ connection.getComponentContext(), keyType, valueType, (Pair< Object, Object >[])initialMappings );
impl_ceckContent( map, _keys, _values, _context );
// check the thing is actually immutable
- assureException( map, "clear", new Object[] {}, NoSupportException.class );
- assureException( map, "remove", new Class[] { Object.class }, new Object[] { _keys[0] }, NoSupportException.class );
- assureException( map, "put", new Class[] { Object.class, Object.class }, new Object[] { _keys[0], _values[0] },
- NoSupportException.class );
+ //? assureException( map, "clear", new Object[] {}, NoSupportException.class );
+ //? assureException( map, "remove", new Class[] { Object.class }, new Object[] { _keys[0] }, NoSupportException.class );
+ //? assureException( map, "put", new Class[] { Object.class, Object.class }, new Object[] { _keys[0], _values[0] }, NoSupportException.class );
}
- public void testSimpleKeyTypes() throws com.sun.star.uno.Exception
+ @Test public void testSimpleKeyTypes() throws com.sun.star.uno.Exception
{
impl_checkMappings(
new Long[] { (long)1, (long)2, (long)3, (long)4, (long)5 },
@@ -191,7 +200,7 @@ public class Map extends complexlib.ComplexTestCase
);
}
- public void testComplexKeyTypes() throws com.sun.star.uno.Exception
+ @Test public void testComplexKeyTypes() throws com.sun.star.uno.Exception
{
Type intType = new Type( Integer.class );
Type longType = new Type( Long.class );
@@ -212,7 +221,7 @@ public class Map extends complexlib.ComplexTestCase
Object[] components = new Object[ serviceNames.length ];
for ( int i=0; i<serviceNames.length; ++i )
{
- components[i] = ((XMultiServiceFactory)param.getMSF()).createInstance( "com.sun.star.form.component." + serviceNames[i] );
+ components[i] = getMSF().createInstance( "com.sun.star.form.component." + serviceNames[i] );
}
// "normalize" the first component, so it has the property type
Type formComponentType = new Type( XFormComponent.class );
@@ -248,7 +257,7 @@ public class Map extends complexlib.ComplexTestCase
case 12: valueClass = ContainerEvent.class; break;
case 13: valueClass = Object.class; break;
default:
- failed( "internal error: wrong position for getValueClass" );
+ fail( "internal error: wrong position for getValueClass" );
}
return valueClass;
}
@@ -274,7 +283,7 @@ public class Map extends complexlib.ComplexTestCase
case 12: someValue = new ContainerEvent(); break;
case 13: someValue = new Locale(); break; // just use *any* value which does not conflict with the others
default:
- failed( "internal error: wrong position for getSomeValue" );
+ fail( "internal error: wrong position for getSomeValue" );
}
return someValue;
}
@@ -313,7 +322,7 @@ public class Map extends complexlib.ComplexTestCase
public boolean hasElements() { throw new UnsupportedOperationException( "Not implemented." ); }
};
- public void testValueTypes() throws com.sun.star.uno.Exception
+ @Test public void testValueTypes() throws com.sun.star.uno.Exception
{
final Integer key = new Integer(1);
@@ -349,29 +358,31 @@ public class Map extends complexlib.ComplexTestCase
for ( int valueTypePos = 0; valueTypePos != typeCompatibility.length; ++valueTypePos )
{
- XMap map = com.sun.star.container.EnumerableMap.create( param.getComponentContext(),
+ XMap map = com.sun.star.container.EnumerableMap.create( connection.getComponentContext(),
new Type( Integer.class ), new Type( impl_getValueClassByPos( valueTypePos ) ) );
for ( int checkTypePos = 0; checkTypePos != typeCompatibility[valueTypePos].length; ++checkTypePos )
{
Object value = impl_getSomeValueByTypePos( checkTypePos );
if ( typeCompatibility[valueTypePos][checkTypePos] != 0 )
+ {
// expected to succeed
- assureException(
- "(" + valueTypePos + "," + checkTypePos + ") putting an " +
- AnyConverter.getType( value ).getTypeName() + ", where " +
- map.getValueType().getTypeName() + " is expected, should succeed",
- map, "put", new Class[] { Object.class, Object.class }, new Object[] { key, value },
- null );
+//? assureException(
+//? "(" + valueTypePos + "," + checkTypePos + ") putting an " +
+//? AnyConverter.getType( value ).getTypeName() + ", where " +
+//? map.getValueType().getTypeName() + " is expected, should succeed",
+//? map, "put", new Class[] { Object.class, Object.class }, new Object[] { key, value },
+//? null );
+ }
else
{
// expected to fail
- assureException(
- "(" + valueTypePos + "," + checkTypePos + ") putting an " +
- AnyConverter.getType( value ).getTypeName() + ", where " +
- map.getValueType().getTypeName() + " is expected, should not succeed",
- map, "put", new Class[] { Object.class, Object.class }, new Object[] { key, value },
- IllegalTypeException.class );
+//? assureException(
+//? "(" + valueTypePos + "," + checkTypePos + ") putting an " +
+//? AnyConverter.getType( value ).getTypeName() + ", where " +
+//? map.getValueType().getTypeName() + " is expected, should not succeed",
+//? map, "put", new Class[] { Object.class, Object.class }, new Object[] { key, value },
+//? IllegalTypeException.class );
}
}
}
@@ -409,7 +420,9 @@ public class Map extends complexlib.ComplexTestCase
// are provided by the enumeration
Set set = new HashSet();
for ( int i=0; i<_expectedElements.length; ++i )
+ {
set.add( i );
+ }
CompareEqual comparator = _expectedElements[0].getClass().equals( Pair.class )
? new PairCompareEqual()
@@ -417,12 +430,14 @@ public class Map extends complexlib.ComplexTestCase
for ( int i=0; i<_expectedElements.length; ++i )
{
- assure( _context + ": too few elements in the enumeration (still " + ( _expectedElements.length - i ) + " to go)",
+ assertTrue( _context + ": too few elements in the enumeration (still " + ( _expectedElements.length - i ) + " to go)",
_enum.hasMoreElements() );
Object nextElement = _enum.nextElement();
if ( nextElement.getClass().equals( Any.class ) )
+ {
nextElement = ((Any)nextElement).getObject();
+ }
int foundPos = -1;
for ( int j=0; j<_expectedElements.length; ++j )
@@ -434,24 +449,26 @@ public class Map extends complexlib.ComplexTestCase
}
}
- assure( _context + ": '" + nextElement.toString() + "' is not expected in the enumeration",
+ assertTrue( _context + ": '" + nextElement.toString() + "' is not expected in the enumeration",
set.contains( foundPos ) );
set.remove( foundPos );
}
- assure( _context + ": too many elements returned by the enumeration", set.isEmpty() );
+ assertTrue( _context + ": too many elements returned by the enumeration", set.isEmpty() );
}
- public void testEnumerations() throws com.sun.star.uno.Exception
+ @Test public void testEnumerations() throws com.sun.star.uno.Exception
{
// fill a map
final String[] keys = new String[] { "This", "is", "an", "enumeration", "test" };
final String[] values = new String[] { "for", "the", "map", "implementation", "." };
- XEnumerableMap map = com.sun.star.container.EnumerableMap.create( param.getComponentContext(), new Type( String.class ), new Type( String.class ) );
+ XEnumerableMap map = com.sun.star.container.EnumerableMap.create( connection.getComponentContext(), new Type( String.class ), new Type( String.class ) );
impl_putAll( map, keys, values );
final Pair< ?, ? >[] paired = new Pair< ?, ? >[ keys.length ];
for ( int i=0; i<keys.length; ++i )
+ {
paired[i] = new Pair< Object, Object >( keys[i], values[i] );
+ }
// create non-isolated enumerators, and check their content
XEnumeration enumerateKeys = map.createKeyEnumeration( false );
@@ -464,9 +481,9 @@ public class Map extends complexlib.ComplexTestCase
// all enumerators above have been created as non-isolated iterators, so they're expected to die when
// the underlying map changes
map.remove( keys[0] );
- assureException( enumerateKeys, "hasMoreElements", new Object[] {}, DisposedException.class );
- assureException( enumerateValues, "hasMoreElements", new Object[] {}, DisposedException.class );
- assureException( enumerateAll, "hasMoreElements", new Object[] {}, DisposedException.class );
+//? assureException( enumerateKeys, "hasMoreElements", new Object[] {}, DisposedException.class );
+//? assureException( enumerateValues, "hasMoreElements", new Object[] {}, DisposedException.class );
+//? assureException( enumerateAll, "hasMoreElements", new Object[] {}, DisposedException.class );
// now try with isolated iterators
map.put( keys[0], values[0] );
@@ -479,36 +496,58 @@ public class Map extends complexlib.ComplexTestCase
impl_verifyEnumerationContent( enumerateAll, paired, "content enumeration" );
}
- public void testSpecialValues() throws com.sun.star.uno.Exception
+ @Test public void testSpecialValues() throws com.sun.star.uno.Exception
{
final Double[] keys = new Double[] { new Double( 0 ), Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY };
final Double[] values = new Double[] { Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, new Double( 0 ) };
- XEnumerableMap map = com.sun.star.container.EnumerableMap.create( param.getComponentContext(), new Type( Double.class ), new Type( Double.class ) );
+ XEnumerableMap map = com.sun.star.container.EnumerableMap.create( connection.getComponentContext(), new Type( Double.class ), new Type( Double.class ) );
impl_putAll( map, keys, values );
- assure( "containsKey( Double.+INF failed", map.containsKey( Double.POSITIVE_INFINITY ) );
- assure( "containsKey( Double.-INF failed", map.containsKey( Double.NEGATIVE_INFINITY ) );
- assure( "containsKey( 0 ) failed", map.containsKey( new Double( 0 ) ) );
+ assertTrue( "containsKey( Double.+INF failed", map.containsKey( Double.POSITIVE_INFINITY ) );
+ assertTrue( "containsKey( Double.-INF failed", map.containsKey( Double.NEGATIVE_INFINITY ) );
+ assertTrue( "containsKey( 0 ) failed", map.containsKey( new Double( 0 ) ) );
- assure( "containsValue( Double.+INF ) failed", map.containsValue( Double.POSITIVE_INFINITY ) );
- assure( "containsValue( Double.-INF ) failed", map.containsValue( Double.NEGATIVE_INFINITY ) );
- assure( "containsValue( 0 ) failed", map.containsValue( new Double( 0 ) ) );
+ assertTrue( "containsValue( Double.+INF ) failed", map.containsValue( Double.POSITIVE_INFINITY ) );
+ assertTrue( "containsValue( Double.-INF ) failed", map.containsValue( Double.NEGATIVE_INFINITY ) );
+ assertTrue( "containsValue( 0 ) failed", map.containsValue( new Double( 0 ) ) );
// put and containsKey should reject Double.NaN as key
- assureException( "Double.NaN should not be allowed as key in a call to 'put'", map, "put",
- new Class[] { Object.class, Object.class }, new Object[] { Double.NaN, new Double( 0 ) },
- com.sun.star.lang.IllegalArgumentException.class );
- assureException( "Double.NaN should not be allowed as key in a call to 'containsKey'", map, "containsKey",
- new Class[] { Object.class }, new Object[] { Double.NaN },
- com.sun.star.lang.IllegalArgumentException.class );
+//? assureException( "Double.NaN should not be allowed as key in a call to 'put'", map, "put",
+//? new Class[] { Object.class, Object.class }, new Object[] { Double.NaN, new Double( 0 ) },
+//? com.sun.star.lang.IllegalArgumentException.class );
+//? assureException( "Double.NaN should not be allowed as key in a call to 'containsKey'", map, "containsKey",
+//? new Class[] { Object.class }, new Object[] { Double.NaN },
+//? com.sun.star.lang.IllegalArgumentException.class );
// ditto for put and containsValue
- assureException( "Double.NaN should not be allowed as value in a call to 'put'", map, "put",
- new Class[] { Object.class, Object.class }, new Object[] { new Double( 0 ), Double.NaN },
- com.sun.star.lang.IllegalArgumentException.class );
- assureException( "Double.NaN should not be allowed as key in a call to 'containsValue'", map, "containsValue",
- new Class[] { Object.class }, new Object[] { Double.NaN },
- com.sun.star.lang.IllegalArgumentException.class );
+//? assureException( "Double.NaN should not be allowed as value in a call to 'put'", map, "put",
+//? new Class[] { Object.class, Object.class }, new Object[] { new Double( 0 ), Double.NaN },
+//? com.sun.star.lang.IllegalArgumentException.class );
+//? assureException( "Double.NaN should not be allowed as key in a call to 'containsValue'", map, "containsValue",
+//? new Class[] { Object.class }, new Object[] { Double.NaN },
+//? com.sun.star.lang.IllegalArgumentException.class );
+ }
+
+
+ private XMultiServiceFactory getMSF()
+ {
+ final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager());
+ return xMSF1;
}
+
+ // setup and close connections
+ @BeforeClass public static void setUpConnection() throws Exception {
+ System.out.println("setUpConnection()");
+ connection.setUp();
+ }
+
+ @AfterClass public static void tearDownConnection()
+ throws InterruptedException, com.sun.star.uno.Exception
+ {
+ System.out.println("tearDownConnection()");
+ connection.tearDown();
+ }
+
+ private static final OfficeConnection connection = new OfficeConnection();
}
diff --git a/comphelper/qa/complex/comphelper/SequenceOutputStreamUnitTest.java b/comphelper/qa/complex/comphelper/SequenceOutputStreamUnitTest.java
index 26879a7c83ad..d6683e64bc83 100644
--- a/comphelper/qa/complex/comphelper/SequenceOutputStreamUnitTest.java
+++ b/comphelper/qa/complex/comphelper/SequenceOutputStreamUnitTest.java
@@ -26,46 +26,163 @@
************************************************************************/
package complex.comphelper;
-import complexlib.ComplexTestCase;
+// import complexlib.ComplexTestCase;
import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+
+import com.sun.star.io.XSequenceOutputStream;
+import com.sun.star.io.XSeekableInputStream;
+
+import java.util.Random;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.openoffice.test.OfficeConnection;
+import static org.junit.Assert.*;
/* Document.
*/
-public class SequenceOutputStreamUnitTest extends ComplexTestCase {
- private XMultiServiceFactory m_xMSF = null;
+class TestHelper
+{
+ // LogWriter m_aLogWriter;
+ String m_sTestPrefix;
- public String[] getTestMethodNames() {
- return new String[] {
- "ExecuteTest01"};
+ /** Creates a new instance of TestHelper
+ * @param sTestPrefix
+ */
+ public TestHelper ( String sTestPrefix ) {
+ m_sTestPrefix = sTestPrefix;
}
- public String getTestObjectName () {
- return "SequenceOutputStreamUnitTest";
+ public void Error ( String sError ) {
+ System.out.println ( m_sTestPrefix + "Error: " + sError );
}
- public static String getShortTestDescription() {
- return "tests the SequenceOutput/InputStream implementations";
+ public void Message ( String sMessage ) {
+ System.out.println ( m_sTestPrefix + sMessage );
}
+}
+
+public class SequenceOutputStreamUnitTest /* extends ComplexTestCase*/ {
+ private XMultiServiceFactory m_xMSF = null;
+
+ TestHelper m_aTestHelper = null;
- public void before() {
+// public String[] getTestMethodNames() {
+// return new String[] {
+// "ExecuteTest01"};
+// }
+
+// public String getTestObjectName () {
+// return "SequenceOutputStreamUnitTest";
+// }
+
+// public static String getShortTestDescription() {
+// return "tests the SequenceOutput/InputStream implementations";
+// }
+
+ @Before public void before() {
try {
- m_xMSF = (XMultiServiceFactory)param.getMSF ();
+ m_xMSF = getMSF();
+ m_aTestHelper = new TestHelper ( "Test01: ");
} catch (Exception e) {
- failed ("Cannot create service factory!");
+ fail ("Cannot create service factory!");
}
if (m_xMSF==null) {
- failed ("Cannot create service factory!");
+ fail ("Cannot create service factory!");
}
}
- public void after() {
+ @After public void after() {
m_xMSF = null;
}
- public void ExecuteTest01() {
- Test01 aTest = new Test01 (m_xMSF, log);
- assure ( "Test01 failed!", aTest.test() );
+// @Test public void ExecuteTest01() {
+// Test01 aTest = new Test01 (m_xMSF);
+// assertTrue( "Test01 failed!", aTest.test() );
+// }
+
+ @Test public void test () {
+ try {
+ final int nBytesCnt = 20;
+
+ //create SequenceOutputStream
+ Object oSequenceOutputStream = m_xMSF.createInstance (
+ "com.sun.star.io.SequenceOutputStream" );
+ XSequenceOutputStream xSeqOutStream =
+ UnoRuntime.queryInterface (
+ XSequenceOutputStream.class, oSequenceOutputStream );
+ m_aTestHelper.Message ( "SequenceOutputStream created." );
+
+ //write something to the stream
+ byte pBytesOriginal[] = new byte [nBytesCnt];
+ Random oRandom = new Random();
+ oRandom.nextBytes (pBytesOriginal);
+ xSeqOutStream.writeBytes (pBytesOriginal);
+ byte pBytesWritten[] = xSeqOutStream.getWrittenBytes ();
+ m_aTestHelper.Message ( "SeuenceOutputStream filled." );
+
+ //create SequenceInputstream
+ Object pArgs[] = new Object[1];
+ pArgs[0] = pBytesWritten;
+ Object oSequenceInputStream = m_xMSF.createInstanceWithArguments (
+ "com.sun.star.io.SequenceInputStream", pArgs );
+ XSeekableInputStream xSeekableInStream =
+ UnoRuntime.queryInterface (
+ XSeekableInputStream.class, oSequenceInputStream );
+ m_aTestHelper.Message ( "SequenceInputStream created." );
+
+ //read from the stream
+ byte pBytesRead[][] = new byte [1][nBytesCnt];
+ xSeekableInStream.readBytes ( pBytesRead, pBytesRead[0].length + 1 );
+ m_aTestHelper.Message ( "Read from SequenceInputStream." );
+
+ //close the streams
+ xSeqOutStream.closeOutput ();
+ xSeekableInStream.closeInput ();
+ m_aTestHelper.Message ( "Both streams closed." );
+
+ //compare the original, written and read arrys
+ for ( int i = 0; i < nBytesCnt; ++i ) {
+ if ( pBytesOriginal[i] != pBytesWritten[i] ) {
+ m_aTestHelper.Error ( "Written array not identical to " +
+ "original array. Position: " + i );
+ return /* false */;
+ } else if ( pBytesOriginal[i] != pBytesRead[0][i] ) {
+ m_aTestHelper.Error ( "Read array not identical to original " +
+ "array. Position: " + i );
+ return /* false */;
+ }
+ }
+ m_aTestHelper.Message ( "All data correct." );
+ } catch ( Exception e ) {
+ m_aTestHelper.Error ( "Exception: " + e );
+ return /* false */;
+ }
+ return /* true */;
+ }
+
+ private XMultiServiceFactory getMSF()
+ {
+ final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager());
+ return xMSF1;
+ }
+
+ // setup and close connections
+ @BeforeClass public static void setUpConnection() throws Exception {
+ System.out.println("setUpConnection()");
+ connection.setUp();
+ }
+
+ @AfterClass public static void tearDownConnection()
+ throws InterruptedException, com.sun.star.uno.Exception
+ {
+ System.out.println("tearDownConnection()");
+ connection.tearDown();
}
+ private static final OfficeConnection connection = new OfficeConnection();
} \ No newline at end of file
diff --git a/comphelper/qa/complex/comphelper/Test01.java b/comphelper/qa/complex/comphelper/Test01.java
deleted file mode 100644
index 6900b738aeba..000000000000
--- a/comphelper/qa/complex/comphelper/Test01.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-package complex.comphelper;
-
-import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.io.XSequenceOutputStream;
-import com.sun.star.io.XSeekableInputStream;
-import com.sun.star.uno.UnoRuntime;
-
-import java.util.Random;
-import share.LogWriter;
-
-public class Test01 {
- XMultiServiceFactory m_xMSF = null;
- TestHelper m_aTestHelper = null;
-
- public Test01 ( XMultiServiceFactory xMSF, LogWriter aLogWriter )
- {
- m_xMSF = xMSF;
- m_aTestHelper = new TestHelper (aLogWriter, "Test01: ");
- }
-
-
- public boolean test () {
- try {
- final int nBytesCnt = 20;
-
- //create SequenceOutputStream
- Object oSequenceOutputStream = m_xMSF.createInstance (
- "com.sun.star.io.SequenceOutputStream" );
- XSequenceOutputStream xSeqOutStream =
- (XSequenceOutputStream) UnoRuntime.queryInterface (
- XSequenceOutputStream.class, oSequenceOutputStream );
- m_aTestHelper.Message ( "SequenceOutputStream created." );
-
- //write something to the stream
- byte pBytesOriginal[] = new byte [nBytesCnt];
- Random oRandom = new Random();
- oRandom.nextBytes (pBytesOriginal);
- xSeqOutStream.writeBytes (pBytesOriginal);
- byte pBytesWritten[] = xSeqOutStream.getWrittenBytes ();
- m_aTestHelper.Message ( "SeuenceOutputStream filled." );
-
- //create SequenceInputstream
- Object pArgs[] = new Object[1];
- pArgs[0] = pBytesWritten;
- Object oSequenceInputStream = m_xMSF.createInstanceWithArguments (
- "com.sun.star.io.SequenceInputStream", pArgs );
- XSeekableInputStream xSeekableInStream =
- (XSeekableInputStream)UnoRuntime.queryInterface (
- XSeekableInputStream.class, oSequenceInputStream );
- m_aTestHelper.Message ( "SequenceInputStream created." );
-
- //read from the stream
- byte pBytesRead[][] = new byte [1][nBytesCnt];
- xSeekableInStream.readBytes ( pBytesRead, pBytesRead[0].length + 1 );
- m_aTestHelper.Message ( "Read from SequenceInputStream." );
-
- //close the streams
- xSeqOutStream.closeOutput ();
- xSeekableInStream.closeInput ();
- m_aTestHelper.Message ( "Both streams closed." );
-
- //compare the original, written and read arrys
- for ( int i = 0; i < nBytesCnt; ++i ) {
- if ( pBytesOriginal[i] != pBytesWritten[i] ) {
- m_aTestHelper.Error ( "Written array not identical to " +
- "original array. Position: " + i );
- return false;
- } else if ( pBytesOriginal[i] != pBytesRead[0][i] ) {
- m_aTestHelper.Error ( "Read array not identical to original " +
- "array. Position: " + i );
- return false;
- }
- }
- m_aTestHelper.Message ( "All data correct." );
- } catch ( Exception e ) {
- m_aTestHelper.Error ( "Exception: " + e );
- return false;
- }
- return true;
- }
-} \ No newline at end of file
diff --git a/comphelper/qa/complex/comphelper/TestHelper.java b/comphelper/qa/complex/comphelper/TestHelper.java
deleted file mode 100644
index 0a6989e95271..000000000000
--- a/comphelper/qa/complex/comphelper/TestHelper.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-package complex.comphelper;
-
-import share.LogWriter;
-
-public class TestHelper {
- LogWriter m_aLogWriter;
- String m_sTestPrefix;
-
- /** Creates a new instance of TestHelper */
- public TestHelper ( LogWriter aLogWriter, String sTestPrefix ) {
- m_aLogWriter = aLogWriter;
- m_sTestPrefix = sTestPrefix;
- }
-
- public void Error ( String sError ) {
- m_aLogWriter.println ( m_sTestPrefix + "Error: " + sError );
- }
-
- public void Message ( String sMessage ) {
- m_aLogWriter.println ( m_sTestPrefix + sMessage );
- }
-}
-
diff --git a/tools/source/solar/makefile.mk b/comphelper/qa/complex/comphelper/makefile.mk
index 6f5dd85c608b..238bbd5c991d 100644
--- a/tools/source/solar/makefile.mk
+++ b/comphelper/qa/complex/comphelper/makefile.mk
@@ -25,39 +25,30 @@
#
#*************************************************************************
-PRJ=..$/..
-
-PRJNAME=tools
-TARGET=mksvconf
-TARGETTYPE=CUI
-
-LIBSALCPPRT=$(0)
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-# --- Files --------------------------------------------------------
-
-CFILES= solar.c
-
-OBJFILES= $(OBJ)$/solar.obj
-
-APP1TARGET= $(TARGET)
-APP1OBJS= $(OBJFILES)
-APP1STDLIBS=
-APP1DEPN=
-APP1DEF=
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
-
-.IF "$(L10N-framework)"==""
-ALLTAR : $(INCCOM)$/svconf.h
-.ENDIF # "$(L10N-framework)"==""
-
-$(INCCOM)$/svconf.h : $(BIN)$/$(TARGET)
- $(BIN)$/$(TARGET) $@
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
+.ELSE
+
+PRJ = ../../..
+PRJNAME = comphelper
+TARGET = qa_complex_comphelper
+
+.IF "$(OOO_JUNIT_JAR)" != ""
+PACKAGE = complex/comphelper
+JAVATESTFILES = \
+ Map.java \
+ SequenceOutputStreamUnitTest.java
+
+JAVAFILES = $(JAVATESTFILES)
+JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar jurt.jar
+EXTRAJARFILES = $(OOO_JUNIT_JAR)
+.END
+
+.INCLUDE: settings.mk
+.INCLUDE: target.mk
+.INCLUDE: installationtest.mk
+
+ALLTAR : javatest
+
+.END
diff --git a/comphelper/qa/complex/makefile.mk b/comphelper/qa/complex/makefile.mk
deleted file mode 100644
index ec0efdd1188c..000000000000
--- a/comphelper/qa/complex/makefile.mk
+++ /dev/null
@@ -1,83 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ = ..$/..
-TARGET = ComphelperComplexTests
-PRJNAME = comphelper
-
-# --- Settings -----------------------------------------------------
-.INCLUDE: settings.mk
-
-#----- compile .java files -----------------------------------------
-
-JARFILES := ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar
-JAVAFILES := $(shell @$(FIND) . -name "*.java")
-JAVACLASSFILES := $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(i:d)$/$(i:b).class)
-
-#----- make a jar from compiled files ------------------------------
-
-MAXLINELENGTH = 100000
-
-#JARCLASSDIRS =
-JARTARGET = $(TARGET).jar
-JARCOMPRESS = TRUE
-
-# --- Runner Settings ----------------------------------------------
-
-# classpath and argument list
-RUNNER_CLASSPATH = -cp $(CLASSPATH)$(PATH_SEPERATOR)$(SOLARBINDIR)$/OOoRunner.jar
-
-# start an office if the parameter is set for the makefile
-.IF "$(OFFICE)" == ""
-RUNNER_APPEXECCOMMAND =
-.ELSE
-RUNNER_APPEXECCOMMAND = -AppExecutionCommand "$(OFFICE)$/soffice -accept=socket,host=localhost,port=8100;urp;"
-.ENDIF
-
-RUNNER_ARGS = org.openoffice.Runner -TestBase java_complex $(RUNNER_APPEXECCOMMAND)
-
-# --- Targets ------------------------------------------------------
-
-.IF "$(depend)" == ""
-ALL : ALLTAR
- @echo -----------------------------------------------------
- @echo - do a 'dmake show_targets' to show available targets
- @echo -----------------------------------------------------
-.ELSE
-ALL: ALLDEP
-.ENDIF
-
-.INCLUDE : target.mk
-
-show_targets:
- +@java $(RUNNER_CLASSPATH) complexlib.ShowTargets $(foreach,i,$(JAVAFILES) $(i:s#.java##:s#./#complex.#))
-
-run:
- +java $(RUNNER_CLASSPATH) $(RUNNER_ARGS) -sce comphelper_all.sce
-
-run_%:
- +java $(RUNNER_CLASSPATH) $(RUNNER_ARGS) -o complex.$(PRJNAME).$(@:s/run_//)
diff --git a/comphelper/source/misc/componentmodule.cxx b/comphelper/source/misc/componentmodule.cxx
index 63893d0f6d0d..1dfd99bfa07e 100644
--- a/comphelper/source/misc/componentmodule.cxx
+++ b/comphelper/source/misc/componentmodule.cxx
@@ -135,64 +135,6 @@ namespace comphelper
}
//--------------------------------------------------------------------------
- sal_Bool OModule::writeComponentInfos( void* pServiceManager, void* pRegistryKey )
- {
- Reference< XMultiServiceFactory > xFactory( static_cast< XMultiServiceFactory* >( pServiceManager ) );
- Reference< XRegistryKey > xRegistryKey( static_cast< XRegistryKey* >( pRegistryKey ) );
- return writeComponentInfos( xFactory, xRegistryKey );
- }
-
- //--------------------------------------------------------------------------
- sal_Bool OModule::writeComponentInfos(
- const Reference< XMultiServiceFactory >& /*_rxServiceManager*/,
- const Reference< XRegistryKey >& _rxRootKey )
- {
- OSL_ENSURE( _rxRootKey.is(), "OModule::writeComponentInfos: invalid argument!" );
-
- ::rtl::OUString sRootKey( "/", 1, RTL_TEXTENCODING_ASCII_US );
-
- for ( ComponentDescriptions::const_iterator component = m_pImpl->m_aRegisteredComponents.begin();
- component != m_pImpl->m_aRegisteredComponents.end();
- ++component
- )
- {
- ::rtl::OUString sMainKeyName( sRootKey );
- sMainKeyName += component->sImplementationName;
- sMainKeyName += ::rtl::OUString::createFromAscii( "/UNO/SERVICES" );
-
- try
- {
- Reference< XRegistryKey > xNewKey( _rxRootKey->createKey( sMainKeyName ) );
-
- const ::rtl::OUString* pService = component->aSupportedServices.getConstArray();
- const ::rtl::OUString* pServiceEnd = component->aSupportedServices.getConstArray() + component->aSupportedServices.getLength();
- for ( ; pService != pServiceEnd; ++pService )
- xNewKey->createKey( *pService );
-
- if ( component->sSingletonName.getLength() )
- {
- OSL_ENSURE( component->aSupportedServices.getLength() == 1, "OModule::writeComponentInfos: singletons should support exactly one service, shouldn't they?" );
-
- ::rtl::OUString sSingletonKeyName( sRootKey );
- sSingletonKeyName += component->sImplementationName;
- sSingletonKeyName += ::rtl::OUString::createFromAscii( "/UNO/SINGLETONS/" );
- sSingletonKeyName += component->sSingletonName;
-
- xNewKey = _rxRootKey->createKey( sSingletonKeyName );
- xNewKey->setStringValue( component->aSupportedServices[ 0 ] );
- }
- }
- catch( Exception& )
- {
- OSL_ASSERT( "OModule::writeComponentInfos: something went wrong while creating the keys!" );
- return sal_False;
- }
- }
-
- return sal_True;
- }
-
- //--------------------------------------------------------------------------
void* OModule::getComponentFactory( const sal_Char* _pImplementationName, void* _pServiceManager, void* /*_pRegistryKey*/ )
{
Reference< XInterface > xFactory( getComponentFactory(
diff --git a/comphelper/source/misc/docpasswordhelper.cxx b/comphelper/source/misc/docpasswordhelper.cxx
index 37941352ae28..3c8d66bd57e4 100644
--- a/comphelper/source/misc/docpasswordhelper.cxx
+++ b/comphelper/source/misc/docpasswordhelper.cxx
@@ -84,16 +84,9 @@ uno::Sequence< beans::PropertyValue > DocPasswordHelper::GenerateNewModifyPasswo
{
uno::Sequence< beans::PropertyValue > aResult;
- uno::Sequence< sal_Int8 > aSalt( 16 );
+ uno::Sequence< sal_Int8 > aSalt = GenerateRandomByteSequence( 16 );
sal_Int32 nCount = 1024;
- TimeValue aTime;
- osl_getSystemTime( &aTime );
- rtlRandomPool aRandomPool = rtl_random_createPool ();
- rtl_random_addBytes ( aRandomPool, &aTime, 8 );
-
- rtl_random_getBytes ( aRandomPool, aSalt.getArray(), 16 );
-
uno::Sequence< sal_Int8 > aNewHash = GeneratePBKDF2Hash( aPassword, aSalt, nCount, 16 );
if ( aNewHash.getLength() )
{
@@ -108,9 +101,6 @@ uno::Sequence< beans::PropertyValue > DocPasswordHelper::GenerateNewModifyPasswo
aResult[3].Value <<= aNewHash;
}
- // Clean up random pool memory
- rtl_random_destroyPool ( aRandomPool );
-
return aResult;
}
@@ -282,9 +272,98 @@ Sequence< sal_Int8 > DocPasswordHelper::GetXLHashAsSequence(
}
// ============================================================================
+/*static*/ uno::Sequence< sal_Int8 > DocPasswordHelper::GenerateRandomByteSequence( sal_Int32 nLength )
+{
+ uno::Sequence< sal_Int8 > aResult( nLength );
+
+ TimeValue aTime;
+ osl_getSystemTime( &aTime );
+ rtlRandomPool aRandomPool = rtl_random_createPool ();
+ rtl_random_addBytes ( aRandomPool, &aTime, 8 );
+ rtl_random_getBytes ( aRandomPool, aResult.getArray(), nLength );
+ rtl_random_destroyPool ( aRandomPool );
-/*static*/ OUString DocPasswordHelper::requestAndVerifyDocPassword(
+ return aResult;
+}
+
+
+// ============================================================================
+/*static*/ uno::Sequence< sal_Int8 > DocPasswordHelper::GenerateStd97Key( const ::rtl::OUString& aPassword, const uno::Sequence< sal_Int8 >& aDocId )
+{
+ uno::Sequence< sal_Int8 > aResultKey;
+ if ( aPassword.getLength() && aDocId.getLength() == 16 )
+ {
+ sal_uInt16 pPassData[16];
+ rtl_zeroMemory( pPassData, sizeof(pPassData) );
+
+ sal_Int32 nPassLen = ::std::min< sal_Int32 >( aPassword.getLength(), 15 );
+ rtl_copyMemory( pPassData, aPassword.getStr(), nPassLen * sizeof(pPassData[0]) );
+
+ aResultKey = GenerateStd97Key( pPassData, aDocId );
+ }
+
+ return aResultKey;
+}
+
+// ============================================================================
+/*static*/ uno::Sequence< sal_Int8 > DocPasswordHelper::GenerateStd97Key( const sal_uInt16 pPassData[16], const uno::Sequence< sal_Int8 >& aDocId )
+{
+ uno::Sequence< sal_Int8 > aResultKey;
+ if ( pPassData[0] && aDocId.getLength() == 16 )
+ {
+ sal_uInt8 pKeyData[64];
+ rtl_zeroMemory( pKeyData, sizeof(pKeyData) );
+
+ sal_Int32 nInd = 0;
+
+ // Fill PassData into KeyData.
+ for ( nInd = 0; nInd < 16 && pPassData[nInd]; nInd++)
+ {
+ pKeyData[2*nInd] = sal::static_int_cast< sal_uInt8 >( (pPassData[nInd] >> 0) & 0xff );
+ pKeyData[2*nInd + 1] = sal::static_int_cast< sal_uInt8 >( (pPassData[nInd] >> 8) & 0xff );
+ }
+
+ pKeyData[2*nInd] = 0x80;
+ pKeyData[56] = sal::static_int_cast< sal_uInt8 >( nInd << 4 );
+
+ // Fill raw digest of KeyData into KeyData.
+ rtlDigest hDigest = rtl_digest_create ( rtl_Digest_AlgorithmMD5 );
+ (void)rtl_digest_updateMD5 (
+ hDigest, pKeyData, sizeof(pKeyData));
+ (void)rtl_digest_rawMD5 (
+ hDigest, pKeyData, RTL_DIGEST_LENGTH_MD5);
+
+ // Update digest with KeyData and Unique.
+ for ( nInd = 0; nInd < 16; nInd++ )
+ {
+ rtl_digest_updateMD5( hDigest, pKeyData, 5 );
+ rtl_digest_updateMD5( hDigest, (const sal_uInt8*)aDocId.getConstArray(), aDocId.getLength() );
+ }
+
+ // Update digest with padding.
+ pKeyData[16] = 0x80;
+ rtl_zeroMemory( pKeyData + 17, sizeof(pKeyData) - 17 );
+ pKeyData[56] = 0x80;
+ pKeyData[57] = 0x0a;
+
+ rtl_digest_updateMD5( hDigest, &(pKeyData[16]), sizeof(pKeyData) - 16 );
+
+ // Fill raw digest of above updates
+ aResultKey.realloc( RTL_DIGEST_LENGTH_MD5 );
+ rtl_digest_rawMD5 ( hDigest, (sal_uInt8*)aResultKey.getArray(), aResultKey.getLength() );
+
+ // Erase KeyData array and leave.
+ rtl_zeroMemory( pKeyData, sizeof(pKeyData) );
+ }
+
+ return aResultKey;
+}
+
+// ============================================================================
+
+/*static*/ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > DocPasswordHelper::requestAndVerifyDocPassword(
IDocPasswordVerifier& rVerifier,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& rMediaEncData,
const OUString& rMediaPassword,
const Reference< XInteractionHandler >& rxInteractHandler,
const OUString& rDocumentName,
@@ -292,7 +371,7 @@ Sequence< sal_Int8 > DocPasswordHelper::GetXLHashAsSequence(
const ::std::vector< OUString >* pDefaultPasswords,
bool* pbIsDefaultPassword )
{
- OUString aPassword;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > aEncData;
DocPasswordVerifierResult eResult = DocPasswordVerifierResult_WRONG_PASSWORD;
// first, try provided default passwords
@@ -302,23 +381,32 @@ Sequence< sal_Int8 > DocPasswordHelper::GetXLHashAsSequence(
{
for( ::std::vector< OUString >::const_iterator aIt = pDefaultPasswords->begin(), aEnd = pDefaultPasswords->end(); (eResult == DocPasswordVerifierResult_WRONG_PASSWORD) && (aIt != aEnd); ++aIt )
{
- aPassword = *aIt;
- OSL_ENSURE( aPassword.getLength() > 0, "DocPasswordHelper::requestAndVerifyDocPassword - unexpected empty default password" );
- if( aPassword.getLength() > 0 )
+ OSL_ENSURE( aIt->getLength() > 0, "DocPasswordHelper::requestAndVerifyDocPassword - unexpected empty default password" );
+ if( aIt->getLength() > 0 )
{
- eResult = rVerifier.verifyPassword( aPassword );
+ eResult = rVerifier.verifyPassword( *aIt, aEncData );
if( pbIsDefaultPassword )
*pbIsDefaultPassword = eResult == DocPasswordVerifierResult_OK;
}
}
}
+ // try media encryption data (skip, if result is OK or ABORT)
+ if( eResult == DocPasswordVerifierResult_WRONG_PASSWORD )
+ {
+ if( rMediaEncData.getLength() > 0 )
+ {
+ eResult = rVerifier.verifyEncryptionData( rMediaEncData );
+ if( eResult == DocPasswordVerifierResult_OK )
+ aEncData = rMediaEncData;
+ }
+ }
+
// try media password (skip, if result is OK or ABORT)
if( eResult == DocPasswordVerifierResult_WRONG_PASSWORD )
{
- aPassword = rMediaPassword;
- if( aPassword.getLength() > 0 )
- eResult = rVerifier.verifyPassword( aPassword );
+ if( rMediaPassword.getLength() > 0 )
+ eResult = rVerifier.verifyPassword( rMediaPassword, aEncData );
}
// request a password (skip, if result is OK or ABORT)
@@ -332,9 +420,8 @@ Sequence< sal_Int8 > DocPasswordHelper::GetXLHashAsSequence(
rxInteractHandler->handle( xRequest );
if( pRequest->isPassword() )
{
- aPassword = pRequest->getPassword();
- if( aPassword.getLength() > 0 )
- eResult = rVerifier.verifyPassword( aPassword );
+ if( pRequest->getPassword().getLength() > 0 )
+ eResult = rVerifier.verifyPassword( pRequest->getPassword(), aEncData );
}
else
{
@@ -347,15 +434,17 @@ Sequence< sal_Int8 > DocPasswordHelper::GetXLHashAsSequence(
{
}
- return (eResult == DocPasswordVerifierResult_OK) ? aPassword : OUString();
+ return (eResult == DocPasswordVerifierResult_OK) ? aEncData : uno::Sequence< beans::NamedValue >();
}
-/*static*/ OUString DocPasswordHelper::requestAndVerifyDocPassword(
+/*static*/ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > DocPasswordHelper::requestAndVerifyDocPassword(
IDocPasswordVerifier& rVerifier,
MediaDescriptor& rMediaDesc,
DocPasswordRequestType eRequestType,
const ::std::vector< OUString >* pDefaultPasswords )
{
+ uno::Sequence< beans::NamedValue > aMediaEncData = rMediaDesc.getUnpackedValueOrDefault(
+ MediaDescriptor::PROP_ENCRYPTIONDATA(), uno::Sequence< beans::NamedValue >() );
OUString aMediaPassword = rMediaDesc.getUnpackedValueOrDefault(
MediaDescriptor::PROP_PASSWORD(), OUString() );
Reference< XInteractionHandler > xInteractHandler = rMediaDesc.getUnpackedValueOrDefault(
@@ -364,14 +453,17 @@ Sequence< sal_Int8 > DocPasswordHelper::GetXLHashAsSequence(
MediaDescriptor::PROP_URL(), OUString() );
bool bIsDefaultPassword = false;
- OUString aPassword = requestAndVerifyDocPassword(
- rVerifier, aMediaPassword, xInteractHandler, aDocumentName, eRequestType, pDefaultPasswords, &bIsDefaultPassword );
+ uno::Sequence< beans::NamedValue > aEncryptionData = requestAndVerifyDocPassword(
+ rVerifier, aMediaEncData, aMediaPassword, xInteractHandler, aDocumentName, eRequestType, pDefaultPasswords, &bIsDefaultPassword );
+
+ rMediaDesc.erase( MediaDescriptor::PROP_PASSWORD() );
+ rMediaDesc.erase( MediaDescriptor::PROP_ENCRYPTIONDATA() );
// insert valid password into media descriptor (but not a default password)
- if( (aPassword.getLength() > 0) && !bIsDefaultPassword )
- rMediaDesc[ MediaDescriptor::PROP_PASSWORD() ] <<= aPassword;
+ if( (aEncryptionData.getLength() > 0) && !bIsDefaultPassword )
+ rMediaDesc[ MediaDescriptor::PROP_ENCRYPTIONDATA() ] <<= aEncryptionData;
- return aPassword;
+ return aEncryptionData;
}
// ============================================================================
diff --git a/comphelper/source/misc/docpasswordrequest.cxx b/comphelper/source/misc/docpasswordrequest.cxx
index 17cdb0ae2d92..15c2e09ba0f3 100644
--- a/comphelper/source/misc/docpasswordrequest.cxx
+++ b/comphelper/source/misc/docpasswordrequest.cxx
@@ -31,6 +31,7 @@
#include "comphelper/docpasswordrequest.hxx"
#include <com/sun/star/task/DocumentMSPasswordRequest2.hpp>
#include <com/sun/star/task/DocumentPasswordRequest2.hpp>
+#include <com/sun/star/task/PasswordRequest.hpp>
#include <com/sun/star/task/XInteractionAbort.hpp>
#include <com/sun/star/task/XInteractionPassword2.hpp>
@@ -44,6 +45,7 @@ using ::com::sun::star::uno::XInterface;
using ::com::sun::star::task::InteractionClassification_QUERY;
using ::com::sun::star::task::DocumentMSPasswordRequest2;
using ::com::sun::star::task::DocumentPasswordRequest2;
+using ::com::sun::star::task::PasswordRequest;
using ::com::sun::star::task::PasswordRequestMode;
using ::com::sun::star::task::XInteractionAbort;
using ::com::sun::star::task::XInteractionContinuation;
@@ -98,11 +100,74 @@ private:
// ============================================================================
+SimplePasswordRequest::SimplePasswordRequest( PasswordRequestMode eMode )
+: mpAbort( NULL )
+, mpPassword( NULL )
+{
+ PasswordRequest aRequest( OUString(), Reference< XInterface >(),
+ InteractionClassification_QUERY, eMode );
+ maRequest <<= aRequest;
+
+ maContinuations.realloc( 2 );
+ maContinuations[ 0 ].set( mpAbort = new AbortContinuation );
+ maContinuations[ 1 ].set( mpPassword = new PasswordContinuation );
+}
+
+SimplePasswordRequest::~SimplePasswordRequest()
+{
+}
+
+/*uno::*/Any SAL_CALL SimplePasswordRequest::queryInterface( const /*uno::*/Type& rType ) throw (RuntimeException)
+{
+ return ::cppu::queryInterface ( rType,
+ // OWeakObject interfaces
+ dynamic_cast< XInterface* > ( (XInteractionRequest *) this ),
+ static_cast< XWeak* > ( this ),
+ // my own interfaces
+ static_cast< XInteractionRequest* > ( this ) );
+}
+
+void SAL_CALL SimplePasswordRequest::acquire( ) throw ()
+{
+ OWeakObject::acquire();
+}
+
+void SAL_CALL SimplePasswordRequest::release( ) throw ()
+{
+ OWeakObject::release();
+}
+
+sal_Bool SimplePasswordRequest::isAbort() const
+{
+ return mpAbort->isSelected();
+}
+
+sal_Bool SimplePasswordRequest::isPassword() const
+{
+ return mpPassword->isSelected();
+}
+
+OUString SimplePasswordRequest::getPassword() const
+{
+ return mpPassword->getPassword();
+}
+
+Any SAL_CALL SimplePasswordRequest::getRequest() throw( RuntimeException )
+{
+ return maRequest;
+}
+
+Sequence< Reference< XInteractionContinuation > > SAL_CALL SimplePasswordRequest::getContinuations() throw( RuntimeException )
+{
+ return maContinuations;
+}
+
+// ============================================================================
+
DocPasswordRequest::DocPasswordRequest( DocPasswordRequestType eType,
PasswordRequestMode eMode, const OUString& rDocumentName, sal_Bool bPasswordToModify )
: mpAbort( NULL )
, mpPassword( NULL )
-, mbPasswordToModify( bPasswordToModify )
{
switch( eType )
{
diff --git a/comphelper/source/misc/makefile.mk b/comphelper/source/misc/makefile.mk
index cecba554b332..0bb4defb4165 100644
--- a/comphelper/source/misc/makefile.mk
+++ b/comphelper/source/misc/makefile.mk
@@ -74,7 +74,6 @@ SLOFILES= \
$(SLO)$/officeresourcebundle.obj \
$(SLO)$/officerestartmanager.obj \
$(SLO)$/proxyaggregation.obj \
- $(SLO)$/querydeep.obj \
$(SLO)$/regpathhelper.obj \
$(SLO)$/scopeguard.obj \
$(SLO)$/SelectionMultiplex.obj \
diff --git a/comphelper/source/misc/mediadescriptor.cxx b/comphelper/source/misc/mediadescriptor.cxx
index 468e1e153bff..e0b3e797264a 100644
--- a/comphelper/source/misc/mediadescriptor.cxx
+++ b/comphelper/source/misc/mediadescriptor.cxx
@@ -113,6 +113,12 @@ const ::rtl::OUString& MediaDescriptor::PROP_DOCUMENTSERVICE()
return sProp;
}
+const ::rtl::OUString& MediaDescriptor::PROP_ENCRYPTIONDATA()
+{
+ static const ::rtl::OUString sProp(RTL_CONSTASCII_USTRINGPARAM("EncryptionData"));
+ return sProp;
+}
+
const ::rtl::OUString& MediaDescriptor::PROP_EXTENSION()
{
static const ::rtl::OUString sProp(RTL_CONSTASCII_USTRINGPARAM("Extension"));
diff --git a/comphelper/source/misc/namedvaluecollection.cxx b/comphelper/source/misc/namedvaluecollection.cxx
index 8bab7fa3d7c7..566e5526019c 100644
--- a/comphelper/source/misc/namedvaluecollection.cxx
+++ b/comphelper/source/misc/namedvaluecollection.cxx
@@ -99,21 +99,7 @@ namespace comphelper
NamedValueCollection::NamedValueCollection( const Any& _rElements )
:m_pImpl( new NamedValueCollection_Impl )
{
- Sequence< NamedValue > aNamedValues;
- Sequence< PropertyValue > aPropertyValues;
- NamedValue aNamedValue;
- PropertyValue aPropertyValue;
-
- if ( _rElements >>= aNamedValues )
- impl_assign( aNamedValues );
- else if ( _rElements >>= aPropertyValues )
- impl_assign( aPropertyValues );
- else if ( _rElements >>= aNamedValue )
- impl_assign( Sequence< NamedValue >( &aNamedValue, 1 ) );
- else if ( _rElements >>= aPropertyValue )
- impl_assign( Sequence< PropertyValue >( &aPropertyValue, 1 ) );
- else
- OSL_ENSURE( !_rElements.hasValue(), "NamedValueCollection::NamedValueCollection(Any): unsupported type!" );
+ impl_assign( _rElements );
}
//--------------------------------------------------------------------
@@ -170,6 +156,39 @@ namespace comphelper
}
//--------------------------------------------------------------------
+ ::std::vector< ::rtl::OUString > NamedValueCollection::getNames() const
+ {
+ ::std::vector< ::rtl::OUString > aNames( m_pImpl->aValues.size() );
+ ::std::transform(
+ m_pImpl->aValues.begin(),
+ m_pImpl->aValues.end(),
+ aNames.begin(),
+ ::std::select1st< NamedValueRepository::value_type >()
+ );
+ return aNames;
+ }
+
+ //--------------------------------------------------------------------
+ void NamedValueCollection::impl_assign( const Any& i_rWrappedElements )
+ {
+ Sequence< NamedValue > aNamedValues;
+ Sequence< PropertyValue > aPropertyValues;
+ NamedValue aNamedValue;
+ PropertyValue aPropertyValue;
+
+ if ( i_rWrappedElements >>= aNamedValues )
+ impl_assign( aNamedValues );
+ else if ( i_rWrappedElements >>= aPropertyValues )
+ impl_assign( aPropertyValues );
+ else if ( i_rWrappedElements >>= aNamedValue )
+ impl_assign( Sequence< NamedValue >( &aNamedValue, 1 ) );
+ else if ( i_rWrappedElements >>= aPropertyValue )
+ impl_assign( Sequence< PropertyValue >( &aPropertyValue, 1 ) );
+ else
+ OSL_ENSURE( !i_rWrappedElements.hasValue(), "NamedValueCollection::impl_assign(Any): unsupported type!" );
+ }
+
+ //--------------------------------------------------------------------
void NamedValueCollection::impl_assign( const Sequence< Any >& _rArguments )
{
{
diff --git a/comphelper/source/misc/querydeep.cxx b/comphelper/source/misc/querydeep.cxx
deleted file mode 100644
index 92e475686783..000000000000
--- a/comphelper/source/misc/querydeep.cxx
+++ /dev/null
@@ -1,76 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_comphelper.hxx"
-#include <comphelper/querydeep.hxx>
-#include <typelib/typedescription.h>
-
-//__________________________________________________________________________________________________
-
-sal_Bool comphelper::isDerivedFrom(
- const ::com::sun::star::uno::Type & rBaseType,
- const ::com::sun::star::uno::Type & rType )
-{
- using namespace ::com::sun::star::uno;
-
- TypeClass eClass = rBaseType.getTypeClass();
-
- if (eClass != TypeClass_INTERFACE)
- return sal_False;
-
- // supported TypeClass - do the types match ?
- if (eClass != rType.getTypeClass())
- return sal_False;
-
- sal_Bool bRet;
-
- // shortcut for simple case
- if (rBaseType == ::getCppuType(static_cast<const Reference< XInterface > *>(0)))
- {
- bRet = sal_True;
- }
- else
- {
- // now ask in cppu (aka typelib)
- ::typelib_TypeDescription *pBaseTD = 0, *pTD = 0;
-
- rBaseType. getDescription(&pBaseTD);
- rType. getDescription(&pTD);
-
- // interfaces are assignable to a base
- bRet = ::typelib_typedescription_isAssignableFrom(pBaseTD, pTD);
-
- ::typelib_typedescription_release(pBaseTD);
- ::typelib_typedescription_release(pTD);
- }
-
- return bRet;
-}
-
-
-
diff --git a/comphelper/source/misc/servicedecl.cxx b/comphelper/source/misc/servicedecl.cxx
index 7c3dd169485d..7986407b0bd5 100644
--- a/comphelper/source/misc/servicedecl.cxx
+++ b/comphelper/source/misc/servicedecl.cxx
@@ -116,37 +116,6 @@ ServiceDecl::Factory::createInstanceWithArgumentsAndContext(
m_rServiceDecl, args, xContext );
}
-bool ServiceDecl::writeInfo( registry::XRegistryKey * xKey ) const
-{
- bool bRet = false;
- if (xKey != 0) {
- rtl::OUStringBuffer buf;
- buf.append( static_cast<sal_Unicode>('/') );
- buf.appendAscii( m_pImplName );
- buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("/UNO/SERVICES") );
- try {
- uno::Reference<registry::XRegistryKey> const xNewKey(
- xKey->createKey( buf.makeStringAndClear() ) );
-
- rtl::OString const str(m_pServiceNames);
- sal_Int32 nIndex = 0;
- do {
- rtl::OString const token( str.getToken( 0, m_cDelim, nIndex ) );
- xNewKey->createKey(
- rtl::OUString( token.getStr(), token.getLength(),
- RTL_TEXTENCODING_ASCII_US ) );
- }
- while (nIndex >= 0);
-
- bRet = true;
- }
- catch (registry::InvalidRegistryException const&) {
- OSL_ENSURE( false, "### InvalidRegistryException!" );
- }
- }
- return bRet;
-}
-
void * ServiceDecl::getFactory( sal_Char const* pImplName ) const
{
if (rtl_str_compare(m_pImplName, pImplName) == 0) {
diff --git a/comphelper/source/misc/storagehelper.cxx b/comphelper/source/misc/storagehelper.cxx
index db5ba71cd876..60ffa965fcf1 100644
--- a/comphelper/source/misc/storagehelper.cxx
+++ b/comphelper/source/misc/storagehelper.cxx
@@ -28,12 +28,15 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_comphelper.hxx"
#include <com/sun/star/embed/ElementModes.hpp>
-#include <com/sun/star/embed/XEncryptionProtectedSource.hpp>
+#include <com/sun/star/embed/XEncryptionProtectedSource2.hpp>
#include <com/sun/star/ucb/XSimpleFileAccess.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/beans/NamedValue.hpp>
#include <com/sun/star/beans/IllegalTypeException.hpp>
+#include <rtl/digest.h>
+
#include <ucbhelper/content.hxx>
#include <comphelper/fileformat.h>
@@ -236,16 +239,16 @@ uno::Reference< io::XInputStream > OStorageHelper::GetInputStreamFromURL(
}
// ----------------------------------------------------------------------
-void OStorageHelper::SetCommonStoragePassword(
+void OStorageHelper::SetCommonStorageEncryptionData(
const uno::Reference< embed::XStorage >& xStorage,
- const ::rtl::OUString& aPass )
+ const uno::Sequence< beans::NamedValue >& aEncryptionData )
throw ( uno::Exception )
{
- uno::Reference< embed::XEncryptionProtectedSource > xEncrSet( xStorage, uno::UNO_QUERY );
+ uno::Reference< embed::XEncryptionProtectedSource2 > xEncrSet( xStorage, uno::UNO_QUERY );
if ( !xEncrSet.is() )
throw io::IOException(); // TODO
- xEncrSet->setEncryptionPassword( aPass );
+ xEncrSet->setEncryptionData( aEncryptionData );
}
// ----------------------------------------------------------------------
@@ -419,6 +422,45 @@ uno::Reference< embed::XStorage > OStorageHelper::GetStorageOfFormatFromStream(
}
// ----------------------------------------------------------------------
+uno::Sequence< beans::NamedValue > OStorageHelper::CreatePackageEncryptionData( const ::rtl::OUString& aPassword )
+{
+ // TODO/LATER: Should not the method be part of DocPasswordHelper?
+ uno::Sequence< beans::NamedValue > aEncryptionData;
+ if ( aPassword.getLength() )
+ {
+ // MS_1252 encoding was used for SO60 document format password encoding,
+ // this encoding supports only a minor subset of nonascii characters,
+ // but for compatibility reasons it has to be used for old document formats
+ aEncryptionData.realloc( 2 );
+ aEncryptionData[0].Name = PACKAGE_ENCRYPTIONDATA_SHA1UTF8;
+ aEncryptionData[1].Name = PACKAGE_ENCRYPTIONDATA_SHA1MS1252;
+
+ rtl_TextEncoding pEncoding[2] = { RTL_TEXTENCODING_UTF8, RTL_TEXTENCODING_MS_1252 };
+
+ for ( sal_Int32 nInd = 0; nInd < 2; nInd++ )
+ {
+ ::rtl::OString aByteStrPass = ::rtl::OUStringToOString( aPassword, pEncoding[nInd] );
+
+ sal_uInt8 pBuffer[RTL_DIGEST_LENGTH_SHA1];
+ rtlDigestError nError = rtl_digest_SHA1( aByteStrPass.getStr(),
+ aByteStrPass.getLength(),
+ pBuffer,
+ RTL_DIGEST_LENGTH_SHA1 );
+
+ if ( nError != rtl_Digest_E_None )
+ {
+ aEncryptionData.realloc( 0 );
+ break;
+ }
+
+ aEncryptionData[nInd].Value <<= uno::Sequence< sal_Int8 >( (sal_Int8*)pBuffer, RTL_DIGEST_LENGTH_SHA1 );
+ }
+ }
+
+ return aEncryptionData;
+}
+
+// ----------------------------------------------------------------------
sal_Bool OStorageHelper::IsValidZipEntryFileName( const ::rtl::OUString& aName, sal_Bool bSlashAllowed )
{
return IsValidZipEntryFileName( aName.getStr(), aName.getLength(), bSlashAllowed );
diff --git a/comphelper/source/misc/uieventslogger.cxx b/comphelper/source/misc/uieventslogger.cxx
index 710c08fdd706..738a5ec6a8d3 100644
--- a/comphelper/source/misc/uieventslogger.cxx
+++ b/comphelper/source/misc/uieventslogger.cxx
@@ -175,6 +175,7 @@ namespace comphelper
static const OUString FN_ROTATEDLOG;
static const OUString LOGROTATE_EVENTNAME;
static const OUString URL_UNO;
+ static const OUString URL_SPECIAL;
static const OUString URL_FILE;
};
}
@@ -209,6 +210,7 @@ namespace comphelper
const OUString UiEventsLogger_Impl::LOGROTATE_EVENTNAME = OUString::createFromAscii("onOOoImprovementLogRotated");
const OUString UiEventsLogger_Impl::URL_UNO = OUString::createFromAscii(".uno:");
+ const OUString UiEventsLogger_Impl::URL_SPECIAL = OUString::createFromAscii(".special:");
const OUString UiEventsLogger_Impl::URL_FILE = OUString::createFromAscii("file:");
@@ -347,7 +349,12 @@ namespace comphelper
const Sequence<PropertyValue>& args)
{
if(!m_Active) return;
- if(!url.Complete.match(URL_UNO) && !url.Complete.match(URL_FILE)) return;
+ if(!url.Complete.match(URL_UNO)
+ && !url.Complete.match(URL_FILE)
+ && !url.Complete.match(URL_SPECIAL))
+ {
+ return;
+ }
checkIdleTimeout();
Sequence<OUString> logdata = Sequence<OUString>(COLUMNS);
diff --git a/comphelper/source/officeinstdir/officeinstallationdirectories.cxx b/comphelper/source/officeinstdir/officeinstallationdirectories.cxx
index 3ce0d4de865a..ebeedc92839d 100644
--- a/comphelper/source/officeinstdir/officeinstallationdirectories.cxx
+++ b/comphelper/source/officeinstdir/officeinstallationdirectories.cxx
@@ -101,10 +101,12 @@ static bool makeCanonicalFileURL( rtl::OUString & rURL )
OfficeInstallationDirectories::OfficeInstallationDirectories(
const uno::Reference< uno::XComponentContext > & xCtx )
-: m_aOfficeDirMacro( RTL_CONSTASCII_USTRINGPARAM( "$(baseinsturl)" ) ),
+: m_aOfficeBrandDirMacro( RTL_CONSTASCII_USTRINGPARAM( "$(brandbaseurl)" ) ),
+ m_aOfficeBaseDirMacro( RTL_CONSTASCII_USTRINGPARAM( "$(baseinsturl)" ) ),
m_aUserDirMacro( RTL_CONSTASCII_USTRINGPARAM( "$(userdataurl)" ) ),
m_xCtx( xCtx ),
- m_pOfficeDir( 0 ),
+ m_pOfficeBrandDir( 0 ),
+ m_pOfficeBaseDir( 0 ),
m_pUserDir( 0 )
{
}
@@ -113,6 +115,9 @@ OfficeInstallationDirectories::OfficeInstallationDirectories(
// virtual
OfficeInstallationDirectories::~OfficeInstallationDirectories()
{
+ delete m_pOfficeBrandDir;
+ delete m_pOfficeBaseDir;
+ delete m_pUserDir;
}
//=========================================================================
@@ -124,9 +129,8 @@ rtl::OUString SAL_CALL
OfficeInstallationDirectories::getOfficeInstallationDirectoryURL()
throw ( uno::RuntimeException )
{
- // late init m_pOfficeDir and m_pUserDir
initDirs();
- return rtl::OUString( *m_pOfficeDir );
+ return rtl::OUString( *m_pOfficeBrandDir );
}
//=========================================================================
@@ -135,7 +139,6 @@ rtl::OUString SAL_CALL
OfficeInstallationDirectories::getOfficeUserDataDirectoryURL()
throw ( uno::RuntimeException )
{
- // late init m_pOfficeDir and m_pUserDir
initDirs();
return rtl::OUString( *m_pUserDir );
}
@@ -149,29 +152,39 @@ OfficeInstallationDirectories::makeRelocatableURL( const rtl::OUString& URL )
{
if ( URL.getLength() > 0 )
{
- // late init m_pOfficeDir and m_pUserDir
initDirs();
rtl::OUString aCanonicalURL( URL );
makeCanonicalFileURL( aCanonicalURL );
- sal_Int32 nIndex = aCanonicalURL.indexOf( *m_pOfficeDir );
+ sal_Int32 nIndex = aCanonicalURL.indexOf( *m_pOfficeBrandDir );
if ( nIndex != -1 )
{
return rtl::OUString(
URL.replaceAt( nIndex,
- m_pOfficeDir->getLength(),
- m_aOfficeDirMacro ) );
+ m_pOfficeBrandDir->getLength(),
+ m_aOfficeBrandDirMacro ) );
}
else
{
- nIndex = aCanonicalURL.indexOf( *m_pUserDir );
+ nIndex = aCanonicalURL.indexOf( *m_pOfficeBaseDir );
if ( nIndex != -1 )
{
return rtl::OUString(
URL.replaceAt( nIndex,
- m_pUserDir->getLength(),
- m_aUserDirMacro ) );
+ m_pOfficeBaseDir->getLength(),
+ m_aOfficeBaseDirMacro ) );
+ }
+ else
+ {
+ nIndex = aCanonicalURL.indexOf( *m_pUserDir );
+ if ( nIndex != -1 )
+ {
+ return rtl::OUString(
+ URL.replaceAt( nIndex,
+ m_pUserDir->getLength(),
+ m_aUserDirMacro ) );
+ }
}
}
}
@@ -186,29 +199,40 @@ OfficeInstallationDirectories::makeAbsoluteURL( const rtl::OUString& URL )
{
if ( URL.getLength() > 0 )
{
- sal_Int32 nIndex = URL.indexOf( m_aOfficeDirMacro );
+ sal_Int32 nIndex = URL.indexOf( m_aOfficeBrandDirMacro );
if ( nIndex != -1 )
{
- // late init m_pOfficeDir and m_pUserDir
initDirs();
return rtl::OUString(
URL.replaceAt( nIndex,
- m_aOfficeDirMacro.getLength(),
- *m_pOfficeDir ) );
+ m_aOfficeBrandDirMacro.getLength(),
+ *m_pOfficeBrandDir ) );
}
else
{
- nIndex = URL.indexOf( m_aUserDirMacro );
+ nIndex = URL.indexOf( m_aOfficeBaseDirMacro );
if ( nIndex != -1 )
{
- // late init m_pOfficeDir and m_pUserDir
initDirs();
return rtl::OUString(
URL.replaceAt( nIndex,
- m_aUserDirMacro.getLength(),
- *m_pUserDir ) );
+ m_aOfficeBaseDirMacro.getLength(),
+ *m_pOfficeBaseDir ) );
+ }
+ else
+ {
+ nIndex = URL.indexOf( m_aUserDirMacro );
+ if ( nIndex != -1 )
+ {
+ initDirs();
+
+ return rtl::OUString(
+ URL.replaceAt( nIndex,
+ m_aUserDirMacro.getLength(),
+ *m_pUserDir ) );
+ }
}
}
}
@@ -300,13 +324,14 @@ OfficeInstallationDirectories::Create(
void OfficeInstallationDirectories::initDirs()
{
- if ( m_pOfficeDir == 0 )
+ if ( m_pOfficeBrandDir == 0 )
{
osl::MutexGuard aGuard( m_aMutex );
- if ( m_pOfficeDir == 0 )
+ if ( m_pOfficeBrandDir == 0 )
{
- m_pOfficeDir = new rtl::OUString;
- m_pUserDir = new rtl::OUString;
+ m_pOfficeBrandDir = new rtl::OUString;
+ m_pOfficeBaseDir = new rtl::OUString;
+ m_pUserDir = new rtl::OUString;
uno::Reference< util::XMacroExpander > xExpander;
@@ -320,15 +345,24 @@ void OfficeInstallationDirectories::initDirs()
if ( xExpander.is() )
{
- *m_pOfficeDir =
+ *m_pOfficeBrandDir =
+ xExpander->expandMacros(
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "$BRAND_BASE_DIR" ) ) );
+
+ OSL_ENSURE( m_pOfficeBrandDir->getLength() > 0,
+ "Unable to obtain office brand installation directory!" );
+
+ makeCanonicalFileURL( *m_pOfficeBrandDir );
+
+ *m_pOfficeBaseDir =
xExpander->expandMacros(
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
"${$BRAND_BASE_DIR/program/" SAL_CONFIGFILE( "bootstrap" ) ":BaseInstallation}" ) ) );
- OSL_ENSURE( m_pOfficeDir->getLength() > 0,
- "Unable to obtain office installation directory!" );
+ OSL_ENSURE( m_pOfficeBaseDir->getLength() > 0,
+ "Unable to obtain office base installation directory!" );
- makeCanonicalFileURL( *m_pOfficeDir );
+ makeCanonicalFileURL( *m_pOfficeBaseDir );
*m_pUserDir =
xExpander->expandMacros(
@@ -336,7 +370,7 @@ void OfficeInstallationDirectories::initDirs()
"${$BRAND_BASE_DIR/program/" SAL_CONFIGFILE( "bootstrap" ) ":UserInstallation}" ) ) );
OSL_ENSURE( m_pUserDir->getLength() > 0,
- "Unable to obtain office user data directory!" );
+ "Unable to obtain office user data directory!" );
makeCanonicalFileURL( *m_pUserDir );
}
diff --git a/comphelper/source/officeinstdir/officeinstallationdirectories.hxx b/comphelper/source/officeinstdir/officeinstallationdirectories.hxx
index 2ffb3582718a..9c56f7ce80fd 100644
--- a/comphelper/source/officeinstdir/officeinstallationdirectories.hxx
+++ b/comphelper/source/officeinstdir/officeinstallationdirectories.hxx
@@ -94,11 +94,13 @@ public:
private:
void initDirs();
- rtl::OUString m_aOfficeDirMacro;
+ rtl::OUString m_aOfficeBrandDirMacro;
+ rtl::OUString m_aOfficeBaseDirMacro;
rtl::OUString m_aUserDirMacro;
com::sun::star::uno::Reference<
com::sun::star::uno::XComponentContext > m_xCtx;
- rtl::OUString * m_pOfficeDir;
+ rtl::OUString * m_pOfficeBrandDir;
+ rtl::OUString * m_pOfficeBaseDir;
rtl::OUString * m_pUserDir;
};
diff --git a/comphelper/source/property/propagg.cxx b/comphelper/source/property/propagg.cxx
index e796c29eba90..9c2fd868d973 100644
--- a/comphelper/source/property/propagg.cxx
+++ b/comphelper/source/property/propagg.cxx
@@ -87,20 +87,36 @@ OPropertyArrayAggregationHelper::OPropertyArrayAggregationHelper(
const Property* pDelegateProps = _rProperties.getConstArray();
Property* pMergedProps = m_aProperties.getArray();
+ // if properties are present both at the delegatee and the aggregate, then the former are supposed to win.
+ // So, we'll need an existence check.
+ ::std::set< ::rtl::OUString > aDelegatorProps;
+
// create the map for the delegator properties
sal_Int32 nMPLoop = 0;
for ( ; nMPLoop < nDelegatorProps; ++nMPLoop, ++pDelegateProps )
+ {
m_aPropertyAccessors[ pDelegateProps->Handle ] = OPropertyAccessor( -1, nMPLoop, sal_False );
+ OSL_ENSURE( aDelegatorProps.find( pDelegateProps->Name ) == aDelegatorProps.end(),
+ "OPropertyArrayAggregationHelper::OPropertyArrayAggregationHelper: duplicate delegatee property!" );
+ aDelegatorProps.insert( pDelegateProps->Name );
+ }
// create the map for the aggregate properties
sal_Int32 nAggregateHandle = _nFirstAggregateId;
pMergedProps += nDelegatorProps;
- for ( ; nMPLoop < nMergedProps; ++nMPLoop, ++pMergedProps, ++pAggregateProps )
+ for ( ; nMPLoop < nMergedProps; ++pAggregateProps )
{
+ // if the aggregate property is present at the delegatee already, ignore it
+ if ( aDelegatorProps.find( pAggregateProps->Name ) != aDelegatorProps.end() )
+ {
+ --nMergedProps;
+ continue;
+ }
+
// next aggregate property - remember it
*pMergedProps = *pAggregateProps;
- // determine the handle for the property which we will expose to the ourside world
+ // determine the handle for the property which we will expose to the outside world
sal_Int32 nHandle = -1;
// ask the infor service first
if ( _pInfoService )
@@ -123,7 +139,11 @@ OPropertyArrayAggregationHelper::OPropertyArrayAggregationHelper(
// remember the accessor for this property
m_aPropertyAccessors[ nHandle ] = OPropertyAccessor( pMergedProps->Handle, nMPLoop, sal_True );
pMergedProps->Handle = nHandle;
+
+ ++nMPLoop;
+ ++pMergedProps;
}
+ m_aProperties.realloc( nMergedProps );
pMergedProps = m_aProperties.getArray(); // reset, needed again below
// sortieren der Properties nach Namen
diff --git a/comphelper/util/comphelp4.component b/comphelper/util/comphelp4.component
new file mode 100644
index 000000000000..10d23d48bcea
--- /dev/null
+++ b/comphelper/util/comphelp4.component
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="AnyCompareFactory">
+ <service name="com.sun.star.ucb.AnyCompareFactory"/>
+ </implementation>
+ <implementation name="IndexedPropertyValuesContainer">
+ <service name="com.sun.star.document.IndexedPropertyValues"/>
+ </implementation>
+ <implementation name="NamedPropertyValuesContainer">
+ <service name="com.sun.star.document.NamedPropertyValues"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.MemoryStream">
+ <service name="com.sun.star.comp.MemoryStream"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.SequenceInputStreamService">
+ <service name="com.sun.star.io.SequenceInputStream"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.SequenceOutputStreamService">
+ <service name="com.sun.star.io.SequenceOutputStream"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.comphelper.OPropertyBag">
+ <service name="com.sun.star.beans.PropertyBag"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.embed.InstanceLocker">
+ <service name="com.sun.star.embed.InstanceLocker"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.logging.SimpleLogRing">
+ <service name="com.sun.star.logging.SimpleLogRing"/>
+ <singleton name="com.sun.star.logging.DocumentIOLogRing"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.task.OfficeRestartManager">
+ <service name="com.sun.star.comp.task.OfficeRestartManager"/>
+ <singleton name="com.sun.star.task.OfficeRestartManager"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.util.OfficeInstallationDirectories">
+ <service name="com.sun.star.util.OfficeInstallationDirectories"/>
+ <singleton name="com.sun.star.util.theOfficeInstallationDirectories"/>
+ </implementation>
+ <implementation name="org.openoffice.comp.comphelper.EnumerableMap">
+ <service name="com.sun.star.container.EnumerableMap"/>
+ </implementation>
+</component>
diff --git a/comphelper/util/exports.dxp b/comphelper/util/exports.dxp
index 0c2e3e7cddd7..0cb5620a1603 100644
--- a/comphelper/util/exports.dxp
+++ b/comphelper/util/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory \ No newline at end of file
diff --git a/comphelper/util/makefile.mk b/comphelper/util/makefile.mk
index ae391e92abf7..62e66672a1cb 100644
--- a/comphelper/util/makefile.mk
+++ b/comphelper/util/makefile.mk
@@ -68,3 +68,11 @@ DEFLIB1NAME=$(TARGET)
# --- Targets ----------------------------------
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/comphelp4.component
+
+$(MISC)/comphelp4.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ comphelp4.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt comphelp4.component
diff --git a/cppcanvas/inc/cppcanvas/renderer.hxx b/cppcanvas/inc/cppcanvas/renderer.hxx
index 780a27f31503..0b8bb43d7e3e 100644
--- a/cppcanvas/inc/cppcanvas/renderer.hxx
+++ b/cppcanvas/inc/cppcanvas/renderer.hxx
@@ -32,7 +32,7 @@
#include <rtl/ustring.hxx>
#include <boost/shared_ptr.hpp>
-#include <comphelper/optionalvalue.hxx>
+#include <boost/optional.hpp>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <cppcanvas/canvasgraphic.hxx>
#include <cppcanvas/color.hxx>
@@ -109,16 +109,16 @@ namespace cppcanvas
struct Parameters
{
/// Optionally forces the fill color attribute for all actions
- ::comphelper::OptionalValue< Color::IntSRGBA > maFillColor;
+ ::boost::optional< Color::IntSRGBA > maFillColor;
/// Optionally forces the line color attribute for all actions
- ::comphelper::OptionalValue< Color::IntSRGBA > maLineColor;
+ ::boost::optional< Color::IntSRGBA > maLineColor;
/// Optionally forces the text color attribute for all actions
- ::comphelper::OptionalValue< Color::IntSRGBA > maTextColor;
+ ::boost::optional< Color::IntSRGBA > maTextColor;
/// Optionally forces the given fontname for all text actions
- ::comphelper::OptionalValue< ::rtl::OUString > maFontName;
+ ::boost::optional< ::rtl::OUString > maFontName;
/** Optionally transforms all text output actions with the
given matrix (in addition to the overall canvas
@@ -128,16 +128,16 @@ namespace cppcanvas
rect coordinate system, i.e. the metafile is assumed
to be contained in the unit rect.
*/
- ::comphelper::OptionalValue< ::basegfx::B2DHomMatrix > maTextTransformation;
+ ::boost::optional< ::basegfx::B2DHomMatrix > maTextTransformation;
/// Optionally forces the given font weight for all text actions
- ::comphelper::OptionalValue< sal_Int8 > maFontWeight;
+ ::boost::optional< sal_Int8 > maFontWeight;
/// Optionally forces the given font letter form (italics etc.) for all text actions
- ::comphelper::OptionalValue< sal_Int8 > maFontLetterForm;
+ ::boost::optional< sal_Int8 > maFontLetterForm;
/// Optionally forces underlining for all text actions
- ::comphelper::OptionalValue< bool > maFontUnderline;
+ ::boost::optional< bool > maFontUnderline;
};
};
diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx
index 1423cd42ed93..006d55a01de6 100644
--- a/cppcanvas/source/mtfrenderer/implrenderer.cxx
+++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx
@@ -831,8 +831,8 @@ namespace cppcanvas
{
rendering::FontRequest aFontRequest;
- if( rParms.mrParms.maFontName.isValid() )
- aFontRequest.FontDescription.FamilyName = rParms.mrParms.maFontName.getValue();
+ if( rParms.mrParms.maFontName.is_initialized() )
+ aFontRequest.FontDescription.FamilyName = *rParms.mrParms.maFontName;
else
aFontRequest.FontDescription.FamilyName = rFont.GetName();
@@ -843,12 +843,12 @@ namespace cppcanvas
// TODO(F2): improve vclenum->panose conversion
aFontRequest.FontDescription.FontDescription.Weight =
- rParms.mrParms.maFontWeight.isValid() ?
- rParms.mrParms.maFontWeight.getValue() :
+ rParms.mrParms.maFontWeight.is_initialized() ?
+ *rParms.mrParms.maFontWeight :
::canvas::tools::numeric_cast<sal_Int8>( ::basegfx::fround( rFont.GetWeight() ) );
aFontRequest.FontDescription.FontDescription.Letterform =
- rParms.mrParms.maFontLetterForm.isValid() ?
- rParms.mrParms.maFontLetterForm.getValue() :
+ rParms.mrParms.maFontLetterForm.is_initialized() ?
+ *rParms.mrParms.maFontLetterForm :
(rFont.GetItalic() == ITALIC_NONE) ? 0 : 9;
LanguageType aLang = rFont.GetLanguage();
@@ -1445,7 +1445,7 @@ namespace cppcanvas
break;
case META_LINECOLOR_ACTION:
- if( !rParms.maLineColor.isValid() )
+ if( !rParms.maLineColor.is_initialized() )
{
setStateColor( static_cast<MetaLineColorAction*>(pCurrAct),
getState( rStates ).isLineColorSet,
@@ -1455,7 +1455,7 @@ namespace cppcanvas
break;
case META_FILLCOLOR_ACTION:
- if( !rParms.maFillColor.isValid() )
+ if( !rParms.maFillColor.is_initialized() )
{
setStateColor( static_cast<MetaFillColorAction*>(pCurrAct),
getState( rStates ).isFillColorSet,
@@ -1466,7 +1466,7 @@ namespace cppcanvas
case META_TEXTCOLOR_ACTION:
{
- if( !rParms.maTextColor.isValid() )
+ if( !rParms.maTextColor.is_initialized() )
{
// Text color is set unconditionally, thus, no
// use of setStateColor here
@@ -1486,7 +1486,7 @@ namespace cppcanvas
break;
case META_TEXTFILLCOLOR_ACTION:
- if( !rParms.maTextColor.isValid() )
+ if( !rParms.maTextColor.is_initialized() )
{
setStateColor( static_cast<MetaTextFillColorAction*>(pCurrAct),
getState( rStates ).isTextFillColorSet,
@@ -1496,7 +1496,7 @@ namespace cppcanvas
break;
case META_TEXTLINECOLOR_ACTION:
- if( !rParms.maTextColor.isValid() )
+ if( !rParms.maTextColor.is_initialized() )
{
setStateColor( static_cast<MetaTextLineColorAction*>(pCurrAct),
getState( rStates ).isTextLineColorSet,
@@ -1526,8 +1526,8 @@ namespace cppcanvas
// TODO(Q2): define and use appropriate enumeration types
rState.textReliefStyle = (sal_Int8)rFont.GetRelief();
rState.textOverlineStyle = (sal_Int8)rFont.GetOverline();
- rState.textUnderlineStyle = rParms.maFontUnderline.isValid() ?
- (rParms.maFontUnderline.getValue() ? (sal_Int8)UNDERLINE_SINGLE : (sal_Int8)UNDERLINE_NONE) :
+ rState.textUnderlineStyle = rParms.maFontUnderline.is_initialized() ?
+ (*rParms.maFontUnderline ? (sal_Int8)UNDERLINE_SINGLE : (sal_Int8)UNDERLINE_NONE) :
(sal_Int8)rFont.GetUnderline();
rState.textStrikeoutStyle = (sal_Int8)rFont.GetStrikeout();
rState.textEmphasisMarkStyle = (sal_Int8)rFont.GetEmphasisMark();
@@ -2946,28 +2946,28 @@ namespace cppcanvas
getState( aStateStack ).textLineColor = pColor->getDeviceColor( 0x000000FF );
// apply overrides from the Parameters struct
- if( rParams.maFillColor.isValid() )
+ if( rParams.maFillColor.is_initialized() )
{
getState( aStateStack ).isFillColorSet = true;
- getState( aStateStack ).fillColor = pColor->getDeviceColor( rParams.maFillColor.getValue() );
+ getState( aStateStack ).fillColor = pColor->getDeviceColor( *rParams.maFillColor );
}
- if( rParams.maLineColor.isValid() )
+ if( rParams.maLineColor.is_initialized() )
{
getState( aStateStack ).isLineColorSet = true;
- getState( aStateStack ).lineColor = pColor->getDeviceColor( rParams.maLineColor.getValue() );
+ getState( aStateStack ).lineColor = pColor->getDeviceColor( *rParams.maLineColor );
}
- if( rParams.maTextColor.isValid() )
+ if( rParams.maTextColor.is_initialized() )
{
getState( aStateStack ).isTextFillColorSet = true;
getState( aStateStack ).isTextLineColorSet = true;
getState( aStateStack ).textColor =
getState( aStateStack ).textFillColor =
- getState( aStateStack ).textLineColor = pColor->getDeviceColor( rParams.maTextColor.getValue() );
+ getState( aStateStack ).textLineColor = pColor->getDeviceColor( *rParams.maTextColor );
}
- if( rParams.maFontName.isValid() ||
- rParams.maFontWeight.isValid() ||
- rParams.maFontLetterForm.isValid() ||
- rParams.maFontUnderline.isValid() )
+ if( rParams.maFontName.is_initialized() ||
+ rParams.maFontWeight.is_initialized() ||
+ rParams.maFontLetterForm.is_initialized() ||
+ rParams.maFontUnderline.is_initialized() )
{
::cppcanvas::internal::OutDevState& rState = getState( aStateStack );
diff --git a/cppcanvas/source/mtfrenderer/textaction.cxx b/cppcanvas/source/mtfrenderer/textaction.cxx
index bc4cf6688ca3..56ce197b7e8e 100644
--- a/cppcanvas/source/mtfrenderer/textaction.cxx
+++ b/cppcanvas/source/mtfrenderer/textaction.cxx
@@ -2069,7 +2069,7 @@ namespace cppcanvas
rCanvas->getUNOCanvas()->getDevice(),
aResultingPolyPolygon ) );
- if( rParms.maTextTransformation.isValid() )
+ if( rParms.maTextTransformation.is_initialized() )
{
return ActionSharedPtr(
new OutlineAction(
@@ -2085,7 +2085,7 @@ namespace cppcanvas
rVDev,
rCanvas,
rState,
- rParms.maTextTransformation.getValue() ) );
+ *rParms.maTextTransformation ) );
}
else
{
@@ -2186,7 +2186,7 @@ namespace cppcanvas
rShadowColor == aEmptyColor )
{
// nope
- if( rParms.maTextTransformation.isValid() )
+ if( rParms.maTextTransformation.is_initialized() )
{
return ActionSharedPtr( new TextAction(
aStartPoint,
@@ -2195,7 +2195,7 @@ namespace cppcanvas
nLen,
rCanvas,
rState,
- rParms.maTextTransformation.getValue() ) );
+ *rParms.maTextTransformation ) );
}
else
{
@@ -2211,7 +2211,7 @@ namespace cppcanvas
else
{
// at least one of the effects requested
- if( rParms.maTextTransformation.isValid() )
+ if( rParms.maTextTransformation.is_initialized() )
return ActionSharedPtr( new EffectTextAction(
aStartPoint,
aReliefOffset,
@@ -2224,7 +2224,7 @@ namespace cppcanvas
rVDev,
rCanvas,
rState,
- rParms.maTextTransformation.getValue() ) );
+ *rParms.maTextTransformation ) );
else
return ActionSharedPtr( new EffectTextAction(
aStartPoint,
@@ -2250,7 +2250,7 @@ namespace cppcanvas
rShadowColor == aEmptyColor )
{
// nope
- if( rParms.maTextTransformation.isValid() )
+ if( rParms.maTextTransformation.is_initialized() )
return ActionSharedPtr( new TextArrayAction(
aStartPoint,
rText,
@@ -2259,7 +2259,7 @@ namespace cppcanvas
aCharWidths,
rCanvas,
rState,
- rParms.maTextTransformation.getValue() ) );
+ *rParms.maTextTransformation ) );
else
return ActionSharedPtr( new TextArrayAction(
aStartPoint,
@@ -2273,7 +2273,7 @@ namespace cppcanvas
else
{
// at least one of the effects requested
- if( rParms.maTextTransformation.isValid() )
+ if( rParms.maTextTransformation.is_initialized() )
return ActionSharedPtr( new EffectTextArrayAction(
aStartPoint,
aReliefOffset,
@@ -2287,7 +2287,7 @@ namespace cppcanvas
rVDev,
rCanvas,
rState,
- rParms.maTextTransformation.getValue() ) );
+ *rParms.maTextTransformation ) );
else
return ActionSharedPtr( new EffectTextArrayAction(
aStartPoint,
diff --git a/dtrans/prj/d.lst b/dtrans/prj/d.lst
index a1a7c2e95480..955aa075f24b 100644
--- a/dtrans/prj/d.lst
+++ b/dtrans/prj/d.lst
@@ -7,3 +7,8 @@
..\source\win32\ftransl\ftransl.xml %_DEST%\xml%_EXT%\ftransl.xml
..\source\cnttype\mcnttype.xml %_DEST%\xml%_EXT%\mcnttype.xml
..\source\generic\dtrans.xml %_DEST%\xml%_EXT%\dtrans.xml
+..\%__SRC%\misc\dnd.component %_DEST%\xml%_EXT%\dnd.component
+..\%__SRC%\misc\dtrans.component %_DEST%\xml%_EXT%\dtrans.component
+..\%__SRC%\misc\ftransl.component %_DEST%\xml%_EXT%\ftransl.component
+..\%__SRC%\misc\mcnttype.component %_DEST%\xml%_EXT%\mcnttype.component
+..\%__SRC%\misc\sysdtrans.component %_DEST%\xml%_EXT%\sysdtrans.component
diff --git a/dtrans/source/cnttype/exports.dxp b/dtrans/source/cnttype/exports.dxp
index 028ac4175990..f0e1c69934bc 100644
--- a/dtrans/source/cnttype/exports.dxp
+++ b/dtrans/source/cnttype/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/dtrans/source/cnttype/mctfentry.cxx b/dtrans/source/cnttype/mctfentry.cxx
index 095c9ed186ce..3d2e41201887 100644
--- a/dtrans/source/cnttype/mctfentry.cxx
+++ b/dtrans/source/cnttype/mctfentry.cxx
@@ -99,35 +99,6 @@ void SAL_CALL component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-//-------------------------------------------------------------------------
-// component_writeInfo - to register a UNO-Service
-// to register a UNO-Service use: regcomp -register -r *.rdb -c *.dll
-// to view the registry use: regview *.rdb /SERVICES/ServiceName
-// (you must use the full services name e.g. com.sun.star.frame.FilePicker
-//-------------------------------------------------------------------------
-
-sal_Bool SAL_CALL component_writeInfo( void* /*pServiceManager*/, void* pRegistryKey )
-{
- sal_Bool bRetVal = sal_False;
-
- if ( pRegistryKey )
- {
- try
- {
- Reference< XRegistryKey > pXNewKey( static_cast< XRegistryKey* >( pRegistryKey ) );
- pXNewKey->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM( MIMECONTENTTYPEFACTORY_REGKEY_NAME ) ) );
- bRetVal = sal_True;
- }
- catch( InvalidRegistryException& )
- {
- OSL_ENSURE(sal_False, "InvalidRegistryException caught");
- bRetVal = sal_False;
- }
- }
-
- return bRetVal;
-}
-
//----------------------------------------------------------------------
// component_getFactory
// returns a factory to create XFilePicker-Services
diff --git a/dtrans/source/generic/dtrans.component b/dtrans/source/generic/dtrans.component
new file mode 100644
index 000000000000..69034f716907
--- /dev/null
+++ b/dtrans/source/generic/dtrans.component
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.datatransfer.ClipboardManager">
+ <service name="com.sun.star.datatransfer.clipboard.ClipboardManager"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.datatransfer.clipboard.GenericClipboard">
+ <service name="com.sun.star.datatransfer.clipboard.GenericClipboard"/>
+ </implementation>
+</component>
diff --git a/dtrans/source/generic/dtrans.cxx b/dtrans/source/generic/dtrans.cxx
index 1e69158a6a12..4b39298f97c2 100644
--- a/dtrans/source/generic/dtrans.cxx
+++ b/dtrans/source/generic/dtrans.cxx
@@ -52,43 +52,6 @@ void SAL_CALL component_getImplementationEnvironment(const sal_Char ** ppEnvType
//==================================================================================================
-sal_Bool SAL_CALL component_writeInfo(void * /*pServiceManager*/, void * pRegistryKey )
-{
- if (pRegistryKey)
- {
- try
- {
- Reference< XRegistryKey > xNewKey(
- reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey(
- OUString::createFromAscii("/" CLIPBOARDMANAGER_IMPLEMENTATION_NAME "/UNO/SERVICES" ) ) );
-
- const Sequence< OUString > & rSNL = ClipboardManager_getSupportedServiceNames();
- const OUString * pArray = rSNL.getConstArray();
- sal_Int32 nPos;
- for ( nPos = rSNL.getLength(); nPos--; )
- xNewKey->createKey( pArray[nPos] );
-
- xNewKey = reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey(
- OUString::createFromAscii("/" GENERIC_CLIPBOARD_IMPLEMENTATION_NAME "/UNO/SERVICES" ) );
-
- const Sequence< OUString > & rSNL2 = GenericClipboard_getSupportedServiceNames();
- pArray = rSNL2.getConstArray();
- for ( nPos = rSNL2.getLength(); nPos--; )
- xNewKey->createKey( pArray[nPos] );
-
- return sal_True;
- }
- catch (InvalidRegistryException &)
- {
- OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
- }
- }
-
- return sal_False;
-}
-
-//==================================================================================================
-
void * SAL_CALL component_getFactory(
const sal_Char * pImplName,
void * pServiceManager,
diff --git a/dtrans/source/generic/exports.dxp b/dtrans/source/generic/exports.dxp
index 9630d7e06768..f0e1c69934bc 100644
--- a/dtrans/source/generic/exports.dxp
+++ b/dtrans/source/generic/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/dtrans/source/generic/makefile.mk b/dtrans/source/generic/makefile.mk
index e015400c32d9..2518b86a2d92 100644
--- a/dtrans/source/generic/makefile.mk
+++ b/dtrans/source/generic/makefile.mk
@@ -65,3 +65,11 @@ DEF1EXPORTFILE= exports.dxp
.ENDIF # L10N_framework
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/dtrans.component
+
+$(MISC)/dtrans.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ dtrans.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt dtrans.component
diff --git a/dtrans/source/os2/clipb/Os2Service.cxx b/dtrans/source/os2/clipb/Os2Service.cxx
index cc3e1e9a9b94..0c3e299f0299 100644
--- a/dtrans/source/os2/clipb/Os2Service.cxx
+++ b/dtrans/source/os2/clipb/Os2Service.cxx
@@ -56,28 +56,6 @@ void SAL_CALL component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-sal_Bool SAL_CALL component_writeInfo( void* pServiceManager, void* pRegistryKey )
-{
- sal_Bool bRetVal = sal_False;
-
- if ( pRegistryKey )
- {
- try
- {
- Reference< XRegistryKey > pXNewKey( static_cast< XRegistryKey* >( pRegistryKey ) );
- pXNewKey->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM( OS2_CLIPBOARD_REGKEY_NAME ) ) );
- bRetVal = sal_True;
- }
- 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;
diff --git a/dtrans/source/os2/clipb/exports.dxp b/dtrans/source/os2/clipb/exports.dxp
index f72beb0fcb31..926e49f5f1a5 100644
--- a/dtrans/source/os2/clipb/exports.dxp
+++ b/dtrans/source/os2/clipb/exports.dxp
@@ -1,4 +1,3 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/dtrans/source/win32/clipb/exports.dxp b/dtrans/source/win32/clipb/exports.dxp
index f72beb0fcb31..926e49f5f1a5 100644
--- a/dtrans/source/win32/clipb/exports.dxp
+++ b/dtrans/source/win32/clipb/exports.dxp
@@ -1,4 +1,3 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/dtrans/source/win32/clipb/wcbentry.cxx b/dtrans/source/win32/clipb/wcbentry.cxx
index 986e7b4c4db7..653d97194efc 100644
--- a/dtrans/source/win32/clipb/wcbentry.cxx
+++ b/dtrans/source/win32/clipb/wcbentry.cxx
@@ -97,35 +97,6 @@ void SAL_CALL component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-//-------------------------------------------------------------------------
-// component_writeInfo - to register a UNO-Service
-// to register a UNO-Service use: regcomp -register -r *.rdb -c *.dll
-// to view the registry use: regview *.rdb /SERVICES/ServiceName
-// (you must use the full services name e.g. com.sun.star.frame.FilePicker
-//-------------------------------------------------------------------------
-
-sal_Bool SAL_CALL component_writeInfo( void* /*pServiceManager*/, void* pRegistryKey )
-{
- sal_Bool bRetVal = sal_False;
-
- if ( pRegistryKey )
- {
- try
- {
- Reference< XRegistryKey > pXNewKey( static_cast< XRegistryKey* >( pRegistryKey ) );
- pXNewKey->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM( WINCLIPBOARD_REGKEY_NAME ) ) );
- bRetVal = sal_True;
- }
- catch( InvalidRegistryException& )
- {
- OSL_ENSURE(sal_False, "InvalidRegistryException caught");
- bRetVal = sal_False;
- }
- }
-
- return bRetVal;
-}
-
//----------------------------------------------------------------------
// component_getFactory
// returns a factory to create XFilePicker-Services
diff --git a/dtrans/source/win32/dnd/dndentry.cxx b/dtrans/source/win32/dnd/dndentry.cxx
index 2ea9b7746def..d37fa07ba3bd 100644
--- a/dtrans/source/win32/dnd/dndentry.cxx
+++ b/dtrans/source/win32/dnd/dndentry.cxx
@@ -72,39 +72,6 @@ void SAL_CALL component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-//-------------------------------------------------------------------------
-// component_writeInfo - to register a UNO-Service
-// to register a UNO-Service use: regcomp -register -r *.rdb -c *.dll
-// to view the registry use: regview *.rdb /SERVICES/ServiceName
-// (you must use the full services name e.g. com.sun.star.frame.FilePicker
-//-------------------------------------------------------------------------
-
-sal_Bool SAL_CALL component_writeInfo( void* /*pServiceManager*/, void* pRegistryKey )
-{
- sal_Bool bRetVal = sal_False;
-
- if ( pRegistryKey )
- {
- try
- {
- Reference< XRegistryKey > pXNewKey( static_cast< XRegistryKey* >( pRegistryKey ) );
- pXNewKey->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM( DNDSOURCE_REGKEY_NAME ) ) );
- bRetVal = sal_True;
-
- pXNewKey= static_cast< XRegistryKey* >( pRegistryKey );
- pXNewKey->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM( DNDTARGET_REGKEY_NAME ) ) );
- bRetVal = sal_True;
- }
- catch( InvalidRegistryException& )
- {
- OSL_ENSURE(sal_False, "InvalidRegistryException caught");
- bRetVal = sal_False;
- }
- }
-
- return bRetVal;
-}
-
//----------------------------------------------------------------------
// component_getFactory
// returns a factory to create XFilePicker-Services
diff --git a/dtrans/source/win32/dnd/exports.dxp b/dtrans/source/win32/dnd/exports.dxp
index 028ac4175990..f0e1c69934bc 100644
--- a/dtrans/source/win32/dnd/exports.dxp
+++ b/dtrans/source/win32/dnd/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/dtrans/source/win32/dtobj/DOTransferable.cxx b/dtrans/source/win32/dtobj/DOTransferable.cxx
index 951c3a69d291..c590bf0e6a80 100644..100755
--- a/dtrans/source/win32/dtobj/DOTransferable.cxx
+++ b/dtrans/source/win32/dtobj/DOTransferable.cxx
@@ -348,6 +348,15 @@ CDOTransferable::ByteSequence_t SAL_CALL CDOTransferable::getClipboardData( CFor
byteStream = WinENHMFPictToOOMFPict( stgmedium.hEnhMetaFile );
else if (CF_HDROP == aFormatEtc.getClipformat())
byteStream = CF_HDROPToFileList(stgmedium.hGlobal);
+ else if ( CF_BITMAP == aFormatEtc.getClipformat() )
+ {
+ byteStream = WinBITMAPToOOBMP(stgmedium.hBitmap);
+ if( aFormatEtc.getTymed() == TYMED_GDI &&
+ ! stgmedium.pUnkForRelease )
+ {
+ DeleteObject(stgmedium.hBitmap);
+ }
+ }
else
{
clipDataToByteStream( aFormatEtc.getClipformat( ), stgmedium, byteStream );
diff --git a/dtrans/source/win32/dtobj/FmtFilter.cxx b/dtrans/source/win32/dtobj/FmtFilter.cxx
index c8a8743647a9..c4f73977d92d 100644..100755
--- a/dtrans/source/win32/dtobj/FmtFilter.cxx
+++ b/dtrans/source/win32/dtobj/FmtFilter.cxx
@@ -534,3 +534,46 @@ ByteSequence_t CF_HDROPToFileList(HGLOBAL hGlobal)
return FileListToByteSequence(files);
}
+//------------------------------------------------------------------------
+// convert a windows bitmap handle into a openoffice bitmap
+//------------------------------------------------------------------------
+
+Sequence< sal_Int8 > SAL_CALL WinBITMAPToOOBMP( HBITMAP aHBMP )
+{
+ Sequence< sal_Int8 > ooBmpStream;
+
+ SIZE aBmpSize;
+ if( GetBitmapDimensionEx( aHBMP, &aBmpSize ) )
+ {
+ // fill bitmap info header
+ size_t nDataBytes = 4 * aBmpSize.cy * aBmpSize.cy;
+ Sequence< sal_Int8 > aBitmapStream(
+ sizeof(BITMAPINFO) +
+ nDataBytes
+ );
+ PBITMAPINFOHEADER pBmp = (PBITMAPINFOHEADER)aBitmapStream.getArray();
+ pBmp->biSize = sizeof( BITMAPINFOHEADER );
+ pBmp->biWidth = aBmpSize.cx;
+ pBmp->biHeight = aBmpSize.cy;
+ pBmp->biPlanes = 1;
+ pBmp->biBitCount = 32;
+ pBmp->biCompression = BI_RGB;
+ pBmp->biSizeImage = (DWORD)nDataBytes;
+ pBmp->biXPelsPerMeter = 1000;
+ pBmp->biYPelsPerMeter = 1000;
+ pBmp->biClrUsed = 0;
+ pBmp->biClrImportant = 0;
+ if( GetDIBits( 0, // DC, 0 is a default GC, basically that of the desktop
+ aHBMP,
+ 0, aBmpSize.cy,
+ aBitmapStream.getArray() + sizeof(BITMAPINFO),
+ (LPBITMAPINFO)pBmp,
+ DIB_RGB_COLORS ) )
+ {
+ ooBmpStream = WinDIBToOOBMP( aBitmapStream );
+ }
+ }
+
+ return ooBmpStream;
+}
+
diff --git a/dtrans/source/win32/dtobj/FmtFilter.hxx b/dtrans/source/win32/dtobj/FmtFilter.hxx
index 3f433561a3b1..84f764c9769b 100644..100755
--- a/dtrans/source/win32/dtobj/FmtFilter.hxx
+++ b/dtrans/source/win32/dtobj/FmtFilter.hxx
@@ -67,6 +67,12 @@ com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL WinDIBToOOBMP( const com::sun
/*------------------------------------------------------------------------
input:
+ aWinDIB - sequence of bytes containing a windows bitmap handle
+------------------------------------------------------------------------*/
+com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL WinBITMAPToOOBMP( HBITMAP );
+
+/*------------------------------------------------------------------------
+ input:
aOOBmp - sequence of bytes containing a openoffice bitmap
------------------------------------------------------------------------*/
com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL OOBmpToWinDIB( com::sun::star::uno::Sequence< sal_Int8 >& aOOBmp );
diff --git a/dtrans/source/win32/ftransl/exports.dxp b/dtrans/source/win32/ftransl/exports.dxp
index 028ac4175990..f0e1c69934bc 100644
--- a/dtrans/source/win32/ftransl/exports.dxp
+++ b/dtrans/source/win32/ftransl/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/dtrans/source/win32/ftransl/ftransl.cxx b/dtrans/source/win32/ftransl/ftransl.cxx
index c0a8264a71b8..98c6625bb33e 100644..100755
--- a/dtrans/source/win32/ftransl/ftransl.cxx
+++ b/dtrans/source/win32/ftransl/ftransl.cxx
@@ -281,6 +281,7 @@ void SAL_CALL CDataFormatTranslator::initTranslationTable()
m_TranslTable.push_back(FormatEntry("application/x-openoffice-dif;windows_formatname=\"DIF\"", "DIF", "DIF", CF_DIF, CPPUTYPE_DEFAULT));
// SOT_FORMAT_BITMAP
m_TranslTable.push_back(FormatEntry("application/x-openoffice-bitmap;windows_formatname=\"Bitmap\"", "Bitmap", "Bitmap", CF_DIB, CPPUTYPE_DEFAULT));
+ m_TranslTable.push_back(FormatEntry("application/x-openoffice-bitmap;windows_formatname=\"Bitmap\"", "Bitmap", "Bitmap", CF_BITMAP, CPPUTYPE_DEFAULT));
// SOT_FORMAT_STRING
m_TranslTable.push_back(FormatEntry("text/plain;charset=utf-16", "Unicode-Text", "", CF_UNICODETEXT, CppuType_String));
// Format Locale - for internal use
diff --git a/dtrans/source/win32/ftransl/ftranslentry.cxx b/dtrans/source/win32/ftransl/ftranslentry.cxx
index 01d1521b15bc..abdd27ffcdae 100644
--- a/dtrans/source/win32/ftransl/ftranslentry.cxx
+++ b/dtrans/source/win32/ftransl/ftranslentry.cxx
@@ -102,35 +102,6 @@ void SAL_CALL component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-//-------------------------------------------------------------------------
-// component_writeInfo - to register a UNO-Service
-// to register a UNO-Service use: regcomp -register -r *.rdb -c *.dll
-// to view the registry use: regview *.rdb /SERVICES/ServiceName
-// (you must use the full services name e.g. com.sun.star.frame.FilePicker
-//-------------------------------------------------------------------------
-
-sal_Bool SAL_CALL component_writeInfo( void* /*pServiceManager*/, void* pRegistryKey )
-{
- sal_Bool bRetVal = sal_False;
-
- if ( pRegistryKey )
- {
- try
- {
- Reference< XRegistryKey > pXNewKey( static_cast< XRegistryKey* >( pRegistryKey ) );
- pXNewKey->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM( REGKEY_NAME ) ) );
- bRetVal = sal_True;
- }
- catch( InvalidRegistryException& )
- {
- OSL_ENSURE(sal_False, "InvalidRegistryException caught");
- bRetVal = sal_False;
- }
- }
-
- return bRetVal;
-}
-
//----------------------------------------------------------------------
// component_getFactory
// returns a factory to create XFilePicker-Services
diff --git a/dtrans/util/dnd.component b/dtrans/util/dnd.component
new file mode 100644
index 000000000000..b56fe326f04f
--- /dev/null
+++ b/dtrans/util/dnd.component
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.datatransfer.dnd.OleDragSource_V1">
+ <service name="com.sun.star.datatransfer.dnd.OleDragSource"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.datatransfer.dnd.OleDropTarget_V1">
+ <service name="com.sun.star.datatransfer.dnd.OleDropTarget"/>
+ </implementation>
+</component>
diff --git a/dtrans/util/exports.dxp b/dtrans/util/exports.dxp
index 028ac4175990..f0e1c69934bc 100644
--- a/dtrans/util/exports.dxp
+++ b/dtrans/util/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/dtrans/util/ftransl.component b/dtrans/util/ftransl.component
new file mode 100644
index 000000000000..dad7d341cce7
--- /dev/null
+++ b/dtrans/util/ftransl.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.datatransfer.DataFormatTranslator">
+ <service name="com.sun.star.datatransfer.DataFormatTranslator"/>
+ </implementation>
+</component>
diff --git a/dtrans/util/makefile.mk b/dtrans/util/makefile.mk
index 0443c131ccb6..8df69bbf1d36 100644
--- a/dtrans/util/makefile.mk
+++ b/dtrans/util/makefile.mk
@@ -180,3 +180,32 @@ DEF3EXPORTFILE= exports.dxp
.INCLUDE : target.mk
+ALLTAR : \
+ $(MISC)/dnd.component \
+ $(MISC)/ftransl.component \
+ $(MISC)/mcnttype.component \
+ $(MISC)/sysdtrans.component
+
+$(MISC)/dnd.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ dnd.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL4TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt dnd.component
+
+$(MISC)/ftransl.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ ftransl.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL2TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt ftransl.component
+
+$(MISC)/mcnttype.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ mcnttype.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt mcnttype.component
+
+$(MISC)/sysdtrans.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ sysdtrans.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL3TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt sysdtrans.component
diff --git a/dtrans/util/mcnttype.component b/dtrans/util/mcnttype.component
new file mode 100644
index 000000000000..f5a937a7a77a
--- /dev/null
+++ b/dtrans/util/mcnttype.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.datatransfer.MimeCntTypeFactory">
+ <service name="com.sun.star.datatransfer.MimeContentTypeFactory"/>
+ </implementation>
+</component>
diff --git a/dtrans/util/sysdtrans.component b/dtrans/util/sysdtrans.component
new file mode 100644
index 000000000000..ec1807000b3f
--- /dev/null
+++ b/dtrans/util/sysdtrans.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.datatransfer.clipboard.ClipboardW32">
+ <service name="com.sun.star.datatransfer.clipboard.SystemClipboard"/>
+ </implementation>
+</component>
diff --git a/i18npool/prj/d.lst b/i18npool/prj/d.lst
index 54aefa732b89..8d27137424a9 100644
--- a/i18npool/prj/d.lst
+++ b/i18npool/prj/d.lst
@@ -46,3 +46,5 @@ mkdir: %_DEST%\inc%_EXT%\i18npool
..\%__SRC%\lib\libi18npaper*.so %_DEST%\lib%_EXT%\libi18npaper*.so
..\%__SRC%\lib\libi18npaper*.dylib %_DEST%\lib%_EXT%\libi18npaper*.dylib
+..\%__SRC%\misc\i18npool.component %_DEST%\xml%_EXT%\i18npool.component
+..\%__SRC%\misc\i18nsearch.component %_DEST%\xml%_EXT%\i18nsearch.component
diff --git a/i18npool/source/breakiterator/breakiteratorImpl.cxx b/i18npool/source/breakiterator/breakiteratorImpl.cxx
index e4e08d42df43..d22203d100c7 100644
--- a/i18npool/source/breakiterator/breakiteratorImpl.cxx
+++ b/i18npool/source/breakiterator/breakiteratorImpl.cxx
@@ -488,6 +488,10 @@ sal_Int16 BreakIteratorImpl::getScriptClass(sal_uInt32 currentChar)
// workaround for Coptic
else if ( 0x2C80 <= currentChar && 0x2CE3 >= currentChar)
nRet = ScriptType::LATIN;
+ // work-around for ligatures (see http://www.unicode.org/charts/PDF/UFB00.pdf)
+ else if ((0xFB00 <= currentChar && currentChar <= 0xFB06) ||
+ (0xFB13 <= currentChar && currentChar <= 0xFB17))
+ nRet = ScriptType::LATIN;
else {
UBlockCode block=ublock_getCode(currentChar);
sal_uInt16 i;
diff --git a/i18npool/source/localedata/data/makefile.mk b/i18npool/source/localedata/data/makefile.mk
index 1ac16a31fe37..1034de7f11bf 100644
--- a/i18npool/source/localedata/data/makefile.mk
+++ b/i18npool/source/localedata/data/makefile.mk
@@ -39,6 +39,14 @@ LIBTARGET=NO
debug!=
.ENDIF
+.IF "$(OS)" == "WNT"
+my_file = file:///
+.ELSE
+my_file = file://
+.END
+
+my_components = sax.inbuild
+
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
@@ -62,190 +70,6 @@ LINK_LOCALEDATA_ES_LIB=-l$(SHL2TARGET)
# --- Files --------------------------------------------------------
-# Interim files generated by the saxparser executable, for dependencies
-MY_MISC_CXXFILES = \
- $(MISC)$/localedata_af_NA.cxx \
- $(MISC)$/localedata_af_ZA.cxx \
- $(MISC)$/localedata_ak_GH.cxx \
- $(MISC)$/localedata_am_ET.cxx \
- $(MISC)$/localedata_ar_DZ.cxx \
- $(MISC)$/localedata_ar_EG.cxx \
- $(MISC)$/localedata_ar_LB.cxx \
- $(MISC)$/localedata_ar_SA.cxx \
- $(MISC)$/localedata_ar_TN.cxx \
- $(MISC)$/localedata_ast_ES.cxx \
- $(MISC)$/localedata_az_AZ.cxx \
- $(MISC)$/localedata_be_BY.cxx \
- $(MISC)$/localedata_bg_BG.cxx \
- $(MISC)$/localedata_bn_IN.cxx \
- $(MISC)$/localedata_bn_BD.cxx \
- $(MISC)$/localedata_br_FR.cxx \
- $(MISC)$/localedata_bs_BA.cxx \
- $(MISC)$/localedata_ca_ES.cxx \
- $(MISC)$/localedata_cs_CZ.cxx \
- $(MISC)$/localedata_cv_RU.cxx \
- $(MISC)$/localedata_cy_GB.cxx \
- $(MISC)$/localedata_da_DK.cxx \
- $(MISC)$/localedata_de_AT.cxx \
- $(MISC)$/localedata_de_CH.cxx \
- $(MISC)$/localedata_de_DE.cxx \
- $(MISC)$/localedata_de_LI.cxx \
- $(MISC)$/localedata_de_LU.cxx \
- $(MISC)$/localedata_dz_BT.cxx \
- $(MISC)$/localedata_ee_GH.cxx \
- $(MISC)$/localedata_el_GR.cxx \
- $(MISC)$/localedata_en_AU.cxx \
- $(MISC)$/localedata_en_BZ.cxx \
- $(MISC)$/localedata_en_CA.cxx \
- $(MISC)$/localedata_en_GB.cxx \
- $(MISC)$/localedata_en_GH.cxx \
- $(MISC)$/localedata_en_IE.cxx \
- $(MISC)$/localedata_en_IN.cxx \
- $(MISC)$/localedata_en_JM.cxx \
- $(MISC)$/localedata_en_NA.cxx \
- $(MISC)$/localedata_en_NZ.cxx \
- $(MISC)$/localedata_en_PH.cxx \
- $(MISC)$/localedata_en_TT.cxx \
- $(MISC)$/localedata_en_US.cxx \
- $(MISC)$/localedata_en_ZA.cxx \
- $(MISC)$/localedata_en_ZW.cxx \
- $(MISC)$/localedata_eo.cxx \
- $(MISC)$/localedata_es_AR.cxx \
- $(MISC)$/localedata_es_BO.cxx \
- $(MISC)$/localedata_es_CL.cxx \
- $(MISC)$/localedata_es_CO.cxx \
- $(MISC)$/localedata_es_CR.cxx \
- $(MISC)$/localedata_es_DO.cxx \
- $(MISC)$/localedata_es_EC.cxx \
- $(MISC)$/localedata_es_ES.cxx \
- $(MISC)$/localedata_es_GT.cxx \
- $(MISC)$/localedata_es_HN.cxx \
- $(MISC)$/localedata_es_MX.cxx \
- $(MISC)$/localedata_es_NI.cxx \
- $(MISC)$/localedata_es_PA.cxx \
- $(MISC)$/localedata_es_PE.cxx \
- $(MISC)$/localedata_es_PR.cxx \
- $(MISC)$/localedata_es_PY.cxx \
- $(MISC)$/localedata_es_SV.cxx \
- $(MISC)$/localedata_es_UY.cxx \
- $(MISC)$/localedata_es_VE.cxx \
- $(MISC)$/localedata_et_EE.cxx \
- $(MISC)$/localedata_eu.cxx \
- $(MISC)$/localedata_fa_IR.cxx \
- $(MISC)$/localedata_fi_FI.cxx \
- $(MISC)$/localedata_fo_FO.cxx \
- $(MISC)$/localedata_fr_BE.cxx \
- $(MISC)$/localedata_fr_CA.cxx \
- $(MISC)$/localedata_fr_CH.cxx \
- $(MISC)$/localedata_fr_FR.cxx \
- $(MISC)$/localedata_fr_LU.cxx \
- $(MISC)$/localedata_fr_MC.cxx \
- $(MISC)$/localedata_fur_IT.cxx \
- $(MISC)$/localedata_fy_NL.cxx \
- $(MISC)$/localedata_ga_IE.cxx \
- $(MISC)$/localedata_gl_ES.cxx \
- $(MISC)$/localedata_gsc_FR.cxx \
- $(MISC)$/localedata_gu_IN.cxx \
- $(MISC)$/localedata_gug_PY.cxx \
- $(MISC)$/localedata_ha_GH.cxx \
- $(MISC)$/localedata_he_IL.cxx \
- $(MISC)$/localedata_hi_IN.cxx \
- $(MISC)$/localedata_hil_PH.cxx \
- $(MISC)$/localedata_hr_HR.cxx \
- $(MISC)$/localedata_hsb_DE.cxx \
- $(MISC)$/localedata_hu_HU.cxx \
- $(MISC)$/localedata_hy_AM.cxx \
- $(MISC)$/localedata_ia.cxx \
- $(MISC)$/localedata_id_ID.cxx \
- $(MISC)$/localedata_is_IS.cxx \
- $(MISC)$/localedata_it_CH.cxx \
- $(MISC)$/localedata_it_IT.cxx \
- $(MISC)$/localedata_ja_JP.cxx \
- $(MISC)$/localedata_ka_GE.cxx \
- $(MISC)$/localedata_kk_KZ.cxx \
- $(MISC)$/localedata_kl_GL.cxx \
- $(MISC)$/localedata_km_KH.cxx \
- $(MISC)$/localedata_kn_IN.cxx \
- $(MISC)$/localedata_ko_KR.cxx \
- $(MISC)$/localedata_ku_TR.cxx \
- $(MISC)$/localedata_ky_KG.cxx \
- $(MISC)$/localedata_la_VA.cxx \
- $(MISC)$/localedata_lb_LU.cxx \
- $(MISC)$/localedata_lg_UG.cxx \
- $(MISC)$/localedata_ln_CD.cxx \
- $(MISC)$/localedata_lo_LA.cxx \
- $(MISC)$/localedata_lt_LT.cxx \
- $(MISC)$/localedata_ltg_LV.cxx \
- $(MISC)$/localedata_lv_LV.cxx \
- $(MISC)$/localedata_mai_IN.cxx \
- $(MISC)$/localedata_mk_MK.cxx \
- $(MISC)$/localedata_ml_IN.cxx \
- $(MISC)$/localedata_mn_MN.cxx \
- $(MISC)$/localedata_mr_IN.cxx \
- $(MISC)$/localedata_ms_MY.cxx \
- $(MISC)$/localedata_mt_MT.cxx \
- $(MISC)$/localedata_my_MM.cxx \
- $(MISC)$/localedata_nb_NO.cxx \
- $(MISC)$/localedata_ne_NP.cxx \
- $(MISC)$/localedata_nl_BE.cxx \
- $(MISC)$/localedata_nl_NL.cxx \
- $(MISC)$/localedata_nn_NO.cxx \
- $(MISC)$/localedata_no_NO.cxx \
- $(MISC)$/localedata_nr_ZA.cxx \
- $(MISC)$/localedata_nso_ZA.cxx \
- $(MISC)$/localedata_oc_FR.cxx \
- $(MISC)$/localedata_om_ET.cxx \
- $(MISC)$/localedata_or_IN.cxx \
- $(MISC)$/localedata_pa_IN.cxx \
- $(MISC)$/localedata_pl_PL.cxx \
- $(MISC)$/localedata_plt_MG.cxx \
- $(MISC)$/localedata_pt_BR.cxx \
- $(MISC)$/localedata_pt_PT.cxx \
- $(MISC)$/localedata_ro_RO.cxx \
- $(MISC)$/localedata_rue_SK.cxx \
- $(MISC)$/localedata_ru_RU.cxx \
- $(MISC)$/localedata_rw_RW.cxx \
- $(MISC)$/localedata_sg_CF.cxx \
- $(MISC)$/localedata_sh_ME.cxx \
- $(MISC)$/localedata_sh_RS.cxx \
- $(MISC)$/localedata_sh_YU.cxx \
- $(MISC)$/localedata_shs_CA.cxx \
- $(MISC)$/localedata_sk_SK.cxx \
- $(MISC)$/localedata_sl_SI.cxx \
- $(MISC)$/localedata_so_SO.cxx \
- $(MISC)$/localedata_sr_ME.cxx \
- $(MISC)$/localedata_sr_RS.cxx \
- $(MISC)$/localedata_sr_YU.cxx \
- $(MISC)$/localedata_ss_ZA.cxx \
- $(MISC)$/localedata_st_ZA.cxx \
- $(MISC)$/localedata_sv_FI.cxx \
- $(MISC)$/localedata_sv_SE.cxx \
- $(MISC)$/localedata_sw_TZ.cxx \
- $(MISC)$/localedata_ta_IN.cxx \
- $(MISC)$/localedata_te_IN.cxx \
- $(MISC)$/localedata_tg_TJ.cxx \
- $(MISC)$/localedata_th_TH.cxx \
- $(MISC)$/localedata_ti_ER.cxx \
- $(MISC)$/localedata_tk_TM.cxx \
- $(MISC)$/localedata_tn_ZA.cxx \
- $(MISC)$/localedata_tpi_PG.cxx \
- $(MISC)$/localedata_tr_TR.cxx \
- $(MISC)$/localedata_ts_ZA.cxx \
- $(MISC)$/localedata_ug_CN.cxx \
- $(MISC)$/localedata_uk_UA.cxx \
- $(MISC)$/localedata_uz_UZ.cxx \
- $(MISC)$/localedata_ve_ZA.cxx \
- $(MISC)$/localedata_vi_VN.cxx \
- $(MISC)$/localedata_wa_BE.cxx \
- $(MISC)$/localedata_xh_ZA.cxx \
- $(MISC)$/localedata_zh_CN.cxx \
- $(MISC)$/localedata_zh_HK.cxx \
- $(MISC)$/localedata_zh_MO.cxx \
- $(MISC)$/localedata_zh_SG.cxx \
- $(MISC)$/localedata_zh_TW.cxx \
- $(MISC)$/localedata_zu_ZA.cxx
-
-
# English Locales
SHL1TARGET=localedata_en
.IF "$(GUI)" == "OS2"
@@ -504,13 +328,28 @@ DEPOBJFILES= \
$(SHL3OBJS) \
$(SHL4OBJS)
+# Interim files generated by the saxparser executable, for dependencies
+MY_MISC_CXXFILES := $(foreach,i,$(DEPOBJFILES) $(MISC)/$(i:b).cxx)
+
# --- Targets ------------------------------------------------------
.INCLUDE : target.mk
-$(MY_MISC_CXXFILES) : $(BIN)$/saxparser$(EXECPOST)
+$(MY_MISC_CXXFILES) : $(BIN)$/saxparser$(EXECPOST) $(MISC)/saxparser.rdb
$(MISC)$/localedata_%.cxx : %.xml
- $(AUGMENT_LIBRARY_PATH) $(WRAPCMD) $(BIN)$/saxparser $* $< $@ $(BIN)$/$(@:b).rdb $(SOLARBINDIR)$/types.rdb
+ $(AUGMENT_LIBRARY_PATH) $(WRAPCMD) $(BIN)$/saxparser $* $< $@ \
+ $(my_file)$(PWD)/$(MISC)/saxparser.rdb $(SOLARBINDIR)$/types.rdb \
+ -env:OOO_INBUILD_SHAREDLIB_DIR=$(my_file)$(SOLARSHAREDBIN)
$(RM) $(BIN)$/$(@:b).rdb
+$(MISC)/saxparser.rdb .ERRREMOVE : $(SOLARENV)/bin/packcomponents.xslt \
+ $(MISC)/saxparser.input \
+ $(my_components:^"$(SOLARXMLDIR)/":+".component")
+ $(XSLTPROC) --nonet --stringparam prefix $(SOLARXMLDIR)/ -o $@ \
+ $(SOLARENV)/bin/packcomponents.xslt $(MISC)/saxparser.input
+
+$(MISC)/saxparser.input :
+ echo \
+ '<list>$(my_components:^"<filename>":+".component</filename>")</list>' \
+ > $@
diff --git a/i18npool/source/localedata/saxparser.cxx b/i18npool/source/localedata/saxparser.cxx
index 9787b9c810a6..5118a827b260 100644
--- a/i18npool/source/localedata/saxparser.cxx
+++ b/i18npool/source/localedata/saxparser.cxx
@@ -34,7 +34,6 @@
#include "sal/main.h"
-#include <com/sun/star/registry/XImplementationRegistration.hpp>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/xml/sax/SAXParseException.hpp>
@@ -339,7 +338,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
{
xSMgr = createRegistryServiceFactory(
::rtl::OUString::createFromAscii(argv[4]),
- ::rtl::OUString::createFromAscii(argv[5]) );
+ ::rtl::OUString::createFromAscii(argv[5]), true );
}
catch ( Exception& )
{
@@ -347,38 +346,6 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
exit(1);
}
- Reference < XImplementationRegistration > xReg;
- try
- {
- // Create registration service
- Reference < XInterface > x = xSMgr->createInstance(
- OUString::createFromAscii( "com.sun.star.registry.ImplementationRegistration" ) );
- xReg = Reference< XImplementationRegistration > ( x , UNO_QUERY );
- }
- catch( Exception & ) {
- printf( "Couldn't create ImplementationRegistration service\n" );
- exit(1);
- }
-
- OString sTestName;
- try
- {
- // Load dll for the tested component
- OUString aDllName =
- OUString::createFromAscii( "sax.uno" SAL_DLLEXTENSION );
- xReg->registerImplementation(
- OUString::createFromAscii( "com.sun.star.loader.SharedLibrary" ),
- aDllName,
- Reference< XSimpleRegistry > () );
- }
- catch( Exception &e ) {
- printf( "Couldn't raise sax.uno library!\n" );
- printf( "%s\n" , OUStringToOString( e.Message , RTL_TEXTENCODING_ASCII_US ).getStr() );
-
- exit(1);
- }
-
-
//--------------------------------
// parser demo
// read xml from a file and count elements
diff --git a/i18npool/source/registerservices/registerservices.cxx b/i18npool/source/registerservices/registerservices.cxx
index 280e12dfe4f7..0671e5669956 100644
--- a/i18npool/source/registerservices/registerservices.cxx
+++ b/i18npool/source/registerservices/registerservices.cxx
@@ -580,29 +580,6 @@ void SAL_CALL component_getImplementationEnvironment( const sal_Char** ppEnvType
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-sal_Bool SAL_CALL component_writeInfo( void* /*_pServiceManager*/, void* _pRegistryKey )
-{
- if (_pRegistryKey)
- {
- ::com::sun::star::registry::XRegistryKey * pRegistryKey =
- reinterpret_cast< ::com::sun::star::registry::XRegistryKey* >(
- _pRegistryKey );
- ::com::sun::star::uno::Reference<
- ::com::sun::star::registry::XRegistryKey > xNewKey;
-
- for( const InstancesArray* pArr = aInstances; pArr->pServiceNm; ++pArr )
- {
- xNewKey = pRegistryKey->createKey(
- ::rtl::OUString::createFromAscii( pArr->pImplementationNm ) );
- xNewKey = xNewKey->createKey(
- ::rtl::OUString::createFromAscii( "/UNO/SERVICES" ) );
- xNewKey->createKey(
- ::rtl::OUString::createFromAscii( pArr->pServiceNm ) );
- }
- }
- return sal_True;
-}
-
void* SAL_CALL component_getFactory( const sal_Char* sImplementationName, void* _pServiceManager, void* /*_pRegistryKey*/ )
{
void* pRet = NULL;
diff --git a/i18npool/source/search/i18nsearch.component b/i18npool/source/search/i18nsearch.component
new file mode 100644
index 000000000000..6288bcd7c840
--- /dev/null
+++ b/i18npool/source/search/i18nsearch.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.util.TextSearch_i18n">
+ <service name="com.sun.star.util.TextSearch"/>
+ </implementation>
+</component>
diff --git a/i18npool/source/search/makefile.mk b/i18npool/source/search/makefile.mk
index aed976edd896..372b32a216d1 100644
--- a/i18npool/source/search/makefile.mk
+++ b/i18npool/source/search/makefile.mk
@@ -76,3 +76,11 @@ DEF1NAME= $(SHL1TARGET)
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/i18nsearch.component
+
+$(MISC)/i18nsearch.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ i18nsearch.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt i18nsearch.component
diff --git a/i18npool/source/search/textsearch.cxx b/i18npool/source/search/textsearch.cxx
index dea4eca2a618..e71e0fc0cd71 100644
--- a/i18npool/source/search/textsearch.cxx
+++ b/i18npool/source/search/textsearch.cxx
@@ -987,25 +987,6 @@ void SAL_CALL component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-sal_Bool SAL_CALL component_writeInfo(
- void* /*_pServiceManager*/, void* _pRegistryKey )
-{
- if (_pRegistryKey)
- {
- ::com::sun::star::registry::XRegistryKey * pRegistryKey =
- reinterpret_cast< ::com::sun::star::registry::XRegistryKey* >(
- _pRegistryKey );
- ::com::sun::star::uno::Reference<
- ::com::sun::star::registry::XRegistryKey > xNewKey;
-
- xNewKey = pRegistryKey->createKey( getImplementationName_Static() );
- xNewKey = xNewKey->createKey(
- ::rtl::OUString::createFromAscii( "/UNO/SERVICES" ) );
- xNewKey->createKey( getServiceName_Static() );
- }
- return sal_True;
-}
-
void* SAL_CALL component_getFactory( const sal_Char* sImplementationName,
void* _pServiceManager, void* /*_pRegistryKey*/ )
{
diff --git a/i18npool/util/i18npool.component b/i18npool/util/i18npool.component
new file mode 100644
index 000000000000..d11606efb6d4
--- /dev/null
+++ b/i18npool/util/i18npool.component
@@ -0,0 +1,484 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.i18n.BreakIterator">
+ <service name="com.sun.star.i18n.BreakIterator"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.BreakIterator_Unicode">
+ <service name="com.sun.star.i18n.BreakIterator_Unicode"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.BreakIterator_ja">
+ <service name="com.sun.star.i18n.BreakIterator_ja"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.BreakIterator_ko">
+ <service name="com.sun.star.i18n.BreakIterator_ko"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.BreakIterator_th">
+ <service name="com.sun.star.i18n.BreakIterator_th"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.BreakIterator_zh">
+ <service name="com.sun.star.i18n.BreakIterator_zh"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.BreakIterator_zh_TW">
+ <service name="com.sun.star.i18n.BreakIterator_zh_TW"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.CalendarImpl">
+ <service name="com.sun.star.i18n.LocaleCalendar"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Calendar_ROC">
+ <service name="com.sun.star.i18n.Calendar_ROC"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Calendar_buddhist">
+ <service name="com.sun.star.i18n.Calendar_buddhist"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Calendar_gengou">
+ <service name="com.sun.star.i18n.Calendar_gengou"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Calendar_gregorian">
+ <service name="com.sun.star.i18n.Calendar_gregorian"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Calendar_hanja">
+ <service name="com.sun.star.i18n.Calendar_hanja"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Calendar_hanja_yoil">
+ <service name="com.sun.star.i18n.Calendar_hanja_yoil"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Calendar_hijri">
+ <service name="com.sun.star.i18n.Calendar_hijri"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Calendar_jewish">
+ <service name="com.sun.star.i18n.Calendar_jewish"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.ChapterCollator">
+ <service name="com.sun.star.i18n.ChapterCollator"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.CharacterClassification">
+ <service name="com.sun.star.i18n.CharacterClassification"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.CharacterClassification_Unicode">
+ <service name="com.sun.star.i18n.CharacterClassification_Unicode"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Collator">
+ <service name="com.sun.star.i18n.Collator"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Collator_Unicode">
+ <service name="com.sun.star.i18n.Collator_Unicode"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.IndexEntrySupplier">
+ <service name="com.sun.star.i18n.IndexEntrySupplier"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.IndexEntrySupplier_Unicode">
+ <service name="com.sun.star.i18n.IndexEntrySupplier_Unicode"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.IndexEntrySupplier_asian">
+ <service name="com.sun.star.i18n.IndexEntrySupplier_asian"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric first)">
+ <service name="com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric first)"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric first) (grouped by consonant)">
+ <service name="com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric first) (grouped by consonant)"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric first) (grouped by syllable)">
+ <service name="com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric first) (grouped by syllable)"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric last)">
+ <service name="com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric last)"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric last) (grouped by consonant)">
+ <service name="com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric last) (grouped by consonant)"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric last) (grouped by syllable)">
+ <service name="com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric last) (grouped by syllable)"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.InputSequenceChecker">
+ <service name="com.sun.star.i18n.InputSequenceChecker"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.InputSequenceChecker_hi">
+ <service name="com.sun.star.i18n.InputSequenceChecker_hi"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.InputSequenceChecker_th">
+ <service name="com.sun.star.i18n.InputSequenceChecker_th"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.LocaleData">
+ <service name="com.sun.star.i18n.LocaleData"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.NativeNumberSupplier">
+ <service name="com.sun.star.i18n.NativeNumberSupplier"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.NumberFormatCodeMapper">
+ <service name="com.sun.star.i18n.NumberFormatMapper"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.OrdinalSuffix">
+ <service name="com.sun.star.i18n.OrdinalSuffix"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.ScriptTypeDetector">
+ <service name="com.sun.star.i18n.ScriptTypeDetector"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.TextConversion">
+ <service name="com.sun.star.i18n.TextConversion"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.TextConversion_ko">
+ <service name="com.sun.star.i18n.TextConversion_ko"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.TextConversion_zh">
+ <service name="com.sun.star.i18n.TextConversion_zh"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration">
+ <service name="com.sun.star.i18n.Transliteration"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.CharToNumEastIndic_ar">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.CharToNumFullwidth">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.CharToNumHangul_ko">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.CharToNumIndic_ar">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.CharToNumIndic_hi">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.CharToNumKanjiShort_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.CharToNumKanjiTraditional_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.CharToNumLower_ko">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.CharToNumLower_zh_CN">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.CharToNumLower_zh_TW">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.CharToNumUpper_ko">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.CharToNumUpper_zh_CN">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.CharToNumUpper_zh_TW">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.CharToNum_th">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.FULLWIDTHKATAKANA_HALFWIDTHKATAKANA">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.FULLWIDTH_HALFWIDTH">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.FULLWIDTH_HALFWIDTH_LIKE_ASC">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.HALFWIDTHKATAKANA_FULLWIDTHKATAKANA">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.HALFWIDTH_FULLWIDTH">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.HALFWIDTH_FULLWIDTH_LIKE_JIS">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.HIRAGANA_KATAKANA">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.IGNORE_CASE">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.IGNORE_KANA">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.IGNORE_WIDTH">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.KATAKANA_HIRAGANA">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.LOWERCASE_UPPERCASE">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToCharEastIndic_ar">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToCharFullwidth">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToCharHalfwidth">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToCharHangul_ko">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToCharIndic_ar">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToCharIndic_hi">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToCharKanjiShort_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToCharKanjiTraditional_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToCharLower_ko">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToCharLower_zh_CN">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToCharLower_zh_TW">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToCharUpper_ko">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToCharUpper_zh_CN">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToCharUpper_zh_TW">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToChar_th">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextAIUFullWidth_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextAIUHalfWidth_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextCircledNumber">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextDate_zh">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextDiZi_zh">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextFormalHangul_ko">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextFormalLower_ko">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextFormalUpper_ko">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextFullwidth_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextFullwidth_ko">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextFullwidth_zh_CN">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextFullwidth_zh_TW">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextHangulCircledJamo_ko">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextHangulCircledSyllable_ko">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextHangulJamo_ko">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextHangulSyllable_ko">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextIROHAFullWidth_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextIROHAHalfWidth_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextInformalHangul_ko">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextInformalLower_ko">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextInformalUpper_ko">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextKanjiLongModern_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextKanjiLongTraditional_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextKanjiShortModern_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextKanjiShortTraditional_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextLower_zh_CN">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextLower_zh_TW">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextTianGan_zh">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextUpper_zh_CN">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextUpper_zh_TW">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.SENTENCE_CASE">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.TITLE_CASE">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.TOGGLE_CASE">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.TextToChuyin_zh_TW">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.TextToNumFormalHangul_ko">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.TextToNumFormalLower_ko">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.TextToNumFormalUpper_ko">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.TextToNumInformalHangul_ko">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.TextToNumInformalLower_ko">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.TextToNumInformalUpper_ko">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.TextToNumKanjiLongModern_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.TextToNumKanjiLongTraditional_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.TextToNumLower_zh_CN">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.TextToNumLower_zh_TW">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.TextToNumUpper_zh_CN">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.TextToNumUpper_zh_TW">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.TextToPinyin_zh_CN">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.UPPERCASE_LOWERCASE">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.ignoreBaFa_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.ignoreHyuByu_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.ignoreIandEfollowedByYa_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.ignoreIterationMark_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.ignoreKana">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.ignoreKiKuFollowedBySa_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.ignoreMiddleDot_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.ignoreMinusSign_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.ignoreProlongedSoundMark_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.ignoreSeZe_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.ignoreSeparator_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.ignoreSize_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.ignoreSpace_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.ignoreTiJi_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.ignoreTraditionalKana_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.ignoreTraditionalKanji_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.ignoreZiZu_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.largeToSmall_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.smallToLarge_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.text.DefaultNumberingProvider">
+ <service name="com.sun.star.text.DefaultNumberingProvider"/>
+ </implementation>
+</component>
diff --git a/i18npool/util/makefile.mk b/i18npool/util/makefile.mk
index 57f802be62fe..8c9f1a83b2c0 100644
--- a/i18npool/util/makefile.mk
+++ b/i18npool/util/makefile.mk
@@ -79,3 +79,11 @@ SHL1STDLIBS= \
# --- Targets ------------------------------------------------------------
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/i18npool.component
+
+$(MISC)/i18npool.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ i18npool.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt i18npool.component
diff --git a/l10ntools/scripts/xhtex b/l10ntools/scripts/xhtex
index d337694c589b..5409f179777d 100755
--- a/l10ntools/scripts/xhtex
+++ b/l10ntools/scripts/xhtex
@@ -31,8 +31,16 @@ if [ x${SOLARENV}x = xx ]; then
exit 1
fi
+if [ ${GUI} = "WNT" ]; then
if [ x${SOLARVER}x = xx -o x${UPDMINOREXT}x = xx ]; then
exec python $SOLARVERSION/$INPATH/bin/xhtex.py "$@"
else
exec python $SOLARVERSION/$INPATH/bin$UPDMINOREXT/xhtex.py "$@"
fi
+else
+if [ x${SOLARVER}x = xx -o x${UPDMINOREXT}x = xx ]; then
+ exec python $SOLARVERSION/$INPATH/bin/xhtex.py "$@"
+else
+ exec python $SOLARVERSION/$INPATH/bin$UPDMINOREXT/xhtex.py "$@"
+fi
+fi
diff --git a/l10ntools/scripts/xtxex b/l10ntools/scripts/xtxex
index 01a70ae57d80..39da89fd81ce 100755
--- a/l10ntools/scripts/xtxex
+++ b/l10ntools/scripts/xtxex
@@ -31,9 +31,17 @@ if [ x${SOLARENV}x = xx ]; then
exit 1
fi
+if [ ${GUI} = "WNT" ]; then
if [ x${SOLARVER}x = xx -o x${UPDMINOREXT}x = xx ]; then
exec python $SOLARVERSION/$INPATH/bin/xtxex.py "$@"
else
exec python $SOLARVERSION/$INPATH/bin$UPDMINOREXT/xtxex.py "$@"
fi
+else
+if [ x${SOLARVER}x = xx -o x${UPDMINOREXT}x = xx ]; then
+ exec python $SOLARVERSION/$INPATH/bin/xtxex.py "$@"
+else
+ exec python $SOLARVERSION/$INPATH/bin$UPDMINOREXT/xtxex.py "$@"
+fi
+fi
diff --git a/l10ntools/source/help/HelpLinker.cxx b/l10ntools/source/help/HelpLinker.cxx
index 411859bfe994..4e3a4cedbe6f 100644
--- a/l10ntools/source/help/HelpLinker.cxx
+++ b/l10ntools/source/help/HelpLinker.cxx
@@ -46,17 +46,16 @@
#define DBHELP_ONLY
-
class IndexerPreProcessor
{
private:
- std::string m_aModuleName;
- fs::path m_fsIndexBaseDir;
- fs::path m_fsCaptionFilesDirName;
- fs::path m_fsContentFilesDirName;
+ std::string m_aModuleName;
+ fs::path m_fsIndexBaseDir;
+ fs::path m_fsCaptionFilesDirName;
+ fs::path m_fsContentFilesDirName;
- xsltStylesheetPtr m_xsltStylesheetPtrCaption;
- xsltStylesheetPtr m_xsltStylesheetPtrContent;
+ xsltStylesheetPtr m_xsltStylesheetPtrCaption;
+ xsltStylesheetPtr m_xsltStylesheetPtrContent;
public:
IndexerPreProcessor( const std::string& aModuleName, const fs::path& fsIndexBaseDir,
@@ -245,7 +244,6 @@ class HelpLinker
{
public:
void main(std::vector<std::string> &args,
-// std::string* pExtensionPath = NULL, const rtl::OUString* pOfficeHelpPath = NULL )
std::string* pExtensionPath = NULL,
std::string* pDestination = NULL,
const rtl::OUString* pOfficeHelpPath = NULL )
@@ -273,12 +271,10 @@ private:
std::string extdestination;
std::string module;
std::string lang;
- std::string hid;
std::string extensionPath;
std::string extensionDestination;
bool bExtensionMode;
fs::path indexDirName;
- Stringtable hidlistTranslation;
fs::path indexDirParentName;
bool init;
IndexerPreProcessor* m_pIndexerPreProcessor;
@@ -331,13 +327,6 @@ void HelpLinker::addBookmark( DB* dbBase, FILE* pFile_DBHelp, std::string thishi
HCDBG(std::cerr << "HelpLinker::addBookmark " << thishid << " " <<
fileB << " " << anchorB << " " << jarfileB << " " << titleB << std::endl);
- std::string temp = thishid;
- std::transform (temp.begin(), temp.end(), temp.begin(), toupper);
- std::replace(temp.begin(), temp.end(), ':', '_');
- const std::string& translatedHid = hidlistTranslation[temp];
- if (!translatedHid.empty())
- thishid = translatedHid;
-
thishid = URLEncoder::encode(thishid);
DBT key;
@@ -472,20 +461,6 @@ void HelpLinker::link() throw( HelpProcessingException )
try
{
- std::ifstream fileReader(hid.c_str());
- while (fileReader)
- {
- std::string key;
- fileReader >> key;
- std::transform (key.begin(), key.end(), key.begin(), toupper);
- std::replace(key.begin(), key.end(), ':', '_');
- std::string data;
- fileReader >> data;
- if (!key.empty() && !data.empty())
- hidlistTranslation[key] = data;
- }
- fileReader.close();
-
// lastly, initialize the indexBuilder
if ( (!bExtensionMode || bIndexForExtension) && !helpFiles.empty())
initIndexerPreProcessor();
@@ -651,13 +626,6 @@ void HelpLinker::link() throw( HelpProcessingException )
std::string helpTextId = helpTextIter->first;
const std::string& helpTextText = helpTextIter->second;
- std::string temp = helpTextId;
- std::transform (temp.begin(), temp.end(), temp.begin(), toupper);
- std::replace(temp.begin(), temp.end(), ':', '_');
-
- const std::string& tHid = hidlistTranslation[temp];
- if (!tHid.empty())
- helpTextId = tHid;
helpTextId = URLEncoder::encode(helpTextId);
DBT keyDbt;
@@ -697,8 +665,8 @@ void HelpLinker::link() throw( HelpProcessingException )
if( !bExtensionMode )
std::cout << std::endl;
- } // try
- catch( HelpProcessingException& )
+ } // try
+ catch( const HelpProcessingException& )
{
// catch HelpProcessingException to avoid locking data bases
#ifndef DBHELP_ONLY
@@ -912,14 +880,7 @@ void HelpLinker::main( std::vector<std::string> &args,
else if (args[i].compare("-hid") == 0)
{
++i;
- if (i >= args.size())
- {
- std::stringstream aStrStream;
- aStrStream << "hid list missing" << std::endl;
- throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
- }
-
- hid = args[i];
+ throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, "obsolete -hid argument used" );
}
else if (args[i].compare("-add") == 0)
{
@@ -1076,13 +1037,6 @@ void HelpLinker::main( std::vector<std::string> &args,
aStrStream << "language missing" << std::endl;
throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
}
- if (!bExtensionMode && hid.empty())
- {
- std::stringstream aStrStream;
- aStrStream << "hid list missing" << std::endl;
- throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
- }
-
link();
}
@@ -1145,7 +1099,7 @@ HelpProcessingErrorInfo& HelpProcessingErrorInfo::operator=( const struct HelpPr
// Returns true in case of success, false in case of error
HELPLINKER_DLLPUBLIC bool compileExtensionHelp
(
- const rtl::OUString& aOfficeHelpPath,
+ const rtl::OUString& aOfficeHelpPath,
const rtl::OUString& aExtensionName,
const rtl::OUString& aExtensionLanguageRoot,
sal_Int32 nXhpFileCount, const rtl::OUString* pXhpFiles,
@@ -1155,31 +1109,20 @@ HELPLINKER_DLLPUBLIC bool compileExtensionHelp
{
bool bSuccess = true;
- sal_Int32 argc = nXhpFileCount + 3;
- const char** argv = new const char*[argc];
- argv[0] = "";
- argv[1] = "-mod";
+ std::vector<std::string> args;
+ args.reserve(nXhpFileCount + 2);
+ args.push_back(std::string("-mod"));
rtl::OString aOExtensionName = rtl::OUStringToOString( aExtensionName, fs::getThreadTextEncoding() );
- argv[2] = aOExtensionName.getStr();
+ args.push_back(std::string(aOExtensionName.getStr()));
for( sal_Int32 iXhp = 0 ; iXhp < nXhpFileCount ; ++iXhp )
{
rtl::OUString aXhpFile = pXhpFiles[iXhp];
rtl::OString aOXhpFile = rtl::OUStringToOString( aXhpFile, fs::getThreadTextEncoding() );
- char* pArgStr = new char[aOXhpFile.getLength() + 1];
- strcpy( pArgStr, aOXhpFile.getStr() );
- argv[iXhp + 3] = pArgStr;
+ args.push_back(std::string(aOXhpFile.getStr()));
}
- std::vector<std::string> args;
- for( sal_Int32 i = 1; i < argc; ++i )
- args.push_back(std::string( argv[i]) );
-
- for( sal_Int32 iXhp = 0 ; iXhp < nXhpFileCount ; ++iXhp )
- delete[] argv[iXhp + 3];
- delete[] argv;
-
rtl::OString aOExtensionLanguageRoot = rtl::OUStringToOString( aExtensionLanguageRoot, fs::getThreadTextEncoding() );
const char* pExtensionPath = aOExtensionLanguageRoot.getStr();
std::string aStdStrExtensionPath = pExtensionPath;
@@ -1249,6 +1192,3 @@ HELPLINKER_DLLPUBLIC bool compileExtensionHelp
return bSuccess;
}
-// vnd.sun.star.help://swriter/52821?Language=en-US&System=UNIX
-/* vi:set tabstop=4 shiftwidth=4 expandtab: */
-
diff --git a/o3tl/qa/makefile.mk b/o3tl/qa/makefile.mk
index 3475aeeca9bb..0c6ecd88e56b 100644
--- a/o3tl/qa/makefile.mk
+++ b/o3tl/qa/makefile.mk
@@ -36,6 +36,13 @@ ENABLE_EXCEPTIONS=TRUE
.INCLUDE : settings.mk
+#building with stlport, but cppunit was not built with stlport
+.IF "$(USE_SYSTEM_STL)"!="YES"
+.IF "$(SYSTEM_CPPUNIT)"=="YES"
+CFLAGSCXX+=-DADAPT_EXT_STL
+.ENDIF
+.ENDIF
+
CFLAGSCXX += $(CPPUNIT_CFLAGS)
.IF "$(L10N_framework)"==""
diff --git a/o3tl/qa/test-cow_wrapper.cxx b/o3tl/qa/test-cow_wrapper.cxx
index 84d615fca3db..cd69ab1c5e3d 100644
--- a/o3tl/qa/test-cow_wrapper.cxx
+++ b/o3tl/qa/test-cow_wrapper.cxx
@@ -1,9 +1,11 @@
// autogenerated file with codegen.pl
+#include "preextstl.h"
#include "cppunit/TestAssert.h"
#include "cppunit/TestFixture.h"
#include "cppunit/extensions/HelperMacros.h"
#include "cppunit/plugin/TestPlugIn.h"
+#include "postextstl.h"
#include "cow_wrapper_clients.hxx"
diff --git a/o3tl/qa/test-heap_ptr.cxx b/o3tl/qa/test-heap_ptr.cxx
index fe2f78eec8af..63ec692efe5c 100644
--- a/o3tl/qa/test-heap_ptr.cxx
+++ b/o3tl/qa/test-heap_ptr.cxx
@@ -25,9 +25,11 @@
*
************************************************************************/
+#include "preextstl.h"
#include "cppunit/TestAssert.h"
#include "cppunit/TestFixture.h"
#include "cppunit/extensions/HelperMacros.h"
+#include "postextstl.h"
#include <o3tl/heap_ptr.hxx>
diff --git a/o3tl/qa/test-range.cxx b/o3tl/qa/test-range.cxx
index 31cf2aec7c10..634b04de9122 100644
--- a/o3tl/qa/test-range.cxx
+++ b/o3tl/qa/test-range.cxx
@@ -25,9 +25,11 @@
*
************************************************************************/
+#include "preextstl.h"
#include "cppunit/TestAssert.h"
#include "cppunit/TestFixture.h"
#include "cppunit/extensions/HelperMacros.h"
+#include "postextstl.h"
#include <o3tl/range.hxx>
#include <vector>
diff --git a/o3tl/qa/test-vector_pool.cxx b/o3tl/qa/test-vector_pool.cxx
index 4efaebdd3414..ab301752532e 100644
--- a/o3tl/qa/test-vector_pool.cxx
+++ b/o3tl/qa/test-vector_pool.cxx
@@ -1,8 +1,10 @@
// autogenerated file with codegen.pl
+#include "preextstl.h"
#include "cppunit/TestAssert.h"
#include "cppunit/TestFixture.h"
#include "cppunit/extensions/HelperMacros.h"
+#include "postextstl.h"
#include <o3tl/vector_pool.hxx>
diff --git a/padmin/source/padialog.cxx b/padmin/source/padialog.cxx
index 583e14c06caa..d91ebea0c73d 100644
--- a/padmin/source/padialog.cxx
+++ b/padmin/source/padialog.cxx
@@ -152,6 +152,20 @@ void PADialog::Init()
m_aFontsPB.Enable( FALSE );
m_aFontsPB.Show( FALSE );
}
+
+ // at this point no actual changes will be written
+ // but the write will have checked whether any writeable config exists
+ if( ! m_rPIManager.writePrinterConfig() )
+ {
+ m_aAddPB.Enable( FALSE );
+ m_aRemPB.Enable( FALSE );
+ m_aConfPB.Enable( FALSE );
+ m_aRenamePB.Enable( FALSE );
+ m_aStdPB.Enable( FALSE );
+ m_aCUPSCB.Enable( FALSE );
+ ErrorBox aBox( GetParent(), WB_OK | WB_DEF_OK, String( PaResId( RID_ERR_NOWRITE ) ) );
+ aBox.Execute();
+ }
}
PADialog::~PADialog()
diff --git a/padmin/source/padialog.src b/padmin/source/padialog.src
index 8834bba3226c..09ce29a2c682 100644
--- a/padmin/source/padialog.src
+++ b/padmin/source/padialog.src
@@ -29,6 +29,7 @@
ModalDialog RID_FONTIMPORT_DIALOG
{
+ HelpID = "padmin:ModalDialog:RID_FONTIMPORT_DIALOG";
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 230 , 185 );
@@ -37,6 +38,7 @@ ModalDialog RID_FONTIMPORT_DIALOG
ListBox RID_FIMP_BOX_NEWFONTS
{
+ HelpID = "padmin:ListBox:RID_FONTIMPORT_DIALOG:RID_FIMP_BOX_NEWFONTS";
Border = TRUE;
Sort=TRUE;
AutoHScroll = TRUE;
@@ -58,18 +60,21 @@ ModalDialog RID_FONTIMPORT_DIALOG
};
Edit RID_FIMP_EDT_FROM
{
+ HelpID = "padmin:Edit:RID_FONTIMPORT_DIALOG:RID_FIMP_EDT_FROM";
Border = TRUE;
Pos = MAP_APPFONT( 10, 97 );
Size = MAP_APPFONT( 130, 12 );
};
PushButton RID_FIMP_BTN_FROM
{
+ HelpID = "padmin:PushButton:RID_FONTIMPORT_DIALOG:RID_FIMP_BTN_FROM";
Pos = MAP_APPFONT( 145, 97 );
Size = MAP_APPFONT( 15, 12 );
Text = "...";
};
CheckBox RID_FIMP_BOX_SUBDIRS
{
+ HelpID = "padmin:CheckBox:RID_FONTIMPORT_DIALOG:RID_FIMP_BOX_SUBDIRS";
Pos = MAP_APPFONT( 10, 115 );
Size = MAP_APPFONT( 145, 10 );
Text [ en-US ] = "Sea~rch Subdirectories";
@@ -83,6 +88,7 @@ ModalDialog RID_FONTIMPORT_DIALOG
CheckBox RID_FIMP_BOX_LINKONLY
{
+ HelpID = "padmin:CheckBox:RID_FONTIMPORT_DIALOG:RID_FIMP_BOX_LINKONLY";
Pos = MAP_APPFONT( 10, 140 );
Size = MAP_APPFONT( 145, 10 );
Text [ en-US ] = "Create ~soft links only";
@@ -100,6 +106,7 @@ ModalDialog RID_FONTIMPORT_DIALOG
};
PushButton RID_FIMP_BTN_SELECTALL
{
+ HelpID = "padmin:PushButton:RID_FONTIMPORT_DIALOG:RID_FIMP_BTN_SELECTALL";
Pos = MAP_APPFONT( 175, 44 );
Size = MAP_APPFONT( 50, 12 );
Text [ en-US ] = "~Select All";
@@ -146,6 +153,7 @@ ModalDialog RID_FONTIMPORT_DIALOG
ModalDialog RID_PADIALOG
{
+ HelpID = "padmin:ModalDialog:RID_PADIALOG";
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 260 , 198 ) ;
@@ -160,6 +168,7 @@ ModalDialog RID_PADIALOG
};
CheckBox RID_PA_CB_CUPSUSAGE
{
+ HelpID = "padmin:CheckBox:RID_PADIALOG:RID_PA_CB_CUPSUSAGE";
Pos = MAP_APPFONT( 12, 158 );
Size = MAP_APPFONT( 168, 8 );
Text [ en-US ] = "Disable CUPS Support";
@@ -186,6 +195,7 @@ ModalDialog RID_PADIALOG
};
ListBox RID_PA_LB_DEV
{
+ HelpID = "padmin:ListBox:RID_PADIALOG:RID_PA_LB_DEV";
Pos = MAP_APPFONT( 12, 15 );
Size = MAP_APPFONT( 168, 80 );
Border = TRUE;
@@ -237,30 +247,35 @@ ModalDialog RID_PADIALOG
};
PushButton RID_PA_BTN_CONF
{
+ HelpID = "padmin:PushButton:RID_PADIALOG:RID_PA_BTN_CONF";
Pos = MAP_APPFONT( 190, 15 );
Size = MAP_APPFONT( 60, 12 );
Text [ en-US ] = "Properties...";
};
PushButton RID_PA_BTN_RENAME
{
+ HelpID = "padmin:PushButton:RID_PADIALOG:RID_PA_BTN_RENAME";
Pos = MAP_APPFONT( 190, 32 );
Size = MAP_APPFONT( 60, 12 );
Text [ en-US ] = "R~ename...";
};
PushButton RID_PA_BTN_STD
{
+ HelpID = "padmin:PushButton:RID_PADIALOG:RID_PA_BTN_STD";
Pos = MAP_APPFONT( 190, 49 );
Size = MAP_APPFONT( 60, 12 );
Text [ en-US ] = "~Default";
};
PushButton RID_PA_BTN_DEL
{
+ HelpID = "padmin:PushButton:RID_PADIALOG:RID_PA_BTN_DEL";
Pos = MAP_APPFONT( 190, 66 );
Size = MAP_APPFONT( 60, 12 );
Text [ en-US ] = "Remo~ve...";
};
PushButton RID_PA_TESTPAGE
{
+ HelpID = "padmin:PushButton:RID_PADIALOG:RID_PA_TESTPAGE";
Pos = MAP_APPFONT( 190, 83 );
Size = MAP_APPFONT( 60, 12 );
Text [ en-US ] = "Test ~Page";
@@ -268,12 +283,14 @@ ModalDialog RID_PADIALOG
PushButton RID_PA_BTN_FONTS
{
+ HelpID = "padmin:PushButton:RID_PADIALOG:RID_PA_BTN_FONTS";
Pos = MAP_APPFONT( 80, 181 );
Size = MAP_APPFONT( 70, 12 );
Text [ en-US ] = "Fon~ts...";
};
PushButton RID_PA_BTN_ADD
{
+ HelpID = "padmin:PushButton:RID_PADIALOG:RID_PA_BTN_ADD";
Pos = MAP_APPFONT( 5, 181 );
Size = MAP_APPFONT( 70, 12 );
Text [ en-US ] = "New Printer...";
@@ -292,6 +309,7 @@ ModalDialog RID_PADIALOG
ModalDialog RID_STRINGQUERYDLG
{
+ HelpID = "padmin:ModalDialog:RID_STRINGQUERYDLG";
OutputSize = TRUE ;
SVLook = TRUE ;
Pos = MAP_APPFONT ( 10 , 10 ) ;
@@ -306,12 +324,14 @@ ModalDialog RID_STRINGQUERYDLG
};
Edit RID_STRQRY_EDT_NEWNAME
{
+ HelpID = "padmin:Edit:RID_STRINGQUERYDLG:RID_STRQRY_EDT_NEWNAME";
Border = TRUE ;
Pos = MAP_APPFONT ( 6 , 23 ) ;
Size = MAP_APPFONT ( 130 , 12 ) ;
};
ComboBox RID_STRQRY_BOX_NEWNAME
{
+ HelpID = "padmin:ComboBox:RID_STRINGQUERYDLG:RID_STRQRY_BOX_NEWNAME";
Border = TRUE ;
DropDown = TRUE;
Pos = MAP_APPFONT ( 6 , 23 ) ;
@@ -340,6 +360,11 @@ String RID_PA_TXT_TESTPAGE_PRINTED
Text [ en-US ] = "The test page was printed succesfully. Please check the result.";
};
+String RID_ERR_NOWRITE
+{
+ Text [en-US] = "No printers can be installed, because the file system is read-only.\nPlease contact your system administrator.";
+};
+
String RID_QRY_PRTNAME
{
Text [ en-US ] = "~New printer name";
@@ -378,6 +403,7 @@ String RID_TXT_TESTPAGE_TIME
ModalDialog RID_FONTNAMEDIALOG
{
+ HelpID = "padmin:ModalDialog:RID_FONTNAMEDIALOG";
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 255 , 110 ) ;
@@ -392,24 +418,28 @@ ModalDialog RID_FONTNAMEDIALOG
};
PushButton RID_FNTNM_BTN_RENAME
{
+ HelpID = "padmin:PushButton:RID_FONTNAMEDIALOG:RID_FNTNM_BTN_RENAME";
Pos = MAP_APPFONT( 196, 31 );
Size = MAP_APPFONT( 50, 12 );
Text [ en-US ] = "Re~name...";
};
PushButton RID_FNTNM_BTN_REMOVE
{
+ HelpID = "padmin:PushButton:RID_FONTNAMEDIALOG:RID_FNTNM_BTN_REMOVE";
Pos = MAP_APPFONT ( 196 , 48 ) ;
Size = MAP_APPFONT ( 50 , 12 ) ;
Text [ en-US ] = "~Remove...";
};
PushButton RID_FNTNM_BTN_IMPORT
{
+ HelpID = "padmin:PushButton:RID_FONTNAMEDIALOG:RID_FNTNM_BTN_IMPORT";
Pos = MAP_APPFONT ( 196 , 65 ) ;
Size = MAP_APPFONT ( 50 , 12 ) ;
Text [ en-US ] = "~Add...";
};
ListBox RID_FNTNM_LB_FONTS
{
+ HelpID = "padmin:ListBox:RID_FONTNAMEDIALOG:RID_FNTNM_LB_FONTS";
Border = TRUE ;
Sort = TRUE ;
AutoHScroll = TRUE;
@@ -536,6 +566,7 @@ String RID_AFMERROR_BOX_TXT
ModelessDialog RID_PROGRESS_DLG
{
+ HelpID = "padmin:ModelessDialog:RID_PROGRESS_DLG";
OutputSize = TRUE ;
SVLook = TRUE ;
Pos = MAP_APPFONT ( 10 , 10 ) ;
@@ -581,6 +612,7 @@ String RID_OPERATION_CONVERTMETRIC
ModalDialog RID_PPDIMPORT_DLG
{
+ HelpID = "padmin:ModalDialog:RID_PPDIMPORT_DLG";
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 265 , 225 ) ;
@@ -601,6 +633,7 @@ ModalDialog RID_PPDIMPORT_DLG
};
ComboBox RID_PPDIMP_LB_PATH
{
+ HelpID = "padmin:ComboBox:RID_PPDIMPORT_DLG:RID_PPDIMP_LB_PATH";
Dropdown = TRUE;
Border = TRUE;
Sort = TRUE;
@@ -610,6 +643,7 @@ ModalDialog RID_PPDIMPORT_DLG
};
PushButton RID_PPDIMP_BTN_SEARCH
{
+ HelpID = "padmin:PushButton:RID_PPDIMPORT_DLG:RID_PPDIMP_BTN_SEARCH";
Pos = MAP_APPFONT( 145, 15 );
Size = MAP_APPFONT( 50, 14 );
Text [ en-US ] = "Browse...";
@@ -623,6 +657,7 @@ ModalDialog RID_PPDIMPORT_DLG
};
MultiListBox RID_PPDIMP_LB_DRIVER
{
+ HelpID = "padmin:MultiListBox:RID_PPDIMPORT_DLG:RID_PPDIMP_LB_DRIVER";
Border = TRUE;
Sort = TRUE;
SimpleMode = TRUE;
@@ -718,6 +753,7 @@ String RID_TXT_PRINTERADDFAILED
ModalDialog RID_ADD_PRINTER_DIALOG
{
+ HelpID = "padmin:ModalDialog:RID_ADD_PRINTER_DIALOG";
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 240 , 172 ) ;
@@ -747,12 +783,14 @@ ModalDialog RID_ADD_PRINTER_DIALOG
};
PushButton RID_ADDP_BTN_NEXT
{
+ HelpID = "padmin:PushButton:RID_ADD_PRINTER_DIALOG:RID_ADDP_BTN_NEXT";
Pos = MAP_APPFONT( 130, 155 );
Size = MAP_APPFONT( 50, 12 );
Text [ en-US ] = "~Next >>";
};
PushButton RID_ADDP_BTN_PREV
{
+ HelpID = "padmin:PushButton:RID_ADD_PRINTER_DIALOG:RID_ADDP_BTN_PREV";
Pos = MAP_APPFONT( 75, 155 );
Size = MAP_APPFONT( 50, 12 );
Text [ en-US ] = "<< ~Back";
@@ -762,6 +800,7 @@ ModalDialog RID_ADD_PRINTER_DIALOG
TabPage RID_ADDP_PAGE_CHOOSEDRIVER
{
+ HelpID = "padmin:TabPage:RID_ADDP_PAGE_CHOOSEDRIVER";
Hide = TRUE;
Pos = MAP_APPFONT( 0, 30 );
Size = MAP_APPFONT( 240, 120 );
@@ -777,6 +816,7 @@ TabPage RID_ADDP_PAGE_CHOOSEDRIVER
};
ListBox RID_ADDP_CHDRV_BOX_DRIVER
{
+ HelpID = "padmin:ListBox:RID_ADDP_PAGE_CHOOSEDRIVER:RID_ADDP_CHDRV_BOX_DRIVER";
Pos = MAP_APPFONT( 5, 15 );
Size = MAP_APPFONT( 175, 100 );
Border = TRUE;
@@ -784,12 +824,14 @@ TabPage RID_ADDP_PAGE_CHOOSEDRIVER
};
PushButton RID_ADDP_CHDRV_BTN_ADD
{
+ HelpID = "padmin:PushButton:RID_ADDP_PAGE_CHOOSEDRIVER:RID_ADDP_CHDRV_BTN_ADD";
Pos = MAP_APPFONT( 185, 15 );
Size = MAP_APPFONT( 50, 12 );
Text [ en-US ] = "~Import...";
};
PushButton RID_ADDP_CHDRV_BTN_REMOVE
{
+ HelpID = "padmin:PushButton:RID_ADDP_PAGE_CHOOSEDRIVER:RID_ADDP_CHDRV_BTN_REMOVE";
Pos = MAP_APPFONT( 185, 32 );
Size = MAP_APPFONT( 50, 12 );
Text [ en-US ] = "~Delete";
@@ -802,6 +844,7 @@ TabPage RID_ADDP_PAGE_CHOOSEDRIVER
TabPage RID_ADDP_PAGE_CHOOSEDEV
{
+ HelpID = "padmin:TabPage:RID_ADDP_PAGE_CHOOSEDEV";
Hide = TRUE;
Pos = MAP_APPFONT( 0, 30 );
Size = MAP_APPFONT( 240, 120 );
@@ -817,24 +860,28 @@ TabPage RID_ADDP_PAGE_CHOOSEDEV
};
RadioButton RID_ADDP_CHDEV_BTN_PRINTER
{
+ HelpID = "padmin:RadioButton:RID_ADDP_PAGE_CHOOSEDEV:RID_ADDP_CHDEV_BTN_PRINTER";
Pos = MAP_APPFONT ( 40, 40 );
Size = MAP_APPFONT( 180, 10 );
Text [ en-US ] = "Add a ~printer";
};
RadioButton RID_ADDP_CHDEV_BTN_FAX
{
+ HelpID = "padmin:RadioButton:RID_ADDP_PAGE_CHOOSEDEV:RID_ADDP_CHDEV_BTN_FAX";
Pos = MAP_APPFONT ( 40, 50 );
Size = MAP_APPFONT( 180, 10 );
Text [ en-US ] = "Connect a fa~x device";
};
RadioButton RID_ADDP_CHDEV_BTN_PDF
{
+ HelpID = "padmin:RadioButton:RID_ADDP_PAGE_CHOOSEDEV:RID_ADDP_CHDEV_BTN_PDF";
Pos = MAP_APPFONT ( 40, 60 );
Size = MAP_APPFONT( 180, 10 );
Text [ en-US ] = "Connect a P~DF converter";
};
RadioButton RID_ADDP_CHDEV_BTN_OLD
{
+ HelpID = "padmin:RadioButton:RID_ADDP_PAGE_CHOOSEDEV:RID_ADDP_CHDEV_BTN_OLD";
Pos = MAP_APPFONT ( 40, 70 );
Size = MAP_APPFONT( 180, 10 );
Text [ en-US ] = "~Import printers from a StarOffice installation";
@@ -843,6 +890,7 @@ TabPage RID_ADDP_PAGE_CHOOSEDEV
TabPage RID_ADDP_PAGE_NAME
{
+ HelpID = "padmin:TabPage:RID_ADDP_PAGE_NAME";
Hide = TRUE;
Pos = MAP_APPFONT( 0, 30 );
Size = MAP_APPFONT( 240, 120 );
@@ -870,12 +918,14 @@ TabPage RID_ADDP_PAGE_NAME
};
Edit RID_ADDP_NAME_EDT_NAME
{
+ HelpID = "padmin:Edit:RID_ADDP_PAGE_NAME:RID_ADDP_NAME_EDT_NAME";
Pos = MAP_APPFONT( 40, 35 );
Size = MAP_APPFONT( 160, 12 );
Border = TRUE;
};
Edit RID_ADDP_NAME_EDT_FAXNAME
{
+ HelpID = "padmin:Edit:RID_ADDP_PAGE_NAME:RID_ADDP_NAME_EDT_FAXNAME";
Pos = MAP_APPFONT( 40, 35 );
Size = MAP_APPFONT( 160, 12 );
Border = TRUE;
@@ -883,6 +933,7 @@ TabPage RID_ADDP_PAGE_NAME
};
Edit RID_ADDP_NAME_EDT_PDFNAME
{
+ HelpID = "padmin:Edit:RID_ADDP_PAGE_NAME:RID_ADDP_NAME_EDT_PDFNAME";
Pos = MAP_APPFONT( 40, 35 );
Size = MAP_APPFONT( 160, 12 );
Border = TRUE;
@@ -890,12 +941,14 @@ TabPage RID_ADDP_PAGE_NAME
};
CheckBox RID_ADDP_NAME_BOX_DEFAULT
{
+ HelpID = "padmin:CheckBox:RID_ADDP_PAGE_NAME:RID_ADDP_NAME_BOX_DEFAULT";
Pos = MAP_APPFONT( 40, 50 );
Size = MAP_APPFONT( 160, 12 );
Text [ en-US ] = "~Use as default printer";
};
CheckBox RID_ADDP_NAME_BOX_FAXSWALLOW
{
+ HelpID = "padmin:CheckBox:RID_ADDP_PAGE_NAME:RID_ADDP_NAME_BOX_FAXSWALLOW";
Pos = MAP_APPFONT( 40, 50 );
Size = MAP_APPFONT( 160, 12 );
Text [ en-US ] = "Remo~ve fax number from output";
@@ -904,6 +957,7 @@ TabPage RID_ADDP_PAGE_NAME
TabPage RID_ADDP_PAGE_COMMAND
{
+ HelpID = "padmin:TabPage:RID_ADDP_PAGE_COMMAND";
Hide = TRUE;
Pos = MAP_APPFONT( 0, 30 );
Size = MAP_APPFONT( 240, 120 );
@@ -920,12 +974,14 @@ TabPage RID_ADDP_PAGE_COMMAND
};
ComboBox RID_ADDP_CMD_BOX_COMMAND
{
+ HelpID = "padmin:ComboBox:RID_ADDP_PAGE_COMMAND:RID_ADDP_CMD_BOX_COMMAND";
Pos = MAP_APPFONT( 10, 30);
Size = MAP_APPFONT( 220, 85 );
Border = TRUE;
};
ComboBox RID_ADDP_CMD_BOX_PDFCOMMAND
{
+ HelpID = "padmin:ComboBox:RID_ADDP_PAGE_COMMAND:RID_ADDP_CMD_BOX_PDFCOMMAND";
Pos = MAP_APPFONT( 10, 30);
Size = MAP_APPFONT( 220, 60 );
Border = TRUE;
@@ -938,18 +994,21 @@ TabPage RID_ADDP_PAGE_COMMAND
};
Edit RID_ADDP_CMD_EDT_PDFDIR
{
+ HelpID = "padmin:Edit:RID_ADDP_PAGE_COMMAND:RID_ADDP_CMD_EDT_PDFDIR";
Border = TRUE;
Pos = MAP_APPFONT( 10, 104 );
Size = MAP_APPFONT( 190, 12 );
};
PushButton RID_ADDP_CMD_BTN_PDFDIR
{
+ HelpID = "padmin:PushButton:RID_ADDP_PAGE_COMMAND:RID_ADDP_CMD_BTN_PDFDIR";
Pos = MAP_APPFONT( 205, 104 );
Size = MAP_APPFONT( 25, 12 );
Text = "~...";
};
PushButton RID_ADDP_CMD_BTN_HELP
{
+ HelpID = "padmin:PushButton:RID_ADDP_PAGE_COMMAND:RID_ADDP_CMD_BTN_HELP";
Pos = MAP_APPFONT( 180, 2 );
Size = MAP_APPFONT( 50, 12 );
Text [ en-US ] = "~Help";
@@ -966,6 +1025,7 @@ TabPage RID_ADDP_PAGE_COMMAND
TabPage RID_ADDP_PAGE_OLDPRINTERS
{
+ HelpID = "padmin:TabPage:RID_ADDP_PAGE_OLDPRINTERS";
Hide = TRUE;
Pos = MAP_APPFONT( 0, 30 );
Size = MAP_APPFONT( 240, 120 );
@@ -982,12 +1042,14 @@ TabPage RID_ADDP_PAGE_OLDPRINTERS
};
MultiListBox RID_ADDP_OLD_BOX_PRINTERS
{
+ HelpID = "padmin:MultiListBox:RID_ADDP_PAGE_OLDPRINTERS:RID_ADDP_OLD_BOX_PRINTERS";
Pos = MAP_APPFONT( 10, 35 );
Size = MAP_APPFONT( 165, 80 );
Border = TRUE;
};
PushButton RID_ADDP_OLD_BTN_SELECTALL
{
+ HelpID = "padmin:PushButton:RID_ADDP_PAGE_OLDPRINTERS:RID_ADDP_OLD_BTN_SELECTALL";
Pos = MAP_APPFONT( 180, 35 );
Size = MAP_APPFONT( 50, 12 );
Text [ en-US ] = "~Select All";
@@ -996,6 +1058,7 @@ TabPage RID_ADDP_PAGE_OLDPRINTERS
TabPage RID_ADDP_PAGE_FAXDRIVER
{
+ HelpID = "padmin:TabPage:RID_ADDP_PAGE_FAXDRIVER";
Hide = TRUE;
Pos = MAP_APPFONT( 0, 30 );
Size = MAP_APPFONT( 240, 120 );
@@ -1012,12 +1075,14 @@ TabPage RID_ADDP_PAGE_FAXDRIVER
};
RadioButton RID_ADDP_FAXDRV_BTN_DEFAULT
{
+ HelpID = "padmin:RadioButton:RID_ADDP_PAGE_FAXDRIVER:RID_ADDP_FAXDRV_BTN_DEFAULT";
Pos = MAP_APPFONT( 40,40 );
Size = MAP_APPFONT( 160, 10 );
Text [ en-US ] = "T~he default driver";
};
RadioButton RID_ADDP_FAXDRV_BTN_SELECT
{
+ HelpID = "padmin:RadioButton:RID_ADDP_PAGE_FAXDRIVER:RID_ADDP_FAXDRV_BTN_SELECT";
Pos = MAP_APPFONT( 40, 50 );
Size = MAP_APPFONT( 160,24 );
Text [ en-US ] = "A speci~fic driver, to adapt the format to another printer";
@@ -1026,6 +1091,7 @@ TabPage RID_ADDP_PAGE_FAXDRIVER
TabPage RID_ADDP_PAGE_PDFDRIVER
{
+ HelpID = "padmin:TabPage:RID_ADDP_PAGE_PDFDRIVER";
Hide = TRUE;
Pos = MAP_APPFONT( 0, 30 );
Size = MAP_APPFONT( 240, 120 );
@@ -1042,18 +1108,21 @@ TabPage RID_ADDP_PAGE_PDFDRIVER
};
RadioButton RID_ADDP_PDFDRV_BTN_DEFAULT
{
+ HelpID = "padmin:RadioButton:RID_ADDP_PAGE_PDFDRIVER:RID_ADDP_PDFDRV_BTN_DEFAULT";
Pos = MAP_APPFONT( 40, 40 );
Size = MAP_APPFONT( 160, 10 );
Text [ en-US ] = "T~he default driver";
};
RadioButton RID_ADDP_PDFDRV_BTN_DIST
{
+ HelpID = "padmin:RadioButton:RID_ADDP_PAGE_PDFDRIVER:RID_ADDP_PDFDRV_BTN_DIST";
Pos = MAP_APPFONT( 40,50 );
Size = MAP_APPFONT( 160, 10 );
Text [ en-US ] = "The Adobe D~istiller(tm) driver";
};
RadioButton RID_ADDP_PDFDRV_BTN_SELECT
{
+ HelpID = "padmin:RadioButton:RID_ADDP_PAGE_PDFDRIVER:RID_ADDP_PDFDRV_BTN_SELECT";
Pos = MAP_APPFONT( 40, 60 );
Size = MAP_APPFONT( 160, 24 );
Text [ en-US ] = "A spec~ific driver, to adapt the format to another printer";
diff --git a/padmin/source/prtsetup.cxx b/padmin/source/prtsetup.cxx
index 17d28515e540..8165b8015403 100644
--- a/padmin/source/prtsetup.cxx
+++ b/padmin/source/prtsetup.cxx
@@ -198,6 +198,7 @@ IMPL_LINK( RTSDialog, ClickButton, Button*, pButton )
m_aJobData.m_nColorDepth = m_pDevicePage->getDepth();
m_aJobData.m_nColorDevice = m_pDevicePage->getColorDevice();
m_aJobData.m_nPSLevel = m_pDevicePage->getLevel();
+ m_aJobData.m_nPDFDevice = m_pDevicePage->getPDFDevice();
}
if( m_pOtherPage )
// write other settings
@@ -363,8 +364,8 @@ RTSDevicePage::RTSDevicePage( RTSDialog* pParent ) :
m_aPPDKeyBox( this, PaResId( RID_RTS_DEVICE_PPDKEY_BOX ) ),
m_aPPDValueText( this, PaResId( RID_RTS_DEVICE_PPDVALUE_TXT ) ),
m_aPPDValueBox( this, PaResId( RID_RTS_DEVICE_PPDVALUE_BOX ) ),
- m_aLevelText( this, PaResId( RID_RTS_DEVICE_LEVEL_TXT ) ),
- m_aLevelBox( this, PaResId( RID_RTS_DEVICE_LEVEL_BOX ) ),
+ m_aLevelText( this, PaResId( RID_RTS_DEVICE_PRINTLANG_TXT ) ),
+ m_aLevelBox( this, PaResId( RID_RTS_DEVICE_PRINTLANG_BOX ) ),
m_aSpaceText( this, PaResId( RID_RTS_DEVICE_SPACE_TXT ) ),
m_aSpaceBox( this, PaResId( RID_RTS_DEVICE_SPACE_BOX ) ),
m_aDepthText( this, PaResId( RID_RTS_DEVICE_DEPTH_TXT ) ),
@@ -385,13 +386,19 @@ RTSDevicePage::RTSDevicePage( RTSDialog* pParent ) :
case 1: m_aSpaceBox.SelectEntry( m_aSpaceColor );break;
}
- m_aLevelBox.InsertEntry( m_pParent->m_aFromDriverString );
- m_aLevelBox.InsertEntry( String( RTL_CONSTASCII_USTRINGPARAM( "1" ) ) );
- m_aLevelBox.InsertEntry( String( RTL_CONSTASCII_USTRINGPARAM( "2" ) ) );
- if( m_pParent->m_aJobData.m_nPSLevel == 0 )
- m_aLevelBox.SelectEntry( m_pParent->m_aFromDriverString );
+ ULONG nLevelEntryData = 0;
+ if( m_pParent->m_aJobData.m_nPDFDevice > 0 )
+ nLevelEntryData = 10;
else
- m_aLevelBox.SelectEntry( String::CreateFromInt32( m_pParent->m_aJobData.m_nPSLevel ) );
+ nLevelEntryData = m_pParent->m_aJobData.m_nPSLevel+1;
+ for( USHORT i = 0; i < m_aLevelBox.GetEntryCount(); i++ )
+ {
+ if( (ULONG)m_aLevelBox.GetEntryData( i ) == nLevelEntryData )
+ {
+ m_aLevelBox.SelectEntryPos( i );
+ break;
+ }
+ }
m_aDepthBox.SelectEntry( String::CreateFromInt32( m_pParent->m_aJobData.m_nColorDepth ).AppendAscii( " Bit" ) );
@@ -430,6 +437,22 @@ void RTSDevicePage::update()
// ------------------------------------------------------------------
+ULONG RTSDevicePage::getLevel()
+{
+ ULONG nLevel = (ULONG)m_aLevelBox.GetEntryData( m_aLevelBox.GetSelectEntryPos() );
+ return nLevel < 10 ? nLevel-1 : 0;
+}
+
+// ------------------------------------------------------------------
+
+ULONG RTSDevicePage::getPDFDevice()
+{
+ ULONG nLevel = (ULONG)m_aLevelBox.GetEntryData( m_aLevelBox.GetSelectEntryPos() );
+ return nLevel > 9 ? 1 : 0;
+}
+
+// ------------------------------------------------------------------
+
IMPL_LINK( RTSDevicePage, SelectHdl, ListBox*, pBox )
{
if( pBox == &m_aPPDKeyBox )
diff --git a/padmin/source/prtsetup.hxx b/padmin/source/prtsetup.hxx
index 65288f738482..72e3d81ee8d7 100644
--- a/padmin/source/prtsetup.hxx
+++ b/padmin/source/prtsetup.hxx
@@ -147,7 +147,8 @@ public:
void update();
- ULONG getLevel() { return m_aLevelBox.GetSelectEntry().ToInt32(); }
+ ULONG getLevel();
+ ULONG getPDFDevice();
ULONG getDepth() { return m_aDepthBox.GetSelectEntry().ToInt32(); }
ULONG getColorDevice()
{
diff --git a/padmin/source/rtsetup.hrc b/padmin/source/rtsetup.hrc
index 30439088de8e..7b6677de7ec4 100644
--- a/padmin/source/rtsetup.hrc
+++ b/padmin/source/rtsetup.hrc
@@ -48,13 +48,13 @@
#define RID_RTS_DEVICEPAGE 4003
#define RID_RTS_DEVICE_COLOR_TXT 1
-#define RID_RTS_DEVICE_GRAY_TXT 2
+#define RID_RTS_DEVICE_GRAY_TXT 2
#define RID_RTS_DEVICE_PPDKEY_TXT 3
#define RID_RTS_DEVICE_PPDKEY_BOX 4
-#define RID_RTS_DEVICE_PPDVALUE_TXT 5
-#define RID_RTS_DEVICE_PPDVALUE_BOX 6
-#define RID_RTS_DEVICE_LEVEL_TXT 7
-#define RID_RTS_DEVICE_LEVEL_BOX 8
+#define RID_RTS_DEVICE_PPDVALUE_TXT 5
+#define RID_RTS_DEVICE_PPDVALUE_BOX 6
+#define RID_RTS_DEVICE_PRINTLANG_TXT 7
+#define RID_RTS_DEVICE_PRINTLANG_BOX 8
#define RID_RTS_DEVICE_SPACE_TXT 9
#define RID_RTS_DEVICE_SPACE_BOX 10
#define RID_RTS_DEVICE_DEPTH_TXT 11
diff --git a/padmin/source/rtsetup.src b/padmin/source/rtsetup.src
index e04374a72245..38f3bf224a13 100644
--- a/padmin/source/rtsetup.src
+++ b/padmin/source/rtsetup.src
@@ -78,6 +78,7 @@ TabDialog RID_RTS_RTSDIALOG
TabPage RID_RTS_PAPERPAGE
{
+ HelpID = "padmin:TabPage:RID_RTS_PAPERPAGE";
Hide = TRUE;
Size = MAP_APPFONT( 230, 175 );
FixedText RID_RTS_PAPER_PAPER_TXT
@@ -88,6 +89,7 @@ TabPage RID_RTS_PAPERPAGE
};
ListBox RID_RTS_PAPER_PAPER_BOX
{
+ HelpID = "padmin:ListBox:RID_RTS_PAPERPAGE:RID_RTS_PAPER_PAPER_BOX";
Border = TRUE;
DropDown = TRUE;
Pos = MAP_APPFONT( 115, 5 );
@@ -101,6 +103,7 @@ TabPage RID_RTS_PAPERPAGE
};
ListBox RID_RTS_PAPER_ORIENTATION_BOX
{
+ HelpID = "padmin:ListBox:RID_RTS_PAPERPAGE:RID_RTS_PAPER_ORIENTATION_BOX";
Border = TRUE;
DropDown = TRUE;
Pos = MAP_APPFONT( 115, 20 );
@@ -114,6 +117,7 @@ TabPage RID_RTS_PAPERPAGE
};
ListBox RID_RTS_PAPER_DUPLEX_BOX
{
+ HelpID = "padmin:ListBox:RID_RTS_PAPERPAGE:RID_RTS_PAPER_DUPLEX_BOX";
Border = TRUE;
DropDown = TRUE;
Pos = MAP_APPFONT( 115, 35 );
@@ -127,6 +131,7 @@ TabPage RID_RTS_PAPERPAGE
};
ListBox RID_RTS_PAPER_SLOT_BOX
{
+ HelpID = "padmin:ListBox:RID_RTS_PAPERPAGE:RID_RTS_PAPER_SLOT_BOX";
Border = TRUE;
DropDown = TRUE;
Pos = MAP_APPFONT( 115, 50 );
@@ -136,6 +141,7 @@ TabPage RID_RTS_PAPERPAGE
TabPage RID_RTS_DEVICEPAGE
{
+ HelpID = "padmin:TabPage:RID_RTS_DEVICEPAGE";
Hide = TRUE;
Size = MAP_APPFONT( 230, 175 );
@@ -156,6 +162,7 @@ TabPage RID_RTS_DEVICEPAGE
};
ListBox RID_RTS_DEVICE_PPDKEY_BOX
{
+ HelpID = "padmin:ListBox:RID_RTS_DEVICEPAGE:RID_RTS_DEVICE_PPDKEY_BOX";
Border = TRUE;
Pos = MAP_APPFONT( 5, 14 );
Size = MAP_APPFONT( 105, 111 );
@@ -168,22 +175,32 @@ TabPage RID_RTS_DEVICEPAGE
};
ListBox RID_RTS_DEVICE_PPDVALUE_BOX
{
+ HelpID = "padmin:ListBox:RID_RTS_DEVICEPAGE:RID_RTS_DEVICE_PPDVALUE_BOX";
Border = TRUE;
Pos = MAP_APPFONT( 120, 14 );
Size = MAP_APPFONT( 105, 111 );
};
- FixedText RID_RTS_DEVICE_LEVEL_TXT
+ FixedText RID_RTS_DEVICE_PRINTLANG_TXT
{
Pos = MAP_APPFONT( 5, 130 );
Size = MAP_APPFONT( 80, 8 );
- Text [ en-US ] = "PostScript ~Level";
+ Text [ en-US ] = "Printer ~Language type";
};
- ListBox RID_RTS_DEVICE_LEVEL_BOX
+ ListBox RID_RTS_DEVICE_PRINTLANG_BOX
{
+ HelpID = "padmin:ListBox:RID_RTS_DEVICEPAGE:RID_RTS_DEVICE_LEVEL_BOX";
DropDown = TRUE;
Pos = MAP_APPFONT( 120, 130 );
Size = MAP_APPFONT( 105, 200 );
+ StringList [en-US] =
+ {
+ < "PostScript (Level from driver)" ; 1; > ;
+ < "PostScript Level 1" ; 2; > ;
+ < "PostScript Level 2"; 3; > ;
+ < "PostScript Level 3"; 3; > ;
+ < "PDF"; 10; > ;
+ };
};
FixedText RID_RTS_DEVICE_SPACE_TXT
{
@@ -193,6 +210,7 @@ TabPage RID_RTS_DEVICEPAGE
};
ListBox RID_RTS_DEVICE_SPACE_BOX
{
+ HelpID = "padmin:ListBox:RID_RTS_DEVICEPAGE:RID_RTS_DEVICE_SPACE_BOX";
DropDown = TRUE;
Pos = MAP_APPFONT( 120, 145 );
Size = MAP_APPFONT( 105, 200 );
@@ -205,6 +223,7 @@ TabPage RID_RTS_DEVICEPAGE
};
ListBox RID_RTS_DEVICE_DEPTH_BOX
{
+ HelpID = "padmin:ListBox:RID_RTS_DEVICEPAGE:RID_RTS_DEVICE_DEPTH_BOX";
DropDown = TRUE;
Pos = MAP_APPFONT( 120, 160 );
Size = MAP_APPFONT( 105, 200 );
@@ -218,11 +237,13 @@ TabPage RID_RTS_DEVICEPAGE
TabPage RID_RTS_FONTSUBSTPAGE
{
+ HelpID = "padmin:TabPage:RID_RTS_FONTSUBSTPAGE";
Hide = TRUE;
Size = MAP_APPFONT( 230, 175 );
CheckBox RID_RTS_FS_ENABLE_BTN
{
+ HelpID = "padmin:CheckBox:RID_RTS_FONTSUBSTPAGE:RID_RTS_FS_ENABLE_BTN";
Pos = MAP_APPFONT( 5, 5 );
Size = MAP_APPFONT( 180, 10 );
Text [ en-US ] = "~Enable font replacement";
@@ -236,6 +257,7 @@ TabPage RID_RTS_FONTSUBSTPAGE
};
MultiListBox RID_RTS_FS_SUBST_BOX
{
+ HelpID = "padmin:MultiListBox:RID_RTS_FONTSUBSTPAGE:RID_RTS_FS_SUBST_BOX";
AutoHScroll = TRUE;
Border = TRUE;
Sort = TRUE;
@@ -245,12 +267,14 @@ TabPage RID_RTS_FONTSUBSTPAGE
};
PushButton RID_RTS_FS_ADD_BTN
{
+ HelpID = "padmin:PushButton:RID_RTS_FONTSUBSTPAGE:RID_RTS_FS_ADD_BTN";
Pos = MAP_APPFONT( 5, 125 );
Size = MAP_APPFONT( 107, 12 );
Text [ en-US ] = "~Add";
};
PushButton RID_RTS_FS_REMOVE_BTN
{
+ HelpID = "padmin:PushButton:RID_RTS_FONTSUBSTPAGE:RID_RTS_FS_REMOVE_BTN";
Pos = MAP_APPFONT( 117, 125 );
Size = MAP_APPFONT( 107, 12 );
Text [ en-US ] = "~Remove";
@@ -263,6 +287,7 @@ TabPage RID_RTS_FONTSUBSTPAGE
};
ComboBox RID_RTS_FS_FROM_BOX
{
+ HelpID = "padmin:ComboBox:RID_RTS_FONTSUBSTPAGE:RID_RTS_FS_FROM_BOX";
Border = TRUE;
DropDown = TRUE;
Sort = TRUE;
@@ -277,6 +302,7 @@ TabPage RID_RTS_FONTSUBSTPAGE
};
ListBox RID_RTS_FS_TO_BOX
{
+ HelpID = "padmin:ListBox:RID_RTS_FONTSUBSTPAGE:RID_RTS_FS_TO_BOX";
Border = TRUE;
DropDown = TRUE;
Sort = TRUE;
@@ -287,11 +313,13 @@ TabPage RID_RTS_FONTSUBSTPAGE
TabPage RID_RTS_COMMANDPAGE
{
+ HelpID = "padmin:TabPage:RID_RTS_COMMANDPAGE";
Hide = TRUE;
Size = MAP_APPFONT( 230, 175 );
ComboBox RID_RTS_CMD_CB_COMMANDS
{
+ HelpID = "padmin:ComboBox:RID_RTS_COMMANDPAGE:RID_RTS_CMD_CB_COMMANDS";
Border = TRUE ;
Sort = TRUE ;
Dropdown = TRUE;
@@ -300,6 +328,7 @@ TabPage RID_RTS_COMMANDPAGE
};
CheckBox RID_RTS_CMD_CB_EXTERNAL
{
+ HelpID = "padmin:CheckBox:RID_RTS_COMMANDPAGE:RID_RTS_CMD_CB_EXTERNAL";
Pos = MAP_APPFONT( 11, 95 );
Size = MAP_APPFONT( 220, 10 );
Text [ en-US ] = "~Use system print dialog, disable %PRODUCTNAME's print dialog";
@@ -313,6 +342,7 @@ TabPage RID_RTS_COMMANDPAGE
};
ComboBox RIT_RTS_CMD_CB_QUICKCMD
{
+ HelpID = "padmin:ComboBox:RID_RTS_COMMANDPAGE:RIT_RTS_CMD_CB_QUICKCMD";
Border = TRUE;
Sort = TRUE;
Dropdown = TRUE;
@@ -340,6 +370,7 @@ TabPage RID_RTS_COMMANDPAGE
ListBox RID_RTS_CMD_LB_CONFIGURE
{
+ HelpID = "padmin:ListBox:RID_RTS_COMMANDPAGE:RID_RTS_CMD_LB_CONFIGURE";
DropDown = true;
Border = true;
Pos = MAP_APPFONT( 101, 56 );
@@ -354,6 +385,7 @@ TabPage RID_RTS_COMMANDPAGE
CheckBox RID_RTS_CMD_BOX_SWALLOWFAXNO
{
+ HelpID = "padmin:CheckBox:RID_RTS_COMMANDPAGE:RID_RTS_CMD_BOX_SWALLOWFAXNO";
Pos = MAP_APPFONT( 11, 146 );
Size = MAP_APPFONT( 130, 8 );
Text [ en-US ] = "~Fax number will be removed from output";
@@ -366,12 +398,14 @@ TabPage RID_RTS_COMMANDPAGE
};
Edit RID_RTS_CMD_EDT_PDFDIR
{
+ HelpID = "padmin:Edit:RID_RTS_COMMANDPAGE:RID_RTS_CMD_EDT_PDFDIR";
Border = TRUE;
Pos = MAP_APPFONT( 11, 155 );
Size = MAP_APPFONT( 130, 12 );
};
PushButton RID_RTS_CMD_BTN_PDFDIR
{
+ HelpID = "padmin:PushButton:RID_RTS_COMMANDPAGE:RID_RTS_CMD_BTN_PDFDIR";
Pos = MAP_APPFONT( 146, 155 );
Size = MAP_APPFONT( 15, 12 );
Text = "...";
@@ -395,12 +429,14 @@ TabPage RID_RTS_COMMANDPAGE
};
PushButton RID_RTS_CMD_BTN_HELP
{
+ HelpID = "padmin:PushButton:RID_RTS_COMMANDPAGE:RID_RTS_CMD_BTN_HELP";
Pos = MAP_APPFONT( 170, 55 );
Size = MAP_APPFONT( 50, 12 );
Text [ en-US ] = "~Help";
};
PushButton RID_RTS_CMD_BTN_REMOVE
{
+ HelpID = "padmin:PushButton:RID_RTS_COMMANDPAGE:RID_RTS_CMD_BTN_REMOVE";
Pos = MAP_APPFONT( 170, 72 );
Size = MAP_APPFONT( 50, 12 );
Text [ en-US ] = "~Remove";
@@ -421,6 +457,7 @@ TabPage RID_RTS_COMMANDPAGE
TabPage RID_RTS_OTHERPAGE
{
+ HelpID = "padmin:TabPage:RID_RTS_OTHERPAGE";
Hide = TRUE;
Size = MAP_APPFONT( 230, 175 );
@@ -432,6 +469,7 @@ TabPage RID_RTS_OTHERPAGE
};
MetricField RID_RTS_OTHER_LEFTMARGIN_BOX
{
+ HelpID = "padmin:MetricField:RID_RTS_OTHERPAGE:RID_RTS_OTHER_LEFTMARGIN_BOX";
Border = TRUE ;
Pos = MAP_APPFONT ( 100 , 5 ) ;
Size = MAP_APPFONT ( 50 , 12 ) ;
@@ -448,6 +486,7 @@ TabPage RID_RTS_OTHERPAGE
};
MetricField RID_RTS_OTHER_TOPMARGIN_BOX
{
+ HelpID = "padmin:MetricField:RID_RTS_OTHERPAGE:RID_RTS_OTHER_TOPMARGIN_BOX";
Border = TRUE ;
Pos = MAP_APPFONT ( 100 , 20 ) ;
Size = MAP_APPFONT ( 50 , 12 ) ;
@@ -464,6 +503,7 @@ TabPage RID_RTS_OTHERPAGE
};
MetricField RID_RTS_OTHER_RIGHTMARGIN_BOX
{
+ HelpID = "padmin:MetricField:RID_RTS_OTHERPAGE:RID_RTS_OTHER_RIGHTMARGIN_BOX";
Border = TRUE ;
Pos = MAP_APPFONT ( 100 , 35 ) ;
Size = MAP_APPFONT ( 50 , 12 ) ;
@@ -480,6 +520,7 @@ TabPage RID_RTS_OTHERPAGE
};
MetricField RID_RTS_OTHER_BOTTOMMARGIN_BOX
{
+ HelpID = "padmin:MetricField:RID_RTS_OTHERPAGE:RID_RTS_OTHER_BOTTOMMARGIN_BOX";
Border = TRUE ;
Pos = MAP_APPFONT ( 100 , 50 ) ;
Size = MAP_APPFONT ( 50 , 12 ) ;
@@ -496,12 +537,14 @@ TabPage RID_RTS_OTHERPAGE
};
Edit RID_RTS_OTHER_COMMENT_EDT
{
+ HelpID = "padmin:Edit:RID_RTS_OTHERPAGE:RID_RTS_OTHER_COMMENT_EDT";
Border = TRUE ;
Pos = MAP_APPFONT ( 5 , 75 ) ;
Size = MAP_APPFONT ( 220 , 12 ) ;
};
PushButton RID_RTS_OTHER_DEFAULT_BTN
{
+ HelpID = "padmin:PushButton:RID_RTS_OTHERPAGE:RID_RTS_OTHER_DEFAULT_BTN";
Pos = MAP_APPFONT( 175, 5 );
Size = MAP_APPFONT( 50, 12 );
Text [ en-US ] = "~Default";
@@ -515,6 +558,7 @@ String RID_TXT_QUERYFAXNUMBER
ModalDialog RID_RTS_PWDIALOG
{
+ HelpID = "padmin:ModalDialog:RID_RTS_PWDIALOG";
Text [ en-US ] = "Authentication request";
OutputSize = TRUE ;
SVLook = TRUE ;
@@ -537,6 +581,7 @@ ModalDialog RID_RTS_PWDIALOG
};
Edit RID_RTS_PWDIALOG_USER_EDT
{
+ HelpID = "padmin:Edit:RID_RTS_PWDIALOG:RID_RTS_PWDIALOG_USER_EDT";
Pos = MAP_APPFONT( 70, 29 );
Size = MAP_APPFONT( 75, 12 );
Border = TRUE;
@@ -549,6 +594,7 @@ ModalDialog RID_RTS_PWDIALOG
};
Edit RID_RTS_PWDIALOG_PASS_EDT
{
+ HelpID = "padmin:Edit:RID_RTS_PWDIALOG:RID_RTS_PWDIALOG_PASS_EDT";
Pos = MAP_APPFONT( 70, 44 );
Size = MAP_APPFONT( 75, 12 );
Border = TRUE;
diff --git a/psprint_config/prj/build.lst b/psprint_config/prj/build.lst
index b2dea37df50b..697fcf6062f0 100644
--- a/psprint_config/prj/build.lst
+++ b/psprint_config/prj/build.lst
@@ -1,4 +1,4 @@
-pc psprint_config : soltools afms NULL
+pc psprint_config : soltools AFMS:afms NULL
pc psprint_config usr1 - all pc_mkout NULL
pc psprint_config\configuration nmake - u pc_conf NULL
pc psprint_config\configuration\ppds nmake - u pc_ppds NULL
diff --git a/rsc/inc/rscdb.hxx b/rsc/inc/rscdb.hxx
index 1d5af35de9ff..51461cf356d6 100644
--- a/rsc/inc/rscdb.hxx
+++ b/rsc/inc/rscdb.hxx
@@ -285,6 +285,7 @@ public:
RscRange a0to9999Short;
RscIdRange aIdLong;
RscString aString;
+ RscString aStringLiteral;
RscFlag aWinBits;
RscLangEnum aLangType;
RscLangArray aLangString;
diff --git a/rsc/inc/vclrsc.hxx b/rsc/inc/vclrsc.hxx
index 19677171dcb2..d4084f2bc239 100644
--- a/rsc/inc/vclrsc.hxx
+++ b/rsc/inc/vclrsc.hxx
@@ -162,9 +162,11 @@ typedef sal_Int64 WinBits;
// - Help-Types -
// --------------
+#if 0
// from vcl/inc/help.hxx
-#define OOO_HELP_INDEX ((ULONG)0xFFFFFFFF)
-#define OOO_HELP_HELPONHELP ((ULONG)0xFFFFFFFE)
+#define OOO_HELP_INDEX ".help:index"
+#define OOO_HELP_HELPONHELP ".help:helponhelp"
+#endif
// --------------
// - FieldTypes -
diff --git a/rsc/source/parser/erscerr.cxx b/rsc/source/parser/erscerr.cxx
index 158aea21b6e3..ed63510737aa 100644
--- a/rsc/source/parser/erscerr.cxx
+++ b/rsc/source/parser/erscerr.cxx
@@ -88,10 +88,8 @@ void RscError::StdOut( const char * pStr, const RscVerbosity _verbosityLevel )
*************************************************************************/
void RscError::StdErr( const char * pStr )
{
-#ifndef WIN
if( pStr )
fprintf( stderr, "%s", pStr );
-#endif
}
/*************************************************************************
diff --git a/rsc/source/parser/rscdb.cxx b/rsc/source/parser/rscdb.cxx
index 97d23d4e3b53..05f7210fd357 100644
--- a/rsc/source/parser/rscdb.cxx
+++ b/rsc/source/parser/rscdb.cxx
@@ -81,6 +81,7 @@ RscTypCont :: RscTypCont( RscError * pErrHdl,
a0to9999Short( pHS->getID( "YearShort" ), RSC_NOTYPE ),
aIdLong( pHS->getID( "IDLONG" ), RSC_NOTYPE ),
aString( pHS->getID( "Chars" ), RSC_NOTYPE ),
+ aStringLiteral( pHS->getID( "Chars" ), RSC_NOTYPE ),
aWinBits( pHS->getID( "WinBits" ), RSC_NOTYPE ),
aLangType(),
aLangString( pHS->getID( "Lang_Chars" ), RSC_NOTYPE, &aString, &aLangType ),
@@ -125,7 +126,7 @@ static sal_uInt32 getLangIdAndShortenLocale( RscTypCont* pTypCont,
else
rLang = rtl::OString();
#if OSL_DEBUG_LEVEL > 1
- fprintf( stderr, " %s (0x%hx)", aL.getStr(), nRet );
+ fprintf( stderr, " %s (0x%hx)", aL.getStr(), (int)nRet );
#endif
return nRet;
}
diff --git a/rsc/source/parser/rscicpx.cxx b/rsc/source/parser/rscicpx.cxx
index 625417769f45..1942711a4a47 100644
--- a/rsc/source/parser/rscicpx.cxx
+++ b/rsc/source/parser/rscicpx.cxx
@@ -297,7 +297,7 @@ RscTop * RscTypCont::InitClassWindow( RscTop * pSuper, RscEnum * pMapUnit,
InsWinBit( pClassWindow, "DialogControl", nTabControlId );
nId = aNmTb.Put( "HelpID", VARNAME );
- pClassWindow->SetVariable( nId, &aIdLong );
+ pClassWindow->SetVariable( nId, &aStringLiteral, NULL, 0, WINDOW_HELPID );
nRsc_XYMAPMODEId = nId = aNmTb.Put( "_XYMapMode", VARNAME );
@@ -325,7 +325,7 @@ RscTop * RscTypCont::InitClassWindow( RscTop * pSuper, RscEnum * pMapUnit,
nId = aNmTb.Put( "ExtraLong", VARNAME );
pClassWindow->SetVariable( nId, &aLong, NULL, 0, WINDOW_EXTRALONG );
nId = aNmTb.Put( "UniqueId", VARNAME );
- pClassWindow->SetVariable( nId, &aLong, NULL, 0, WINDOW_UNIQUEID );
+ pClassWindow->SetVariable( nId, &aString, NULL, 0, WINDOW_UNIQUEID );
// BorderStyle
RscEnum* pBorderStyleEnum = new RscEnum( pHS->getID( "WindowBorderStyle" ), RSC_NOTYPE );
@@ -1201,7 +1201,7 @@ RscTop * RscTypCont::InitClassMenuItem( RscTop * pSuper,
pClassMenuItem->SetVariable( nId, &aLangString, NULL, 0,
RSC_MENUITEM_HELPTEXT );
nId = aNmTb.Put( "HelpID", VARNAME );
- pClassMenuItem->SetVariable( nId, &aIdLong, NULL, 0,
+ pClassMenuItem->SetVariable( nId, &aStringLiteral, NULL, 0,
RSC_MENUITEM_HELPID );
nId = aNmTb.Put( "AccelKey", VARNAME );
pClassMenuItem->SetVariable( nId, pClassKeyCode, NULL, 0,
@@ -1276,7 +1276,7 @@ RscTop * RscTypCont::InitClassMessBox( RscTop * pSuper,
nId = aNmTb.Put( "DefButton", VARNAME );
pClassMessBox->SetVariable( nId, pMessDefButton );
nId = aNmTb.Put( "HelpID", VARNAME );
- pClassMessBox->SetVariable( nId, &aIdLong );
+ pClassMessBox->SetVariable( nId, &aStringLiteral );
nId = aNmTb.Put( "SysModal", VARNAME );
pClassMessBox->SetVariable( nId, &aBool );
nId = aNmTb.Put( "Title", VARNAME );
@@ -2015,7 +2015,7 @@ RscTop * RscTypCont::InitClassToolBoxItem( RscTop * pSuper,
pClassToolBoxItem->SetVariable( nId, pClient, NULL, VAR_NODATAINST, 0, l_nVarId );
}
nId = aNmTb.Put( "HelpID", VARNAME );
- pClassToolBoxItem->SetVariable( nId, &aIdLong, NULL, 0,
+ pClassToolBoxItem->SetVariable( nId, &aStringLiteral, NULL, 0,
RSC_TOOLBOXITEM_HELPID );
nId = aNmTb.Put( "Text", VARNAME );
pClassToolBoxItem->SetVariable( nId, &aLangString, NULL, 0,
diff --git a/rsc/source/parser/rscinit.cxx b/rsc/source/parser/rscinit.cxx
index a763b92f0bb1..54a56a3840d2 100644
--- a/rsc/source/parser/rscinit.cxx
+++ b/rsc/source/parser/rscinit.cxx
@@ -210,9 +210,11 @@ void RscTypCont::Init()
aNmTb.Put( "TRUE", BOOLEAN, (long)TRUE );
aNmTb.Put( "FALSE", BOOLEAN, (long)FALSE );
+ #if 0
/* Vordefinierte HilfeId's */
aNmTb.Put( "HELP_INDEX", NUMBER, OOO_HELP_INDEX );
aNmTb.Put( "HELP_HELPONHELP", NUMBER, OOO_HELP_HELPONHELP );
+ #endif
aNmTb.Put( "XSCALE", XSCALE , (long)0 );
aNmTb.Put( "YSCALE", YSCALE , (long)0 );
diff --git a/rsc/source/parser/rsclex.cxx b/rsc/source/parser/rsclex.cxx
index e0df5de254f9..76ec4c551d52 100644..100755
--- a/rsc/source/parser/rsclex.cxx
+++ b/rsc/source/parser/rsclex.cxx
@@ -175,11 +175,16 @@ int MakeToken( YYSTYPE * pTokenVal ){
c = pFI->GetFastChar();
if( c == '"' )
{
- c = pFI->GetFastChar();
+ do
+ {
+ c = pFI->GetFastChar();
+ }
+ while( c == ' ' || c == '\t' );
if( c == '"' )
{
- aBuf.append( '"' );
- aBuf.append( '"' );
+ // this is a continued string
+ // note: multiline string continuations are handled by the parser
+ // see rscyacc.y
}
else
bDone = TRUE;
diff --git a/rsc/source/parser/rscyacc.cxx b/rsc/source/parser/rscyacc.cxx
index 89891581d9ba..0d5cc8faef0e 100644
--- a/rsc/source/parser/rscyacc.cxx
+++ b/rsc/source/parser/rscyacc.cxx
@@ -253,12 +253,8 @@ RSCINST GetFirstTupelEle( const RSCINST & rTop )
#ifdef UNX
#define YYMAXDEPTH 2000
#else
-#ifdef W30
-#define YYMAXDEPTH 300
-#else
#define YYMAXDEPTH 800
#endif
-#endif
#if defined _MSC_VER
#pragma warning(push, 1)
diff --git a/rsc/source/rsc/rsc.cxx b/rsc/source/rsc/rsc.cxx
index 40d589aea359..15d26318875b 100644
--- a/rsc/source/rsc/rsc.cxx
+++ b/rsc/source/rsc/rsc.cxx
@@ -474,10 +474,8 @@ ERRTYPE RscCompiler::Start()
if( PRINTSYNTAX_FLAG & pCL->nCommands )
{
-#ifndef W30
pTC->WriteSyntax( stdout );
-printf( "khg\n" );
-#endif
+ printf( "khg\n" );
return ERR_OK;
}
diff --git a/rsc/source/tools/rsctools.cxx b/rsc/source/tools/rsctools.cxx
index 9904cd20d4e7..93ecff2afe43 100644
--- a/rsc/source/tools/rsctools.cxx
+++ b/rsc/source/tools/rsctools.cxx
@@ -32,7 +32,7 @@
// C and C++ Includes.
#include <stdlib.h>
#include <stdio.h>
-#if defined ( DOS ) || defined ( WIN ) || defined (WNT )
+#if defined (WNT )
#include <direct.h>
#endif
#if defined ( OS2 ) && !defined ( GCC )
@@ -51,10 +51,6 @@
#include <rtl/alloc.h>
#include <rtl/memory.h>
-#if defined (WIN)
-#define ONLY_NEW
-#endif
-
using namespace rtl;
/****************** C o d e **********************************************/
diff --git a/sax/prj/d.lst b/sax/prj/d.lst
index 87f01348163c..76177f554909 100644
--- a/sax/prj/d.lst
+++ b/sax/prj/d.lst
@@ -2,6 +2,9 @@
..\%__SRC%\lib\*.so %_DEST%\lib%_EXT%\*.so
..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\*.dylib
..\%__SRC%\lib\*.lib %_DEST%\lib%_EXT%\*.lib
+..\%__SRC%\misc\fastsax.component %_DEST%\xml%_EXT%\fastsax.component
+..\%__SRC%\misc\sax.component %_DEST%\xml%_EXT%\sax.component
+..\%__SRC%\misc\sax.inbuild.component %_DEST%\xml%_EXT%\sax.inbuild.component
mkdir: %_DEST%\inc%_EXT%\sax
mkdir: %_DEST%\inc%_EXT%\sax\tools
diff --git a/sax/qa/cppunit/makefile.mk b/sax/qa/cppunit/makefile.mk
index e06eca25a737..b28f0cbac2ab 100644
--- a/sax/qa/cppunit/makefile.mk
+++ b/sax/qa/cppunit/makefile.mk
@@ -35,6 +35,13 @@ ENABLE_EXCEPTIONS=TRUE
.INCLUDE : settings.mk
+#building with stlport, but cppunit was not built with stlport
+.IF "$(USE_SYSTEM_STL)"!="YES"
+.IF "$(SYSTEM_CPPUNIT)"=="YES"
+CFLAGSCXX+=-DADAPT_EXT_STL
+.ENDIF
+.ENDIF
+
CFLAGSCXX += $(CPPUNIT_CFLAGS)
DLLPRE = # no leading "lib" on .so files
diff --git a/sax/qa/cppunit/test_converter.cxx b/sax/qa/cppunit/test_converter.cxx
index 1ea781afff95..b1881f248c0c 100644
--- a/sax/qa/cppunit/test_converter.cxx
+++ b/sax/qa/cppunit/test_converter.cxx
@@ -25,10 +25,12 @@
*
************************************************************************/
+#include "preextstl.h"
#include <cppunit/TestAssert.h>
#include <cppunit/TestFixture.h>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/plugin/TestPlugIn.h>
+#include "postextstl.h"
#include <rtl/ustrbuf.hxx>
diff --git a/sax/source/expatwrap/makefile.mk b/sax/source/expatwrap/makefile.mk
index bcb73b0443ac..6e1348c0d403 100644
--- a/sax/source/expatwrap/makefile.mk
+++ b/sax/source/expatwrap/makefile.mk
@@ -72,5 +72,16 @@ DEF1NAME= $(SHL1TARGET)
.INCLUDE : target.mk
+ALLTAR : $(MISC)/sax.component $(MISC)/sax.inbuild.component
+$(MISC)/sax.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ sax.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt sax.component
+$(MISC)/sax.inbuild.component .ERRREMOVE : \
+ $(SOLARENV)/bin/createcomponent.xslt sax.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_INBUILD_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt sax.component
diff --git a/sax/source/expatwrap/sax.component b/sax/source/expatwrap/sax.component
new file mode 100644
index 000000000000..5e6699d9dd33
--- /dev/null
+++ b/sax/source/expatwrap/sax.component
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.extensions.xml.sax.ParserExpat">
+ <service name="com.sun.star.xml.sax.Parser"/>
+ </implementation>
+ <implementation name="com.sun.star.extensions.xml.sax.Writer">
+ <service name="com.sun.star.xml.sax.Writer"/>
+ </implementation>
+</component>
diff --git a/sax/source/expatwrap/sax_expat.cxx b/sax/source/expatwrap/sax_expat.cxx
index 4ffebfa3590d..aaaac6bd564e 100644
--- a/sax/source/expatwrap/sax_expat.cxx
+++ b/sax/source/expatwrap/sax_expat.cxx
@@ -1034,37 +1034,6 @@ void SAL_CALL component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-
-sal_Bool SAL_CALL component_writeInfo(
- void * /*pServiceManager*/, void * pRegistryKey )
-{
- if (pRegistryKey)
- {
- try
- {
- Reference< XRegistryKey > xKey(
- reinterpret_cast< XRegistryKey * >( pRegistryKey ) );
-
- Reference< XRegistryKey > xNewKey = xKey->createKey(
- OUString::createFromAscii( "/" IMPLEMENTATION_NAME "/UNO/SERVICES" ) );
- xNewKey->createKey( OUString::createFromAscii( SERVICE_NAME ) );
-
- xNewKey = xKey->createKey( OUString::createFromAscii("/") +
- SaxWriter_getImplementationName()+
- OUString::createFromAscii( "/UNO/SERVICES" ) );
- xNewKey->createKey( SaxWriter_getServiceName() );
-
- return sal_True;
- }
- catch (InvalidRegistryException &)
- {
- OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
- }
- }
- return sal_False;
-}
-
-
void * SAL_CALL component_getFactory(
const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ )
{
diff --git a/sax/source/fastparser/facreg.cxx b/sax/source/fastparser/facreg.cxx
index 1916a9740f1a..98a55823271e 100644
--- a/sax/source/fastparser/facreg.cxx
+++ b/sax/source/fastparser/facreg.cxx
@@ -40,34 +40,6 @@ void SAL_CALL component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-
-sal_Bool SAL_CALL component_writeInfo(
- void * /*pServiceManager*/, void * pRegistryKey )
-{
- if (pRegistryKey)
- {
- try
- {
- Reference< XRegistryKey > xKey( reinterpret_cast< XRegistryKey * >( pRegistryKey ) );
-
- Reference< XRegistryKey > xNewKey( xKey->createKey(
- OUString::createFromAscii( "/" PARSER_IMPLEMENTATION_NAME "/UNO/SERVICES" ) ) );
- xNewKey->createKey( OUString::createFromAscii( PARSER_SERVICE_NAME ) );
-
- Reference< XRegistryKey > xNewKey1( xKey->createKey(
- OUString::createFromAscii( "/" SERIALIZER_IMPLEMENTATION_NAME "/UNO/SERVICES" ) ) );
- xNewKey1->createKey( OUString::createFromAscii( SERIALIZER_SERVICE_NAME ) );
-
- return sal_True;
- }
- catch (InvalidRegistryException &)
- {
- OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
- }
- }
- return sal_False;
-}
-
void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ )
{
void * pRet = 0;
diff --git a/sax/source/fastparser/fastsax.component b/sax/source/fastparser/fastsax.component
new file mode 100644
index 000000000000..a184a76d2d83
--- /dev/null
+++ b/sax/source/fastparser/fastsax.component
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.extensions.xml.sax.FastParser">
+ <service name="com.sun.star.xml.sax.FastParser"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.extensions.xml.sax.FastSerializer">
+ <service name="com.sun.star.xml.sax.FastSerializer"/>
+ </implementation>
+</component>
diff --git a/sax/source/fastparser/makefile.mk b/sax/source/fastparser/makefile.mk
index 7f70b7aee7bf..d8f9378c19b9 100644
--- a/sax/source/fastparser/makefile.mk
+++ b/sax/source/fastparser/makefile.mk
@@ -70,5 +70,10 @@ DEF1NAME= $(SHL1TARGET)
.INCLUDE : target.mk
+ALLTAR : $(MISC)/fastsax.component
-
+$(MISC)/fastsax.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ fastsax.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt fastsax.component
diff --git a/sax/source/tools/converter.cxx b/sax/source/tools/converter.cxx
index 5df3044bd6d3..26b3c48998f3 100644
--- a/sax/source/tools/converter.cxx
+++ b/sax/source/tools/converter.cxx
@@ -66,7 +66,7 @@ bool Converter::convertMeasure( sal_Int32& rValue,
bool bNeg = false;
double nVal = 0;
- sal_Int32 nPos = 0L;
+ sal_Int32 nPos = 0;
sal_Int32 nLen = rString.getLength();
// skip white space
@@ -579,7 +579,7 @@ bool Converter::convertNumber( sal_Int32& rValue,
bool bNeg = false;
rValue = 0;
- sal_Int32 nPos = 0L;
+ sal_Int32 nPos = 0;
sal_Int32 nLen = rString.getLength();
// skip white space
diff --git a/sax/source/tools/fastserializer.cxx b/sax/source/tools/fastserializer.cxx
index b0318516b72c..af89761a2c86 100644
--- a/sax/source/tools/fastserializer.cxx
+++ b/sax/source/tools/fastserializer.cxx
@@ -27,6 +27,7 @@
#include "fastserializer.hxx"
#include <rtl/ustrbuf.hxx>
+#include <rtl/byteseq.hxx>
#include <com/sun/star/xml/Attribute.hpp>
#include <com/sun/star/xml/FastAttribute.hpp>
@@ -41,6 +42,7 @@ using ::rtl::OUStringToOString;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::RuntimeException;
using ::com::sun::star::uno::Sequence;
+using ::com::sun::star::uno::toUnoSequence;
using ::com::sun::star::xml::FastAttribute;
using ::com::sun::star::xml::Attribute;
using ::com::sun::star::xml::sax::SAXException;
@@ -52,15 +54,15 @@ using ::com::sun::star::io::NotConnectedException;
using ::com::sun::star::io::IOException;
using ::com::sun::star::io::BufferSizeExceededException;
-static Sequence< sal_Int8 > aClosingBracket((sal_Int8 *)">", 1);
-static Sequence< sal_Int8 > aSlashAndClosingBracket((sal_Int8 *)"/>", 2);
-static Sequence< sal_Int8 > aColon((sal_Int8 *)":", 1);
-static Sequence< sal_Int8 > aOpeningBracket((sal_Int8 *)"<", 1);
-static Sequence< sal_Int8 > aOpeningBracketAndSlash((sal_Int8 *)"</", 2);
-static Sequence< sal_Int8 > aQuote((sal_Int8 *)"\"", 1);
-static Sequence< sal_Int8 > aEqualSignAndQuote((sal_Int8 *)"=\"", 2);
-static Sequence< sal_Int8 > aSpace((sal_Int8 *)" ", 1);
-static Sequence< sal_Int8 > aXmlHeader((sal_Int8*) "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n", 56);
+static rtl::ByteSequence aClosingBracket((const sal_Int8 *)">", 1);
+static rtl::ByteSequence aSlashAndClosingBracket((const sal_Int8 *)"/>", 2);
+static rtl::ByteSequence aColon((const sal_Int8 *)":", 1);
+static rtl::ByteSequence aOpeningBracket((const sal_Int8 *)"<", 1);
+static rtl::ByteSequence aOpeningBracketAndSlash((const sal_Int8 *)"</", 2);
+static rtl::ByteSequence aQuote((const sal_Int8 *)"\"", 1);
+static rtl::ByteSequence aEqualSignAndQuote((const sal_Int8 *)"=\"", 2);
+static rtl::ByteSequence aSpace((const sal_Int8 *)" ", 1);
+static rtl::ByteSequence aXmlHeader((const sal_Int8*) "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n", 56);
#define HAS_NAMESPACE(x) ((x & 0xffff0000) != 0)
#define NAMESPACE(x) (x >> 16)
@@ -74,7 +76,7 @@ namespace sax_fastparser {
{
if (!mxOutputStream.is())
return;
- writeBytes(aXmlHeader);
+ writeBytes(toUnoSequence(aXmlHeader));
}
OUString FastSaxSerializer::escapeXml( const OUString& s )
@@ -116,7 +118,7 @@ namespace sax_fastparser {
{
if( HAS_NAMESPACE( nElement ) ) {
writeBytes(mxFastTokenHandler->getUTF8Identifier(NAMESPACE(nElement)));
- writeBytes(aColon);
+ writeBytes(toUnoSequence(aColon));
writeBytes(mxFastTokenHandler->getUTF8Identifier(TOKEN(nElement)));
} else
writeBytes(mxFastTokenHandler->getUTF8Identifier(nElement));
@@ -128,12 +130,12 @@ namespace sax_fastparser {
if (!mxOutputStream.is())
return;
- writeBytes(aOpeningBracket);
+ writeBytes(toUnoSequence(aOpeningBracket));
writeId(Element);
writeFastAttributeList(Attribs);
- writeBytes(aClosingBracket);
+ writeBytes(toUnoSequence(aClosingBracket));
}
void SAL_CALL FastSaxSerializer::startUnknownElement( const OUString& Namespace, const OUString& Name, const Reference< XFastAttributeList >& Attribs )
@@ -142,19 +144,19 @@ namespace sax_fastparser {
if (!mxOutputStream.is())
return;
- writeBytes(aOpeningBracket);
+ writeBytes(toUnoSequence(aOpeningBracket));
if (Namespace.getLength())
{
write(Namespace);
- writeBytes(aColon);
+ writeBytes(toUnoSequence(aColon));
}
write(Name);
writeFastAttributeList(Attribs);
- writeBytes(aClosingBracket);
+ writeBytes(toUnoSequence(aClosingBracket));
}
void SAL_CALL FastSaxSerializer::endFastElement( ::sal_Int32 Element )
@@ -163,11 +165,11 @@ namespace sax_fastparser {
if (!mxOutputStream.is())
return;
- writeBytes(aOpeningBracketAndSlash);
+ writeBytes(toUnoSequence(aOpeningBracketAndSlash));
writeId(Element);
- writeBytes(aClosingBracket);
+ writeBytes(toUnoSequence(aClosingBracket));
}
void SAL_CALL FastSaxSerializer::endUnknownElement( const OUString& Namespace, const OUString& Name )
@@ -176,17 +178,17 @@ namespace sax_fastparser {
if (!mxOutputStream.is())
return;
- writeBytes(aOpeningBracketAndSlash);
+ writeBytes(toUnoSequence(aOpeningBracketAndSlash));
if (Namespace.getLength())
{
write(Namespace);
- writeBytes(aColon);
+ writeBytes(toUnoSequence(aColon));
}
write(Name);
- writeBytes(aClosingBracket);
+ writeBytes(toUnoSequence(aClosingBracket));
}
void SAL_CALL FastSaxSerializer::singleFastElement( ::sal_Int32 Element, const Reference< XFastAttributeList >& Attribs )
@@ -195,12 +197,12 @@ namespace sax_fastparser {
if (!mxOutputStream.is())
return;
- writeBytes(aOpeningBracket);
+ writeBytes(toUnoSequence(aOpeningBracket));
writeId(Element);
writeFastAttributeList(Attribs);
- writeBytes(aSlashAndClosingBracket);
+ writeBytes(toUnoSequence(aSlashAndClosingBracket));
}
void SAL_CALL FastSaxSerializer::singleUnknownElement( const OUString& Namespace, const OUString& Name, const Reference< XFastAttributeList >& Attribs )
@@ -209,19 +211,19 @@ namespace sax_fastparser {
if (!mxOutputStream.is())
return;
- writeBytes(aOpeningBracket);
+ writeBytes(toUnoSequence(aOpeningBracket));
if (Namespace.getLength())
{
write(Namespace);
- writeBytes(aColon);
+ writeBytes(toUnoSequence(aColon));
}
write(Name);
writeFastAttributeList(Attribs);
- writeBytes(aSlashAndClosingBracket);
+ writeBytes(toUnoSequence(aSlashAndClosingBracket));
}
void SAL_CALL FastSaxSerializer::characters( const OUString& aChars )
@@ -251,12 +253,12 @@ namespace sax_fastparser {
sal_Int32 nAttrLength = aAttrSeq.getLength();
for (sal_Int32 i = 0; i < nAttrLength; i++)
{
- writeBytes(aSpace);
+ writeBytes(toUnoSequence(aSpace));
write(pAttr[i].Name);
- writeBytes(aEqualSignAndQuote);
+ writeBytes(toUnoSequence(aEqualSignAndQuote));
write(escapeXml(pAttr[i].Value));
- writeBytes(aQuote);
+ writeBytes(toUnoSequence(aQuote));
}
Sequence< FastAttribute > aFastAttrSeq = Attribs->getFastAttributes();
@@ -264,16 +266,16 @@ namespace sax_fastparser {
sal_Int32 nFastAttrLength = aFastAttrSeq.getLength();
for (sal_Int32 j = 0; j < nFastAttrLength; j++)
{
- writeBytes(aSpace);
+ writeBytes(toUnoSequence(aSpace));
sal_Int32 nToken = pFastAttr[j].Token;
writeId(nToken);
- writeBytes(aEqualSignAndQuote);
+ writeBytes(toUnoSequence(aEqualSignAndQuote));
write(escapeXml(Attribs->getValue(pFastAttr[j].Token)));
- writeBytes(aQuote);
+ writeBytes(toUnoSequence(aQuote));
}
}
diff --git a/sot/prj/build.lst b/sot/prj/build.lst
index f2696155fd97..a5ebff311e9c 100644
--- a/sot/prj/build.lst
+++ b/sot/prj/build.lst
@@ -1,8 +1,10 @@
to sot : tools ucbhelper unotools NULL
-to sot usr1 - all sot_mkout NULL
-to sot\inc nmake - all sot_inc NULL
-to sot\prj get - all sot_prj NULL
-to sot\source\base nmake - all sot_base sot_inc NULL
-to sot\source\sdstor nmake - all sot_sdst sot_inc NULL
-to sot\source\unoolestorage nmake - all sot_unoolestor sot_inc NULL
-to sot\util nmake - all sot_ut sot_base sot_sdst sot_unoolestor NULL
+to sot usr1 - all sot_mkout NULL
+to sot\inc nmake - all sot_inc NULL
+to sot\prj get - all sot_prj NULL
+to sot\source\base nmake - all sot_base sot_inc NULL
+to sot\source\sdstor nmake - all sot_sdst sot_inc NULL
+to sot\source\unoolestorage nmake - all sot_unoolestor sot_inc NULL
+to sot\util nmake - all sot_ut sot_base sot_sdst sot_unoolestor NULL
+
+# to sot\qa\complex\olesimplestorage nmake - all sot_complex sot_ut NULL
diff --git a/sot/prj/d.lst b/sot/prj/d.lst
index 528b6863ef3c..10bed8c9fe5e 100644
--- a/sot/prj/d.lst
+++ b/sot/prj/d.lst
@@ -25,3 +25,4 @@ mkdir: %_DEST%\inc%_EXT%\sot
..\%__SRC%\bin\sot?????.dll %_DEST%\bin%_EXT%\sot?????.dll
..\%__SRC%\bin\sot?????.sym %_DEST%\bin%_EXT%\sot?????.sym
..\%__SRC%\misc\sot?????.map %_DEST%\bin%_EXT%\sot?????.map
+..\%__SRC%\misc\sot.component %_DEST%\xml%_EXT%\sot.component
diff --git a/sot/qa/complex/olesimplestorage/OLESimpleStorageUnitTest.java b/sot/qa/complex/olesimplestorage/OLESimpleStorageUnitTest.java
index 054480d377d1..2824b0fcbffa 100644
--- a/sot/qa/complex/olesimplestorage/OLESimpleStorageUnitTest.java
+++ b/sot/qa/complex/olesimplestorage/OLESimpleStorageUnitTest.java
@@ -26,42 +26,85 @@
************************************************************************/
package complex.olesimplestorage;
-import complexlib.ComplexTestCase;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.uno.UnoRuntime;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.openoffice.test.OfficeConnection;
+import static org.junit.Assert.*;
+
/* Document.
*/
-public class OLESimpleStorageUnitTest extends ComplexTestCase {
+public class OLESimpleStorageUnitTest /* extends ComplexTestCase */
+{
private XMultiServiceFactory m_xMSF = null;
- public String[] getTestMethodNames() {
- return new String[] {
- "ExecuteTest01"};
- }
-
- public String getTestObjectName() {
- return "OLESimpleStorageUnitTest";
- }
+// public String[] getTestMethodNames() {
+// return new String[] {
+// "ExecuteTest01"};
+// }
+//
+// public String getTestObjectName() {
+// return "OLESimpleStorageUnitTest";
+// }
- public void before () {
+ @Before public void before () {
+ System.out.println("before()");
try {
- m_xMSF = (XMultiServiceFactory)param.getMSF();
+ m_xMSF = getMSF();
} catch ( Exception e ){
- failed ( "Cannot create service factory!" );
+ fail( "Cannot create service factory!" );
}
if ( m_xMSF == null ) {
- failed ( "Cannot create service factory!" );
+ fail( "Cannot create service factory!" );
}
}
- public void after () {
+ @After public void after () {
+ System.out.println("after()");
m_xMSF = null;
}
- public void ExecuteTest01() {
- OLESimpleStorageTest aTest = new Test01( m_xMSF, log );
- assure( "Test01 failed!", aTest.test() );
+ @Test public void ExecuteTest01() {
+ System.out.println("ExecuteTest01()");
+ OLESimpleStorageTest aTest = new Test01( m_xMSF );
+ assertTrue( "Test01 failed!", aTest.test() );
}
+
+
+
+ private XMultiServiceFactory getMSF()
+ {
+ final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager());
+ return xMSF1;
+ }
+
+ // setup and close connections
+ @BeforeClass public static void setUpConnection() throws Exception {
+ System.out.println("setUpConnection()");
+ connection.setUp();
+ }
+
+ @AfterClass public static void tearDownConnection()
+ throws InterruptedException, com.sun.star.uno.Exception
+ {
+// try
+// {
+// Thread.sleep(5000);
+// }
+// catch (java.lang.InterruptedException e)
+// {
+// }
+ System.out.println("tearDownConnection()");
+ connection.tearDown();
+ }
+
+ private static final OfficeConnection connection = new OfficeConnection();
+
} \ No newline at end of file
diff --git a/sot/qa/complex/olesimplestorage/Test01.java b/sot/qa/complex/olesimplestorage/Test01.java
index c9010e61231a..ad32e6e55a6b 100644
--- a/sot/qa/complex/olesimplestorage/Test01.java
+++ b/sot/qa/complex/olesimplestorage/Test01.java
@@ -1,6 +1,6 @@
package complex.olesimplestorage;
-import complexlib.ComplexTestCase;
+
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.io.XInputStream;
@@ -10,7 +10,7 @@ import com.sun.star.embed.XOLESimpleStorage;
import com.sun.star.uno.UnoRuntime;
import java.util.Random;
-import share.LogWriter;
+
public class Test01 implements OLESimpleStorageTest
{
@@ -19,10 +19,10 @@ public class Test01 implements OLESimpleStorageTest
final int pStreamCnt = 5;
final int pBytesCnt = 10;
- public Test01 ( XMultiServiceFactory xMSF, LogWriter aLogWriter )
+ public Test01 ( XMultiServiceFactory xMSF )
{
m_xMSF = xMSF;
- m_aTestHelper = new TestHelper (aLogWriter, "Test01: ");
+ m_aTestHelper = new TestHelper ("Test01: ");
}
public boolean test ()
@@ -31,7 +31,7 @@ public class Test01 implements OLESimpleStorageTest
{
//create a new temporary stream
Object oTempFile = m_xMSF.createInstance ( "com.sun.star.io.TempFile" );
- XTempFile xTempFile = (XTempFile) UnoRuntime.queryInterface ( XTempFile.class, oTempFile );
+ XTempFile xTempFile = UnoRuntime.queryInterface(XTempFile.class, oTempFile);
m_aTestHelper.Message ( "A new temporary stream created." );
//create OLESimpleStorage based on it
@@ -39,7 +39,7 @@ public class Test01 implements OLESimpleStorageTest
pArgs[0] = (Object) xTempFile;
pArgs[1] = new Boolean( true );
Object oOLESimpleStorage = m_xMSF.createInstanceWithArguments ( "com.sun.star.embed.OLESimpleStorage", pArgs );
- XOLESimpleStorage xOLESimpleStorage = (XOLESimpleStorage) UnoRuntime.queryInterface ( XOLESimpleStorage.class, oOLESimpleStorage );
+ XOLESimpleStorage xOLESimpleStorage = UnoRuntime.queryInterface(XOLESimpleStorage.class, oOLESimpleStorage);
m_aTestHelper.Message ( "OLESimpleStorage based on XStream created." );
//fill it with some streams
@@ -53,7 +53,7 @@ public class Test01 implements OLESimpleStorageTest
{
oRandom.nextBytes (pBytesOut[i]);
oStream[i] = m_xMSF.createInstance ( "com.sun.star.io.TempFile" );
- xTempStream[i] = (XTempFile) UnoRuntime.queryInterface ( XTempFile.class, oStream[i] );
+ xTempStream[i] = UnoRuntime.queryInterface(XTempFile.class, oStream[i]);
xTempStream[i].getOutputStream ().writeBytes (pBytesOut[i]);
xTempStream[i].seek (0);
m_aTestHelper.Message ( "Substream " + i + " initialized." );
@@ -83,7 +83,7 @@ public class Test01 implements OLESimpleStorageTest
//open the same stream with the constructor for inputstream
pArgs[0] = (Object)xTempFile.getInputStream ();
oOLESimpleStorage = m_xMSF.createInstanceWithArguments ( "com.sun.star.embed.OLESimpleStorage", pArgs );
- xOLESimpleStorage = (XOLESimpleStorage)UnoRuntime.queryInterface ( XOLESimpleStorage.class, oOLESimpleStorage );
+ xOLESimpleStorage = UnoRuntime.queryInterface(XOLESimpleStorage.class, oOLESimpleStorage);
m_aTestHelper.Message ( "Storage reopened, based on XInputStream." );
//check that all the streams contain correct information
@@ -92,8 +92,7 @@ public class Test01 implements OLESimpleStorageTest
{
if ( xOLESimpleStorage.hasByName (sSubStreamPrefix + i) )
{
- xTempStream[i] = (XTempFile)UnoRuntime.queryInterface (
- XTempFile.class, xOLESimpleStorage.getByName (sSubStreamPrefix + i) );
+ xTempStream[i] = UnoRuntime.queryInterface(XTempFile.class, xOLESimpleStorage.getByName(sSubStreamPrefix + i));
xTempStream[i].seek (0);
xTempStream[i].getInputStream ().readBytes (pBytesIn[i], pBytesIn[i][0].length + 1 );
for ( int j = 0; j < pBytesCnt; ++j )
@@ -120,6 +119,7 @@ public class Test01 implements OLESimpleStorageTest
catch ( Exception e )
{
m_aTestHelper.Error ( "Exception: " + e );
+ return false;
}
return true;
}
diff --git a/sot/qa/complex/olesimplestorage/TestHelper.java b/sot/qa/complex/olesimplestorage/TestHelper.java
index 4b29ed15e393..e9e14f8d68c0 100644
--- a/sot/qa/complex/olesimplestorage/TestHelper.java
+++ b/sot/qa/complex/olesimplestorage/TestHelper.java
@@ -1,26 +1,27 @@
package complex.olesimplestorage;
-import share.LogWriter;
public class TestHelper
{
- LogWriter m_aLogWriter;
+
String m_sTestPrefix;
- /** Creates a new instance of TestHelper */
- public TestHelper ( LogWriter aLogWriter, String sTestPrefix )
+ /** Creates a new instance of TestHelper
+ * @param sTestPrefix
+ */
+ public TestHelper ( String sTestPrefix )
{
- m_aLogWriter = aLogWriter;
+
m_sTestPrefix = sTestPrefix;
}
public void Error ( String sError )
{
- m_aLogWriter.println ( m_sTestPrefix + "Error: " + sError );
+ System.out.println ( m_sTestPrefix + "Error: " + sError );
}
public void Message ( String sMessage )
{
- m_aLogWriter.println ( m_sTestPrefix + sMessage );
+ System.out.println ( m_sTestPrefix + sMessage );
}
}
diff --git a/sot/qa/complex/olesimplestorage/makefile.mk b/sot/qa/complex/olesimplestorage/makefile.mk
index 3420d798c9bc..cf3facf94d66 100644
--- a/sot/qa/complex/olesimplestorage/makefile.mk
+++ b/sot/qa/complex/olesimplestorage/makefile.mk
@@ -25,60 +25,38 @@
#
#*************************************************************************
-PRJ = ..$/..$/..
-TARGET = OLESimpleStorageUnitTest
-PRJNAME = sot
-PACKAGE = complex$/olesimplestorage
-
-# --- Settings -----------------------------------------------------
-.INCLUDE: settings.mk
-
-
-#----- compile .java files -----------------------------------------
-
-JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar
-
-JAVAFILES =\
- OLESimpleStorageUnitTest.java\
- OLESimpleStorageTest.java\
- TestHelper.java\
- Test01.java
-
-JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class)
-
-#----- make a jar from compiled files ------------------------------
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
+.ELSE
-MAXLINELENGTH = 100000
+PRJ = ../../..
+PRJNAME = sot
+TARGET = qa_complex_olesimplestorage
-JARCLASSDIRS = $(PACKAGE)
-JARTARGET = $(TARGET).jar
-JARCOMPRESS = TRUE
+.IF "$(OOO_JUNIT_JAR)" != ""
+PACKAGE = complex/olesimplestorage
+JAVATESTFILES = \
+ OLESimpleStorageUnitTest.java
-# --- Parameters for the test --------------------------------------
+JAVAFILES = $(JAVATESTFILES) \
+ OLESimpleStorageTest.java \
+ Test01.java \
+ TestHelper.java
-# start an office if the parameter is set for the makefile
-.IF "$(OFFICE)" == ""
-CT_APPEXECCOMMAND =
-.ELSE
-CT_APPEXECCOMMAND = -AppExecutionCommand "$(OFFICE)$/soffice -accept=socket,host=localhost,port=8100;urp;"
-.ENDIF
+JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar jurt.jar
+EXTRAJARFILES = $(OOO_JUNIT_JAR)
+.END
-# test base is java complex
-CT_TESTBASE = -TestBase java_complex
+.INCLUDE: settings.mk
+.INCLUDE: target.mk
+.INCLUDE: installationtest.mk
-# test looks something like the.full.package.TestName
-CT_TEST = -o $(PACKAGE:s\$/\.\).$(JAVAFILES:b)
+ALLTAR : javatest
-# start the runner application
-CT_APP = org.openoffice.Runner
+.END
-# --- Targets ------------------------------------------------------
-.INCLUDE: target.mk
-RUN: run
-run:
- +java -cp $(CLASSPATH) $(CT_APP) $(CT_TESTBASE) $(CT_APPEXECCOMMAND) $(CT_TEST)
diff --git a/sot/source/sdstor/stgdir.cxx b/sot/source/sdstor/stgdir.cxx
index f093dc60cbe7..039a29fd2683 100644
--- a/sot/source/sdstor/stgdir.cxx
+++ b/sot/source/sdstor/stgdir.cxx
@@ -936,8 +936,11 @@ BOOL StgDirStrm::Store()
void* StgDirStrm::GetEntry( INT32 n, BOOL bDirty )
{
+ if( n < 0 )
+ return NULL;
+
n *= STGENTRY_SIZE;
- if( n >= nSize )
+ if( n < 0 && n >= nSize )
return NULL;
return GetPtr( n, TRUE, bDirty );
}
diff --git a/sot/source/sdstor/stgstrms.cxx b/sot/source/sdstor/stgstrms.cxx
index 07711133bf4b..dd6ba6202bbe 100644
--- a/sot/source/sdstor/stgstrms.cxx
+++ b/sot/source/sdstor/stgstrms.cxx
@@ -41,13 +41,7 @@
#include "stgdir.hxx"
#include "stgio.hxx"
-#if defined(W31)
- #include <tools/svwin.h>
- #define memcpy hmemcpy
- #define __HUGE _huge
-#else
- #define __HUGE
-#endif
+#define __HUGE
///////////////////////////// class StgFAT ///////////////////////////////
diff --git a/sot/source/unoolestorage/register.cxx b/sot/source/unoolestorage/register.cxx
index 00326333546d..083a4d585ca1 100644
--- a/sot/source/unoolestorage/register.cxx
+++ b/sot/source/unoolestorage/register.cxx
@@ -69,33 +69,5 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( const sal_Char * pImp
return pRet;
}
-SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( void * /*pServiceManager*/, void * pRegistryKey )
-{
- if (pRegistryKey)
- {
- try
- {
- uno::Reference< registry::XRegistryKey > xKey( reinterpret_cast< registry::XRegistryKey* >( pRegistryKey ) );
-
- uno::Reference< registry::XRegistryKey > xNewKey;
-
- xNewKey = xKey->createKey( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) +
- OLESimpleStorage::impl_staticGetImplementationName() +
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES") ) );
-
- const uno::Sequence< ::rtl::OUString > &rServices = OLESimpleStorage::impl_staticGetSupportedServiceNames();
- for( sal_Int32 ind = 0; ind < rServices.getLength(); ind++ )
- xNewKey->createKey( rServices.getConstArray()[ind] );
-
- return sal_True;
- }
- catch (registry::InvalidRegistryException &)
- {
- OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
- }
- }
- return sal_False;
-}
-
} // extern "C"
diff --git a/sot/util/makefile.mk b/sot/util/makefile.mk
index 60b34c356217..72d17db189be 100644
--- a/sot/util/makefile.mk
+++ b/sot/util/makefile.mk
@@ -79,3 +79,11 @@ $(MISC)$/$(SHL1TARGET).flt: makefile.mk
@echo Making: $@
$(TYPE) sot.flt > $@
+
+ALLTAR : $(MISC)/sot.component
+
+$(MISC)/sot.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ sot.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt sot.component
diff --git a/sot/util/sot.component b/sot/util/sot.component
new file mode 100644
index 000000000000..7d17c7d54475
--- /dev/null
+++ b/sot/util/sot.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.embed.OLESimpleStorage">
+ <service name="com.sun.star.embed.OLESimpleStorage"/>
+ </implementation>
+</component>
diff --git a/svl/inc/lngmisc.hxx b/svl/inc/lngmisc.hxx
index d85de673c4c9..5143d147227d 100644
--- a/svl/inc/lngmisc.hxx
+++ b/svl/inc/lngmisc.hxx
@@ -32,6 +32,7 @@
#include <tools/solar.h>
#include <sal/types.h>
#include <rtl/ustring.hxx>
+#include <tools/string.hxx>
///////////////////////////////////////////////////////////////////////////
@@ -68,6 +69,8 @@ SVL_DLLPUBLIC BOOL RemoveControlChars( rtl::OUString &rTxt );
SVL_DLLPUBLIC BOOL ReplaceControlChars( rtl::OUString &rTxt, sal_Char aRplcChar = ' ' );
+SVL_DLLPUBLIC String GetThesaurusReplaceText( const String &rText );
+
} // namespace linguistic
#endif
diff --git a/svl/inc/poolcach.hxx b/svl/inc/poolcach.hxx
index 949c0aee5bad..78bdca8177e6 100644
--- a/svl/inc/poolcach.hxx
+++ b/svl/inc/poolcach.hxx
@@ -29,13 +29,24 @@
#include "svl/svldllapi.h"
#include <tools/solar.h>
+#include <vector>
+
+//------------------------------------------------------------------------
-class SfxItemModifyArr_Impl;
class SfxItemPool;
class SfxItemSet;
class SfxPoolItem;
class SfxSetItem;
+struct SfxItemModifyImpl
+{
+ const SfxSetItem *pOrigItem;
+ SfxSetItem *pPoolItem;
+};
+
+typedef std::vector<SfxItemModifyImpl> SfxItemModifyArr_Impl;
+
+
class SVL_DLLPUBLIC SfxItemPoolCache
{
SfxItemPool *pPool;
diff --git a/svl/inc/svl/itempool.hxx b/svl/inc/svl/itempool.hxx
index cbc6b7c4dd11..daaa2b481ba3 100644
--- a/svl/inc/svl/itempool.hxx
+++ b/svl/inc/svl/itempool.hxx
@@ -104,7 +104,7 @@ class SVL_DLLPUBLIC SfxItemPool
*/
{
- SVL_DLLPRIVATE void readTheItems(SvStream & rStream, USHORT nCount, USHORT nVersion,
+ SVL_DLLPRIVATE void readTheItems(SvStream & rStream, sal_uInt32 nCount, USHORT nVersion,
SfxPoolItem * pDefItem, SfxPoolItemArray_Impl ** pArr);
UniString aName;
@@ -208,9 +208,9 @@ public:
const SfxPoolItem &rItem,
FASTBOOL bDirect = FALSE ) const;
- USHORT GetSurrogate(const SfxPoolItem *) const;
- const SfxPoolItem * GetItem(USHORT nWhich, USHORT nSurrogate) const;
- USHORT GetItemCount(USHORT nWhich) const;
+ sal_uInt32 GetSurrogate(const SfxPoolItem *) const;
+ const SfxPoolItem * GetItem2(USHORT nWhich, sal_uInt32 nSurrogate) const;
+ sal_uInt32 GetItemCount2(USHORT nWhich) const;
const SfxPoolItem* LoadSurrogate(SvStream& rStream,
USHORT &rWhich, USHORT nSlotId,
const SfxItemPool* pRefPool = 0 );
diff --git a/svl/inc/svl/poolitem.hxx b/svl/inc/svl/poolitem.hxx
index c0cf53fb6ded..d78e32877440 100644
--- a/svl/inc/svl/poolitem.hxx
+++ b/svl/inc/svl/poolitem.hxx
@@ -50,8 +50,9 @@ class IntlWrapper;
namespace com { namespace sun { namespace star { namespace uno { class Any; } } } }
-#define SFX_ITEMS_DIRECT 0xffff
-#define SFX_ITEMS_NULL 0xfff0 // anstelle StoreSurrogate
+static const sal_uInt32 SFX_ITEMS_DIRECT= 0xffffffff;
+static const sal_uInt32 SFX_ITEMS_NULL= 0xfffffff0; // instead StoreSurrogate
+static const sal_uInt32 SFX_ITEMS_DEFAULT= 0xfffffffe;
#define SFX_ITEMS_POOLDEFAULT 0xffff
#define SFX_ITEMS_STATICDEFAULT 0xfffe
diff --git a/svl/inc/svl/svarray.hxx b/svl/inc/svl/svarray.hxx
index 99b2901b95f9..d48998247eeb 100644
--- a/svl/inc/svl/svarray.hxx
+++ b/svl/inc/svl/svarray.hxx
@@ -39,12 +39,6 @@
* enthaelt. (Sie werden im Speicher verschoben, koennen also
* z.B. keine String sein)
*
-* SV_DECL_OBJARR(nm, AE, IS, GS)
-* SV_IMPL_OBJARR( nm, AE )
-* definiere/implementiere ein Array das Objecte enthaelt.
-* (Hier koennen es auch Strings sein)
-*
-*
* SV_DECL_PTRARR(nm, AE, IS, GS)
* SV_IMPL_PTRARR(nm, AE)
* definiere/implementiere ein Array das Pointer haelt. Diese
@@ -86,10 +80,6 @@
* Basiert auf einem VARARR.
* Sortierung mit Hilfe der Object-operatoren "<" und "=="
*
-* JP 23.12.94 neu:
-* SV_DECL_PTRARR_STACK(nm, AE, IS, GS)
-* ein Stack mit einem PtrArray als Grundlage.
-*
* JP 09.10.96: vordefinierte Arrays:
* VarArr: SvBools, SvULongs, SvUShorts, SvLongs, SvShorts
* PtrArr: SvStrings, SvStringsDtor
@@ -207,8 +197,6 @@ public:\
#define _SV_DECL_VARARR(nm, AE, IS, GS ) \
_SV_DECL_VARARR_GEN(nm, AE, IS, GS, AE & )
-#define _SV_DECL_VARARR_PLAIN(nm, AE, IS, GS ) \
-_SV_DECL_VARARR_GEN(nm, AE, IS, GS, AE )
#define SV_DECL_VARARR_GEN(nm, AE, IS, GS, AERef, vis )\
_SV_DECL_VARARR_GEN(nm, AE, IS, GS, AERef, vis )\
@@ -219,15 +207,10 @@ nm& operator=( const nm& );\
#define SV_DECL_VARARR(nm, AE, IS, GS ) \
SV_DECL_VARARR_GEN(nm, AE, IS, GS, AE &, )
-#define SV_DECL_VARARR_PLAIN(nm, AE, IS, GS ) \
-SV_DECL_VARARR_GEN(nm, AE, IS, GS, AE, )
#define SV_DECL_VARARR_VISIBILITY(nm, AE, IS, GS, vis ) \
SV_DECL_VARARR_GEN(nm, AE, IS, GS, AE &, vis )
-#define SV_DECL_VARARR_PLAIN_VISIBILITY(nm, AE, IS, GS, vis ) \
-SV_DECL_VARARR_GEN(nm, AE, IS, GS, AE, vis )
-
#define SV_IMPL_VARARR_GEN( nm, AE, AERef )\
nm::nm( USHORT nInit, BYTE )\
: pData (0),\
@@ -329,192 +312,6 @@ _SVVARARR_IMPL_GET_OP_INLINE(nm, AE )\
#define SV_IMPL_VARARR( nm, AE ) \
SV_IMPL_VARARR_GEN( nm, AE, AE & )
-#define SV_IMPL_VARARR_PLAIN( nm, AE ) \
-SV_IMPL_VARARR_GEN( nm, AE, AE )
-
-#if defined(PRODUCT)
-
-#define _SVOBJARR_DEF_GET_OP_INLINE( nm,ArrElem )\
-ArrElem& operator[](USHORT nP) const { return *(pData+nP); }\
-\
-void Insert( const nm *pI, USHORT nP,\
- USHORT nS = 0, USHORT nE = USHRT_MAX )\
-{\
- if( USHRT_MAX == nE ) \
- nE = pI->nA; \
- if( nS < nE ) \
- Insert( (const ArrElem*)pI->pData+nS, (USHORT)nE-nS, nP );\
-}
-
-#define _SVOBJARR_IMPL_GET_OP_INLINE( nm, ArrElem )
-
-#else
-
-#define _SVOBJARR_DEF_GET_OP_INLINE( nm,ArrElem ) \
-ArrElem& operator[](USHORT nP) const;\
-void Insert( const nm *pI, USHORT nP,\
- USHORT nS = 0, USHORT nE = USHRT_MAX );
-
-#define _SVOBJARR_IMPL_GET_OP_INLINE( nm, ArrElem )\
-ArrElem& nm::operator[](USHORT nP) const\
-{\
- DBG_ASSERT( pData && nP < nA,"Op[]");\
- return *(pData+nP);\
-}\
-void nm::Insert( const nm *pI, USHORT nP, USHORT nStt, USHORT nE )\
-{\
- DBG_ASSERT( nP <= nA,"Ins,Ar[Start.End]");\
- if( USHRT_MAX == nE ) \
- nE = pI->nA; \
- if( nStt < nE ) \
- Insert( (const ArrElem*)pI->pData+nStt, (USHORT)nE-nStt, nP );\
-}
-
-#endif
-
-#define _SV_DECL_OBJARR(nm, AE, IS, GS)\
-typedef BOOL (*FnForEach_##nm)( const AE&, void* );\
-class nm\
-{\
-protected:\
- AE *pData;\
- USHORT nFree;\
- USHORT nA;\
-\
- void _resize(size_t n);\
- void _destroy();\
-\
-public:\
- nm( USHORT= IS, BYTE= GS );\
- ~nm() { _destroy(); }\
-\
- _SVOBJARR_DEF_GET_OP_INLINE(nm,AE)\
- AE& GetObject(USHORT nP) const { return (*this)[nP]; } \
-\
- void Insert( const AE &aE, USHORT nP );\
- void Insert( const AE *pE, USHORT nL, USHORT nP );\
- void Remove( USHORT nP, USHORT nL = 1 );\
- USHORT Count() const { return nA; }\
- const AE* GetData() const { return (const AE*)pData; }\
-\
- void ForEach( CONCAT( FnForEach_, nm ) fnForEach, void* pArgs = 0 )\
- {\
- _ForEach( 0, nA, fnForEach, pArgs );\
- }\
- void ForEach( USHORT nS, USHORT nE, \
- CONCAT( FnForEach_, nm ) fnForEach, void* pArgs = 0 )\
- {\
- _ForEach( nS, nE, fnForEach, pArgs );\
- }\
-\
- void _ForEach( USHORT nStt, USHORT nE, \
- CONCAT( FnForEach_, nm ) fnCall, void* pArgs = 0 );\
-\
-
-#define SV_DECL_OBJARR(nm, AE, IS, GS)\
-_SV_DECL_OBJARR(nm, AE, IS, GS)\
-private:\
-nm( const nm& );\
-nm& operator=( const nm& );\
-};
-
-#define SV_IMPL_OBJARR( nm, AE )\
-nm::nm( USHORT nInit, BYTE )\
- : pData (0),\
- nFree (nInit),\
- nA (0)\
-{\
- if( nInit )\
- {\
- pData = (AE*)(rtl_allocateMemory(sizeof(AE) * nInit));\
- DBG_ASSERT( pData, "CTOR, allocate");\
- }\
-}\
-\
-void nm::_destroy()\
-{\
- if(pData)\
- {\
- AE* pTmp=pData;\
- for(USHORT n=0; n < nA; n++,pTmp++ )\
- {\
- pTmp->~AE();\
- }\
- rtl_freeMemory(pData);\
- pData = 0;\
- }\
-}\
-\
-void nm::_resize (size_t n)\
-{\
- USHORT nL = ((n < USHRT_MAX) ? USHORT(n) : USHRT_MAX);\
- AE* pE = (AE*)(rtl_reallocateMemory (pData, sizeof(AE) * nL));\
- if ((pE != 0) || (nL == 0))\
- {\
- pData = pE;\
- nFree = nL - nA;\
- }\
-}\
-\
-void nm::Insert( const AE &aE, USHORT nP )\
-{\
- DBG_ASSERT( nP <= nA && nA < USHRT_MAX,"Ins 1");\
- if (nFree < 1)\
- _resize (nA + ((nA > 1) ? nA : 1));\
- if( pData && nP < nA )\
- memmove( pData+nP+1, pData+nP, (nA-nP) * sizeof( AE ));\
- AE* pTmp = pData+nP;\
- new( (DummyType*) pTmp ) AE( (AE&)aE );\
- ++nA; --nFree;\
-}\
-\
-void nm::Insert( const AE* pE, USHORT nL, USHORT nP )\
-{\
- DBG_ASSERT(nP<=nA && ((long)nA+nL) < USHRT_MAX, "Ins n");\
- if (nFree < nL)\
- _resize (nA + ((nA > nL) ? nA : nL));\
- if( pData && nP < nA )\
- memmove( pData+nP+nL, pData+nP, (nA-nP) * sizeof( AE ));\
- if( pE )\
- {\
- AE* pTmp = pData+nP;\
- for( USHORT n = 0; n < nL; n++, pTmp++, pE++)\
- {\
- new( (DummyType*) pTmp ) AE( (AE&)*pE );\
- }\
- }\
- nA = nA + nL; nFree = nFree - nL;\
-}\
-\
-void nm::Remove( USHORT nP, USHORT nL )\
-{\
- if( !nL )\
- return;\
- DBG_ASSERT( nP < nA && nP + nL <= nA,"Del");\
- AE* pTmp=pData+nP;\
- USHORT nCtr = nP;\
- for(USHORT n=0; n < nL; n++,pTmp++,nCtr++)\
- {\
- if( nCtr < nA )\
- pTmp->~AE();\
- }\
- if( pData && nP+1 < nA )\
- memmove( pData+nP, pData+nP+nL, (nA-nP-nL) * sizeof( AE ));\
- nA = nA - nL; nFree = nFree + nL;\
- if (nFree > nA) \
- _resize (nA);\
-}\
-\
-void nm::_ForEach( USHORT nStt, USHORT nE, \
- CONCAT( FnForEach_, nm ) fnCall, void* pArgs )\
-{\
- if( nStt >= nE || nE > nA )\
- return;\
- for( ; nStt < nE && (*fnCall)( *(pData+nStt), pArgs ); nStt++)\
- ;\
-}\
-\
-_SVOBJARR_IMPL_GET_OP_INLINE(nm, AE)\
#define _SV_DECL_PTRARR_DEF_GEN( nm, AE, IS, GS, AERef, vis )\
_SV_DECL_VARARR_GEN( nm, AE, IS, GS, AERef, vis)\
@@ -523,8 +320,6 @@ USHORT GetPos( const AERef aE ) const;\
#define _SV_DECL_PTRARR_DEF( nm, AE, IS, GS, vis )\
_SV_DECL_PTRARR_DEF_GEN( nm, AE, IS, GS, AE &, vis )
-#define _SV_DECL_PTRARR_DEF_PLAIN( nm, AE, IS, GS, vis )\
-_SV_DECL_PTRARR_DEF_GEN( nm, AE, IS, GS, AE, vis )
#define SV_DECL_PTRARR_GEN(nm, AE, IS, GS, Base, AERef, VPRef, vis )\
typedef BOOL (*FnForEach_##nm)( const AERef, void* );\
@@ -580,13 +375,9 @@ private:\
#define SV_DECL_PTRARR(nm, AE, IS, GS )\
SV_DECL_PTRARR_GEN(nm, AE, IS, GS, SvPtrarr, AE &, VoidPtr &, )
-#define SV_DECL_PTRARR_PLAIN(nm, AE, IS, GS )\
-SV_DECL_PTRARR_GEN(nm, AE, IS, GS, SvPtrarrPlain, AE, VoidPtr, )
#define SV_DECL_PTRARR_VISIBILITY(nm, AE, IS, GS, vis )\
SV_DECL_PTRARR_GEN(nm, AE, IS, GS, SvPtrarr, AE &, VoidPtr &, vis )
-#define SV_DECL_PTRARR_PLAIN_VISIBILITY(nm, AE, IS, GS, vis )\
-SV_DECL_PTRARR_GEN(nm, AE, IS, GS, SvPtrarrPlain, AE, VoidPtr, vis )
#define SV_DECL_PTRARR_DEL_GEN(nm, AE, IS, GS, Base, AERef, VPRef, vis )\
typedef BOOL (*FnForEach_##nm)( const AERef, void* );\
@@ -643,13 +434,9 @@ private:\
#define SV_DECL_PTRARR_DEL(nm, AE, IS, GS )\
SV_DECL_PTRARR_DEL_GEN(nm, AE, IS, GS, SvPtrarr, AE &, VoidPtr &, )
-#define SV_DECL_PTRARR_DEL_PLAIN(nm, AE, IS, GS )\
-SV_DECL_PTRARR_DEL_GEN(nm, AE, IS, GS, SvPtrarrPlain, AE, VoidPtr, )
#define SV_DECL_PTRARR_DEL_VISIBILITY(nm, AE, IS, GS, vis )\
SV_DECL_PTRARR_DEL_GEN(nm, AE, IS, GS, SvPtrarr, AE &, VoidPtr &, vis)
-#define SV_DECL_PTRARR_DEL_PLAIN_VISIBILITY(nm, AE, IS, GS, vis )\
-SV_DECL_PTRARR_DEL_GEN(nm, AE, IS, GS, SvPtrarrPlain, AE, VoidPtr, vis)
#define SV_IMPL_PTRARR_GEN(nm, AE, Base)\
void nm::DeleteAndDestroy( USHORT nP, USHORT nL )\
@@ -664,12 +451,9 @@ void nm::DeleteAndDestroy( USHORT nP, USHORT nL )\
#define SV_IMPL_PTRARR(nm, AE )\
SV_IMPL_PTRARR_GEN(nm, AE, SvPtrarr )
-#define SV_IMPL_PTRARR_PLAIN(nm, AE )\
-SV_IMPL_PTRARR_GEN(nm, AE, SvPtrarrPlain )
typedef void* VoidPtr;
_SV_DECL_PTRARR_DEF( SvPtrarr, VoidPtr, 0, 1, SVL_DLLPUBLIC )
-_SV_DECL_PTRARR_DEF_PLAIN( SvPtrarrPlain, VoidPtr, 0, 1, SVL_DLLPUBLIC )
// SORTARR - Begin
@@ -983,69 +767,21 @@ SV_IMPL_VARARR(nm##_SAR, AE)\
_SV_IMPL_SORTAR_ALG( nm,AE )\
_SV_SEEK_OBJECT( nm,AE )
-#define SV_DECL_PTRARR_STACK(nm, AE, IS, GS)\
-class nm: private SvPtrarr \
-{\
-public:\
- nm( USHORT nIni=IS, BYTE nG=GS )\
- : SvPtrarr(nIni,nG) {}\
- void Insert( const nm *pI, USHORT nP,\
- USHORT nS = 0, USHORT nE = USHRT_MAX ) {\
- SvPtrarr::Insert( pI, nP, nS, nE ); \
- }\
- void Remove( USHORT nP, USHORT nL = 1 ) {\
- SvPtrarr::Remove( nP, nL ); \
- }\
- void Push( const AE &aE ) {\
- SvPtrarr::Insert( (const VoidPtr &)aE, SvPtrarr::Count() );\
- }\
- USHORT Count() const { return SvPtrarr::Count(); }\
- AE operator[](USHORT nP) const {\
- return (AE)SvPtrarr::operator[]( nP );\
- }\
- AE GetObject(USHORT nP) const {\
- return (AE)SvPtrarr::GetObject( nP );\
- }\
- AE Pop(){\
- AE pRet = 0;\
- if( SvPtrarr::Count() ){\
- pRet = GetObject( SvPtrarr::Count()-1 );\
- SvPtrarr::Remove(Count()-1);\
- }\
- return pRet;\
- }\
- AE Top() const {\
- AE pRet = 0;\
- if( SvPtrarr::Count() )\
- pRet = GetObject( SvPtrarr::Count()-1 ); \
- return pRet;\
- }\
-};
-
#if defined (C40) || defined (C41) || defined (C42) || defined(C50) || defined(C52)
#define C40_INSERT( c, p, n) Insert( (c const *) p, n )
-#define C40_PUSH( c, p) Push( (c const *) p )
#define C40_PTR_INSERT( c, p) Insert( (c const *) p )
-#define C40_REMOVE( c, p ) Remove( (c const *) p )
#define C40_REPLACE( c, p, n) Replace( (c const *) p, n )
-#define C40_PTR_REPLACE( c, p) Replace( (c const *) p )
#define C40_GETPOS( c, r) GetPos( (c const *)r )
#else
#if defined WTC || defined ICC || defined HPUX || (defined GCC && __GNUC__ >= 3) || (defined(WNT) && _MSC_VER >= 1400)
#define C40_INSERT( c, p, n ) Insert( (c const *&) p, n )
-#define C40_PUSH( c, p) Push( (c const *&) p )
#define C40_PTR_INSERT( c, p ) Insert( (c const *&) p )
-#define C40_REMOVE( c, p ) Remove( (c const *&) p )
#define C40_REPLACE( c, p, n ) Replace( (c const *&) p, n )
-#define C40_PTR_REPLACE( c, p ) Replace( (c const *&) p )
#define C40_GETPOS( c, r) GetPos( (c const *&) r )
#else
#define C40_INSERT( c, p, n ) Insert( p, n )
-#define C40_PUSH( c, p) Push( p )
#define C40_PTR_INSERT( c, p ) Insert( p )
-#define C40_REMOVE( c, p) Remove( p )
#define C40_REPLACE( c, p, n ) Replace( p, n )
-#define C40_PTR_REPLACE( c, p ) Replace( p )
#define C40_GETPOS( c, r) GetPos( r )
#endif
#endif
diff --git a/svl/inc/svl/svstdarr.hxx b/svl/inc/svl/svstdarr.hxx
index fa3c94034256..608705dca43d 100644
--- a/svl/inc/svl/svstdarr.hxx
+++ b/svl/inc/svl/svstdarr.hxx
@@ -42,20 +42,11 @@
#include "svl/svldllapi.h"
#include <svl/svarray.hxx>
+#include <deque>
-//#ifdef _SVSTDARR_BOOLS
-#ifndef _SVSTDARR_BOOLS_DECL
-SV_DECL_VARARR_VISIBILITY( SvBools, BOOL, 1, 1, SVL_DLLPUBLIC )
-#define _SVSTDARR_BOOLS_DECL
-#endif
-//#endif
+typedef std::deque< BOOL > SvBools;
-//#ifdef _SVSTDARR_BYTES
-#ifndef _SVSTDARR_BYTES_DECL
-SV_DECL_VARARR_VISIBILITY( SvBytes, BYTE, 1, 1, SVL_DLLPUBLIC )
-#define _SVSTDARR_BYTES_DECL
-#endif
-//#endif
+typedef std::deque< BYTE > SvBytes;
//#ifdef _SVSTDARR_ULONGS
#ifndef _SVSTDARR_ULONGS_DECL
@@ -139,12 +130,7 @@ SV_DECL_VARARR_SORT_VISIBILITY( SvLongsSort, long, 1, 1, SVL_DLLPUBLIC )
#endif
//#endif
-//#ifdef _SVSTDARR_SHORTS
-#ifndef _SVSTDARR_SHORTS_DECL
-SV_DECL_VARARR_VISIBILITY( SvShorts, short, 1, 1, SVL_DLLPUBLIC )
-#define _SVSTDARR_SHORTS_DECL
-#endif
-//#endif
+typedef std::deque< short > SvShorts;
/*
form here all Arrays for Strings, ByteString and then
@@ -255,17 +241,5 @@ SV_DECL_PTRARR_SORT_DEL_VISIBILITY( SvByteStringsISortDtor, ByteStringPtr, 1, 1,
#endif
//#endif
-//#ifdef _SVSTDARR_XUB_STRLEN
-#ifndef _SVSTDARR_XUB_STRLEN_DECL
-SV_DECL_VARARR_VISIBILITY( SvXub_StrLens, xub_StrLen, 1, 1, SVL_DLLPUBLIC )
-#define _SVSTDARR_XUB_STRLEN_DECL
-#endif
-//#endif
-
-//#ifdef _SVSTDARR_XUB_STRLENSORT
-#ifndef _SVSTDARR_XUB_STRLENSORT_DECL
-SV_DECL_VARARR_SORT_VISIBILITY( SvXub_StrLensSort, xub_StrLen, 1, 1, SVL_DLLPUBLIC )
-#define _SVSTDARR_XUB_STRLENSORT_DECL
-#endif
-//#endif
+typedef std::deque< xub_StrLen > SvXub_StrLens;
diff --git a/svl/prj/build.lst b/svl/prj/build.lst
index f2d4bf324d01..d5897d9e9883 100644
--- a/svl/prj/build.lst
+++ b/svl/prj/build.lst
@@ -19,4 +19,8 @@ sl svl\util nmake - all svl_util svl_usdde.u svl_psd
sl svl\source\fsstor nmake - all svl_fsstor svl_inc NULL
sl svl\source\passwordcontainer nmake - all svl_passcont svl_inc NULL
+# complex test for ConfigItems are marked as defect
+# sl svl\qa\complex\ConfigItems\helper nmake - all svl_qa_complex_help svl_util svl_passcont NULL
+# sl svl\qa\complex\ConfigItems nmake - all svl_qa_complex svl_qa_complex_help svl_util svl_passcont NULL
+sl svl\qa\complex\passwordcontainer nmake - all svl_qa_complex svl_util svl_passcont NULL
diff --git a/svl/prj/d.lst b/svl/prj/d.lst
index a5c2564e81cd..d79346c16087 100644
--- a/svl/prj/d.lst
+++ b/svl/prj/d.lst
@@ -20,3 +20,6 @@ dos: sh -c "if test %OS% = MACOSX; then macosx-create-bundle %_DEST%\bin%_EXT%\b
*.xml %_DEST%\xml%_EXT%\*.xml
+..\%__SRC%\misc\fsstorage.component %_DEST%\xml%_EXT%\fsstorage.component
+..\%__SRC%\misc\passwordcontainer.component %_DEST%\xml%_EXT%\passwordcontainer.component
+..\%__SRC%\misc\svl.component %_DEST%\xml%_EXT%\svl.component
diff --git a/svl/qa/complex/ConfigItems/CheckConfigItems.java b/svl/qa/complex/ConfigItems/CheckConfigItems.java
index 4afa2bf33f55..78141b6b20d4 100644
--- a/svl/qa/complex/ConfigItems/CheckConfigItems.java
+++ b/svl/qa/complex/ConfigItems/CheckConfigItems.java
@@ -27,20 +27,25 @@
package complex.ConfigItems;
-import com.sun.star.beans.*;
-import com.sun.star.lang.*;
-import com.sun.star.uno.*;
-import com.sun.star.task.*;
+import com.sun.star.beans.NamedValue;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.task.XJob;
+import com.sun.star.uno.UnoRuntime;
-import complexlib.*;
-import java.lang.*;
-import java.util.*;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.openoffice.test.OfficeConnection;
+// import static org.junit.Assert.*;
//-----------------------------------------------
/** @short todo document me
+ * @deprecated this tests seems no longer work as expected.
*/
-public class CheckConfigItems extends ComplexTestCase
+public class CheckConfigItems
{
//-------------------------------------------
// some const
@@ -64,43 +69,44 @@ public class CheckConfigItems extends ComplexTestCase
@return All test methods.
@todo Think about selection of tests from outside ...
*/
- public String[] getTestMethodNames()
- {
- return new String[]
- {
- "checkPicklist",
- "checkURLHistory",
- "checkHelpBookmarks",
- "checkPrintOptions",
- "checkAccessibilityOptions",
- "checkUserOptions"
- };
- }
+// public String[] getTestMethodNames()
+// {
+// return new String[]
+// {
+// "checkPicklist",
+// "checkURLHistory",
+// "checkHelpBookmarks",
+// "checkPrintOptions",
+// "checkAccessibilityOptions",
+// "checkUserOptions"
+// };
+// }
//-------------------------------------------
/** @short Create the environment for following tests.
- @descr Use either a component loader from desktop or
+ * @throws java.lang.Exception
+ * @descr Use either a component loader from desktop or
from frame
*/
- public void before()
+ @Before public void before()
throws java.lang.Exception
{
// get uno service manager from global test environment
- m_xSmgr = (XMultiServiceFactory)param.getMSF();
+ m_xSmgr = getMSF();
// TODO register helper service
// create module manager
- m_xTest = (XJob)UnoRuntime.queryInterface(
- XJob.class,
- m_xSmgr.createInstance("com.sun.star.comp.svl.ConfigItemTest"));
+ m_xTest = UnoRuntime.queryInterface(XJob.class, m_xSmgr.createInstance("com.sun.star.comp.svl.ConfigItemTest"));
}
//-------------------------------------------
- /** @short close the environment.
+ /**
+ * @throws java.lang.Exception
+ * @short close the environment.
*/
- public void after()
+ @After public void after()
throws java.lang.Exception
{
// TODO deregister helper service
@@ -110,54 +116,66 @@ public class CheckConfigItems extends ComplexTestCase
}
//-------------------------------------------
- /** @todo document me
+ /**
+ * @throws java.lang.Exception
+ * @todo document me
*/
- public void checkPicklist()
+ @Test public void checkPicklist()
throws java.lang.Exception
{
impl_triggerTest("checkPicklist");
}
//-------------------------------------------
- /** @todo document me
+ /**
+ * @throws java.lang.Exception
+ * @todo document me
*/
- public void checkURLHistory()
+ @Test public void checkURLHistory()
throws java.lang.Exception
{
impl_triggerTest("checkURLHistory");
}
//-------------------------------------------
- /** @todo document me
+ /**
+ * @throws java.lang.Exception
+ * @todo document me
*/
- public void checkHelpBookmarks()
+ @Test public void checkHelpBookmarks()
throws java.lang.Exception
{
impl_triggerTest("checkHelpBookmarks");
}
//-------------------------------------------
- /** @todo document me
+ /**
+ * @throws java.lang.Exception
+ * @todo document me
*/
- public void checkPrintOptions()
- throws java.lang.Exception
- {
- impl_triggerTest("checkPrintOptions");
- }
+// @Test public void checkPrintOptions()
+// throws java.lang.Exception
+// {
+// impl_triggerTest("checkPrintOptions");
+// }
//-------------------------------------------
- /** @todo document me
+ /**
+ * @throws java.lang.Exception
+ * @todo document me
*/
- public void checkAccessibilityOptions()
+ @Test public void checkAccessibilityOptions()
throws java.lang.Exception
{
impl_triggerTest("checkAccessibilityOptions");
}
//-------------------------------------------
- /** @todo document me
+ /**
+ * @throws java.lang.Exception
+ * @todo document me
*/
- public void checkUserOptions()
+ @Test public void checkUserOptions()
throws java.lang.Exception
{
impl_triggerTest("checkUserOptions");
@@ -175,4 +193,27 @@ public class CheckConfigItems extends ComplexTestCase
lArgs[0].Value = sTest;
m_xTest.execute(lArgs);
}
+
+
+ private XMultiServiceFactory getMSF()
+ {
+ final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager());
+ return xMSF1;
+ }
+
+ // setup and close connections
+ @BeforeClass public static void setUpConnection() throws Exception {
+ System.out.println("setUpConnection()");
+ connection.setUp();
+ }
+
+ @AfterClass public static void tearDownConnection()
+ throws InterruptedException, com.sun.star.uno.Exception
+ {
+ System.out.println("tearDownConnection()");
+ connection.tearDown();
+ }
+
+ private static final OfficeConnection connection = new OfficeConnection();
+
}
diff --git a/svl/qa/complex/ConfigItems/helper/ConfigItemTest.cxx b/svl/qa/complex/ConfigItems/helper/ConfigItemTest.cxx
index f9840605a6d5..b342eff7ff76 100644
--- a/svl/qa/complex/ConfigItems/helper/ConfigItemTest.cxx
+++ b/svl/qa/complex/ConfigItems/helper/ConfigItemTest.cxx
@@ -26,8 +26,8 @@
************************************************************************/
#include "HistoryOptTest.hxx"
-#include "AccessibilityOptTest.hxx"
-#include "PrintOptTest.hxx"
+// #include "AccessibilityOptTest.hxx"
+// #include "PrintOptTest.hxx"
#include "UserOptTest.hxx"
#include <com/sun/star/uno/XComponentContext.hpp>
@@ -50,8 +50,8 @@ static const ::rtl::OUString PROP_TEST = ::rtl::OUString::creat
static const ::rtl::OUString TEST_PICKLIST = ::rtl::OUString::createFromAscii("checkPicklist");
static const ::rtl::OUString TEST_URLHISTORY = ::rtl::OUString::createFromAscii("checkURLHistory");
static const ::rtl::OUString TEST_HELPBOOKMARKS = ::rtl::OUString::createFromAscii("checkHelpBookmarks");
-static const ::rtl::OUString TEST_ACCESSIBILITYOPTIONS = ::rtl::OUString::createFromAscii("checkAccessibilityOptions");
-static const ::rtl::OUString TEST_PRINTOPTIONS = ::rtl::OUString::createFromAscii("checkPrintOptions");
+// static const ::rtl::OUString TEST_ACCESSIBILITYOPTIONS = ::rtl::OUString::createFromAscii("checkAccessibilityOptions");
+// static const ::rtl::OUString TEST_PRINTOPTIONS = ::rtl::OUString::createFromAscii("checkPrintOptions");
static const ::rtl::OUString TEST_USEROPTIONS = ::rtl::OUString::createFromAscii("checkUserOptions");
//=============================================================================
@@ -136,16 +136,16 @@ css::uno::Any SAL_CALL ConfigItemTest::execute(const css::uno::Sequence< css::be
HistoryOptTest aOptTest;
aOptTest.checkHelpBookmarks();
}
- else if (sTest.equals(TEST_ACCESSIBILITYOPTIONS))
- {
- AccessibilityOptTest aOptTest;
- aOptTest.impl_checkAccessibilityOptions();
- }
- else if (sTest.equals(TEST_PRINTOPTIONS))
- {
- PrintOptTest aOptTest;
- aOptTest.impl_checkPrint();
- }
+// else if (sTest.equals(TEST_ACCESSIBILITYOPTIONS))
+// {
+// AccessibilityOptTest aOptTest;
+// aOptTest.impl_checkAccessibilityOptions();
+// }
+// else if (sTest.equals(TEST_PRINTOPTIONS))
+// {
+// PrintOptTest aOptTest;
+// aOptTest.impl_checkPrint();
+// }
else if (sTest.equals(TEST_USEROPTIONS))
{
UserOptTest aOptTest;
diff --git a/svl/qa/complex/ConfigItems/helper/makefile.mk b/svl/qa/complex/ConfigItems/helper/makefile.mk
index 13ea12106792..95f2e456fab3 100644
--- a/svl/qa/complex/ConfigItems/helper/makefile.mk
+++ b/svl/qa/complex/ConfigItems/helper/makefile.mk
@@ -24,7 +24,7 @@
# for a copy of the LGPLv3 License.
#
#*************************************************************************
-PRJ=..$/..$/..$/..
+PRJ=../../../..
PRJNAME= svl
TARGET= ConfigItemTest
@@ -38,26 +38,27 @@ NO_BSYMBOLIC= TRUE
# --- Generate -----------------------------------------------------
-INCPOST += $(PRJ)$/source$/inc
+INCPOST += $(PRJ)/source/inc
# --- light services library ----------------------------------------------------
SHL1TARGET= svt_$(TARGET)
SHL1OBJS= \
- $(SLO)$/UserOptTest.obj \
- $(SLO)$/PrintOptTest.obj \
- $(SLO)$/AccessibilityOptTest.obj \
- $(SLO)$/HistoryOptTest.obj \
- $(SLO)$/ConfigItemTest.obj
+ $(SLO)/UserOptTest.obj \
+ $(SLO)/HistoryOptTest.obj \
+ $(SLO)/ConfigItemTest.obj
+
+# $(SLO)/PrintOptTest.obj
+# $(SLO)/AccessibilityOptTest.obj
SHL1STDLIBS= \
- $(SVLIB) \
- $(SVLLIB) \
- $(UNOTOOLSLIB) \
- $(COMPHELPERLIB) \
- $(CPPUHELPERLIB) \
- $(CPPULIB) \
+ $(SVLIB) \
+ $(SVLLIB) \
+ $(UNOTOOLSLIB) \
+ $(COMPHELPERLIB) \
+ $(CPPUHELPERLIB) \
+ $(CPPULIB) \
$(SALLIB)
SHL1DEF= $(MISC)$/$(SHL1TARGET).def
diff --git a/svl/qa/complex/ConfigItems/makefile.mk b/svl/qa/complex/ConfigItems/makefile.mk
index 6838cc79a660..b4241f24dfee 100644
--- a/svl/qa/complex/ConfigItems/makefile.mk
+++ b/svl/qa/complex/ConfigItems/makefile.mk
@@ -24,60 +24,38 @@
# for a copy of the LGPLv3 License.
#
#*************************************************************************
-PRJ = ..$/..$/..
-TARGET = CheckConfigItems
-PRJNAME = svl
-PACKAGE = complex$/ConfigItems
-
-# --- Settings -----------------------------------------------------
-.INCLUDE: settings.mk
-
-
-#----- compile .java files -----------------------------------------
-
-JARFILES = mysql.jar ridl.jar unoil.jar jurt.jar juh.jar jut.jar java_uno.jar \
- OOoRunner.jar
-
-JAVAFILES = CheckConfigItems.java
-
-JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class)
-
-SUBDIRS = helper
-
-#----- make a jar from compiled files ------------------------------
-
-MAXLINELENGTH = 100000
-
-JARCLASSDIRS = $(PACKAGE)
-JARTARGET = $(TARGET).jar
-JARCOMPRESS = TRUE
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
+.ELSE
-# --- Parameters for the test --------------------------------------
+PRJ = ../../..
+PRJNAME = svl
+TARGET = qa_complex_ConfigItems
-# start an office if the parameter is set for the makefile
-.IF "$(OFFICE)" == ""
-CT_APPEXECCOMMAND =
-.ELSE
-CT_APPEXECCOMMAND = -AppExecutionCommand "$(OFFICE)$/soffice -accept=socket,host=localhost,port=8100;urp;"
-.ENDIF
+.IF "$(OOO_JUNIT_JAR)" != ""
+PACKAGE = complex/ConfigItems
-# test base is java complex
-CT_TESTBASE = -TestBase java_complex
+# here store only Files which contain a @Test
+JAVATESTFILES = \
+ CheckConfigItems.java
-# test looks something like the.full.package.TestName
-CT_TEST = -o $(PACKAGE:s\$/\.\).$(JAVAFILES:b)
+# put here all other files
+JAVAFILES = $(JAVATESTFILES)
-# start the runner application
-CT_APP = org.openoffice.Runner
+JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar
+EXTRAJARFILES = $(OOO_JUNIT_JAR)
-# --- Targets ------------------------------------------------------
+# Sample how to debug
+# JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y
-.INCLUDE : target.mk
+.END
-RUN: run
+.INCLUDE: settings.mk
+.INCLUDE: target.mk
+.INCLUDE: installationtest.mk
-run:
- java -cp $(CLASSPATH) $(CT_APP) $(CT_TESTBASE) $(CT_APPEXECCOMMAND) $(CT_TEST)
+ALLTAR : javatest
+.END
diff --git a/svl/qa/complex/passwordcontainer/MasterPasswdHandler.java b/svl/qa/complex/passwordcontainer/MasterPasswdHandler.java
index bf6159ee38c5..8e886f0b8269 100644
--- a/svl/qa/complex/passwordcontainer/MasterPasswdHandler.java
+++ b/svl/qa/complex/passwordcontainer/MasterPasswdHandler.java
@@ -36,12 +36,16 @@ public class MasterPasswdHandler extends WeakBase
XInteractionSupplyAuthentication xAuthentication = null;
for( int i = 0; i < xContinuations.length; ++i ) {
- xAuthentication = (XInteractionSupplyAuthentication)UnoRuntime.queryInterface( XInteractionSupplyAuthentication.class, xContinuations[i]);
+ xAuthentication = UnoRuntime.queryInterface(XInteractionSupplyAuthentication.class, xContinuations[i]);
if( xAuthentication != null )
+ {
break;
+ }
}
if( xAuthentication.canSetPassword() )
- xAuthentication.setPassword( "abcdefghijklmnopqrstuvwxyz123456" );
+ {
+ xAuthentication.setPassword("abcdefghijklmnopqrstuvwxyz123456");
+ }
xAuthentication.select();
}
} else {
diff --git a/svl/qa/complex/passwordcontainer/PasswordContainerUnitTest.java b/svl/qa/complex/passwordcontainer/PasswordContainerUnitTest.java
index 2e3bada4d1bc..ac5c79d134dc 100644
--- a/svl/qa/complex/passwordcontainer/PasswordContainerUnitTest.java
+++ b/svl/qa/complex/passwordcontainer/PasswordContainerUnitTest.java
@@ -27,47 +27,78 @@
package complex.passwordcontainer;
-import complexlib.ComplexTestCase;
import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
-public class PasswordContainerUnitTest extends ComplexTestCase {
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.openoffice.test.OfficeConnection;
+import static org.junit.Assert.*;
+
+public class PasswordContainerUnitTest {
private XMultiServiceFactory m_xMSF = null;
- public String[] getTestMethodNames() {
- return new String[] {
- "ExecuteTest01",
- "ExecuteTest02",
- "ExecuteTest03"};
- }
- public String getTestObjectName() {
- return "PasswordContainerUnitTest";
- }
+//// public String[] getTestMethodNames() {
+//// return new String[] {
+//// "ExecuteTest01",
+//// "ExecuteTest02",
+//// "ExecuteTest03"};
+//// }
+// public String getTestObjectName() {
+// return "PasswordContainerUnitTest";
+// }
- public void before() {
+ @Before public void before() {
try {
- m_xMSF = (XMultiServiceFactory) param.getMSF();
+ m_xMSF = getMSF();
} catch (Exception e) {
- failed ("Cannot create service factory!");
+ fail ("Cannot create service factory!");
}
if (m_xMSF == null) {
- failed ("Cannot create service factory!");
+ fail ("Cannot create service factory!");
}
}
- public void after() {
+ @After public void after() {
m_xMSF = null;
}
- public void ExecuteTest01() {
- PasswordContainerTest aTest = new Test01(m_xMSF, log);
- assure("Test01 failed!", aTest.test());
+ @Test public void ExecuteTest01()
+ {
+ PasswordContainerTest aTest = new Test01(m_xMSF);
+ assertTrue("Test01 failed!", aTest.test());
}
- public void ExecuteTest02() {
- PasswordContainerTest aTest = new Test02(m_xMSF, log);
- assure("Test02 failed!", aTest.test());
+ @Test public void ExecuteTest02() {
+ PasswordContainerTest aTest = new Test02(m_xMSF);
+ assertTrue("Test02 failed!", aTest.test());
}
- public void ExecuteTest03() {
- PasswordContainerTest aTest = new Test03(m_xMSF, log);
- assure("Test03 failed!", aTest.test());
+ @Test public void ExecuteTest03() {
+ PasswordContainerTest aTest = new Test03(m_xMSF);
+ assertTrue("Test03 failed!", aTest.test());
}
+
+ private XMultiServiceFactory getMSF()
+ {
+ final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager());
+ return xMSF1;
+ }
+
+ // setup and close connections
+ @BeforeClass public static void setUpConnection() throws Exception {
+ System.out.println("setUpConnection()");
+ connection.setUp();
+ }
+
+ @AfterClass public static void tearDownConnection()
+ throws InterruptedException, com.sun.star.uno.Exception
+ {
+ System.out.println("tearDownConnection()");
+ connection.tearDown();
+ }
+
+ private static final OfficeConnection connection = new OfficeConnection();
+
}
diff --git a/svl/qa/complex/passwordcontainer/Test01.java b/svl/qa/complex/passwordcontainer/Test01.java
index 1ca17c922669..9367fea4eb7b 100644
--- a/svl/qa/complex/passwordcontainer/Test01.java
+++ b/svl/qa/complex/passwordcontainer/Test01.java
@@ -36,17 +36,17 @@ import com.sun.star.task.XMasterPasswordHandling;
import com.sun.star.uno.UnoRuntime;
-import share.LogWriter;
+// import share.LogWriter;
public class Test01 implements PasswordContainerTest {
XMultiServiceFactory m_xMSF = null;
XPasswordContainer m_xPasswordContainer = null;
TestHelper m_aTestHelper = null;
- public Test01 ( XMultiServiceFactory xMSF, LogWriter aLogWriter )
+ public Test01 ( XMultiServiceFactory xMSF )
{
m_xMSF = xMSF;
- m_aTestHelper = new TestHelper (aLogWriter, "Test01: ");
+ m_aTestHelper = new TestHelper ( "Test01: ");
}
public boolean test() {
@@ -68,9 +68,9 @@ public class Test01 implements PasswordContainerTest {
}
try {
Object oPasswordContainer = m_xMSF.createInstance( "com.sun.star.task.PasswordContainer" );
- XPasswordContainer xContainer = (XPasswordContainer)UnoRuntime.queryInterface(XPasswordContainer.class, oPasswordContainer);
+ XPasswordContainer xContainer = UnoRuntime.queryInterface(XPasswordContainer.class, oPasswordContainer);
Object oHandler = m_xMSF.createInstance( "com.sun.star.task.InteractionHandler" );
- XInteractionHandler xHandler = (XInteractionHandler)UnoRuntime.queryInterface(XInteractionHandler.class, oHandler);
+ XInteractionHandler xHandler = UnoRuntime.queryInterface(XInteractionHandler.class, oHandler);
MasterPasswdHandler aMHandler = new MasterPasswdHandler( xHandler );
// add a set of users and passwords for the same URL for runtime
diff --git a/svl/qa/complex/passwordcontainer/Test02.java b/svl/qa/complex/passwordcontainer/Test02.java
index b77b0fe9bf48..3d0123de3179 100644
--- a/svl/qa/complex/passwordcontainer/Test02.java
+++ b/svl/qa/complex/passwordcontainer/Test02.java
@@ -36,17 +36,16 @@ import com.sun.star.task.UserRecord;
import com.sun.star.uno.UnoRuntime;
-import share.LogWriter;
public class Test02 implements PasswordContainerTest {
XMultiServiceFactory m_xMSF = null;
XPasswordContainer m_xPasswordContainer = null;
TestHelper m_aTestHelper = null;
- public Test02 ( XMultiServiceFactory xMSF, LogWriter aLogWriter )
+ public Test02 ( XMultiServiceFactory xMSF )
{
m_xMSF = xMSF;
- m_aTestHelper = new TestHelper (aLogWriter, "Test02: ");
+ m_aTestHelper = new TestHelper ( "Test02: ");
}
public boolean test() {
@@ -69,11 +68,11 @@ public class Test02 implements PasswordContainerTest {
try {
Object oPasswordContainer = m_xMSF.createInstance("com.sun.star.task.PasswordContainer");
- XPasswordContainer xContainer = (XPasswordContainer)UnoRuntime.queryInterface(XPasswordContainer.class, oPasswordContainer);
+ XPasswordContainer xContainer = UnoRuntime.queryInterface(XPasswordContainer.class, oPasswordContainer);
Object oHandler = m_xMSF.createInstance("com.sun.star.task.InteractionHandler");
- XInteractionHandler xHandler = (XInteractionHandler)UnoRuntime.queryInterface(XInteractionHandler.class, oHandler);
+ XInteractionHandler xHandler = UnoRuntime.queryInterface(XInteractionHandler.class, oHandler);
MasterPasswdHandler aMHandler = new MasterPasswdHandler(xHandler);
- XMasterPasswordHandling xMHandling = (XMasterPasswordHandling)UnoRuntime.queryInterface(XMasterPasswordHandling.class, oPasswordContainer);
+ XMasterPasswordHandling xMHandling = UnoRuntime.queryInterface(XMasterPasswordHandling.class, oPasswordContainer);
// allow the storing of the passwords
xMHandling.allowPersistentStoring(true);
diff --git a/svl/qa/complex/passwordcontainer/Test03.java b/svl/qa/complex/passwordcontainer/Test03.java
index 9e38a55893e0..cf2b3d45cbb0 100644
--- a/svl/qa/complex/passwordcontainer/Test03.java
+++ b/svl/qa/complex/passwordcontainer/Test03.java
@@ -36,17 +36,17 @@ import com.sun.star.task.XInteractionHandler;
import com.sun.star.uno.UnoRuntime;
-import share.LogWriter;
+
public class Test03 implements PasswordContainerTest {
XMultiServiceFactory m_xMSF = null;
XPasswordContainer m_xPasswordContainer = null;
TestHelper m_aTestHelper = null;
- public Test03 ( XMultiServiceFactory xMSF, LogWriter aLogWriter )
+ public Test03 ( XMultiServiceFactory xMSF )
{
m_xMSF = xMSF;
- m_aTestHelper = new TestHelper (aLogWriter, "Test03: ");
+ m_aTestHelper = new TestHelper ( "Test03: ");
}
public boolean test() {
@@ -68,11 +68,11 @@ public class Test03 implements PasswordContainerTest {
try {
Object oPasswordContainer = m_xMSF.createInstance("com.sun.star.task.PasswordContainer");
- XPasswordContainer xContainer = (XPasswordContainer)UnoRuntime.queryInterface(XPasswordContainer.class, oPasswordContainer);
+ XPasswordContainer xContainer = UnoRuntime.queryInterface(XPasswordContainer.class, oPasswordContainer);
Object oHandler = m_xMSF.createInstance("com.sun.star.task.InteractionHandler");
- XInteractionHandler xHandler = (XInteractionHandler)UnoRuntime.queryInterface(XInteractionHandler.class, oHandler);
+ XInteractionHandler xHandler = UnoRuntime.queryInterface(XInteractionHandler.class, oHandler);
MasterPasswdHandler aMHandler = new MasterPasswdHandler(xHandler);
- XMasterPasswordHandling xMHandling = (XMasterPasswordHandling)UnoRuntime.queryInterface(XMasterPasswordHandling.class, oPasswordContainer);
+ XMasterPasswordHandling xMHandling = UnoRuntime.queryInterface(XMasterPasswordHandling.class, oPasswordContainer);
// allow the storing of the passwords
xMHandling.allowPersistentStoring(true);
diff --git a/svl/qa/complex/passwordcontainer/TestHelper.java b/svl/qa/complex/passwordcontainer/TestHelper.java
index 1971b61098f5..c91401e74c91 100644
--- a/svl/qa/complex/passwordcontainer/TestHelper.java
+++ b/svl/qa/complex/passwordcontainer/TestHelper.java
@@ -29,23 +29,23 @@ package complex.passwordcontainer;
import com.sun.star.task.UserRecord;
-import share.LogWriter;
+// import share.LogWriter;
public class TestHelper {
- LogWriter m_aLogWriter;
+ // LogWriter m_aLogWriter;
String m_sTestPrefix;
- public TestHelper( LogWriter aLogWriter, String sTestPrefix ) {
- m_aLogWriter = aLogWriter;
+ public TestHelper( String sTestPrefix ) {
+ // m_aLogWriter = aLogWriter;
m_sTestPrefix = sTestPrefix;
}
public void Error( String sError ) {
- m_aLogWriter.println( m_sTestPrefix + "Error: " + sError );
+ System.out.println( m_sTestPrefix + "Error: " + sError );
}
public void Message( String sMessage ) {
- m_aLogWriter.println( m_sTestPrefix + sMessage );
+ System.out.println( m_sTestPrefix + sMessage );
}
public boolean sameLists(UserRecord aUserList1[], UserRecord aUserList2[]) {
@@ -60,7 +60,9 @@ public class TestHelper {
int j;
for(j = 0; j < aUserList2.length; j++) {
if(!aUserList1[i].UserName.equals(aUserList2[j].UserName))
+ {
continue;
+ }
if(aUserList1[i].Passwords[0].equals(aUserList2[j].Passwords[0])) {
break;
}
diff --git a/svl/qa/complex/passwordcontainer/makefile.mk b/svl/qa/complex/passwordcontainer/makefile.mk
index 57fd4d560f8d..625404682761 100644
--- a/svl/qa/complex/passwordcontainer/makefile.mk
+++ b/svl/qa/complex/passwordcontainer/makefile.mk
@@ -25,63 +25,110 @@
#
#*************************************************************************
-PRJ = ..$/..$/..
-TARGET = PasswordContainerUnitTest
-PRJNAME=svl
-PACKAGE = complex$/passwordcontainer
-
-# --- Settings -----------------------------------------------------
-.INCLUDE: settings.mk
-
-
-#----- compile .java files -----------------------------------------
-
-JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar
-
-JAVAFILES =\
- PasswordContainerUnitTest.java\
- PasswordContainerTest.java\
- TestHelper.java\
- Test01.java\
- Test02.java\
- Test03.java\
- MasterPasswdHandler.java
-
-JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class)
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
+.ELSE
-#----- make a jar from compiled files ------------------------------
+PRJ = ../../..
+PRJNAME = svl
+TARGET = qa_complex_passwordcontainer
-MAXLINELENGTH = 100000
+.IF "$(OOO_JUNIT_JAR)" != ""
+PACKAGE = complex/passwordcontainer
-JARCLASSDIRS = $(PACKAGE)
-JARTARGET = $(TARGET).jar
-JARCOMPRESS = TRUE
+# here store only Files which contain a @Test
+JAVATESTFILES = \
+ PasswordContainerUnitTest.java
-# --- Parameters for the test --------------------------------------
-# start an office if the parameter is set for the makefile
-.IF "$(OFFICE)" == ""
-CT_APPEXECCOMMAND =
-.ELSE
-CT_APPEXECCOMMAND = -AppExecutionCommand "$(OFFICE)$/soffice -accept=socket,host=localhost,port=8100;urp;"
-.ENDIF
+# put here all other files
+JAVAFILES = $(JAVATESTFILES) \
+ PasswordContainerTest.java\
+ Test01.java\
+ Test02.java\
+ Test03.java\
+ TestHelper.java\
+ MasterPasswdHandler.java
-# test base is java complex
-CT_TESTBASE = -TestBase java_complex
-# test looks something like the.full.package.TestName
-CT_TEST = -o $(PACKAGE:s\$/\.\).$(JAVAFILES:b)
+JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar
+EXTRAJARFILES = $(OOO_JUNIT_JAR)
-# start the runner application
-CT_APP = org.openoffice.Runner
+# Sample how to debug
+# JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y
-# --- Targets ------------------------------------------------------
+.END
+.INCLUDE: settings.mk
.INCLUDE: target.mk
+.INCLUDE: installationtest.mk
-RUN: run
+ALLTAR : javatest
-run:
- +java -cp $(CLASSPATH) $(CT_APP) $(CT_TESTBASE) $(CT_APPEXECCOMMAND) $(CT_TEST)
+.END
+#
+#
+#
+#
+# PRJ = ..$/..$/..
+# TARGET = PasswordContainerUnitTest
+# PRJNAME=svl
+# PACKAGE = complex$/passwordcontainer
+#
+# # --- Settings -----------------------------------------------------
+# .INCLUDE: settings.mk
+#
+#
+# #----- compile .java files -----------------------------------------
+#
+# JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar
+#
+# JAVAFILES =\
+# PasswordContainerUnitTest.java\
+# PasswordContainerTest.java\
+# TestHelper.java\
+# Test01.java\
+# Test02.java\
+# Test03.java\
+# MasterPasswdHandler.java
+#
+# JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class)
+#
+# #----- make a jar from compiled files ------------------------------
+#
+# MAXLINELENGTH = 100000
+#
+# JARCLASSDIRS = $(PACKAGE)
+# JARTARGET = $(TARGET).jar
+# JARCOMPRESS = TRUE
+#
+# # --- Parameters for the test --------------------------------------
+#
+# # start an office if the parameter is set for the makefile
+# .IF "$(OFFICE)" == ""
+# CT_APPEXECCOMMAND =
+# .ELSE
+# CT_APPEXECCOMMAND = -AppExecutionCommand "$(OFFICE)$/soffice -accept=socket,host=localhost,port=8100;urp;"
+# .ENDIF
+#
+# # test base is java complex
+# CT_TESTBASE = -TestBase java_complex
+#
+# # test looks something like the.full.package.TestName
+# CT_TEST = -o $(PACKAGE:s\$/\.\).$(JAVAFILES:b)
+#
+# # start the runner application
+# CT_APP = org.openoffice.Runner
+#
+# # --- Targets ------------------------------------------------------
+#
+# .INCLUDE: target.mk
+#
+# RUN: run
+#
+# run:
+# +java -cp $(CLASSPATH) $(CT_APP) $(CT_TESTBASE) $(CT_APPEXECCOMMAND) $(CT_TEST)
+#
+#
diff --git a/svl/source/filepicker/makefile.mk b/svl/source/filepicker/makefile.mk
index a4c97ea41aa1..b3c2a829cf54 100644
--- a/svl/source/filepicker/makefile.mk
+++ b/svl/source/filepicker/makefile.mk
@@ -38,7 +38,6 @@ ENABLE_EXCEPTIONS=TRUE
# --- Files --------------------------------------------------------------
SLOFILES =\
- $(SLO)$/pickerhelper.obj \
$(SLO)$/pickerhistory.obj
# --- Targets -------------------------------------------------------
diff --git a/svl/source/filepicker/pickerhelper.cxx b/svl/source/filepicker/pickerhelper.cxx
deleted file mode 100644
index 72096c1bc56a..000000000000
--- a/svl/source/filepicker/pickerhelper.cxx
+++ /dev/null
@@ -1,99 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svl.hxx"
-
-#include "pickerhelper.hxx"
-#include "rtl/ustring.hxx"
-#include "com/sun/star/ui/dialogs/XFilePicker.hpp"
-#include "com/sun/star/ui/dialogs/XFolderPicker.hpp"
-#include "com/sun/star/beans/XPropertySet.hpp"
-#include "com/sun/star/beans/XPropertySetInfo.hpp"
-#include "com/sun/star/uno/Any.hxx"
-#include "tools/debug.hxx"
-
-namespace css = com::sun::star;
-
-using css::uno::Reference;
-using rtl::OUString;
-
-namespace svt
-{
- void SetDialogHelpId(
- Reference < css::ui::dialogs::XFilePicker > _mxFileDlg, sal_Int32 _nHelpId )
- {
- try
- {
- // does the dialog haver a help URL property?
- Reference< css::beans::XPropertySet > xDialogProps( _mxFileDlg, css::uno::UNO_QUERY );
- Reference< css::beans::XPropertySetInfo > xInfo;
- if( xDialogProps.is() )
- xInfo = xDialogProps->getPropertySetInfo( );
-
- const OUString sHelpURLPropertyName( RTL_CONSTASCII_USTRINGPARAM( "HelpURL" ) );
-
- if( xInfo.is() && xInfo->hasPropertyByName( sHelpURLPropertyName ) )
- { // yep
- OUString sId( RTL_CONSTASCII_USTRINGPARAM( "HID:" ) );
- sId += OUString::valueOf( _nHelpId );
- xDialogProps->setPropertyValue( sHelpURLPropertyName, css::uno::makeAny( sId ) );
- }
- }
- catch( const css::uno::Exception& )
- {
- DBG_ERROR( "svt::SetDialogHelpId(): caught an exception while setting the help id!" );
- }
- }
-
- void SetDialogHelpId(
- Reference< css::ui::dialogs::XFolderPicker > _mxFileDlg, sal_Int32 _nHelpId )
- {
- try
- {
- // does the dialog haver a help URL property?
- Reference< css::beans::XPropertySet > xDialogProps( _mxFileDlg, css::uno::UNO_QUERY );
- Reference< css::beans::XPropertySetInfo > xInfo;
- if( xDialogProps.is() )
- xInfo = xDialogProps->getPropertySetInfo( );
-
- const OUString sHelpURLPropertyName( RTL_CONSTASCII_USTRINGPARAM( "HelpURL" ) );
-
- if( xInfo.is() && xInfo->hasPropertyByName( sHelpURLPropertyName ) )
- { // yep
- OUString sId( RTL_CONSTASCII_USTRINGPARAM( "HID:" ) );
- sId += OUString::valueOf( _nHelpId );
- xDialogProps->setPropertyValue( sHelpURLPropertyName, css::uno::makeAny( sId ) );
- }
- }
- catch( const css::uno::Exception& )
- {
- DBG_ERROR( "svt::SetDialogHelpId(): caught an exception while setting the help id!" );
- }
- }
-}
-
diff --git a/svl/source/fsstor/fsfactory.cxx b/svl/source/fsstor/fsfactory.cxx
index 298b6f555e2a..62fc88f6053a 100644
--- a/svl/source/fsstor/fsfactory.cxx
+++ b/svl/source/fsstor/fsfactory.cxx
@@ -240,30 +240,6 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment (
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo (
- void * /* pServiceManager */, void * pRegistryKey)
-{
- if (pRegistryKey)
- {
- uno::Reference< registry::XRegistryKey > xRegistryKey (
- reinterpret_cast< registry::XRegistryKey*>(pRegistryKey));
-
- uno::Reference< registry::XRegistryKey > xNewKey;
- xNewKey = xRegistryKey->createKey(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) +
- FSStorageFactory::impl_staticGetImplementationName() +
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES")));
-
- const uno::Sequence< ::rtl::OUString > aServices (
- FSStorageFactory::impl_staticGetSupportedServiceNames());
- for( sal_Int32 i = 0; i < aServices.getLength(); i++ )
- xNewKey->createKey( aServices.getConstArray()[i] );
-
- return sal_True;
- }
- return sal_False;
-}
-
SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory (
const sal_Char * pImplementationName, void * pServiceManager, void * /* pRegistryKey */)
{
diff --git a/svl/source/fsstor/fsstorage.component b/svl/source/fsstor/fsstorage.component
new file mode 100644
index 000000000000..3ef0be825972
--- /dev/null
+++ b/svl/source/fsstor/fsstorage.component
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.embed.FileSystemStorageFactory">
+ <service name="com.sun.star.comp.embed.FileSystemStorageFactory"/>
+ <service name="com.sun.star.embed.FileSystemStorageFactory"/>
+ </implementation>
+</component>
diff --git a/svl/source/fsstor/makefile.mk b/svl/source/fsstor/makefile.mk
index dc91814772f9..1dd5d2307037 100644
--- a/svl/source/fsstor/makefile.mk
+++ b/svl/source/fsstor/makefile.mk
@@ -64,3 +64,11 @@ DEF1NAME= $(SHL1TARGET)
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/fsstorage.component
+
+$(MISC)/fsstorage.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ fsstorage.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt fsstorage.component
diff --git a/svl/source/inc/poolio.hxx b/svl/source/inc/poolio.hxx
index 70122a5b1998..79cbbc463700 100644
--- a/svl/source/inc/poolio.hxx
+++ b/svl/source/inc/poolio.hxx
@@ -25,7 +25,8 @@
*
************************************************************************/
#include <svl/brdcst.hxx>
-
+#include <boost/shared_ptr.hpp>
+#include <deque>
#ifndef DELETEZ
#define DELETEZ(pPtr) { delete pPtr; pPtr = 0; }
@@ -53,16 +54,17 @@ struct SfxPoolVersion_Impl
{}
};
-SV_DECL_PTRARR( SfxPoolItemArrayBase_Impl, SfxPoolItem*, 0, 5 )
-SV_DECL_PTRARR_DEL( SfxPoolVersionArr_Impl, SfxPoolVersion_Impl*, 0, 2 )
+typedef std::deque<SfxPoolItem*> SfxPoolItemArrayBase_Impl;
+
+typedef boost::shared_ptr< SfxPoolVersion_Impl > SfxPoolVersion_ImplPtr;
+typedef std::deque< SfxPoolVersion_ImplPtr > SfxPoolVersionArr_Impl;
struct SfxPoolItemArray_Impl: public SfxPoolItemArrayBase_Impl
{
- USHORT nFirstFree;
+ size_t nFirstFree;
- SfxPoolItemArray_Impl (USHORT nInitSize = 0)
- : SfxPoolItemArrayBase_Impl( nInitSize ),
- nFirstFree( 0 )
+ SfxPoolItemArray_Impl ()
+ : nFirstFree( 0 )
{}
};
@@ -96,7 +98,8 @@ struct SfxItemPool_Impl
void DeleteItems()
{
- delete[] ppPoolItems; ppPoolItems = 0;
+ delete[] ppPoolItems;
+ ppPoolItems = 0;
}
};
diff --git a/svl/source/items/itempool.cxx b/svl/source/items/itempool.cxx
index 5c5f106a1c36..d8bdeb330776 100644
--- a/svl/source/items/itempool.cxx
+++ b/svl/source/items/itempool.cxx
@@ -38,14 +38,6 @@
#include <svl/brdcst.hxx>
#include <svl/smplhint.hxx>
#include "poolio.hxx"
-#include <algorithm>
-
-// STATIC DATA -----------------------------------------------------------
-
-
-//========================================================================
-
-SV_IMPL_PTRARR( SfxPoolVersionArr_Impl, SfxPoolVersion_Impl* );
//========================================================================
@@ -275,13 +267,12 @@ SfxItemPool::SfxItemPool
(*( ppPoolDefaults + n ))->SetKind( SFX_ITEMS_POOLDEFAULT );
}
- // Version-Map kopieren
- USHORT nVerCount = rPool.pImp->aVersions.Count();
- for ( USHORT nVer = 0; nVer < nVerCount; ++nVer )
+ // Copy Version-Map
+ for ( size_t nVer = 0; nVer < rPool.pImp->aVersions.size(); ++nVer )
{
- const SfxPoolVersion_Impl *pOld = rPool.pImp->aVersions.GetObject(nVer);
- const SfxPoolVersion_Impl *pNew = new SfxPoolVersion_Impl( *pOld );
- pImp->aVersions.Insert( pNew, nVer );
+ const SfxPoolVersion_ImplPtr pOld = rPool.pImp->aVersions[nVer];
+ SfxPoolVersion_ImplPtr pNew = SfxPoolVersion_ImplPtr( new SfxPoolVersion_Impl( *pOld ) );
+ pImp->aVersions.push_back( pNew );
}
// Verkettung wiederherstellen
@@ -454,9 +445,8 @@ void SfxItemPool::SetSecondaryPool( SfxItemPool *pPool )
pSecondary->pImp->ppPoolItems + n;
if ( *ppItemArr )
{
- SfxPoolItem** ppHtArr =
- (SfxPoolItem**)(*ppItemArr)->GetData();
- for( USHORT i = (*ppItemArr)->Count(); i; ++ppHtArr, --i )
+ SfxPoolItemArrayBase_Impl::iterator ppHtArr = (*ppItemArr)->begin();
+ for( size_t i = (*ppItemArr)->size(); i; ++ppHtArr, --i )
if ( !(*ppHtArr) )
{
DBG_ERROR( "old secondary pool must be empty" );
@@ -582,8 +572,8 @@ void SfxItemPool::Delete()
{
if ( *ppItemArr )
{
- SfxPoolItem** ppHtArr = (SfxPoolItem**)(*ppItemArr)->GetData();
- for ( USHORT n = (*ppItemArr)->Count(); n; --n, ++ppHtArr )
+ SfxPoolItemArrayBase_Impl::iterator ppHtArr = (*ppItemArr)->begin();
+ for ( size_t n = (*ppItemArr)->size(); n; --n, ++ppHtArr )
if (*ppHtArr)
{
#ifdef DBG_UTIL
@@ -614,8 +604,8 @@ void SfxItemPool::Delete()
{
if ( *ppItemArr )
{
- SfxPoolItem** ppHtArr = (SfxPoolItem**)(*ppItemArr)->GetData();
- for ( USHORT n = (*ppItemArr)->Count(); n; --n, ++ppHtArr )
+ SfxPoolItemArrayBase_Impl::iterator ppHtArr = (*ppItemArr)->begin();
+ for ( size_t n = (*ppItemArr)->size(); n; --n, ++ppHtArr )
if (*ppHtArr)
{
#ifdef DBG_UTIL
@@ -663,8 +653,8 @@ void SfxItemPool::Cleanup()
((*ppDefaultItem && (*ppDefaultItem)->ISA(SfxSetItem)) ||
(*ppStaticDefaultItem)->ISA(SfxSetItem)) )
{
- SfxPoolItem** ppHtArr = (SfxPoolItem**)(*ppItemArr)->GetData();
- for ( USHORT n = (*ppItemArr)->Count(); n; --n, ++ppHtArr )
+ SfxPoolItemArrayBase_Impl::iterator ppHtArr = (*ppItemArr)->begin();
+ for ( size_t n = (*ppItemArr)->size(); n; --n, ++ppHtArr )
if ( *ppHtArr && !(*ppHtArr)->GetRefCount() )
{
DELETEZ(*ppHtArr);
@@ -681,8 +671,8 @@ void SfxItemPool::Cleanup()
{
if ( *ppItemArr )
{
- SfxPoolItem** ppHtArr = (SfxPoolItem**)(*ppItemArr)->GetData();
- for ( USHORT n = (*ppItemArr)->Count(); n; --n, ++ppHtArr )
+ SfxPoolItemArrayBase_Impl::iterator ppHtArr = (*ppItemArr)->begin();
+ for ( size_t n = (*ppItemArr)->size(); n; --n, ++ppHtArr )
if ( *ppHtArr && !(*ppHtArr)->GetRefCount() )
DELETEZ( *ppHtArr );
}
@@ -782,15 +772,16 @@ const SfxPoolItem& SfxItemPool::Put( const SfxPoolItem& rItem, USHORT nWhich )
if( !*ppItemArr )
*ppItemArr = new SfxPoolItemArray_Impl;
- SfxPoolItem **ppFree = 0;
- SfxPoolItem** ppHtArray = (SfxPoolItem**)(*ppItemArr)->GetData();
+ SfxPoolItemArrayBase_Impl::iterator ppFree;
+ BOOL ppFreeIsSet = FALSE;
+ SfxPoolItemArrayBase_Impl::iterator ppHtArray = (*ppItemArr)->begin();
if ( IsItemFlag_Impl( nIndex, SFX_ITEM_POOLABLE ) )
{
// wenn es ueberhaupt gepoolt ist, koennte es schon drin sein
if ( IsPooledItem(&rItem) )
{
// 1. Schleife: teste ob der Pointer vorhanden ist.
- for( USHORT n = (*ppItemArr)->Count(); n; ++ppHtArray, --n )
+ for( size_t n = (*ppItemArr)->size(); n; ++ppHtArray, --n )
if( &rItem == (*ppHtArray) )
{
AddRef( **ppHtArray );
@@ -799,8 +790,8 @@ const SfxPoolItem& SfxItemPool::Put( const SfxPoolItem& rItem, USHORT nWhich )
}
// 2. Schleife: dann muessen eben die Attribute verglichen werden
- USHORT n;
- for ( n = (*ppItemArr)->Count(), ppHtArray = (SfxPoolItem**)(*ppItemArr)->GetData();
+ size_t n;
+ for ( n = (*ppItemArr)->size(), ppHtArray = (*ppItemArr)->begin();
n; ++ppHtArray, --n )
{
if ( *ppHtArray )
@@ -812,22 +803,26 @@ const SfxPoolItem& SfxItemPool::Put( const SfxPoolItem& rItem, USHORT nWhich )
}
}
else
- if ( !ppFree )
+ if ( ppFreeIsSet == FALSE )
+ {
ppFree = ppHtArray;
+ ppFreeIsSet = TRUE;
+ }
}
}
else
{
// freien Platz suchen
- SfxPoolItem** ppHtArr;
- USHORT n, nCount = (*ppItemArr)->Count();
+ SfxPoolItemArrayBase_Impl::iterator ppHtArr;
+ size_t n, nCount = (*ppItemArr)->size();
for ( n = (*ppItemArr)->nFirstFree,
- ppHtArr = (SfxPoolItem**)(*ppItemArr)->GetData() + n;
+ ppHtArr = (*ppItemArr)->begin() + n;
n < nCount;
++ppHtArr, ++n )
if ( !*ppHtArr )
{
ppFree = ppHtArr;
+ ppFreeIsSet = TRUE;
break;
}
@@ -853,9 +848,9 @@ const SfxPoolItem& SfxItemPool::Put( const SfxPoolItem& rItem, USHORT nWhich )
#endif
#endif
AddRef( *pNewItem, pImp->nInitRefCount );
- const SfxPoolItem* pTemp = pNewItem;
- if ( !ppFree )
- (*ppItemArr)->Insert( pTemp, (*ppItemArr)->Count() );
+ SfxPoolItem* pTemp = pNewItem;
+ if ( ppFreeIsSet == FALSE )
+ (*ppItemArr)->push_back( pTemp );
else
{
DBG_ASSERT( *ppFree == 0, "using surrogate in use" );
@@ -915,8 +910,8 @@ void SfxItemPool::Remove( const SfxPoolItem& rItem )
// Item im eigenen Pool suchen
SfxPoolItemArray_Impl** ppItemArr = (pImp->ppPoolItems + nIndex);
SFX_ASSERT( *ppItemArr, rItem.Which(), "removing Item not in Pool" );
- SfxPoolItem** ppHtArr = (SfxPoolItem**)(*ppItemArr)->GetData();
- for( USHORT n = (*ppItemArr)->Count(); n; ++ppHtArr, --n )
+ SfxPoolItemArrayBase_Impl::iterator ppHtArr = (*ppItemArr)->begin();
+ for( size_t n = (*ppItemArr)->size(); n; ++ppHtArr, --n )
if( *ppHtArr == &rItem )
{
if ( (*ppHtArr)->GetRefCount() ) //!
@@ -928,7 +923,7 @@ void SfxItemPool::Remove( const SfxPoolItem& rItem )
}
// ggf. kleinstmoegliche freie Position merken
- USHORT nPos = (*ppItemArr)->Count() - n;
+ size_t nPos = (*ppItemArr)->size() - n;
if ( (*ppItemArr)->nFirstFree > nPos )
(*ppItemArr)->nFirstFree = nPos;
@@ -1009,24 +1004,24 @@ void SfxItemPool::FillItemIdRanges_Impl( USHORT*& pWhichRanges ) const
// -----------------------------------------------------------------------
-const SfxPoolItem *SfxItemPool::GetItem(USHORT nWhich, USHORT nOfst) const
+const SfxPoolItem *SfxItemPool::GetItem2(USHORT nWhich, sal_uInt32 nOfst) const
{
DBG_CHKTHIS(SfxItemPool, 0);
if ( !IsInRange(nWhich) )
{
if ( pSecondary )
- return pSecondary->GetItem( nWhich, nOfst );
+ return pSecondary->GetItem2( nWhich, nOfst );
SFX_ASSERT( 0, nWhich, "unknown Which-Id - cannot resolve surrogate" );
return 0;
}
// dflt-Attribut?
- if ( nOfst == SFX_ITEMS_STATICDEFAULT )
+ if ( nOfst == SFX_ITEMS_DEFAULT )
return *(ppStaticDefaults + GetIndex_Impl(nWhich));
SfxPoolItemArray_Impl* pItemArr = *(pImp->ppPoolItems + GetIndex_Impl(nWhich));
- if( pItemArr && nOfst < pItemArr->Count() )
+ if( pItemArr && nOfst < pItemArr->size() )
return (*pItemArr)[nOfst];
return 0;
@@ -1034,21 +1029,21 @@ const SfxPoolItem *SfxItemPool::GetItem(USHORT nWhich, USHORT nOfst) const
// -----------------------------------------------------------------------
-USHORT SfxItemPool::GetItemCount(USHORT nWhich) const
+sal_uInt32 SfxItemPool::GetItemCount2(USHORT nWhich) const
{
DBG_CHKTHIS(SfxItemPool, 0);
if ( !IsInRange(nWhich) )
{
if ( pSecondary )
- return pSecondary->GetItemCount( nWhich );
+ return pSecondary->GetItemCount2( nWhich );
SFX_ASSERT( 0, nWhich, "unknown Which-Id - cannot resolve surrogate" );
return 0;
}
SfxPoolItemArray_Impl* pItemArr = *(pImp->ppPoolItems + GetIndex_Impl(nWhich));
if ( pItemArr )
- return pItemArr->Count();
+ return pItemArr->size();
return 0;
}
diff --git a/svl/source/items/poolcach.cxx b/svl/source/items/poolcach.cxx
index b918add10f0f..fee18724bcc2 100644
--- a/svl/source/items/poolcach.cxx
+++ b/svl/source/items/poolcach.cxx
@@ -41,18 +41,6 @@
DBG_NAME(SfxItemPoolCache)
-
-//------------------------------------------------------------------------
-
-struct SfxItemModifyImpl
-{
- const SfxSetItem *pOrigItem;
- SfxSetItem *pPoolItem;
-};
-
-SV_DECL_VARARR( SfxItemModifyArr_Impl, SfxItemModifyImpl, 8, 8 )
-SV_IMPL_VARARR( SfxItemModifyArr_Impl, SfxItemModifyImpl);
-
//------------------------------------------------------------------------
SfxItemPoolCache::SfxItemPoolCache( SfxItemPool *pItemPool,
@@ -84,7 +72,7 @@ SfxItemPoolCache::SfxItemPoolCache( SfxItemPool *pItemPool,
SfxItemPoolCache::~SfxItemPoolCache()
{
DBG_DTOR(SfxItemPoolCache, 0);
- for ( USHORT nPos = 0; nPos < pCache->Count(); ++nPos ) {
+ for ( size_t nPos = 0; nPos < pCache->size(); ++nPos ) {
pPool->Remove( *(*pCache)[nPos].pPoolItem );
pPool->Remove( *(*pCache)[nPos].pOrigItem );
}
@@ -103,8 +91,8 @@ const SfxSetItem& SfxItemPoolCache::ApplyTo( const SfxSetItem &rOrigItem, BOOL b
DBG_ASSERT( IsDefaultItem( &rOrigItem ) || IsPooledItem( &rOrigItem ),
"original not in pool" );
- // Suchen, ob diese Transformations schon einmal vorkam
- for ( USHORT nPos = 0; nPos < pCache->Count(); ++nPos )
+ // Find whether this Transformations ever occurred
+ for ( size_t nPos = 0; nPos < pCache->size(); ++nPos )
{
SfxItemModifyImpl &rMapEntry = (*pCache)[nPos];
if ( rMapEntry.pOrigItem == &rOrigItem )
@@ -143,7 +131,7 @@ const SfxSetItem& SfxItemPoolCache::ApplyTo( const SfxSetItem &rOrigItem, BOOL b
SfxItemModifyImpl aModify;
aModify.pOrigItem = &rOrigItem;
aModify.pPoolItem = (SfxSetItem*) pNewPoolItem;
- pCache->Insert( aModify, pCache->Count() );
+ pCache->push_back( aModify );
DBG_ASSERT( !pItemToPut ||
&pNewPoolItem->GetItemSet().Get( pItemToPut->Which() ) == pItemToPut,
diff --git a/svl/source/items/poolio.cxx b/svl/source/items/poolio.cxx
index 6aeb64d76d1a..8bf8f2b2434b 100644
--- a/svl/source/items/poolio.cxx
+++ b/svl/source/items/poolio.cxx
@@ -178,10 +178,10 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const
// Version-Maps
{
SfxMultiVarRecordWriter aVerRec( &rStream, SFX_ITEMPOOL_REC_VERSIONMAP, 0 );
- for ( USHORT nVerNo = 0; nVerNo < pImp->aVersions.Count(); ++nVerNo )
+ for ( size_t nVerNo = 0; nVerNo < pImp->aVersions.size(); ++nVerNo )
{
aVerRec.NewContent();
- SfxPoolVersion_Impl *pVer = pImp->aVersions[nVerNo];
+ SfxPoolVersion_ImplPtr pVer = pImp->aVersions[nVerNo];
rStream << pVer->_nVer << pVer->_nStart << pVer->_nEnd;
USHORT nCount = pVer->_nEnd - pVer->_nStart + 1;
USHORT nNewWhich = 0;
@@ -207,7 +207,7 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const
SfxPoolItemArray_Impl **pArr = pImp->ppPoolItems;
SfxPoolItem **ppDefItem = ppStaticDefaults;
const USHORT nSize = GetSize_Impl();
- for ( USHORT i = 0; i < nSize && !rStream.GetError(); ++i, ++pArr, ++ppDefItem )
+ for ( size_t i = 0; i < nSize && !rStream.GetError(); ++i, ++pArr, ++ppDefItem )
{
// Version des Items feststellen
USHORT nItemVersion = (*ppDefItem)->GetVersion( _nFileFormatVersion );
@@ -229,16 +229,16 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const
aWhichIdsRec.NewContent(nSlotId, 0);
rStream << (*ppDefItem)->Which();
rStream << nItemVersion;
- const USHORT nCount = (*pArr)->Count();
- DBG_ASSERT(nCount, "ItemArr ist leer");
+ const sal_uInt32 nCount = ::std::min<size_t>( (*pArr)->size(), SAL_MAX_UINT32 );
+ DBG_ASSERT(nCount, "ItemArr is empty");
rStream << nCount;
// Items an sich schreiben
SfxMultiMixRecordWriter aItemsRec( &rStream, SFX_ITEMPOOL_REC_ITEMS, 0 );
- for ( USHORT j = 0; j < nCount; ++j )
+ for ( size_t j = 0; j < nCount; ++j )
{
// Item selbst besorgen
- const SfxPoolItem *pItem = (*pArr)->GetObject(j);
+ const SfxPoolItem *pItem = (*pArr)->operator[](j);
if ( pItem && pItem->GetRefCount() ) //! siehe anderes MI-REF
{
aItemsRec.NewContent(j, 'X' );
@@ -353,8 +353,8 @@ void SfxItemPool::LoadCompleted()
if ( *ppItemArr )
{
// "uber alle Items mit dieser Which-Id iterieren
- SfxPoolItem** ppHtArr = (SfxPoolItem**)(*ppItemArr)->GetData();
- for( USHORT n = (*ppItemArr)->Count(); n; --n, ++ppHtArr )
+ SfxPoolItemArrayBase_Impl::iterator ppHtArr = (*ppItemArr)->begin();
+ for( size_t n = (*ppItemArr)->size(); n; --n, ++ppHtArr )
if (*ppHtArr)
{
#ifdef DBG_UTIL
@@ -382,15 +382,15 @@ void SfxItemPool::LoadCompleted()
//============================================================================
// This had to be moved to a method of its own to keep Solaris GCC happy:
void SfxItemPool::readTheItems (
- SvStream & rStream, USHORT nItemCount, USHORT nVersion,
+ SvStream & rStream, sal_uInt32 nItemCount, USHORT nVersion,
SfxPoolItem * pDefItem, SfxPoolItemArray_Impl ** ppArr)
{
SfxMultiRecordReader aItemsRec( &rStream, SFX_ITEMPOOL_REC_ITEMS );
- SfxPoolItemArray_Impl *pNewArr = new SfxPoolItemArray_Impl( nItemCount );
+ SfxPoolItemArray_Impl *pNewArr = new SfxPoolItemArray_Impl();
SfxPoolItem *pItem = 0;
- USHORT n, nLastSurrogate = USHORT(-1);
+ ULONG n, nLastSurrogate = ULONG(-1);
while (aItemsRec.GetContent())
{
// n"achstes Surrogat holen
@@ -400,7 +400,7 @@ void SfxItemPool::readTheItems (
// fehlende auff"ullen
for ( pItem = 0, n = nLastSurrogate+1; n < nSurrogate; ++n )
- pNewArr->C40_INSERT(SfxPoolItem, pItem, n);
+ pNewArr->push_back( (SfxPoolItem*) pItem );
nLastSurrogate = nSurrogate;
// Ref-Count und Item laden
@@ -408,7 +408,7 @@ void SfxItemPool::readTheItems (
rStream >> nRef;
pItem = pDefItem->Create(rStream, nVersion);
- pNewArr->C40_INSERT(SfxPoolItem, pItem, nSurrogate);
+ pNewArr->push_back( (SfxPoolItem*) pItem );
if ( !bPersistentRefCounts )
// bis <SfxItemPool::LoadCompleted()> festhalten
@@ -424,33 +424,32 @@ void SfxItemPool::readTheItems (
// fehlende auff"ullen
for ( pItem = 0, n = nLastSurrogate+1; n < nItemCount; ++n )
- pNewArr->C40_INSERT(SfxPoolItem, pItem, n);
+ pNewArr->push_back( (SfxPoolItem*) pItem );
SfxPoolItemArray_Impl *pOldArr = *ppArr;
*ppArr = pNewArr;
// die Items merken, die schon im Pool sind
- int bEmpty = TRUE;
+ bool bEmpty = true;
if ( 0 != pOldArr )
- for ( n = 0; bEmpty && n < pOldArr->Count(); ++n )
- bEmpty = pOldArr->GetObject(n) == 0;
+ for ( n = 0; bEmpty && n < pOldArr->size(); ++n )
+ bEmpty = pOldArr->operator[](n) == 0;
DBG_ASSERTWARNING( bEmpty, "loading non-empty pool" );
if ( !bEmpty )
{
// f"ur alle alten suchen, ob ein gleiches neues existiert
- for ( USHORT nOld = 0; nOld < pOldArr->Count(); ++nOld )
+ for ( size_t nOld = 0; nOld < pOldArr->size(); ++nOld )
{
SfxPoolItem *pOldItem = (*pOldArr)[nOld];
if ( pOldItem )
{
- USHORT nFree = USHRT_MAX;
- int bFound = FALSE;
- USHORT nCount = (*ppArr)->Count();
- for ( USHORT nNew = nCount; !bFound && nNew--; )
+ sal_uInt32 nFree = SAL_MAX_UINT32;
+ bool bFound = false;
+ for ( size_t nNew = (*ppArr)->size(); nNew--; )
{
// geladenes Item
SfxPoolItem *&rpNewItem =
- (SfxPoolItem*&)(*ppArr)->GetData()[nNew];
+ (SfxPoolItem*&)(*ppArr)->operator[](nNew);
// surrogat unbenutzt?
if ( !rpNewItem )
@@ -464,17 +463,18 @@ void SfxItemPool::readTheItems (
SetRefCount( *rpNewItem, 0 );
delete rpNewItem;
rpNewItem = pOldItem;
- bFound = TRUE;
+ bFound = true;
+ break;
}
}
// vorhervorhandene, nicht geladene uebernehmen
if ( !bFound )
{
- if ( nFree != USHRT_MAX )
- (SfxPoolItem*&)(*ppArr)->GetData()[nFree] = pOldItem;
+ if ( nFree != SAL_MAX_UINT32 )
+ (SfxPoolItem*&)(*ppArr)->operator[](nFree) = pOldItem;
else
- (*ppArr)->C40_INSERT( SfxPoolItem, pOldItem, nCount );
+ (*ppArr)->push_back( (SfxPoolItem*) pOldItem );
}
}
}
@@ -495,14 +495,14 @@ SvStream &SfxItemPool::Load(SvStream &rStream)
// "uber alle Which-Werte iterieren
SfxPoolItemArray_Impl** ppItemArr = pImp->ppPoolItems;
- for( USHORT nArrCnt = GetSize_Impl(); nArrCnt; --nArrCnt, ++ppItemArr )
+ for( size_t nArrCnt = GetSize_Impl(); nArrCnt; --nArrCnt, ++ppItemArr )
{
// ist "uberhaupt ein Item mit dem Which-Wert da?
if ( *ppItemArr )
{
// "uber alle Items mit dieser Which-Id iterieren
- SfxPoolItem** ppHtArr = (SfxPoolItem**)(*ppItemArr)->GetData();
- for( USHORT n = (*ppItemArr)->Count(); n; --n, ++ppHtArr )
+ SfxPoolItemArrayBase_Impl::iterator ppHtArr = (*ppItemArr)->begin();
+ for( size_t n = (*ppItemArr)->size(); n; --n, ++ppHtArr )
if (*ppHtArr)
{
#ifdef DBG_UTIL
@@ -611,10 +611,10 @@ SvStream &SfxItemPool::Load(SvStream &rStream)
rStream >> nVersion >> nHStart >> nHEnd;
USHORT nCount = nHEnd - nHStart + 1;
- // Version neuer als bekannt?
- if ( nVerNo >= pImp->aVersions.Count() )
+ // Is new version is known?
+ if ( nVerNo >= pImp->aVersions.size() )
{
- // neue Version hinzufuegen
+ // Add new Version
USHORT *pMap = new USHORT[nCount];
for ( USHORT n = 0; n < nCount; ++n )
rStream >> pMap[n];
@@ -632,7 +632,8 @@ SvStream &SfxItemPool::Load(SvStream &rStream)
while ( aWhichIdsRec.GetContent() )
{
// SlotId, Which-Id und Item-Version besorgen
- USHORT nCount, nVersion, nWhich;
+ sal_uInt32 nCount;
+ USHORT nVersion, nWhich;
//!USHORT nSlotId = aWhichIdsRec.GetContentTag();
rStream >> nWhich;
if ( pImp->nLoadingVersion != pImp->nVersion )
@@ -799,10 +800,10 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream)
USHORT nCount = nHEnd - nHStart + 1;
USHORT nBytes = (nCount)*sizeof(USHORT);
- // Version neuer als bekannt?
- if ( nVerNo >= pImp->aVersions.Count() )
+ // Is new version is known?
+ if ( nVerNo >= pImp->aVersions.size() )
{
- // neue Version hinzufuegen
+ // Add new Version
USHORT *pMap = new USHORT[nCount];
for ( USHORT n = 0; n < nCount; ++n )
rStream >> pMap[n];
@@ -849,7 +850,7 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream)
USHORT nIndex = GetIndex_Impl(nWhich);
ppArr = pImp->ppPoolItems + nIndex;
- pNewArr = new SfxPoolItemArray_Impl( nCount );
+ pNewArr = new SfxPoolItemArray_Impl();
pDefItem = *(ppStaticDefaults + nIndex);
}
@@ -897,8 +898,8 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream)
AddRef(*pItem, nRef);
}
}
-
- pNewArr->C40_INSERT( SfxPoolItem, pItem, j);
+ //pNewArr->insert( pItem, j );
+ pNewArr->push_back( (SfxPoolItem*) pItem );
// restliche gespeicherte Laenge skippen (neueres Format)
nLastPos = rStream.Tell();
@@ -924,24 +925,23 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream)
// die Items merken, die schon im Pool sind
int bEmpty = TRUE;
if ( 0 != pOldArr )
- for ( USHORT n = 0; bEmpty && n < pOldArr->Count(); ++n )
- bEmpty = pOldArr->GetObject(n) == 0;
+ for ( size_t n = 0; bEmpty && n < pOldArr->size(); ++n )
+ bEmpty = pOldArr->operator[](n) == 0;
DBG_ASSERTWARNING( bEmpty, "loading non-empty pool" );
if ( !bEmpty )
{
// f"ur alle alten suchen, ob ein gleiches neues existiert
- for ( USHORT nOld = 0; nOld < pOldArr->Count(); ++nOld )
+ for ( size_t nOld = 0; nOld < pOldArr->size(); ++nOld )
{
SfxPoolItem *pOldItem = (*pOldArr)[nOld];
if ( pOldItem )
{
- int bFound = FALSE;
- for ( USHORT nNew = 0;
- !bFound && nNew < (*ppArr)->Count();
- ++nNew )
+ bool bFound = false;
+ for ( size_t nNew = 0;
+ nNew < (*ppArr)->size(); ++nNew )
{
SfxPoolItem *&rpNewItem =
- (SfxPoolItem*&)(*ppArr)->GetData()[nNew];
+ (SfxPoolItem*&)(*ppArr)->operator[](nNew);
if ( rpNewItem && *rpNewItem == *pOldItem )
{
@@ -949,11 +949,11 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream)
SetRefCount( *rpNewItem, 0 );
delete rpNewItem;
rpNewItem = pOldItem;
- bFound = TRUE;
+ bFound = true;
SFX_TRACE( "reusing item", pOldItem );
+ break;
}
}
- //! DBG_ASSERT( bFound, "old-item not found in file" );
if ( !bFound )
{
SFX_TRACE( "item not found: ", pOldItem );
@@ -1039,7 +1039,7 @@ const SfxPoolItem* SfxItemPool::LoadSurrogate
L"adt Surrogat aus 'rStream' und liefert das dadurch in 'rRefPool'
repr"asentierte SfxPoolItem zu"ruck. Ist das im Stream befindliche
Surrogat == SFX_ITEMS_DIRECT (!SFX_ITEM_POOLABLE) wird 0 zur"uckgegeben,
- das Item ist direkt aus dem Stream zu laden. Bei 0xfff0 (SFX_ITEMS_NULL)
+ das Item ist direkt aus dem Stream zu laden. Bei 0xfffffff0 (SFX_ITEMS_NULL)
wird auch 0 zurueckgegeben und rWhich auf 0 gesetzt, das Item ist nicht
verfuegbar.
@@ -1071,15 +1071,15 @@ const SfxPoolItem* SfxItemPool::LoadSurrogate
*/
{
- // erstmal das Surrogat lesen
- USHORT nSurrogat;
+ // Read the first surrogate
+ sal_uInt32 nSurrogat;
rStream >> nSurrogat;
- // direkt gespeichertes Item?
+ // Is item stored directly?
if ( SFX_ITEMS_DIRECT == nSurrogat )
return 0;
- // nicht vorhandenes Item?
+ // Item does not exist?
if ( SFX_ITEMS_NULL == nSurrogat )
{
rWhich = 0;
@@ -1114,13 +1114,13 @@ const SfxPoolItem* SfxItemPool::LoadSurrogate
if ( pTarget->IsInRange(rWhich) )
{
// dflt-Attribut?
- if ( SFX_ITEMS_STATICDEFAULT == nSurrogat )
+ if ( SFX_ITEMS_DEFAULT == nSurrogat )
return *(pTarget->ppStaticDefaults +
pTarget->GetIndex_Impl(rWhich));
SfxPoolItemArray_Impl* pItemArr = *(pTarget->pImp->ppPoolItems +
pTarget->GetIndex_Impl(rWhich));
- pItem = pItemArr && nSurrogat < pItemArr->Count()
+ pItem = pItemArr && nSurrogat < pItemArr->size()
? (*pItemArr)[nSurrogat]
: 0;
if ( !pItem )
@@ -1184,17 +1184,17 @@ FASTBOOL SfxItemPool::StoreSurrogate
FASTBOOL bRealSurrogate = IsItemFlag(*pItem, SFX_ITEM_POOLABLE);
rStream << ( bRealSurrogate
? GetSurrogate( pItem )
- : (UINT16) SFX_ITEMS_DIRECT );
+ : SFX_ITEMS_DIRECT );
return bRealSurrogate;
}
- rStream << (UINT16) SFX_ITEMS_NULL;
+ rStream << SFX_ITEMS_NULL;
return TRUE;
}
// -----------------------------------------------------------------------
-USHORT SfxItemPool::GetSurrogate(const SfxPoolItem *pItem) const
+sal_uInt32 SfxItemPool::GetSurrogate(const SfxPoolItem *pItem) const
{
DBG_CHKTHIS(SfxItemPool, 0);
DBG_ASSERT( pItem, "no 0-Pointer Surrogate" );
@@ -1210,18 +1210,18 @@ USHORT SfxItemPool::GetSurrogate(const SfxPoolItem *pItem) const
// Pointer auf static- oder pool-dflt-Attribut?
if( IsStaticDefaultItem(pItem) || IsPoolDefaultItem(pItem) )
- return SFX_ITEMS_STATICDEFAULT;
+ return SFX_ITEMS_DEFAULT;
SfxPoolItemArray_Impl* pItemArr = *(pImp->ppPoolItems + GetIndex_Impl(pItem->Which()));
- DBG_ASSERT(pItemArr, "ItemArr nicht vorhanden");
- const USHORT nCount = pItemArr->Count();
- for ( USHORT i = 0; i < nCount; ++i )
+ DBG_ASSERT(pItemArr, "ItemArr is not available");
+
+ for ( size_t i = 0; i < pItemArr->size(); ++i )
{
const SfxPoolItem *p = (*pItemArr)[i];
if ( p == pItem )
return i;
}
- SFX_ASSERT( 0, pItem->Which(), "Item nicht im Pool");
+ SFX_ASSERT( 0, pItem->Which(), "Item not in the pool");
return SFX_ITEMS_NULL;
}
@@ -1326,10 +1326,10 @@ void SfxItemPool::SetVersionMap
*/
{
- // neuen Map-Eintrag erzeugen und einf"ugen
- const SfxPoolVersion_Impl *pVerMap = new SfxPoolVersion_Impl(
- nVer, nOldStart, nOldEnd, pOldWhichIdTab );
- pImp->aVersions.Insert( pVerMap, pImp->aVersions.Count() );
+ // create new map entry to insert
+ const SfxPoolVersion_ImplPtr pVerMap = SfxPoolVersion_ImplPtr( new SfxPoolVersion_Impl(
+ nVer, nOldStart, nOldEnd, pOldWhichIdTab ) );
+ pImp->aVersions.push_back( pVerMap );
DBG_ASSERT( nVer > pImp->nVersion, "Versions not sorted" );
pImp->nVersion = nVer;
@@ -1398,9 +1398,9 @@ USHORT SfxItemPool::GetNewWhich
if ( nDiff > 0 )
{
// von der Top-Version bis runter zur File-Version stufenweise mappen
- for ( USHORT nMap = pImp->aVersions.Count(); nMap > 0; --nMap )
+ for ( size_t nMap = pImp->aVersions.size(); nMap > 0; --nMap )
{
- SfxPoolVersion_Impl *pVerInfo = pImp->aVersions[nMap-1];
+ SfxPoolVersion_ImplPtr pVerInfo = pImp->aVersions[nMap-1];
if ( pVerInfo->_nVer > pImp->nVersion )
{ USHORT nOfs;
USHORT nCount = pVerInfo->_nEnd - pVerInfo->_nStart + 1;
@@ -1424,9 +1424,9 @@ USHORT SfxItemPool::GetNewWhich
else if ( nDiff < 0 )
{
// von der File-Version bis zur aktuellen Version stufenweise mappen
- for ( USHORT nMap = 0; nMap < pImp->aVersions.Count(); ++nMap )
+ for ( size_t nMap = 0; nMap < pImp->aVersions.size(); ++nMap )
{
- SfxPoolVersion_Impl *pVerInfo = pImp->aVersions[nMap];
+ SfxPoolVersion_ImplPtr pVerInfo = pImp->aVersions[nMap];
if ( pVerInfo->_nVer > pImp->nLoadingVersion )
{
DBG_ASSERT( nFileWhich >= pVerInfo->_nStart &&
@@ -1637,7 +1637,8 @@ const SfxPoolItem* SfxItemPool::LoadItem( SvStream &rStream, FASTBOOL bDirect,
else
{
// WID in der Version nicht vorhanden => ueberspringen
- USHORT nSurro, nVersion, nLen;
+ sal_uInt32 nSurro;
+ USHORT nVersion, nLen;
rStream >> nSurro;
if ( SFX_ITEMS_DIRECT == nSurro )
{
diff --git a/svl/source/items/whassert.hxx b/svl/source/items/whassert.hxx
index 9933294b4d86..237cf73f6c7f 100644
--- a/svl/source/items/whassert.hxx
+++ b/svl/source/items/whassert.hxx
@@ -42,7 +42,7 @@
ByteString aMsg( sMessage ); \
aMsg.Append(RTL_CONSTASCII_STRINGPARAM("\nwith Id/Pos: ")); \
aMsg += ByteString::CreateFromInt32( nId ); \
- DbgOut( aMsg.GetBuffer(), DBG_OUT_ERROR, __FILE__, __LINE__); \
+ DbgError( aMsg.GetBuffer(), __FILE__, __LINE__); \
} \
} \
}
diff --git a/svl/source/memtools/svarray.cxx b/svl/source/memtools/svarray.cxx
index b2184442ea0e..622533dceae2 100644
--- a/svl/source/memtools/svarray.cxx
+++ b/svl/source/memtools/svarray.cxx
@@ -61,7 +61,6 @@
#include <tools/debug.hxx>
SV_IMPL_VARARR(SvPtrarr,VoidPtr)
-SV_IMPL_VARARR_PLAIN(SvPtrarrPlain,VoidPtr)
USHORT SvPtrarr::GetPos( const VoidPtr& aElement ) const
{ USHORT n;
@@ -69,25 +68,12 @@ USHORT SvPtrarr::GetPos( const VoidPtr& aElement ) const
return ( n >= nA ? USHRT_MAX : n );
}
-USHORT SvPtrarrPlain::GetPos( const VoidPtr aElement ) const
-{ USHORT n;
- for( n=0; n < nA && *(GetData()+n) != aElement; ) n++;
- return ( n >= nA ? USHRT_MAX : n );
-}
-
-
-SV_IMPL_VARARR( SvBools, BOOL )
-SV_IMPL_VARARR( SvBytes, BYTE )
SV_IMPL_VARARR( SvULongs, ULONG )
SV_IMPL_VARARR( SvUShorts, USHORT )
SV_IMPL_VARARR( SvLongs, long)
-SV_IMPL_VARARR( SvShorts, short )
SV_IMPL_VARARR_SORT( SvULongsSort, ULONG )
SV_IMPL_VARARR_SORT( SvLongsSort, long )
-SV_IMPL_VARARR_SORT( SvXub_StrLensSort, xub_StrLen )
-
-SV_IMPL_VARARR( SvXub_StrLens, xub_StrLen )
SV_IMPL_PTRARR( SvStrings, StringPtr )
SV_IMPL_PTRARR( SvStringsDtor, StringPtr )
diff --git a/svl/source/misc/lngmisc.cxx b/svl/source/misc/lngmisc.cxx
index 2203cc08458e..488e317c6f58 100644
--- a/svl/source/misc/lngmisc.cxx
+++ b/svl/source/misc/lngmisc.cxx
@@ -27,6 +27,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svl.hxx"
+
#include <lngmisc.hxx>
#include <tools/solar.h>
#include <tools/string.hxx>
@@ -132,6 +133,38 @@ BOOL ReplaceControlChars( rtl::OUString &rTxt, sal_Char /*aRplcChar*/ )
return bModified;
}
+
+String GetThesaurusReplaceText( const String &rText )
+{
+ // The strings for synonyms returned by the thesaurus sometimes have some
+ // explanation text put in between '(' and ')' or a trailing '*'.
+ // These parts should not be put in the ReplaceEdit Text that may get
+ // inserted into the document. Thus we strip them from the text.
+
+ String aText( rText );
+
+ xub_StrLen nPos = aText.Search( sal_Unicode('(') );
+ while (STRING_NOTFOUND != nPos)
+ {
+ xub_StrLen nEnd = aText.Search( sal_Unicode(')'), nPos );
+ if (STRING_NOTFOUND != nEnd)
+ aText.Erase( nPos, nEnd-nPos+1 );
+ else
+ break;
+ nPos = aText.Search( sal_Unicode('(') );
+ }
+
+ nPos = aText.Search( sal_Unicode('*') );
+ if (STRING_NOTFOUND != nPos)
+ aText.Erase( nPos );
+
+ // remove any possible remaining ' ' that may confuse the thesaurus
+ // when it gets called with the text
+ aText.EraseLeadingAndTrailingChars( sal_Unicode(' ') );
+
+ return aText;
+}
+
///////////////////////////////////////////////////////////////////////////
} // namespace linguistic
diff --git a/svl/source/numbers/nbdll.cxx b/svl/source/numbers/nbdll.cxx
deleted file mode 100644
index b93eda3e7f37..000000000000
--- a/svl/source/numbers/nbdll.cxx
+++ /dev/null
@@ -1,79 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svl.hxx"
-
-#ifdef WIN
-#include <svwin.h>
-
-#ifndef _SYSDEP_HXX
-#include <sysdep.hxx>
-#endif
-
-// Statische DLL-Verwaltungs-Variablen
-static HINSTANCE hDLLInst = 0; // HANDLE der DLL
-
-
-/***************************************************************************
-|*
-|* LibMain()
-|*
-|* Beschreibung Initialisierungsfunktion der DLL
-|* Ersterstellung TH 05.05.93
-|* Letzte Aenderung TH 05.05.93
-|*
-***************************************************************************/
-
-extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR )
-{
-#ifndef WNT
- if ( nHeap )
- UnlockData( 0 );
-#endif
-
- hDLLInst = hDLL;
-
- return TRUE;
-}
-
-/***************************************************************************
-|*
-|* WEP()
-|*
-|* Beschreibung DLL-Deinitialisierung
-|* Ersterstellung TH 05.05.93
-|* Letzte Aenderung TH 05.05.93
-|*
-***************************************************************************/
-
-extern "C" int CALLBACK WEP( int )
-{
- return 1;
-}
-
-#endif
diff --git a/svl/source/passwordcontainer/makefile.mk b/svl/source/passwordcontainer/makefile.mk
index d9eb9615cf80..626a6ffc5830 100644
--- a/svl/source/passwordcontainer/makefile.mk
+++ b/svl/source/passwordcontainer/makefile.mk
@@ -60,3 +60,11 @@ DEF1NAME= $(SHL1TARGET)
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/passwordcontainer.component
+
+$(MISC)/passwordcontainer.component .ERRREMOVE : \
+ $(SOLARENV)/bin/createcomponent.xslt passwordcontainer.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt passwordcontainer.component
diff --git a/svl/source/passwordcontainer/passwordcontainer.component b/svl/source/passwordcontainer/passwordcontainer.component
new file mode 100644
index 000000000000..42eb47cf14dd
--- /dev/null
+++ b/svl/source/passwordcontainer/passwordcontainer.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="stardiv.svl.PasswordContainer">
+ <service name="com.sun.star.task.PasswordContainer"/>
+ </implementation>
+</component>
diff --git a/svl/source/passwordcontainer/passwordcontainer.cxx b/svl/source/passwordcontainer/passwordcontainer.cxx
index 7db18c65db1f..6e92d390eea9 100644
--- a/svl/source/passwordcontainer/passwordcontainer.cxx
+++ b/svl/source/passwordcontainer/passwordcontainer.cxx
@@ -1543,24 +1543,6 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment (
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo (
- void * /* pServiceManager */, void * pRegistryKey)
-{
- if (pRegistryKey)
- {
- Reference< XRegistryKey > xRegistryKey (
- reinterpret_cast< XRegistryKey* >( pRegistryKey ));
- Reference< XRegistryKey > xNewKey;
-
- xNewKey = xRegistryKey->createKey(
- ::rtl::OUString::createFromAscii( "/stardiv.svl.PasswordContainer/UNO/SERVICES" ));
- xNewKey->createKey( ::rtl::OUString::createFromAscii("com.sun.star.task.PasswordContainer"));
-
- return sal_True;
- }
- return sal_False;
-}
-
SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory (
const sal_Char * pImplementationName, void * pServiceManager, void * /* pRegistryKey */)
{
diff --git a/svl/source/svdde/ddedata.cxx b/svl/source/svdde/ddedata.cxx
index ba67d451be34..369306c22874 100644
--- a/svl/source/svdde/ddedata.cxx
+++ b/svl/source/svdde/ddedata.cxx
@@ -41,10 +41,6 @@
#include <osl/thread.h>
-#if defined( WIN ) && defined( MSC )
-#pragma code_seg( "SVDDE_MISC_CODE" )
-#endif
-
// --- DdeData::DdeData() ------------------------------------------
DdeData::DdeData()
@@ -164,10 +160,10 @@ ULONG DdeData::GetExternalFormat( ULONG nFmt )
default:
{
-#if defined(WNT) || defined(WIN) || defined( PM2 )
+#if defined(WNT) || defined( PM2 )
String aName( SotExchange::GetFormatName( nFmt ) );
-#if defined(WNT) || defined(WIN)
+#if defined(WNT)
if( aName.Len() )
nFmt = RegisterClipboardFormat( reinterpret_cast<LPCWSTR>(aName.GetBuffer()) );
@@ -203,7 +199,7 @@ ULONG DdeData::GetInternalFormat( ULONG nFmt )
break;
default:
-#if defined(WIN) || defined(WNT)
+#if defined(WNT)
if( nFmt >= CF_MAX )
{
TCHAR szName[ 256 ];
diff --git a/svl/source/svdde/ddedll.cxx b/svl/source/svdde/ddedll.cxx
deleted file mode 100644
index a71662dd5e63..000000000000
--- a/svl/source/svdde/ddedll.cxx
+++ /dev/null
@@ -1,64 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svl.hxx"
-#ifdef WIN
-
-
-#include <sysdep.hxx> // included svwin.h
-
-// Statische DLL-Verwaltungs-Variablen
-static HINSTANCE hDLLInst = 0; // HANDLE der DLL
-
-/***************************************************************************
-|* LibMain()
-|* Beschreibung Initialisierungsfunktion der DLL
-***************************************************************************/
-extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR )
-{
-#ifndef WNT
- if ( nHeap )
- UnlockData( 0 );
-#endif
-
- hDLLInst = hDLL;
-
- return TRUE;
-}
-
-/***************************************************************************
-|* WEP()
-|* Beschreibung DLL-Deinitialisierung
-***************************************************************************/
-extern "C" int CALLBACK WEP( int )
-{
- return 1;
-}
-
-#endif
-
diff --git a/svl/source/svdde/ddestrg.cxx b/svl/source/svdde/ddestrg.cxx
index 4f0e2464a276..007c9f56c544 100644
--- a/svl/source/svdde/ddestrg.cxx
+++ b/svl/source/svdde/ddestrg.cxx
@@ -33,10 +33,6 @@
#include "ddeimp.hxx"
#include <svl/svdde.hxx>
-#if defined( WIN ) && defined( MSC )
-#pragma code_seg( "SVDDE_MISC_CODE" )
-#endif
-
// --- DdeString::DdeString() --------------------------------------
DdeString::DdeString( DWORD hDdeInst, const sal_Unicode* p ) :
diff --git a/svl/source/uno/registerservices.cxx b/svl/source/uno/registerservices.cxx
index ab01d308c2da..8edbccc2d435 100644
--- a/svl/source/uno/registerservices.cxx
+++ b/svl/source/uno/registerservices.cxx
@@ -60,37 +60,6 @@ SVL_DLLPUBLIC void SAL_CALL component_getImplementationEnvironment (
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-SVL_DLLPUBLIC sal_Bool SAL_CALL component_writeInfo (
- void * /* _pServiceManager */, void * _pRegistryKey)
-{
- if (_pRegistryKey)
- {
- Reference< css::registry::XRegistryKey > xRegistryKey (
- reinterpret_cast< css::registry::XRegistryKey* >(_pRegistryKey));
- Reference< css::registry::XRegistryKey > xNewKey;
-
- xNewKey = xRegistryKey->createKey (
- OUString::createFromAscii(
- "/com.sun.star.uno.util.numbers.SvNumberFormatsSupplierServiceObject/UNO/SERVICES" ) );
- xNewKey->createKey (
- OUString::createFromAscii( "com.sun.star.util.NumberFormatsSupplier" ) );
-
- xNewKey = xRegistryKey->createKey (
- OUString::createFromAscii(
- "/com.sun.star.uno.util.numbers.SvNumberFormatterServiceObject/UNO/SERVICES" ) );
- xNewKey->createKey (
- OUString::createFromAscii( "com.sun.star.util.NumberFormatter" ) );
-
- xNewKey = xRegistryKey->createKey(
- OUString::createFromAscii( "/com.sun.star.comp.svl.PathService/UNO/SERVICES" ) );
- xNewKey->createKey (
- OUString::createFromAscii( "com.sun.star.config.SpecialConfigManager" ) );
-
- return sal_True;
- }
- return sal_False;
-}
-
SVL_DLLPUBLIC void* SAL_CALL component_getFactory (
const sal_Char * pImplementationName, void * _pServiceManager, void * /* _pRegistryKey*/)
{
diff --git a/svl/util/makefile.mk b/svl/util/makefile.mk
index 3cb87dcd33ad..7cb493ae0d94 100644
--- a/svl/util/makefile.mk
+++ b/svl/util/makefile.mk
@@ -120,3 +120,11 @@ ALL: $(SLB)$/svl.lib \
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/svl.component
+
+$(MISC)/svl.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ svl.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt svl.component
diff --git a/svl/util/svl.component b/svl/util/svl.component
new file mode 100644
index 000000000000..4af1a31f5782
--- /dev/null
+++ b/svl/util/svl.component
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.svl.PathService">
+ <service name="com.sun.star.config.SpecialConfigManager"/>
+ </implementation>
+ <implementation name="com.sun.star.uno.util.numbers.SvNumberFormatsSupplierServiceObject">
+ <service name="com.sun.star.util.NumberFormatsSupplier"/>
+ </implementation>
+ <implementation name="com.sun.star.uno.util.numbers.SvNumberFormatterServiceObject">
+ <service name="com.sun.star.util.NumberFormatter"/>
+ </implementation>
+</component>
diff --git a/svtools/bmpmaker/bmp.src b/svtools/bmpmaker/bmp.src
index 7431d2e335a4..30ff9488a805 100644
--- a/svtools/bmpmaker/bmp.src
+++ b/svtools/bmpmaker/bmp.src
@@ -27,6 +27,7 @@
#include "bmp.hrc"
ModalDialog DLG_PATH {
+ HelpID = "svtools:ModalDialog:DLG_PATH";
OutputSize = TRUE;
SVLook = TRUE;
Size = MAP_APPFONT( 301, 104 );
@@ -54,36 +55,42 @@ ModalDialog DLG_PATH {
Text = "Bitmap-Pfad:";
};
Edit EDT_SRS {
+ HelpID = "svtools:Edit:DLG_PATH:EDT_SRS";
Border = TRUE;
Pos = MAP_APPFONT( 65, 14 );
Size = MAP_APPFONT( 160, 12 );
TabStop = TRUE;
};
Edit EDT_RES {
+ HelpID = "svtools:Edit:DLG_PATH:EDT_RES";
Border = TRUE;
Pos = MAP_APPFONT( 65, 29 );
Size = MAP_APPFONT( 160, 12 );
TabStop = TRUE;
};
Edit EDT_OUT {
+ HelpID = "svtools:Edit:DLG_PATH:EDT_OUT";
Border = TRUE;
Pos = MAP_APPFONT( 65, 44 );
Size = MAP_APPFONT( 160, 12 );
TabStop = TRUE;
};
PushButton BTN_SRS {
+ HelpID = "svtools:PushButton:DLG_PATH:BTN_SRS";
Pos = MAP_APPFONT( 228, 14 );
Size = MAP_APPFONT( 15, 12 );
Text = "...";
TabStop = TRUE;
};
PushButton BTN_RES {
+ HelpID = "svtools:PushButton:DLG_PATH:BTN_RES";
Pos = MAP_APPFONT( 228, 29 );
Size = MAP_APPFONT( 15, 12 );
Text = "...";
TabStop = TRUE;
};
PushButton BTN_OUT {
+ HelpID = "svtools:PushButton:DLG_PATH:BTN_OUT";
Pos = MAP_APPFONT( 228, 44 );
Size = MAP_APPFONT( 15, 12 );
Text = "...";
@@ -106,6 +113,7 @@ ModalDialog DLG_PATH {
Text = "Sprache";
};
ListBox LB_LANG {
+ HelpID = "svtools:ListBox:DLG_PATH:LB_LANG";
Border = TRUE;
Pos = MAP_APPFONT( 12, 76 );
Size = MAP_APPFONT( 231, 70 );
diff --git a/svtools/inc/fileview.hxx b/svtools/inc/fileview.hxx
index 74476541dcd8..db704a0e6784 100644
--- a/svtools/inc/fileview.hxx
+++ b/svtools/inc/fileview.hxx
@@ -104,8 +104,8 @@ public:
sal_Bool GetParentURL( String& _rParentURL ) const;
sal_Bool CreateNewFolder( const String& rNewFolder );
- void SetHelpId( sal_uInt32 nHelpId );
- sal_uInt32 GetHelpId( ) const;
+ void SetHelpId( const rtl::OString& rHelpId );
+ const rtl::OString& GetHelpId( ) const;
void SetSizePixel( const Size& rNewSize );
using Window::SetPosSizePixel;
virtual void SetPosSizePixel( const Point& rNewPos, const Size& rNewSize );
diff --git a/svtools/inc/fltdefs.hxx b/svtools/inc/fltdefs.hxx
index 8ef3f2ab3740..86462c2faa33 100644
--- a/svtools/inc/fltdefs.hxx
+++ b/svtools/inc/fltdefs.hxx
@@ -34,7 +34,7 @@
#define _FLTDEFS_HXX
-#if defined ( WIN ) || defined ( WNT )
+#if defined ( WNT )
#define RGBQUAD RGBQUADWIN
@@ -53,21 +53,6 @@ typedef struct RGBQUAD
} RGBQUAD;
-#ifdef WIN
-typedef BYTE huge* PDIBBYTE;
-#define MEMCPY hmemcpy
-#define GLOBALALLOC(nSize) ((PDIBBYTE)GlobalLock(GlobalAlloc(GHND,(nSize))))
-#define GLOBALHANDLE(pPointer) ((HGLOBAL)GlobalHandle((*((size_t*)&(pPointer)+1))))
-#define GLOBALFREE(pPointer) (GlobalUnlock(GLOBALHANDLE((pPointer))))
-#define MEMSET( pDst, cByte, nCount ) \
-{ \
- PDIBBYTE pTmp = (PDIBBYTE) pDst; \
- for ( ULONG i = 0; i < nCount; i++ )\
- *pTmp++ = cByte; \
-}
-
-#else
-
typedef BYTE* PDIBBYTE;
#define MEMCPY memcpy
#define MEMSET memset
@@ -75,7 +60,6 @@ typedef BYTE* PDIBBYTE;
#define GLOBALFREE(pPointer) (GlobalFree((HGLOBAL)pPointer))
#define GLOBALHANDLE(pPointer) ((HGLOBAL)(pPointer))
-#endif
#else
typedef BYTE* PDIBBYTE;
diff --git a/svtools/inc/rtfkeywd.hxx b/svtools/inc/rtfkeywd.hxx
index 5ccd9149bd68..de59e1d8faf9 100644
--- a/svtools/inc/rtfkeywd.hxx
+++ b/svtools/inc/rtfkeywd.hxx
@@ -39,6 +39,7 @@
#define OOO_STRING_SVTOOLS_RTF_ALT "\\alt"
#define OOO_STRING_SVTOOLS_RTF_ANNOTATION "\\annotation"
#define OOO_STRING_SVTOOLS_RTF_ANSI "\\ansi"
+#define OOO_STRING_SVTOOLS_RTF_ATNDATE "\\atndate"
#define OOO_STRING_SVTOOLS_RTF_ATNID "\\atnid"
#define OOO_STRING_SVTOOLS_RTF_AUTHOR "\\author"
#define OOO_STRING_SVTOOLS_RTF_B "\\b"
@@ -976,12 +977,15 @@
#define OOO_STRING_SVTOOLS_RTF_SHPBXCOLUMN "\\shpbxcolumn"
#define OOO_STRING_SVTOOLS_RTF_SHPBXMARGIN "\\shpbxmargin"
#define OOO_STRING_SVTOOLS_RTF_SHPBXPAGE "\\shpbxpage"
+#define OOO_STRING_SVTOOLS_RTF_SHPBXIGNORE "\\shpbxignore"
#define OOO_STRING_SVTOOLS_RTF_SHPBYMARGIN "\\shpbymargin"
#define OOO_STRING_SVTOOLS_RTF_SHPBYPAGE "\\shpbypage"
#define OOO_STRING_SVTOOLS_RTF_SHPBYPARA "\\shpbypara"
+#define OOO_STRING_SVTOOLS_RTF_SHPBYIGNORE "\\shpbyignore"
#define OOO_STRING_SVTOOLS_RTF_SHPFBLWTXT "\\shpfblwtxt"
#define OOO_STRING_SVTOOLS_RTF_SHPFHDR "\\shpfhdr"
#define OOO_STRING_SVTOOLS_RTF_SHPGRP "\\shpgrp"
+#define OOO_STRING_SVTOOLS_RTF_SHPINST "\\shpinst"
#define OOO_STRING_SVTOOLS_RTF_SHPLEFT "\\shpleft"
#define OOO_STRING_SVTOOLS_RTF_SHPLID "\\shplid"
#define OOO_STRING_SVTOOLS_RTF_SHPLOCKANCHOR "\\shplockanchor"
@@ -993,6 +997,7 @@
#define OOO_STRING_SVTOOLS_RTF_SHPWRK "\\shpwrk"
#define OOO_STRING_SVTOOLS_RTF_SHPWR "\\shpwr"
#define OOO_STRING_SVTOOLS_RTF_SHPZ "\\shpz"
+#define OOO_STRING_SVTOOLS_RTF_SP "\\sp"
#define OOO_STRING_SVTOOLS_RTF_SPRSBSP "\\sprsbsp"
#define OOO_STRING_SVTOOLS_RTF_SPRSLNSP "\\sprslnsp"
#define OOO_STRING_SVTOOLS_RTF_SPRSTSM "\\sprstsm"
@@ -1116,6 +1121,7 @@
#define OOO_STRING_SVTOOLS_RTF_SHP "\\shp"
#define OOO_STRING_SVTOOLS_RTF_SN "\\sn"
#define OOO_STRING_SVTOOLS_RTF_SV "\\sv"
+#define OOO_STRING_SVTOOLS_RTF_SP "\\sp"
// Support for overline attributes
#define OOO_STRING_SVTOOLS_RTF_OL "\\ol"
@@ -1138,4 +1144,11 @@
#define OOO_STRING_SVTOOLS_RTF_OLHWAVE "\\olhwave"
#define OOO_STRING_SVTOOLS_RTF_OLOLDBWAVE "\\ololdbwave"
+// Support for nested tables
+#define OOO_STRING_SVTOOLS_RTF_ITAP "\\itap"
+#define OOO_STRING_SVTOOLS_RTF_NESTCELL "\\nestcell"
+#define OOO_STRING_SVTOOLS_RTF_NESTTABLEPROPRS "\\nesttableprops"
+#define OOO_STRING_SVTOOLS_RTF_NESTROW "\\nestrow"
+#define OOO_STRING_SVTOOLS_RTF_NONESTTABLES "\\nonesttables"
+
#endif // _RTFKEYWD_HXX
diff --git a/svtools/inc/rtfout.hxx b/svtools/inc/rtfout.hxx
index 12a125635132..b9bfbc901848 100644
--- a/svtools/inc/rtfout.hxx
+++ b/svtools/inc/rtfout.hxx
@@ -41,7 +41,7 @@ class SvStream;
class SVT_DLLPUBLIC RTFOutFuncs
{
public:
-#if defined(MAC) || defined(UNX)
+#if defined(UNX)
static const sal_Char sNewLine; // nur \012 oder \015
#else
static const sal_Char __FAR_DATA sNewLine[]; // \015\012
diff --git a/svtools/inc/rtftoken.h b/svtools/inc/rtftoken.h
index e75254487312..f292682a0236 100644
--- a/svtools/inc/rtftoken.h
+++ b/svtools/inc/rtftoken.h
@@ -1258,7 +1258,7 @@ enum RTF_TOKEN_IDS {
RTF_SOUTLVL,
// shapes
- RTF_SHP, RTF_SN, RTF_SV
+ RTF_SHP, RTF_SN, RTF_SV, RTF_SP
/*
RTF_SHPLEFT,
RTF_SHPTOP,
diff --git a/svtools/inc/svtools/filter.hxx b/svtools/inc/svtools/filter.hxx
index 49ec77adfea5..8c6f014d4219 100644
--- a/svtools/inc/svtools/filter.hxx
+++ b/svtools/inc/svtools/filter.hxx
@@ -134,16 +134,6 @@ class Graphic;
#define GFF_EMF ( (USHORT)0x00f8 )
#define GFF_XXX ( (USHORT)0xffff )
-// ---------------
-// - RequestInfo -
-// ---------------
-
-struct RequestInfo
-{
- BYTE* pBuffer;
- ULONG nRealBufferSize;
-};
-
// ---------------------
// - GraphicDescriptor -
// ---------------------
@@ -151,29 +141,18 @@ struct RequestInfo
class SVT_DLLPUBLIC GraphicDescriptor
{
SvStream* pFileStm;
- Link aReqLink;
+
String aPathExt;
Size aPixSize;
Size aLogSize;
- SvStream* pMemStm;
- SvStream* pBaseStm;
- ULONG nStmPos;
USHORT nBitsPerPixel;
USHORT nPlanes;
USHORT nFormat;
BOOL bCompressed;
- BOOL bDataReady;
- BOOL bLinked;
- BOOL bLinkChanged;
- BOOL bWideSearch;
- BOOL bBaseStm;
- long nExtra1;
- long nExtra2;
+ BOOL bOwnStream;
void ImpConstruct();
-//#if 0 // _SOLAR__PRIVATE
-
BOOL ImpDetectBMP( SvStream& rStm, BOOL bExtendedInfo );
BOOL ImpDetectGIF( SvStream& rStm, BOOL bExtendedInfo );
BOOL ImpDetectJPG( SvStream& rStm, BOOL bExtendedInfo );
@@ -199,27 +178,11 @@ class SVT_DLLPUBLIC GraphicDescriptor
BOOL ImpDetectSGV( SvStream& rStm, BOOL bExtendedInfo );
BOOL ImpDetectEMF( SvStream& rStm, BOOL bExtendedInfo );
-//#endif
-
GraphicDescriptor( const GraphicDescriptor& );
GraphicDescriptor& operator=( const GraphicDescriptor& );
-protected:
-
- BOOL IsDataReady() const;
- BOOL IsWideSearch() const;
- SvStream& GetSearchStream() const;
- const String& GetPathExtension() const;
-
public:
- // Default-Ctor, um anschliessend einen Link zu setzen, mit dem
- // die Daten vom Aufrufer im ::Detect() angefordert werden.
- // da einige Formate ( Mtf's ) keinen eindeutigen Header besitzen,
- // ist es sinnvoll den vollen Filenamen (inkl. Ext. ) mitanzugeben,
- // da so das Format ueber die Extension ermittelt werden kann
- GraphicDescriptor( const String* pPath = NULL );
-
// Ctor, um einen Filenamen zu setzen. Es muss ::Detect() gerufen werden,
// um das File zu identifizieren;
// wenn das File keinen eindeutigen Header besitzt ( Mtf's ) wird das
@@ -261,21 +224,6 @@ public:
// zeigt an, ob das Bild evtl. komprimiert (wie auch immer) ist
BOOL IsCompressed() const { return bCompressed; }
- // setzt den LinkHdl zum Setzen der Bytes;
- // der Handler muss einen Pointer auf die RequestInfo-Struktur
- // zurueckgeben; die Anzahl der minimal zur Verfuegung zu stellenden
- // Daten muss im Handler ueber ::GetRequestedByteCount() erfragt werden;
- // die tatsaechlich zur Verfuegung gestellte BYTE-Anzahl
- // wird in der RequestInfo-Struktur gesetzt
- void SetRequestHdl( const Link& rRequestHdl );
-
- // gibt den LinkHdl zum Setzen der Bytes zurueck
- const Link& GetRequestHdl() const { return aReqLink; }
-
- // muss im ReqHdl gerufen werden, um zu erfahren, wieviele
- // Bytes _mindestens_ bereitgestellt werden muessen
- ULONG GetRequestedByteCount() const;
-
// gibt die Filternummer des Filters zurueck,
// der im GraphicFilter zum Lesen dieses Formats
// benoetigt wird
diff --git a/svtools/inc/svtools/headbar.hxx b/svtools/inc/svtools/headbar.hxx
index 1ef7687cfb1d..c225a95d1f55 100644
--- a/svtools/inc/svtools/headbar.hxx
+++ b/svtools/inc/svtools/headbar.hxx
@@ -360,15 +360,15 @@ public:
void SetHelpText( USHORT nItemId, const XubString& rText );
XubString GetHelpText( USHORT nItemId ) const;
- void SetHelpId( USHORT nItemId, ULONG nHelpId );
- ULONG GetHelpId( USHORT nItemId ) const;
+ void SetHelpId( USHORT nItemId, const rtl::OString& nHelpId );
+ rtl::OString GetHelpId( USHORT nItemId ) const;
Size CalcWindowSizePixel() const;
inline void SetHelpText( const String& rText ) { Window::SetHelpText( rText ); }
inline const String& GetHelpText() const { return Window::GetHelpText(); }
- inline void SetHelpId( ULONG nId ) { Window::SetHelpId( nId ); }
- inline ULONG GetHelpId() const { return Window::GetHelpId(); }
+ inline void SetHelpId( const rtl::OString& rId ) { Window::SetHelpId( rId ); }
+ inline const rtl::OString& GetHelpId() const { return Window::GetHelpId(); }
inline void SetStartDragHdl( const Link& rLink ) { maStartDragHdl = rLink; }
inline const Link& GetStartDragHdl() const { return maStartDragHdl; }
diff --git a/svtools/inc/svtools/helpid.hrc b/svtools/inc/svtools/helpid.hrc
index 1ffb7a99fb32..ecf8ba4b1bf7 100644
--- a/svtools/inc/svtools/helpid.hrc
+++ b/svtools/inc/svtools/helpid.hrc
@@ -28,90 +28,103 @@
#ifndef _SVT_HELPID_HRC
#define _SVT_HELPID_HRC
-// include ---------------------------------------------------------------
-
-#include <svl/solar.hrc>
-
-// Help-Ids --------------------------------------------------------------
-
-#define HID_FILEDLG_OPENDLG (HID_SVTOOLS_START + 0)
-#define HID_FILEDLG_PATHDLG (HID_SVTOOLS_START + 1)
-#define HID_FILEDLG_DIR (HID_SVTOOLS_START + 2)
-#define HID_FILEDLG_EDIT (HID_SVTOOLS_START + 3)
-#define HID_FILEDLG_DIRS (HID_SVTOOLS_START + 4)
-#define HID_FILEDLG_DRIVE (HID_SVTOOLS_START + 5)
-#define HID_FILEDLG_DRIVES (HID_SVTOOLS_START + 6)
-#define HID_FILEDLG_NEWDIR (HID_SVTOOLS_START + 7)
-#define HID_FILEDLG_HOME (HID_SVTOOLS_START + 8)
-#define HID_FILEDLG_FILE (HID_SVTOOLS_START + 9)
-#define HID_FILEDLG_FILES (HID_SVTOOLS_START + 10)
-#define HID_FILEDLG_PATH (HID_SVTOOLS_START + 11)
-#define HID_FILEDLG_TYPE (HID_SVTOOLS_START + 12)
-#define HID_FILEDLG_TYPES (HID_SVTOOLS_START + 13)
+#define HID_FILEDLG_OPENDLG "SVT_HID_FILEDLG_OPENDLG"
+#define HID_FILEDLG_PATHDLG "SVT_HID_FILEDLG_PATHDLG"
+#define HID_FILEDLG_DIR "SVT_HID_FILEDLG_DIR"
+#define HID_FILEDLG_EDIT "SVT_HID_FILEDLG_EDIT"
+#define HID_FILEDLG_DIRS "SVT_HID_FILEDLG_DIRS"
+#define HID_FILEDLG_DRIVE "SVT_HID_FILEDLG_DRIVE"
+#define HID_FILEDLG_DRIVES "SVT_HID_FILEDLG_DRIVES"
+#define HID_FILEDLG_NEWDIR "SVT_HID_FILEDLG_NEWDIR"
+#define HID_FILEDLG_HOME "SVT_HID_FILEDLG_HOME"
+#define HID_FILEDLG_FILE "SVT_HID_FILEDLG_FILE"
+#define HID_FILEDLG_FILES "SVT_HID_FILEDLG_FILES"
+#define HID_FILEDLG_PATH "SVT_HID_FILEDLG_PATH"
+#define HID_FILEDLG_TYPE "SVT_HID_FILEDLG_TYPE"
+#define HID_FILEDLG_TYPES "SVT_HID_FILEDLG_TYPES"
+#define HID_FILEDLG_LINK_CB "SVT_HID_FILEDLG_LINK_CB"
+#define HID_FILEDLG_PREVIEW_CB "SVT_HID_FILEDLG_PREVIEW_CB"
+#define HID_FILEDLG_STANDARD "SVT_HID_FILEDLG_STANDARD"
+#define HID_FILEDLG_MANAGER "SVT_HID_FILEDLG_MANAGER"
+#define HID_FILEDLG_URL "SVT_HID_FILEDLG_URL"
+#define HID_FILEDLG_USE_PASSWD "SVT_HID_FILEDLG_USE_PASSWD"
+#define HID_FILEDLG_READ_ONLY "SVT_HID_FILEDLG_READ_ONLY"
+#define HID_FILEDLG_AUTOCOMPLETEBOX "SVT_HID_FILEDLG_AUTOCOMPLETEBOX"
+#define HID_FILEDLG_SAVE_BTN "SVT_HID_FILEDLG_SAVE_BTN"
+#define HID_FILEDLG_SAVE_FILENAME "SVT_HID_FILEDLG_SAVE_FILENAME"
+#define HID_FILEDLG_SAVE_FILETYPE "SVT_HID_FILEDLG_SAVE_FILETYPE"
+#define HID_FILEDLG_INSERT_BTN "SVT_HID_FILEDLG_INSERT_BTN"
+#define HID_FILEDLG_PATH_BTN "SVT_HID_FILEDLG_PATH_BTN"
+#define HID_FILEDLG_PATH_FILENAME "SVT_HID_FILEDLG_PATH_FILENAME"
+#define HID_FILEDLG_FOLDER_BTN "SVT_HID_FILEDLG_FOLDER_BTN"
+#define HID_FILEDLG_FOLDER_FILENAME "SVT_HID_FILEDLG_FOLDER_FILENAME"
+#define HID_FILEDLG_SRCHFOLDER_BTN "SVT_HID_FILEDLG_SRCHFOLDER_BTN"
+#define HID_FILEDLG_EDIT_FAVORITES "SVT_HID_FILEDLG_EDIT_FAVORITES"
+#define HID_FILEDLG_NEW_FAVORITE "SVT_HID_FILEDLG_NEW_FAVORITE"
+#define HID_FILEDLG_EDIT_FAVORITES_LISTBOX "SVT_HID_FILEDLG_EDIT_FAVORITES_LISTBOX"
+#define HID_FILEDLG_EDIT_FAVORITES_HEADERBAR "SVT_HID_FILEDLG_EDIT_FAVORITES_HEADERBAR"
+#define HID_FILEDLG_EXPORTASPDF "SVT_HID_FILEDLG_EXPORTASPDF"
// HelpID's fuer die Textkomponente
-#define HID_TEXTCPNT_OPEN_LINK (HID_SVTOOLS_START + 14)
-#define HID_TEXTCPNT_OPEN_LINK_NEW (HID_SVTOOLS_START + 15)
-#define HID_TEXTCPNT_DOWNLOAD (HID_SVTOOLS_START + 16)
-#define HID_TEXTCPNT_ADD_BOOKMARK (HID_SVTOOLS_START + 17)
-#define HID_TEXTCPNT_COPY_LINK (HID_SVTOOLS_START + 18)
+#define HID_TEXTCPNT_OPEN_LINK "SVT_HID_TEXTCPNT_OPEN_LINK"
+#define HID_TEXTCPNT_OPEN_LINK_NEW "SVT_HID_TEXTCPNT_OPEN_LINK_NEW"
+#define HID_TEXTCPNT_DOWNLOAD "SVT_HID_TEXTCPNT_DOWNLOAD"
+#define HID_TEXTCPNT_ADD_BOOKMARK "SVT_HID_TEXTCPNT_ADD_BOOKMARK"
+#define HID_TEXTCPNT_COPY_LINK "SVT_HID_TEXTCPNT_COPY_LINK"
// HelpID's fuer RegisterDialog
-#define HID_LIMITED_DIALOG (HID_SVTOOLS_START + 20)
+#define HID_LIMITED_DIALOG "SVT_HID_LIMITED_DIALOG"
// Help ids of template dialog
-#define HID_TEMPLATEDLG_DIALOG (HID_SVTOOLS_START + 21)
-#define HID_TEMPLATEDLG_ICONCTRL (HID_SVTOOLS_START + 22)
-#define HID_TEMPLATEDLG_FILEVIEW (HID_SVTOOLS_START + 23)
-#define HID_TEMPLATEDLG_TB_BACK (HID_SVTOOLS_START + 24)
-#define HID_TEMPLATEDLG_TB_PREV (HID_SVTOOLS_START + 25)
-#define HID_TEMPLATEDLG_TB_PRINT (HID_SVTOOLS_START + 26)
-#define HID_TEMPLATEDLG_TB_DOCINFO (HID_SVTOOLS_START + 27)
-#define HID_TEMPLATEDLG_TB_PREVIEW (HID_SVTOOLS_START + 28)
+#define HID_TEMPLATEDLG_DIALOG "SVT_HID_TEMPLATEDLG_DIALOG"
+#define HID_TEMPLATEDLG_ICONCTRL "SVT_HID_TEMPLATEDLG_ICONCTRL"
+#define HID_TEMPLATEDLG_FILEVIEW "SVT_HID_TEMPLATEDLG_FILEVIEW"
+#define HID_TEMPLATEDLG_TB_BACK "SVT_HID_TEMPLATEDLG_TB_BACK"
+#define HID_TEMPLATEDLG_TB_PREV "SVT_HID_TEMPLATEDLG_TB_PREV"
+#define HID_TEMPLATEDLG_TB_PRINT "SVT_HID_TEMPLATEDLG_TB_PRINT"
+#define HID_TEMPLATEDLG_TB_DOCINFO "SVT_HID_TEMPLATEDLG_TB_DOCINFO"
+#define HID_TEMPLATEDLG_TB_PREVIEW "SVT_HID_TEMPLATEDLG_TB_PREVIEW"
-#define HID_ADDRTEMPL_FIELD_ASSIGNMENT (HID_SVTOOLS_START + 29)
+#define HID_ADDRTEMPL_FIELD_ASSIGNMENT "SVT_HID_ADDRTEMPL_FIELD_ASSIGNMENT"
// Help ids for the filepicker dialogs
-#define HID_EXPLORERDLG_FILE (HID_SVTOOLS_START + 30)
+#define HID_EXPLORERDLG_FILE "SVT_HID_EXPLORERDLG_FILE"
// help ids for fileview contextmenu
-#define HID_FILEVIEW_MENU_DELETE (HID_SVTOOLS_START + 31)
-#define HID_FILEVIEW_MENU_RENAME (HID_SVTOOLS_START + 32)
+#define HID_FILEVIEW_MENU_DELETE "SVT_HID_FILEVIEW_MENU_DELETE"
+#define HID_FILEVIEW_MENU_RENAME "SVT_HID_FILEVIEW_MENU_RENAME"
// help ids for the different modi of the file picker dialog
// FREE
-#define HID_FILESAVE_LEVELUP (HID_SVTOOLS_START + 34)
-#define HID_FILESAVE_CREATEDIRECTORY (HID_SVTOOLS_START + 35)
-#define HID_FILESAVE_DEFAULTDIRECTORY (HID_SVTOOLS_START + 36)
-#define HID_FILESAVE_FILEVIEW (HID_SVTOOLS_START + 37)
-#define HID_FILESAVE_TEMPLATE (HID_SVTOOLS_START + 38)
-#define HID_FILESAVE_FILEURL (HID_SVTOOLS_START + 39)
-#define HID_FILESAVE_FILETYPE (HID_SVTOOLS_START + 40)
-#define HID_FILESAVE_DOSAVE (HID_SVTOOLS_START + 41)
-#define HID_FILESAVE_AUTOEXTENSION (HID_SVTOOLS_START + 42)
-#define HID_FILESAVE_SAVEWITHPASSWORD (HID_SVTOOLS_START + 43)
-#define HID_FILESAVE_CUSTOMIZEFILTER (HID_SVTOOLS_START + 44)
-#define HID_FILESAVE_SELECTION (HID_SVTOOLS_START + 45)
-#define HID_FILESAVE_DIALOG (HID_SVTOOLS_START + 46)
-#define HID_FILESAVE_DOPLAY (HID_SVTOOLS_START + 47)
-
-#define HID_FILEOPEN_READONLY (HID_SVTOOLS_START + 48)
-#define HID_FILEOPEN_VERSION (HID_SVTOOLS_START + 49)
-#define HID_FILEOPEN_IMAGE_TEMPLATE (HID_SVTOOLS_START + 50)
-
-#define HID_FILEDLG_LINK_CB (HID_SFX_START + 276)
-#define HID_FILEDLG_PREVIEW_CB (HID_SFX_START + 277)
+#define HID_FILESAVE_LEVELUP "SVT_HID_FILESAVE_LEVELUP"
+#define HID_FILESAVE_CREATEDIRECTORY "SVT_HID_FILESAVE_CREATEDIRECTORY"
+#define HID_FILESAVE_DEFAULTDIRECTORY "SVT_HID_FILESAVE_DEFAULTDIRECTORY"
+#define HID_FILESAVE_FILEVIEW "SVT_HID_FILESAVE_FILEVIEW"
+#define HID_FILESAVE_TEMPLATE "SVT_HID_FILESAVE_TEMPLATE"
+#define HID_FILESAVE_FILEURL "SVT_HID_FILESAVE_FILEURL"
+#define HID_FILESAVE_FILETYPE "SVT_HID_FILESAVE_FILETYPE"
+#define HID_FILESAVE_DOSAVE "SVT_HID_FILESAVE_DOSAVE"
+#define HID_FILESAVE_AUTOEXTENSION "SVT_HID_FILESAVE_AUTOEXTENSION"
+#define HID_FILESAVE_SAVEWITHPASSWORD "SVT_HID_FILESAVE_SAVEWITHPASSWORD"
+#define HID_FILESAVE_CUSTOMIZEFILTER "SVT_HID_FILESAVE_CUSTOMIZEFILTER"
+#define HID_FILESAVE_SELECTION "SVT_HID_FILESAVE_SELECTION"
+#define HID_FILESAVE_DIALOG "SVT_HID_FILESAVE_DIALOG"
+#define HID_FILESAVE_DOPLAY "SVT_HID_FILESAVE_DOPLAY"
+
+#define HID_FILEOPEN_READONLY "SVT_HID_FILEOPEN_READONLY"
+#define HID_FILEOPEN_VERSION "SVT_HID_FILEOPEN_VERSION"
+#define HID_FILEOPEN_IMAGE_TEMPLATE "SVT_HID_FILEOPEN_IMAGE_TEMPLATE"
// uniqueid for the helpagent window (testtool)
-#define HID_HELPAGENT_WINDOW (HID_SVTOOLS_START + 51)
+#define HID_HELPAGENT_WINDOW "SVT_HID_HELPAGENT_WINDOW"
// registration dialog
-#define HID_REGISTRATION_DIALOG (HID_SVTOOLS_START + 52)
+#define HID_REGISTRATION_DIALOG "SVT_HID_REGISTRATION_DIALOG"
-#define HID_PRINTDIALOG_TOFILE (HID_SVTOOLS_START + 53)
+#define HID_PRINTDIALOG_TOFILE "SVT_HID_PRINTDIALOG_TOFILE"
-#define HID_WIZARD_NEXT (HID_SVTOOLS_START + 54)
-#define HID_WIZARD_PREVIOUS (HID_SVTOOLS_START + 55)
+#define HID_WIZARD_NEXT "SVT_HID_WIZARD_NEXT"
+#define HID_WIZARD_PREVIOUS "SVT_HID_WIZARD_PREVIOUS"
#endif
diff --git a/svtools/inc/svtools/htmlout.hxx b/svtools/inc/svtools/htmlout.hxx
index 888286b231ee..1a21f1154602 100644
--- a/svtools/inc/svtools/htmlout.hxx
+++ b/svtools/inc/svtools/htmlout.hxx
@@ -60,7 +60,7 @@ struct SVT_DLLPUBLIC HTMLOutContext
struct HTMLOutFuncs
{
-#if defined(MAC) || defined(UNX)
+#if defined(UNX)
static const sal_Char sNewLine; // nur \012 oder \015
#else
static const sal_Char __FAR_DATA sNewLine[]; // \015\012
diff --git a/svtools/inc/svtools/parrtf.hxx b/svtools/inc/svtools/parrtf.hxx
index 179f5a28259a..b96e3937231d 100644
--- a/svtools/inc/svtools/parrtf.hxx
+++ b/svtools/inc/svtools/parrtf.hxx
@@ -30,7 +30,7 @@
#include "svtools/svtdllapi.h"
#include <svtools/svparser.hxx>
-#include <svl/svarray.hxx>
+#include <stack>
struct RtfParserState_Impl
{
@@ -42,7 +42,7 @@ struct RtfParserState_Impl
{}
};
-SV_DECL_VARARR( RtfParserStates_Impl, RtfParserState_Impl, 16, 16 )
+typedef std::stack< RtfParserState_Impl > RtfParserStates_Impl;
class SVT_DLLPUBLIC SvRTFParser : public SvParser
{
diff --git a/svtools/inc/svtools/roadmapwizard.hxx b/svtools/inc/svtools/roadmapwizard.hxx
index 5d8e0d9b01bb..25d983c85a90 100644
--- a/svtools/inc/svtools/roadmapwizard.hxx
+++ b/svtools/inc/svtools/roadmapwizard.hxx
@@ -90,8 +90,8 @@ namespace svt
void SetRoadmapBitmap( const BitmapEx& _rBitmap );
const BitmapEx& GetRoadmapBitmap( ) const;
- void SetRoadmapSmartHelpId( const SmartId& _rId, SmartIdUpdateMode _aMode = SMART_SET_SMART );
- SmartId GetRoadmapSmartHelpId() const;
+ void SetRoadmapHelpId( const rtl::OString& _rId );
+ const rtl::OString& GetRoadmapHelpId() const;
void SetRoadmapInteractive( sal_Bool _bInteractive );
sal_Bool IsRoadmapInteractive();
diff --git a/svtools/inc/svtools/svicnvw.hxx b/svtools/inc/svtools/svicnvw.hxx
index ac15f0b55be6..68a76d25e108 100644
--- a/svtools/inc/svtools/svicnvw.hxx
+++ b/svtools/inc/svtools/svicnvw.hxx
@@ -89,7 +89,6 @@ class SvIconView : public SvLBox
SvImpIconView* pImp;
Image aCollapsedEntryBmp;
Image aExpandedEntryBmp;
- WinBits nWinBits;
USHORT nIcnVwFlags;
void SetModel( SvLBoxTreeList* );
@@ -111,6 +110,7 @@ protected:
virtual void ReadDragServerInfo( const Point&, SvLBoxDDInfo* );
virtual void Command( const CommandEvent& rCEvt );
virtual void PreparePaint( SvLBoxEntry* );
+ virtual void StateChanged( StateChangedType nStateChange );
public:
@@ -203,7 +203,6 @@ public:
SvLBoxEntry* GetEntryFromLogicPos( const Point& rDocPos ) const;
- void SetWindowBits( WinBits nWinStyle );
virtual void PaintEntry( SvLBoxEntry* );
virtual void PaintEntry( SvLBoxEntry*, const Point& rDocPos );
Rectangle GetFocusRect( SvLBoxEntry* );
diff --git a/svtools/inc/svtools/svlbitm.hxx b/svtools/inc/svtools/svlbitm.hxx
index c28b8d5db10c..5158c38fbd87 100644
--- a/svtools/inc/svtools/svlbitm.hxx
+++ b/svtools/inc/svtools/svlbitm.hxx
@@ -176,6 +176,8 @@ class SVT_DLLPUBLIC SvLBoxButton : public SvLBoxItem
USHORT nItemFlags;
USHORT nImgArrOffs;
USHORT nBaseOffs;
+
+ void ImplAdjustBoxSize( Size& io_rCtrlSize, ControlType i_eType, Window* pParent );
public:
// An SvLBoxButton can be of three different kinds: an
// enabled checkbox (the normal kind), a disabled checkbox
diff --git a/svtools/inc/svtools/svlbox.hxx b/svtools/inc/svtools/svlbox.hxx
index f33784f45397..95fbd9f014d1 100644
--- a/svtools/inc/svtools/svlbox.hxx
+++ b/svtools/inc/svtools/svlbox.hxx
@@ -47,6 +47,7 @@
#include <vcl/accel.hxx>
#endif
#include <vcl/mnemonicengine.hxx>
+#include <vcl/quickselectionengine.hxx>
#include <tools/gen.hxx>
#include <svtools/treelist.hxx>
#include <svl/svarray.hxx>
@@ -253,10 +254,12 @@ DECLARE_SVTREELIST(SvLBoxTreeList, SvLBoxEntry*)
class SvLBox;
struct SvLBox_Impl
{
- bool m_bIsEmptyTextAllowed;
- bool m_bEntryMnemonicsEnabled;
- Link* m_pLink;
- ::vcl::MnemonicEngine m_aMnemonicEngine;
+ bool m_bIsEmptyTextAllowed;
+ bool m_bEntryMnemonicsEnabled;
+ bool m_bDoingQuickSelection;
+ Link* m_pLink;
+ ::vcl::MnemonicEngine m_aMnemonicEngine;
+ ::vcl::QuickSelectionEngine m_aQuickSelectionEngine;
SvLBox_Impl( SvLBox& _rBox );
};
@@ -267,6 +270,7 @@ class SVT_DLLPUBLIC SvLBox
,public DropTargetHelper
,public DragSourceHelper
,public ::vcl::IMnemonicEntryList
+ ,public ::vcl::ISearchableStringList
{
friend class SvLBoxEntry;
@@ -290,7 +294,6 @@ class SVT_DLLPUBLIC SvLBox
protected:
- WinBits nWindowStyle;
Link aExpandedHdl;
Link aExpandingHdl;
Link aSelectHdl;
@@ -376,11 +379,18 @@ protected:
// for asynchronous D&D
sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt, SvLBox* pSourceView );
- // IMnemonicEntryList
- virtual const void* FirstSearchEntry( String& _rEntryText );
- virtual const void* NextSearchEntry( const void* _pCurrentSearchEntry, String& _rEntryText );
- virtual void SelectSearchEntry( const void* _pEntry );
- virtual void ExecuteSearchEntry( const void* _pEntry );
+ void OnCurrentEntryChanged();
+
+ // IMnemonicEntryList
+ virtual const void* FirstSearchEntry( String& _rEntryText ) const;
+ virtual const void* NextSearchEntry( const void* _pCurrentSearchEntry, String& _rEntryText ) const;
+ virtual void SelectSearchEntry( const void* _pEntry );
+ virtual void ExecuteSearchEntry( const void* _pEntry ) const;
+
+ // ISearchableStringList
+ virtual ::vcl::StringEntryIdentifier CurrentEntry( String& _out_entryText ) const;
+ virtual ::vcl::StringEntryIdentifier NextEntry( ::vcl::StringEntryIdentifier _currentEntry, String& _out_entryText ) const;
+ virtual void SelectEntry( ::vcl::StringEntryIdentifier _entry );
public:
diff --git a/svtools/inc/svtools/svtdata.hxx b/svtools/inc/svtools/svtdata.hxx
index 9faadaff7305..eb5c5dad1b75 100644
--- a/svtools/inc/svtools/svtdata.hxx
+++ b/svtools/inc/svtools/svtdata.hxx
@@ -40,11 +40,10 @@ class ImpSvtData
public:
SfxItemDesruptorList_Impl * pItemDesruptList;
ResMgr * pResMgr;
- ResMgr * pPatchResMgr;
private:
ImpSvtData():
- pItemDesruptList(0), pResMgr(0), pPatchResMgr(0)
+ pItemDesruptList(0), pResMgr(0)
{}
~ImpSvtData();
@@ -52,25 +51,11 @@ private:
public:
ResMgr * GetResMgr(const ::com::sun::star::lang::Locale aLocale);
ResMgr * GetResMgr(); // VCL dependant, only available in SVT, not in SVL!
- ResMgr * GetPatchResMgr();
- ResMgr * GetPatchResMgr(const ::com::sun::star::lang::Locale& aLocale);
static ImpSvtData & GetSvtData();
};
//============================================================================
-
-class SvpResId: public ResId
-{
-public:
- SvpResId( USHORT nId, const ::com::sun::star::lang::Locale aLocale ):
- ResId( nId, *ImpSvtData::GetSvtData().GetResMgr( aLocale ) ) {}
-
- // VCL dependant, only available in SVT, not in SVL!
- SvpResId( USHORT nId );
-};
-
-
class SvtResId: public ResId
{
public:
diff --git a/svtools/inc/svtools/svtools.hrc b/svtools/inc/svtools/svtools.hrc
index a57a0f5bb0fe..3dd2f0706a2e 100644
--- a/svtools/inc/svtools/svtools.hrc
+++ b/svtools/inc/svtools/svtools.hrc
@@ -38,22 +38,12 @@
//.............................................................................
// various unsorted stuff
-#define DLG_EXPORT_PIX (RID_SVTOOLS_START+1)
-#define DLG_EXPORT_VEC (RID_SVTOOLS_START+2)
#define DLG_TWAIN_SOURCE (RID_SVTOOLS_START+3)
#define DLG_SVT_EXPLORERFILE (RID_SVTOOLS_START+4)
#define DLG_SVT_QUERYFOLDERNAME (RID_SVTOOLS_START+5)
#define DLG_SVT_QUERYDELETE (RID_SVTOOLS_START+6)
-#define EXPORT_DIALOG_TITLE (RID_SVTOOLS_START+4)
-#define KEY_MODE (RID_SVTOOLS_START+5)
-#define KEY_RES (RID_SVTOOLS_START+6)
-#define KEY_SIZE (RID_SVTOOLS_START+7)
-
-#define KEY_COLORS (RID_SVTOOLS_START+9)
-#define KEY_RLE_CODING (RID_SVTOOLS_START+10)
-
#define STR_SVT_AUTOMATIC_COLOR (RID_SVTOOLS_START+16)
#define STR_SVT_FILEVIEW_COLUMN_TITLE (RID_SVTOOLS_START + 20)
@@ -289,17 +279,16 @@
//.............................................................................
// dialogs
-
-#define DLG_EXPORT_JPG_START (RID_SVTOOLS_START+110)
-#define DLG_EXPORT_JPG (RID_SVTOOLS_START+111)
-#define DLG_EXPORT_JPG_END (RID_SVTOOLS_START+112)
+#define DLG_EXPORT_START (STR_ARR_SVT_LANGUAGE_TABLE_END + 1)
+#define DLG_EXPORT (DLG_EXPORT_START)
+#define DLG_EXPORT_TITLE (DLG_EXPORT_START+1)
+#define DLG_EXPORT_END (DLG_EXPORT_TITLE)
#define DLG_LOGIN (RID_SVTOOLS_START+113)
#define DLG_ADDRESSBOOKSOURCE (RID_SVTOOLS_START+114)
#define DLG_REGISTRATION_REQUEST (RID_SVTOOLS_START+115)
-#define DLG_EXPORT_EPNG (RID_SVTOOLS_START+116)
//.............................................................................
// bitmaps
diff --git a/svtools/inc/svtools/svtreebx.hxx b/svtools/inc/svtools/svtreebx.hxx
index 787e0956888f..79402cb13f23 100644
--- a/svtools/inc/svtools/svtreebx.hxx
+++ b/svtools/inc/svtools/svtreebx.hxx
@@ -39,11 +39,6 @@ class TabBar;
#define SV_TAB_BORDER 8
-#define WB_HASBUTTONSATROOT ((WinBits)0x0800)
-#define WB_NOINITIALSELECTION WB_DROPDOWN
-#define WB_HIDESELECTION WB_NOHIDESELECTION
-#define WB_FORCE_MAKEVISIBLE WB_SPIN
-
#define SV_LISTBOX_ID_TREEBOX 1 // fuer SvLBox::IsA()
#define SV_ENTRYHEIGHTOFFS_PIXEL 2
@@ -97,9 +92,11 @@ class SVT_DLLPUBLIC SvTreeListBox : public SvLBox
USHORT nTabFlagMask=0xffff,
BOOL bHasClipRegion=FALSE );
- SVT_DLLPRIVATE void InitTreeView( WinBits nWinStyle );
+ SVT_DLLPRIVATE void InitTreeView();
SVT_DLLPRIVATE SvLBoxItem* GetItem_Impl( SvLBoxEntry*, long nX, SvLBoxTab** ppTab,
USHORT nEmptyWidth );
+ SVT_DLLPRIVATE void ImplInitStyle();
+
#endif
protected:
@@ -318,9 +315,6 @@ public:
SvLBoxEntry* GetEntry( SvLBoxEntry* pParent, ULONG nPos ) const { return SvLBox::GetEntry(pParent,nPos); }
SvLBoxEntry* GetEntry( ULONG nRootPos ) const { return SvLBox::GetEntry(nRootPos);}
- void SetWindowBits( WinBits nWinStyle );
- WinBits GetWindowBits() const { return nWindowStyle; }
-
void PaintEntry( SvLBoxEntry* );
long PaintEntry( SvLBoxEntry*, long nLine,
USHORT nTabFlagMask=0xffff );
diff --git a/svtools/inc/svtools/svxbox.hxx b/svtools/inc/svtools/svxbox.hxx
index 25deba4d091c..a4a920e692be 100644
--- a/svtools/inc/svtools/svxbox.hxx
+++ b/svtools/inc/svtools/svxbox.hxx
@@ -129,11 +129,7 @@ enum SvxComboBoxStyle
SVX_CBS_LOWER = 0x02,
SVX_CBS_ALL = 0x04,
SVX_CBS_FILENAME = 0x08,
-#ifdef WIN
- SVX_CBS_SW_FILENAME = SVX_CBS_FILENAME | SVX_CBS_LOWER
-#else
SVX_CBS_SW_FILENAME = SVX_CBS_FILENAME
-#endif
};
// class SvxComboBox -----------------------------------------------------
diff --git a/svtools/inc/svtools/syntaxhighlight.hxx b/svtools/inc/svtools/syntaxhighlight.hxx
index 8cf7126fa24c..e406c33fc54f 100644
--- a/svtools/inc/svtools/syntaxhighlight.hxx
+++ b/svtools/inc/svtools/syntaxhighlight.hxx
@@ -57,8 +57,6 @@
#include <tools/string.hxx>
#include <tools/gen.hxx>
-#include <svl/svarray.hxx>
-
// Token-Typen TT_...
enum TokenTypes
@@ -79,8 +77,7 @@ enum TokenTypes
struct HighlightPortion { UINT16 nBegin; UINT16 nEnd; TokenTypes tokenType; };
-
-SV_DECL_VARARR(HighlightPortions, HighlightPortion, 0, 16)
+typedef std::vector<HighlightPortion> HighlightPortions;
/////////////////////////////////////////////////////////////////////////
// Hilfsklasse zur Untersuchung von JavaScript-Modulen, zunaechst zum
diff --git a/svtools/inc/svtools/toolpanel/toolpanel.hxx b/svtools/inc/svtools/toolpanel/toolpanel.hxx
index 432dea64e8b5..d38d8e7d257d 100644
--- a/svtools/inc/svtools/toolpanel/toolpanel.hxx
+++ b/svtools/inc/svtools/toolpanel/toolpanel.hxx
@@ -32,7 +32,6 @@
#include <rtl/ustring.hxx>
#include <vcl/image.hxx>
-#include <vcl/smartid.hxx>
#include <boost/noncopyable.hpp>
@@ -62,7 +61,7 @@ namespace svt
virtual Image GetImage() const = 0;
/// retrieves the help ID associated with the panel, if any.
- virtual SmartId GetHelpID() const = 0;
+ virtual rtl::OString GetHelpID() const = 0;
/** activates the panel
diff --git a/svtools/inc/tabbar.hxx b/svtools/inc/tabbar.hxx
index e036f4c2f045..2757811ba34e 100644
--- a/svtools/inc/tabbar.hxx
+++ b/svtools/inc/tabbar.hxx
@@ -516,8 +516,8 @@ public:
XubString GetPageText( USHORT nPageId ) const;
void SetHelpText( USHORT nPageId, const XubString& rText );
XubString GetHelpText( USHORT nPageId ) const;
- void SetHelpId( USHORT nPageId, ULONG nHelpId );
- ULONG GetHelpId( USHORT nPageId ) const;
+ void SetHelpId( USHORT nPageId, const rtl::OString& nHelpId );
+ rtl::OString GetHelpId( USHORT nPageId ) const;
long GetSplitSize() const { return mnSplitSize; }
long GetMinSize() const;
@@ -526,9 +526,9 @@ public:
{ Window::SetHelpText( rText ); }
XubString GetHelpText() const
{ return Window::GetHelpText(); };
- void SetHelpId( ULONG nId )
- { Window::SetHelpId( nId ); }
- ULONG GetHelpId() const
+ void SetHelpId( const rtl::OString& rId )
+ { Window::SetHelpId( rId ); }
+ const rtl::OString& GetHelpId() const
{ return Window::GetHelpId(); }
void SetStyle( WinBits nStyle );
diff --git a/svtools/inc/taskbar.hxx b/svtools/inc/taskbar.hxx
index 46853fa07c03..d4a6699e2d5e 100644
--- a/svtools/inc/taskbar.hxx
+++ b/svtools/inc/taskbar.hxx
@@ -268,7 +268,7 @@ private:
Image maImage;
XubString maQuickHelpText;
XubString maHelpText;
- ULONG mnHelpId;
+ rtl::OString maHelpId;
USHORT mnFlags;
public:
@@ -289,8 +289,8 @@ public:
const XubString& GetQuickHelpText() const { return maQuickHelpText; }
void SetHelpText( const XubString& rStr ) { maHelpText = rStr; }
const XubString& GetHelpText() const { return maHelpText; }
- void SetHelpId( ULONG nHelpId ) { mnHelpId = nHelpId; }
- ULONG GetHelpId() const { return mnHelpId; }
+ void SetHelpId( const rtl::OString& rHelpId ) { maHelpId = rHelpId; }
+ const rtl::OString& GetHelpId() const { return maHelpId; }
void SetFlags( USHORT nFlags ) { mnFlags = nFlags; }
USHORT GetFlags() const { return mnFlags; }
diff --git a/svtools/prj/d.lst b/svtools/prj/d.lst
index b46ddef72311..7b9c6a1957e3 100644
--- a/svtools/prj/d.lst
+++ b/svtools/prj/d.lst
@@ -38,3 +38,6 @@ dos: sh -c "if test %OS% = MACOSX; then macosx-create-bundle %_DEST%\bin%_EXT%\b
*.xml %_DEST%\xml%_EXT%\*.xml
+..\%__SRC%\misc\hatchwindowfactory.component %_DEST%\xml%_EXT%\hatchwindowfactory.component
+..\%__SRC%\misc\productregistration.uno.component %_DEST%\xml%_EXT%\productregistration.uno.component
+..\%__SRC%\misc\svt.component %_DEST%\xml%_EXT%\svt.component
diff --git a/svtools/source/config/menuoptions.cxx b/svtools/source/config/menuoptions.cxx
index 1551361f252f..e33251050b81 100644
--- a/svtools/source/config/menuoptions.cxx
+++ b/svtools/source/config/menuoptions.cxx
@@ -314,9 +314,16 @@ void SvtMenuOptions_Impl::Notify( const Sequence< OUString >& seqPropertyNames )
// We need values from ALL notified configuration keys.
DBG_ASSERT( !(seqPropertyNames.getLength()!=seqValues.getLength()), "SvtMenuOptions_Impl::Notify()\nI miss some values of configuration keys!\n" );
- sal_Bool bMenuIcons = true;
- sal_Bool bSystemMenuIcons = true;
- sal_Bool bMenuSettingsChanged = false;
+ sal_Bool bMenuSettingsChanged = sal_False;
+ sal_Bool bMenuIcons = sal_True;
+ sal_Bool bSystemMenuIcons = sal_True;
+ if (m_nMenuIcons == 2)
+ bMenuIcons = (sal_Bool)(Application::GetSettings().GetStyleSettings().GetUseImagesInMenus());
+ else
+ {
+ bSystemMenuIcons = sal_False;
+ bMenuIcons = m_nMenuIcons ? sal_True : sal_False;
+ }
// Step over list of property names and get right value from coreesponding value list to set it on internal members!
sal_Int32 nCount = seqPropertyNames.getLength();
diff --git a/svtools/source/contnr/ctrdll.cxx b/svtools/source/contnr/ctrdll.cxx
deleted file mode 100644
index 463c6ccc8b35..000000000000
--- a/svtools/source/contnr/ctrdll.cxx
+++ /dev/null
@@ -1,79 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svtools.hxx"
-
-#ifdef WIN
-#include <svwin.h>
-
-#ifndef _SYSDEP_HXX
-#include <sysdep.hxx>
-#endif
-
-// Statische DLL-Verwaltungs-Variablen
-static HINSTANCE hDLLInst = 0; // HANDLE der DLL
-
-
-/***************************************************************************
-|*
-|* LibMain()
-|*
-|* Beschreibung Initialisierungsfunktion der DLL
-|* Ersterstellung TH 05.05.93
-|* Letzte Aenderung TH 05.05.93
-|*
-***************************************************************************/
-
-extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR )
-{
-#ifndef WNT
- if ( nHeap )
- UnlockData( 0 );
-#endif
-
- hDLLInst = hDLL;
-
- return TRUE;
-}
-
-/***************************************************************************
-|*
-|* WEP()
-|*
-|* Beschreibung DLL-Deinitialisierung
-|* Ersterstellung TH 05.05.93
-|* Letzte Aenderung TH 05.05.93
-|*
-***************************************************************************/
-
-extern "C" int CALLBACK WEP( int )
-{
- return 1;
-}
-
-#endif
diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx
index af19379d8b8f..7c1dd8362e86 100644
--- a/svtools/source/contnr/fileview.cxx
+++ b/svtools/source/contnr/fileview.cxx
@@ -1443,16 +1443,16 @@ sal_Bool SvtFileView::GetParentURL( String& rParentURL ) const
// -----------------------------------------------------------------------
-sal_uInt32 SvtFileView::GetHelpId( ) const
+const rtl::OString& SvtFileView::GetHelpId( ) const
{
return mpImp->mpView->GetHelpId( );
}
// -----------------------------------------------------------------------
-void SvtFileView::SetHelpId( sal_uInt32 nHelpId )
+void SvtFileView::SetHelpId( const rtl::OString& rHelpId )
{
- mpImp->mpView->SetHelpId( nHelpId );
+ mpImp->mpView->SetHelpId( rHelpId );
}
// -----------------------------------------------------------------------
diff --git a/svtools/source/contnr/fileview.src b/svtools/source/contnr/fileview.src
index f40530c10347..bcb282f44615 100644
--- a/svtools/source/contnr/fileview.src
+++ b/svtools/source/contnr/fileview.src
@@ -110,6 +110,7 @@ Menu RID_FILEVIEW_CONTEXTMENU
ModalDialog DLG_SVT_QUERYDELETE
{
+ HelpID = "svtools:ModalDialog:DLG_SVT_QUERYDELETE";
SVLook = TRUE ;
OutputSize = TRUE ;
Moveable = TRUE ;
@@ -142,6 +143,7 @@ ModalDialog DLG_SVT_QUERYDELETE
PushButton BTN_YES
{
+ HelpID = "svtools:PushButton:DLG_SVT_QUERYDELETE:BTN_YES";
Pos = MAP_APPFONT ( 6 , 47 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
@@ -151,6 +153,7 @@ ModalDialog DLG_SVT_QUERYDELETE
PushButton BTN_ALL
{
+ HelpID = "svtools:PushButton:DLG_SVT_QUERYDELETE:BTN_ALL";
Pos = MAP_APPFONT ( 59 , 47 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
@@ -160,6 +163,7 @@ ModalDialog DLG_SVT_QUERYDELETE
PushButton BTN_NO
{
+ HelpID = "svtools:PushButton:DLG_SVT_QUERYDELETE:BTN_NO";
Pos = MAP_APPFONT ( 112 , 47 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
diff --git a/svtools/source/contnr/svicnvw.cxx b/svtools/source/contnr/svicnvw.cxx
index 20bcfe0fe33a..6fd0f5bf0c9c 100644
--- a/svtools/source/contnr/svicnvw.cxx
+++ b/svtools/source/contnr/svicnvw.cxx
@@ -50,7 +50,6 @@ SvIcnVwDataEntry::~SvIcnVwDataEntry()
SvIconView::SvIconView( Window* pParent, WinBits nWinStyle ) :
SvLBox( pParent, nWinStyle | WB_BORDER )
{
- nWinBits = nWinStyle;
nIcnVwFlags = 0;
pImp = new SvImpIconView( this, GetModel(), nWinStyle | WB_ICON );
pImp->mpViewData = 0;
@@ -72,8 +71,6 @@ SvIconView::SvIconView( Window* pParent , const ResId& rResId ) :
SetBackground( Wallpaper( rStyleSettings.GetFieldColor() ) );
SetDefaultFont();
pImp->SetSelectionMode( GetSelectionMode() );
- pImp->SetWindowBits( nWindowStyle );
- nWinBits = nWindowStyle;
}
SvIconView::~SvIconView()
@@ -403,10 +400,11 @@ SvLBoxEntry* SvIconView::GetEntryFromLogicPos( const Point& rDocPos ) const
}
-void SvIconView::SetWindowBits( WinBits nWinStyle )
+void SvIconView::StateChanged( StateChangedType i_nStateChange )
{
- nWinBits = nWinStyle;
- pImp->SetWindowBits( nWinStyle );
+ SvLBox::StateChanged( i_nStateChange );
+ if ( i_nStateChange == STATE_CHANGE_STYLE )
+ pImp->SetStyle( GetStyle() );
}
void SvIconView::PaintEntry( SvLBoxEntry* pEntry )
@@ -469,6 +467,7 @@ void SvIconView::SelectAll( BOOL bSelect, BOOL )
void SvIconView::SetCurEntry( SvLBoxEntry* _pEntry )
{
pImp->SetCursor( _pEntry );
+ OnCurrentEntryChanged();
}
SvLBoxEntry* SvIconView::GetCurEntry() const
@@ -550,9 +549,6 @@ void SvIconView::EditItemText( SvLBoxEntry* pEntry, SvLBoxItem* pItem,
aRect.Bottom() += 2; // sieht huebscher aus
-#ifdef WIN
- aRect.Bottom() += 4;
-#endif
#ifdef OS2
#if OS2_SINGLE_LINE_EDIT
diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx
index 35324d551858..c251903d02bd 100644
--- a/svtools/source/contnr/svimpbox.cxx
+++ b/svtools/source/contnr/svimpbox.cxx
@@ -45,6 +45,7 @@
#include <svimpbox.hxx>
#include <rtl/instance.hxx>
#include <svtools/svtdata.hxx>
+#include <tools/wintypes.hxx>
#ifndef _SVTOOLS_HRC
#include <svtools/svtools.hrc>
@@ -83,7 +84,7 @@ SvImpLBox::SvImpLBox( SvTreeListBox* pLBView, SvLBoxTreeList* pLBTree, WinBits n
pTree = pLBTree;
aSelEng.SetFunctionSet( (FunctionSet*)&aFctSet );
aSelEng.ExpandSelectionOnMouseMove( FALSE );
- SetWindowBits( nWinStyle );
+ SetStyle( nWinStyle );
SetSelectionMode( SINGLE_SELECTION );
SetDragDropMode( 0 );
@@ -253,10 +254,10 @@ void SvImpLBox::CalcCellFocusRect( SvLBoxEntry* pEntry, Rectangle& rRect )
}
}
-void SvImpLBox::SetWindowBits( WinBits nWinStyle )
+void SvImpLBox::SetStyle( WinBits i_nWinStyle )
{
- nWinBits = nWinStyle;
- if((nWinStyle & WB_SIMPLEMODE) && aSelEng.GetSelectionMode()==MULTIPLE_SELECTION)
+ m_nStyle = i_nWinStyle;
+ if ( ( m_nStyle & WB_SIMPLEMODE) && ( aSelEng.GetSelectionMode() == MULTIPLE_SELECTION ) )
aSelEng.AddAlways( TRUE );
}
@@ -683,6 +684,8 @@ void SvImpLBox::SetCursor( SvLBoxEntry* pEntry, BOOL bForceNoSelect )
}
}
nFlags &= (~F_DESEL_ALL);
+
+ pView->OnCurrentEntryChanged();
}
void SvImpLBox::ShowCursor( BOOL bShow )
@@ -952,7 +955,7 @@ void SvImpLBox::Paint( const Rectangle& rRect )
// erst die Linien Zeichnen, dann clippen!
pView->SetClipRegion();
- if( nWinBits & ( WB_HASLINES | WB_HASLINESATROOT ) )
+ if( m_nStyle & ( WB_HASLINES | WB_HASLINESATROOT ) )
DrawNet();
pView->SetClipRegion( aClipRegion );
@@ -969,7 +972,7 @@ void SvImpLBox::Paint( const Rectangle& rRect )
{
// do not select if multiselection or explicit set
BOOL bNotSelect = ( aSelEng.GetSelectionMode() == MULTIPLE_SELECTION )
- || ( ( nWinBits & WB_NOINITIALSELECTION ) == WB_NOINITIALSELECTION );
+ || ( ( m_nStyle & WB_NOINITIALSELECTION ) == WB_NOINITIALSELECTION );
SetCursor( pStartEntry, bNotSelect );
}
@@ -994,7 +997,7 @@ void SvImpLBox::MakeVisible( SvLBoxEntry* pEntry, BOOL bMoveToTop )
if( bInView && (!bMoveToTop || pStartEntry == pEntry) )
return; // ist schon sichtbar
- if( pStartEntry || (nWinBits & WB_FORCE_MAKEVISIBLE) )
+ if( pStartEntry || (m_nStyle & WB_FORCE_MAKEVISIBLE) )
nFlags &= (~F_FILLING);
if( !bInView )
{
@@ -1132,7 +1135,7 @@ void SvImpLBox::DrawNet()
pView->DrawLine( aPos1, aPos2 );
}
// Sichtbar im Control ?
- if( n>= nOffs && ((nWinBits & WB_HASLINESATROOT) || !pTree->IsAtRootDepth(pEntry)))
+ if( n>= nOffs && ((m_nStyle & WB_HASLINESATROOT) || !pTree->IsAtRootDepth(pEntry)))
{
// kann aPos1 recyclet werden ?
if( !pView->IsExpanded(pEntry) )
@@ -1154,7 +1157,7 @@ void SvImpLBox::DrawNet()
nY += nEntryHeight;
pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry ));
}
- if( nWinBits & WB_HASLINESATROOT )
+ if( m_nStyle & WB_HASLINESATROOT )
{
pEntry = pView->First();
aPos1.X() = pView->GetTabPos( pEntry, pFirstDynamicTab);
@@ -1248,7 +1251,8 @@ USHORT SvImpLBox::AdjustScrollBars( Size& rSize )
Size aOSize( pView->Control::GetOutputSizePixel() );
- BOOL bVerSBar = ( pView->nWindowStyle & WB_VSCROLL ) != 0;
+ const WinBits nWindowStyle = pView->GetStyle();
+ BOOL bVerSBar = ( nWindowStyle & WB_VSCROLL ) != 0;
BOOL bHorBar = FALSE;
long nMaxRight = aOSize.Width(); //GetOutputSize().Width();
Point aOrigin( pView->GetMapMode().GetOrigin() );
@@ -1256,7 +1260,7 @@ USHORT SvImpLBox::AdjustScrollBars( Size& rSize )
nMaxRight += aOrigin.X() - 1;
long nVis = nMostRight - aOrigin.X();
if( pTabBar || (
- (pView->nWindowStyle & WB_HSCROLL) &&
+ (nWindowStyle & WB_HSCROLL) &&
(nVis < nMostRight || nMaxRight < nMostRight) ))
bHorBar = TRUE;
@@ -1274,7 +1278,7 @@ USHORT SvImpLBox::AdjustScrollBars( Size& rSize )
nMaxRight -= nVerSBarWidth;
if( !bHorBar )
{
- if( (pView->nWindowStyle & WB_HSCROLL) &&
+ if( (nWindowStyle & WB_HSCROLL) &&
(nVis < nMostRight || nMaxRight < nMostRight) )
bHorBar = TRUE;
}
@@ -1439,7 +1443,7 @@ void SvImpLBox::FillView()
void SvImpLBox::ShowVerSBar()
{
- BOOL bVerBar = ( pView->nWindowStyle & WB_VSCROLL ) != 0;
+ BOOL bVerBar = ( pView->GetStyle() & WB_VSCROLL ) != 0;
ULONG nVis = 0;
if( !bVerBar )
nVis = pView->GetVisibleCount();
@@ -1681,7 +1685,7 @@ void SvImpLBox::EntrySelected( SvLBoxEntry* pEntry, BOOL bSelect )
return;
/*
- if( (nWinBits & WB_HIDESELECTION) && pEntry && !pView->HasFocus() )
+ if( (m_nStyle & WB_HIDESELECTION) && pEntry && !pView->HasFocus() )
{
SvViewData* pViewData = pView->GetViewData( pEntry );
pViewData->SetCursored( bSelect );
@@ -1943,7 +1947,7 @@ void SvImpLBox::EntryInserted( SvLBoxEntry* pEntry )
// die Linien invalidieren
/*
if( (bEntryVisible || bPrevEntryVisible) &&
- (nWinBits & ( WB_HASLINES | WB_HASLINESATROOT )) )
+ (m_nStyle & ( WB_HASLINES | WB_HASLINESATROOT )) )
{
SvLBoxTab* pTab = pView->GetFirstDynamicTab();
if( pTab )
@@ -2265,6 +2269,7 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt)
SvLBoxEntry* pNewCursor;
+ const WinBits nWindowStyle = pView->GetStyle();
switch( aCode )
{
case KEY_UP:
@@ -2348,7 +2353,7 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt)
CallEventListeners( VCLEVENT_LISTBOX_SELECT, pCursor );
}
}
- else if( pView->nWindowStyle & WB_HSCROLL )
+ else if( nWindowStyle & WB_HSCROLL )
{
long nThumb = aHorSBar.GetThumbPos();
nThumb += aHorSBar.GetLineSize();
@@ -2379,7 +2384,7 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt)
CallEventListeners( VCLEVENT_LISTBOX_SELECT, pCursor );
}
}
- else if ( pView->nWindowStyle & WB_HSCROLL )
+ else if ( nWindowStyle & WB_HSCROLL )
{
long nThumb = aHorSBar.GetThumbPos();
nThumb -= aHorSBar.GetLineSize();
@@ -2481,13 +2486,17 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt)
else if ( !bShift /*&& !bMod1*/ )
{
if ( aSelEng.IsAddMode() )
+ {
// toggle selection
pView->Select( pCursor, !pView->IsSelected( pCursor ) );
- else
+ }
+ else if ( !pView->IsSelected( pCursor ) )
{
SelAllDestrAnch( FALSE );
pView->Select( pCursor, TRUE );
}
+ else
+ bKeyUsed = FALSE;
}
else
bKeyUsed = FALSE;
@@ -2520,7 +2529,7 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt)
case KEY_F8:
if( bShift && pView->GetSelectionMode()==MULTIPLE_SELECTION &&
- !(nWinBits & WB_SIMPLEMODE))
+ !(m_nStyle & WB_SIMPLEMODE))
{
if( aSelEng.IsAlwaysAdding() )
aSelEng.AddAlways( FALSE );
@@ -2568,8 +2577,8 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt)
case KEY_A:
if( bMod1 )
SelAllDestrAnch( TRUE );
-// else
-// bKeyUsed = FALSE; #105907# assume user wants to use quicksearch with key "a", so key is handled!
+ else
+ bKeyUsed = FALSE;
break;
case KEY_SUBTRACT:
@@ -2680,10 +2689,15 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt)
break;
default:
- if( bMod1 || rKeyCode.GetGroup() == KEYGROUP_FKEYS )
- // #105907# CTRL or Function key is pressed, assume user don't want to use quicksearch...
- // if there are groups of keys which should not be handled, they can be added here
- bKeyUsed = FALSE;
+ // is there any reason why we should eat the events here? The only place where this is called
+ // is from SvTreeListBox::KeyInput. If we set bKeyUsed to TRUE here, then the key input
+ // is just silenced. However, we want SvLBox::KeyInput to get a chance, to do the QuickSelection
+ // handling.
+ // (The old code here which intentionally set bKeyUsed to TRUE said this was because of "quick search"
+ // handling, but actually there was no quick search handling anymore. We just re-implemented it.)
+ // #i31275# / 2009-06-16 / frank.schoenheit@sun.com
+ bKeyUsed = FALSE;
+ break;
}
return bKeyUsed;
}
@@ -2698,7 +2712,7 @@ void __EXPORT SvImpLBox::GetFocus()
// if( bSimpleTravel && !pView->IsSelected(pCursor) )
// pView->Select( pCursor, TRUE );
}
- if( nWinBits & WB_HIDESELECTION )
+ if( m_nStyle & WB_HIDESELECTION )
{
SvLBoxEntry* pEntry = pView->FirstSelected();
while( pEntry )
@@ -2731,7 +2745,7 @@ void __EXPORT SvImpLBox::LoseFocus()
pView->SetEntryFocus( pCursor,FALSE );
ShowCursor( FALSE );
- if( nWinBits & WB_HIDESELECTION )
+ if( m_nStyle & WB_HIDESELECTION )
{
SvLBoxEntry* pEntry = pView->FirstSelected();
while( pEntry )
@@ -3029,7 +3043,7 @@ void SvImpLBox::SetSelectionMode( SelectionMode eSelMode )
bSimpleTravel = TRUE;
else
bSimpleTravel = FALSE;
- if( (nWinBits & WB_SIMPLEMODE) && (eSelMode == MULTIPLE_SELECTION) )
+ if( (m_nStyle & WB_SIMPLEMODE) && (eSelMode == MULTIPLE_SELECTION) )
aSelEng.AddAlways( TRUE );
}
diff --git a/svtools/source/contnr/svimpicn.cxx b/svtools/source/contnr/svimpicn.cxx
index 2d4c9cf2df0e..0d335429d564 100644
--- a/svtools/source/contnr/svimpicn.cxx
+++ b/svtools/source/contnr/svimpicn.cxx
@@ -708,7 +708,7 @@ public:
SvImpIconView::SvImpIconView( SvIconView* pCurView, SvLBoxTreeList* pTree,
- WinBits nWinStyle ) :
+ WinBits i_nWinStyle ) :
aVerSBar( pCurView, WB_DRAG | WB_VSCROLL ),
aHorSBar( pCurView, WB_DRAG | WB_HSCROLL )
{
@@ -716,7 +716,7 @@ SvImpIconView::SvImpIconView( SvIconView* pCurView, SvLBoxTreeList* pTree,
pModel = pTree;
pCurParent = 0;
pZOrderList = new SvPtrarr;
- SetWindowBits( nWinStyle );
+ SetStyle( i_nWinStyle );
nHorDist = 0;
nVerDist = 0;
nFlags = 0;
@@ -785,13 +785,12 @@ void SvImpIconView::Clear( BOOL bInCtor )
AdjustScrollBars();
}
-void SvImpIconView::SetWindowBits( WinBits nWinStyle )
+void SvImpIconView::SetStyle( const WinBits i_nWinStyle )
{
- nWinBits = nWinStyle;
nViewMode = VIEWMODE_TEXT;
- if( nWinStyle & WB_NAME )
+ if( i_nWinStyle & WB_NAME )
nViewMode = VIEWMODE_NAME;
- if( nWinStyle & WB_ICON )
+ if( i_nWinStyle & WB_ICON )
nViewMode = VIEWMODE_ICON;
}
@@ -1702,11 +1701,6 @@ void SvImpIconView::PositionScrollBars( long nRealWidth, long nRealHeight )
Point aPos( 0, nRealHeight );
aPos.Y() -= nHorSBarHeight;
-#ifdef WIN
- // vom linken und unteren Rand ein Pixel abschneiden
- aPos.Y()++;
- aPos.X()--;
-#endif
#ifdef OS2
aPos.Y()++;
#endif
@@ -1717,7 +1711,7 @@ void SvImpIconView::PositionScrollBars( long nRealWidth, long nRealHeight )
aPos.X() = nRealWidth; aPos.Y() = 0;
aPos.X() -= nVerSBarWidth;
-#if defined(WIN) || defined(WNT)
+#if defined(WNT)
aPos.X()++;
aPos.Y()--;
#endif
@@ -1759,8 +1753,8 @@ void SvImpIconView::AdjustScrollBars()
else
nVisibleHeight = nRealHeight;
- bool bVerSBar = (pView->nWindowStyle & WB_VSCROLL) ? true : false;
- bool bHorSBar = (pView->nWindowStyle & WB_HSCROLL) ? true : false;
+ bool bVerSBar = (pView->GetStyle() & WB_VSCROLL) ? true : false;
+ bool bHorSBar = (pView->GetStyle() & WB_HSCROLL) ? true : false;
USHORT nResult = 0;
if( nVirtHeight )
@@ -1809,7 +1803,7 @@ void SvImpIconView::AdjustScrollBars()
// size ver scrollbar
long nThumb = aVerSBar.GetThumbPos();
Size aSize( nVerSBarWidth, nRealHeight );
-#if defined(WIN) || defined(WNT)
+#if defined(WNT)
aSize.Height() += 2;
#endif
#ifdef OS2
@@ -1834,7 +1828,7 @@ void SvImpIconView::AdjustScrollBars()
nThumb = aHorSBar.GetThumbPos();
aSize.Width() = nRealWidth;
aSize.Height() = nHorSBarHeight;
-#if defined(WIN) || defined(WNT)
+#if defined(WNT)
aSize.Width()++;
#endif
#ifdef OS2
@@ -1842,7 +1836,7 @@ void SvImpIconView::AdjustScrollBars()
if( nResult & 0x0001 ) // vertikale Scrollbar ?
aSize.Width()--;
#endif
-#if defined(WIN) || defined(WNT)
+#if defined(WNT)
if( nResult & 0x0001 ) // vertikale Scrollbar ?
{
aSize.Width()++;
@@ -1868,7 +1862,7 @@ void SvImpIconView::AdjustScrollBars()
nRealWidth++;
#endif
aOutputSize.Width() = nRealWidth;
-#if defined(WIN) || defined(WNT)
+#if defined(WNT)
if( nResult & 0x0002 ) // hor scrollbar ?
nRealHeight++; // weil unterer Rand geclippt wird
#endif
@@ -1908,7 +1902,7 @@ BOOL SvImpIconView::CheckHorScrollBar()
return FALSE;
const MapMode& rMapMode = pView->GetMapMode();
Point aOrigin( rMapMode.GetOrigin() );
- if(!(pView->nWindowStyle & WB_HSCROLL) && !aOrigin.X() )
+ if(!(pView->GetStyle() & WB_HSCROLL) && !aOrigin.X() )
{
long nWidth = aOutputSize.Width();
USHORT nCount = pZOrderList->Count();
@@ -1946,7 +1940,7 @@ BOOL SvImpIconView::CheckVerScrollBar()
return FALSE;
const MapMode& rMapMode = pView->GetMapMode();
Point aOrigin( rMapMode.GetOrigin() );
- if(!(pView->nWindowStyle & WB_VSCROLL) && !aOrigin.Y() )
+ if(!(pView->GetStyle() & WB_VSCROLL) && !aOrigin.Y() )
{
long nDeepest = 0;
long nHeight = aOutputSize.Height();
diff --git a/svtools/source/contnr/svlbitm.cxx b/svtools/source/contnr/svlbitm.cxx
index edb0a65cb39f..d260f984c2b0 100644
--- a/svtools/source/contnr/svlbitm.cxx
+++ b/svtools/source/contnr/svlbitm.cxx
@@ -406,7 +406,7 @@ BOOL SvLBoxButton::ClickHdl( SvLBox*, SvLBoxEntry* pEntry )
}
void SvLBoxButton::Paint( const Point& rPos, SvLBox& rDev, USHORT /* nFlags */,
- SvLBoxEntry* )
+ SvLBoxEntry* /*pEntry*/ )
{
DBG_CHKTHIS(SvLBoxButton,0);
USHORT nIndex = eKind == SvLBoxButtonKind_staticImage
@@ -418,14 +418,13 @@ void SvLBoxButton::Paint( const Point& rPos, SvLBox& rDev, USHORT /* nFlags */,
//Native drawing
///
BOOL bNativeOK = FALSE;
- Window *pWin = NULL;
- if( rDev.GetOutDevType() == OUTDEV_WINDOW )
- pWin = (Window*) &rDev;
-
- if ( nIndex != SV_BMP_STATICIMAGE && pWin && pWin->IsNativeControlSupported( (pData->IsRadio())? CTRL_RADIOBUTTON : CTRL_CHECKBOX, PART_ENTIRE_CONTROL) )
+ ControlType eCtrlType = (pData->IsRadio())? CTRL_RADIOBUTTON : CTRL_CHECKBOX;
+ if ( nIndex != SV_BMP_STATICIMAGE && rDev.IsNativeControlSupported( eCtrlType, PART_ENTIRE_CONTROL) )
{
+ Size aSize(pData->Width(), pData->Height());
+ ImplAdjustBoxSize( aSize, eCtrlType, &rDev );
ImplControlValue aControlValue;
- Rectangle aCtrlRegion( rPos, Size(pData->Width(), pData->Height()) );
+ Rectangle aCtrlRegion( rPos, aSize );
ControlState nState = 0;
//states CTRL_STATE_DEFAULT, CTRL_STATE_PRESSED and CTRL_STATE_ROLLOVER are not implemented
@@ -439,8 +438,8 @@ void SvLBoxButton::Paint( const Point& rPos, SvLBox& rDev, USHORT /* nFlags */,
else if ( IsStateTristate() )
aControlValue.setTristateVal( BUTTONVALUE_MIXED );
- bNativeOK = pWin->DrawNativeControl( (pData->IsRadio())? CTRL_RADIOBUTTON : CTRL_CHECKBOX, PART_ENTIRE_CONTROL,
- aCtrlRegion, nState, aControlValue, rtl::OUString() );
+ bNativeOK = rDev.DrawNativeControl( eCtrlType, PART_ENTIRE_CONTROL,
+ aCtrlRegion, nState, aControlValue, rtl::OUString() );
}
if( !bNativeOK)
@@ -459,13 +458,47 @@ void SvLBoxButton::Clone( SvLBoxItem* pSource )
pData = ((SvLBoxButton*)pSource)->pData;
}
+void SvLBoxButton::ImplAdjustBoxSize( Size& io_rSize, ControlType i_eType, Window* i_pParent )
+{
+ if ( i_pParent->IsNativeControlSupported( i_eType, PART_ENTIRE_CONTROL) )
+ {
+ ImplControlValue aControlValue;
+ Rectangle aCtrlRegion( Point( 0, 0 ), io_rSize );
+ ControlState nState = CTRL_STATE_ENABLED;
+
+ aControlValue.setTristateVal( BUTTONVALUE_ON );
+
+ Rectangle aNativeBounds, aNativeContent;
+ bool bNativeOK = i_pParent->GetNativeControlRegion( i_eType,
+ PART_ENTIRE_CONTROL,
+ aCtrlRegion,
+ nState,
+ aControlValue,
+ rtl::OUString(),
+ aNativeBounds,
+ aNativeContent );
+ if( bNativeOK )
+ {
+ Size aContentSize( aNativeContent.GetSize() );
+ // leave a little space around the box image (looks better
+ if( aContentSize.Height() + 2 > io_rSize.Height() )
+ io_rSize.Height() = aContentSize.Height() + 2;
+ }
+ }
+}
+
void SvLBoxButton::InitViewData( SvLBox* pView,SvLBoxEntry* pEntry,
SvViewDataItem* pViewData )
{
DBG_CHKTHIS(SvLBoxButton,0);
if( !pViewData )
pViewData = pView->GetViewDataItem( pEntry, this );
- pViewData->aSize = Size( pData->Width(), pData->Height() );
+ Size aSize( pData->Width(), pData->Height() );
+
+ ControlType eCtrlType = (pData->IsRadio())? CTRL_RADIOBUTTON : CTRL_CHECKBOX;
+ if ( eKind != SvLBoxButtonKind_staticImage && pView )
+ ImplAdjustBoxSize( aSize, eCtrlType, pView );
+ pViewData->aSize = aSize;
}
bool SvLBoxButton::CheckModification() const
diff --git a/svtools/source/contnr/svlbox.cxx b/svtools/source/contnr/svlbox.cxx
index a69253c69629..11e19c6bab3c 100644
--- a/svtools/source/contnr/svlbox.cxx
+++ b/svtools/source/contnr/svlbox.cxx
@@ -685,6 +685,7 @@ SvLBox_Impl::SvLBox_Impl( SvLBox& _rBox )
,m_bEntryMnemonicsEnabled( false )
,m_pLink( NULL )
,m_aMnemonicEngine( _rBox )
+ ,m_aQuickSelectionEngine( _rBox )
{
}
@@ -699,7 +700,6 @@ SvLBox::SvLBox( Window* pParent, WinBits nWinStyle ) :
DropTargetHelper( this ), DragSourceHelper( this ), eSelMode( NO_SELECTION )
{
DBG_CTOR(SvLBox,0);
- nWindowStyle = nWinStyle;
nDragOptions = DND_ACTION_COPYMOVE | DND_ACTION_LINK;
nImpFlags = 0;
pTargetEntry = 0;
@@ -724,7 +724,6 @@ SvLBox::SvLBox( Window* pParent, const ResId& rResId ) :
DBG_CTOR(SvLBox,0);
pTargetEntry = 0;
nImpFlags = 0;
- nWindowStyle = 0;
pLBoxImpl = new SvLBox_Impl( *this );
nDragOptions = DND_ACTION_COPYMOVE | DND_ACTION_LINK;
nDragDropMode = 0;
@@ -1251,6 +1250,12 @@ ULONG SvLBox::SelectChilds( SvLBoxEntry* , BOOL )
return 0;
}
+void SvLBox::OnCurrentEntryChanged()
+{
+ if ( !pLBoxImpl->m_bDoingQuickSelection )
+ pLBoxImpl->m_aQuickSelectionEngine.Reset();
+}
+
void SvLBox::SelectAll( BOOL /* bSelect */ , BOOL /* bPaint */ )
{
DBG_CHKTHIS(SvLBox,0);
@@ -1535,15 +1540,14 @@ void SvLBox::KeyInput( const KeyEvent& rKEvt )
Control::KeyInput( rKEvt );
}
-const void* SvLBox::FirstSearchEntry( String& _rEntryText )
+const void* SvLBox::FirstSearchEntry( String& _rEntryText ) const
{
SvLBoxEntry* pEntry = GetCurEntry();
if ( pEntry )
pEntry = const_cast< SvLBoxEntry* >( static_cast< const SvLBoxEntry* >( NextSearchEntry( pEntry, _rEntryText ) ) );
else
{
- if ( !pEntry )
- pEntry = FirstSelected();
+ pEntry = FirstSelected();
if ( !pEntry )
pEntry = First();
}
@@ -1554,11 +1558,23 @@ const void* SvLBox::FirstSearchEntry( String& _rEntryText )
return pEntry;
}
-const void* SvLBox::NextSearchEntry( const void* _pCurrentSearchEntry, String& _rEntryText )
+const void* SvLBox::NextSearchEntry( const void* _pCurrentSearchEntry, String& _rEntryText ) const
{
SvLBoxEntry* pEntry = const_cast< SvLBoxEntry* >( static_cast< const SvLBoxEntry* >( _pCurrentSearchEntry ) );
- pEntry = Next( pEntry );
+ if ( ( ( GetChildCount( pEntry ) > 0 )
+ || ( pEntry->HasChildsOnDemand() )
+ )
+ && !IsExpanded( pEntry )
+ )
+ {
+ pEntry = NextSibling( pEntry );
+ }
+ else
+ {
+ pEntry = Next( pEntry );
+ }
+
if ( !pEntry )
pEntry = First();
@@ -1572,7 +1588,7 @@ void SvLBox::SelectSearchEntry( const void* _pEntry )
{
SvLBoxEntry* pEntry = const_cast< SvLBoxEntry* >( static_cast< const SvLBoxEntry* >( _pEntry ) );
DBG_ASSERT( pEntry, "SvLBox::SelectSearchEntry: invalid entry!" );
- if ( pEntry )
+ if ( !pEntry )
return;
SelectAll( FALSE );
@@ -1580,17 +1596,50 @@ void SvLBox::SelectSearchEntry( const void* _pEntry )
Select( pEntry );
}
-void SvLBox::ExecuteSearchEntry( const void* /*_pEntry*/ )
+void SvLBox::ExecuteSearchEntry( const void* /*_pEntry*/ ) const
{
// nothing to do here, we have no "execution"
}
+::vcl::StringEntryIdentifier SvLBox::CurrentEntry( String& _out_entryText ) const
+{
+ // always accept the current entry if there is one
+ SvLBoxEntry* pCurrentEntry( GetCurEntry() );
+ if ( pCurrentEntry )
+ {
+ _out_entryText = GetEntryText( pCurrentEntry );
+ return pCurrentEntry;
+ }
+ return FirstSearchEntry( _out_entryText );
+}
+
+::vcl::StringEntryIdentifier SvLBox::NextEntry( ::vcl::StringEntryIdentifier _currentEntry, String& _out_entryText ) const
+{
+ return NextSearchEntry( _currentEntry, _out_entryText );
+}
+
+void SvLBox::SelectEntry( ::vcl::StringEntryIdentifier _entry )
+{
+ SelectSearchEntry( _entry );
+}
+
bool SvLBox::HandleKeyInput( const KeyEvent& _rKEvt )
{
- if ( !IsEntryMnemonicsEnabled() )
- return false;
+ if ( IsEntryMnemonicsEnabled()
+ && pLBoxImpl->m_aMnemonicEngine.HandleKeyEvent( _rKEvt )
+ )
+ return true;
+
+ if ( ( GetStyle() & WB_QUICK_SEARCH ) != 0 )
+ {
+ pLBoxImpl->m_bDoingQuickSelection = true;
+ const bool bHandled = pLBoxImpl->m_aQuickSelectionEngine.HandleKeyEvent( _rKEvt );
+ pLBoxImpl->m_bDoingQuickSelection = false;
+ if ( bHandled )
+ return true;
+ }
- return pLBoxImpl->m_aMnemonicEngine.HandleKeyEvent( _rKEvt );
+ return false;
}
SvLBoxEntry* SvLBox::GetEntry( const Point&, BOOL ) const
diff --git a/svtools/source/contnr/svtreebx.cxx b/svtools/source/contnr/svtreebx.cxx
index a8635c99d127..f4780fbf08ad 100644
--- a/svtools/source/contnr/svtreebx.cxx
+++ b/svtools/source/contnr/svtreebx.cxx
@@ -65,10 +65,10 @@ DBG_NAME(SvTreeListBox)
#define SV_LBOX_DEFAULT_INDENT_PIXEL 20
SvTreeListBox::SvTreeListBox( Window* pParent, WinBits nWinStyle )
- : SvLBox(pParent,nWinStyle )
+ : SvLBox( pParent, nWinStyle )
{
DBG_CTOR(SvTreeListBox,0);
- InitTreeView( nWinStyle );
+ InitTreeView();
SetSublistOpenWithLeftRight();
}
@@ -78,13 +78,13 @@ SvTreeListBox::SvTreeListBox( Window* pParent , const ResId& rResId )
{
DBG_CTOR(SvTreeListBox,0);
- InitTreeView( 0 );
+ InitTreeView();
Resize();
SetSublistOpenWithLeftRight();
}
-void SvTreeListBox::InitTreeView( WinBits nWinStyle )
+void SvTreeListBox::InitTreeView()
{
DBG_CHKTHIS(SvTreeListBox,0);
pCheckButtonData = NULL;
@@ -102,7 +102,7 @@ void SvTreeListBox::InitTreeView( WinBits nWinStyle )
nTreeFlags = TREEFLAG_RECALCTABS;
nIndent = SV_LBOX_DEFAULT_INDENT_PIXEL;
nEntryHeightOffs = SV_ENTRYHEIGHTOFFS_PIXEL;
- pImp = new SvImpLBox( this, GetModel(), nWinStyle );
+ pImp = new SvImpLBox( this, GetModel(), GetStyle() );
aContextBmpMode = SVLISTENTRYFLAG_EXPANDED;
nContextBmpWidthMax = 0;
@@ -110,7 +110,7 @@ void SvTreeListBox::InitTreeView( WinBits nWinStyle )
SetSpaceBetweenEntries( 0 );
SetLineColor();
InitSettings( TRUE, TRUE, TRUE );
- SetWindowBits( nWinStyle );
+ ImplInitStyle();
SetTabs();
}
@@ -227,8 +227,9 @@ void SvTreeListBox::SetTabs()
EndEditing( TRUE );
nTreeFlags &= (~TREEFLAG_RECALCTABS);
nFocusWidth = -1;
- BOOL bHasButtons = (nWindowStyle & WB_HASBUTTONS)!=0;
- BOOL bHasButtonsAtRoot = (nWindowStyle & (WB_HASLINESATROOT |
+ const WinBits nStyle( GetStyle() );
+ BOOL bHasButtons = (nStyle & WB_HASBUTTONS)!=0;
+ BOOL bHasButtonsAtRoot = (nStyle & (WB_HASLINESATROOT |
WB_HASBUTTONSATROOT))!=0;
long nStartPos = TAB_STARTPOS;
long nNodeWidthPixel = GetExpandedNodeBmp().GetSizePixel().Width();
@@ -1492,12 +1493,14 @@ SvLBoxEntry* SvTreeListBox::GetCurEntry() const
return pImp->GetCurEntry();
}
-void SvTreeListBox::SetWindowBits( WinBits nWinStyle )
+void SvTreeListBox::ImplInitStyle()
{
DBG_CHKTHIS(SvTreeListBox,0);
- nWindowStyle = nWinStyle;
+
+ const WinBits nWindowStyle = GetStyle();
+
nTreeFlags |= TREEFLAG_RECALCTABS;
- if( nWinStyle & WB_SORT )
+ if( nWindowStyle & WB_SORT )
{
GetModel()->SetSortMode( SortAscending );
GetModel()->SetCompareHdl( LINK(this,SvTreeListBox,DefaultCompare));
@@ -1508,9 +1511,9 @@ void SvTreeListBox::SetWindowBits( WinBits nWinStyle )
GetModel()->SetCompareHdl( Link() );
}
#ifdef OS2
- nWinStyle |= WB_VSCROLL;
+ nWindowStyle |= WB_VSCROLL;
#endif
- pImp->SetWindowBits( nWinStyle );
+ pImp->SetStyle( nWindowStyle );
pImp->Resize();
Invalidate();
}
@@ -1578,8 +1581,9 @@ long SvTreeListBox::PaintEntry1(SvLBoxEntry* pEntry,long nLine,USHORT nTabFlags,
BOOL bInUse = pEntry->HasInUseEmphasis();
// wenn eine ClipRegion von aussen gesetzt wird, dann
// diese nicht zuruecksetzen
- BOOL bResetClipRegion = !bHasClipRegion;
- BOOL bHideSelection = ((nWindowStyle & WB_HIDESELECTION) && !HasFocus())!=0;
+ const WinBits nWindowStyle = GetStyle();
+ const BOOL bResetClipRegion = !bHasClipRegion;
+ const BOOL bHideSelection = ((nWindowStyle & WB_HIDESELECTION) && !HasFocus())!=0;
const StyleSettings& rSettings = GetSettings().GetStyleSettings();
Font aHighlightFont( GetFont() );
@@ -2367,6 +2371,7 @@ void SvTreeListBox::ModelNotification( USHORT nActionId, SvListEntry* pEntry1,
long SvTreeListBox::GetTextOffset() const
{
DBG_CHKTHIS(SvTreeListBox,0);
+ const WinBits nWindowStyle = GetStyle();
BOOL bHasButtons = (nWindowStyle & WB_HASBUTTONS)!=0;
BOOL bHasButtonsAtRoot = (nWindowStyle & (WB_HASLINESATROOT |
WB_HASBUTTONSATROOT))!=0;
@@ -2519,6 +2524,8 @@ void SvTreeListBox::DataChanged( const DataChangedEvent& rDCEvt )
void SvTreeListBox::StateChanged( StateChangedType i_nStateChange )
{
SvLBox::StateChanged( i_nStateChange );
+ if ( i_nStateChange == STATE_CHANGE_STYLE )
+ ImplInitStyle();
}
void SvTreeListBox::InitSettings(BOOL bFont,BOOL bForeground,BOOL bBackground)
diff --git a/svtools/source/contnr/templwin.src b/svtools/source/contnr/templwin.src
index 048d052c18d8..45f9803539a1 100644
--- a/svtools/source/contnr/templwin.src
+++ b/svtools/source/contnr/templwin.src
@@ -289,12 +289,14 @@ ModalDialog DLG_DOCTEMPLATE
};
PushButton BTN_DOCTEMPLATE_MANAGE
{
+ HelpID = "svtools:PushButton:DLG_DOCTEMPLATE:BTN_DOCTEMPLATE_MANAGE";
Pos = MAP_APPFONT( 6, 230 );
Size = MAP_APPFONT( 50, 14 );
Text [ en-US ] = "Organi~ze...";
};
PushButton BTN_DOCTEMPLATE_EDIT
{
+ HelpID = "svtools:PushButton:DLG_DOCTEMPLATE:BTN_DOCTEMPLATE_EDIT";
Pos = MAP_APPFONT( 59, 230 );
Size = MAP_APPFONT( 50, 14 );
Text [ en-US ] = "~Edit";
diff --git a/svtools/source/contnr/treelist.cxx b/svtools/source/contnr/treelist.cxx
index 3395dffc28f5..1b96f1ac89e4 100644
--- a/svtools/source/contnr/treelist.cxx
+++ b/svtools/source/contnr/treelist.cxx
@@ -139,16 +139,6 @@ void SvTreeEntryList::DestroyAll()
}
-
-
-#if defined (WIN) && defined (MSC)
-// siehe BugId 42896: Die Funktionen Prev, PrevVisible, Next, NextVisible
-// (andere?) funktionieren nicht mit Optimierung.
-#pragma optimize ("", off)
-#endif
-
-
-
/*************************************************************************
|*
|* SvTreeList::
diff --git a/svtools/source/control/ctrldll.cxx b/svtools/source/control/ctrldll.cxx
deleted file mode 100644
index 2f3ff037be31..000000000000
--- a/svtools/source/control/ctrldll.cxx
+++ /dev/null
@@ -1,78 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svtools.hxx"
-
-#ifdef WIN
-#include <svwin.h>
-
-#ifndef _SYSDEP_HXX
-#include <sysdep.hxx>
-#endif
-
-// Statische DLL-Verwaltungs-Variablen
-static HINSTANCE hDLLInst = 0; // HANDLE der DLL
-
-/***************************************************************************
-|*
-|* LibMain()
-|*
-|* Beschreibung Initialisierungsfunktion der DLL
-|* Ersterstellung TH 05.05.93
-|* Letzte Aenderung TH 05.05.93
-|*
-***************************************************************************/
-
-extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR )
-{
-#ifndef WNT
- if ( nHeap )
- UnlockData( 0 );
-#endif
-
- hDLLInst = hDLL;
-
- return TRUE;
-}
-
-/***************************************************************************
-|*
-|* WEP()
-|*
-|* Beschreibung DLL-Deinitialisierung
-|* Ersterstellung TH 05.05.93
-|* Letzte Aenderung TH 05.05.93
-|*
-***************************************************************************/
-
-extern "C" int CALLBACK WEP( int )
-{
- return 1;
-}
-
-#endif
diff --git a/svtools/source/control/headbar.cxx b/svtools/source/control/headbar.cxx
index 1ae223bebf06..7b1f2ad87108 100644..100755
--- a/svtools/source/control/headbar.cxx
+++ b/svtools/source/control/headbar.cxx
@@ -53,7 +53,7 @@ struct ImplHeadItem
USHORT mnId;
HeaderBarItemBits mnBits;
long mnSize;
- ULONG mnHelpId;
+ rtl::OString maHelpId;
Image maImage;
XubString maOutText;
XubString maText;
@@ -1132,13 +1132,13 @@ void HeaderBar::RequestHelp( const HelpEvent& rHEvt )
}
else if ( rHEvt.GetMode() & HELPMODE_EXTENDED )
{
- ULONG nHelpId = GetHelpId( nItemId );
- if ( nHelpId )
+ rtl::OUString aHelpId( rtl::OStringToOUString( GetHelpId( nItemId ), RTL_TEXTENCODING_UTF8 ) );
+ if ( aHelpId.getLength() )
{
// Wenn eine Hilfe existiert, dann ausloesen
Help* pHelp = Application::GetHelp();
if ( pHelp )
- pHelp->Start( nHelpId, this );
+ pHelp->Start( aHelpId, this );
return;
}
}
@@ -1266,7 +1266,6 @@ void HeaderBar::InsertItem( USHORT nItemId, const XubString& rText,
pItem->mnId = nItemId;
pItem->mnBits = nBits;
pItem->mnSize = nSize;
- pItem->mnHelpId = 0;
pItem->maText = rText;
pItem->mpUserData = 0;
mpItemList->Insert( pItem, nPos );
@@ -1291,7 +1290,6 @@ void HeaderBar::InsertItem( USHORT nItemId,
pItem->mnId = nItemId;
pItem->mnBits = nBits;
pItem->mnSize = nSize;
- pItem->mnHelpId = 0;
pItem->maImage = rImage;
pItem->maText = rText;
pItem->mpUserData = 0;
@@ -1563,11 +1561,11 @@ XubString HeaderBar::GetHelpText( USHORT nItemId ) const
if ( nPos != HEADERBAR_ITEM_NOTFOUND )
{
ImplHeadItem* pItem = mpItemList->GetObject( nPos );
- if ( !pItem->maHelpText.Len() && pItem->mnHelpId )
+ if ( !pItem->maHelpText.Len() && pItem->maHelpId.getLength() )
{
Help* pHelp = Application::GetHelp();
if ( pHelp )
- pItem->maHelpText = pHelp->GetHelpText( pItem->mnHelpId, this );
+ pItem->maHelpText = pHelp->GetHelpText( rtl::OStringToOUString( pItem->maHelpId, RTL_TEXTENCODING_UTF8 ), this );
}
return pItem->maHelpText;
@@ -1578,22 +1576,22 @@ XubString HeaderBar::GetHelpText( USHORT nItemId ) const
// -----------------------------------------------------------------------
-void HeaderBar::SetHelpId( USHORT nItemId, ULONG nHelpId )
+void HeaderBar::SetHelpId( USHORT nItemId, const rtl::OString& rHelpId )
{
USHORT nPos = GetItemPos( nItemId );
if ( nPos != HEADERBAR_ITEM_NOTFOUND )
- mpItemList->GetObject( nPos )->mnHelpId = nHelpId;
+ mpItemList->GetObject( nPos )->maHelpId = rHelpId;
}
// -----------------------------------------------------------------------
-ULONG HeaderBar::GetHelpId( USHORT nItemId ) const
+rtl::OString HeaderBar::GetHelpId( USHORT nItemId ) const
{
USHORT nPos = GetItemPos( nItemId );
+ rtl::OString aRet;
if ( nPos != HEADERBAR_ITEM_NOTFOUND )
- return mpItemList->GetObject( nPos )->mnHelpId;
- else
- return 0;
+ aRet = mpItemList->GetObject( nPos )->maHelpId;
+ return aRet;
}
// -----------------------------------------------------------------------
diff --git a/svtools/source/control/inettbc.cxx b/svtools/source/control/inettbc.cxx
index 02a578629039..4aaa55409266 100644..100755
--- a/svtools/source/control/inettbc.cxx
+++ b/svtools/source/control/inettbc.cxx
@@ -41,10 +41,7 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/sdbc/XResultSet.hpp>
#include <com/sun/star/sdbc/XRow.hpp>
-
-#ifndef _COM_SUN_STAR_TASK_XINTERACTIONHANDLER_HDL_
-#include <com/sun/star/task/XInteractionHandler.hdl>
-#endif
+#include <com/sun/star/task/XInteractionHandler.hpp>
#include <com/sun/star/ucb/NumberedSortingInfo.hpp>
#include <com/sun/star/ucb/XAnyCompareFactory.hpp>
#include <com/sun/star/ucb/XProgressHandler.hpp>
@@ -165,7 +162,7 @@ SvtMatchContext_Impl::SvtMatchContext_Impl(
SvtURLBox* pBoxP, const String& rText )
: aLink( STATIC_LINK( this, SvtMatchContext_Impl, Select_Impl ) )
, aBaseURL( pBoxP->aBaseURL )
- , aText( rText )
+ , aText( rText )
, pBox( pBoxP )
, bStop( FALSE )
, bOnlyDirectories( pBoxP->bOnlyDirectories )
@@ -426,7 +423,7 @@ void SvtMatchContext_Impl::ReadFolder( const String& rURL,
uno::Reference< XDynamicResultSet > xDynResultSet;
ResultSetInclude eInclude = INCLUDE_FOLDERS_AND_DOCUMENTS;
if ( bOnlyDirectories )
- eInclude = INCLUDE_FOLDERS_ONLY;
+ eInclude = INCLUDE_FOLDERS_ONLY;
xDynResultSet = aCnt.createDynamicCursor( aProps, eInclude );
@@ -654,7 +651,7 @@ void SvtMatchContext_Impl::run()
{
// if text input is a directory, it must be part of the match list! Until then it is scanned
if ( UCBContentHelper::IsFolder( aMainURL ) && aURLObject.hasFinalSlash() )
- Insert( aText, aMatch );
+ Insert( aText, aMatch );
else
// otherwise the parent folder will be taken
aURLObject.removeSegment();
@@ -684,6 +681,7 @@ void SvtMatchContext_Impl::run()
aCurObj.SetURL( *aPickList.GetObject( nPos ) );
aCurObj.SetSmartURL( aCurObj.GetURLNoPass());
aCurMainURL = aCurObj.GetMainURL( INetURLObject::NO_DECODE );
+
if( eProt != INET_PROT_NOT_VALID && aCurObj.GetProtocol() != eProt )
continue;
@@ -708,7 +706,7 @@ void SvtMatchContext_Impl::run()
{
// try if text matches the scheme
String aScheme( INetURLObject::GetScheme( aCurObj.GetProtocol() ) );
- if ( aText.CompareTo( aScheme, aText.Len() ) == COMPARE_EQUAL && aText.Len() < aScheme.Len() )
+ if ( aText.CompareIgnoreCaseToAscii( aScheme, aText.Len() ) == COMPARE_EQUAL && aText.Len() < aScheme.Len() )
{
if( bFull )
aMatch = aCurObj.GetMainURL( INetURLObject::NO_DECODE );
@@ -727,7 +725,7 @@ void SvtMatchContext_Impl::run()
aCurString.Erase( 0, aScheme.Len() );
}
- if( aText.CompareTo( aCurString, aText.Len() )== COMPARE_EQUAL )
+ if( aText.CompareIgnoreCaseToAscii( aCurString, aText.Len() )== COMPARE_EQUAL )
{
if( bFull )
aMatch = aCurObj.GetMainURL( INetURLObject::NO_DECODE );
@@ -858,7 +856,8 @@ SvtURLBox::SvtURLBox( Window* pParent, const ResId& _rResId, INetProtocol eSmart
void SvtURLBox::ImplInit()
{
pImp = new SvtURLBox_Impl();
- SetHelpId( SID_OPENURL );
+
+ SetHelpId( ".uno:OpenURL" );
EnableAutocomplete( FALSE );
SetText( String() );
@@ -1314,7 +1313,7 @@ sal_Bool SvtURLBox_Impl::TildeParsing(
return sal_False; // no such user
#else
pPasswd = getpwnam( OUStringToOString( OUString( aUserName ), RTL_TEXTENCODING_ASCII_US ).getStr() );
- if( pPasswd )
+ if( pPasswd )
aParseTilde = String::CreateFromAscii( pPasswd->pw_dir );
else
return sal_False; // no such user
diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx
index 6fcbd92597ba..011dd4cd7956 100644..100755
--- a/svtools/source/control/ruler.cxx
+++ b/svtools/source/control/ruler.cxx
@@ -468,6 +468,7 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter )
BOOL bNoTicks = FALSE;
// Groessenvorberechnung
+ // Sizes calculation
BOOL bVertRight = FALSE;
if ( mnWinStyle & WB_HORZ )
nTickWidth = aPixSize.Width();
@@ -486,19 +487,21 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter )
}
long nMaxWidth = maVirDev.PixelToLogic( Size( mpData->nPageWidth, 0 ), maMapMode ).Width();
if ( nMaxWidth < 0 )
- nMaxWidth *= -1;
+ nMaxWidth = -nMaxWidth;
nMaxWidth /= aImplRulerUnitTab[mnUnitIndex].nTickUnit;
UniString aNumStr( UniString::CreateFromInt32( nMaxWidth ) );
long nTxtWidth = GetTextWidth( aNumStr );
- if ( (nTxtWidth*2) > nTickWidth )
+
+ const long nTextOff = 4;
+ if ( nTickWidth < nTxtWidth+nTextOff )
{
+ // Calculate the scale of the ruler
long nMulti = 1;
long nOrgTick3 = nTick3;
- long nTextOff = 2;
while ( nTickWidth < nTxtWidth+nTextOff )
{
long nOldMulti = nMulti;
- if ( !nTickWidth )
+ if ( !nTickWidth ) //If nTickWidth equals 0
nMulti *= 10;
else if ( nMulti < 10 )
nMulti++;
@@ -516,8 +519,7 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter )
bNoTicks = TRUE;
break;
}
- if ( nMulti >= 100 )
- nTextOff = 4;
+
nTick3 = nOrgTick3 * nMulti;
aPixSize = maVirDev.LogicToPixel( Size( nTick3, nTick3 ), maMapMode );
if ( mnWinStyle & WB_HORZ )
@@ -541,7 +543,7 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter )
{
if ( nStart > nMin )
{
- // Nur 0 malen, wenn Margin1 nicht gleich dem NullPunkt ist
+ // 0 is only painted when Margin1 is not equal to zero
if ( (mpData->nMargin1Style & RULER_STYLE_INVISIBLE) || (mpData->nMargin1 != 0) )
{
aNumStr = (sal_Unicode)'0';
@@ -564,7 +566,7 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter )
else
n = aPixSize.Height();
- // Tick3 - Ausgabe (Text)
+ // Tick3 - Output (Text)
if ( !(nTick % nTick3) )
{
aNumStr = UniString::CreateFromInt32( nTick / aImplRulerUnitTab[mnUnitIndex].nTickUnit );
@@ -573,7 +575,9 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter )
nX = nStart+n;
//different orientation needs a different starting position
nY = bVertRight ? nCenter+nTxtHeight2 : nCenter-nTxtHeight2;
- if ( nX < nMax )
+
+ // Check if we can display full number
+ if ( nX < (nMax-nTxtWidth2) )
{
if ( mnWinStyle & WB_HORZ )
nX -= nTxtWidth2;
@@ -582,7 +586,7 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter )
ImplVDrawText( nX, nY, aNumStr );
}
nX = nStart-n;
- if ( nX > nMin )
+ if ( nX > (nMin+nTxtWidth2) )
{
if ( mnWinStyle & WB_HORZ )
nX -= nTxtWidth2;
@@ -591,7 +595,7 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter )
ImplVDrawText( nX, nY, aNumStr );
}
}
- // Tick/Tick2 - Ausgabe (Striche)
+ // Tick/Tick2 - Output (Strokes)
else
{
if ( !(nTick % aImplRulerUnitTab[mnUnitIndex].nTick2) )
@@ -1258,7 +1262,7 @@ void Ruler::ImplFormat()
Size aVirDevSize;
BOOL b3DLook = !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO);
- // VirtualDevice initialisieren
+ // VirtualDevice initialize
if ( mnWinStyle & WB_HORZ )
{
aVirDevSize.Width() = mnVirWidth;
@@ -1387,15 +1391,15 @@ void Ruler::ImplFormat()
if ( nP2 < nVirRight )
nMax--;
- // Beschriftung ausgeben
+ // Draw captions
ImplDrawTicks( nMin, nMax, nStart, nCenter );
}
- // Spalten ausgeben
+ // Draw borders
if ( mpData->pBorders )
ImplDrawBorders( nVirLeft, nP2, nVirTop, nVirBottom );
- // Einzuege ausgeben
+ // Draw indents
if ( mpData->pIndents )
ImplDrawIndents( nVirLeft, nP2, nVirTop-1, nVirBottom+1 );
@@ -2888,7 +2892,7 @@ void Ruler::SetMargin2( long nPos, USHORT nMarginStyle )
void Ruler::SetLines( USHORT n, const RulerLine* pLineAry )
{
- // Testen, ob sich was geaendert hat
+ // To determine if what has changed
if ( mpData->nLines == n )
{
USHORT i = n;
@@ -2907,18 +2911,18 @@ void Ruler::SetLines( USHORT n, const RulerLine* pLineAry )
return;
}
- // Neue Werte setzen und neu ausgeben
+ // New values and new share issue
BOOL bMustUpdate;
if ( IsReallyVisible() && IsUpdateMode() )
bMustUpdate = TRUE;
else
bMustUpdate = FALSE;
- // Alte Linien loeschen
+ // Delete old lines
if ( bMustUpdate )
ImplInvertLines();
- // Neue Daten setzen
+ // New data set
if ( !n || !pLineAry )
{
if ( !mpData->pLines )
diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx
index 2ad81da40716..315e432edd60 100755
--- a/svtools/source/control/tabbar.cxx
+++ b/svtools/source/control/tabbar.cxx
@@ -60,7 +60,7 @@ struct ImplTabBarItem
XubString maHelpText;
Rectangle maRect;
long mnWidth;
- ULONG mnHelpId;
+ rtl::OString maHelpId;
BOOL mbShort;
BOOL mbSelect;
BOOL mbEnable;
@@ -76,7 +76,6 @@ struct ImplTabBarItem
mnId = nItemId;
mnBits = nPageBits;
mnWidth = 0;
- mnHelpId = 0;
mbShort = FALSE;
mbSelect = FALSE;
mbEnable = TRUE;
@@ -1394,13 +1393,13 @@ void TabBar::RequestHelp( const HelpEvent& rHEvt )
}
else if ( rHEvt.GetMode() & HELPMODE_EXTENDED )
{
- ULONG nHelpId = GetHelpId( nItemId );
- if ( nHelpId )
+ rtl::OUString aHelpId( rtl::OStringToOUString( GetHelpId( nItemId ), RTL_TEXTENCODING_UTF8 ) );
+ if ( aHelpId.getLength() )
{
// Wenn eine Hilfe existiert, dann ausloesen
Help* pHelp = Application::GetHelp();
if ( pHelp )
- pHelp->Start( nHelpId, this );
+ pHelp->Start( aHelpId, this );
return;
}
}
@@ -2400,11 +2399,11 @@ XubString TabBar::GetHelpText( USHORT nPageId ) const
if ( nPos != PAGE_NOT_FOUND )
{
ImplTabBarItem* pItem = mpItemList->GetObject( nPos );
- if ( !pItem->maHelpText.Len() && pItem->mnHelpId )
+ if ( !pItem->maHelpText.Len() && pItem->maHelpId.getLength() )
{
Help* pHelp = Application::GetHelp();
if ( pHelp )
- pItem->maHelpText = pHelp->GetHelpText( pItem->mnHelpId, this );
+ pItem->maHelpText = pHelp->GetHelpText( rtl::OStringToOUString( pItem->maHelpId, RTL_TEXTENCODING_UTF8 ), this );
}
return pItem->maHelpText;
@@ -2415,22 +2414,22 @@ XubString TabBar::GetHelpText( USHORT nPageId ) const
// -----------------------------------------------------------------------
-void TabBar::SetHelpId( USHORT nPageId, ULONG nHelpId )
+void TabBar::SetHelpId( USHORT nPageId, const rtl::OString& rHelpId )
{
USHORT nPos = GetPagePos( nPageId );
if ( nPos != PAGE_NOT_FOUND )
- mpItemList->GetObject( nPos )->mnHelpId = nHelpId;
+ mpItemList->GetObject( nPos )->maHelpId = rHelpId;
}
// -----------------------------------------------------------------------
-ULONG TabBar::GetHelpId( USHORT nPageId ) const
+rtl::OString TabBar::GetHelpId( USHORT nPageId ) const
{
USHORT nPos = GetPagePos( nPageId );
+ rtl::OString aRet;
if ( nPos != PAGE_NOT_FOUND )
- return mpItemList->GetObject( nPos )->mnHelpId;
- else
- return 0;
+ aRet = mpItemList->GetObject( nPos )->maHelpId;
+ return aRet;
}
// -----------------------------------------------------------------------
diff --git a/svtools/source/control/taskstat.cxx b/svtools/source/control/taskstat.cxx
index 2fdab63be37f..ba5e8d53b8b2 100644..100755
--- a/svtools/source/control/taskstat.cxx
+++ b/svtools/source/control/taskstat.cxx
@@ -517,13 +517,13 @@ void TaskStatusBar::RequestHelp( const HelpEvent& rHEvt )
{
if ( pItem )
{
- ULONG nHelpId = pItem->maItem.GetHelpId();
- if ( nHelpId )
+ rtl::OUString aHelpId( rtl::OStringToOUString( pItem->maItem.GetHelpId(), RTL_TEXTENCODING_UTF8 ) );
+ if ( aHelpId.getLength() )
{
// Wenn eine Hilfe existiert, dann ausloesen
Help* pHelp = Application::GetHelp();
if ( pHelp )
- pHelp->Start( nHelpId, this );
+ pHelp->Start( aHelpId, this );
return;
}
}
diff --git a/svtools/source/dialogs/addresstemplate.src b/svtools/source/dialogs/addresstemplate.src
index 0652dfb9d0f5..990dfc98f89b 100644
--- a/svtools/source/dialogs/addresstemplate.src
+++ b/svtools/source/dialogs/addresstemplate.src
@@ -39,6 +39,7 @@
ModalDialog DLG_ADDRESSBOOKSOURCE
{
+ HelpID = "svtools:ModalDialog:DLG_ADDRESSBOOKSOURCE";
SVLook = TRUE ;
OutputSize = TRUE ;
Size = MAP_APPFONT ( 300 , 88 + FIELD_ROW_HEIGHT * FIELD_PAIRS_VISIBLE ) ;
@@ -64,6 +65,7 @@ ModalDialog DLG_ADDRESSBOOKSOURCE
};
ComboBox CB_DATASOURCE
{
+ HelpID = "svtools:ComboBox:DLG_ADDRESSBOOKSOURCE:CB_DATASOURCE";
SVLook = TRUE ;
Pos = MAP_APPFONT ( 105, 13 ) ;
Size = MAP_APPFONT ( 96, 55 ) ;
@@ -73,6 +75,7 @@ ModalDialog DLG_ADDRESSBOOKSOURCE
};
PushButton PB_ADMINISTATE_DATASOURCES
{
+ HelpID = "svtools:PushButton:DLG_ADDRESSBOOKSOURCE:PB_ADMINISTATE_DATASOURCES";
Text [ en-US ] = "~Address Data Source...";
SVLook = TRUE ;
Pos = MAP_APPFONT ( 204, 13 ) ;
@@ -90,6 +93,7 @@ ModalDialog DLG_ADDRESSBOOKSOURCE
};
ComboBox CB_TABLE
{
+ HelpID = "svtools:ComboBox:DLG_ADDRESSBOOKSOURCE:CB_TABLE";
SVLook = TRUE ;
Pos = MAP_APPFONT ( 105, 30 ) ;
Size = MAP_APPFONT ( 96, 55 ) ;
diff --git a/svtools/source/dialogs/colrdlg.src b/svtools/source/dialogs/colrdlg.src
index ad9a5c1aa015..a93642b0bd05 100644
--- a/svtools/source/dialogs/colrdlg.src
+++ b/svtools/source/dialogs/colrdlg.src
@@ -29,6 +29,7 @@
#define DIFF 3
ModalDialog DLG_COLOR
{
+ HelpID = "svtools:ModalDialog:DLG_COLOR";
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 260 , 165 + DIFF ) ;
@@ -93,6 +94,7 @@ ModalDialog DLG_COLOR
};
MetricField NUM_CYAN
{
+ HelpID = "svtools:MetricField:DLG_COLOR:NUM_CYAN";
Border = TRUE ;
Pos = MAP_APPFONT ( 42 , 109 + DIFF ) ;
Size = MAP_APPFONT ( 26 , 12 ) ;
@@ -106,6 +108,7 @@ ModalDialog DLG_COLOR
};
MetricField NUM_MAGENTA
{
+ HelpID = "svtools:MetricField:DLG_COLOR:NUM_MAGENTA";
Border = TRUE ;
Pos = MAP_APPFONT ( 42 , 122 + DIFF ) ;
Size = MAP_APPFONT ( 26 , 12 ) ;
@@ -119,6 +122,7 @@ ModalDialog DLG_COLOR
};
MetricField NUM_YELLOW
{
+ HelpID = "svtools:MetricField:DLG_COLOR:NUM_YELLOW";
Border = TRUE ;
Pos = MAP_APPFONT ( 42 , 135 + DIFF ) ;
Size = MAP_APPFONT ( 26 , 12 ) ;
@@ -132,6 +136,7 @@ ModalDialog DLG_COLOR
};
MetricField NUM_KEY
{
+ HelpID = "svtools:MetricField:DLG_COLOR:NUM_KEY";
Border = TRUE ;
Pos = MAP_APPFONT ( 42 , 148 + DIFF ) ;
Size = MAP_APPFONT ( 26 , 12 ) ;
@@ -163,6 +168,7 @@ ModalDialog DLG_COLOR
};
NumericField NUM_RED
{
+ HelpID = "svtools:NumericField:DLG_COLOR:NUM_RED";
Border = TRUE ;
Pos = MAP_APPFONT ( 106 , 122 + DIFF ) ;
Size = MAP_APPFONT ( 26 , 12 ) ;
@@ -174,6 +180,7 @@ ModalDialog DLG_COLOR
};
NumericField NUM_GREEN
{
+ HelpID = "svtools:NumericField:DLG_COLOR:NUM_GREEN";
Border = TRUE ;
Pos = MAP_APPFONT ( 106 , 135 + DIFF ) ;
Size = MAP_APPFONT ( 26 , 12 ) ;
@@ -185,6 +192,7 @@ ModalDialog DLG_COLOR
};
NumericField NUM_BLUE
{
+ HelpID = "svtools:NumericField:DLG_COLOR:NUM_BLUE";
Border = TRUE ;
Pos = MAP_APPFONT ( 106 , 148 + DIFF ) ;
Size = MAP_APPFONT ( 26 , 12 ) ;
@@ -202,6 +210,7 @@ ModalDialog DLG_COLOR
};
NumericField NUM_HUE
{
+ HelpID = "svtools:NumericField:DLG_COLOR:NUM_HUE";
Border = TRUE ;
Pos = MAP_APPFONT ( 171 , 122 + DIFF ) ;
Size = MAP_APPFONT ( 26 , 12 ) ;
@@ -219,6 +228,7 @@ ModalDialog DLG_COLOR
};
NumericField NUM_SATURATION
{
+ HelpID = "svtools:NumericField:DLG_COLOR:NUM_SATURATION";
Border = TRUE ;
Pos = MAP_APPFONT ( 171 , 135 + DIFF ) ;
Size = MAP_APPFONT ( 26 , 12 ) ;
@@ -236,6 +246,7 @@ ModalDialog DLG_COLOR
};
NumericField NUM_LUMINANCE
{
+ HelpID = "svtools:NumericField:DLG_COLOR:NUM_LUMINANCE";
Border = TRUE ;
Pos = MAP_APPFONT ( 171 , 148 + DIFF ) ;
Size = MAP_APPFONT ( 26 , 12 ) ;
@@ -247,6 +258,7 @@ ModalDialog DLG_COLOR
};
PushButton BTN_1
{
+ HelpID = "svtools:PushButton:DLG_COLOR:BTN_1";
Pos = MAP_APPFONT ( 80 , 109 ) ;
Size = MAP_APPFONT ( 17 , 12 ) ;
Text = "~<--" ;
@@ -254,6 +266,7 @@ ModalDialog DLG_COLOR
};
PushButton BTN_2
{
+ HelpID = "svtools:PushButton:DLG_COLOR:BTN_2";
Pos = MAP_APPFONT ( 100 , 109 ) ;
Size = MAP_APPFONT ( 17 , 12 ) ;
Text = "--~>" ;
diff --git a/svtools/source/dialogs/filedlg2.cxx b/svtools/source/dialogs/filedlg2.cxx
index b0e77d658931..67262ba72c1a 100644
--- a/svtools/source/dialogs/filedlg2.cxx
+++ b/svtools/source/dialogs/filedlg2.cxx
@@ -68,9 +68,9 @@ DECLARE_LIST( UniStringList, UniString* )
// #define STD_BTN_WIDTH 90
// #define STD_BTN_HEIGHT 35
-#define INITCONTROL( p, ControlClass, nBits, aPos, aSize, aTitel, nHelpId ) \
+#define INITCONTROL( p, ControlClass, nBits, aPos, aSize, aTitel, rHelpId ) \
p = new ControlClass( GetPathDialog(), WinBits( nBits ) ); \
- p->SetHelpId( nHelpId ); \
+ p->SetHelpId( rHelpId ); \
p->SetPosSizePixel( aPos, aSize ); \
p->SetText( aTitel ); \
p->Show();
@@ -226,10 +226,10 @@ void ImpPathDialog::InitControls()
aPnt.X() = 2 * a6Siz.Width() + aEDSiz.Width();
aPnt.Y() = a6Siz.Height();
INITCONTROL( pOkBtn, PushButton, WB_DEFBUTTON,
- aPnt, aBtnSiz, aOkStr, 0 );
+ aPnt, aBtnSiz, aOkStr, "" );
aPnt.Y() += aBtnSiz.Height() + a3Siz.Height();
INITCONTROL( pCancelBtn, CancelButton, 0,
- aPnt, aBtnSiz, aCancelStr, 0 );
+ aPnt, aBtnSiz, aCancelStr, "" );
aPnt.Y() += aBtnSiz.Height() + a3Siz.Height();
INITCONTROL( pNewDirBtn, PushButton, WB_DEFBUTTON,
aPnt, aBtnSiz, aNewDirStr, HID_FILEDLG_NEWDIR );
@@ -347,7 +347,7 @@ IMPL_LINK( ImpPathDialog, ClickHdl, Button*, pBtn )
if ( pBtn == pHomeBtn )
{
::rtl::OUString aHomeDir;
- NAMESPACE_VOS( OSecurity ) aSecurity;
+ vos:: OSecurity aSecurity;
if ( aSecurity.getHomeDir( aHomeDir ) )
{
DirEntry aFile ( aHomeDir );
@@ -782,10 +782,10 @@ void ImpFileDialog::InitControls()
const long nButtonStartX = 2*nW+20+15;
INITCONTROL( pOkBtn, PushButton, WB_DEFBUTTON,
Point(nButtonStartX, 10), Size(STD_BTN_WIDTH, STD_BTN_HEIGHT),
- Button::GetStandardText( BUTTON_OK ), 0 );
+ Button::GetStandardText( BUTTON_OK ), "" );
INITCONTROL( pCancelBtn, CancelButton, 0,
Point(nButtonStartX, 45 ), Size(STD_BTN_WIDTH, STD_BTN_HEIGHT),
- Button::GetStandardText( BUTTON_CANCEL ), 0 );
+ Button::GetStandardText( BUTTON_CANCEL ), "" );
pLoadBtn = 0;
diff --git a/svtools/source/dialogs/printdlg.cxx b/svtools/source/dialogs/printdlg.cxx
index 532fd3f61bb2..dba5ed627952 100644
--- a/svtools/source/dialogs/printdlg.cxx
+++ b/svtools/source/dialogs/printdlg.cxx
@@ -28,26 +28,18 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
#include <tools/debug.hxx>
-#ifndef _SV_APP_HXX
#include <vcl/svapp.hxx>
-#endif
-#ifndef _VCL_PRINT_HXX
#include <vcl/print.hxx>
-#endif
#include <vcl/msgbox.hxx>
#include <vcl/jobset.hxx>
#include <tools/urlobj.hxx>
-
#include "printdlg.hrc"
#include "controldims.hrc"
#include <svtools/prnsetup.hxx>
#include <svtools/printdlg.hxx>
#include <svtools/svtdata.hxx>
#include <filedlg.hxx>
-#include "svl/pickerhelper.hxx"
-#ifndef _SVT_HELPID_HRC
#include <svtools/helpid.hrc>
-#endif
#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
#include <com/sun/star/ui/dialogs/XFilePicker.hpp>
diff --git a/svtools/source/dialogs/printdlg.src b/svtools/source/dialogs/printdlg.src
index 405accc63344..80c6e465d49a 100644
--- a/svtools/source/dialogs/printdlg.src
+++ b/svtools/source/dialogs/printdlg.src
@@ -31,6 +31,7 @@
ModalDialog DLG_SVT_PRNDLG_PRINTDLG
{
+ HelpID = "svtools:ModalDialog:DLG_SVT_PRNDLG_PRINTDLG";
SVLook = TRUE ;
OutputSize = TRUE ;
Moveable = TRUE ;
@@ -50,6 +51,7 @@ ModalDialog DLG_SVT_PRNDLG_PRINTDLG
};
ListBox LB_NAMES
{
+ HelpID = "svtools:ListBox:DLG_SVT_PRNDLG_PRINTDLG:LB_NAMES";
Border = TRUE ;
Pos = MAP_APPFONT ( 60 , 13 ) ;
Size = MAP_APPFONT ( 130 , 80 ) ;
@@ -58,6 +60,7 @@ ModalDialog DLG_SVT_PRNDLG_PRINTDLG
};
PushButton BTN_PROPERTIES
{
+ HelpID = "svtools:PushButton:DLG_SVT_PRNDLG_PRINTDLG:BTN_PROPERTIES";
Pos = MAP_APPFONT ( 193 , 12 ) ;
Size = MAP_APPFONT ( 60 , 14 ) ;
Text [ en-US ] = "Propert~ies..." ;
@@ -114,12 +117,14 @@ ModalDialog DLG_SVT_PRNDLG_PRINTDLG
};
Edit EDT_FAXNO
{
+ HelpID = "svtools:Edit:DLG_SVT_PRNDLG_PRINTDLG:EDT_FAXNO";
Border = TRUE;
Pos = MAP_APPFONT ( 60 , 73 );
Size = MAP_APPFONT ( 188 , 12 );
};
CheckBox CBX_FILEPRINT
{
+ HelpID = "svtools:CheckBox:DLG_SVT_PRNDLG_PRINTDLG:CBX_FILEPRINT";
Pos = MAP_APPFONT ( 12 , 73 ) ;
Size = MAP_APPFONT ( 75 , 10 ) ;
Text [ en-US ] = "Print to file" ;
@@ -132,6 +137,7 @@ ModalDialog DLG_SVT_PRNDLG_PRINTDLG
/*!!!
PushButton BTN_BROWSE
{
+ HelpID = "svtools:PushButton:DLG_SVT_PRNDLG_PRINTDLG:BTN_BROWSE";
Pos = MAP_APPFONT ( 234 , 75 ) ;
Size = MAP_APPFONT ( 14 , 14 ) ;
Text = "~..." ;
@@ -146,18 +152,21 @@ ModalDialog DLG_SVT_PRNDLG_PRINTDLG
};
RadioButton RBT_ALL_SHEETS
{
+ HelpID = "svtools:RadioButton:DLG_SVT_PRNDLG_PRINTDLG:RBT_ALL_SHEETS";
Pos = MAP_APPFONT ( 12 , 102 ) ;
Size = MAP_APPFONT ( 105 , 10 ) ;
Text [ en-US ] = "All sheets" ;
};
RadioButton RBT_SELECTED_SHEETS
{
+ HelpID = "svtools:RadioButton:DLG_SVT_PRNDLG_PRINTDLG:RBT_SELECTED_SHEETS";
Pos = MAP_APPFONT ( 12 , 115 ) ;
Size = MAP_APPFONT ( 105 , 10 ) ;
Text [ en-US ] = "Selected sheets" ;
};
RadioButton RBT_SELECTED_CELLS
{
+ HelpID = "svtools:RadioButton:DLG_SVT_PRNDLG_PRINTDLG:RBT_SELECTED_CELLS";
Pos = MAP_APPFONT ( 12 , 128 ) ;
Size = MAP_APPFONT ( 105 , 10 ) ;
Text [ en-US ] = "Selected cells" ;
@@ -170,24 +179,28 @@ ModalDialog DLG_SVT_PRNDLG_PRINTDLG
};
RadioButton RBT_ALL
{
+ HelpID = "svtools:RadioButton:DLG_SVT_PRNDLG_PRINTDLG:RBT_ALL";
Pos = MAP_APPFONT ( 12 , 152 ) ;
Size = MAP_APPFONT ( 105 , 10 ) ;
Text [ en-US ] = "All pages" ;
};
RadioButton RBT_PAGES
{
+ HelpID = "svtools:RadioButton:DLG_SVT_PRNDLG_PRINTDLG:RBT_PAGES";
Pos = MAP_APPFONT ( 12 , 165 ) ;
Size = MAP_APPFONT ( 50 , 10 ) ;
Text [ en-US ] = "Pages" ;
};
Edit EDT_PAGES
{
+ HelpID = "svtools:Edit:DLG_SVT_PRNDLG_PRINTDLG:EDT_PAGES";
Border = TRUE ;
Pos = MAP_APPFONT ( 65 , 164 ) ;
Size = MAP_APPFONT ( 52 , 12 ) ;
};
RadioButton RBT_SELECTION
{
+ HelpID = "svtools:RadioButton:DLG_SVT_PRNDLG_PRINTDLG:RBT_SELECTION";
Hide = TRUE ;
Pos = MAP_APPFONT ( 12 , 179 ) ;
Size = MAP_APPFONT ( 105 , 10 ) ;
@@ -213,6 +226,7 @@ ModalDialog DLG_SVT_PRNDLG_PRINTDLG
};
NumericField NUM_COPIES
{
+ HelpID = "svtools:NumericField:DLG_SVT_PRNDLG_PRINTDLG:NUM_COPIES";
Border = TRUE ;
Pos = MAP_APPFONT ( 201 , 102 ) ;
Size = MAP_APPFONT ( 33 , 12 ) ;
@@ -226,6 +240,7 @@ ModalDialog DLG_SVT_PRNDLG_PRINTDLG
};
CheckBox CBX_COLLATE
{
+ HelpID = "svtools:CheckBox:DLG_SVT_PRNDLG_PRINTDLG:CBX_COLLATE";
Pos = MAP_APPFONT ( 201 , 123 ) ;
Size = MAP_APPFONT ( 60 , 10 ) ;
Text [ en-US ] = "Co~llate" ;
@@ -249,6 +264,7 @@ ModalDialog DLG_SVT_PRNDLG_PRINTDLG
};
PushButton BTN_OPTIONS
{
+ HelpID = "svtools:PushButton:DLG_SVT_PRNDLG_PRINTDLG:BTN_OPTIONS";
Hide = TRUE ;
Pos = MAP_APPFONT ( 6 , 190 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
diff --git a/svtools/source/dialogs/prnsetup.src b/svtools/source/dialogs/prnsetup.src
index 1443a35e0f39..afdf7d56864e 100644
--- a/svtools/source/dialogs/prnsetup.src
+++ b/svtools/source/dialogs/prnsetup.src
@@ -138,6 +138,7 @@ String STR_SVT_PRNDLG_JOBCOUNT
ModalDialog DLG_SVT_PRNDLG_PRNSETUPDLG
{
+ HelpID = "svtools:ModalDialog:DLG_SVT_PRNDLG_PRNSETUPDLG";
OutputSize = TRUE ;
SVLook = TRUE ;
Moveable = TRUE ;
@@ -157,6 +158,7 @@ ModalDialog DLG_SVT_PRNDLG_PRNSETUPDLG
};
ListBox LB_NAMES
{
+ HelpID = "svtools:ListBox:DLG_SVT_PRNDLG_PRNSETUPDLG:LB_NAMES";
Border = TRUE ;
Pos = MAP_APPFONT ( 60 , 12 ) ;
Size = MAP_APPFONT ( 125 , 80 ) ;
@@ -165,6 +167,7 @@ ModalDialog DLG_SVT_PRNDLG_PRNSETUPDLG
};
PushButton BTN_PROPERTIES
{
+ HelpID = "svtools:PushButton:DLG_SVT_PRNDLG_PRNSETUPDLG:BTN_PROPERTIES";
Pos = MAP_APPFONT ( 188 , 12 ) ;
Size = MAP_APPFONT ( 60 , 14 ) ;
Text [ en-US ] = "Propert~ies..." ;
@@ -220,6 +223,7 @@ ModalDialog DLG_SVT_PRNDLG_PRNSETUPDLG
};
PushButton BTN_OPTIONS
{
+ HelpID = "svtools:PushButton:DLG_SVT_PRNDLG_PRNSETUPDLG:BTN_OPTIONS";
Pos = MAP_APPFONT ( 5 , 84 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text [ en-US ] = "~Options..." ;
diff --git a/svtools/source/dialogs/roadmapwizard.cxx b/svtools/source/dialogs/roadmapwizard.cxx
index c28cfe1d4b18..43b9fcddf91d 100644
--- a/svtools/source/dialogs/roadmapwizard.cxx
+++ b/svtools/source/dialogs/roadmapwizard.cxx
@@ -239,15 +239,15 @@ namespace svt
}
//--------------------------------------------------------------------
- void RoadmapWizard::SetRoadmapSmartHelpId( const SmartId& _rId, SmartIdUpdateMode _aMode )
+ void RoadmapWizard::SetRoadmapHelpId( const rtl::OString& _rId )
{
- m_pImpl->pRoadmap->SetSmartHelpId( _rId, _aMode );
+ m_pImpl->pRoadmap->SetHelpId( _rId );
}
//--------------------------------------------------------------------
- SmartId RoadmapWizard::GetRoadmapSmartHelpId() const
+ const rtl::OString& RoadmapWizard::GetRoadmapHelpId() const
{
- return m_pImpl->pRoadmap->GetSmartHelpId();
+ return m_pImpl->pRoadmap->GetHelpId();
}
//--------------------------------------------------------------------
diff --git a/svtools/source/dialogs/wizardmachine.cxx b/svtools/source/dialogs/wizardmachine.cxx
index 2053da80019d..41e759eda43b 100644
--- a/svtools/source/dialogs/wizardmachine.cxx
+++ b/svtools/source/dialogs/wizardmachine.cxx
@@ -197,7 +197,7 @@ namespace svt
if (_nButtonFlags & WZB_PREVIOUS)
{
m_pPrevPage = new PushButton(this, WB_TABSTOP);
- m_pPrevPage->SetSmartHelpId( SmartId(HID_WIZARD_PREVIOUS) );
+ m_pPrevPage->SetHelpId( HID_WIZARD_PREVIOUS );
m_pPrevPage->SetSizePixel( LogicToPixel( Size( 50, 14 ), MAP_APPFONT ) );
m_pPrevPage->SetText(String(SvtResId(STR_WIZDLG_PREVIOUS)));
m_pPrevPage->Show();
@@ -214,7 +214,7 @@ namespace svt
if (_nButtonFlags & WZB_NEXT)
{
m_pNextPage = new PushButton(this, WB_TABSTOP);
- m_pNextPage->SetSmartHelpId( SmartId(HID_WIZARD_NEXT) );
+ m_pNextPage->SetHelpId( HID_WIZARD_NEXT );
m_pNextPage->SetSizePixel( LogicToPixel( Size( 50, 14 ), MAP_APPFONT ) );
m_pNextPage->SetText(String(SvtResId(STR_WIZDLG_NEXT)));
m_pNextPage->Show();
diff --git a/svtools/source/edit/editsyntaxhighlighter.cxx b/svtools/source/edit/editsyntaxhighlighter.cxx
index 01bb7ad41682..af38c444c0f2 100644
--- a/svtools/source/edit/editsyntaxhighlighter.cxx
+++ b/svtools/source/edit/editsyntaxhighlighter.cxx
@@ -193,7 +193,7 @@ void MultiLineEditSyntaxHighlight::UpdateData()
GetTextEngine()->RemoveAttribs( nLine, TRUE );
HighlightPortions aPortions;
aHighlighter.getHighlightPortions( nLine, aLine, aPortions );
- for ( USHORT i = 0; i < aPortions.Count(); i++ )
+ for ( size_t i = 0; i < aPortions.size(); i++ )
{
HighlightPortion& r = aPortions[i];
GetTextEngine()->SetAttrib( TextAttribFontColor( GetColorValue(r.tokenType) ), nLine, r.nBegin, r.nEnd, TRUE );
diff --git a/svtools/source/edit/makefile.mk b/svtools/source/edit/makefile.mk
index 58a63be58f78..8d4da553cb0d 100644
--- a/svtools/source/edit/makefile.mk
+++ b/svtools/source/edit/makefile.mk
@@ -38,25 +38,23 @@ TARGET=edit
# --- Files --------------------------------------------------------
SLOFILES= \
+ $(EXCEPTIONSFILES) \
$(SLO)$/textdata.obj \
- $(SLO)$/textdoc.obj \
- $(SLO)$/texteng.obj \
$(SLO)$/textundo.obj \
- $(SLO)$/textview.obj \
$(SLO)$/txtattr.obj \
$(SLO)$/xtextedt.obj \
$(SLO)$/sychconv.obj \
$(SLO)$/svmedit.obj \
$(SLO)$/svmedit2.obj \
- $(SLO)$/textwindowpeer.obj \
- $(SLO)$/syntaxhighlight.obj \
$(SLO)$/editsyntaxhighlighter.obj
EXCEPTIONSFILES= \
$(SLO)$/textview.obj \
$(SLO)$/textdoc.obj \
$(SLO)$/texteng.obj \
- $(SLO)$/textwindowpeer.obj
+ $(SLO)$/textwindowpeer.obj \
+ $(SLO)$/syntaxhighlight.obj \
+
# --- Targets ------------------------------------------------------
diff --git a/svtools/source/edit/syntaxhighlight.cxx b/svtools/source/edit/syntaxhighlight.cxx
index 5729eb712bfe..87585f5b2587 100644
--- a/svtools/source/edit/syntaxhighlight.cxx
+++ b/svtools/source/edit/syntaxhighlight.cxx
@@ -34,9 +34,6 @@
#include <tools/debug.hxx>
-SV_IMPL_VARARR(HighlightPortions, HighlightPortion)
-
-
// ##########################################################################
// ATTENTION: all these words needs to be in small caps
// ##########################################################################
@@ -849,7 +846,7 @@ void SimpleTokenizer_Impl::getHighlightPortions( UINT32 nParseLine, const String
portion.nEnd = (UINT16)(pEndPos - mpStringBegin);
portion.tokenType = eType;
- portions.Insert(portion, portions.Count());
+ portions.push_back(portion);
}
}
diff --git a/svtools/source/edit/textdata.cxx b/svtools/source/edit/textdata.cxx
index 32bdfe40a3fb..cb33ea7d50e6 100644
--- a/svtools/source/edit/textdata.cxx
+++ b/svtools/source/edit/textdata.cxx
@@ -37,7 +37,7 @@ SV_IMPL_PTRARR( TextLines, TextLinePtr );
SV_IMPL_VARARR( TEWritingDirectionInfos, TEWritingDirectionInfo );
- // -------------------------------------------------------------------------
+// -------------------------------------------------------------------------
// (+) class TextSelection
// -------------------------------------------------------------------------
@@ -66,7 +66,7 @@ void TextSelection::Justify()
}
- // -------------------------------------------------------------------------
+// -------------------------------------------------------------------------
// (+) class TETextPortionList
// -------------------------------------------------------------------------
TETextPortionList::TETextPortionList()
@@ -129,7 +129,7 @@ USHORT TETextPortionList::GetPortionStartIndex( USHORT nPortion )
*/
- // -------------------------------------------------------------------------
+// -------------------------------------------------------------------------
// (+) class TEParaPortion
// -------------------------------------------------------------------------
TEParaPortion::TEParaPortion( TextNode* pN )
@@ -254,7 +254,7 @@ void TEParaPortion::CorrectValuesBehindLastFormattedLine( USHORT nLastFormattedL
}
}
- // -------------------------------------------------------------------------
+// -------------------------------------------------------------------------
// (+) class TEParaPortions
// -------------------------------------------------------------------------
TEParaPortions::TEParaPortions()
@@ -274,7 +274,7 @@ void TEParaPortions::Reset()
clear();
}
- // -------------------------------------------------------------------------
+// -------------------------------------------------------------------------
// (+) class IdleFormatter
// -------------------------------------------------------------------------
IdleFormatter::IdleFormatter()
diff --git a/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.cxx b/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.cxx
index 038930ef80ee..1c4eeeff1bbf 100644
--- a/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.cxx
+++ b/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.cxx
@@ -36,9 +36,7 @@
#include <osl/module.hxx>
#include <svl/solar.hrc>
#include <svtools/fltcall.hxx>
-#include "dlgexpor.hxx"
-#include "dlgejpg.hxx"
-#include "dlgepng.hxx"
+#include "exportdialog.hxx"
#include <uno/mapping.hxx>
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/document/XViewDataSupplier.hpp>
@@ -49,12 +47,6 @@
#include <unotools/syslocale.hxx>
#include "vcl/svapp.hxx"
-#if defined WIN || (defined OS2 && !defined ICC)
-#define EXPDLG_FUNCTION_NAME "_DoExportDialog"
-#else
-#define EXPDLG_FUNCTION_NAME "DoExportDialog"
-#endif
-
using namespace ::rtl;
using namespace ::com::sun::star;
@@ -93,9 +85,10 @@ uno::Sequence< OUString > SAL_CALL SvFilterOptionsDialog_getSupportedServiceName
// -----------------------------------------------------------------------------
-SvFilterOptionsDialog::SvFilterOptionsDialog( const uno::Reference< lang::XMultiServiceFactory > & xMgr ) :
- rxMgr ( xMgr ),
- eFieldUnit ( FUNIT_CM )
+SvFilterOptionsDialog::SvFilterOptionsDialog( const uno::Reference< lang::XMultiServiceFactory > xMgr ) :
+ mxMgr ( xMgr ),
+ meFieldUnit ( FUNIT_CM ),
+ mbExportSelection ( sal_False )
{
}
@@ -148,18 +141,18 @@ uno::Sequence< beans::PropertyValue > SvFilterOptionsDialog::getPropertyValues()
throw ( uno::RuntimeException )
{
sal_Int32 i, nCount;
- for ( i = 0, nCount = aMediaDescriptor.getLength(); i < nCount; i++ )
+ for ( i = 0, nCount = maMediaDescriptor.getLength(); i < nCount; i++ )
{
- if ( aMediaDescriptor[ i ].Name.equalsAscii( "FilterData" ) )
+ if ( maMediaDescriptor[ i ].Name.equalsAscii( "FilterData" ) )
break;
}
if ( i == nCount )
- aMediaDescriptor.realloc( ++nCount );
+ maMediaDescriptor.realloc( ++nCount );
// the "FilterData" Property is an Any that will contain our PropertySequence of Values
- aMediaDescriptor[ i ].Name = String( RTL_CONSTASCII_USTRINGPARAM( "FilterData" ) );
- aMediaDescriptor[ i ].Value <<= aFilterDataSequence;
- return aMediaDescriptor;
+ maMediaDescriptor[ i ].Name = String( RTL_CONSTASCII_USTRINGPARAM( "FilterData" ) );
+ maMediaDescriptor[ i ].Value <<= maFilterDataSequence;
+ return maMediaDescriptor;
}
void SvFilterOptionsDialog::setPropertyValues( const uno::Sequence< beans::PropertyValue > & aProps )
@@ -167,15 +160,18 @@ void SvFilterOptionsDialog::setPropertyValues( const uno::Sequence< beans::Prope
lang::IllegalArgumentException, lang::WrappedTargetException,
uno::RuntimeException )
{
- aMediaDescriptor = aProps;
+ maMediaDescriptor = aProps;
sal_Int32 i, nCount;
- for ( i = 0, nCount = aMediaDescriptor.getLength(); i < nCount; i++ )
+ for ( i = 0, nCount = maMediaDescriptor.getLength(); i < nCount; i++ )
{
- if ( aMediaDescriptor[ i ].Name.equalsAscii( "FilterData" ) )
+ if ( maMediaDescriptor[ i ].Name.equalsAscii( "FilterData" ) )
{
- aMediaDescriptor[ i ].Value >>= aFilterDataSequence;
- break;
+ maMediaDescriptor[ i ].Value >>= maFilterDataSequence;
+ }
+ else if ( maMediaDescriptor[ i ].Name.equalsAscii( "SelectionOnly" ) )
+ {
+ maMediaDescriptor[ i ].Value >>= mbExportSelection;
}
}
}
@@ -184,7 +180,7 @@ void SvFilterOptionsDialog::setPropertyValues( const uno::Sequence< beans::Prope
void SvFilterOptionsDialog::setTitle( const OUString& aTitle )
throw ( uno::RuntimeException )
{
- aDialogTitle = aTitle;
+ maDialogTitle = aTitle;
}
sal_Int16 SvFilterOptionsDialog::execute()
@@ -194,13 +190,13 @@ sal_Int16 SvFilterOptionsDialog::execute()
String aFilterNameStr( RTL_CONSTASCII_USTRINGPARAM( "FilterName" ) );
String aInternalFilterName;
- sal_Int32 j, nCount = aMediaDescriptor.getLength();
+ sal_Int32 j, nCount = maMediaDescriptor.getLength();
for ( j = 0; j < nCount; j++ )
{
- if ( aMediaDescriptor[ j ].Name.equals( aFilterNameStr ) )
+ if ( maMediaDescriptor[ j ].Name.equals( aFilterNameStr ) )
{
OUString aStr;
- aMediaDescriptor[ j ].Value >>= aStr;
+ maMediaDescriptor[ j ].Value >>= aStr;
aInternalFilterName = aStr;
aInternalFilterName.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "draw_" ) ), String(), 0 );
aInternalFilterName.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "impress_" ) ), String(), 0 );
@@ -219,79 +215,24 @@ sal_Int16 SvFilterOptionsDialog::execute()
}
if ( nFormat < nFilterCount )
{
- FltCallDialogParameter aFltCallDlgPara( Application::GetDefDialogParent(), NULL, eFieldUnit );
- aFltCallDlgPara.aFilterData = aFilterDataSequence;
-
- String aFilterName( aGraphicFilter.pConfig->GetExportFilterName( nFormat ) );
- if ( aGraphicFilter.pConfig->IsExportInternalFilter( nFormat ) )
- {
- // Export-Dialog fuer Bitmap's, SVM's und WMF's
- if( ( aFilterName.EqualsIgnoreCaseAscii( EXP_BMP ) ) ||
- ( aFilterName.EqualsIgnoreCaseAscii( EXP_SVMETAFILE ) ) ||
- ( aFilterName.EqualsIgnoreCaseAscii( EXP_WMF ) ) ||
- ( aFilterName.EqualsIgnoreCaseAscii( EXP_EMF ) ) ||
- ( aFilterName.EqualsIgnoreCaseAscii( EXP_JPEG ) )||
- ( aFilterName.EqualsIgnoreCaseAscii( EXP_PNG ) ) )
- {
- ByteString aResMgrName( "svt", 3 );
- ResMgr* pResMgr;
-
- pResMgr = ResMgr::CreateResMgr( aResMgrName.GetBuffer(), Application::GetSettings().GetUILocale() );
- aFltCallDlgPara.pResMgr = pResMgr;
- // JPEG-Dialog
- if( aFilterName.EqualsIgnoreCaseAscii( EXP_JPEG ) )
- {
- if ( DlgExportEJPG( aFltCallDlgPara ).Execute() == RET_OK )
- nRet = ui::dialogs::ExecutableDialogResults::OK;
- }
- else if ( aFilterName.EqualsIgnoreCaseAscii( EXP_PNG ) )
- {
- if ( DlgExportEPNG( aFltCallDlgPara ).Execute() == RET_OK )
- nRet = ui::dialogs::ExecutableDialogResults::OK;
- }
- else if( aFilterName.EqualsIgnoreCaseAscii( EXP_BMP ) )
- {
- // Fuer Vektorformate nehmen wir den Vektor-Dialog
- aFltCallDlgPara.aFilterExt = aGraphicFilter.pConfig->GetExportFormatShortName( nFormat );
- if ( DlgExportPix( aFltCallDlgPara ).Execute() == RET_OK )
- nRet = ui::dialogs::ExecutableDialogResults::OK;
- }
- else
- {
- aFltCallDlgPara.aFilterExt = aGraphicFilter.pConfig->GetExportFormatShortName( nFormat );
- if ( DlgExportVec( aFltCallDlgPara ).Execute() == RET_OK )
- nRet = ui::dialogs::ExecutableDialogResults::OK;
- }
- delete pResMgr;
- }
- }
- else // ladbare Filter
- {
- xub_StrLen i, nTokenCount = aGraphicFilter.aFilterPath.GetTokenCount( ';' );
- for ( i = 0; i < nTokenCount; i++ )
- {
-
- OUString aPathURL;
-
- ::osl::FileBase::getFileURLFromSystemPath( aGraphicFilter.aFilterPath.GetToken( i ), aPathURL );
- aPathURL += String( '/' );
-
- OUString aSystemPath;
- ::osl::FileBase::getSystemPathFromFileURL( aPathURL, aSystemPath );
- aSystemPath += OUString( aFilterName );
-
- osl::Module aLibrary( aSystemPath );
- PFilterDlgCall pFunc = (PFilterDlgCall) aLibrary.getFunctionSymbol( UniString::CreateFromAscii( EXPDLG_FUNCTION_NAME ) );
- // Dialog in DLL ausfuehren
- if( pFunc )
- {
- if ( (*pFunc)( aFltCallDlgPara ) )
- nRet = ui::dialogs::ExecutableDialogResults::OK;
- }
- }
- }
+ FltCallDialogParameter aFltCallDlgPara( Application::GetDefDialogParent(), NULL, meFieldUnit );
+ aFltCallDlgPara.aFilterData = maFilterDataSequence;
+
+ ByteString aResMgrName( "svt", 3 );
+ ResMgr* pResMgr;
+
+ pResMgr = ResMgr::CreateResMgr( aResMgrName.GetBuffer(), Application::GetSettings().GetUILocale() );
+ aFltCallDlgPara.pResMgr = pResMgr;
+
+ aFltCallDlgPara.aFilterExt = aGraphicFilter.pConfig->GetExportFormatShortName( nFormat );
+ sal_Bool bIsPixelFormat( aGraphicFilter.pConfig->IsExportPixelFormat( nFormat ) );
+ if ( ExportDialog( aFltCallDlgPara, mxMgr, mxSourceDocument, mbExportSelection, bIsPixelFormat ).Execute() == RET_OK )
+ nRet = ui::dialogs::ExecutableDialogResults::OK;
+
+ delete pResMgr;
+
// taking the out parameter from the dialog
- aFilterDataSequence = aFltCallDlgPara.aFilterData;
+ maFilterDataSequence = aFltCallDlgPara.aFilterData;
}
}
return nRet;
@@ -301,6 +242,8 @@ sal_Int16 SvFilterOptionsDialog::execute()
void SvFilterOptionsDialog::setSourceDocument( const uno::Reference< lang::XComponent >& xDoc )
throw ( lang::IllegalArgumentException, uno::RuntimeException )
{
+ mxSourceDocument = xDoc;
+
// try to set the corresponding metric unit
String aConfigPath;
uno::Reference< lang::XServiceInfo > xServiceInfo
@@ -320,7 +263,7 @@ void SvFilterOptionsDialog::setSourceDocument( const uno::Reference< lang::XComp
aPropertyName = String( RTL_CONSTASCII_USTRINGPARAM( "Metric" ) );
else
aPropertyName = String( RTL_CONSTASCII_USTRINGPARAM( "NonMetric" ) );
- eFieldUnit = (FieldUnit)aConfigItem.ReadInt32( aPropertyName, FUNIT_CM );
+ meFieldUnit = (FieldUnit)aConfigItem.ReadInt32( aPropertyName, FUNIT_CM );
}
}
}
diff --git a/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.hxx b/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.hxx
index a55fc4c84520..16592bac8df7 100644
--- a/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.hxx
+++ b/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.hxx
@@ -46,18 +46,22 @@ class SvFilterOptionsDialog : public cppu::WeakImplHelper5
com::sun::star::lang::XServiceInfo
>
{
- const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > &
- rxMgr;
+ const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >
+ mxMgr;
com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >
- aMediaDescriptor;
+ maMediaDescriptor;
com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >
- aFilterDataSequence;
- rtl::OUString aDialogTitle;
- FieldUnit eFieldUnit;
+ maFilterDataSequence;
+ com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >
+ mxSourceDocument;
+
+ rtl::OUString maDialogTitle;
+ FieldUnit meFieldUnit;
+ sal_Bool mbExportSelection;
public:
- SvFilterOptionsDialog( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB );
+ SvFilterOptionsDialog( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > _rxORB );
~SvFilterOptionsDialog();
// XInterface
diff --git a/svtools/source/filter.vcl/filter/dlgejpg.cxx b/svtools/source/filter.vcl/filter/dlgejpg.cxx
deleted file mode 100644
index 377697023de3..000000000000
--- a/svtools/source/filter.vcl/filter/dlgejpg.cxx
+++ /dev/null
@@ -1,96 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svtools.hxx"
-#include "dlgejpg.hxx"
-#include "dlgejpg.hrc"
-#include "strings.hrc"
-#include <svtools/FilterConfigItem.hxx>
-
-#define KEY_QUALITY "Quality"
-#define KEY_GRAYSCALES "ColorMode"
-
-/*************************************************************************
-|*
-|* Ctor
-|*
-\************************************************************************/
-
-DlgExportEJPG::DlgExportEJPG( FltCallDialogParameter& rPara ) :
- ModalDialog ( rPara.pWindow, ResId( DLG_EXPORT_JPG, *rPara.pResMgr ) ),
- rFltCallPara ( rPara ),
- aFiDescr ( this, ResId( FI_DESCR, *rPara.pResMgr ) ),
- aNumFldQuality ( this, ResId( NUM_FLD_QUALITY, *rPara.pResMgr ) ),
- aGrpQuality ( this, ResId( GRP_QUALITY, *rPara.pResMgr ) ),
- aRbGray ( this, ResId( RB_GRAY, *rPara.pResMgr ) ),
- aRbRGB ( this, ResId( RB_RGB, *rPara.pResMgr ) ),
- aGrpColors ( this, ResId( GRP_COLORS, *rPara.pResMgr ) ),
- aBtnOK ( this, ResId( BTN_OK, *rPara.pResMgr ) ),
- aBtnCancel ( this, ResId( BTN_CANCEL, *rPara.pResMgr ) ),
- aBtnHelp ( this, ResId( BTN_HELP, *rPara.pResMgr ) )
-{
- FreeResource();
- String aFilterConfigPath( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/Graphic/Export/JPG" ) );
- pConfigItem = new FilterConfigItem( aFilterConfigPath, &rPara.aFilterData );
-
- // reading filter options
- sal_Int32 nQuality = pConfigItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( KEY_QUALITY ) ), 75 );
- sal_Int32 nColorMode = pConfigItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( KEY_GRAYSCALES ) ), 0 );
- aNumFldQuality.SetValue( nQuality );
-
- if ( nColorMode )
- aRbGray.Check( sal_True );
- else
- aRbRGB.Check( sal_True );
-
- aBtnOK.SetClickHdl( LINK( this, DlgExportEJPG, OK ) );
-}
-
-
-/*************************************************************************
-|*
-|* Speichert eingestellte Werte in ini-Datei
-|*
-\************************************************************************/
-
-IMPL_LINK( DlgExportEJPG, OK, void *, EMPTYARG )
-{
- // Config-Parameter schreiben
- pConfigItem->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( KEY_QUALITY ) ), (sal_Int32)aNumFldQuality.GetValue() );
- pConfigItem->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( KEY_GRAYSCALES ) ), aRbGray.IsChecked() ? 1 : 0 );
- rFltCallPara.aFilterData = pConfigItem->GetFilterData();
- EndDialog( RET_OK );
- return 0;
-}
-
-DlgExportEJPG::~DlgExportEJPG()
-{
- delete pConfigItem;
-}
-
-
diff --git a/svtools/source/filter.vcl/filter/dlgejpg.hrc b/svtools/source/filter.vcl/filter/dlgejpg.hrc
deleted file mode 100644
index 90a3c1d162be..000000000000
--- a/svtools/source/filter.vcl/filter/dlgejpg.hrc
+++ /dev/null
@@ -1,39 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#include <svtools/svtools.hrc>
-
-#define BTN_OK 1
-#define BTN_CANCEL 1
-#define BTN_HELP 1
-#define FI_DESCR 1
-#define NUM_FLD_QUALITY 1
-#define GRP_QUALITY 1
-#define GRP_COLORS 2
-#define RB_GRAY 1
-#define RB_RGB 2
-
-
diff --git a/svtools/source/filter.vcl/filter/dlgejpg.hxx b/svtools/source/filter.vcl/filter/dlgejpg.hxx
deleted file mode 100644
index d80682574a54..000000000000
--- a/svtools/source/filter.vcl/filter/dlgejpg.hxx
+++ /dev/null
@@ -1,72 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#ifndef _DLGEJPG_HXX_
-#define _DLGEJPG_HXX_
-
-#include <vcl/dialog.hxx>
-#include <vcl/button.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/field.hxx>
-#include <vcl/lstbox.hxx>
-#include <vcl/msgbox.hxx>
-#include <svtools/stdctrl.hxx>
-#include <svtools/fltcall.hxx>
-
-/*************************************************************************
-|*
-|* Dialog zum Einstellen von Filteroptionen
-|*
-\************************************************************************/
-class FilterConfigItem;
-class DlgExportEJPG : public ModalDialog
-{
-private:
-
- FltCallDialogParameter& rFltCallPara;
-
- FixedInfo aFiDescr;
- NumericField aNumFldQuality;
- FixedLine aGrpQuality;
- RadioButton aRbGray;
- RadioButton aRbRGB;
- FixedLine aGrpColors;
- OKButton aBtnOK;
- CancelButton aBtnCancel;
- HelpButton aBtnHelp;
- FilterConfigItem* pConfigItem;
-
- DECL_LINK( OK, void * );
-
-public:
- DlgExportEJPG( FltCallDialogParameter& rDlgPara );
- ~DlgExportEJPG();
-};
-
-#endif // _DLGEJPG_HXX_
-
diff --git a/svtools/source/filter.vcl/filter/dlgejpg.src b/svtools/source/filter.vcl/filter/dlgejpg.src
deleted file mode 100644
index fd224f22c409..000000000000
--- a/svtools/source/filter.vcl/filter/dlgejpg.src
+++ /dev/null
@@ -1,136 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "dlgejpg.hrc"
-ModalDialog DLG_EXPORT_JPG
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 159 , 92 ) ;
- Text [ en-US ] = "JPEG Options" ;
- Moveable = TRUE ;
- Closeable = TRUE ;
- OKButton BTN_OK
- {
- Pos = MAP_APPFONT ( 103 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton BTN_CANCEL
- {
- Pos = MAP_APPFONT ( 103 , 23 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- HelpButton BTN_HELP
- {
- Pos = MAP_APPFONT ( 103 , 43 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- FixedLine GRP_QUALITY
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 90 , 8 ) ;
- Text [ en-US ] = "Quality" ;
- };
- FixedText FI_DESCR
- {
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 81 , 16 ) ;
- Text [ en-US ] = "1: min. quality\n100: max. quality" ;
- };
- NumericField NUM_FLD_QUALITY
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 33 ) ;
- Size = MAP_APPFONT ( 50 , 12 ) ;
- TabStop = TRUE ;
- Spin = TRUE ;
- Minimum = 1;
- Maximum = 100 ;
- StrictFormat = TRUE ;
- Last = 100 ;
- Repeat = TRUE ;
- };
- FixedLine GRP_COLORS
- {
- Pos = MAP_APPFONT ( 6 , 51 ) ;
- Size = MAP_APPFONT ( 90 , 8 ) ;
- Text [ en-US ] = "Color resolution" ;
- };
- RadioButton RB_GRAY
- {
- Pos = MAP_APPFONT ( 12 , 62 ) ;
- Size = MAP_APPFONT ( 81 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "Grayscale" ;
- };
- RadioButton RB_RGB
- {
- Pos = MAP_APPFONT ( 12 , 76 ) ;
- Size = MAP_APPFONT ( 81 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "True Colors" ;
- };
-};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/svtools/source/filter.vcl/filter/dlgepng.cxx b/svtools/source/filter.vcl/filter/dlgepng.cxx
deleted file mode 100644
index bd551e9a4bda..000000000000
--- a/svtools/source/filter.vcl/filter/dlgepng.cxx
+++ /dev/null
@@ -1,90 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svtools.hxx"
-#include <tools/ref.hxx>
-#include <vcl/msgbox.hxx>
-#include "dlgepng.hxx"
-#include "dlgepng.hrc"
-
-using namespace ::rtl;
-using namespace ::com::sun::star::uno;
-
-/*************************************************************************
-|*
-|* Ctor
-|*
-\************************************************************************/
-
-DlgExportEPNG::DlgExportEPNG( FltCallDialogParameter& rPara ) :
- ModalDialog ( rPara.pWindow, ResId( DLG_EXPORT_EPNG, *rPara.pResMgr ) ),
- FilterConfigItem ( OUString( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/Graphic/Export/PNG" ) ), &rPara.aFilterData ),
- rFltCallPara ( rPara ),
- aGrpCompression ( this, ResId( GRP_COMPRESSION, *rPara.pResMgr ) ),
- aFiCompression ( this, ResId( FI_COMPRESSION, *rPara.pResMgr ) ),
- aNumCompression ( this, ResId( NUM_COMPRESSION, *rPara.pResMgr ) ),
- aCbxInterlaced ( this, ResId( CBX_INTERLACED, *rPara.pResMgr ) ),
- aBtnOK ( this, ResId( BTN_OK, *rPara.pResMgr ) ),
- aBtnCancel ( this, ResId( BTN_CANCEL, *rPara.pResMgr ) ),
- aBtnHelp ( this, ResId( BTN_HELP, *rPara.pResMgr ) ),
- pMgr ( rPara.pResMgr )
-{
- FreeResource();
-
- // Config-Parameter lesen
- sal_Int32 nCompression = ReadInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "Compression" ) ), 6 );
- if ( ( nCompression < 0 ) || ( nCompression > 9 ) )
- nCompression = 6;
- aNumCompression.SetValue( nCompression );
-
- sal_Int32 nInterlaced = ReadInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "Interlaced" ) ), 0 );
- sal_Bool bInterlaced = nInterlaced != 0;
- aCbxInterlaced.Check( bInterlaced );
-
- aBtnOK.SetClickHdl( LINK( this, DlgExportEPNG, OK ) );
-}
-
-/*************************************************************************
-|*
-|* Speichert eingestellte Werte in ini-Datei
-|*
-\************************************************************************/
-
-IMPL_LINK( DlgExportEPNG, OK, void *, EMPTYARG )
-{
- // Config-Parameter schreiben
- WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "Compression" ) ), static_cast<sal_Int32>(aNumCompression.GetValue()) );
- sal_Int32 nInterlace = 0;
- if ( aCbxInterlaced.IsChecked() )
- nInterlace++;
- WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "Interlaced" ) ), nInterlace );
- rFltCallPara.aFilterData = GetFilterData();
- EndDialog( RET_OK );
-
- return 0;
-}
diff --git a/svtools/source/filter.vcl/filter/dlgepng.hrc b/svtools/source/filter.vcl/filter/dlgepng.hrc
deleted file mode 100644
index b3ffaab3ab1e..000000000000
--- a/svtools/source/filter.vcl/filter/dlgepng.hrc
+++ /dev/null
@@ -1,35 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#include <svtools/svtools.hrc>
-
-#define BTN_OK 1
-#define BTN_CANCEL 1
-#define BTN_HELP 1
-#define GRP_COMPRESSION 1
-#define FI_COMPRESSION 1
-#define NUM_COMPRESSION 1
-#define CBX_INTERLACED 1
diff --git a/svtools/source/filter.vcl/filter/dlgepng.hxx b/svtools/source/filter.vcl/filter/dlgepng.hxx
deleted file mode 100644
index 469985afee59..000000000000
--- a/svtools/source/filter.vcl/filter/dlgepng.hxx
+++ /dev/null
@@ -1,71 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#ifndef _DLGEPNG_HXX_
-#define _DLGEPNG_HXX_
-#include <svtools/fltcall.hxx>
-#include <vcl/dialog.hxx>
-#include <vcl/button.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/field.hxx>
-#include <svtools/stdctrl.hxx>
-#include <svtools/FilterConfigItem.hxx>
-
-
-/*************************************************************************
-|*
-|* Dialog zum Einstellen von Filteroptionen
-|*
-\************************************************************************/
-
-class ResMgr;
-
-class DlgExportEPNG : public ModalDialog, FilterConfigItem
-{
-
- private:
-
- FltCallDialogParameter& rFltCallPara;
-
- FixedLine aGrpCompression;
- FixedInfo aFiCompression;
- NumericField aNumCompression;
- CheckBox aCbxInterlaced;
- OKButton aBtnOK;
- CancelButton aBtnCancel;
- HelpButton aBtnHelp;
- ResMgr* pMgr;
-
- DECL_LINK( OK, void * );
-
- public:
-
- DlgExportEPNG( FltCallDialogParameter& rPara );
-};
-
-#endif // _DLGEPNG_HXX_
diff --git a/svtools/source/filter.vcl/filter/dlgepng.src b/svtools/source/filter.vcl/filter/dlgepng.src
deleted file mode 100644
index aa778842dc48..000000000000
--- a/svtools/source/filter.vcl/filter/dlgepng.src
+++ /dev/null
@@ -1,119 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "dlgepng.hrc"
-ModalDialog DLG_EXPORT_EPNG
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 169 , 64 ) ;
- Moveable = TRUE ;
- Closeable = TRUE ;
- Text [ en-US ] = "PNG Options" ;
- OKButton BTN_OK
- {
- Pos = MAP_APPFONT ( 113 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton BTN_CANCEL
- {
- Pos = MAP_APPFONT ( 113 , 23 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- HelpButton BTN_HELP
- {
- Pos = MAP_APPFONT ( 113 , 43 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- FixedLine GRP_COMPRESSION
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 100 , 8 ) ;
- Text[ en-US ] = "Mode";
- };
- FixedText FI_COMPRESSION
- {
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 80 , 8 ) ;
- Text[ en-US ] = "~Compression 0..9";
- };
- NumericField NUM_COMPRESSION
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 25 ) ;
- Size = MAP_APPFONT ( 40 , 12 ) ;
- TabStop = TRUE ;
- Spin = TRUE ;
- Minimum = 0 ;
- Maximum = 9 ;
- First = 0 ;
- Last = 9 ;
- StrictFormat = TRUE ;
- Repeat = TRUE ;
- };
- CheckBox CBX_INTERLACED
- {
- Pos = MAP_APPFONT ( 12 , 43 ) ;
- Size = MAP_APPFONT ( 80 , 12 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Interlaced" ;
- };
-};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/svtools/source/filter.vcl/filter/dlgexpor.cxx b/svtools/source/filter.vcl/filter/dlgexpor.cxx
deleted file mode 100644
index b4b7c0fc949d..000000000000
--- a/svtools/source/filter.vcl/filter/dlgexpor.cxx
+++ /dev/null
@@ -1,442 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svtools.hxx"
-
-#ifndef GCC
-# pragma hdrstop
-#endif
-
-#include <tools/ref.hxx>
-#include <svtools/FilterConfigItem.hxx>
-#include <com/sun/star/awt/Size.hpp>
-#include <vcl/msgbox.hxx>
-#include "dlgexpor.hxx"
-#include "dlgexpor.hrc"
-#include "strings.hrc"
-
-/*************************************************************************
-|*
-|* Ctor
-|*
-\************************************************************************/
-
-DlgExportPix::DlgExportPix( FltCallDialogParameter& rPara ) :
- ModalDialog ( rPara.pWindow, ResId( DLG_EXPORT_PIX, *rPara.pResMgr ) ),
- rFltCallPara ( rPara ),
- aBtnOK ( this, ResId( BTN_OK_PIX, *rPara.pResMgr ) ),
- aBtnCancel ( this, ResId( BTN_CANCEL_PIX, *rPara.pResMgr ) ),
- aBtnHelp ( this, ResId( BTN_HELP_PIX, *rPara.pResMgr ) ),
- aLbColors ( this, ResId( LB_COLORS, *rPara.pResMgr ) ),
- aCbxRLE ( this, ResId( CBX_RLE, *rPara.pResMgr ) ),
- aGrpColors ( this, ResId( GRP_COLORS, *rPara.pResMgr ) ),
- aRbOriginal ( this, ResId( RB_ORIGINAL_PIX, *rPara.pResMgr ) ),
- aRbRes ( this, ResId( RB_RES_PIX, *rPara.pResMgr ) ),
- aRbSize ( this, ResId( RB_SIZE_PIX, *rPara.pResMgr ) ),
- aFtSizeX ( this, ResId( FT_SIZEX_PIX, *rPara.pResMgr ) ),
- aMtfSizeX ( this, ResId( MTF_SIZEX_PIX, *rPara.pResMgr ) ),
- aFtSizeY ( this, ResId( FT_SIZEY_PIX, *rPara.pResMgr ) ),
- aMtfSizeY ( this, ResId( MTF_SIZEY_PIX, *rPara.pResMgr ) ),
- aGrpMode ( this, ResId( GRP_MODE_PIX, *rPara.pResMgr ) ),
- aCbbRes ( this, ResId( CBB_RES_PIX, *rPara.pResMgr ) ),
- pMgr ( rPara.pResMgr ),
- aExt ( rPara.aFilterExt )
-{
- aExt.ToUpperAscii();
- String aFilterConfigPath( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/Graphic/Export/" ) );
- aFilterConfigPath.Append( aExt );
- pConfigItem = new FilterConfigItem( aFilterConfigPath, &rPara.aFilterData );
-
- String aTitle( aExt );
- FreeResource();
-
- aBtnOK.SetClickHdl( LINK( this, DlgExportPix, OK ) );
- aRbOriginal.SetClickHdl( LINK( this, DlgExportPix, ClickRbOriginal ) );
- aRbRes.SetClickHdl( LINK( this, DlgExportPix, ClickRbRes ) );
- aRbSize.SetClickHdl( LINK( this, DlgExportPix, ClickRbSize ) );
- aLbColors.SetSelectHdl( LINK( this, DlgExportPix, SelectLbColors ) );
-
- aTitle.ToUpperAscii();
- aTitle += String( ResId( EXPORT_DIALOG_TITLE, *pMgr ) );
- SetText( aTitle );
-
- // Config-Parameter lesen
- sal_Int32 nColors = pConfigItem->ReadInt32( String( ResId( KEY_COLORS, *pMgr ) ), 0 );
- sal_Int32 nMode = pConfigItem->ReadInt32( String( ResId( KEY_MODE, *pMgr ) ), 0 );
- sal_Int32 nRes = pConfigItem->ReadInt32( String( ResId( KEY_RES, *pMgr ) ), 75 );
- sal_Bool bRleCoding = pConfigItem->ReadBool( String( ResId( KEY_RLE_CODING, *pMgr ) ), sal_True );
-
- aLbColors.SelectEntryPos( Min( (sal_uInt16) 7, (sal_uInt16)nColors ) );
-
- String aStrRes( String::CreateFromInt32( nRes ) );
- aStrRes.Append( String( RTL_CONSTASCII_USTRINGPARAM( " DPI" ) ) );
- aCbbRes.SetText( aStrRes );
-
- ::com::sun::star::awt::Size aDefault( 10000, 10000 );
- ::com::sun::star::awt::Size aSize;
- aSize = pConfigItem->ReadSize( String( ResId( KEY_SIZE, *pMgr ) ), aDefault );
-
- aCbxRLE.Check( bRleCoding );
-
- aMtfSizeX.SetDefaultUnit( FUNIT_MM );
- aMtfSizeY.SetDefaultUnit( FUNIT_MM );
-
- aMtfSizeX.SetValue( aSize.Width );
- aMtfSizeY.SetValue( aSize.Height );
-
- switch ( rPara.eFieldUnit )
- {
-// case FUNIT_NONE :
-// case FUNIT_KM :
-// case FUNIT_PERCENT :
-// case FUNIT_CUSTOM :
-// case FUNIT_MILE :
-// case FUNIT_FOOT :
-// case FUNIT_M :
- case FUNIT_MM :
- case FUNIT_CM :
- case FUNIT_TWIP :
- case FUNIT_POINT :
- case FUNIT_PICA :
- case FUNIT_INCH :
- case FUNIT_100TH_MM :
- {
- aMtfSizeX.SetUnit( rPara.eFieldUnit );
- aMtfSizeY.SetUnit( rPara.eFieldUnit );
- }
- break;
-
- default:
- break; // -Wall multiple values not handled.
- }
-
- switch ( nMode )
- {
- case 2 :
- {
- aRbSize.Check( TRUE );
- ClickRbSize( NULL );
- }
- break;
- case 1 :
- {
- aRbRes.Check( TRUE );
- ClickRbRes( NULL );
- }
- break;
- default :
- {
- aRbOriginal.Check( TRUE );
- ClickRbOriginal( NULL );
- }
- break;
- }
- SelectLbColors( &aLbColors );
-}
-
-DlgExportPix::~DlgExportPix()
-{
- delete pConfigItem;
-}
-
-
-/*************************************************************************
-|*
-|* Speichert eingestellte Werte in ini-Datei
-|*
-\************************************************************************/
-
-IMPL_LINK( DlgExportPix, OK, void *, EMPTYARG )
-{
- // Config-Parameter schreiben
-
- sal_Int32 nRes = Max( Min( aCbbRes.GetText().ToInt32(), sal_Int32( 600 ) ), sal_Int32( 75 ) );
- ::com::sun::star::awt::Size aSize(
- static_cast<long>(MetricField::ConvertDoubleValue( static_cast<double>(aMtfSizeX.GetValue()), 2, aMtfSizeX.GetUnit(), MAP_100TH_MM )),
- static_cast<long>(MetricField::ConvertDoubleValue( static_cast<double>(aMtfSizeY.GetValue()), 2, aMtfSizeY.GetUnit(), MAP_100TH_MM )) );
-
- sal_Int32 nMode;
- if ( aRbRes.IsChecked() )
- nMode = 1;
- else if ( aRbSize.IsChecked() )
- nMode = 2;
- else
- nMode = 0;
-
- pConfigItem->WriteInt32( String( ResId( KEY_MODE, *pMgr ) ), nMode );
- pConfigItem->WriteInt32( String( ResId( KEY_RES, *pMgr ) ), nRes );
- pConfigItem->WriteSize( String( ResId( KEY_SIZE, *pMgr ) ), aSize );
- pConfigItem->WriteInt32( String( ResId( KEY_COLORS, *pMgr ) ), (sal_Int32)aLbColors.GetSelectEntryPos() );
- pConfigItem->WriteBool( String( ResId( KEY_RLE_CODING, *pMgr ) ), aCbxRLE.IsChecked() );
- rFltCallPara.aFilterData = pConfigItem->GetFilterData();
- EndDialog( RET_OK );
-
- return 0;
-}
-
-/*************************************************************************
-|*
-|* Enabled/Disabled Controls
-|*
-\************************************************************************/
-
-IMPL_LINK( DlgExportPix, ClickRbOriginal, void*, EMPTYARG )
-{
- aCbbRes.Disable();
-
- aFtSizeX.Disable();
- aMtfSizeX.Disable();
- aFtSizeY.Disable();
- aMtfSizeY.Disable();
-
- return 0;
-}
-
-
-/*************************************************************************
-|*
-|* Enabled/Disabled Controls
-|*
-\************************************************************************/
-
-IMPL_LINK( DlgExportPix, ClickRbRes, void*, EMPTYARG )
-{
- aCbbRes.Enable();
-
- aFtSizeX.Disable();
- aMtfSizeX.Disable();
- aFtSizeY.Disable();
- aMtfSizeY.Disable();
-
- return 0;
-}
-
-
-/*************************************************************************
-|*
-|* Enabled/Disabled Controls
-|*
-\************************************************************************/
-
-IMPL_LINK( DlgExportPix, ClickRbSize, void*, EMPTYARG )
-{
- aFtSizeX.Enable();
- aMtfSizeX.Enable();
- aFtSizeY.Enable();
- aMtfSizeY.Enable();
-
- aCbbRes.Disable();
-
- return 0;
-}
-
-
-/*************************************************************************
-|*
-|* Enabled/Disabled Controls
-|*
-\************************************************************************/
-
-IMPL_LINK( DlgExportPix, SelectLbColors, void*, EMPTYARG )
-{
- const USHORT nLbPos = aLbColors.GetSelectEntryPos();
-
- if ( ( nLbPos >= 3 ) && ( nLbPos <= 6 ) )
- aCbxRLE.Enable();
- else
- aCbxRLE.Disable();
-
- return 0L;
-}
-
-
-/******************************************************************************/
-
-
-/*************************************************************************
-|*
-|* Ctor
-|*
-\************************************************************************/
-
-DlgExportVec::DlgExportVec( FltCallDialogParameter& rPara ) :
- ModalDialog ( rPara.pWindow, ResId( DLG_EXPORT_VEC, *rPara.pResMgr ) ),
- rFltCallPara ( rPara ),
- aBtnOK ( this, ResId( BTN_OK_VEC, *rPara.pResMgr ) ),
- aBtnCancel ( this, ResId( BTN_CANCEL_VEC, *rPara.pResMgr ) ),
- aBtnHelp ( this, ResId( BTN_HELP_VEC, *rPara.pResMgr ) ),
- aRbOriginal ( this, ResId( RB_ORIGINAL_VEC, *rPara.pResMgr ) ),
- aRbSize ( this, ResId( RB_SIZE_VEC, *rPara.pResMgr ) ),
- aGrpMode ( this, ResId( GRP_MODE_VEC, *rPara.pResMgr ) ),
- aFtSizeX ( this, ResId( FT_SIZEX_VEC, *rPara.pResMgr ) ),
- aMtfSizeX ( this, ResId( MTF_SIZEX_VEC, *rPara.pResMgr ) ),
- aFtSizeY ( this, ResId( FT_SIZEY_VEC, *rPara.pResMgr ) ),
- aMtfSizeY ( this, ResId( MTF_SIZEY_VEC, *rPara.pResMgr ) ),
- aGrpSize ( this, ResId( GRP_SIZE_VEC, *rPara.pResMgr ) ),
- pMgr ( rPara.pResMgr ),
- aExt ( rPara.aFilterExt )
-{
- aExt.ToUpperAscii();
- String aFilterConfigPath( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/Graphic/Export/" ) );
- aFilterConfigPath.Append( aExt );
- pConfigItem = new FilterConfigItem( aFilterConfigPath, &rPara.aFilterData );
-
- String aTitle( aExt );
- FreeResource();
-
- aBtnOK.SetClickHdl( LINK( this, DlgExportVec, OK ) );
- aRbOriginal.SetClickHdl( LINK( this, DlgExportVec, ClickRbOriginal ) );
- aRbSize.SetClickHdl( LINK( this, DlgExportVec, ClickRbSize ) );
-
- aTitle.ToUpperAscii();
- aTitle += String( ResId( EXPORT_DIALOG_TITLE, *pMgr ) );
- SetText( aTitle );
-
- // reading config-parameter
- sal_Int32 nMode = pConfigItem->ReadInt32( String( ResId( KEY_MODE, *pMgr ) ), 0 );
-
- ::com::sun::star::awt::Size aDefault( 10000, 10000 );
- ::com::sun::star::awt::Size aSize;
- aSize = pConfigItem->ReadSize( String( ResId( KEY_SIZE, *pMgr ) ), aDefault );
-
- aMtfSizeX.SetDefaultUnit( FUNIT_MM );
- aMtfSizeY.SetDefaultUnit( FUNIT_MM );
- aMtfSizeX.SetValue( aSize.Width );
- aMtfSizeY.SetValue( aSize.Height );
-
- switch ( rPara.eFieldUnit )
- {
-// case FUNIT_NONE :
-// case FUNIT_KM :
-// case FUNIT_PERCENT :
-// case FUNIT_CUSTOM :
-// case FUNIT_MILE :
-// case FUNIT_FOOT :
- case FUNIT_MM :
- case FUNIT_CM :
- case FUNIT_M :
- case FUNIT_TWIP :
- case FUNIT_POINT :
- case FUNIT_PICA :
- case FUNIT_INCH :
- case FUNIT_100TH_MM :
- {
- aMtfSizeX.SetUnit( rPara.eFieldUnit );
- aMtfSizeY.SetUnit( rPara.eFieldUnit );
- }
- break;
- default:
- break; // -Wall Multiple values not handled.
- }
-
- switch ( nMode )
- {
- case 1 :
- {
- aRbSize.Check( TRUE );
- ClickRbSize( NULL );
- }
- break;
-
- default :
- {
- aRbOriginal.Check( TRUE );
- ClickRbOriginal( NULL );
- }
- break;
- }
-}
-
-DlgExportVec::~DlgExportVec()
-{
- delete pConfigItem;
-}
-/*************************************************************************
-|*
-|* Speichert eingestellte Werte in ini-Datei
-|*
-\************************************************************************/
-
-IMPL_LINK( DlgExportVec, OK, void *, EMPTYARG )
-{
- // Config-Parameter schreiben
- ::com::sun::star::awt::Size aSize(
- static_cast<long>(MetricField::ConvertDoubleValue( static_cast<double>(aMtfSizeX.GetValue()), 2, aMtfSizeX.GetUnit(), MAP_100TH_MM )),
- static_cast<long>(MetricField::ConvertDoubleValue( static_cast<double>(aMtfSizeY.GetValue()), 2, aMtfSizeY.GetUnit(), MAP_100TH_MM )) );
-
- sal_Int32 nMode;
- if ( aRbSize.IsChecked() )
- nMode = 1;
- else
- nMode = 0;
-
- pConfigItem->WriteInt32( String( ResId( KEY_MODE, *pMgr ) ), nMode );
- pConfigItem->WriteSize( String( ResId( KEY_SIZE, *pMgr ) ), aSize );
- rFltCallPara.aFilterData = pConfigItem->GetFilterData();
- EndDialog( RET_OK );
-
- return 0;
-}
-
-/*************************************************************************
-|*
-|* Enabled/Disabled Controls
-|*
-\************************************************************************/
-
-IMPL_LINK( DlgExportVec, ClickRbOriginal, void*, EMPTYARG )
-{
- aGrpSize.Disable();
- aFtSizeX.Disable();
- aMtfSizeX.Disable();
- aFtSizeY.Disable();
- aMtfSizeY.Disable();
-
- return 0;
-}
-
-
-/*************************************************************************
-|*
-|* Enabled/Disabled Controls
-|*
-\************************************************************************/
-
-IMPL_LINK( DlgExportVec, ClickRbSize, void*, EMPTYARG )
-{
- aGrpSize.Enable();
- aFtSizeX.Enable();
- aMtfSizeX.Enable();
- aFtSizeY.Enable();
- aMtfSizeY.Enable();
-
- return 0;
-}
-
-
-
diff --git a/svtools/source/filter.vcl/filter/dlgexpor.hrc b/svtools/source/filter.vcl/filter/dlgexpor.hrc
deleted file mode 100644
index 69870c9b00b0..000000000000
--- a/svtools/source/filter.vcl/filter/dlgexpor.hrc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#include <svtools/svtools.hrc>
-
-#define BTN_OK_PIX 1
-#define BTN_CANCEL_PIX 1
-#define BTN_HELP_PIX 1
-#define CBX_RES_PIX 1
-#define CBX_SIZE_PIX 2
-#define CBX_RLE 3
-#define CBB_RES_PIX 1
-#define LB_COLORS 1
-#define MTF_SIZEX_PIX 1
-#define MTF_SIZEY_PIX 2
-#define FT_SIZEX_PIX 1
-#define FT_SIZEY_PIX 2
-#define GRP_MODE_PIX 1
-#define GRP_COLORS 4
-#define RB_ORIGINAL_PIX 1
-#define RB_RES_PIX 2
-#define RB_SIZE_PIX 3
-
-#define BTN_OK_VEC 1
-#define BTN_CANCEL_VEC 1
-#define BTN_HELP_VEC 1
-#define CBX_SIZE_VEC 2
-#define MTF_SIZEX_VEC 1
-#define MTF_SIZEY_VEC 2
-#define FT_SIZEX_VEC 1
-#define FT_SIZEY_VEC 2
-#define GRP_SIZE_VEC 1
-#define GRP_MODE_VEC 2
-#define RB_ORIGINAL_VEC 1
-#define RB_SIZE_VEC 2
diff --git a/svtools/source/filter.vcl/filter/dlgexpor.hxx b/svtools/source/filter.vcl/filter/dlgexpor.hxx
deleted file mode 100644
index 8c7b2d462e70..000000000000
--- a/svtools/source/filter.vcl/filter/dlgexpor.hxx
+++ /dev/null
@@ -1,127 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#ifndef _DLGEXPOR_HXX_
-#define _DLGEXPOR_HXX_
-
-#include <svtools/fltcall.hxx>
-#include <vcl/dialog.hxx>
-#include <vcl/button.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/field.hxx>
-#include <vcl/lstbox.hxx>
-
-/*************************************************************************
-|*
-|* Dialog zum Einstellen von Filteroptionen bei Pixelformaten
-|*
-\************************************************************************/
-
-class FilterConfigItem;
-class DlgExportPix : public ModalDialog
-{
-private:
-
- FltCallDialogParameter& rFltCallPara;
-
- OKButton aBtnOK;
- CancelButton aBtnCancel;
- HelpButton aBtnHelp;
-
- ListBox aLbColors;
- CheckBox aCbxRLE;
- FixedLine aGrpColors;
-
- RadioButton aRbOriginal;
- RadioButton aRbRes;
- RadioButton aRbSize;
- FixedText aFtSizeX;
- MetricField aMtfSizeX;
- FixedText aFtSizeY;
- MetricField aMtfSizeY;
- FixedLine aGrpMode;
- ComboBox aCbbRes;
-
- FilterConfigItem* pConfigItem;
- ResMgr* pMgr;
-
- String aExt;
-
- DECL_LINK( OK, void* p );
- DECL_LINK( ClickRbOriginal,void* p );
- DECL_LINK( ClickRbRes,void* p );
- DECL_LINK( ClickRbSize,void* p );
- DECL_LINK( SelectLbColors, void* p );
-
-public:
- DlgExportPix( FltCallDialogParameter& rPara );
- ~DlgExportPix();
-};
-
-
-/*************************************************************************
-|*
-|* Dialog zum Einstellen von Filteroptionen bei Vektorformaten
-|*
-\************************************************************************/
-class DlgExportVec : public ModalDialog
-{
-private:
-
- FltCallDialogParameter& rFltCallPara;
-
- OKButton aBtnOK;
- CancelButton aBtnCancel;
- HelpButton aBtnHelp;
-
- RadioButton aRbOriginal;
- RadioButton aRbSize;
- FixedLine aGrpMode;
-
- FixedText aFtSizeX;
- MetricField aMtfSizeX;
- FixedText aFtSizeY;
- MetricField aMtfSizeY;
- FixedLine aGrpSize;
-
- FilterConfigItem* pConfigItem;
- ResMgr* pMgr;
-
- String aExt;
-
- DECL_LINK( OK, void* p );
- DECL_LINK( ClickRbOriginal,void* p );
- DECL_LINK( ClickRbSize,void* p );
-
-public:
- DlgExportVec( FltCallDialogParameter& rPara );
- ~DlgExportVec();
-};
-
-#endif // _DLGEXPOR_HXX_
-
diff --git a/svtools/source/filter.vcl/filter/dlgexpor.src b/svtools/source/filter.vcl/filter/dlgexpor.src
deleted file mode 100644
index 7573b394d72f..000000000000
--- a/svtools/source/filter.vcl/filter/dlgexpor.src
+++ /dev/null
@@ -1,315 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#include "dlgexpor.hrc"
-
-ModalDialog DLG_EXPORT_PIX
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 178 , 135 ) ;
- Moveable = TRUE ;
- Closeable = TRUE ;
- FixedLine GRP_COLORS
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 110 , 8 ) ;
- Text [ en-US ] = "Color resolution" ;
- };
- ListBox LB_COLORS
- {
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 98 , 90 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- AutoHScroll = TRUE ;
- StringList [ en-US ] =
- {
- < "Original" ; Default ; > ;
- < "1 Bit - Threshold Value" ; Default ; > ;
- < "1 Bit - Dithering" ; Default ; > ;
- < "4 Bit - Grayscale" ; Default ; > ;
- < "4 Bit - Color Palette" ; Default ; > ;
- < "8 Bit - Grayscales" ; Default ; > ;
- < "8 Bit - Color Palette" ; Default ; > ;
- < "24 Bit - True Colors" ; Default ; > ;
- };
- };
- CheckBox CBX_RLE
- {
- Pos = MAP_APPFONT ( 12 , 31 ) ;
- Size = MAP_APPFONT ( 98 , 12 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "RLE coding" ;
- };
- FixedLine GRP_MODE_PIX
- {
- Pos = MAP_APPFONT ( 6 , 48 ) ;
- Size = MAP_APPFONT ( 110 , 8 ) ;
- Text [ en-US ] = "Mode" ;
- };
- RadioButton RB_ORIGINAL_PIX
- {
- Pos = MAP_APPFONT ( 12 , 59 ) ;
- Size = MAP_APPFONT ( 98 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Original" ;
- };
- RadioButton RB_RES_PIX
- {
- Pos = MAP_APPFONT ( 12 , 73 ) ;
- Size = MAP_APPFONT ( 55 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Resolution" ;
- };
- ComboBox CBB_RES_PIX
- {
- Pos = MAP_APPFONT ( 70 , 73 ) ;
- Size = MAP_APPFONT ( 40 , 50 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- StringList =
- {
- "75 DPI" ;
- "150 DPI" ;
- "300 DPI" ;
- "600 DPI" ;
- };
- };
- RadioButton RB_SIZE_PIX
- {
- Pos = MAP_APPFONT ( 12 , 87 ) ;
- Size = MAP_APPFONT ( 98 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Size" ;
- };
- MetricField MTF_SIZEX_PIX
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 60 , 101 ) ;
- Size = MAP_APPFONT ( 50 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 100 ;
- Maximum = 99999 ;
- StrictFormat = TRUE ;
- DecimalDigits = 2 ;
- Unit = FUNIT_MM ;
- First = 100 ;
- Last = 99999 ;
- SpinSize = 100 ;
- };
- FixedText FT_SIZEX_PIX
- {
- Pos = MAP_APPFONT ( 18 , 102 ) ;
- Size = MAP_APPFONT ( 41 , 10 ) ;
- Text [ en-US ] = "Width" ;
- };
- MetricField MTF_SIZEY_PIX
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 60 , 117 ) ;
- Size = MAP_APPFONT ( 50 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 100 ;
- Maximum = 99999 ;
- StrictFormat = TRUE ;
- DecimalDigits = 2 ;
- Unit = FUNIT_MM ;
- First = 100 ;
- Last = 99999 ;
- SpinSize = 100 ;
- };
- FixedText FT_SIZEY_PIX
- {
- Pos = MAP_APPFONT ( 18 , 118 ) ;
- Size = MAP_APPFONT ( 41 , 10 ) ;
- Text [ en-US ] = "Height" ;
- };
- OKButton BTN_OK_PIX
- {
- Pos = MAP_APPFONT ( 122 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton BTN_CANCEL_PIX
- {
- Pos = MAP_APPFONT ( 122 , 23 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- HelpButton BTN_HELP_PIX
- {
- Pos = MAP_APPFONT ( 122 , 43 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
-};
-ModalDialog DLG_EXPORT_VEC
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 178 , 89 ) ;
- Moveable = TRUE ;
- Closeable = TRUE ;
-
- FixedLine GRP_MODE_VEC
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 110 , 8 ) ;
- Text [ en-US ] = "Mode" ;
- };
- RadioButton RB_ORIGINAL_VEC
- {
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 98 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Original" ;
- };
- RadioButton RB_SIZE_VEC
- {
- Pos = MAP_APPFONT ( 12 , 28 ) ;
- Size = MAP_APPFONT ( 98 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Size" ;
- };
- FixedLine GRP_SIZE_VEC
- {
- Pos = MAP_APPFONT ( 6 , 44 ) ;
- Size = MAP_APPFONT ( 110 , 8 ) ;
- Text [ en-US ] = "Size" ;
- };
- FixedText FT_SIZEX_VEC
- {
- Pos = MAP_APPFONT ( 12 , 56 ) ;
- Size = MAP_APPFONT ( 45 , 10 ) ;
- Text [ en-US ] = "Width" ;
- };
- MetricField MTF_SIZEX_VEC
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 60 , 55 ) ;
- Size = MAP_APPFONT ( 50 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 100 ;
- Maximum = 99999 ;
- StrictFormat = TRUE ;
- DecimalDigits = 2 ;
- Unit = FUNIT_MM ;
- First = 100 ;
- Last = 99999 ;
- SpinSize = 100 ;
- };
- FixedText FT_SIZEY_VEC
- {
- Pos = MAP_APPFONT ( 12 , 72 ) ;
- Size = MAP_APPFONT ( 45 , 10 ) ;
- Text [ en-US ] = "Height" ;
- };
- MetricField MTF_SIZEY_VEC
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 60 , 71 ) ;
- Size = MAP_APPFONT ( 50 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 100 ;
- Maximum = 99999 ;
- StrictFormat = TRUE ;
- DecimalDigits = 2 ;
- Unit = FUNIT_MM ;
- First = 100 ;
- Last = 99999 ;
- SpinSize = 100 ;
- };
- OKButton BTN_OK_VEC
- {
- Pos = MAP_APPFONT ( 122 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton BTN_CANCEL_VEC
- {
- Pos = MAP_APPFONT ( 122 , 24 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- HelpButton BTN_HELP_VEC
- {
- Pos = MAP_APPFONT ( 122 , 43 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
-};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/svtools/source/filter.vcl/filter/exportdialog.cxx b/svtools/source/filter.vcl/filter/exportdialog.cxx
new file mode 100644
index 000000000000..20cc46a30ab5
--- /dev/null
+++ b/svtools/source/filter.vcl/filter/exportdialog.cxx
@@ -0,0 +1,1513 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_svtools.hxx"
+
+#ifndef GCC
+# pragma hdrstop
+#endif
+
+#include <tools/ref.hxx>
+#include <tools/stream.hxx>
+#include <svtools/filter.hxx>
+#include <svtools/FilterConfigItem.hxx>
+#include <com/sun/star/io/XStream.hpp>
+#include <com/sun/star/awt/Size.hpp>
+#include <com/sun/star/view/XSelectionSupplier.hpp>
+#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/frame/XController.hpp>
+#include <com/sun/star/drawing/XDrawView.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/graphic/XPrimitiveFactory2D.hpp>
+#include <com/sun/star/geometry/AffineMatrix2D.hpp>
+#include <com/sun/star/document/XExporter.hpp>
+#include <com/sun/star/document/XFilter.hpp>
+#include <unotools/streamwrap.hxx>
+#include <vcl/msgbox.hxx>
+#include <vcl/svapp.hxx>
+#include <vcl/outdev.hxx>
+#include <vcl/graph.hxx>
+#include <rtl/ustrbuf.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include "exportdialog.hxx"
+#include "exportdialog.hrc"
+
+#define FORMAT_UNKNOWN 0
+#define FORMAT_JPG 1
+#define FORMAT_PNG 2
+#define FORMAT_BMP 3
+#define FORMAT_GIF 4
+#define FORMAT_PBM 5
+#define FORMAT_PGM 6
+#define FORMAT_PPM 7
+#define FORMAT_PCT 8
+#define FORMAT_RAS 9
+#define FORMAT_TIF 10
+#define FORMAT_XPM 11
+#define FORMAT_WMF 12
+#define FORMAT_EMF 13
+#define FORMAT_EPS 14
+#define FORMAT_MET 15
+#define FORMAT_SVG 16
+#define FORMAT_SVM 17
+
+#define UNIT_DEFAULT -1
+#define UNIT_INCH 0
+#define UNIT_CM 1
+#define UNIT_MM 2
+#define UNIT_POINT 3
+#define UNIT_PIXEL 4
+#define UNIT_MAX_ID UNIT_PIXEL
+
+using namespace ::com::sun::star;
+
+static sal_Int16 GetFilterFormat( String& rExt )
+{
+ sal_Int16 nFormat = FORMAT_UNKNOWN;
+ ByteString aExt( rExt, RTL_TEXTENCODING_UTF8 );
+ if ( aExt.Equals( "JPG" ) )
+ nFormat = FORMAT_JPG;
+ else if ( aExt.Equals( "PNG" ) )
+ nFormat = FORMAT_PNG;
+ else if ( aExt.Equals( "BMP" ) )
+ nFormat = FORMAT_BMP;
+ else if ( aExt.Equals( "GIF" ) )
+ nFormat = FORMAT_GIF;
+ else if ( aExt.Equals( "PBM" ) )
+ nFormat = FORMAT_PBM;
+ else if ( aExt.Equals( "PGM" ) )
+ nFormat = FORMAT_PGM;
+ else if ( aExt.Equals( "PPM" ) )
+ nFormat = FORMAT_PPM;
+ else if ( aExt.Equals( "PCT" ) )
+ nFormat = FORMAT_PCT;
+ else if ( aExt.Equals( "RAS" ) )
+ nFormat = FORMAT_RAS;
+ else if ( aExt.Equals( "TIF" ) )
+ nFormat = FORMAT_TIF;
+ else if ( aExt.Equals( "XPM" ) )
+ nFormat = FORMAT_XPM;
+ else if ( aExt.Equals( "WMF" ) )
+ nFormat = FORMAT_WMF;
+ else if ( aExt.Equals( "EMF" ) )
+ nFormat = FORMAT_EMF;
+ else if ( aExt.Equals( "EPS" ) )
+ nFormat = FORMAT_EPS;
+ else if ( aExt.Equals( "MET" ) )
+ nFormat = FORMAT_MET;
+ else if ( aExt.Equals( "SVG" ) )
+ nFormat = FORMAT_SVG;
+ else if ( aExt.Equals( "SVM" ) )
+ nFormat = FORMAT_SVM;
+ return nFormat;
+}
+
+static MapUnit GetMapUnit( sal_Int32 nUnit )
+{
+ MapUnit aMapUnit( MAP_PIXEL );
+ switch( nUnit )
+ {
+ case UNIT_INCH : aMapUnit = MAP_INCH; break;
+ case UNIT_CM : aMapUnit = MAP_CM; break;
+ case UNIT_MM : aMapUnit = MAP_MM; break;
+ case UNIT_POINT : aMapUnit = MAP_POINT; break;
+ case UNIT_PIXEL : aMapUnit = MAP_PIXEL; break;
+ }
+ return aMapUnit;
+}
+
+sal_Int32 ExportDialog::GetDefaultUnit()
+{
+ sal_Int32 nDefaultUnit = UNIT_CM;
+ switch( mrFltCallPara.eFieldUnit )
+ {
+// case FUNIT_NONE :
+// case FUNIT_PERCENT :
+// case FUNIT_CUSTOM :
+ default: nDefaultUnit = UNIT_CM; break;
+
+ case FUNIT_MILE : // PASSTHROUGH INTENDED
+ case FUNIT_FOOT :
+ case FUNIT_TWIP :
+ case FUNIT_PICA : nDefaultUnit = UNIT_INCH; break;
+
+ case FUNIT_KM : // PASSTHROUGH INTENDED
+ case FUNIT_M :
+ case FUNIT_100TH_MM : nDefaultUnit = UNIT_CM; break;
+
+ case FUNIT_INCH : nDefaultUnit = UNIT_INCH; break;
+ case FUNIT_CM : nDefaultUnit = UNIT_CM; break;
+ case FUNIT_MM : nDefaultUnit = UNIT_MM; break;
+ case FUNIT_POINT : nDefaultUnit = UNIT_POINT; break;
+ }
+ return nDefaultUnit;
+}
+
+static basegfx::B2DRange GetShapeRangeForXShape( const uno::Reference< drawing::XShape >& rxShape,
+ const uno::Reference< graphic::XPrimitiveFactory2D >& rxPrimitiveFactory2D, const uno::Sequence< beans::PropertyValue >& rViewInformation )
+{
+ basegfx::B2DRange aShapeRange;
+
+ const uno::Sequence< beans::PropertyValue > aParams;
+ const uno::Sequence< uno::Reference< graphic::XPrimitive2D > > aPrimitiveSequence( rxPrimitiveFactory2D->createPrimitivesFromXShape( rxShape, aParams ) );
+
+ const sal_Int32 nCount = aPrimitiveSequence.getLength();
+ for( sal_Int32 nIndex = 0; nIndex < nCount; nIndex++ )
+ {
+ const geometry::RealRectangle2D aRect( aPrimitiveSequence[ nIndex ]->getRange( rViewInformation ) );
+ aShapeRange.expand( basegfx::B2DTuple( aRect.X1, aRect.Y1 ) );
+ aShapeRange.expand( basegfx::B2DTuple( aRect.X2, aRect.Y2 ) );
+ }
+ return aShapeRange;
+}
+
+uno::Sequence< beans::PropertyValue > ExportDialog::GetFilterData( sal_Bool bUpdateConfig )
+{
+ if ( bUpdateConfig )
+ {
+ sal_Int32 nUnit = maLbSizeX.GetSelectEntryPos();
+ if ( nUnit < 0 )
+ nUnit = UNIT_CM;
+
+ if ( ( mnInitialResolutionUnit == UNIT_DEFAULT ) && ( nUnit == GetDefaultUnit() ) )
+ nUnit = UNIT_DEFAULT;
+
+ // updating ui configuration
+ if ( mbIsPixelFormat )
+ {
+ if ( nUnit > UNIT_MAX_ID )
+ nUnit = UNIT_PIXEL;
+
+ sal_Int32 nResolution = maNfResolution.GetValue();
+ if ( nResolution < 1 )
+ nResolution = 96;
+
+ mpOptionsItem->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "PixelExportUnit" ) ), nUnit );
+ mpOptionsItem->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "PixelExportResolution" ) ), nResolution );
+ mpOptionsItem->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "PixelExportResolutionUnit" ) ), maLbResolution.GetSelectEntryPos() );
+ }
+ else
+ {
+ if ( nUnit >= UNIT_PIXEL )
+ nUnit = UNIT_CM;
+
+ mpOptionsItem->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "VectorExportUnit" ) ), nUnit );
+ }
+ }
+
+ FilterConfigItem* pFilterOptions;
+ if ( bUpdateConfig )
+ pFilterOptions = mpFilterOptionsItem;
+ else
+ {
+ uno::Sequence< beans::PropertyValue > aFilterData( mpFilterOptionsItem->GetFilterData() );
+ pFilterOptions = new FilterConfigItem( &aFilterData );
+ }
+
+ const String sLogicalWidth( String( RTL_CONSTASCII_USTRINGPARAM( "LogicalWidth" ) ) );
+ const String sLogicalHeight( String( RTL_CONSTASCII_USTRINGPARAM( "LogicalHeight" ) ) );
+ if ( mbIsPixelFormat )
+ {
+ pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "PixelWidth" ) ), static_cast< sal_Int32 >( maSize.Width ) );
+ pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "PixelHeight" ) ), static_cast< sal_Int32 >( maSize.Height ) );
+ if ( maResolution.Width && maResolution.Height )
+ {
+ const double f100thmmPerPixelX = 100000.0 / maResolution.Width;
+ const double f100thmmPerPixelY = 100000.0 / maResolution.Height;
+ sal_Int32 nLogicalWidth = static_cast< sal_Int32 >( f100thmmPerPixelX * maSize.Width );
+ sal_Int32 nLogicalHeight= static_cast< sal_Int32 >( f100thmmPerPixelY * maSize.Height );
+ if ( nLogicalWidth && nLogicalHeight )
+ {
+ pFilterOptions->WriteInt32( sLogicalWidth, nLogicalWidth );
+ pFilterOptions->WriteInt32( sLogicalHeight, nLogicalHeight );
+ }
+ }
+ }
+ else
+ {
+ pFilterOptions->WriteInt32( sLogicalWidth, static_cast< sal_Int32 >( maSize.Width ) );
+ pFilterOptions->WriteInt32( sLogicalHeight, static_cast< sal_Int32 >( maSize.Height ) );
+ }
+ switch ( mnFormat )
+ {
+ case FORMAT_JPG :
+ {
+ sal_Int32 nColor = maLbColorDepth.GetSelectEntryPos();
+ if ( nColor == 1 )
+ nColor = 0;
+ else
+ nColor = 1;
+ pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "ColorMode" ) ), nColor );
+ pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Quality" ) ), static_cast< sal_Int32 >( maSbCompression.GetThumbPos() ) );
+ }
+ break;
+
+ case FORMAT_PNG :
+ {
+ pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Compression" ) ), static_cast< sal_Int32 >( maSbCompression.GetThumbPos() ) );
+ sal_Int32 nInterlace = 0;
+ if ( maCbInterlaced.IsChecked() )
+ nInterlace++;
+ pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Interlaced" ) ), nInterlace );
+ }
+ break;
+
+ case FORMAT_BMP :
+ {
+ pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Color" ) ), maLbColorDepth.GetSelectEntryPos() + 1 );
+ pFilterOptions->WriteBool( String( RTL_CONSTASCII_USTRINGPARAM( "RLE_Coding" ) ), maCbRLEEncoding.IsChecked() );
+ }
+ break;
+
+ case FORMAT_GIF :
+ {
+ sal_Int32 nValue = 0;
+ if ( maCbInterlaced.IsChecked() )
+ nValue++;
+ pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Interlaced" ) ), nValue );
+
+ nValue = 0;
+ if ( maCbSaveTransparency.IsChecked() )
+ nValue++;
+ pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Translucent" ) ), nValue );
+ }
+ break;
+
+ case FORMAT_PBM :
+ case FORMAT_PGM :
+ case FORMAT_PPM :
+ {
+ sal_Int32 nFormat = 0;
+ if ( maRbText.IsChecked() )
+ nFormat++;
+ pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "FileFormat" ) ), nFormat );
+ }
+ break;
+
+ case FORMAT_EPS :
+ {
+ sal_Int32 nCheck = 0;
+ if ( maCbEPSPreviewTIFF.IsChecked() )
+ nCheck++;
+ if ( maCbEPSPreviewEPSI.IsChecked() )
+ nCheck += 2;
+ pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Preview" ) ), nCheck );
+
+ nCheck = 1;
+ if ( maRbEPSLevel2.IsChecked() )
+ nCheck++;
+ pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Version" ) ), nCheck );
+
+ nCheck = 1;
+ if ( maRbEPSColorFormat2.IsChecked() )
+ nCheck++;
+ pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "ColorFormat" ) ), nCheck );
+
+ nCheck = 1;
+ if ( maRbEPSCompressionNone.IsChecked() )
+ nCheck++;
+ pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "CompressionMode" ) ), nCheck );
+ }
+ break;
+ }
+
+ uno::Sequence< beans::PropertyValue > aRet( pFilterOptions->GetFilterData() );
+ if ( bUpdateConfig == sal_False )
+ delete pFilterOptions;
+ return aRet;
+}
+
+//
+awt::Size ExportDialog::GetOriginalSize()
+{
+ basegfx::B2DRange aShapesRange;
+
+ if ( mxPage.is () )
+ {
+ uno::Reference< beans::XPropertySet > xPagePropSet( mxPage, uno::UNO_QUERY );
+ if ( xPagePropSet.is() )
+ {
+ sal_Int32 nWidth = 0;
+ sal_Int32 nHeight= 0;
+ com::sun::star::uno::Any aAny;
+ aAny = xPagePropSet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Width" ) ) );
+ aAny >>= nWidth;
+ aAny = xPagePropSet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Height" ) ) );
+ aAny >>= nHeight;
+ aShapesRange = basegfx::B2DRange( 0, 0, nWidth, nHeight );
+ }
+ }
+ else
+ {
+ uno::Reference< graphic::XPrimitiveFactory2D > xPrimitiveFactory(
+ mxMgr->createInstance( String( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.graphic.PrimitiveFactory2D" ) ) ), uno::UNO_QUERY );
+ if ( xPrimitiveFactory.is() )
+ {
+ basegfx::B2DHomMatrix aViewTransformation( Application::GetDefaultDevice()->GetViewTransformation() );
+ com::sun::star::geometry::AffineMatrix2D aTransformation;
+ aTransformation.m00 = aViewTransformation.get(0,0);
+ aTransformation.m01 = aViewTransformation.get(0,1);
+ aTransformation.m02 = aViewTransformation.get(0,2);
+ aTransformation.m10 = aViewTransformation.get(1,0);
+ aTransformation.m11 = aViewTransformation.get(1,1);
+ aTransformation.m12 = aViewTransformation.get(1,2);
+
+ const rtl::OUString sViewTransformation( RTL_CONSTASCII_USTRINGPARAM( "ViewTransformation" ) );
+ uno::Sequence< beans::PropertyValue > aViewInformation( 1 );
+ aViewInformation[ 0 ].Value <<= aTransformation;
+ aViewInformation[ 0 ].Name = sViewTransformation;
+
+ if ( mxShape.is() )
+ aShapesRange = GetShapeRangeForXShape( mxShape, xPrimitiveFactory, aViewInformation );
+ else if ( mxShapes.is() )
+ {
+ const sal_Int32 nCount = mxShapes->getCount();
+ for( sal_Int32 nIndex = 0; nIndex < nCount; nIndex++ )
+ {
+ uno::Reference< drawing::XShape > xShape;
+ mxShapes->getByIndex( nIndex ) >>= xShape;
+ aShapesRange.expand( GetShapeRangeForXShape( xShape, xPrimitiveFactory, aViewInformation ) );
+ }
+ }
+ }
+ }
+ return awt::Size( static_cast<sal_Int32>(aShapesRange.getWidth()), static_cast<sal_Int32>(aShapesRange.getHeight()) );
+}
+
+void ExportDialog::GetGraphicSource()
+{
+ if ( mxSourceDocument.is() )
+ {
+ uno::Reference< frame::XModel > xModel( mxSourceDocument, uno::UNO_QUERY );
+ if ( xModel.is() )
+ {
+ uno::Reference< frame::XController > xController( xModel->getCurrentController() );
+ if ( xController.is() )
+ {
+ if ( mbExportSelection ) // check if there is a selection
+ {
+ uno::Reference< view::XSelectionSupplier > xSelectionSupplier( xController, uno::UNO_QUERY );
+ if ( xSelectionSupplier.is() )
+ {
+ uno::Any aAny( xSelectionSupplier->getSelection() );
+ if ( ! ( aAny >>= mxShapes ) )
+ aAny >>= mxShape;
+ }
+ }
+ if ( !mxShape.is() && !mxShapes.is() )
+ {
+ uno::Reference< drawing::XDrawView > xDrawView( xController, uno::UNO_QUERY );
+ if ( xDrawView.is() )
+ {
+ uno::Reference< drawing::XDrawPage > xCurrentPage( xDrawView->getCurrentPage() );
+ if ( xCurrentPage.is() )
+ {
+ mxPage = xCurrentPage; // exporting whole page
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+sal_Bool ExportDialog::GetGraphicStream()
+{
+ sal_Bool bRet = sal_False;
+
+ if ( !IsTempExportAvailable() )
+ {
+ delete mpTempStream, mpTempStream = new SvMemoryStream();
+ maBitmap = Bitmap();
+ return bRet;
+ }
+
+ sal_Bool bRecreateOutputStream = mpTempStream->Tell() == 0;
+
+ static uno::Sequence< beans::PropertyValue > aOldFilterData;
+ uno::Sequence< beans::PropertyValue > aNewFilterData( GetFilterData( sal_False ) );
+ if ( aOldFilterData != aNewFilterData )
+ {
+ aOldFilterData = aNewFilterData;
+ bRecreateOutputStream = sal_True;
+ }
+ try
+ {
+ if ( bRecreateOutputStream )
+ {
+ delete mpTempStream, mpTempStream = new SvMemoryStream();
+ maBitmap = Bitmap();
+
+ uno::Reference < io::XStream > xStream( new utl::OStreamWrapper( *mpTempStream ) );
+ uno::Reference < io::XOutputStream > xOutputStream( xStream->getOutputStream() );
+
+ uno::Reference< document::XExporter > xGraphicExporter(
+ mxMgr->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.GraphicExportFilter") ) ), uno::UNO_QUERY_THROW );
+ uno::Reference< document::XFilter > xFilter( xGraphicExporter, uno::UNO_QUERY_THROW );
+
+ sal_Int32 nProperties = 2;
+ uno::Sequence< beans::PropertyValue > aFilterData( nProperties );
+
+
+ rtl::OUString sFormat( maExt );
+ uno::Sequence< beans::PropertyValue > aDescriptor( 3 );
+ aDescriptor[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("OutputStream") );
+ aDescriptor[0].Value <<= xOutputStream;
+ aDescriptor[1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FilterName") );
+ aDescriptor[1].Value <<= sFormat;
+ aDescriptor[2].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FilterData") );
+ aDescriptor[2].Value <<= aNewFilterData;
+
+ uno::Reference< lang::XComponent > xSourceDoc;
+ if ( mxPage.is() )
+ xSourceDoc = uno::Reference< lang::XComponent >( mxPage, uno::UNO_QUERY_THROW );
+ else if ( mxShapes.is() )
+ xSourceDoc = uno::Reference< lang::XComponent >( mxShapes, uno::UNO_QUERY_THROW );
+ else if ( mxShape.is() )
+ xSourceDoc = uno::Reference< lang::XComponent >( mxShape, uno::UNO_QUERY_THROW );;
+ if ( xSourceDoc.is() )
+ {
+ xGraphicExporter->setSourceDocument( xSourceDoc );
+ xFilter->filter( aDescriptor );
+ bRet = sal_True;
+
+ if ( mnFormat == FORMAT_JPG )
+ {
+ mpTempStream->Seek( STREAM_SEEK_TO_BEGIN );
+ maBitmap = GetGraphicBitmap( *mpTempStream );
+ mpTempStream->Seek( STREAM_SEEK_TO_END );
+ }
+ }
+ }
+ else
+ bRet = sal_True;
+ }
+ catch( uno::Exception& )
+ {
+
+ // ups
+
+ }
+ return bRet;
+}
+
+Bitmap ExportDialog::GetGraphicBitmap( SvStream& rInputStream )
+{
+ Bitmap aRet;
+ Graphic aGraphic;
+ GraphicFilter aFilter( sal_False );
+ if ( aFilter.ImportGraphic( aGraphic, String(), rInputStream, GRFILTER_FORMAT_NOTFOUND, NULL, 0, NULL ) == GRFILTER_OK )
+ {
+ aRet = aGraphic.GetBitmap();
+ }
+ return aRet;
+}
+
+sal_uInt32 ExportDialog::GetRawFileSize() const
+{
+ sal_uInt64 nRawFileSize = 0;
+ if ( mbIsPixelFormat )
+ {
+ sal_Int32 nBitsPerPixel = 24;
+ String aEntry( maLbColorDepth.GetSelectEntry() );
+ if ( ms1BitTreshold == aEntry )
+ nBitsPerPixel = 1;
+ else if ( ms1BitDithered == aEntry )
+ nBitsPerPixel = 1;
+ else if ( ms4BitGrayscale == aEntry )
+ nBitsPerPixel = 4;
+ else if ( ms4BitColorPalette == aEntry )
+ nBitsPerPixel = 8;
+ else if ( ms8BitGrayscale == aEntry )
+ nBitsPerPixel = 8;
+ else if ( ms8BitColorPalette == aEntry )
+ nBitsPerPixel = 8;
+ else if ( ms24BitColor == aEntry )
+ nBitsPerPixel = 24;
+
+ if ( mbIsPixelFormat )
+ {
+ nRawFileSize = ( maSize.Width * nBitsPerPixel + 7 ) &~ 7; // rounding up to 8 bits
+ nRawFileSize /= 8; // in bytes
+ nRawFileSize *= maSize.Height;
+ }
+ if ( nRawFileSize > SAL_MAX_UINT32 )
+ nRawFileSize = 0;
+ }
+ return static_cast< sal_uInt32 >( nRawFileSize );
+}
+
+// checks if the source dimension/resolution is not too big
+// to determine the exact graphic output size and preview for jpg
+sal_Bool ExportDialog::IsTempExportAvailable() const
+{
+ return GetRawFileSize() < static_cast< sal_uInt32 >( mnMaxFilesizeForRealtimePreview );
+}
+
+ExportDialog::ExportDialog( FltCallDialogParameter& rPara,
+ const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > rxMgr,
+ const com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& rxSourceDocument,
+ sal_Bool bExportSelection, sal_Bool bIsPixelFormat ) :
+ ModalDialog ( rPara.pWindow, ResId( DLG_EXPORT, *rPara.pResMgr ) ),
+ mrFltCallPara ( rPara ),
+ mpMgr ( rPara.pResMgr ),
+ mxMgr ( rxMgr ),
+ mxSourceDocument ( rxSourceDocument ),
+ maFlExportSize ( this, ResId( FL_EXPORT_SIZE, *rPara.pResMgr ) ),
+ maFtSizeX ( this, ResId( FT_SIZEX, *rPara.pResMgr ) ),
+ maMfSizeX ( this, ResId( MF_SIZEX, *rPara.pResMgr ) ),
+ maLbSizeX ( this, ResId( LB_SIZEX, *rPara.pResMgr ) ),
+ maFtSizeY ( this, ResId( FT_SIZEY, *rPara.pResMgr ) ),
+ maMfSizeY ( this, ResId( MF_SIZEY, *rPara.pResMgr ) ),
+ maLbSizeY ( this, ResId( LB_SIZEY, *rPara.pResMgr ) ),
+ maFtResolution ( this, ResId( FT_RESOLUTION, *rPara.pResMgr ) ),
+ maNfResolution ( this, ResId( NF_RESOLUTION, *rPara.pResMgr ) ),
+ maLbResolution ( this, ResId( LB_RESOLUTION, *rPara.pResMgr ) ),
+ maFlColorDepth ( this, ResId( FL_COLOR_DEPTH, *rPara.pResMgr ) ),
+ maLbColorDepth ( this, ResId( LB_COLOR_DEPTH, *rPara.pResMgr ) ),
+ maFlJPGQuality ( this, ResId( FL_JPG_QUALITY, *rPara.pResMgr ) ),
+ maFlMode ( this, ResId( FL_MODE, *rPara.pResMgr ) ),
+ maFlPBMOptions ( this, ResId( FL_PBM_OPTIONS, *rPara.pResMgr ) ),
+ maSbCompression ( this, ResId( SB_COMPRESSION, *rPara.pResMgr ) ),
+ maNfCompression ( this, ResId( NF_COMPRESSION, *rPara.pResMgr ) ),
+ maFtJPGMin ( this, ResId( FT_JPG_MIN, *rPara.pResMgr ) ),
+ maFtJPGMax ( this, ResId( FT_JPG_MAX, *rPara.pResMgr ) ),
+ maFtPNGMin ( this, ResId( FT_PNG_MIN, *rPara.pResMgr ) ),
+ maFtPNGMax ( this, ResId( FT_PNG_MAX, *rPara.pResMgr ) ),
+ maCbJPGPreview ( this, ResId( CB_JPG_PREVIEW, *rPara.pResMgr ) ),
+ maCbInterlaced ( this, ResId( CB_INTERLACED, *rPara.pResMgr ) ),
+ maCbRLEEncoding ( this, ResId( CB_RLE_ENCODING, *rPara.pResMgr ) ),
+ maFlGIFDrawingObjects ( this, ResId( FL_GIF_DRAWING_OBJECTS, *rPara.pResMgr ) ),
+ maCbSaveTransparency ( this, ResId( CB_SAVE_TRANSPARENCY, *rPara.pResMgr ) ),
+ maRbBinary ( this, ResId( RB_BINARY, *rPara.pResMgr ) ),
+ maRbText ( this, ResId( RB_TEXT, *rPara.pResMgr ) ),
+ maFlEPSPreview ( this, ResId( FL_EPS_PREVIEW, *rPara.pResMgr ) ),
+ maCbEPSPreviewTIFF ( this, ResId( CB_EPS_PREVIEW_TIFF, *rPara.pResMgr ) ),
+ maCbEPSPreviewEPSI ( this, ResId( CB_EPS_PREVIEW_EPSI, *rPara.pResMgr ) ),
+ maFlEPSVersion ( this, ResId( FL_EPS_VERSION, *rPara.pResMgr ) ),
+ maRbEPSLevel1 ( this, ResId( RB_EPS_LEVEL1, *rPara.pResMgr ) ),
+ maRbEPSLevel2 ( this, ResId( RB_EPS_LEVEL2, *rPara.pResMgr ) ),
+ maFlEPSColorFormat ( this, ResId( FL_EPS_COLOR_FORMAT, *rPara.pResMgr ) ),
+ maRbEPSColorFormat1 ( this, ResId( RB_EPS_COLOR_FORMAT1, *rPara.pResMgr ) ),
+ maRbEPSColorFormat2 ( this, ResId( RB_EPS_COLOR_FORMAT2, *rPara.pResMgr ) ),
+ maFlCompression ( this, ResId( FL_COMPRESSION, *rPara.pResMgr ) ),
+ maRbEPSCompressionLZW ( this, ResId( RB_EPS_COMPRESSION_LZW, *rPara.pResMgr ) ),
+ maRbEPSCompressionNone ( this, ResId( RB_EPS_COMPRESSION_NONE, *rPara.pResMgr ) ),
+ maFlEstimatedSize ( this, ResId( FL_ESTIMATED_SIZE, *rPara.pResMgr ) ),
+ maFtEstimatedSize ( this, ResId( FT_ESTIMATED_SIZE, *rPara.pResMgr ) ),
+ msEstimatedSizePix1 ( ResId( STR_ESTIMATED_SIZE_PIX_1, *rPara.pResMgr ) ),
+ msEstimatedSizePix2 ( ResId( STR_ESTIMATED_SIZE_PIX_2, *rPara.pResMgr ) ),
+ msEstimatedSizeVec ( ResId( STR_ESTIMATED_SIZE_VEC, *rPara.pResMgr ) ),
+ maFlButtons ( this, ResId( FL_BUTTONS, *rPara.pResMgr ) ),
+ maFbJPGPreview ( this, ResId( FB_JPG_PREVIEW, *rPara.pResMgr ) ),
+ maSbZoom ( this, ResId( SB_ZOOM, *rPara.pResMgr ) ),
+ maNfZoom ( this, ResId( NF_ZOOM, *rPara.pResMgr ) ),
+ maSbJPGPreviewHorz ( this, ResId( SB_JPG_PREVIEW_HORZ, *rPara.pResMgr ) ),
+ maSbJPGPreviewVert ( this, ResId( SB_JPG_PREVIEW_VERT, *rPara.pResMgr ) ),
+ maBtnOK ( this, ResId( BTN_OK, *rPara.pResMgr ) ),
+ maBtnCancel ( this, ResId( BTN_CANCEL, *rPara.pResMgr ) ),
+ maBtnHelp ( this, ResId( BTN_HELP, *rPara.pResMgr ) ),
+ ms1BitTreshold ( ResId( STR_1BIT_THRESHOLD, *rPara.pResMgr ) ),
+ ms1BitDithered ( ResId( STR_1BIT_DITHERED, *rPara.pResMgr ) ),
+ ms4BitGrayscale ( ResId( STR_4BIT_GRAYSCALE, *rPara.pResMgr ) ),
+ ms4BitColorPalette ( ResId( STR_4BIT_COLOR_PALETTE, *rPara.pResMgr ) ),
+ ms8BitGrayscale ( ResId( STR_8BIT_GRAYSCALE, *rPara.pResMgr ) ),
+ ms8BitColorPalette ( ResId( STR_8BIT_COLOR_PALETTE, *rPara.pResMgr ) ),
+ ms24BitColor ( ResId( STR_24BIT_TRUE_COLOR, *rPara.pResMgr ) ),
+ maExt ( rPara.aFilterExt ),
+ mnFormat ( FORMAT_UNKNOWN ),
+ mnMaxFilesizeForRealtimePreview( 0 ),
+ mpTempStream ( new SvMemoryStream() ),
+ maOriginalSize ( awt::Size( 0, 0 ) ),
+ mbPreview ( sal_False ),
+ mbIsPixelFormat ( bIsPixelFormat ),
+ mbExportSelection ( bExportSelection ),
+ mbPreserveAspectRatio ( sal_True )
+{
+ GetGraphicSource();
+
+ maExt.ToUpperAscii();
+
+ String aFilterConfigPath( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/Graphic/Export/" ) );
+ mpOptionsItem = new FilterConfigItem( aFilterConfigPath, &rPara.aFilterData );
+ aFilterConfigPath.Append( maExt );
+ mpFilterOptionsItem = new FilterConfigItem( aFilterConfigPath, &rPara.aFilterData );
+
+ mnInitialResolutionUnit = mbIsPixelFormat
+ ? mpOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "PixelExportUnit" ) ), UNIT_DEFAULT )
+ : mpOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "VectorExportUnit" ) ), UNIT_DEFAULT );
+
+ mnMaxFilesizeForRealtimePreview = mpOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "MaxFilesizeForRealtimePreview" ) ), 0 );
+ maFtEstimatedSize.SetText( String( RTL_CONSTASCII_USTRINGPARAM( " \n " ) ) );
+
+ String aTitle( maExt );
+ aTitle += String( ResId( DLG_EXPORT_TITLE, *mpMgr ) );
+ SetText( aTitle );
+
+ mnFormat = GetFilterFormat( maExt );
+
+ Size aResolution( Application::GetDefaultDevice()->LogicToPixel( Size( 100, 100 ), MAP_CM ) );
+ maResolution.Width = aResolution.Width();
+ maResolution.Height= aResolution.Height();
+ maOriginalSize = GetOriginalSize();
+ if ( bIsPixelFormat )
+ {
+ double fPixelsPer100thmm = static_cast< double >( maResolution.Width ) / 100000.0;
+ maSize = awt::Size( static_cast< sal_Int32 >( ( fPixelsPer100thmm * maOriginalSize.Width ) + 0.5 ),
+ static_cast< sal_Int32 >( ( fPixelsPer100thmm * maOriginalSize.Height ) + 0.5 ) );
+ }
+ else
+ {
+ maSize = maOriginalSize;
+ }
+
+ // Size
+ maLbSizeX.SetSelectHdl( LINK( this, ExportDialog, UpdateHdl ) );
+
+ maSbCompression.SetScrollHdl( LINK( this, ExportDialog, SbCompressionUpdateHdl ) );
+ maNfCompression.SetModifyHdl( LINK( this, ExportDialog, UpdateHdl ) );
+
+ maMfSizeX.SetModifyHdl( LINK( this, ExportDialog, UpdateHdlMtfSizeX ) );
+ maMfSizeY.SetModifyHdl( LINK( this, ExportDialog, UpdateHdlMtfSizeY ) );
+
+ maNfResolution.SetModifyHdl( LINK( this, ExportDialog, UpdateHdlNfResolution ) );
+ maLbResolution.SetSelectHdl( LINK( this, ExportDialog, UpdateHdl ) );
+
+ maLbColorDepth.SetSelectHdl( LINK( this, ExportDialog, UpdateHdl ) );
+
+ maCbInterlaced.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) );
+
+ maCbSaveTransparency.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) );
+
+ maCbEPSPreviewTIFF.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) );
+ maCbEPSPreviewEPSI.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) );
+
+ maRbEPSCompressionLZW.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) );
+ maRbEPSCompressionNone.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) );
+
+ maRbBinary.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) );
+ maRbText.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) );
+
+
+ // JPG Preview
+// maCbJPGPreview.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) );
+maCbJPGPreview.Enable( sal_False );
+
+ maSbJPGPreviewVert.SetScrollHdl( LINK( this, ExportDialog, UpdateHdl ) );
+ maSbJPGPreviewHorz.SetScrollHdl( LINK( this, ExportDialog, UpdateHdl ) );
+ maSbZoom.SetScrollHdl( LINK( this, ExportDialog, UpdateHdl ) );
+
+ // BMP
+ maCbRLEEncoding.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) );
+
+ // EPS
+ maRbEPSLevel1.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) );
+ maRbEPSLevel2.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) );
+
+ maBtnOK.SetClickHdl( LINK( this, ExportDialog, OK ) );
+
+ setupLayout();
+ updateControls();
+
+ FreeResource();
+}
+
+void ExportDialog::createSizeControls( vcl::RowOrColumn& rLayout )
+{
+ size_t nIndex;
+ Size aBorder( LogicToPixel( Size( 5, 5 ), MapMode( MAP_APPFONT ) ) );
+ long nIndent = aBorder.Width();
+
+ // Size controls
+ rLayout.addWindow( &maFlExportSize );
+
+ Size aLbMax( maLbSizeX.GetSizePixel() );
+ aLbMax.Width() = Max( aLbMax.Width(), maLbResolution.GetSizePixel().Width() );
+
+ boost::shared_ptr< vcl::LabelColumn > xSizeColumns( new vcl::LabelColumn( &rLayout ) );
+ rLayout.addChild( xSizeColumns );
+
+ // row 1
+ boost::shared_ptr< vcl::RowOrColumn > xColumn( new vcl::RowOrColumn( xSizeColumns.get(), false ) );
+ xSizeColumns->addRow( &maFtSizeX, xColumn, nIndent );
+ Size aMinSize( maMfSizeX.GetSizePixel() );
+ nIndex = xColumn->addWindow( &maMfSizeX );
+ xColumn->setMinimumSize( nIndex, aMinSize );
+ nIndex = xColumn->addWindow( &maLbSizeX );
+ xColumn->setMinimumSize( nIndex, aLbMax );
+
+ // row 2
+ xColumn = boost::shared_ptr< vcl::RowOrColumn >( new vcl::RowOrColumn( xSizeColumns.get(), false ) );
+ xSizeColumns->addRow( &maFtSizeY, xColumn, nIndent );
+ nIndex = xColumn->addWindow( &maMfSizeY );
+ xColumn->setMinimumSize( nIndex, aMinSize );
+ nIndex = xColumn->addWindow( &maLbSizeY );
+ xColumn->setMinimumSize( nIndex, aLbMax );
+
+ // row 3
+ if ( mbIsPixelFormat ) // TODO: (metafileresolutionsupport)
+ {
+ xColumn = boost::shared_ptr< vcl::RowOrColumn >( new vcl::RowOrColumn( xSizeColumns.get(), false ) );
+ xSizeColumns->addRow( &maFtResolution, xColumn, nIndent );
+ nIndex = xColumn->addWindow( &maNfResolution );
+ xColumn->setMinimumSize( nIndex, aMinSize );
+ nIndex = xColumn->addWindow( &maLbResolution );
+ xColumn->setMinimumSize( nIndex, aLbMax );
+ }
+
+ sal_Int32 nUnit = mnInitialResolutionUnit;
+ if ( nUnit == UNIT_DEFAULT )
+ nUnit = GetDefaultUnit();
+
+ if ( !mbIsPixelFormat )
+ {
+ maLbSizeX.RemoveEntry( UNIT_PIXEL ); // removing pixel
+ if ( nUnit >= UNIT_PIXEL )
+ nUnit = UNIT_CM;
+ }
+ else if ( nUnit > UNIT_MAX_ID )
+ nUnit = UNIT_PIXEL;
+ if ( nUnit < 0 )
+ nUnit = UNIT_CM;
+ maLbSizeX.SelectEntryPos( static_cast< USHORT >( nUnit ) );
+
+ if ( mbIsPixelFormat ) // TODO: (metafileresolutionsupport) should be supported for vector formats also... this makes
+ { // sense eg for bitmap fillings in metafiles, to preserve high dpi output
+ // (atm without special vector support the bitmaps are rendered with 96dpi)
+ sal_Int32 nResolution = mpOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "PixelExportResolution" ) ), 96 );
+ if ( nResolution < 1 )
+ nResolution = 96;
+ maNfResolution.SetValue( nResolution );
+
+ sal_Int32 nResolutionUnit = mpOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "PixelExportResolutionUnit" ) ), 1 );
+ if ( ( nResolutionUnit < 0 ) || ( nResolutionUnit > 2 ) )
+ nResolutionUnit = 1;
+ maLbResolution.SelectEntryPos( static_cast< USHORT >( nResolutionUnit ) );
+ }
+
+ boost::shared_ptr< vcl::Spacer > xSpacer( new vcl::Spacer( &rLayout, 2 ) );
+ rLayout.addChild( xSpacer );
+}
+
+void ExportDialog::createColorDepthControls( vcl::RowOrColumn& rLayout )
+{
+ // Color Depth
+ Size aBorder( LogicToPixel( Size( 5, 5 ), MapMode( MAP_APPFONT ) ) );
+ long nIndent = aBorder.Width();
+
+ boost::shared_ptr< vcl::RowOrColumn > xRow( new vcl::RowOrColumn( &rLayout, false ) );
+ rLayout.addChild( xRow );
+ xRow->addWindow( &maFlColorDepth );
+
+ xRow = boost::shared_ptr< vcl::RowOrColumn >( new vcl::RowOrColumn( &rLayout, false ) );
+ rLayout.addChild( xRow );
+ boost::shared_ptr< vcl::Indenter > xIndenter( new vcl::Indenter( &rLayout, nIndent ) );
+ xRow->addChild( xIndenter );
+ boost::shared_ptr< vcl::RowOrColumn > xRows( new vcl::RowOrColumn( &rLayout, true ) );
+ xIndenter->setChild( xRows );
+ xRows->addWindow( &maLbColorDepth );
+
+ boost::shared_ptr< vcl::Spacer > xSpacer( new vcl::Spacer( &rLayout, 2 ) );
+ rLayout.addChild( xSpacer );
+}
+
+void ExportDialog::createScrollBar( vcl::RowOrColumn& rLayout )
+{
+ boost::shared_ptr< vcl::RowOrColumn > xRow( new vcl::RowOrColumn( &rLayout, false ) );
+ rLayout.addChild( xRow );
+
+ Size aMinSize( maSbCompression.GetSizePixel() );
+ size_t nIndex = xRow->addWindow( &maSbCompression );
+ xRow->setMinimumSize( nIndex, aMinSize );
+ aMinSize = maNfCompression.GetSizePixel();
+ nIndex = xRow->addWindow( &maNfCompression );
+ xRow->setMinimumSize( nIndex, aMinSize );
+}
+
+void ExportDialog::createFilterOptions( vcl::RowOrColumn& rLayout )
+{
+ Size aBorder( LogicToPixel( Size( 5, 5 ), MapMode( MAP_APPFONT ) ) );
+ long nIndent = aBorder.Width();
+
+ switch( mnFormat )
+ {
+ case FORMAT_JPG :
+ {
+ sal_Int32 nColor = mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "ColorMode" ) ), 0 );
+ if ( nColor == 1 )
+ nColor = 0;
+ else
+ nColor = 1;
+ maLbColorDepth.InsertEntry( ms8BitGrayscale );
+ maLbColorDepth.InsertEntry( ms24BitColor );
+ maLbColorDepth.SelectEntryPos( nColor );
+ createColorDepthControls( maLayout );
+
+ rLayout.addWindow( &maFlJPGQuality );
+
+ // Quality
+ boost::shared_ptr< vcl::Indenter > xIndenter( new vcl::Indenter( &rLayout, nIndent ) );
+ rLayout.addChild( xIndenter );
+ boost::shared_ptr< vcl::RowOrColumn > xRows( new vcl::RowOrColumn( &rLayout, true ) );
+ xIndenter->setChild( xRows );
+ createScrollBar( *xRows.get() );
+ xRows->addWindow( &maFtJPGMin );
+ xRows->addWindow( &maFtJPGMax );
+ if ( maCbJPGPreview.IsEnabled() )
+ xRows->addWindow( &maCbJPGPreview );
+
+ boost::shared_ptr< vcl::Spacer > xSpacer( new vcl::Spacer( &rLayout, 2 ) );
+ rLayout.addChild( xSpacer );
+
+ sal_Int32 nQuality = mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Quality" ) ), 75 );
+ if ( ( nQuality < 1 ) || ( nQuality > 100 ) )
+ nQuality = 75;
+
+ maSbCompression.SetRangeMin( 1 );
+ maSbCompression.SetRangeMax( 100 );
+ maNfCompression.SetMin( 1 );
+ maNfCompression.SetMax( 100 );
+ maNfCompression.SetValue( nQuality );
+ maNfCompression.SetStrictFormat( sal_True );
+ if ( maCbJPGPreview.IsEnabled() )
+ maCbJPGPreview.Check( sal_False );
+ }
+ break;
+ case FORMAT_PNG :
+ {
+ rLayout.addWindow( &maFlCompression );
+
+ // Compression 1..9
+ boost::shared_ptr< vcl::Indenter > xIndenter( new vcl::Indenter( &rLayout, nIndent ) );
+ rLayout.addChild( xIndenter );
+ boost::shared_ptr< vcl::RowOrColumn > xRows( new vcl::RowOrColumn( &rLayout, true ) );
+ xIndenter->setChild( xRows );
+ createScrollBar( *xRows.get() );
+ xRows->addWindow( &maFtPNGMin );
+ xRows->addWindow( &maFtPNGMax );
+ boost::shared_ptr< vcl::Spacer > xSpacer( new vcl::Spacer( &rLayout, 2 ) );
+ rLayout.addChild( xSpacer );
+
+ // Interlaced
+ rLayout.addWindow( &maFlMode );
+ xIndenter.reset( new vcl::Indenter( &rLayout, nIndent ) );
+ rLayout.addChild( xIndenter );
+ xRows.reset( new vcl::RowOrColumn( &rLayout, true ) );
+ xIndenter->setChild( xRows );
+ xRows->addWindow( &maCbInterlaced );
+
+ xSpacer.reset( new vcl::Spacer( &rLayout, 2 ) );
+ rLayout.addChild( xSpacer );
+
+ sal_Int32 nCompression = mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Compression" ) ), 6 );
+ if ( ( nCompression < 1 ) || ( nCompression > 9 ) )
+ nCompression = 6;
+ maSbCompression.SetRangeMin( 1 );
+ maSbCompression.SetRangeMax( 9 );
+ maNfCompression.SetMin( 1 );
+ maNfCompression.SetMax( 9 );
+ maNfCompression.SetValue( 9 );
+ maNfCompression.SetStrictFormat( sal_True );
+
+ maCbInterlaced.Check( mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Interlaced" ) ), 0 ) != 0 );
+ }
+ break;
+ case FORMAT_BMP :
+ {
+ sal_Int32 nColor = mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Color" ) ), 0 );
+ if ( nColor == 0 )
+ nColor = 6;
+ else
+ nColor--;
+ maLbColorDepth.InsertEntry( ms1BitTreshold );
+ maLbColorDepth.InsertEntry( ms1BitDithered );
+ maLbColorDepth.InsertEntry( ms4BitGrayscale );
+ maLbColorDepth.InsertEntry( ms4BitColorPalette );
+ maLbColorDepth.InsertEntry( ms8BitGrayscale );
+ maLbColorDepth.InsertEntry( ms8BitColorPalette );
+ maLbColorDepth.InsertEntry( ms24BitColor );
+ maLbColorDepth.SelectEntryPos( nColor );
+ createColorDepthControls( maLayout );
+
+ rLayout.addWindow( &maFlCompression );
+ // RLE coding
+ boost::shared_ptr< vcl::Indenter > xIndenter( new vcl::Indenter( &rLayout, nIndent ) );
+ rLayout.addChild( xIndenter );
+ boost::shared_ptr< vcl::RowOrColumn > xRows( new vcl::RowOrColumn( &rLayout, true ) );
+ xIndenter->setChild( xRows );
+ xRows->addWindow( &maCbRLEEncoding );
+ boost::shared_ptr< vcl::Spacer > xSpacer( new vcl::Spacer( &rLayout, 2 ) );
+ rLayout.addChild( xSpacer );
+
+ maCbRLEEncoding.Check( mpFilterOptionsItem->ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "RLE_Coding" ) ), sal_True ) );
+ }
+ break;
+ case FORMAT_GIF :
+ {
+ rLayout.addWindow( &maFlMode );
+ boost::shared_ptr< vcl::Indenter > xIndenter( new vcl::Indenter( &rLayout, nIndent ) );
+ rLayout.addChild( xIndenter );
+ boost::shared_ptr< vcl::RowOrColumn > xRows( new vcl::RowOrColumn( &rLayout, true ) );
+ xIndenter->setChild( xRows );
+ xRows->addWindow( &maCbInterlaced );
+ boost::shared_ptr< vcl::Spacer > xSpacer( new vcl::Spacer( &rLayout, 2 ) );
+ rLayout.addChild( xSpacer );
+
+ rLayout.addWindow( &maFlGIFDrawingObjects );
+ xIndenter = boost::shared_ptr< vcl::Indenter >( new vcl::Indenter( &rLayout, nIndent ) );
+ rLayout.addChild( xIndenter );
+ xRows = boost::shared_ptr< vcl::RowOrColumn >( new vcl::RowOrColumn( &rLayout, true ) );
+ xIndenter->setChild( xRows );
+ xRows->addWindow( &maCbSaveTransparency );
+ xSpacer.reset( new vcl::Spacer( &rLayout, 2 ) );
+ rLayout.addChild( xSpacer );
+
+ maCbInterlaced.Check( mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Interlaced" ) ), 1 ) != 0 );
+ maCbSaveTransparency.Check( mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Translucent" ) ), 1 ) != 0 );
+ }
+ break;
+ case FORMAT_PBM :
+ case FORMAT_PGM :
+ case FORMAT_PPM :
+ {
+ rLayout.addWindow( &maFlJPGQuality );
+
+ // RB Binary / Text
+ boost::shared_ptr< vcl::Indenter > xIndenter( new vcl::Indenter( &rLayout, nIndent ) );
+ rLayout.addChild( xIndenter );
+ boost::shared_ptr< vcl::RowOrColumn > xRows( new vcl::RowOrColumn( &rLayout, true ) );
+ xIndenter->setChild( xRows );
+ xRows->addWindow( &maRbBinary );
+ xRows->addWindow( &maRbText );
+ boost::shared_ptr< vcl::Spacer > xSpacer( new vcl::Spacer( &rLayout, 2 ) );
+ rLayout.addChild( xSpacer );
+
+ sal_Int32 nFormat = mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "FileFormat" ) ), 1 );
+ maRbBinary.Check( nFormat == 0 );
+ maRbText.Check( nFormat != 0 );
+ }
+ break;
+ case FORMAT_EPS :
+ {
+ boost::shared_ptr< vcl::RowOrColumn > xColumns( new vcl::RowOrColumn( &rLayout, false ) );
+ rLayout.addChild( xColumns );
+ boost::shared_ptr< vcl::RowOrColumn > xLeft( new vcl::RowOrColumn( &rLayout, true ) );
+ xColumns->addChild( xLeft );
+
+ xLeft->addWindow( &maFlEPSPreview );
+ boost::shared_ptr< vcl::Indenter > xIndenter( new vcl::Indenter( xLeft.get(), nIndent ) );
+ xLeft->addChild( xIndenter );
+ boost::shared_ptr< vcl::RowOrColumn > xRows( new vcl::RowOrColumn( xLeft.get(), true ) );
+ xIndenter->setChild( xRows );
+ xRows->addWindow( &maCbEPSPreviewTIFF );
+ xRows->addWindow( &maCbEPSPreviewEPSI );
+ boost::shared_ptr< vcl::Spacer > xSpacer( new vcl::Spacer( xLeft.get(), 2 ) );
+ xLeft->addChild( xSpacer );
+
+ xLeft->addWindow( &maFlEPSVersion );
+ xIndenter = boost::shared_ptr< vcl::Indenter >( new vcl::Indenter( xLeft.get(), nIndent ) );
+ xLeft->addChild( xIndenter );
+ xRows = boost::shared_ptr< vcl::RowOrColumn >( new vcl::RowOrColumn( xLeft.get(), true ) );
+ xIndenter->setChild( xRows );
+ xRows->addWindow( &maRbEPSLevel1 );
+ xRows->addWindow( &maRbEPSLevel2 );
+ xSpacer.reset( new vcl::Spacer( xLeft.get(), 2 ) );
+ xLeft->addChild( xSpacer );
+
+ boost::shared_ptr< vcl::RowOrColumn > xRight( new vcl::RowOrColumn( &rLayout, true ) );
+ xColumns->addChild( xRight );
+
+ xRight->addWindow( &maFlEPSColorFormat );
+ xIndenter = boost::shared_ptr< vcl::Indenter >( new vcl::Indenter( xRight.get(), nIndent ) );
+ xRight->addChild( xIndenter );
+ xRows = boost::shared_ptr< vcl::RowOrColumn >( new vcl::RowOrColumn( xRight.get(), true ) );
+ xIndenter->setChild( xRows );
+ xRows->addWindow( &maRbEPSColorFormat1 );
+ xRows->addWindow( &maRbEPSColorFormat2 );
+ xSpacer.reset( new vcl::Spacer( xRight.get(), 2 ) );
+ xRight->addChild( xSpacer );
+
+ xRight->addWindow( &maFlCompression );
+ xIndenter = boost::shared_ptr< vcl::Indenter >( new vcl::Indenter( xRight.get(), nIndent ) );
+ xRight->addChild( xIndenter );
+ xRows = boost::shared_ptr< vcl::RowOrColumn >( new vcl::RowOrColumn( xRight.get(), true ) );
+ xIndenter->setChild( xRows );
+ xRows->addWindow( &maRbEPSCompressionLZW );
+ xRows->addWindow( &maRbEPSCompressionNone );
+
+ xSpacer.reset( new vcl::Spacer( &rLayout, 2 ) );
+ rLayout.addChild( xSpacer );
+
+ sal_Int32 nPreview = mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Preview" ) ), 0 );
+ sal_Int32 nVersion = mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Version" ) ), 2 );
+ sal_Int32 nColor = mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "ColorFormat" ) ), 0 );
+ sal_Int32 nCompr = mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "CompressionMode" ) ), 2 );
+
+ mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "TextMode" ) ), 0 );
+
+ maCbEPSPreviewTIFF.Check( ( nPreview & 1 ) != 0 );
+ maCbEPSPreviewEPSI.Check( ( nPreview & 2 ) != 0 );
+
+ maRbEPSLevel1.Check( nVersion == 1 );
+ maRbEPSLevel2.Check( nVersion == 2 );
+
+ maRbEPSColorFormat1.Check( nColor == 1 );
+ maRbEPSColorFormat2.Check( nColor != 1 );
+
+ maRbEPSCompressionLZW.Check( nCompr == 1 );
+ maRbEPSCompressionNone.Check( nCompr != 1 );
+ }
+ break;
+ }
+}
+
+void ExportDialog::createButtons( vcl::RowOrColumn& rLayout )
+{
+ rLayout.addWindow( &maFlButtons );
+ boost::shared_ptr< vcl::Spacer > xSpacer( new vcl::Spacer( &rLayout, 2 ) );
+ rLayout.addChild( xSpacer );
+
+ Size aBorder( LogicToPixel( Size( 5, 5 ), MapMode( MAP_APPFONT ) ) );
+
+ boost::shared_ptr< vcl::RowOrColumn > xButtons( new vcl::RowOrColumn( &rLayout, false ) );
+ size_t nIndex = rLayout.addChild( xButtons );
+ rLayout.setBorders( nIndex, aBorder.Width(), 0, aBorder.Width(), aBorder.Width() );
+
+ Size aMinSize( maBtnCancel.GetSizePixel() );
+ // insert help button
+ xButtons->setMinimumSize( xButtons->addWindow( &maBtnHelp ), aMinSize );
+
+ // insert a spacer, cancel and OK buttons are right aligned
+
+ xSpacer.reset( new vcl::Spacer( xButtons.get(), 2 ) );
+ xButtons->addChild( xSpacer );
+ xButtons->setMinimumSize( xButtons->addWindow( &maBtnOK ), aMinSize );
+ xButtons->setMinimumSize( xButtons->addWindow( &maBtnCancel ), aMinSize );
+}
+
+void ExportDialog::setupLayout()
+{
+ Size aBorder( LogicToPixel( Size( 5, 5 ), MapMode( MAP_APPFONT ) ) );
+ maLayout.setParentWindow( this );
+ maLayout.setOuterBorder( aBorder.Width() );
+
+ createSizeControls( maLayout );
+ createFilterOptions( maLayout );
+
+ if ( mnMaxFilesizeForRealtimePreview || mbIsPixelFormat )
+ {
+ maLayout.addWindow( &maFlEstimatedSize );
+ maLayout.addWindow( &maFtEstimatedSize );
+ }
+ createButtons( maLayout );
+
+ maLayout.show();
+ maDialogSize = maLayout.getOptimalSize( WINDOWSIZE_PREFERRED );
+ maLayout.setManagedArea( Rectangle( Point(), maDialogSize ) );
+ SetOutputSizePixel( Size( mbPreview ? maDialogSize.Width() * 2 : maDialogSize.Width(), maDialogSize.Height() ) );
+
+ maRectFlButtons = Rectangle( maFlButtons.GetPosPixel(), maFlButtons.GetSizePixel() );
+ maRectBtnHelp = Rectangle( maBtnHelp.GetPosPixel(), maBtnHelp.GetSizePixel() );
+ maRectBtnOK = Rectangle( maBtnOK.GetPosPixel(), maBtnOK.GetSizePixel() );
+ maRectBtnCancel = Rectangle( maBtnCancel.GetPosPixel(), maBtnOK.GetSizePixel() );
+
+ maLbSizeY.Hide();
+}
+
+static rtl::OUString ImpValueOfInKB( const sal_Int64& rVal )
+{
+ double fVal( static_cast<double>( rVal ) );
+ fVal /= ( 1 << 10 );
+ fVal += 0.05;
+ rtl::OUStringBuffer aVal( rtl::OUString::valueOf( fVal ) );
+ sal_Int32 nX( rtl::OUString( aVal.getStr() ).indexOf( '.', 0 ) );
+ if ( nX > 0 )
+ aVal.setLength( nX + 2 );
+ return aVal.makeStringAndClear();
+}
+
+sal_Int32 static GetZoomValueFromThumbPos( sal_Int32 nThumbPos )
+{
+ sal_Int32 nProz = 0;
+ if ( nThumbPos <= 50 )
+ nProz = nThumbPos * 2; // so a range of 50 represents 100%
+ else
+ nProz = ( ( nThumbPos - 50 ) * 60 ) + 100; // we want to scale up to 3000%
+ return nProz;
+}
+
+void ExportDialog::updatePreview()
+{
+ // JPG
+// maCbJPGPreview.Enable( IsTempExportAvailable() );
+
+// if ( maCbJPGPreview.IsEnabled() && maCbJPGPreview.IsChecked() )
+ if ( mbPreview )
+ {
+ long nScrollBarSize = Application::GetSettings().GetStyleSettings().GetScrollBarSize();
+
+ Point aPreviewPos( maDialogSize.Width(), 0 );
+ Size aPreviewSize( maDialogSize.Width(), maFlButtons.GetPosPixel().Y() );
+
+ Point aFixedBitmapPos( aPreviewPos );
+ Size aFixedBitmapSize( aPreviewSize );
+
+ maSbZoom.Show( sal_False );
+ maSbZoom.SetPosPixel( Point( aPreviewPos.X(), aPreviewPos.Y() ) );
+ maSbZoom.SetSizePixel( Size( aPreviewSize.Width() / 4, nScrollBarSize ) );
+ maNfZoom.Show( sal_False );
+ maNfZoom.SetPosPixel( Point( aPreviewPos.X() + aPreviewSize.Width() / 4, aPreviewPos.Y() ) );
+ maNfZoom.SetSizePixel( Size( aPreviewSize.Width() / 6, nScrollBarSize ) );
+ maNfZoom.SetValue( GetZoomValueFromThumbPos( maSbZoom.GetThumbPos() ) );
+ maFbJPGPreview.Show( sal_True );
+
+ sal_Int32 nZoom = GetZoomValueFromThumbPos( maSbZoom.GetThumbPos() );
+ double fSizePixelX = static_cast< double >( maSize.Width * nZoom ) / 100.0;
+ double fSizePixelY = static_cast< double >( maSize.Height * nZoom ) / 100.0;
+
+ double fXRatio = fSizePixelX / maSize.Width; // the size of each pixel
+ double fYRatio = fSizePixelY / maSize.Height;
+
+ sal_Bool bHorzSb = fSizePixelX > aFixedBitmapSize.Width();
+ sal_Bool bVertSb = fSizePixelY > aFixedBitmapSize.Height();
+ if ( bHorzSb )
+ {
+ aFixedBitmapSize.Height() -= nScrollBarSize;
+
+ maSbJPGPreviewHorz.Show( sal_True );
+ maSbJPGPreviewHorz.SetPosPixel( Point( aFixedBitmapPos.X(), aFixedBitmapPos.Y() + aFixedBitmapSize.Height() ) );
+ maSbJPGPreviewHorz.SetSizePixel( Size( aFixedBitmapSize.Width(), nScrollBarSize ) );
+ }
+ else
+ {
+ maSbJPGPreviewHorz.Show( sal_False );
+ }
+
+
+ if ( bVertSb )
+ {
+ aFixedBitmapSize.Width() -= nScrollBarSize;
+
+ maSbJPGPreviewVert.Show( sal_True );
+ maSbJPGPreviewVert.SetPosPixel( Point( aFixedBitmapPos.X() + aFixedBitmapSize.Width(), aFixedBitmapPos.Y() ) );
+ maSbJPGPreviewVert.SetSizePixel( Size( nScrollBarSize, aFixedBitmapSize.Height() ) );
+ }
+ else
+ {
+ maSbJPGPreviewVert.Show( sal_False );
+ }
+
+ Point aPos( 0, 0 );
+ Size aSize;
+ if ( fXRatio > 1.0 )
+ {
+ aSize.Width() = maSize.Width > aFixedBitmapSize.Width() ? maSize.Width : aFixedBitmapSize.Width();
+ aSize.Width() /= static_cast<long int>(fXRatio);
+ }
+ else
+ {
+ aSize.Width() = maSize.Width < aFixedBitmapSize.Width() ? maSize.Width : aFixedBitmapSize.Width();
+ aSize.Width() /= static_cast<long int>(fXRatio);
+ }
+
+ if ( fYRatio > 1.0 )
+ {
+ aSize.Height() = maSize.Height > aFixedBitmapSize.Height() ? maSize.Height : aFixedBitmapSize.Height();
+ aSize.Height() /= static_cast<long int>(fYRatio);
+ }
+ else
+ {
+ aSize.Height() = maSize.Height < aFixedBitmapSize.Height() ? maSize.Height : aFixedBitmapSize.Height();
+ aSize.Height() /= static_cast<long int>(fYRatio);
+ }
+
+ if ( aSize.Width() < maSize.Width )
+ {
+ sal_Int32 nXDiff = static_cast< sal_Int32 >( ( ( ( maSize.Width - aSize.Width() ) * maSbJPGPreviewHorz.GetThumbPos() ) / 100.0 ) );
+ aPos.X() += nXDiff;
+ }
+ if ( aSize.Height() < maSize.Height )
+ {
+ sal_Int32 nYDiff = static_cast< sal_Int32 >( ( ( ( maSize.Height - aSize.Height() ) * maSbJPGPreviewVert.GetThumbPos() ) / 100.0 ) );
+ aPos.Y() += nYDiff;
+ }
+
+ Bitmap aCroppedBitmap( maBitmap );
+ aCroppedBitmap.Crop( Rectangle( aPos, aSize ) );
+ aSize = aCroppedBitmap.GetSizePixel();
+ aSize = Size( static_cast<long int>(aSize.Width() * fXRatio), static_cast<long int>(aSize.Height() * fYRatio) );
+ aCroppedBitmap.Scale( aSize );
+
+ if ( aSize.Width() > aFixedBitmapSize.Width() )
+ aSize.Width() = aFixedBitmapSize.Width();
+ if ( aSize.Height() > aFixedBitmapSize.Height() )
+ aSize.Height() = aFixedBitmapSize.Height();
+ Point aPoint( aFixedBitmapPos );
+ if ( aSize.Width() < aFixedBitmapSize.Width() )
+ aPoint.X() += ( aFixedBitmapSize.Width() - aSize.Width() ) / 2;
+ if ( aSize.Height() < aFixedBitmapSize.Height() )
+ aPoint.Y() += ( aFixedBitmapSize.Height() - aSize.Height() ) / 2;
+
+ maFbJPGPreview.SetPosPixel( aPoint );
+ maFbJPGPreview.SetSizePixel( aSize );
+ maFbJPGPreview.SetBitmap( aCroppedBitmap );
+
+ SetOutputSizePixel( Size( maDialogSize.Width() * 2, maDialogSize.Height() ) );
+
+ maFlButtons.SetSizePixel( Size( maRectFlButtons.GetWidth() * 2, maRectFlButtons.GetHeight() ) );
+ maBtnHelp.SetPosPixel( Point( maRectBtnHelp.Left() + maDialogSize.Width(), maRectBtnHelp.Top() ) );
+ maBtnOK.SetPosPixel( Point( maRectBtnOK.Left() + maDialogSize.Width(), maRectBtnOK.Top() ) );
+ maBtnCancel.SetPosPixel( Point( maRectBtnCancel.Left() + maDialogSize.Width(), maRectBtnCancel.Top() ) );
+ }
+ else
+ {
+ maSbZoom.Show( sal_False );
+ maNfZoom.Show( sal_False );
+ maFbJPGPreview.Show( sal_False );
+ maSbJPGPreviewHorz.Show( sal_False );
+ maSbJPGPreviewVert.Show( sal_False );
+
+ SetOutputSizePixel( maDialogSize );
+
+ maFlButtons.SetSizePixel( Size( maRectFlButtons.GetWidth(), maRectFlButtons.GetHeight() ) );
+ maBtnHelp.SetPosPixel( Point( maRectBtnHelp.Left(), maRectBtnHelp.Top() ) );
+ maBtnOK.SetPosPixel( Point( maRectBtnOK.Left(), maRectBtnOK.Top() ) );
+ maBtnCancel.SetPosPixel( Point( maRectBtnCancel.Left(), maRectBtnCancel.Top() ) );
+ }
+}
+
+void ExportDialog::updateControls()
+{
+ GetGraphicStream();
+
+ // Size Controls
+ if ( !mbIsPixelFormat )
+ {
+ awt::Size aSize100thmm( maSize );
+ Size aSize( LogicToLogic( Size( aSize100thmm.Width * 100, aSize100thmm.Height * 100 ), MAP_100TH_MM,
+ MapMode( GetMapUnit( maLbSizeX.GetSelectEntryPos() ) ) ) );
+ maMfSizeX.SetValue( aSize.Width() );
+ maMfSizeY.SetValue( aSize.Height() );
+ }
+ else
+ {
+ MapUnit aMapUnit( GetMapUnit( maLbSizeX.GetSelectEntryPos() ) );
+ if ( aMapUnit == MAP_PIXEL )
+ { // calculating pixel count via resolution and original graphic size
+ maMfSizeX.SetDecimalDigits( 0 );
+ maMfSizeY.SetDecimalDigits( 0 );
+ maMfSizeX.SetValue( maSize.Width );
+ maMfSizeY.SetValue( maSize.Height );
+ }
+ else
+ {
+ maMfSizeX.SetDecimalDigits( 2 );
+ maMfSizeY.SetDecimalDigits( 2 );
+ double fRatio;
+ switch( GetMapUnit( maLbSizeX.GetSelectEntryPos() ) )
+ {
+ case MAP_INCH : fRatio = static_cast< double >( maResolution.Width ) * 0.0254; break;
+ case MAP_MM : fRatio = static_cast< double >( maResolution.Width ) * 0.001; break;
+ case MAP_POINT :fRatio = ( static_cast< double >( maResolution.Width ) * 0.0254 ) / 72.0; break;
+ default:
+ case MAP_CM : fRatio = static_cast< double >( maResolution.Width ) * 0.01; break;
+ }
+ maMfSizeX.SetValue( static_cast< sal_Int32 >( ( static_cast< double >( maSize.Width * 100 ) / fRatio ) + 0.5 ) );
+ maMfSizeY.SetValue( static_cast< sal_Int32 >( ( static_cast< double >( maSize.Height * 100 ) / fRatio ) + 0.5 ) );
+ }
+ }
+ sal_Int32 nResolution = 0;
+ switch( maLbResolution.GetSelectEntryPos() )
+ {
+ case 0 : nResolution = maResolution.Width / 100; break; // pixels / cm
+ case 2 : nResolution = maResolution.Width; break; // pixels / meter
+ default:
+ case 1 : nResolution = static_cast< sal_Int32 >(maResolution.Width * 0.0254); break; // pixels / inch
+ }
+ maNfResolution.SetValue( nResolution );
+
+ if ( maSbCompression.IsVisible() )
+ maSbCompression.SetThumbPos( maNfCompression.GetValue() );
+
+ // updating estimated size
+ sal_Int64 nRealFileSize( mpTempStream->Tell() );
+ if ( mbIsPixelFormat )
+ {
+ String aEst( nRealFileSize ? msEstimatedSizePix2 : msEstimatedSizePix1 );
+ sal_Int64 nRawFileSize( GetRawFileSize() );
+ xub_StrLen nInd = aEst.Search( '%' );
+ aEst.Replace( nInd, 2, ImpValueOfInKB( nRawFileSize ) );
+
+ if ( nRealFileSize )
+ {
+ nInd = aEst.Search( '%', nInd );
+ aEst.Replace( nInd, 2, ImpValueOfInKB( nRealFileSize ) );
+ }
+ maFtEstimatedSize.SetText( aEst );
+ }
+ else
+ {
+ if ( mnMaxFilesizeForRealtimePreview )
+ {
+ String aEst( msEstimatedSizeVec );
+ xub_StrLen nInd = aEst.Search( '%', 0 );
+ aEst.Replace( nInd, 2, ImpValueOfInKB( nRealFileSize ) );
+ maFtEstimatedSize.SetText( aEst );
+ }
+ }
+ updatePreview();
+
+ // EPS
+ if ( maRbEPSLevel1.IsVisible() )
+ {
+ sal_Bool bEnabled = maRbEPSLevel1.IsChecked() == sal_False;
+ maRbEPSColorFormat1.Enable( bEnabled );
+ maRbEPSColorFormat2.Enable( bEnabled );
+ maRbEPSCompressionLZW.Enable( bEnabled );
+ maRbEPSCompressionNone.Enable( bEnabled );
+ }
+}
+
+ExportDialog::~ExportDialog()
+{
+ delete mpFilterOptionsItem;
+ delete mpOptionsItem;
+}
+
+
+/*************************************************************************
+|*
+|* Speichert eingestellte Werte in ini-Datei
+|*
+\************************************************************************/
+IMPL_LINK( ExportDialog, UpdateHdl, void *, EMPTYARG )
+{
+ updateControls();
+ return 0;
+}
+
+IMPL_LINK( ExportDialog, UpdateHdlMtfSizeX, void *, EMPTYARG )
+{
+ double fRatio = static_cast< double >( maOriginalSize.Height ) / maOriginalSize.Width;
+
+ if ( mbIsPixelFormat )
+ {
+ switch( GetMapUnit( maLbSizeX.GetSelectEntryPos() ) )
+ {
+ case MAP_INCH : maSize.Width = static_cast< sal_Int32 >( static_cast< double >( maResolution.Width ) * 0.0254 * maMfSizeX.GetValue() / 100.0 + 0.5 ); break;
+ case MAP_CM : maSize.Width = static_cast< sal_Int32 >( static_cast< double >( maResolution.Width ) * 0.01 * maMfSizeX.GetValue() / 100.0 + 0.5 ); break;
+ case MAP_MM : maSize.Width = static_cast< sal_Int32 >( static_cast< double >( maResolution.Width ) * 0.001 * maMfSizeX.GetValue() / 100.0 + 0.5 ); break;
+ case MAP_POINT : maSize.Width = static_cast< sal_Int32 >( static_cast< double >( maResolution.Width ) * 0.0254 * maMfSizeX.GetValue() / 100.0 * 72 + 0.5 ); break;
+ default:
+ case MAP_PIXEL : maSize.Width = maMfSizeX.GetValue(); break;
+ }
+ maSize.Height = static_cast< sal_Int32 >( fRatio * maSize.Width + 0.5 );
+ }
+ else
+ {
+ Fraction aFract( 1, 100 );
+ sal_Int32 nWidth = maMfSizeX.GetValue();
+ sal_Int32 nHeight= static_cast< sal_Int32 >( nWidth * fRatio );
+ const Size aSource( static_cast< sal_Int32 >( nWidth ), static_cast< sal_Int32 >( nHeight ) );
+ MapMode aSourceMapMode( GetMapUnit( maLbSizeX.GetSelectEntryPos() ),Point(), aFract, aFract );
+ Size aDest( LogicToLogic( aSource, aSourceMapMode, MAP_100TH_MM ) );
+
+ maSize.Width = aDest.Width();
+ if ( mbPreserveAspectRatio )
+ maSize.Height = aDest.Height();
+ }
+ updateControls();
+ return 0;
+}
+
+IMPL_LINK( ExportDialog, UpdateHdlMtfSizeY, void *, EMPTYARG )
+{
+ double fRatio = static_cast< double >( maOriginalSize.Width ) / maOriginalSize.Height;
+
+ if ( mbIsPixelFormat )
+ {
+ switch( GetMapUnit( maLbSizeX.GetSelectEntryPos() ) )
+ {
+ case MAP_INCH : maSize.Height = static_cast< sal_Int32 >( static_cast< double >( maResolution.Height ) * 0.0254 * maMfSizeY.GetValue() / 100.0 + 0.5 ); break;
+ case MAP_CM : maSize.Height = static_cast< sal_Int32 >( static_cast< double >( maResolution.Height ) * 0.01 * maMfSizeY.GetValue() / 100.0 + 0.5 ); break;
+ case MAP_MM : maSize.Height = static_cast< sal_Int32 >( static_cast< double >( maResolution.Height ) * 0.001 * maMfSizeY.GetValue() / 100.0 + 0.5 ); break;
+ case MAP_POINT : maSize.Height = static_cast< sal_Int32 >( static_cast< double >( maResolution.Height ) * 0.0254 * maMfSizeY.GetValue() / 100.0 * 72 + 0.5 ); break;
+ default:
+ case MAP_PIXEL : maSize.Height = maMfSizeY.GetValue(); break;
+ }
+ maSize.Width = static_cast< sal_Int32 >( fRatio * maSize.Height + 0.5 );
+ }
+ else
+ {
+ Fraction aFract( 1, 100 );
+ sal_Int32 nHeight= maMfSizeY.GetValue();
+ sal_Int32 nWidth = static_cast< sal_Int32 >( nHeight * fRatio );
+ const Size aSource( static_cast< sal_Int32 >( nWidth ), static_cast< sal_Int32 >( nHeight ) );
+ MapMode aSourceMapMode( GetMapUnit( maLbSizeX.GetSelectEntryPos() ),Point(), aFract, aFract );
+ Size aDest( LogicToLogic( aSource, aSourceMapMode, MAP_100TH_MM ) );
+
+ maSize.Height = aDest.Height();
+ if ( mbPreserveAspectRatio )
+ maSize.Width = aDest.Width();
+ }
+ updateControls();
+ return 0;
+}
+
+IMPL_LINK( ExportDialog, UpdateHdlNfResolution, void *, EMPTYARG )
+{
+ sal_Int32 nResolution = maNfResolution.GetValue();
+ if ( maLbResolution.GetSelectEntryPos() == 0 ) // pixels / cm
+ nResolution *= 100;
+ else if ( maLbResolution.GetSelectEntryPos() == 1 ) // pixels / inch
+ nResolution = static_cast< sal_Int32 >( ( ( static_cast< double >( nResolution ) + 0.5 ) / 0.0254 ) );
+ maResolution.Width = nResolution;
+ maResolution.Height= nResolution;
+
+ updateControls();
+ return 0;
+}
+
+IMPL_LINK( ExportDialog, SbCompressionUpdateHdl, void *, EMPTYARG )
+{
+ maNfCompression.SetValue( maSbCompression.GetThumbPos() );
+ updateControls();
+ return 0;
+}
+
+IMPL_LINK( ExportDialog, OK, void *, EMPTYARG )
+{
+ // writing config parameter
+
+
+ mrFltCallPara.aFilterData = GetFilterData( sal_True );
+ EndDialog( RET_OK );
+
+ return 0;
+}
+
diff --git a/svtools/source/filter.vcl/filter/exportdialog.hrc b/svtools/source/filter.vcl/filter/exportdialog.hrc
new file mode 100644
index 000000000000..e230bcd2c5c3
--- /dev/null
+++ b/svtools/source/filter.vcl/filter/exportdialog.hrc
@@ -0,0 +1,99 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include <svtools/svtools.hrc>
+
+#define BTN_OK 1
+#define BTN_CANCEL 1
+#define BTN_HELP 1
+
+#define FL_EXPORT_SIZE 1
+#define FL_COLOR_DEPTH 2
+#define FL_JPG_QUALITY 3
+#define FL_COMPRESSION 4
+#define FL_MODE 5
+#define FL_GIF_DRAWING_OBJECTS 6
+#define FL_PBM_OPTIONS 7
+#define FL_EPS_PREVIEW 8
+#define FL_EPS_VERSION 9
+#define FL_EPS_COLOR_FORMAT 10
+#define FL_ESTIMATED_SIZE 11
+#define FL_BUTTONS 12
+
+#define FT_SIZEX 1
+#define FT_SIZEY 2
+#define FT_RESOLUTION 3
+#define FT_JPG_MIN 4
+#define FT_JPG_MAX 5
+#define FT_PNG_MIN 6
+#define FT_PNG_MAX 7
+#define FT_ESTIMATED_SIZE 8
+
+#define NF_RESOLUTION 1
+#define NF_COMPRESSION 2
+#define NF_ZOOM 3
+
+#define MF_SIZEX 1
+#define MF_SIZEY 2
+
+#define LB_SIZEX 1
+#define LB_SIZEY 2
+#define LB_RESOLUTION 3
+#define LB_COLOR_DEPTH 4
+
+#define RB_BINARY 1
+#define RB_TEXT 2
+#define RB_EPS_LEVEL1 3
+#define RB_EPS_LEVEL2 4
+#define RB_EPS_COLOR_FORMAT1 5
+#define RB_EPS_COLOR_FORMAT2 6
+#define RB_EPS_COMPRESSION_LZW 7
+#define RB_EPS_COMPRESSION_NONE 8
+
+#define CB_JPG_PREVIEW 1
+#define CB_INTERLACED 2
+#define CB_RLE_ENCODING 3
+#define CB_SAVE_TRANSPARENCY 4
+#define CB_EPS_PREVIEW_TIFF 5
+#define CB_EPS_PREVIEW_EPSI 6
+
+#define FB_JPG_PREVIEW 1
+
+#define SB_COMPRESSION 1
+#define SB_JPG_PREVIEW_HORZ 2
+#define SB_JPG_PREVIEW_VERT 3
+#define SB_ZOOM 4
+
+#define STR_1BIT_THRESHOLD 1
+#define STR_1BIT_DITHERED 2
+#define STR_4BIT_GRAYSCALE 3
+#define STR_4BIT_COLOR_PALETTE 4
+#define STR_8BIT_GRAYSCALE 5
+#define STR_8BIT_COLOR_PALETTE 6
+#define STR_24BIT_TRUE_COLOR 7
+#define STR_ESTIMATED_SIZE_PIX_1 8
+#define STR_ESTIMATED_SIZE_PIX_2 9
+#define STR_ESTIMATED_SIZE_VEC 10
diff --git a/svtools/source/filter.vcl/filter/exportdialog.hxx b/svtools/source/filter.vcl/filter/exportdialog.hxx
new file mode 100644
index 000000000000..20a9ac3ea832
--- /dev/null
+++ b/svtools/source/filter.vcl/filter/exportdialog.hxx
@@ -0,0 +1,216 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+
+#ifndef _EXPORTDIALOG_HXX_
+#define _EXPORTDIALOG_HXX_
+
+#include <svtools/fltcall.hxx>
+#include <vcl/dialog.hxx>
+#include <vcl/button.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/field.hxx>
+#include <vcl/lstbox.hxx>
+#include <vcl/msgbox.hxx>
+#include <vcl/arrange.hxx>
+#include <vcl/scrbar.hxx>
+#include <com/sun/star/document/XExporter.hpp>
+#include <com/sun/star/drawing/XShape.hpp>
+#include <com/sun/star/drawing/XShapes.hpp>
+#include <com/sun/star/drawing/XDrawPage.hpp>
+
+/*************************************************************************
+|*
+|* Dialog zum Einstellen von Filteroptionen bei Pixelformaten
+|*
+\************************************************************************/
+
+class FilterConfigItem;
+class ExportDialog : public ModalDialog
+{
+private:
+
+ FltCallDialogParameter&
+ mrFltCallPara;
+
+ ResMgr* mpMgr;
+
+ const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >
+ mxMgr;
+ const com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >&
+ mxSourceDocument;
+
+ FixedLine maFlExportSize;
+ FixedText maFtSizeX;
+ MetricField maMfSizeX;
+ ListBox maLbSizeX;
+ FixedText maFtSizeY;
+ MetricField maMfSizeY;
+ ListBox maLbSizeY;
+ FixedText maFtResolution;
+ NumericField maNfResolution;
+ ListBox maLbResolution;
+ FixedLine maFlColorDepth;
+ ListBox maLbColorDepth;
+ FixedLine maFlJPGQuality;
+ FixedLine maFlMode;
+ FixedLine maFlPBMOptions;
+ ScrollBar maSbCompression;
+ NumericField maNfCompression;
+ FixedText maFtJPGMin;
+ FixedText maFtJPGMax;
+ FixedText maFtPNGMin;
+ FixedText maFtPNGMax;
+ CheckBox maCbJPGPreview;
+ CheckBox maCbInterlaced;
+ CheckBox maCbRLEEncoding;
+ FixedLine maFlGIFDrawingObjects;
+ CheckBox maCbSaveTransparency;
+ RadioButton maRbBinary;
+ RadioButton maRbText;
+ FixedLine maFlEPSPreview;
+ CheckBox maCbEPSPreviewTIFF;
+ CheckBox maCbEPSPreviewEPSI;
+ FixedLine maFlEPSVersion;
+ RadioButton maRbEPSLevel1;
+ RadioButton maRbEPSLevel2;
+ FixedLine maFlEPSColorFormat;
+ RadioButton maRbEPSColorFormat1;
+ RadioButton maRbEPSColorFormat2;
+ FixedLine maFlCompression;
+ RadioButton maRbEPSCompressionLZW;
+ RadioButton maRbEPSCompressionNone;
+ FixedLine maFlEstimatedSize;
+ FixedText maFtEstimatedSize;
+ String msEstimatedSizePix1;
+ String msEstimatedSizePix2;
+ String msEstimatedSizeVec;
+ FixedLine maFlButtons;
+ FixedBitmap maFbJPGPreview;
+ ScrollBar maSbZoom;
+ NumericField maNfZoom;
+ ScrollBar maSbJPGPreviewHorz;
+ ScrollBar maSbJPGPreviewVert;
+ OKButton maBtnOK;
+ CancelButton maBtnCancel;
+ HelpButton maBtnHelp;
+
+ String ms1BitTreshold;
+ String ms1BitDithered;
+ String ms4BitGrayscale;
+ String ms4BitColorPalette;
+ String ms8BitGrayscale;
+ String ms8BitColorPalette;
+ String ms24BitColor;
+
+ vcl::RowOrColumn maLayout;
+ Size maDialogSize;
+
+ FilterConfigItem* mpOptionsItem;
+ FilterConfigItem* mpFilterOptionsItem;
+
+ String maExt;
+ String maEstimatedSizeText;
+ sal_Int16 mnFormat;
+ sal_Int32 mnMaxFilesizeForRealtimePreview;
+
+ Rectangle maRectFlButtons;
+ Rectangle maRectBtnHelp;
+ Rectangle maRectBtnOK;
+ Rectangle maRectBtnCancel;
+
+ SvStream* mpTempStream;
+ Bitmap maBitmap;
+
+ com::sun::star::awt::Size
+ maOriginalSize; // the original graphic size in 1/100mm
+ com::sun::star::awt::Size
+ maSize; // for vector graphics it always contains the logical size in 1/100mm
+
+ sal_Bool mbPreview;
+ sal_Bool mbIsPixelFormat;
+ sal_Bool mbExportSelection;
+ sal_Bool mbPreserveAspectRatio;
+
+ sal_Int32 mnInitialResolutionUnit;
+
+ // for pixel graphics it always contains the pixel count
+ com::sun::star::awt::Size
+ maResolution; // it always contains the number of pixels per meter
+
+ com::sun::star::uno::Reference< com::sun::star::drawing::XShape >
+ mxShape;
+ com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >
+ mxShapes;
+ com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage >
+ mxPage;
+
+
+ DECL_LINK( UpdateHdl,void* p );
+ DECL_LINK( UpdateHdlMtfSizeX,void* p );
+ DECL_LINK( UpdateHdlMtfSizeY,void* p );
+ DECL_LINK( UpdateHdlNfResolution,void* p );
+ DECL_LINK( SbCompressionUpdateHdl,void* p );
+ DECL_LINK( NfCompressionUpdateHdlX,void* p );
+
+ DECL_LINK( OK, void* p );
+
+ void createSizeControls( vcl::RowOrColumn& );
+ void createColorDepthControls( vcl::RowOrColumn& );
+ void createFilterOptions( vcl::RowOrColumn& );
+ void createButtons( vcl::RowOrColumn& );
+ void createScrollBar( vcl::RowOrColumn& );
+ void setupLayout();
+ void updatePreview();
+ void updateControls();
+
+ void GetGraphicSource();
+ sal_Bool GetGraphicStream();
+ Bitmap GetGraphicBitmap( SvStream& rStream );
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >
+ GetFilterData( sal_Bool bUpdateConfig );
+
+ sal_uInt32 GetRawFileSize() const;
+ sal_Bool IsTempExportAvailable() const;
+
+ com::sun::star::awt::Size
+ GetOriginalSize();
+
+ sal_Int32 GetDefaultUnit();
+
+public:
+ ExportDialog( FltCallDialogParameter& rPara,
+ const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > rxMgr,
+ const com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& rxSourceDocument,
+ sal_Bool bExportSelection, sal_Bool bIsExportVectorFormat );
+ ~ExportDialog();
+};
+
+
+
+#endif // _EXPORTDIALOG_HXX_
+
diff --git a/svtools/source/filter.vcl/filter/exportdialog.src b/svtools/source/filter.vcl/filter/exportdialog.src
new file mode 100644
index 000000000000..c9e87989a314
--- /dev/null
+++ b/svtools/source/filter.vcl/filter/exportdialog.src
@@ -0,0 +1,529 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "exportdialog.hrc"
+
+String DLG_EXPORT_TITLE
+{
+ Text [ en-US ] = " Options" ;
+};
+
+ModalDialog DLG_EXPORT
+{
+ HelpID = "svtools:ModalDialog:DLG_EXPORT";
+ OutputSize = TRUE ;
+ SVLook = TRUE ;
+ Size = MAP_APPFONT ( 178 , 135 ) ;
+ Moveable = TRUE ;
+ Closeable = TRUE ;
+
+ FixedLine FL_EXPORT_SIZE
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 110 , 8 ) ;
+ Text [ en-US ] = "Size" ;
+ };
+ FixedText FT_SIZEX
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 41 , 10 ) ;
+ Text [ en-US ] = "Width:" ;
+ };
+ MetricField MF_SIZEX
+ {
+ HelpID = "svtools:MetricField:DLG_EXPORT:MF_SIZEX";
+ Hide = TRUE;
+ Border = TRUE;
+ Size = MAP_APPFONT ( 30, 12 ) ;
+ TabStop = TRUE;
+ Repeat = TRUE;
+ Spin = FALSE;
+ StrictFormat = TRUE;
+ DecimalDigits = 2;
+ Unit = FUNIT_NONE;
+ Maximum = 99999;
+ Last = 255;
+ };
+ ListBox LB_SIZEX
+ {
+ HelpID = "svtools:ListBox:DLG_EXPORT:LB_SIZEX";
+ Hide = TRUE;
+ Border = TRUE ;
+ Size = MAP_APPFONT ( 60, 80 ) ;
+ DropDown = TRUE ;
+ Sort = FALSE ;
+ StringList [ en-US ] =
+ {
+ < "inches" ; > ;
+ < "cm" ; Default ; > ;
+ < "mm" ; > ;
+ < "points" ; > ;
+ < "pixels" ; > ;
+ };
+ };
+ FixedText FT_SIZEY
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 41 , 10 ) ;
+ Text [ en-US ] = "Height:" ;
+ };
+ MetricField MF_SIZEY
+ {
+ HelpID = "svtools:MetricField:DLG_EXPORT:MF_SIZEY";
+ Hide = TRUE;
+ Border = TRUE;
+ Size = MAP_APPFONT ( 30, 12 );
+ TabStop = TRUE;
+ Repeat = TRUE;
+ Spin = FALSE;
+ StrictFormat = TRUE;
+ DecimalDigits = 2;
+ Unit = FUNIT_NONE;
+ Maximum = 99999;
+ Last = 255 ;
+ };
+ ListBox LB_SIZEY
+ {
+ HelpID = "svtools:ListBox:DLG_EXPORT:LB_SIZEY";
+ Hide = TRUE;
+ Border = TRUE ;
+ Size = MAP_APPFONT ( 60, 80 ) ;
+ DropDown = TRUE ;
+ Sort = FALSE ;
+ StringList [ en-US ] =
+ {
+ < "inches" ; > ;
+ < "cm" ; Default ; > ;
+ < "mm" ; > ;
+ < "points" ; > ;
+ < "pixels" ; > ;
+ };
+ };
+ FixedText FT_RESOLUTION
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 41 , 10 ) ;
+ Text [ en-US ] = "Resolution:" ;
+ };
+ NumericField NF_RESOLUTION
+ {
+ HelpID = "svtools:NumericField:DLG_EXPORT:NF_RESOLUTION";
+ Hide = TRUE;
+ Border = TRUE ;
+ Size = MAP_APPFONT ( 30, 12 ) ;
+ TabStop = TRUE ;
+ Repeat = TRUE ;
+ Spin = FALSE ;
+ Maximum = 99999;
+ Last = 255 ;
+ };
+ ListBox LB_RESOLUTION
+ {
+ HelpID = "svtools:ListBox:DLG_EXPORT:LB_RESOLUTION";
+ Hide = TRUE;
+ Border = TRUE ;
+ Size = MAP_APPFONT ( 60, 80 ) ;
+ DropDown = TRUE ;
+ Sort = FALSE ;
+ StringList [ en-US ] =
+ {
+ < "pixels/cm" ; > ;
+ < "pixels/inch" ; Default ; > ;
+ < "pixels/meter" ; > ;
+ };
+ };
+ FixedLine FL_COLOR_DEPTH
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 110 , 8 ) ;
+ Text [ en-US ] = "Color Depth" ;
+ };
+ ListBox LB_COLOR_DEPTH
+ {
+ HelpID = "svtools:ListBox:DLG_EXPORT:LB_COLOR_DEPTH";
+ Hide = TRUE;
+ Border = TRUE ;
+ Size = MAP_APPFONT ( 60, 80 ) ;
+ DropDown = TRUE ;
+ Sort = FALSE ;
+ };
+ String STR_1BIT_THRESHOLD
+ {
+ Text [ en-US ] = "1 bit threshold";
+ };
+ String STR_1BIT_DITHERED
+ {
+ Text [ en-US ] = "1 bit dithered";
+ };
+ String STR_4BIT_GRAYSCALE
+ {
+ Text [ en-US ] = "4 bit grayscale";
+ };
+ String STR_4BIT_COLOR_PALETTE
+ {
+ Text [ en-US ] = "4 bit color";
+ };
+ String STR_8BIT_GRAYSCALE
+ {
+ Text [ en-US ] = "8 bit grayscale";
+ };
+ String STR_8BIT_COLOR_PALETTE
+ {
+ Text [ en-US ] = "8 bit color";
+ };
+ String STR_24BIT_TRUE_COLOR
+ {
+ Text [ en-US ] = "24 bit true color";
+ };
+ FixedLine FL_JPG_QUALITY
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 110 , 8 ) ;
+ Text [ en-US ] = "Quality" ;
+ };
+ FixedLine FL_COMPRESSION
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 110 , 8 ) ;
+ Text [ en-US ] = "Compression" ;
+ };
+ FixedLine FL_MODE
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 110 , 8 ) ;
+ Text [ en-US ] = "Mode" ;
+ };
+ FixedLine FL_PBM_OPTIONS
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 110 , 8 ) ;
+ Text [ en-US ] = "File Format" ;
+ };
+ ScrollBar SB_COMPRESSION
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 48, 10 ) ;
+ VScroll = FALSE ;
+ HScroll = TRUE;
+ Drag = TRUE ;
+ };
+ NumericField NF_COMPRESSION
+ {
+ HelpID = "svtools:NumericField:DLG_EXPORT:NF_COMPRESSION";
+ Hide = TRUE;
+ Border = TRUE ;
+ Size = MAP_APPFONT ( 30, 12 ) ;
+ TabStop = TRUE ;
+ Repeat = TRUE ;
+ Spin = FALSE ;
+ Maximum = 99999;
+ Last = 255 ;
+ };
+ FixedText FT_JPG_MIN
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 41 , 10 ) ;
+ Text [ en-US ] = "1 is minimum Quality and smallest file size." ;
+ };
+ FixedText FT_JPG_MAX
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 41 , 10 ) ;
+ Text [ en-US ] = "100 is maximum Quality and biggest file size." ;
+ };
+ FixedText FT_PNG_MIN
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 41 , 10 ) ;
+ Text [ en-US ] = "0 is biggest file size and fastest loading." ;
+ };
+ FixedText FT_PNG_MAX
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 41 , 10 ) ;
+ Text [ en-US ] = "9 is smallest file size and slowest loading." ;
+ };
+ CheckBox CB_JPG_PREVIEW
+ {
+ HelpID = "svtools:CheckBox:DLG_EXPORT:CB_JPG_PREVIEW";
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 60 , 10 ) ;
+ Text [ en-US ] = "Preview" ;
+ };
+ CheckBox CB_INTERLACED
+ {
+ HelpID = "svtools:CheckBox:DLG_EXPORT:CB_INTERLACED";
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 60 , 10 ) ;
+ Text [ en-US ] = "Interlaced" ;
+ };
+ CheckBox CB_RLE_ENCODING
+ {
+ HelpID = "svtools:CheckBox:DLG_EXPORT:CB_RLE_ENCODING";
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 60 , 10 ) ;
+ Text [ en-US ] = "RLE encoding" ;
+ };
+ FixedLine FL_GIF_DRAWING_OBJECTS
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 110 , 8 ) ;
+ Text [ en-US ] = "Drawing Objects" ;
+ };
+ CheckBox CB_SAVE_TRANSPARENCY
+ {
+ HelpID = "svtools:CheckBox:DLG_EXPORT:CB_SAVE_TRANSPARENCY";
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 60 , 10 ) ;
+ Text [ en-US ] = "Save transparency" ;
+ };
+ RadioButton RB_BINARY
+ {
+ HelpID = "svtools:RadioButton:DLG_EXPORT:RB_BINARY";
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 105 , 10 ) ;
+ Text [ en-US ] = "Binary" ;
+ };
+ RadioButton RB_TEXT
+ {
+ HelpID = "svtools:RadioButton:DLG_EXPORT:RB_TEXT";
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 105 , 10 ) ;
+ Text [ en-US ] = "Text" ;
+ };
+ FixedLine FL_EPS_PREVIEW
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 110 , 8 ) ;
+ Text [ en-US ] = "Preview" ;
+ };
+ CheckBox CB_EPS_PREVIEW_TIFF
+ {
+ HelpID = "svtools:CheckBox:DLG_EXPORT:CB_EPS_PREVIEW_TIFF";
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 60 , 10 ) ;
+ Text [ en-US ] = "Image Preview (TIFF)" ;
+ };
+ CheckBox CB_EPS_PREVIEW_EPSI
+ {
+ HelpID = "svtools:CheckBox:DLG_EXPORT:CB_EPS_PREVIEW_EPSI";
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 60 , 10 ) ;
+ Text [ en-US ] = "Interchange (EPSI)" ;
+ };
+ FixedLine FL_EPS_VERSION
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 41 , 10 ) ;
+ Text [ en-US ] = "Version" ;
+ };
+ RadioButton RB_EPS_LEVEL1
+ {
+ HelpID = "svtools:RadioButton:DLG_EXPORT:RB_EPS_LEVEL1";
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 105 , 10 ) ;
+ Text [ en-US ] = "Level 1" ;
+ };
+ RadioButton RB_EPS_LEVEL2
+ {
+ HelpID = "svtools:RadioButton:DLG_EXPORT:RB_EPS_LEVEL2";
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 105 , 10 ) ;
+ Text [ en-US ] = "Level 2" ;
+ };
+ FixedLine FL_EPS_COLOR_FORMAT
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 41 , 10 ) ;
+ Text [ en-US ] = "Color format" ;
+ };
+ RadioButton RB_EPS_COLOR_FORMAT1
+ {
+ HelpID = "svtools:RadioButton:DLG_EXPORT:RB_EPS_COLOR_FORMAT1";
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 105 , 10 ) ;
+ Text [ en-US ] = "Color" ;
+ };
+ RadioButton RB_EPS_COLOR_FORMAT2
+ {
+ HelpID = "svtools:RadioButton:DLG_EXPORT:RB_EPS_COLOR_FORMAT2";
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 105 , 10 ) ;
+ Text [ en-US ] = "Grayscale" ;
+ };
+ RadioButton RB_EPS_COMPRESSION_LZW
+ {
+ HelpID = "svtools:RadioButton:DLG_EXPORT:RB_EPS_COMPRESSION_LZW";
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 105 , 10 ) ;
+ Text [ en-US ] = "LZW encoding" ;
+ };
+ RadioButton RB_EPS_COMPRESSION_NONE
+ {
+ HelpID = "svtools:RadioButton:DLG_EXPORT:RB_EPS_COMPRESSION_NONE";
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 105 , 10 ) ;
+ Text [ en-US ] = "None" ;
+ };
+ FixedLine FL_ESTIMATED_SIZE
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 41 , 10 ) ;
+ };
+ FixedText FT_ESTIMATED_SIZE
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 41 , 10 ) ;
+ };
+ String STR_ESTIMATED_SIZE_PIX_1
+ {
+ Text [ en-US ] = "The picture needs about %1 KB of memory.";
+ };
+ String STR_ESTIMATED_SIZE_PIX_2
+ {
+ Text [ en-US ] = "The picture needs about %1 KB of memory,\n the file size is %2 KB.";
+ };
+ String STR_ESTIMATED_SIZE_VEC
+ {
+ Text [ en-US ] = "The file size is %1 KB.";
+ };
+ FixedLine FL_BUTTONS
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 41 , 10 ) ;
+ };
+ FixedBitmap FB_JPG_PREVIEW
+ {
+ Hide = TRUE;
+ OutputSize = TRUE ;
+ Scale = TRUE;
+ Border = TRUE;
+ };
+ ScrollBar SB_ZOOM
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 48, 10 );
+ VScroll = FALSE;
+ HScroll = TRUE;
+ Drag = TRUE;
+ MinPos = 5;
+ MaxPos = 100;
+ ThumbPos = 50;
+ };
+ NumericField NF_ZOOM
+ {
+ HelpID = "svtools:NumericField:DLG_EXPORT:NF_ZOOM";
+ Hide = TRUE;
+ Border = TRUE ;
+ Size = MAP_APPFONT ( 30, 12 ) ;
+ TabStop = TRUE ;
+ Repeat = TRUE ;
+ Spin = FALSE ;
+ Maximum = 3000;
+ Last = 255 ;
+ };
+ ScrollBar SB_JPG_PREVIEW_HORZ
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 48, 10 );
+ VScroll = FALSE;
+ HScroll = TRUE;
+ Drag = TRUE;
+ MinPos = 0;
+ MaxPos = 100;
+ ThumbPos = 50;
+ };
+ ScrollBar SB_JPG_PREVIEW_VERT
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 48, 10 );
+ VScroll = TRUE;
+ HScroll = FALSE;
+ Drag = TRUE;
+ MinPos = 0;
+ MaxPos = 100;
+ ThumbPos = 50;
+ };
+ OKButton BTN_OK
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ DefButton = TRUE ;
+ };
+ CancelButton BTN_CANCEL
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ };
+ HelpButton BTN_HELP
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ };
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/svtools/source/filter.vcl/filter/filter.cxx b/svtools/source/filter.vcl/filter/filter.cxx
index c8a79d3a35cd..9c754a947fcd 100644
--- a/svtools/source/filter.vcl/filter/filter.cxx
+++ b/svtools/source/filter.vcl/filter/filter.cxx
@@ -52,7 +52,7 @@
#include "xbmread.hxx"
#include "xpmread.hxx"
#include <svl/solar.hrc>
-#include "strings.hrc"
+#include <svtools/svtools.hrc>
#include "sgffilt.hxx"
#include "osl/module.hxx"
#include <com/sun/star/uno/Reference.h>
@@ -79,7 +79,7 @@
#define PMGCHUNG_msOG 0x6d734f47 // Microsoft Office Animated GIF
-#if defined WIN || (defined OS2 && !defined ICC)
+#if (defined OS2 && !defined ICC)
#define IMPORT_FUNCTION_NAME "_GraphicImport"
#define EXPORT_FUNCTION_NAME "_GraphicExport"
@@ -552,16 +552,48 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B
if( !bTest || ( rFormatExtension.CompareToAscii( "PCT", 3 ) == COMPARE_EQUAL ) )
{
bSomethingTested = TRUE;
- BYTE sBuf[4];
+ BYTE sBuf[3];
+ // store number format
+ sal_uInt16 oldNumberFormat = rStream.GetNumberFormatInt();
sal_uInt32 nOffset; // in ms documents the pict format is used without the first 512 bytes
- for ( nOffset = 10; ( nOffset <= 522 ) && ( ( nStreamPos + nOffset + 3 ) <= nStreamLen ); nOffset += 512 )
+ for ( nOffset = 0; ( nOffset <= 512 ) && ( ( nStreamPos + nOffset + 14 ) <= nStreamLen ); nOffset += 512 )
{
- rStream.Seek( nStreamPos + nOffset );
+ short y1,x1,y2,x2;
+ bool bdBoxOk = true;
+
+ rStream.Seek( nStreamPos + nOffset);
+ // size of the pict in version 1 pict ( 2bytes) : ignored
+ rStream.SeekRel(2);
+ // bounding box (bytes 2 -> 9)
+ rStream.SetNumberFormatInt(NUMBERFORMAT_INT_BIGENDIAN);
+ rStream >> y1 >> x1 >> y2 >> x2;
+ rStream.SetNumberFormatInt(oldNumberFormat); // reset format
+
+ if (x1 > x2 || y1 > y2 || // bad bdbox
+ (x1 == x2 && y1 == y2) || // 1 pixel picture
+ x2-x1 > 2048 || y2-y1 > 2048 ) // picture anormaly big
+ bdBoxOk = false;
+
+ // read version op
rStream.Read( sBuf,3 );
- if ( sBuf[ 0 ] == 0x00 && sBuf[ 1 ] == 0x11 && ( sBuf[ 2 ] == 0x01 || sBuf[ 2 ] == 0x02 ) )
+ // see http://developer.apple.com/legacy/mac/library/documentation/mac/pdf/Imaging_With_QuickDraw/Appendix_A.pdf
+ // normal version 2 - page A23 and A24
+ if ( sBuf[ 0 ] == 0x00 && sBuf[ 1 ] == 0x11 && sBuf[ 2 ] == 0x02)
{
- rFormatExtension = UniString::CreateFromAscii( "PCT", 3 );
- return TRUE;
+ rFormatExtension = UniString::CreateFromAscii( "PCT", 3 );
+ return TRUE;
+ }
+ // normal version 1 - page A25
+ else if (sBuf[ 0 ] == 0x11 && sBuf[ 1 ] == 0x01 && bdBoxOk) {
+ rFormatExtension = UniString::CreateFromAscii( "PCT", 3 );
+ return TRUE;
+ }
+ // previous code kept in order to do not break any compatibility
+ // probably eroneous
+ else if ( sBuf[ 0 ] == 0x00 && sBuf[ 1 ] == 0x11 && sBuf[ 2 ] == 0x01 && bdBoxOk)
+ {
+ rFormatExtension = UniString::CreateFromAscii( "PCT", 3 );
+ return TRUE;
}
}
}
@@ -752,7 +784,7 @@ static Graphic ImpGetScaledGraphic( const Graphic& rGraphic, FilterConfigItem& r
if ( rGraphic.GetType() != GRAPHIC_NONE )
{
- sal_Int32 nMode = rConfigItem.ReadInt32( String( ResId( KEY_MODE, *pResMgr ) ), -1 );
+ sal_Int32 nMode = rConfigItem.ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "ExportMode" ) ), -1 );
if ( nMode == -1 ) // the property is not there, this is possible, if the graphic filter
{ // is called via UnoGraphicExporter and not from a graphic export Dialog
@@ -782,7 +814,7 @@ static Graphic ImpGetScaledGraphic( const Graphic& rGraphic, FilterConfigItem& r
Bitmap aBitmap( rGraphic.GetBitmap() );
MapMode aMap( MAP_100TH_INCH );
- sal_Int32 nDPI = rConfigItem.ReadInt32( String( ResId( KEY_RES, *pResMgr ) ), 75 );
+ sal_Int32 nDPI = rConfigItem.ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Resolution" ) ), 75 );
Fraction aFrac( 1, Min( Max( nDPI, sal_Int32( 75 ) ), sal_Int32( 600 ) ) );
aMap.SetScaleX( aFrac );
@@ -806,7 +838,7 @@ static Graphic ImpGetScaledGraphic( const Graphic& rGraphic, FilterConfigItem& r
else
aGraphic = rGraphic;
- sal_Int32 nColors = rConfigItem.ReadInt32( String( ResId( KEY_COLORS, *pResMgr ) ), 0 ); // #92767#
+ sal_Int32 nColors = rConfigItem.ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Color" ) ), 0 ); // #92767#
if ( nColors ) // graphic conversion necessary ?
{
BitmapEx aBmpEx( aGraphic.GetBitmapEx() );
@@ -1771,7 +1803,7 @@ USHORT GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String& rPat
aBmp = aGraphic.GetBitmap();
}
ResMgr* pResMgr = CREATERESMGR( svt );
- sal_Bool bRleCoding = aConfigItem.ReadBool( String( ResId( KEY_RLE_CODING, *pResMgr ) ), sal_True );
+ sal_Bool bRleCoding = aConfigItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "RLE_Coding" ) ), sal_True );
// Wollen wir RLE-Kodiert speichern?
aBmp.Write( rOStm, bRleCoding );
delete pResMgr;
diff --git a/svtools/source/filter.vcl/filter/filter2.cxx b/svtools/source/filter.vcl/filter/filter2.cxx
index 6abab2626516..d91ec1a19772 100644
--- a/svtools/source/filter.vcl/filter/filter2.cxx
+++ b/svtools/source/filter.vcl/filter/filter2.cxx
@@ -42,29 +42,6 @@
BYTE* ImplSearchEntry( BYTE* , BYTE* , ULONG , ULONG );
-
-/*************************************************************************
-|*
-|*
-|*
-\************************************************************************/
-
-GraphicDescriptor::GraphicDescriptor( const String* pPath ) :
- pFileStm ( NULL )
-{
- ImpConstruct();
-
- if ( pPath )
- {
- INetURLObject aURL( *pPath, INET_PROT_FILE );
- aPathExt = aURL.GetFileExtension().toAsciiLowerCase();
- }
- bLinked = TRUE;
- bLinkChanged = FALSE;
- bWideSearch = FALSE;
-}
-
-
/*************************************************************************
|*
|*
@@ -73,19 +50,10 @@ GraphicDescriptor::GraphicDescriptor( const String* pPath ) :
GraphicDescriptor::GraphicDescriptor( const INetURLObject& rPath ) :
pFileStm( ::utl::UcbStreamHelper::CreateStream( rPath.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READ ) ),
- aPathExt( rPath.GetFileExtension().toAsciiLowerCase() )
+ aPathExt( rPath.GetFileExtension().toAsciiLowerCase() ),
+ bOwnStream( TRUE )
{
- if ( pFileStm )
- {
- nStmPos = 0;
- pFileStm->Seek( nStmPos );
- bDataReady = TRUE;
- }
-
ImpConstruct();
-
- if ( pFileStm && !pFileStm->GetError() )
- bDataReady = TRUE;
}
/*************************************************************************
@@ -95,7 +63,8 @@ GraphicDescriptor::GraphicDescriptor( const INetURLObject& rPath ) :
\************************************************************************/
GraphicDescriptor::GraphicDescriptor( SvStream& rInStream, const String* pPath) :
- pFileStm ( NULL )
+ pFileStm ( &rInStream ),
+ bOwnStream ( FALSE )
{
ImpConstruct();
@@ -104,15 +73,8 @@ GraphicDescriptor::GraphicDescriptor( SvStream& rInStream, const String* pPath)
INetURLObject aURL( *pPath );
aPathExt = aURL.GetFileExtension().toAsciiLowerCase();
}
- nStmPos = rInStream.Tell();
- pBaseStm = &rInStream;
- bBaseStm = TRUE;
-
- if ( !pBaseStm->GetError() )
- bDataReady = TRUE;
}
-
/*************************************************************************
|*
|*
@@ -121,10 +83,10 @@ GraphicDescriptor::GraphicDescriptor( SvStream& rInStream, const String* pPath)
GraphicDescriptor::~GraphicDescriptor()
{
- delete pFileStm;
+ if ( bOwnStream )
+ delete pFileStm;
}
-
/*************************************************************************
|*
|*
@@ -134,22 +96,9 @@ GraphicDescriptor::~GraphicDescriptor()
BOOL GraphicDescriptor::Detect( BOOL bExtendedInfo )
{
BOOL bRet = FALSE;
-
- // Link-Status ueberpruefen
- if ( bLinked && bLinkChanged )
- {
- DBG_ASSERT( aReqLink.IsSet(), "Wo ist der RequestHandler???" );
- pMemStm = (SvStream*) aReqLink.Call( this );
- if ( pMemStm )
- {
- nStmPos = pMemStm->Tell();
- bDataReady = TRUE;
- }
- }
-
- if ( bDataReady )
+ if ( pFileStm && !pFileStm->GetError() )
{
- SvStream& rStm = GetSearchStream();
+ SvStream& rStm = *pFileStm;
UINT16 nOldFormat = rStm.GetNumberFormatInt();
if ( ImpDetectGIF( rStm, bExtendedInfo ) ) bRet = TRUE;
@@ -175,96 +124,13 @@ BOOL GraphicDescriptor::Detect( BOOL bExtendedInfo )
else if ( ImpDetectTGA( rStm, bExtendedInfo ) ) bRet = TRUE;
else if ( ImpDetectPSD( rStm, bExtendedInfo ) ) bRet = TRUE;
else if ( ImpDetectEPS( rStm, bExtendedInfo ) ) bRet = TRUE;
-
- // diese Formate lassen sich nur bei WideSearch im gesamten
- // Stream ermitteln
- else if ( bWideSearch )
- {
- if ( ImpDetectPCD( rStm, bExtendedInfo ) )
- bRet = TRUE;
- }
+ else if ( ImpDetectPCD( rStm, bExtendedInfo ) ) bRet = TRUE;
rStm.SetNumberFormatInt( nOldFormat );
- rStm.Seek( nStmPos );
}
-
return bRet;
}
-
-/*************************************************************************
-|*
-|*
-|*
-\************************************************************************/
-
-BOOL GraphicDescriptor::IsDataReady() const
-{
- return bDataReady;
-}
-
-
-/*************************************************************************
-|*
-|*
-|*
-\************************************************************************/
-
-BOOL GraphicDescriptor::IsWideSearch() const
-{
- return bWideSearch;
-}
-
-
-/*************************************************************************
-|*
-|*
-|*
-\************************************************************************/
-
-SvStream& GraphicDescriptor::GetSearchStream() const
-{
- DBG_ASSERT( bDataReady, "Was laeuft hier falsch???" );
-
- if ( bLinked )
- return *pMemStm;
- else if ( bBaseStm )
- return *pBaseStm;
- else
- return *pFileStm;
-}
-
-
-/*************************************************************************
-|*
-|*
-|*
-\************************************************************************/
-
-void GraphicDescriptor::SetRequestHdl( const Link& rRequestLink )
-{
- aReqLink = rRequestLink;
- bLinkChanged = TRUE;
-}
-
-
-/*************************************************************************
-|*
-|*
-|*
-\************************************************************************/
-
-ULONG GraphicDescriptor::GetRequestedByteCount() const
-{
- return DATA_SIZE;
-}
-
-
-/******************************************************************************/
-/* IMP-Methoden */
-/* */
-
-
/*************************************************************************
|*
|*
@@ -273,17 +139,10 @@ ULONG GraphicDescriptor::GetRequestedByteCount() const
void GraphicDescriptor::ImpConstruct()
{
- if ( !pFileStm )
- pFileStm = new SvStream();
nFormat = GFF_NOT;
nBitsPerPixel = 0;
nPlanes = 0;
bCompressed = FALSE;
- bDataReady = FALSE;
- bLinked = FALSE;
- bWideSearch = TRUE;
- bBaseStm = FALSE;
- pMemStm = NULL;
}
@@ -297,10 +156,9 @@ BOOL GraphicDescriptor::ImpDetectBMP( SvStream& rStm, BOOL bExtendedInfo )
{
UINT16 nTemp16;
BOOL bRet = FALSE;
+ sal_Int32 nStmPos = rStm.Tell();
rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
- rStm.Seek( nStmPos );
-
rStm >> nTemp16;
// OS/2-BitmapArray
@@ -364,7 +222,7 @@ BOOL GraphicDescriptor::ImpDetectBMP( SvStream& rStm, BOOL bExtendedInfo )
}
}
}
-
+ rStm.Seek( nStmPos );
return bRet;
}
@@ -382,10 +240,10 @@ BOOL GraphicDescriptor::ImpDetectGIF( SvStream& rStm, BOOL bExtendedInfo )
BOOL bRet = FALSE;
BYTE cByte;
+ sal_Int32 nStmPos = rStm.Tell();
rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
- rStm.Seek( nStmPos );
-
rStm >> n32;
+
if ( n32 == 0x38464947 )
{
rStm >> n16;
@@ -412,7 +270,7 @@ BOOL GraphicDescriptor::ImpDetectGIF( SvStream& rStm, BOOL bExtendedInfo )
}
}
}
-
+ rStm.Seek( nStmPos );
return bRet;
}
@@ -423,125 +281,188 @@ BOOL GraphicDescriptor::ImpDetectGIF( SvStream& rStm, BOOL bExtendedInfo )
|*
\************************************************************************/
+// returns the next jpeg marker, a return value of 0 represents an error
+sal_uInt8 ImpDetectJPG_GetNextMarker( SvStream& rStm )
+{
+ sal_uInt8 nByte;
+ do
+ {
+ do
+ {
+ rStm >> nByte;
+ if ( rStm.IsEof() || rStm.GetError() ) // as 0 is not allowed as marker,
+ return 0; // we can use it as errorcode
+ }
+ while ( nByte != 0xff );
+ do
+ {
+ rStm >> nByte;
+ if ( rStm.IsEof() || rStm.GetError() )
+ return 0;
+ }
+ while( nByte == 0xff );
+ }
+ while( nByte == 0 ); // 0xff00 represents 0xff and not a marker,
+ // the marker detection has to be restartet.
+ return nByte;
+}
+
BOOL GraphicDescriptor::ImpDetectJPG( SvStream& rStm, BOOL bExtendedInfo )
{
UINT32 nTemp32;
BOOL bRet = FALSE;
- BYTE cByte = 0;
- BOOL bM_COM;
- rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN );
- rStm.Seek( nStmPos );
+ sal_Int32 nStmPos = rStm.Tell();
+ rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN );
rStm >> nTemp32;
- // compare upper 28 bits
+ // compare upper 24 bits
if( 0xffd8ff00 == ( nTemp32 & 0xffffff00 ) )
{
nFormat = GFF_JPG;
- return TRUE;
- }
-
- bM_COM = ( nTemp32 == 0xffd8fffe );
- if ( ( nTemp32 == 0xffd8ffe0 ) || bM_COM )
- {
- if( !bM_COM )
- {
- rStm.SeekRel( 2 );
- rStm >> nTemp32;
- }
+ bRet = TRUE;
- if( bM_COM || ( nTemp32 == 0x4a464946 ) )
+ if ( bExtendedInfo )
{
- nFormat = GFF_JPG;
- bRet = TRUE;
+ rStm.SeekRel( -2 );
- if( bExtendedInfo )
- {
- MapMode aMap;
- UINT16 nTemp16;
- ULONG nCount = 9;
- ULONG nMax;
- ULONG nResX;
- ULONG nResY;
- BYTE cUnit;
-
- // Groesse des verbleibenden Puffers ermitteln
- if ( bLinked )
- nMax = static_cast< SvMemoryStream& >(rStm).GetEndOfData()
- - 16;
- else
- nMax = DATA_SIZE - 16;
-
- // max. 8K
- nMax = Min( nMax, (ULONG) 8192 );
+ sal_uInt32 nError( rStm.GetError() );
- // Res-Unit ermitteln
- rStm.SeekRel( 3 );
- rStm >> cUnit;
-
- // ResX ermitteln
- rStm >> nTemp16;
- nResX = nTemp16;
+ sal_Bool bScanFailure = sal_False;
+ sal_Bool bScanFinished = sal_False;
- // ResY ermitteln
- rStm >> nTemp16;
- nResY = nTemp16;
-
- // SOF0/1-Marker finden, aber dabei
- // nicht mehr als DATA_SIZE Pixel lesen, falls
- // kein WideSearch
- do
+ while( !bScanFailure && !bScanFinished && !rStm.IsEof() && !rStm.GetError() )
+ {
+ sal_uInt8 nMarker = ImpDetectJPG_GetNextMarker( rStm );
+ switch( nMarker )
{
- while ( ( cByte != 0xff ) &&
- ( bWideSearch || ( nCount++ < nMax ) ) )
+ // fixed size marker, not having a two byte length parameter
+ case 0xd0 : // RST0
+ case 0xd1 :
+ case 0xd2 :
+ case 0xd3 :
+ case 0xd4 :
+ case 0xd5 :
+ case 0xd6 :
+ case 0xd7 : // RST7
+ case 0x01 : // TEM
+ break;
+
+ case 0xd8 : // SOI (has already been checked, there should not be a second one)
+ case 0x00 : // marker is invalid, we should stop now
+ bScanFailure = sal_True;
+ break;
+
+ case 0xd9 : // EOI
+ bScanFinished = sal_True;
+ break;
+
+ // per default we assume marker segments conaining a length parameter
+ default :
{
- rStm >> cByte;
- }
-
- while ( ( cByte == 0xff ) &&
- ( bWideSearch || ( nCount++ < nMax ) ) )
- {
- rStm >> cByte;
- }
- }
- while ( ( cByte != 0xc0 ) &&
- ( cByte != 0xc1 ) &&
- ( bWideSearch || ( nCount < nMax ) ) );
-
- // wir haben den SOF0/1-Marker
- if ( ( cByte == 0xc0 ) || ( cByte == 0xc1 ) )
- {
- // Hoehe einlesen
- rStm.SeekRel( 3 );
- rStm >> nTemp16;
- aPixSize.Height() = nTemp16;
+ sal_uInt16 nLength;
+ rStm >> nLength;
- // Breite einlesen
- rStm >> nTemp16;
- aPixSize.Width() = nTemp16;
-
- // Bit/Pixel einlesen
- rStm >> cByte;
- nBitsPerPixel = ( cByte == 3 ? 24 : cByte == 1 ? 8 : 0 );
+ if ( nLength < 2 )
+ bScanFailure = sal_True;
+ else
+ {
+ sal_uInt32 nNextMarkerPos = rStm.Tell() + nLength - 2;
+ switch( nMarker )
+ {
+ case 0xe0 : // APP0 Marker
+ {
+ if ( nLength == 16 )
+ {
+ sal_Int32 nIdentifier;
+ rStm >> nIdentifier;
+ if ( nIdentifier == 0x4a464946 ) // JFIF Identifier
+ {
+ sal_uInt8 nStringTerminator;
+ sal_uInt8 nMajorRevision;
+ sal_uInt8 nMinorRevision;
+ sal_uInt8 nUnits;
+ sal_uInt16 nHorizontalResolution;
+ sal_uInt16 nVerticalResolution;
+ sal_uInt8 nHorzThumbnailPixelCount;
+ sal_uInt8 nVertThumbnailPixelCount;
+
+ rStm >> nStringTerminator
+ >> nMajorRevision
+ >> nMinorRevision
+ >> nUnits
+ >> nHorizontalResolution
+ >> nVerticalResolution
+ >> nHorzThumbnailPixelCount
+ >> nVertThumbnailPixelCount;
+
+ // setting the logical size
+ if ( nUnits && nHorizontalResolution && nVerticalResolution )
+ {
+ MapMode aMap;
+ aMap.SetMapUnit( nUnits == 1 ? MAP_INCH : MAP_CM );
+ aMap.SetScaleX( Fraction( 1, nHorizontalResolution ) );
+ aMap.SetScaleY( Fraction( 1, nVerticalResolution ) );
+ aLogSize = OutputDevice::LogicToLogic( aPixSize, aMap, MapMode( MAP_100TH_MM ) );
+ }
+ }
+ }
+ }
+ break;
- // logische Groesse setzen
- if ( cUnit && nResX && nResY )
- {
- aMap.SetMapUnit( cUnit == 1 ? MAP_INCH : MAP_CM );
- aMap.SetScaleX( Fraction( 1, nResX ) );
- aMap.SetScaleY( Fraction( 1, nResY ) );
- aLogSize = OutputDevice::LogicToLogic( aPixSize, aMap,
- MapMode( MAP_100TH_MM ) );
+ // Start of Frame Markers
+ case 0xc0 : // SOF0
+ case 0xc1 : // SOF1
+ case 0xc2 : // SOF2
+ case 0xc3 : // SOF3
+ case 0xc5 : // SOF5
+ case 0xc6 : // SOF6
+ case 0xc7 : // SOF7
+ case 0xc9 : // SOF9
+ case 0xca : // SOF10
+ case 0xcb : // SOF11
+ case 0xcd : // SOF13
+ case 0xce : // SOF14
+ case 0xcf : // SOF15
+ {
+ sal_uInt8 nSamplePrecision;
+ sal_uInt16 nNumberOfLines;
+ sal_uInt16 nSamplesPerLine;
+ sal_uInt8 nNumberOfImageComponents;
+ sal_uInt8 nComponentsIdentifier;
+ sal_uInt8 nHorizontalSamplingFactor;
+ sal_uInt8 nVerticalSamplingFactor;
+ sal_uInt8 nQuantizationTableDestinationSelector;
+ rStm >> nSamplePrecision
+ >> nNumberOfLines
+ >> nSamplesPerLine
+ >> nNumberOfImageComponents
+ >> nComponentsIdentifier
+ >> nHorizontalSamplingFactor
+ >> nQuantizationTableDestinationSelector;
+ nVerticalSamplingFactor = nHorizontalSamplingFactor & 0xf;
+ nHorizontalSamplingFactor >>= 4;
+
+ aPixSize.Height() = nNumberOfLines;
+ aPixSize.Width() = nSamplesPerLine;
+ nBitsPerPixel = ( nNumberOfImageComponents == 3 ? 24 : nNumberOfImageComponents == 1 ? 8 : 0 );
+ nPlanes = 1;
+
+ bScanFinished = sal_True;
+ }
+ break;
+ }
+ rStm.Seek( nNextMarkerPos );
+ }
}
-
- // Planes immer 1
- nPlanes = 1;
+ break;
}
}
+ rStm.SetError( nError );
}
}
-
+ rStm.Seek( nStmPos );
return bRet;
}
@@ -556,37 +477,26 @@ BOOL GraphicDescriptor::ImpDetectPCD( SvStream& rStm, BOOL )
{
BOOL bRet = FALSE;
+ sal_Int32 nStmPos = rStm.Tell();
rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
- rStm.Seek( nStmPos );
- if ( bWideSearch )
- {
- UINT32 nTemp32;
- UINT16 nTemp16;
- BYTE cByte;
+ UINT32 nTemp32;
+ UINT16 nTemp16;
+ BYTE cByte;
- rStm.SeekRel( 2048 );
- rStm >> nTemp32;
- rStm >> nTemp16;
- rStm >> cByte;
+ rStm.SeekRel( 2048 );
+ rStm >> nTemp32;
+ rStm >> nTemp16;
+ rStm >> cByte;
- if ( ( nTemp32 == 0x5f444350 ) &&
- ( nTemp16 == 0x5049 ) &&
- ( cByte == 0x49 ) )
- {
- nFormat = GFF_PCD;
- bRet = TRUE;
- }
- }
- else
+ if ( ( nTemp32 == 0x5f444350 ) &&
+ ( nTemp16 == 0x5049 ) &&
+ ( cByte == 0x49 ) )
{
- bRet = aPathExt.CompareToAscii( "pcd", 3 ) == COMPARE_EQUAL;
- if ( bRet )
- {
- nFormat = GFF_PCD;
- }
+ nFormat = GFF_PCD;
+ bRet = TRUE;
}
-
+ rStm.Seek( nStmPos );
return bRet;
}
@@ -608,10 +518,10 @@ BOOL GraphicDescriptor::ImpDetectPCX( SvStream& rStm, BOOL bExtendedInfo )
BOOL bRet = FALSE;
BYTE cByte;
+ sal_Int32 nStmPos = rStm.Tell();
rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
- rStm.Seek( nStmPos );
-
rStm >> cByte;
+
if ( cByte == 0x0a )
{
nFormat = GFF_PCX;
@@ -675,6 +585,7 @@ BOOL GraphicDescriptor::ImpDetectPCX( SvStream& rStm, BOOL bExtendedInfo )
}
}
+ rStm.Seek( nStmPos );
return bRet;
}
@@ -690,10 +601,10 @@ BOOL GraphicDescriptor::ImpDetectPNG( SvStream& rStm, BOOL bExtendedInfo )
UINT32 nTemp32;
BOOL bRet = FALSE;
+ sal_Int32 nStmPos = rStm.Tell();
rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN );
- rStm.Seek( nStmPos );
-
rStm >> nTemp32;
+
if ( nTemp32 == 0x89504e47 )
{
rStm >> nTemp32;
@@ -726,55 +637,52 @@ BOOL GraphicDescriptor::ImpDetectPNG( SvStream& rStm, BOOL bExtendedInfo )
nPlanes = 1;
bCompressed = TRUE;
- if ( bWideSearch )
- {
- UINT32 nLen32;
+ UINT32 nLen32;
- rStm.SeekRel( 8 );
+ rStm.SeekRel( 8 );
- // so lange ueberlesen, bis wir den pHYs-Chunk haben oder
- // den Anfang der Bilddaten
+ // so lange ueberlesen, bis wir den pHYs-Chunk haben oder
+ // den Anfang der Bilddaten
+ rStm >> nLen32;
+ rStm >> nTemp32;
+ while( ( nTemp32 != 0x70485973 ) && ( nTemp32 != 0x49444154 ) )
+ {
+ rStm.SeekRel( 4 + nLen32 );
rStm >> nLen32;
rStm >> nTemp32;
- while( ( nTemp32 != 0x70485973 ) && ( nTemp32 != 0x49444154 ) )
- {
- rStm.SeekRel( 4 + nLen32 );
- rStm >> nLen32;
- rStm >> nTemp32;
- }
+ }
- if ( nTemp32 == 0x70485973 )
- {
- ULONG nXRes;
- ULONG nYRes;
+ if ( nTemp32 == 0x70485973 )
+ {
+ ULONG nXRes;
+ ULONG nYRes;
- // horizontale Aufloesung
- rStm >> nTemp32;
- nXRes = nTemp32;
+ // horizontale Aufloesung
+ rStm >> nTemp32;
+ nXRes = nTemp32;
- // vertikale Aufloesung
- rStm >> nTemp32;
- nYRes = nTemp32;
+ // vertikale Aufloesung
+ rStm >> nTemp32;
+ nYRes = nTemp32;
- // Unit einlesen
- rStm >> cByte;
+ // Unit einlesen
+ rStm >> cByte;
- if ( cByte )
- {
- if ( nXRes )
- aLogSize.Width() = ( aPixSize.Width() * 100000 ) /
- nTemp32;
+ if ( cByte )
+ {
+ if ( nXRes )
+ aLogSize.Width() = ( aPixSize.Width() * 100000 ) /
+ nTemp32;
- if ( nYRes )
- aLogSize.Height() = ( aPixSize.Height() * 100000 ) /
- nTemp32;
- }
+ if ( nYRes )
+ aLogSize.Height() = ( aPixSize.Height() * 100000 ) /
+ nTemp32;
}
}
}
}
}
-
+ rStm.Seek( nStmPos );
return bRet;
}
@@ -792,7 +700,7 @@ BOOL GraphicDescriptor::ImpDetectTIF( SvStream& rStm, BOOL bExtendedInfo )
BYTE cByte1;
BYTE cByte2;
- rStm.Seek( nStmPos );
+ sal_Int32 nStmPos = rStm.Tell();
rStm >> cByte1;
rStm >> cByte2;
if ( cByte1 == cByte2 )
@@ -829,14 +737,14 @@ BOOL GraphicDescriptor::ImpDetectTIF( SvStream& rStm, BOOL bExtendedInfo )
rStm >> nTemp32;
rStm.SeekRel( ( nCount = ( nTemp32 + 2 ) ) - 0x08 );
- if ( bWideSearch || ( nCount < nMax ) )
+ if ( nCount < nMax )
{
// Tag's lesen, bis wir auf Tag256 ( Width ) treffen
// nicht mehr Bytes als DATA_SIZE lesen
rStm >> nTemp16;
while ( nTemp16 != 256 )
{
- bOk = bWideSearch || ( nCount < nMax );
+ bOk = nCount < nMax;
if ( !bOk )
{
break;
@@ -912,7 +820,7 @@ BOOL GraphicDescriptor::ImpDetectTIF( SvStream& rStm, BOOL bExtendedInfo )
}
}
}
-
+ rStm.Seek( nStmPos );
return bRet;
}
@@ -965,11 +873,12 @@ BOOL GraphicDescriptor::ImpDetectPBM( SvStream& rStm, BOOL )
bRet = TRUE;
else
{
+ sal_Int32 nStmPos = rStm.Tell();
BYTE nFirst, nSecond;
- rStm.Seek( nStmPos );
rStm >> nFirst >> nSecond;
if ( nFirst == 'P' && ( ( nSecond == '1' ) || ( nSecond == '4' ) ) )
bRet = TRUE;
+ rStm.Seek( nStmPos );
}
if ( bRet )
@@ -992,11 +901,12 @@ BOOL GraphicDescriptor::ImpDetectPGM( SvStream& rStm, BOOL )
bRet = TRUE;
else
{
- BYTE nFirst, nSecond;
- rStm.Seek( nStmPos );
+ BYTE nFirst, nSecond;
+ sal_Int32 nStmPos = rStm.Tell();
rStm >> nFirst >> nSecond;
if ( nFirst == 'P' && ( ( nSecond == '2' ) || ( nSecond == '5' ) ) )
bRet = TRUE;
+ rStm.Seek( nStmPos );
}
if ( bRet )
@@ -1020,10 +930,11 @@ BOOL GraphicDescriptor::ImpDetectPPM( SvStream& rStm, BOOL )
else
{
BYTE nFirst, nSecond;
- rStm.Seek( nStmPos );
+ sal_Int32 nStmPos = rStm.Tell();
rStm >> nFirst >> nSecond;
if ( nFirst == 'P' && ( ( nSecond == '3' ) || ( nSecond == '6' ) ) )
bRet = TRUE;
+ rStm.Seek( nStmPos );
}
if ( bRet )
@@ -1041,16 +952,17 @@ BOOL GraphicDescriptor::ImpDetectPPM( SvStream& rStm, BOOL )
BOOL GraphicDescriptor::ImpDetectRAS( SvStream& rStm, BOOL )
{
UINT32 nMagicNumber;
- rStm.Seek( nStmPos );
+ BOOL bRet = FALSE;
+ sal_Int32 nStmPos = rStm.Tell();
rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN );
rStm >> nMagicNumber;
if ( nMagicNumber == 0x59a66a95 )
{
nFormat = GFF_RAS;
- return TRUE;
+ bRet = TRUE;
}
- else
- return FALSE;
+ rStm.Seek( nStmPos );
+ return bRet;
}
/*************************************************************************
@@ -1079,7 +991,7 @@ BOOL GraphicDescriptor::ImpDetectPSD( SvStream& rStm, BOOL bExtendedInfo )
BOOL bRet = FALSE;
UINT32 nMagicNumber;
- rStm.Seek( nStmPos );
+ sal_Int32 nStmPos = rStm.Tell();
rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN );
rStm >> nMagicNumber;
if ( nMagicNumber == 0x38425053 )
@@ -1123,6 +1035,7 @@ BOOL GraphicDescriptor::ImpDetectPSD( SvStream& rStm, BOOL bExtendedInfo )
if ( bRet )
nFormat = GFF_PSD;
+ rStm.Seek( nStmPos );
return bRet;
}
@@ -1139,8 +1052,9 @@ BOOL GraphicDescriptor::ImpDetectEPS( SvStream& rStm, BOOL )
sal_uInt32 nFirstLong;
sal_uInt8 nFirstBytes[20];
+ BOOL bRet = FALSE;
- rStm.Seek( nStmPos );
+ sal_Int32 nStmPos = rStm.Tell();
rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN );
rStm >> nFirstLong;
rStm.SeekRel( -4 );
@@ -1151,10 +1065,10 @@ BOOL GraphicDescriptor::ImpDetectEPS( SvStream& rStm, BOOL )
&& ImplSearchEntry( &nFirstBytes[15], (sal_uInt8*)"EPS", 3, 3 ) ) )
{
nFormat = GFF_EPS;
- return TRUE;
+ bRet = TRUE;
}
- else
- return FALSE;
+ rStm.Seek( nStmPos );
+ return bRet;
}
/*************************************************************************
@@ -1201,9 +1115,11 @@ BOOL GraphicDescriptor::ImpDetectPCT( SvStream& rStm, BOOL )
nFormat = GFF_PCT;
else
{
- BYTE sBuf[3]={0};
+ sal_Int32 nStmPos = rStm.Tell();
+
+ BYTE sBuf[4];
- rStm.Seek( nStmPos + 522 );
+ rStm.SeekRel( 522 );
rStm.Read( sBuf, 3 );
if( !rStm.GetError() )
@@ -1215,6 +1131,7 @@ BOOL GraphicDescriptor::ImpDetectPCT( SvStream& rStm, BOOL )
nFormat = GFF_PCT;
}
}
+ rStm.Seek( nStmPos );
}
return bRet;
@@ -1230,18 +1147,20 @@ BOOL GraphicDescriptor::ImpDetectPCT( SvStream& rStm, BOOL )
BOOL GraphicDescriptor::ImpDetectSGF( SvStream& rStm, BOOL )
{
BOOL bRet = FALSE;
-
if( aPathExt.CompareToAscii( "sgf", 3 ) == COMPARE_EQUAL )
bRet = TRUE;
else
{
+ sal_Int32 nStmPos = rStm.Tell();
+
BYTE nFirst, nSecond;
- rStm.Seek( nStmPos );
rStm >> nFirst >> nSecond;
if( nFirst == 'J' && nSecond == 'J' )
bRet = TRUE;
+
+ rStm.Seek( nStmPos );
}
if( bRet )
@@ -1279,9 +1198,8 @@ BOOL GraphicDescriptor::ImpDetectSVM( SvStream& rStm, BOOL bExtendedInfo )
BOOL bRet = FALSE;
BYTE cByte;
+ sal_Int32 nStmPos = rStm.Tell();
rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
- rStm.Seek( nStmPos );
-
rStm >> n32;
if ( n32 == 0x44475653 )
{
@@ -1342,7 +1260,7 @@ BOOL GraphicDescriptor::ImpDetectSVM( SvStream& rStm, BOOL bExtendedInfo )
}
}
}
-
+ rStm.Seek( nStmPos );
return bRet;
}
@@ -1417,3 +1335,5 @@ String GraphicDescriptor::GetImportFormatShortName( sal_uInt16 nFormat )
return String( aKeyName, RTL_TEXTENCODING_ASCII_US );
}
+
+
diff --git a/svtools/source/filter.vcl/filter/fldll.cxx b/svtools/source/filter.vcl/filter/fldll.cxx
deleted file mode 100644
index b44e08835f34..000000000000
--- a/svtools/source/filter.vcl/filter/fldll.cxx
+++ /dev/null
@@ -1,76 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svtools.hxx"
-
-#ifdef WIN
-#include <svwin.h>
-
-// Statische DLL-Verwaltungs-Variablen
-static HINSTANCE hDLLInst = 0; // HANDLE der DLL
-
-
-/***************************************************************************
-|*
-|* LibMain()
-|*
-|* Beschreibung Initialisierungsfunktion der DLL
-|* Ersterstellung TH 05.05.93
-|* Letzte Aenderung TH 05.05.93
-|*
-***************************************************************************/
-
-extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR )
-{
-#ifndef WNT
- if ( nHeap )
- UnlockData( 0 );
-#endif
-
- hDLLInst = hDLL;
-
- return TRUE;
-}
-
-/***************************************************************************
-|*
-|* WEP()
-|*
-|* Beschreibung DLL-Deinitialisierung
-|* Ersterstellung TH 05.05.93
-|* Letzte Aenderung TH 05.05.93
-|*
-***************************************************************************/
-
-extern "C" int CALLBACK WEP( int )
-{
- return 1;
-}
-
-#endif
-
diff --git a/svtools/source/filter.vcl/filter/makefile.mk b/svtools/source/filter.vcl/filter/makefile.mk
index 272bb9a76b03..11d35150bda8 100644
--- a/svtools/source/filter.vcl/filter/makefile.mk
+++ b/svtools/source/filter.vcl/filter/makefile.mk
@@ -41,16 +41,11 @@ SOLARINC+=-I../../inc
# --- Files --------------------------------------------------------
SRS1NAME=$(TARGET)
-SRC1FILES= strings.src \
- dlgexpor.src \
- dlgepng.src \
- dlgejpg.src
+SRC1FILES=exportdialog.src
SLOFILES= $(SLO)$/filter.obj \
$(SLO)$/filter2.obj \
- $(SLO)$/dlgexpor.obj \
- $(SLO)$/dlgejpg.obj \
- $(SLO)$/dlgepng.obj \
+ $(SLO)$/exportdialog.obj \
$(SLO)$/sgfbram.obj \
$(SLO)$/sgvmain.obj \
$(SLO)$/sgvtext.obj \
@@ -59,28 +54,26 @@ SLOFILES= $(SLO)$/filter.obj \
$(SLO)$/FilterConfigCache.obj \
$(SLO)$/SvFilterOptionsDialog.obj
+EXCEPTIONSFILES= $(SLO)$/exportdialog.obj
+
EXCEPTIONSNOOPTFILES= $(SLO)$/filter.obj \
$(SLO)$/FilterConfigItem.obj \
$(SLO)$/FilterConfigCache.obj \
$(SLO)$/SvFilterOptionsDialog.obj
LIB1TARGET= $(SLB)$/$(TARGET).uno.lib
-LIB1OBJFILES= \
- $(SLO)$/dlgexpor.obj \
- $(SLO)$/dlgejpg.obj \
- $(SLO)$/dlgepng.obj \
- $(SLO)$/SvFilterOptionsDialog.obj
+LIB1OBJFILES= $(SLO)$/exportdialog.obj \
+ $(SLO)$/SvFilterOptionsDialog.obj
LIB2TARGET= $(SLB)$/$(TARGET).lib
-LIB2OBJFILES= \
- $(SLO)$/filter.obj \
- $(SLO)$/filter2.obj \
- $(SLO)$/sgfbram.obj \
- $(SLO)$/sgvmain.obj \
- $(SLO)$/sgvtext.obj \
- $(SLO)$/sgvspln.obj \
- $(SLO)$/FilterConfigItem.obj \
- $(SLO)$/FilterConfigCache.obj
+LIB2OBJFILES= $(SLO)$/filter.obj \
+ $(SLO)$/filter2.obj \
+ $(SLO)$/sgfbram.obj \
+ $(SLO)$/sgvmain.obj \
+ $(SLO)$/sgvtext.obj \
+ $(SLO)$/sgvspln.obj \
+ $(SLO)$/FilterConfigItem.obj \
+ $(SLO)$/FilterConfigCache.obj
# --- Targets -------------------------------------------------------
diff --git a/svtools/source/filter.vcl/filter/sgfbram.cxx b/svtools/source/filter.vcl/filter/sgfbram.cxx
index 43cf0fbbacd3..3d1a71f5a2db 100644
--- a/svtools/source/filter.vcl/filter/sgfbram.cxx
+++ b/svtools/source/filter.vcl/filter/sgfbram.cxx
@@ -37,10 +37,6 @@
#include "sgffilt.hxx"
#include "sgfbram.hxx"
-#if defined( WIN ) && defined( MSC )
-#pragma code_seg( "SVTOOLS_FILTER4", "SVTOOLS_CODE" )
-#endif
-
/*************************************************************************
|*
|* operator>>( SvStream&, SgfHeader& )
diff --git a/svtools/source/filter.vcl/filter/sgvmain.cxx b/svtools/source/filter.vcl/filter/sgvmain.cxx
index e175380244b3..293c6dab7964 100644
--- a/svtools/source/filter.vcl/filter/sgvmain.cxx
+++ b/svtools/source/filter.vcl/filter/sgvmain.cxx
@@ -110,20 +110,11 @@
//
////////////////////////////////////////////////////////////////////////////////////////////////////
-#if defined( WIN ) && defined( MSC )
-#pragma code_seg( "svtools", "AUTO_CODE" )
-#endif
-
////////////////////////////////////////////////////////////////////////////////////////////////////
// Fuer Fontuebersetzung ///////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
SgfFontLst* pSgfFonts = 0;
-#if defined( WIN ) && defined( MSC )
-#pragma code_seg( "SVTOOLS_FILTER3", "SVTOOLS_CODE" )
-static void AntiMscBug() {}
-#endif
-
////////////////////////////////////////////////////////////////////////////////////////////////////
// Fuer Kreisunterarten, Text und gedrehte Rechtecke ///////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -1137,7 +1128,3 @@ for n:=0 to 63 do
end;
*/
-#if defined( WIN ) && defined( MSC )
-#pragma code_seg( "svtools", "AUTO_CODE" )
-#endif
-
diff --git a/svtools/source/filter.vcl/filter/sgvspln.cxx b/svtools/source/filter.vcl/filter/sgvspln.cxx
index 7a23e85f4dbe..d695e171a194 100644
--- a/svtools/source/filter.vcl/filter/sgvspln.cxx
+++ b/svtools/source/filter.vcl/filter/sgvspln.cxx
@@ -33,11 +33,6 @@
#include <tools/poly.hxx>
-#if defined( WIN ) && defined( MSC )
-#pragma code_seg( "SVTOOLS_FILTER2", "SVTOOLS_CODE" )
-#pragma optimize( "", off )
-#endif
-
#if defined( PM2 ) && defined( __BORLANDC__ )
#pragma option -Od
#endif
diff --git a/svtools/source/filter.vcl/filter/sgvtext.cxx b/svtools/source/filter.vcl/filter/sgvtext.cxx
index 4a0be80b55be..9a82cd486599 100644
--- a/svtools/source/filter.vcl/filter/sgvtext.cxx
+++ b/svtools/source/filter.vcl/filter/sgvtext.cxx
@@ -38,10 +38,6 @@
extern SgfFontLst* pSgfFonts;
-#if defined( WIN ) && defined( MSC )
-#pragma code_seg( "SVTOOLS_FILTER1", "SVTOOLS_CODE" )
-#endif
-
#ifndef abs
#define abs(x) ((x)<0 ? -(x) : (x))
#endif
@@ -621,7 +617,7 @@ USHORT SetTextContext(OutputDevice& rOut, ObjTextType& Atr, BOOL Kapt, USHORT Dr
switch (Atr.GetFont()) {
case 92500: case 92501: case 92504: case 92505:
{
-#if defined(WIN) || defined(WNT) || defined(PM2)
+#if defined(WNT) || defined(PM2)
FNam=String::CreateFromAscii( "Times New Roman" ); // CG Times ist unter Windows und OS/2 Times New Roman
#else
FNam=String::CreateFromAscii( "Times" ); // ansonsten ist das einfach Times
@@ -630,7 +626,7 @@ USHORT SetTextContext(OutputDevice& rOut, ObjTextType& Atr, BOOL Kapt, USHORT Dr
aFont.SetFamily(FAMILY_ROMAN);
} break;
case 94021: case 94022: case 94023: case 94024: {
-#if defined(WIN) || defined(WNT)
+#if defined(WNT)
FNam=String::CreateFromAscii( "Arial", 5 ); // Univers ist unter Windows Arial
#else
FNam=String::CreateFromAscii( "Helvetica" ); // und ansonsten Helvetica
@@ -639,7 +635,7 @@ USHORT SetTextContext(OutputDevice& rOut, ObjTextType& Atr, BOOL Kapt, USHORT Dr
StdBrei=47;
} break;
case 93950: case 93951: case 93952: case 93953: {
-#if defined(WIN) || defined(WNT)
+#if defined(WNT)
FNam=String::CreateFromAscii( "Courier New" ); // Der Vector-Courierfont unter Windows heisst Courier New
#else
FNam=String::CreateFromAscii( "Courier" ); // ansonsten ist und bleibt Courier immer Courier
diff --git a/svtools/source/filter.vcl/filter/strings.hrc b/svtools/source/filter.vcl/filter/strings.hrc
deleted file mode 100644
index 0eea67fb2338..000000000000
--- a/svtools/source/filter.vcl/filter/strings.hrc
+++ /dev/null
@@ -1,27 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#include <svtools/svtools.hrc>
diff --git a/svtools/source/filter.vcl/filter/strings.src b/svtools/source/filter.vcl/filter/strings.src
deleted file mode 100644
index 60e628ee0b5c..000000000000
--- a/svtools/source/filter.vcl/filter/strings.src
+++ /dev/null
@@ -1,85 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "strings.hrc"
-
-String EXPORT_DIALOG_TITLE
-{
- Text [ en-US ] = " Options" ;
-};
-
-String KEY_MODE
-{
- Text = "ExportMode" ;
-};
-
-String KEY_RES
-{
- Text = "Resolution" ;
-};
-
-String KEY_SIZE
-{
- Text = "Size" ;
-};
-
-String KEY_COLORS
-{
- Text = "Color" ;
-};
-
-String KEY_RLE_CODING
-{
- Text = "RLE_Coding" ;
-};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/svtools/source/filter.vcl/jpeg/jpeg.h b/svtools/source/filter.vcl/jpeg/jpeg.h
index deb06600474c..82a2f80a838c 100644
--- a/svtools/source/filter.vcl/jpeg/jpeg.h
+++ b/svtools/source/filter.vcl/jpeg/jpeg.h
@@ -51,11 +51,7 @@ struct JPEGCreateBitmapParam
typedef struct my_error_mgr* my_error_ptr;
typedef unsigned char BYTE;
-#ifdef WIN
-typedef unsigned char _huge* HPBYTE;
-#else
typedef unsigned char* HPBYTE;
-#endif
void* JPEGMalloc( size_t size );
void JPEGFree( void *ptr );
diff --git a/svtools/source/hatchwindow/hatchwindowfactory.component b/svtools/source/hatchwindow/hatchwindowfactory.component
new file mode 100644
index 000000000000..153fc8796281
--- /dev/null
+++ b/svtools/source/hatchwindow/hatchwindowfactory.component
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.embed.DocumentCloser">
+ <service name="com.sun.star.embed.DocumentCloser"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.embed.HatchWindowFactory">
+ <service name="com.sun.star.comp.embed.HatchWindowFactory"/>
+ <service name="com.sun.star.embed.HatchWindowFactory"/>
+ </implementation>
+</component>
diff --git a/svtools/source/hatchwindow/hatchwindowfactory.cxx b/svtools/source/hatchwindow/hatchwindowfactory.cxx
index f8dbddff3761..0eec027167c2 100644
--- a/svtools/source/hatchwindow/hatchwindowfactory.cxx
+++ b/svtools/source/hatchwindow/hatchwindowfactory.cxx
@@ -112,45 +112,6 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment (
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo (
- void * /* pServiceManager */, void * pRegistryKey)
-{
- if (pRegistryKey)
- {
- uno::Reference< registry::XRegistryKey> xRegistryKey (
- reinterpret_cast< registry::XRegistryKey* >(pRegistryKey));
- uno::Reference< registry::XRegistryKey> xNewKey;
-
- // OHatchWindowFactory registration
-
- xNewKey = xRegistryKey->createKey (
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) +
- OHatchWindowFactory::impl_staticGetImplementationName() +
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES") ) );
-
- uno::Sequence< ::rtl::OUString > aServices =
- OHatchWindowFactory::impl_staticGetSupportedServiceNames();
- for (sal_Int32 i = 0, n = aServices.getLength(); i < n; i++ )
- xNewKey->createKey( aServices.getConstArray()[i] );
-
-
- // ODocumentCloser registration
-
- xNewKey = xRegistryKey->createKey (
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) +
- ODocumentCloser::impl_staticGetImplementationName() +
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES") ) );
-
- aServices = ODocumentCloser::impl_staticGetSupportedServiceNames();
- for (sal_Int32 i = 0, n = aServices.getLength(); i < n; i++ )
- xNewKey->createKey( aServices.getConstArray()[i] );
-
-
- return sal_True;
- }
- return sal_False;
-}
-
SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory (
const sal_Char * pImplementationName, void * pServiceManager, void * /* pRegistryKey */)
{
diff --git a/svtools/source/hatchwindow/makefile.mk b/svtools/source/hatchwindow/makefile.mk
index 316e4ab1bfe2..3c736bc4e66a 100644
--- a/svtools/source/hatchwindow/makefile.mk
+++ b/svtools/source/hatchwindow/makefile.mk
@@ -63,3 +63,11 @@ DEF1NAME= $(SHL1TARGET)
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/hatchwindowfactory.component
+
+$(MISC)/hatchwindowfactory.component .ERRREMOVE : \
+ $(SOLARENV)/bin/createcomponent.xslt hatchwindowfactory.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt hatchwindowfactory.component
diff --git a/svtools/source/inc/svimpbox.hxx b/svtools/source/inc/svimpbox.hxx
index 92b9f960b65c..6919944daef4 100644
--- a/svtools/source/inc/svimpbox.hxx
+++ b/svtools/source/inc/svimpbox.hxx
@@ -153,7 +153,7 @@ private:
USHORT nFlags;
USHORT nCurTabPos;
- WinBits nWinBits;
+ WinBits m_nStyle;
ExtendedWinBits nExtendedWinBits;
BOOL bSimpleTravel : 1; // ist TRUE bei SINGLE_SELECTION
BOOL bUpdateMode : 1;
@@ -264,7 +264,7 @@ public:
~SvImpLBox();
void Clear();
- void SetWindowBits( WinBits nWinStyle );
+ void SetStyle( WinBits i_nWinStyle );
void SetExtendedWindowBits( ExtendedWinBits _nBits );
ExtendedWinBits GetExtendedWindowBits() const { return nExtendedWinBits; }
void SetModel( SvLBoxTreeList* pModel ) { pTree = pModel;}
diff --git a/svtools/source/inc/svimpicn.hxx b/svtools/source/inc/svimpicn.hxx
index 20f98d2bcbbd..7d5c2b1b41e3 100644
--- a/svtools/source/inc/svimpicn.hxx
+++ b/svtools/source/inc/svimpicn.hxx
@@ -96,7 +96,6 @@ class SvImpIconView
nGridDY;
long nHorSBarHeight,
nVerSBarWidth;
- WinBits nWinBits;
int nViewMode;
long nHorDist;
long nVerDist;
@@ -171,7 +170,7 @@ public:
~SvImpIconView();
void Clear( BOOL bInCtor = FALSE );
- void SetWindowBits( WinBits nWinStyle );
+ void SetStyle( const WinBits i_nWinStyle );
void SetModel( SvLBoxTreeList* pTree, SvLBoxEntry* pParent )
{ pModel = pTree; SetCurParent(pParent); }
void EntryInserted( SvLBoxEntry*);
diff --git a/svtools/source/java/javainteractionhandler.cxx b/svtools/source/java/javainteractionhandler.cxx
index ec34ed07f25d..a7420dbc388f 100644
--- a/svtools/source/java/javainteractionhandler.cxx
+++ b/svtools/source/java/javainteractionhandler.cxx
@@ -147,28 +147,10 @@ void SAL_CALL JavaInteractionHandler::handle( const Reference< XInteractionReque
// No suitable JRE found
vos::OGuard aSolarGuard( Application::GetSolarMutex() );
m_bJavaNotFound_Handled = true;
- //We first try to get the patch resource svp680xxx.res
- //If the resource is not found then svt680xxx.res is used
- ResId idWBX = SvtResId(WARNINGBOX_JAVANOTFOUND);
- SvpResId pidPatchWBX(WARNINGBOX_JAVANOTFOUND);
- pidPatchWBX.SetRT(RSC_WARNINGBOX);
- ResMgr *pMgrWB = pidPatchWBX.GetResMgr();
- if (pMgrWB && pMgrWB->IsAvailable(pidPatchWBX))
- idWBX = pidPatchWBX;
- WarningBox aWarningBox( NULL, idWBX);
-
- String aTitle;
- SvpResId pidString(STR_WARNING_JAVANOTFOUND);
- pidString.SetRT(RSC_STRING);
- ResMgr *pmgr = pidString.GetResMgr();
- if ( pmgr && pmgr->IsAvailable(pidString))
- aTitle = String(pidString);
- else
- aTitle = String( SvtResId( STR_WARNING_JAVANOTFOUND ));
-
+ WarningBox aWarningBox( NULL, SvtResId( WARNINGBOX_JAVANOTFOUND ) );
+ String aTitle( SvtResId( STR_WARNING_JAVANOTFOUND ) );
aWarningBox.SetText( aTitle );
nResult = aWarningBox.Execute();
-
}
else
{
@@ -182,25 +164,8 @@ void SAL_CALL JavaInteractionHandler::handle( const Reference< XInteractionReque
// javavendors.xml was updated and Java has not been configured yet
vos::OGuard aSolarGuard( Application::GetSolarMutex() );
m_bInvalidSettings_Handled = true;
- //We first try to get the patch resource svp680xxx.res
- //If the resource is not found then svt680xxx.res is used
- ResId idWBX = SvtResId(WARNINGBOX_INVALIDJAVASETTINGS);
- SvpResId pidPatchWBX(WARNINGBOX_INVALIDJAVASETTINGS);
- pidPatchWBX.SetRT(RSC_WARNINGBOX);
- ResMgr *pMgrWB = pidPatchWBX.GetResMgr();
- if (pMgrWB && pMgrWB->IsAvailable(pidPatchWBX))
- idWBX = pidPatchWBX;
- WarningBox aWarningBox( NULL, idWBX);
-
- String aTitle;
- SvpResId pidString(STR_WARNING_INVALIDJAVASETTINGS);
- pidString.SetRT(RSC_STRING);
- ResMgr *pmgr = pidString.GetResMgr();
- if ( pmgr && pmgr->IsAvailable(pidString))
- aTitle = String(pidString);
- else
- aTitle = String( SvtResId(STR_WARNING_INVALIDJAVASETTINGS));
-
+ WarningBox aWarningBox( NULL, SvtResId( WARNINGBOX_INVALIDJAVASETTINGS ) );
+ String aTitle( SvtResId(STR_WARNING_INVALIDJAVASETTINGS));
aWarningBox.SetText( aTitle );
nResult = aWarningBox.Execute();
}
@@ -216,28 +181,8 @@ void SAL_CALL JavaInteractionHandler::handle( const Reference< XInteractionReque
vos::OGuard aSolarGuard( Application::GetSolarMutex() );
m_bJavaDisabled_Handled = true;
// Java disabled. Give user a chance to enable Java inside Office.
- //We first try to get the patch resource svp680xxx.res
- //If the resource is not found then svt680xxx.res is used
- ResId idQBX = SvtResId( QBX_JAVADISABLED );
- SvpResId pidPatchQBX(QBX_JAVADISABLED);
- pidPatchQBX.SetRT(RSC_QUERYBOX);
- ResMgr *pMgrQB = pidPatchQBX.GetResMgr();
-
- if (pMgrQB && pMgrQB->IsAvailable(pidPatchQBX))
- idQBX = pidPatchQBX;
-
- QueryBox aQueryBox(NULL, idQBX);
-
- String aTitle;
-
- SvpResId pidString(STR_QUESTION_JAVADISABLED);
- pidString.SetRT(RSC_STRING);
- ResMgr *pmgr = pidString.GetResMgr();
- if ( pmgr && pmgr->IsAvailable(pidString))
- aTitle = String(pidString);
- else
- aTitle = String( SvtResId( STR_QUESTION_JAVADISABLED ));
-
+ QueryBox aQueryBox( NULL, SvtResId( QBX_JAVADISABLED ) );
+ String aTitle( SvtResId( STR_QUESTION_JAVADISABLED ) );
aQueryBox.SetText( aTitle );
nResult = aQueryBox.Execute();
if ( nResult == RET_YES )
@@ -260,25 +205,8 @@ void SAL_CALL JavaInteractionHandler::handle( const Reference< XInteractionReque
// Java not correctly installed, or damaged
vos::OGuard aSolarGuard( Application::GetSolarMutex() );
m_bVMCreationFailure_Handled = true;
- //We first try to get the patch resource svp680xxx.res
- //If the resource is not found then svt680xxx.res is used
- ResId idEBX = SvtResId(ERRORBOX_JVMCREATIONFAILED);
- SvpResId pidPatchEBX(ERRORBOX_JVMCREATIONFAILED);
- pidPatchEBX.SetRT(RSC_ERRORBOX);
- ResMgr *pMgrEB = pidPatchEBX.GetResMgr();
- if (pMgrEB && pMgrEB->IsAvailable(pidPatchEBX))
- idEBX = pidPatchEBX;
- ErrorBox aErrorBox( NULL, idEBX);
-
- String aTitle;
- SvpResId pidString(STR_ERROR_JVMCREATIONFAILED);
- pidString.SetRT(RSC_STRING);
- ResMgr *pmgr = pidString.GetResMgr();
- if ( pmgr && pmgr->IsAvailable(pidString))
- aTitle = String(pidString);
- else
- aTitle = String( SvtResId(STR_ERROR_JVMCREATIONFAILED));
-
+ ErrorBox aErrorBox( NULL, SvtResId( ERRORBOX_JVMCREATIONFAILED ) );
+ String aTitle( SvtResId( STR_ERROR_JVMCREATIONFAILED ) );
aErrorBox.SetText( aTitle );
nResult = aErrorBox.Execute();
}
@@ -295,25 +223,8 @@ void SAL_CALL JavaInteractionHandler::handle( const Reference< XInteractionReque
//before it can be used.
vos::OGuard aSolarGuard( Application::GetSolarMutex() );
m_bRestartRequired_Handled = true;
- //We first try to get the patch resource svp680xxx.res
- //If the resource is not found then svt680xxx.res is used
- ResId idEBX = SvtResId(ERRORBOX_RESTARTREQUIRED);
- SvpResId pidPatchEBX(ERRORBOX_RESTARTREQUIRED);
- pidPatchEBX.SetRT(RSC_ERRORBOX);
- ResMgr *pMgrEB = pidPatchEBX.GetResMgr();
- if (pMgrEB && pMgrEB->IsAvailable(pidPatchEBX))
- idEBX = pidPatchEBX;
- ErrorBox aErrorBox(NULL, idEBX);
-
- String aTitle;
- SvpResId pidString(STR_ERROR_RESTARTREQUIRED);
- pidString.SetRT(RSC_STRING);
- ResMgr *pmgr = pidString.GetResMgr();
- if ( pmgr && pmgr->IsAvailable(pidString))
- aTitle = String(pidString);
- else
- aTitle = String( SvtResId(STR_ERROR_RESTARTREQUIRED));
-
+ ErrorBox aErrorBox(NULL, SvtResId( ERRORBOX_RESTARTREQUIRED ) );
+ String aTitle( SvtResId( STR_ERROR_RESTARTREQUIRED ) );
aErrorBox.SetText( aTitle );
nResult = aErrorBox.Execute();
}
diff --git a/svtools/source/misc/ehdl.cxx b/svtools/source/misc/ehdl.cxx
index bf9e87d33a74..8834f5497e5a 100644
--- a/svtools/source/misc/ehdl.cxx
+++ b/svtools/source/misc/ehdl.cxx
@@ -64,7 +64,7 @@ static USHORT aWndFunc(
{
- NAMESPACE_VOS( OGuard ) aGuard( Application::GetSolarMutex() );
+ vos:: OGuard aGuard( Application::GetSolarMutex() );
// aus den Flags die benoetigten WinBits ermitteln
WinBits eBits=0;
@@ -377,7 +377,7 @@ BOOL SfxErrorHandler::GetErrorString(
*/
{
- NAMESPACE_VOS( OGuard ) aGuard( Application::GetSolarMutex() );
+ vos:: OGuard aGuard( Application::GetSolarMutex() );
BOOL bRet = FALSE;
rStr=String(SvtResId(RID_ERRHDL_CLASS));
@@ -454,7 +454,7 @@ BOOL SfxErrorContext::GetString(ULONG nErrId, String &rStr)
}
if( pMgr )
{
- NAMESPACE_VOS( OGuard ) aGuard( Application::GetSolarMutex() );
+ vos:: OGuard aGuard( Application::GetSolarMutex() );
ResId aResId( nResId, *pMgr );
diff --git a/svtools/source/misc/imap.cxx b/svtools/source/misc/imap.cxx
index 25f23e2ef00b..4378e0acd234 100644
--- a/svtools/source/misc/imap.cxx
+++ b/svtools/source/misc/imap.cxx
@@ -57,10 +57,6 @@ UINT16 IMapObject::nActualTextEncoding = (UINT16) RTL_TEXTENCODING_DONTKNOW;
/******************************************************************************/
-#ifdef WIN
-#pragma optimize ( "", off )
-#endif
-
IMapObject::IMapObject()
: bActive( false )
, nReadVersion( 0 )
@@ -1224,9 +1220,3 @@ void ImageMap::Read( SvStream& rIStm, const String& rBaseURL )
rIStm.SetNumberFormatInt( nOldFormat );
}
-
-#ifdef WIN
-#pragma optimize ( "", on )
-#endif
-
-
diff --git a/svtools/source/misc/imap2.cxx b/svtools/source/misc/imap2.cxx
index 9834fe0fcb76..587a31d4f098 100644
--- a/svtools/source/misc/imap2.cxx
+++ b/svtools/source/misc/imap2.cxx
@@ -28,9 +28,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-#ifdef WIN
-#include <sysdep.hxx>
-#endif
#include <string.h>
// #include <math.h>
#include <vcl/svapp.hxx>
@@ -48,9 +45,6 @@
#include <svtools/imapcirc.hxx>
#include <svtools/imappoly.hxx>
-#ifdef WIN
-#include <sysdep.hxx>
-#endif
#include <string.h>
#include <math.h>
diff --git a/svtools/source/misc/svtdata.cxx b/svtools/source/misc/svtdata.cxx
index 65715f635883..7a04b3276c9f 100644
--- a/svtools/source/misc/svtdata.cxx
+++ b/svtools/source/misc/svtdata.cxx
@@ -61,25 +61,6 @@ ResMgr * ImpSvtData::GetResMgr()
return GetResMgr(Application::GetSettings().GetUILocale());
}
-ResMgr * ImpSvtData::GetPatchResMgr(const ::com::sun::star::lang::Locale& aLocale)
-{
- if (!pPatchResMgr)
- {
- pPatchResMgr = ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(svp), aLocale);
- }
- return pPatchResMgr;
-}
-
-ResMgr * ImpSvtData::GetPatchResMgr()
-{
- return GetPatchResMgr(Application::GetSettings().GetUILocale());
-}
-
-SvpResId::SvpResId( USHORT nId ) :
- ResId( nId, *ImpSvtData::GetSvtData().GetPatchResMgr() )
-{
-}
-
//============================================================================
// static
ImpSvtData & ImpSvtData::GetSvtData()
diff --git a/svtools/source/plugapp/testtool.src b/svtools/source/plugapp/testtool.src
index 9cc52c58f013..e456200943f6 100644
--- a/svtools/source/plugapp/testtool.src
+++ b/svtools/source/plugapp/testtool.src
@@ -104,6 +104,7 @@ Bitmap TT_SHOW2 {
};
WorkWindow TT_INLINE_TRANSLATION {
+ HelpID = "svtools:WorkWindow:TT_INLINE_TRANSLATION";
SVLook = TRUE;
Size = MAP_APPFONT( 2*Control_Border + 4*ButtonWidth + 3*Button_Button, 120 );
Moveable = TRUE;
@@ -116,6 +117,7 @@ WorkWindow TT_INLINE_TRANSLATION {
Text[ en-US ] = "Translation";
};
Edit TT_E_NEW {
+ HelpID = "svtools:Edit:TT_INLINE_TRANSLATION:TT_E_NEW";
Disable = TRUE;
Border = TRUE;
Pos = MAP_APPFONT( 7, 16 );
@@ -134,6 +136,7 @@ WorkWindow TT_INLINE_TRANSLATION {
Text[ en-US ] = "Comment";
};
Edit TT_E_COMMENT {
+ HelpID = "svtools:Edit:TT_INLINE_TRANSLATION:TT_E_COMMENT";
Disable = TRUE;
Border = TRUE;
Pos = MAP_APPFONT( 7, 64 );
@@ -142,12 +145,14 @@ WorkWindow TT_INLINE_TRANSLATION {
Text[ en-US ] = "~Comment";
};
PushButton TT_PB_SELECT {
+ HelpID = "svtools:PushButton:TT_INLINE_TRANSLATION:TT_PB_SELECT";
Pos = MAP_APPFONT( Control_Border, 89 );
Size = MAP_APPFONT( ButtonWidth, 12 );
TabStop = TRUE;
Text[ en-US ] = "~Select";
};
PushButton TT_PB_RESTORE {
+ HelpID = "svtools:PushButton:TT_INLINE_TRANSLATION:TT_PB_RESTORE";
Disable = TRUE;
Pos = MAP_APPFONT( Control_Border + ButtonWidth + Button_Button, 89 );
Size = MAP_APPFONT( ButtonWidth, 12 );
@@ -155,6 +160,7 @@ WorkWindow TT_INLINE_TRANSLATION {
Text[ en-US ] = "~Restore";
};
PushButton TT_PB_ACCEPT {
+ HelpID = "svtools:PushButton:TT_INLINE_TRANSLATION:TT_PB_ACCEPT";
Disable = TRUE;
Pos = MAP_APPFONT( Control_Border + 2*(ButtonWidth + Button_Button), 89 );
Size = MAP_APPFONT( ButtonWidth, 12 );
@@ -162,6 +168,7 @@ WorkWindow TT_INLINE_TRANSLATION {
Text[ en-US ] = "~Accept";
};
PushButton TT_PB_NEXT {
+ HelpID = "svtools:PushButton:TT_INLINE_TRANSLATION:TT_PB_NEXT";
Pos = MAP_APPFONT( Control_Border + 3*(ButtonWidth + Button_Button), 89 );
Size = MAP_APPFONT( ButtonWidth, 12 );
TabStop = TRUE;
diff --git a/svtools/source/productregistration/makefile.mk b/svtools/source/productregistration/makefile.mk
index a26e8feca753..b6e119601697 100644
--- a/svtools/source/productregistration/makefile.mk
+++ b/svtools/source/productregistration/makefile.mk
@@ -76,3 +76,11 @@ RESLIB1SRSFILES=\
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/productregistration.uno.component
+
+$(MISC)/productregistration.uno.component .ERRREMOVE : \
+ $(SOLARENV)/bin/createcomponent.xslt productregistration.uno.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt productregistration.uno.component
diff --git a/svtools/source/productregistration/productregistration.cxx b/svtools/source/productregistration/productregistration.cxx
index 39629f5c3f77..cb3a9b7a7702 100644
--- a/svtools/source/productregistration/productregistration.cxx
+++ b/svtools/source/productregistration/productregistration.cxx
@@ -461,25 +461,6 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment (
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo (
- void * /* pServiceManager */, void * pRegistryKey)
-{
- if (pRegistryKey)
- {
- Reference< XRegistryKey > xRegistryKey (
- reinterpret_cast< XRegistryKey* >( pRegistryKey ));
- Reference< XRegistryKey > xNewKey;
-
- xNewKey = xRegistryKey->createKey(
- OUString::createFromAscii( "/" PRODREG_IMPLNAME "/UNO/SERVICES" ));
- xNewKey->createKey(
- OUString::createFromAscii( PRODREG_SERVNAME ));
-
- return sal_True;
- }
- return sal_False;
-}
-
SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory (
const sal_Char * pImplementationName, void * pServiceManager, void * /* pRegistryKey */)
{
diff --git a/svtools/source/productregistration/productregistration.uno.component b/svtools/source/productregistration/productregistration.uno.component
new file mode 100644
index 000000000000..da2cfd37c483
--- /dev/null
+++ b/svtools/source/productregistration/productregistration.uno.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.setup.ProductRegistration">
+ <service name="com.sun.star.setup.ProductRegistration"/>
+ </implementation>
+</component>
diff --git a/svtools/source/productregistration/registrationdlg.src b/svtools/source/productregistration/registrationdlg.src
index c4cdcbcbe3ec..64f1063f1ba3 100644
--- a/svtools/source/productregistration/registrationdlg.src
+++ b/svtools/source/productregistration/registrationdlg.src
@@ -72,6 +72,7 @@ ModalDialog DLG_REGISTRATION_REQUEST
RadioButton RB_NOW
{
+ HelpID = "svtools:RadioButton:DLG_REGISTRATION_REQUEST:RB_NOW";
Pos = MAP_APPFONT ( 33 , 41 ) ;
Size = MAP_APPFONT ( 153 , 10 ) ;
Text [ en-US ] = "Register now" ;
@@ -79,18 +80,21 @@ ModalDialog DLG_REGISTRATION_REQUEST
RadioButton RB_LATER
{
+ HelpID = "svtools:RadioButton:DLG_REGISTRATION_REQUEST:RB_LATER";
Pos = MAP_APPFONT ( 33 , 54 ) ;
Size = MAP_APPFONT ( 153 , 10 ) ;
Text [ en-US ] = "Remind me to register later" ;
};
RadioButton RB_NEVER
{
+ HelpID = "svtools:RadioButton:DLG_REGISTRATION_REQUEST:RB_NEVER";
Pos = MAP_APPFONT ( 33 , 67 ) ;
Size = MAP_APPFONT ( 153 , 10 ) ;
Text [ en-US ] = "Never register" ;
};
RadioButton RB_DONE
{
+ HelpID = "svtools:RadioButton:DLG_REGISTRATION_REQUEST:RB_DONE";
Pos = MAP_APPFONT ( 33 , 80 ) ;
Size = MAP_APPFONT ( 153 , 20 ) ;
WordBreak = TRUE;
diff --git a/svtools/source/svrtf/makefile.mk b/svtools/source/svrtf/makefile.mk
index 5ebb0e28c69e..cb76882f5f94 100644
--- a/svtools/source/svrtf/makefile.mk
+++ b/svtools/source/svrtf/makefile.mk
@@ -30,6 +30,8 @@ PRJ=..$/..
PRJNAME=svtools
TARGET=svrtf
+ENABLE_EXCEPTIONS=TRUE
+
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
diff --git a/svtools/source/svrtf/parrtf.cxx b/svtools/source/svrtf/parrtf.cxx
index 1c578d160307..3a775a7fc345 100644
--- a/svtools/source/svrtf/parrtf.cxx
+++ b/svtools/source/svrtf/parrtf.cxx
@@ -44,8 +44,6 @@ const int MAX_TOKEN_LEN = 128;
#define RTF_ISDIGIT( c ) (c >= '0' && c <= '9')
#define RTF_ISALPHA( c ) ( (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') )
-SV_IMPL_VARARR( RtfParserStates_Impl, RtfParserState_Impl )
-
SvRTFParser::SvRTFParser( SvStream& rIn, BYTE nStackSize )
: SvParser( rIn, nStackSize ),
eUNICodeSet( RTL_TEXTENCODING_MS_1252 ), // default ist ANSI-CodeSet
@@ -175,14 +173,13 @@ int SvRTFParser::_GetNextToken()
nUCharOverread = (BYTE)nTokenValue;
#if 1
//cmc: other ifdef breaks #i3584
- aParserStates[ aParserStates.Count()-1].
+ aParserStates.top().
nUCharOverread = nUCharOverread;
#else
if( !nUCharOverread )
- nUCharOverread = aParserStates[
- aParserStates.Count()-1].nUCharOverread;
+ nUCharOverread = aParserStates.top().nUCharOverread;
else
- aParserStates[ aParserStates.Count()-1].
+ aParserStates.top().
nUCharOverread = nUCharOverread;
#endif
}
@@ -252,12 +249,12 @@ int SvRTFParser::_GetNextToken()
if( 0 <= nOpenBrakets )
{
RtfParserState_Impl aState( nUCharOverread, GetSrcEncoding() );
- aParserStates.Insert(
- aState, sal::static_int_cast< USHORT >(nOpenBrakets) );
+ aParserStates.push( aState );
}
++nOpenBrakets;
- DBG_ASSERT( nOpenBrakets == aParserStates.Count(),
- "ParserStateStack unequal to bracket count" );
+ DBG_ASSERT(
+ static_cast<size_t>(nOpenBrakets) == aParserStates.size(),
+ "ParserStateStack unequal to bracket count" );
nRet = nNextCh;
}
break;
@@ -266,12 +263,11 @@ int SvRTFParser::_GetNextToken()
--nOpenBrakets;
if( 0 <= nOpenBrakets )
{
- aParserStates.Remove(
- sal::static_int_cast< USHORT >(nOpenBrakets) );
- if( aParserStates.Count() )
+ aParserStates.pop();
+ if( !aParserStates.empty() )
{
const RtfParserState_Impl& rRPS =
- aParserStates[ aParserStates.Count() - 1 ];
+ aParserStates.top();
nUCharOverread = rRPS.nUCharOverread;
SetSrcEncoding( rRPS.eCodeSet );
}
@@ -281,8 +277,9 @@ int SvRTFParser::_GetNextToken()
SetSrcEncoding( GetCodeSet() );
}
}
- DBG_ASSERT( nOpenBrakets == aParserStates.Count(),
- "ParserStateStack unequal to bracket count" );
+ DBG_ASSERT(
+ static_cast<size_t>(nOpenBrakets) == aParserStates.size(),
+ "ParserStateStack unequal to bracket count" );
nRet = nNextCh;
break;
@@ -690,8 +687,8 @@ void SvRTFParser::SetEncoding( rtl_TextEncoding eEnc )
if (eEnc == RTL_TEXTENCODING_DONTKNOW)
eEnc = GetCodeSet();
- if (aParserStates.Count())
- aParserStates[aParserStates.Count() - 1].eCodeSet = eEnc;
+ if (!aParserStates.empty())
+ aParserStates.top().eCodeSet = eEnc;
SetSrcEncoding(eEnc);
}
diff --git a/svtools/source/svrtf/rtfkey2.cxx b/svtools/source/svrtf/rtfkey2.cxx
index 03a7667f48e2..a4335302f475 100644
--- a/svtools/source/svrtf/rtfkey2.cxx
+++ b/svtools/source/svrtf/rtfkey2.cxx
@@ -1128,6 +1128,7 @@ sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SOUTLVL, "\\soutlvl" );
sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHP, "\\shp" );
sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SN, "\\sn" );
sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SV, "\\sv" );
+sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SP, "\\sp" );
/*
sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHPLEFT, "\\shpleft" );
sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHPTOP, "\\shptop" );
diff --git a/svtools/source/svrtf/rtfkeywd.cxx b/svtools/source/svrtf/rtfkeywd.cxx
index 27ce3643f8cf..9b29951ddbbf 100644
--- a/svtools/source/svrtf/rtfkeywd.cxx
+++ b/svtools/source/svrtf/rtfkeywd.cxx
@@ -1160,6 +1160,7 @@ static RTF_TokenEntry __FAR_DATA aRTFTokenTab[] = {
*/
{{OOO_STRING_SVTOOLS_RTF_SN}, RTF_SN},
{{OOO_STRING_SVTOOLS_RTF_SV}, RTF_SV},
+ {{OOO_STRING_SVTOOLS_RTF_SP}, RTF_SP},
// Support for overline attributes
{{OOO_STRING_SVTOOLS_RTF_OL}, RTF_OL},
diff --git a/svtools/source/toolpanel/drawerlayouter.cxx b/svtools/source/toolpanel/drawerlayouter.cxx
index 040f33045fff..7fc7d05ea0c9 100644
--- a/svtools/source/toolpanel/drawerlayouter.cxx
+++ b/svtools/source/toolpanel/drawerlayouter.cxx
@@ -165,7 +165,7 @@ namespace svt
OSL_PRECOND( i_nPosition <= m_aDrawers.size(), "DrawerDeckLayouter::PanelInserted: inconsistency!" );
PToolPanelDrawer pDrawer( new ToolPanelDrawer( m_rParentWindow, i_pPanel->GetDisplayName() ) );
- pDrawer->SetSmartHelpId( i_pPanel->GetHelpID() );
+ pDrawer->SetHelpId( i_pPanel->GetHelpID() );
// proper Z-Order
if ( i_nPosition == 0 )
{
diff --git a/svtools/source/toolpanel/dummypanel.cxx b/svtools/source/toolpanel/dummypanel.cxx
index 20f140a6e610..4de38b7f4bb3 100644
--- a/svtools/source/toolpanel/dummypanel.cxx
+++ b/svtools/source/toolpanel/dummypanel.cxx
@@ -80,9 +80,9 @@ namespace svt
}
//--------------------------------------------------------------------
- SmartId DummyPanel::GetHelpID() const
+ rtl::OString DummyPanel::GetHelpID() const
{
- return SmartId();
+ return rtl::OString();
}
//--------------------------------------------------------------------
diff --git a/svtools/source/toolpanel/dummypanel.hxx b/svtools/source/toolpanel/dummypanel.hxx
index adb98e52077e..d2ca4480fce5 100644
--- a/svtools/source/toolpanel/dummypanel.hxx
+++ b/svtools/source/toolpanel/dummypanel.hxx
@@ -49,7 +49,7 @@ namespace svt
// IToolPanel
virtual ::rtl::OUString GetDisplayName() const;
virtual Image GetImage() const;
- virtual SmartId GetHelpID() const;
+ virtual rtl::OString GetHelpID() const;
virtual void Activate( Window& i_rParentWindow );
virtual void Deactivate();
virtual void SetSizePixel( const Size& i_rPanelWindowSize );
diff --git a/svtools/source/uno/miscservices.cxx b/svtools/source/uno/miscservices.cxx
index e16a1ecb56dc..34984976bf07 100644
--- a/svtools/source/uno/miscservices.cxx
+++ b/svtools/source/uno/miscservices.cxx
@@ -101,55 +101,6 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment (
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo (
- void * pServiceManager, void * _pRegistryKey )
-{
- if (_pRegistryKey)
- {
- Reference< XRegistryKey > xRegistryKey (
- reinterpret_cast< XRegistryKey* >( _pRegistryKey ));
- Reference< XRegistryKey > xNewKey;
- uno::Sequence< ::rtl::OUString > aServices;
-
- xNewKey = xRegistryKey->createKey (
- OUString::createFromAscii( "/com.sun.star.comp.svtools.OAddressBookSourceDialogUno/UNO/SERVICES" ) );
- xNewKey->createKey(
- OUString::createFromAscii( "com.sun.star.ui.AddressBookSourceDialog" ) );
-
- xNewKey = xRegistryKey->createKey (
- OUString::createFromAscii( "/com.sun.star.svtools.SvFilterOptionsDialog/UNO/SERVICES" ) );
- xNewKey->createKey (
- OUString::createFromAscii( "com.sun.star.ui.dialogs.FilterOptionsDialog" ) );
-
- // GraphicProvider
- xNewKey = reinterpret_cast< registry::XRegistryKey * >( _pRegistryKey )->createKey(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) +
- GraphicProvider::getImplementationName_Static() +
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES") ) );
-
- aServices = GraphicProvider::getSupportedServiceNames_Static();
- int i;
- for( i = 0; i < aServices.getLength(); i++ )
- xNewKey->createKey( aServices.getConstArray()[ i ] );
-
- // GraphicRendererVCL
- xNewKey = reinterpret_cast< registry::XRegistryKey * >( _pRegistryKey )->createKey(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) +
- GraphicRendererVCL::getImplementationName_Static() +
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES") ) );
-
- aServices = ( GraphicRendererVCL::getSupportedServiceNames_Static() );
- for( i = 0; i < aServices.getLength(); i++ )
- xNewKey->createKey( aServices.getConstArray()[ i ] );
-
- if ( !component_writeInfoHelper( reinterpret_cast< lang::XMultiServiceFactory* >( pServiceManager ), reinterpret_cast< registry::XRegistryKey* >( _pRegistryKey ), serviceDecl ) )
- return false;
-
- return ::cppu::component_writeInfoHelper( pServiceManager, _pRegistryKey, s_aServiceEntries );
- }
- return sal_False;
-}
-
SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory (
const sal_Char * pImplementationName, void * _pServiceManager, void * pRegistryKey)
{
diff --git a/svtools/source/uno/toolboxcontroller.cxx b/svtools/source/uno/toolboxcontroller.cxx
index 92ae93f5080d..bdb2256a07e8 100644
--- a/svtools/source/uno/toolboxcontroller.cxx
+++ b/svtools/source/uno/toolboxcontroller.cxx
@@ -806,7 +806,7 @@ sal_Bool SAL_CALL ToolboxController::convertFastPropertyValue( com::sun::star::u
{
case TOOLBARCONTROLLER_PROPHANDLE_SUPPORTSVISIABLE:
{
- sal_Bool aNewValue;
+ sal_Bool aNewValue(sal_False);
aValue >>= aNewValue;
if (aNewValue != m_bSupportVisiable)
{
diff --git a/svtools/source/uno/treecontrolpeer.cxx b/svtools/source/uno/treecontrolpeer.cxx
index d1ea854cce61..f37d5f80ed68 100644
--- a/svtools/source/uno/treecontrolpeer.cxx
+++ b/svtools/source/uno/treecontrolpeer.cxx
@@ -1327,12 +1327,12 @@ void TreeControlPeer::setProperty( const ::rtl::OUString& PropertyName, const An
sal_Bool bEnabled = sal_False;
if ( aValue >>= bEnabled )
{
- WinBits nStyle = rTree.GetWindowBits();
+ WinBits nStyle = rTree.GetStyle();
if ( bEnabled )
nStyle |= WB_HIDESELECTION;
else
nStyle &= ~WB_HIDESELECTION;
- rTree.SetWindowBits( nStyle );
+ rTree.SetStyle( nStyle );
}
}
break;
@@ -1390,11 +1390,11 @@ void TreeControlPeer::setProperty( const ::rtl::OUString& PropertyName, const An
sal_Bool bEnabled = false;
if( aValue >>= bEnabled )
{
- WinBits nBits = rTree.GetWindowBits() & (~WB_HASLINES);
+ WinBits nBits = rTree.GetStyle() & (~WB_HASLINES);
if( bEnabled )
nBits |= WB_HASLINES;
- if( nBits != rTree.GetWindowBits() )
- rTree.SetWindowBits( nBits );
+ if( nBits != rTree.GetStyle() )
+ rTree.SetStyle( nBits );
}
break;
}
@@ -1403,11 +1403,11 @@ void TreeControlPeer::setProperty( const ::rtl::OUString& PropertyName, const An
sal_Bool bEnabled = false;
if( aValue >>= bEnabled )
{
- WinBits nBits = rTree.GetWindowBits() & (~WB_HASLINESATROOT);
+ WinBits nBits = rTree.GetStyle() & (~WB_HASLINESATROOT);
if( bEnabled )
nBits |= WB_HASLINESATROOT;
- if( nBits != rTree.GetWindowBits() )
- rTree.SetWindowBits( nBits );
+ if( nBits != rTree.GetStyle() )
+ rTree.SetStyle( nBits );
}
break;
}
@@ -1428,7 +1428,7 @@ Any TreeControlPeer::getProperty( const ::rtl::OUString& PropertyName ) throw(Ru
switch(nPropId)
{
case BASEPROPERTY_HIDEINACTIVESELECTION:
- return Any( ( rTree.GetWindowBits() & WB_HIDESELECTION ) != 0 ? sal_True : sal_False );
+ return Any( ( rTree.GetStyle() & WB_HIDESELECTION ) != 0 ? sal_True : sal_False );
case BASEPROPERTY_TREE_SELECTIONTYPE:
{
@@ -1456,9 +1456,9 @@ Any TreeControlPeer::getProperty( const ::rtl::OUString& PropertyName ) throw(Ru
case BASEPROPERTY_TREE_ROOTDISPLAYED:
return Any( mbIsRootDisplayed );
case BASEPROPERTY_TREE_SHOWSHANDLES:
- return Any( (rTree.GetWindowBits() & WB_HASLINES) != 0 ? sal_True : sal_False );
+ return Any( (rTree.GetStyle() & WB_HASLINES) != 0 ? sal_True : sal_False );
case BASEPROPERTY_TREE_SHOWSROOTHANDLES:
- return Any( (rTree.GetWindowBits() & WB_HASLINESATROOT) != 0 ? sal_True : sal_False );
+ return Any( (rTree.GetStyle() & WB_HASLINESATROOT) != 0 ? sal_True : sal_False );
}
}
return VCLXWindow::getProperty( PropertyName );
@@ -1527,7 +1527,7 @@ UnoTreeListBoxImpl::UnoTreeListBoxImpl( TreeControlPeer* pPeer, Window* pParent,
: SvTreeListBox( pParent, nWinStyle )
, mxPeer( pPeer )
{
- SetWindowBits( WB_BORDER | WB_HASLINES |WB_HASBUTTONS | WB_HASLINESATROOT | WB_HASBUTTONSATROOT | WB_HSCROLL );
+ SetStyle( WB_BORDER | WB_HASLINES |WB_HASBUTTONS | WB_HASLINESATROOT | WB_HASBUTTONSATROOT | WB_HSCROLL );
SetNodeDefaultImages();
SetSelectHdl( LINK(this, UnoTreeListBoxImpl, OnSelectionChangeHdl) );
SetDeselectHdl( LINK(this, UnoTreeListBoxImpl, OnSelectionChangeHdl) );
diff --git a/svtools/source/uno/wizard/unowizard.cxx b/svtools/source/uno/wizard/unowizard.cxx
index 9440c0e69f26..ea147c5979d3 100644
--- a/svtools/source/uno/wizard/unowizard.cxx
+++ b/svtools/source/uno/wizard/unowizard.cxx
@@ -42,6 +42,7 @@
#include <rtl/strbuf.hxx>
#include <vos/mutex.hxx>
#include <vcl/svapp.hxx>
+#include <tools/urlobj.hxx>
//......................................................................................................................
namespace svt { namespace uno
@@ -206,11 +207,32 @@ namespace svt { namespace uno
m_bInitialized = true;
}
+ static rtl::OString lcl_getHelpId( const ::rtl::OUString& _rHelpURL )
+ {
+ INetURLObject aHID( _rHelpURL );
+ if ( aHID.GetProtocol() == INET_PROT_HID )
+ return rtl::OUStringToOString( aHID.GetURLPath(), RTL_TEXTENCODING_UTF8 );
+ else
+ return rtl::OUStringToOString( _rHelpURL, RTL_TEXTENCODING_UTF8 );
+ }
+
+ //------------------------------------------------------------------------
+ static ::rtl::OUString lcl_getHelpURL( const rtl::OString& sHelpId )
+ {
+ ::rtl::OUStringBuffer aBuffer;
+ ::rtl::OUString aTmp( sHelpId, sHelpId.getLength(), RTL_TEXTENCODING_UTF8 );
+ INetURLObject aHID( aTmp );
+ if ( aHID.GetProtocol() == INET_PROT_NOT_VALID )
+ aBuffer.appendAscii( INET_HID_SCHEME );
+ aBuffer.append( aTmp.getStr() );
+ return aBuffer.makeStringAndClear();
+ }
+
//--------------------------------------------------------------------
Dialog* Wizard::createDialog( Window* i_pParent )
{
WizardShell* pDialog( new WizardShell( i_pParent, this, m_xController, m_aWizardSteps ) );
- pDialog->SetSmartHelpId( SmartId( m_sHelpURL ) );
+ pDialog->SetHelpId( lcl_getHelpId( m_sHelpURL ) );
pDialog->setTitleBase( m_sTitle );
return pDialog;
}
@@ -219,7 +241,7 @@ namespace svt { namespace uno
void Wizard::destroyDialog()
{
if ( m_pDialog )
- m_sHelpURL = m_pDialog->GetSmartHelpId().GetStr();
+ m_sHelpURL = lcl_getHelpURL( m_pDialog->GetHelpId() );
Wizard_Base::destroyDialog();
}
@@ -279,8 +301,7 @@ namespace svt { namespace uno
if ( !m_pDialog )
return m_sHelpURL;
- const SmartId aSmartId( m_pDialog->GetSmartHelpId() );
- return aSmartId.GetStr();
+ return lcl_getHelpURL( m_pDialog->GetHelpId() );
}
//------------------------------------------------------------------------------------------------------------------
@@ -292,7 +313,7 @@ namespace svt { namespace uno
if ( !m_pDialog )
m_sHelpURL = i_HelpURL;
else
- m_pDialog->SetSmartHelpId( SmartId( i_HelpURL ) );
+ m_pDialog->SetHelpId( lcl_getHelpId( i_HelpURL ) );
}
//------------------------------------------------------------------------------------------------------------------
@@ -414,7 +435,7 @@ namespace svt { namespace uno
::osl::MutexGuard aGuard( m_aMutex );
WizardShell* pWizardImpl = dynamic_cast< WizardShell* >( m_pDialog );
- ENSURE_OR_RETURN_FALSE( pWizardImpl, "Wizard::getCurrentPage: invalid dialog implementation!" );
+ ENSURE_OR_RETURN( pWizardImpl, "Wizard::getCurrentPage: invalid dialog implementation!", Reference< XWizardPage >() );
return pWizardImpl->getCurrentWizardPage();
}
diff --git a/svtools/util/hidother.src b/svtools/util/hidother.src
index 77dd98115221..03aea7ebdf7e 100644
--- a/svtools/util/hidother.src
+++ b/svtools/util/hidother.src
@@ -57,3 +57,23 @@ hidspecial HID_PRINTDIALOG_TOFILE { HelpID = HID_PRINTDIALOG_TOFIL
hidspecial HID_WIZARD_NEXT { HelpID = HID_WIZARD_NEXT; };
hidspecial HID_WIZARD_PREVIOUS { HelpID = HID_WIZARD_PREVIOUS; };
+hidspecial HID_FILEDLG_LINK_CB { HelpID = HID_FILEDLG_LINK_CB; };
+hidspecial HID_FILEDLG_PREVIEW_CB { HelpID = HID_FILEDLG_PREVIEW_CB; };
+hidspecial HID_FILEDLG_FILE { HelpID = HID_FILEDLG_FILE; };
+hidspecial HID_FILEDLG_MANAGER { HelpID = HID_FILEDLG_MANAGER; };
+hidspecial HID_FILEDLG_READ_ONLY { HelpID = HID_FILEDLG_READ_ONLY; };
+hidspecial HID_FILEDLG_STANDARD { HelpID = HID_FILEDLG_STANDARD; };
+hidspecial HID_FILEDLG_URL { HelpID = HID_FILEDLG_URL; };
+hidspecial HID_FILEDLG_USE_PASSWD { HelpID = HID_FILEDLG_USE_PASSWD; };
+hidspecial HID_FILEDLG_AUTOCOMPLETEBOX { HelpID = HID_FILEDLG_AUTOCOMPLETEBOX; };
+hidspecial HID_FILEDLG_SAVE_BTN { HelpID = HID_FILEDLG_SAVE_BTN; };
+hidspecial HID_FILEDLG_SAVE_FILENAME { HelpID = HID_FILEDLG_SAVE_FILENAME; };
+hidspecial HID_FILEDLG_SAVE_FILETYPE { HelpID = HID_FILEDLG_SAVE_FILETYPE; };
+hidspecial HID_FILEDLG_INSERT_BTN { HelpID = HID_FILEDLG_INSERT_BTN; };
+hidspecial HID_FILEDLG_PATH_BTN { HelpID = HID_FILEDLG_PATH_BTN; };
+hidspecial HID_FILEDLG_PATH_FILENAME { HelpID = HID_FILEDLG_PATH_FILENAME; };
+hidspecial HID_FILEDLG_FOLDER_BTN { HelpID = HID_FILEDLG_FOLDER_BTN; };
+hidspecial HID_FILEDLG_FOLDER_FILENAME { HelpID = HID_FILEDLG_FOLDER_FILENAME; };
+hidspecial HID_FILEDLG_SRCHFOLDER_BTN { HelpID = HID_FILEDLG_SRCHFOLDER_BTN; };
+hidspecial HID_FILEDLG_EDIT_FAVORITES_LISTBOX { HelpID = HID_FILEDLG_EDIT_FAVORITES_LISTBOX; };
+hidspecial HID_FILEDLG_EDIT_FAVORITES_HEADERBAR { HelpID = HID_FILEDLG_EDIT_FAVORITES_HEADERBAR; };
diff --git a/svtools/util/makefile.mk b/svtools/util/makefile.mk
index f9c14a540410..27b46488a16c 100644
--- a/svtools/util/makefile.mk
+++ b/svtools/util/makefile.mk
@@ -190,3 +190,11 @@ ALL: $(SLB)$/svt.lib \
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/svt.component
+
+$(MISC)/svt.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ svt.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt svt.component
diff --git a/svtools/util/svt.component b/svtools/util/svt.component
new file mode 100644
index 000000000000..e15970547a38
--- /dev/null
+++ b/svtools/util/svt.component
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.graphic.GraphicProvider">
+ <service name="com.sun.star.graphic.GraphicProvider"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.graphic.GraphicRendererVCL">
+ <service name="com.sun.star.graphic.GraphicRendererVCL"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.svtools.OAddressBookSourceDialogUno">
+ <service name="com.sun.star.ui.AddressBookSourceDialog"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.svtools.uno.Wizard">
+ <service name="com.sun.star.ui.dialogs.Wizard"/>
+ </implementation>
+ <implementation name="com.sun.star.graphic.GraphicObject">
+ <service name="com.sun.star.graphic.GraphicObject"/>
+ </implementation>
+ <implementation name="com.sun.star.svtools.SvFilterOptionsDialog">
+ <service name="com.sun.star.ui.dialogs.FilterOptionsDialog"/>
+ </implementation>
+</component>
diff --git a/svtools/workben/toolpanel/toolpaneltest.cxx b/svtools/workben/toolpanel/toolpaneltest.cxx
index 6d044cee7c93..6542fe826587 100755
--- a/svtools/workben/toolpanel/toolpaneltest.cxx
+++ b/svtools/workben/toolpanel/toolpaneltest.cxx
@@ -145,7 +145,7 @@ public:
// IToolPanel
virtual ::rtl::OUString GetDisplayName() const;
virtual Image GetImage() const;
- virtual SmartId GetHelpID() const;
+ virtual rtl::OString GetHelpID() const;
virtual void Activate( Window& i_rParentWindow );
virtual void Deactivate();
virtual void SetSizePixel( const Size& i_rPanelWindowSize );
@@ -272,9 +272,9 @@ Image ColoredPanel::GetImage() const
}
//-----------------------------------------------------------------------------
-SmartId ColoredPanel::GetHelpID() const
+rtl::OString ColoredPanel::GetHelpID() const
{
- return SmartId();
+ return rtl::OString();
}
//=============================================================================
diff --git a/svtools/workben/unodialog/roadmapskeleton.src b/svtools/workben/unodialog/roadmapskeleton.src
index 797490273b5f..33728c700df6 100644
--- a/svtools/workben/unodialog/roadmapskeleton.src
+++ b/svtools/workben/unodialog/roadmapskeleton.src
@@ -31,6 +31,7 @@
// -----------------------------------------------------------------------------
ModalDialog DLG_ROADMAP_SKELETON
{
+ HelpID = "svtools:ModalDialog:DLG_ROADMAP_SKELETON";
OutputSize = TRUE ;
Moveable = TRUE;
Closeable = TRUE ;
@@ -61,24 +62,28 @@ ModalDialog DLG_ROADMAP_SKELETON
TabPage TP_WELCOME
{
+ HelpID = "svtools:TabPage:TP_WELCOME";
Size = MAP_APPFONT( TAB_PAGE_WIDTH, TAB_PAGE_HEIGHT );
Hide = TRUE;
};
TabPage TP_PREPARE
{
+ HelpID = "svtools:TabPage:TP_PREPARE";
Size = MAP_APPFONT( TAB_PAGE_WIDTH, TAB_PAGE_HEIGHT );
Hide = TRUE;
};
TabPage TP_SETUP
{
+ HelpID = "svtools:TabPage:TP_SETUP";
Size = MAP_APPFONT( TAB_PAGE_WIDTH, TAB_PAGE_HEIGHT );
Hide = TRUE;
};
TabPage TP_FINISH
{
+ HelpID = "svtools:TabPage:TP_FINISH";
Size = MAP_APPFONT( TAB_PAGE_WIDTH, TAB_PAGE_HEIGHT );
Hide = TRUE;
};
diff --git a/toolkit/inc/layout/layout.hxx b/toolkit/inc/layout/layout.hxx
index 78c7ea29272a..5d013e8a74c4 100644
--- a/toolkit/inc/layout/layout.hxx
+++ b/toolkit/inc/layout/layout.hxx
@@ -40,7 +40,6 @@
#include <vcl/combobox.h>
#include <vcl/fldunit.hxx>
#include <vcl/lstbox.h>
-#include <vcl/smartid.hxx>
#include <vcl/wintypes.hxx>
class Button;
@@ -162,10 +161,8 @@ public:
String GetText() const;
void SetStyle( WinBits style );
void SetUpdateMode( bool mode );
- void SetHelpId( sal_uIntPtr id );
- sal_uIntPtr GetHelpId() const;
- void SetSmartHelpId( SmartId const&, SmartIdUpdateMode mode=SMART_SET_SMART );
- SmartId GetSmartHelpId() const;
+ void SetHelpId( const rtl::OString& id );
+ const rtl::OString& GetHelpId() const;
void EnterWait ();
void LeaveWait ();
bool IsWait () const;
@@ -582,20 +579,20 @@ public:
#define DECL_MESSAGE_BOX_CTORS(Name)\
public:\
Name##Box (::Window *parent, char const* message,\
- char const* yes=0, char const* no=0, sal_uIntPtr help_id=0,\
+ char const* yes=0, char const* no=0, const rtl::OString& help_id=rtl::OString(),\
char const* xml_file="message-box.xml", char const* id="message-box");\
Name##Box (::Window *parent, rtl::OUString const& message,\
rtl::OUString yes=String (),\
rtl::OUString no=String (),\
- sal_uIntPtr help_id=0,\
+ const rtl::OString& help_id=rtl::OString(),\
char const* xml_file="message-box.xml", char const* id="message-box");\
Name##Box (::Window *parent, WinBits, char const* message,\
- char const* yes=0, char const* no=0, sal_uIntPtr help_id=0,\
+ char const* yes=0, char const* no=0, const rtl::OString& help_id=rtl::OString(),\
char const* xml_file="message-box.xml", char const* id="message-box");\
Name##Box (::Window *parent, WinBits, rtl::OUString const& message,\
rtl::OUString yes=String (),\
rtl::OUString no=String (),\
- sal_uIntPtr help_id=0,\
+ const rtl::OString& help_id=rtl::OString(),\
char const* xml_file="message-box.xml", char const* id="message-box")\
class TOOLKIT_DLLPUBLIC MessageBox : public Dialog
@@ -616,10 +613,10 @@ protected:
YesButton yesButton;
void bits_init (WinBits bits, rtl::OUString const& message,
- rtl::OUString yes, rtl::OUString, sal_uIntPtr help_id);
+ rtl::OUString yes, rtl::OUString, const rtl::OString& help_id);
void init (rtl::OUString const& message,
- rtl::OUString const& yes, rtl::OUString const& no, sal_uIntPtr help_id);
- void init (char const* message, char const* yes, char const* no, sal_uIntPtr help_id);
+ rtl::OUString const& yes, rtl::OUString const& no, const rtl::OString& help_id);
+ void init (char const* message, char const* yes, char const* no, const rtl::OString& help_id);
};
#define CLASS_MESSAGE_BOX(Name)\
diff --git a/toolkit/inc/toolkit/awt/vclxdevice.hxx b/toolkit/inc/toolkit/awt/vclxdevice.hxx
index 62753a36136d..bb1c35078055 100644
--- a/toolkit/inc/toolkit/awt/vclxdevice.hxx
+++ b/toolkit/inc/toolkit/awt/vclxdevice.hxx
@@ -58,7 +58,7 @@ class TOOLKIT_DLLPUBLIC VCLXDevice : public ::com::sun::star::awt::XDevice,
friend class VCLXGraphics;
private:
- NAMESPACE_VOS(IMutex)& mrMutex; // Reference to SolarMutex
+ vos::IMutex& mrMutex; // Reference to SolarMutex
OutputDevice* mpOutputDevice;
public:
@@ -66,7 +66,7 @@ public:
sal_uInt32 nFlags;
protected:
- NAMESPACE_VOS(IMutex)& GetMutex() { return mrMutex; }
+ vos::IMutex& GetMutex() { return mrMutex; }
void DestroyOutputDevice();
public:
diff --git a/toolkit/inc/toolkit/awt/vclxgraphics.hxx b/toolkit/inc/toolkit/awt/vclxgraphics.hxx
index 5fda9ac947ee..6a076a5339b8 100644
--- a/toolkit/inc/toolkit/awt/vclxgraphics.hxx
+++ b/toolkit/inc/toolkit/awt/vclxgraphics.hxx
@@ -60,7 +60,7 @@ class VCLXGraphics : public ::com::sun::star::awt::XGraphics,
public ::cppu::OWeakObject
{
private:
- NAMESPACE_VOS(IMutex)& mrMutex; // Reference to SolarMutex
+ vos::IMutex& mrMutex; // Reference to SolarMutex
::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice> mxDevice; // nur um bei getDevice() immer das gleiche zurueckzugeben
OutputDevice* mpOutputDevice;
@@ -73,7 +73,7 @@ private:
Region* mpClipRegion;
protected:
- NAMESPACE_VOS(IMutex)& GetMutex() { return mrMutex; }
+ vos::IMutex& GetMutex() { return mrMutex; }
public:
VCLXGraphics();
diff --git a/toolkit/inc/toolkit/awt/vclxwindows.hxx b/toolkit/inc/toolkit/awt/vclxwindows.hxx
index fb110cb74391..36ac2fa51337 100644
--- a/toolkit/inc/toolkit/awt/vclxwindows.hxx
+++ b/toolkit/inc/toolkit/awt/vclxwindows.hxx
@@ -395,7 +395,7 @@ public:
// ::com::sun::star::awt::XDialog2
virtual void SAL_CALL endDialog( ::sal_Int32 Result ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setHelpId( ::sal_Int32 Id ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setHelpId( const rtl::OUString& Id ) throw (::com::sun::star::uno::RuntimeException);
// ::com::sun::star::awt::XDialog
void SAL_CALL setTitle( const ::rtl::OUString& Title ) throw(::com::sun::star::uno::RuntimeException);
diff --git a/toolkit/inc/toolkit/controls/dialogcontrol.hxx b/toolkit/inc/toolkit/controls/dialogcontrol.hxx
index 0c5731d3f923..f6a0f768bc10 100644
--- a/toolkit/inc/toolkit/controls/dialogcontrol.hxx
+++ b/toolkit/inc/toolkit/controls/dialogcontrol.hxx
@@ -274,7 +274,7 @@ public:
// ::com::sun::star::awt::XDialog2
virtual void SAL_CALL endDialog( ::sal_Int32 Result ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setHelpId( ::sal_Int32 Id ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setHelpId( const rtl::OUString& Id ) throw (::com::sun::star::uno::RuntimeException);
// ::com::sun::star::awt::XDialog
void SAL_CALL setTitle( const ::rtl::OUString& Title ) throw(::com::sun::star::uno::RuntimeException);
diff --git a/toolkit/inc/toolkit/helper/throbberimpl.hxx b/toolkit/inc/toolkit/helper/throbberimpl.hxx
index 5ca6ec83d330..b944a74b65d2 100644
--- a/toolkit/inc/toolkit/helper/throbberimpl.hxx
+++ b/toolkit/inc/toolkit/helper/throbberimpl.hxx
@@ -43,7 +43,7 @@ namespace toolkit
class Throbber_Impl
{
private:
- NAMESPACE_VOS(IMutex)& mrMutex; // Reference to SolarMutex
+ vos::IMutex& mrMutex; // Reference to SolarMutex
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > > maImageList;
::com::sun::star::uno::Reference< VCLXWindow > mxParent;
@@ -55,7 +55,7 @@ namespace toolkit
DECL_LINK( TimeOutHdl, Throbber_Impl* );
- NAMESPACE_VOS(IMutex)& GetMutex() { return mrMutex; }
+ vos::IMutex& GetMutex() { return mrMutex; }
public:
Throbber_Impl( ::com::sun::star::uno::Reference< VCLXWindow > xParent,
diff --git a/toolkit/prj/build.lst b/toolkit/prj/build.lst
index 126eea24c66c..f4854de8e0c4 100644
--- a/toolkit/prj/build.lst
+++ b/toolkit/prj/build.lst
@@ -11,4 +11,12 @@ ti toolkit\source\controls\grid nmake - all ti_grid NULL
ti toolkit\source\layout\core nmake - all ti_layout_core NULL
ti toolkit\source\layout\vcl nmake - all ti_layout_vcl NULL
ti toolkit\util nmake - all ti_util ti_awt ti_controls ti_layout_core ti_helper ti_tree ti_grid ti_layout_vcl NULL
-ti toolkit\qa\unoapi nmake - all ti_qa_unoapi NULL
+
+ti toolkit\qa\unoapi nmake - all ti_qa_unoapi NULL
+
+
+# fail on unxsoli4
+#ti toolkit\qa\complex\xunitconversion nmake - all ti_complex_conv ti_util NULL
+
+# fails
+# ti toolkit\qa\complex\toolkit nmake - all ti_complex_ti ti_qa_complex_toolkit_interface_tests ti_util NULL
diff --git a/toolkit/prj/d.lst b/toolkit/prj/d.lst
index 375485c96e4d..01eb5026e401 100644
--- a/toolkit/prj/d.lst
+++ b/toolkit/prj/d.lst
@@ -63,3 +63,4 @@ mkdir: %_DEST%\inc%_EXT%\layout\vcl
..\source\layout\vcl\*.hxx %_DEST%\inc%_EXT%\layout\vcl\*.hxx
..\%__SRC%\bin\*-layout.zip %_DEST%\pck%_EXT%\*.*
+..\%__SRC%\misc\tk.component %_DEST%\xml%_EXT%\tk.component
diff --git a/toolkit/qa/complex/toolkit/CallbackClass.java b/toolkit/qa/complex/toolkit/CallbackClass.java
index efc0ef91f7c0..1c9eb68a6d34 100644
--- a/toolkit/qa/complex/toolkit/CallbackClass.java
+++ b/toolkit/qa/complex/toolkit/CallbackClass.java
@@ -28,11 +28,11 @@
package complex.toolkit;
import com.sun.star.awt.XCallback;
-import lib.MultiMethodTest;
+// import lib.MultiMethodTest;
import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.uno.XInterface;
-import com.sun.star.uno.UnoRuntime;
-import share.LogWriter;
+// import com.sun.star.uno.XInterface;
+// import com.sun.star.uno.UnoRuntime;
+// import share.LogWriter;
/**
* Testing <code>com.sun.star.awt.XRequestCallback</code>
@@ -44,15 +44,15 @@ import share.LogWriter;
*/
public class CallbackClass implements XCallback{
- private LogWriter log;
+ // private LogWriter log;
private XMultiServiceFactory xMSF;
- public CallbackClass(LogWriter log, XMultiServiceFactory xMSF ) {
+ public CallbackClass(XMultiServiceFactory xMSF ) {
this.xMSF = xMSF;
- this.log = log;
+ // this.log = log;
}
@@ -62,6 +62,6 @@ public class CallbackClass implements XCallback{
*/
public void notify( Object aData ) {
- log.println("callback called successfully" );
+ System.out.println("callback called successfully" );
}
}
diff --git a/toolkit/qa/complex/toolkit/CheckAccessibleStatusBar.java b/toolkit/qa/complex/toolkit/CheckAccessibleStatusBar.java
index fee95f2e6de0..cfb40614beab 100755
--- a/toolkit/qa/complex/toolkit/CheckAccessibleStatusBar.java
+++ b/toolkit/qa/complex/toolkit/CheckAccessibleStatusBar.java
@@ -27,15 +27,12 @@
package complex.toolkit;
-import complexlib.ComplexTestCase;
+// import complexlib.ComplexTestCase;
+import lib.TestParameters;
import util.SOfficeFactory;
import util.AccessibilityTools;
-import complex.toolkit.interface_tests._XAccessibleComponent;
-import complex.toolkit.interface_tests._XAccessibleContext;
-import complex.toolkit.interface_tests._XAccessibleExtendedComponent;
-import complex.toolkit.interface_tests._XAccessibleEventBroadcaster;
import com.sun.star.awt.XWindow;
-import com.sun.star.chart.XChartDocument;
+// import com.sun.star.chart.XChartDocument;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.lang.XComponent;
import com.sun.star.lang.XServiceInfo;
@@ -48,26 +45,46 @@ import com.sun.star.accessibility.AccessibleRole;
import com.sun.star.accessibility.XAccessible;
import com.sun.star.accessibility.XAccessibleContext;
import com.sun.star.awt.XExtendedToolkit;
-import java.io.PrintWriter;
+// import java.io.PrintWriter;
+
+// import org.junit.After;
+import org.junit.AfterClass;
+// import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.openoffice.test.OfficeConnection;
+import static org.junit.Assert.*;
/**
*
*/
-public class CheckAccessibleStatusBar extends ComplexTestCase {
+public class CheckAccessibleStatusBar {
XInterface testObject = null;
XMultiServiceFactory xMSF = null;
XWindow xWindow = null;
- public String[] getTestMethodNames() {
- return new String[]{"checkDocs"};//WriterDoc", "checkDrawDoc",
-// "checkMathDoc", "checkImpressDoc", "checkCalcDoc"};
- }
+ /**
+ * The test parameters
+ */
+ private static TestParameters param = null;
+
+// public String[] getTestMethodNames() {
+// return new String[]{"checkDocs"};//WriterDoc", "checkDrawDoc",
+//// "checkMathDoc", "checkImpressDoc", "checkCalcDoc"};
+// }
/* public String getTestObjectName() {
return "com.sun.star.awt.AccessibleStatusBar";
}
*/
+ private XMultiServiceFactory getMSF()
+ {
+ final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager());
+ return xMSF1;
+ }
+
+
/**
* Sleeps for 0.5 sec. to allow StarOffice to react on <code>
* reset</code> call.
@@ -76,33 +93,47 @@ public class CheckAccessibleStatusBar extends ComplexTestCase {
try {
Thread.sleep(500) ;
} catch (InterruptedException e) {
- log.println("While waiting :" + e) ;
+ System.out.println("While waiting :" + e) ;
}
}
/**
* Check document types
*/
- public void checkDocs() {
+ @Test public void checkDocs() {
Object doc = param.get("DocType");
String testDocType;
if (doc == null)
+ {
testDocType = "all";
+ }
else
+ {
testDocType = (String)doc;
+ }
System.out.println("Param was " + doc);
System.out.println("DocType " + testDocType);
if (testDocType.equalsIgnoreCase("writer") || testDocType.equalsIgnoreCase("all"))
+ {
checkWriterDoc();
+ }
if (testDocType.equalsIgnoreCase("math") || testDocType.equalsIgnoreCase("all"))
+ {
checkMathDoc();
+ }
if (testDocType.equalsIgnoreCase("draw") || testDocType.equalsIgnoreCase("all"))
+ {
checkDrawDoc();
+ }
if (testDocType.equalsIgnoreCase("impress") || testDocType.equalsIgnoreCase("all"))
+ {
checkImpressDoc();
+ }
if (testDocType.equalsIgnoreCase("calc") || testDocType.equalsIgnoreCase("all"))
+ {
checkCalcDoc();
+ }
}
@@ -110,11 +141,11 @@ public class CheckAccessibleStatusBar extends ComplexTestCase {
* Test the interfaces on a writer document
*/
public void checkWriterDoc() {
- xMSF = (XMultiServiceFactory)param.getMSF();
+ xMSF = getMSF();
SOfficeFactory xSOF = SOfficeFactory.getFactory(xMSF);
XTextDocument xTextDoc = null;
try {
- log.println("****** Open a new writer document");
+ System.out.println("****** Open a new writer document");
xTextDoc = xSOF.createTextDoc("_blank");
getTestObject();
}
@@ -124,7 +155,7 @@ public class CheckAccessibleStatusBar extends ComplexTestCase {
runAllInterfaceTests();
if (xTextDoc != null) {
- XCloseable xClose = (XCloseable)UnoRuntime.queryInterface(XCloseable.class, xTextDoc);
+ XCloseable xClose = UnoRuntime.queryInterface(XCloseable.class, xTextDoc);
try {
xClose.close(false);
}
@@ -138,11 +169,11 @@ public class CheckAccessibleStatusBar extends ComplexTestCase {
* Test the interfaces on a math document
*/
public void checkMathDoc() {
- xMSF = (XMultiServiceFactory)param.getMSF();
+ xMSF = getMSF();
SOfficeFactory xSOF = SOfficeFactory.getFactory(xMSF);
XComponent xMathDoc = null;
try {
- log.println("****** Open a new math document");
+ System.out.println("****** Open a new math document");
xMathDoc = xSOF.createMathDoc("_blank");
getTestObject();
}
@@ -152,7 +183,7 @@ public class CheckAccessibleStatusBar extends ComplexTestCase {
runAllInterfaceTests();
if (xMathDoc != null) {
- XCloseable xClose = (XCloseable)UnoRuntime.queryInterface(XCloseable.class, xMathDoc);
+ XCloseable xClose = UnoRuntime.queryInterface(XCloseable.class, xMathDoc);
try {
xClose.close(false);
}
@@ -166,11 +197,11 @@ public class CheckAccessibleStatusBar extends ComplexTestCase {
* Test the interfaces on a draw document
*/
public void checkDrawDoc() {
- xMSF = (XMultiServiceFactory)param.getMSF();
+ xMSF = getMSF();
SOfficeFactory xSOF = SOfficeFactory.getFactory(xMSF);
XComponent xDrawDoc = null;
try {
- log.println("****** Open a new draw document");
+ System.out.println("****** Open a new draw document");
xDrawDoc = xSOF.createDrawDoc("_blank");
getTestObject();
}
@@ -180,7 +211,7 @@ public class CheckAccessibleStatusBar extends ComplexTestCase {
runAllInterfaceTests();
if (xDrawDoc != null) {
- XCloseable xClose = (XCloseable)UnoRuntime.queryInterface(XCloseable.class, xDrawDoc);
+ XCloseable xClose = UnoRuntime.queryInterface(XCloseable.class, xDrawDoc);
try {
xClose.close(false);
}
@@ -194,11 +225,11 @@ public class CheckAccessibleStatusBar extends ComplexTestCase {
* Test the interfaces on an impress document
*/
public void checkImpressDoc() {
- xMSF = (XMultiServiceFactory)param.getMSF();
+ xMSF = getMSF();
SOfficeFactory xSOF = SOfficeFactory.getFactory(xMSF);
XComponent xImpressDoc = null;
try {
- log.println("****** Open a new impress document");
+ System.out.println("****** Open a new impress document");
xImpressDoc = xSOF.createImpressDoc("_blank");
getTestObject();
}
@@ -208,7 +239,7 @@ public class CheckAccessibleStatusBar extends ComplexTestCase {
runAllInterfaceTests();
if (xImpressDoc != null) {
- XCloseable xClose = (XCloseable)UnoRuntime.queryInterface(XCloseable.class, xImpressDoc);
+ XCloseable xClose = UnoRuntime.queryInterface(XCloseable.class, xImpressDoc);
try {
xClose.close(false);
}
@@ -221,11 +252,11 @@ public class CheckAccessibleStatusBar extends ComplexTestCase {
* Test the interfaces on an calc document
*/
public void checkCalcDoc() {
- xMSF = (XMultiServiceFactory)param.getMSF();
+ xMSF = getMSF();
SOfficeFactory xSOF = SOfficeFactory.getFactory(xMSF);
XSpreadsheetDocument xSpreadsheetDoc = null;
try {
- log.println("****** Open a new calc document");
+ System.out.println("****** Open a new calc document");
xSpreadsheetDoc = xSOF.createCalcDoc("_blank");
shortWait();
getTestObject();
@@ -236,7 +267,7 @@ public class CheckAccessibleStatusBar extends ComplexTestCase {
runAllInterfaceTests();
if (xSpreadsheetDoc != null) {
- XCloseable xClose = (XCloseable)UnoRuntime.queryInterface(XCloseable.class, xSpreadsheetDoc);
+ XCloseable xClose = UnoRuntime.queryInterface(XCloseable.class, xSpreadsheetDoc);
try {
xClose.close(false);
}
@@ -250,32 +281,31 @@ public class CheckAccessibleStatusBar extends ComplexTestCase {
try {
XInterface xIfc = (XInterface) xMSF.createInstance(
"com.sun.star.awt.Toolkit") ;
- XExtendedToolkit tk = (XExtendedToolkit)
- UnoRuntime.queryInterface(XExtendedToolkit.class,xIfc);
+ XExtendedToolkit tk = UnoRuntime.queryInterface(XExtendedToolkit.class, xIfc);
shortWait();
- xWindow = (XWindow)UnoRuntime.queryInterface(
- XWindow.class,tk.getActiveTopWindow());
+ xWindow = UnoRuntime.queryInterface(XWindow.class, tk.getActiveTopWindow());
shortWait();
AccessibilityTools at = new AccessibilityTools();
XAccessible xRoot = at.getAccessibleObject(xWindow);
XAccessibleContext parentContext = null;
- log.println("Get the accessible status bar.");
+ System.out.println("Get the accessible status bar.");
parentContext = at.getAccessibleObjectForRole(
xRoot, AccessibleRole.STATUS_BAR, "");
shortWait();
- log.println("...OK.");
+ System.out.println("...OK.");
- XServiceInfo xSI = (XServiceInfo)UnoRuntime.queryInterface(
- XServiceInfo.class,parentContext);
+ XServiceInfo xSI = UnoRuntime.queryInterface(XServiceInfo.class, parentContext);
String[] services = xSI.getSupportedServiceNames();
- log.println("*****");
- log.println("* Implementation Name: " + xSI.getImplementationName());
+ System.out.println("*****");
+ System.out.println("* Implementation Name: " + xSI.getImplementationName());
for (int i=0; i<services.length; i++)
- log.println("* ServiceName "+i+": "+ services[i]);
- log.println("*****");
+ {
+ System.out.println("* ServiceName " + i + ": " + services[i]);
+ }
+ System.out.println("*****");
testObject=parentContext;
}
catch(com.sun.star.uno.Exception e) {
@@ -288,44 +318,62 @@ public class CheckAccessibleStatusBar extends ComplexTestCase {
}
public void runAllInterfaceTests() {
- log.println("*** Now testing XAccessibleComponent ***");
+ System.out.println("*** Now testing XAccessibleComponent ***");
_XAccessibleComponent _xAccCompTest =
- new _XAccessibleComponent(testObject, log);
- assure("failed: XAccessibleComponent::getBounds", _xAccCompTest._getBounds());
- assure("failed: XAccessibleComponent::contains", _xAccCompTest._containsPoint());
- assure("failed: XAccessibleComponent::getAccessibleAt", _xAccCompTest._getAccessibleAtPoint());
- assure("failed: XAccessibleComponent::getBackground", _xAccCompTest._getBackground());
- assure("failed: XAccessibleComponent::getForeground", _xAccCompTest._getForeground());
- assure("failed: XAccessibleComponent::getLocation", _xAccCompTest._getLocation());
- assure("failed: XAccessibleComponent::getLocationOnScreen", _xAccCompTest._getLocationOnScreen());
- assure("failed: XAccessibleComponent::getSize", _xAccCompTest._getSize());
- assure("failed: XAccessibleComponent::grabFocus", _xAccCompTest._grabFocus());
-
- log.println("*** Now testing XAccessibleContext ***");
+ new _XAccessibleComponent(testObject);
+ assertTrue("failed: XAccessibleComponent::getBounds", _xAccCompTest._getBounds());
+ assertTrue("failed: XAccessibleComponent::contains", _xAccCompTest._containsPoint());
+ assertTrue("failed: XAccessibleComponent::getAccessibleAt", _xAccCompTest._getAccessibleAtPoint());
+ assertTrue("failed: XAccessibleComponent::getBackground", _xAccCompTest._getBackground());
+ assertTrue("failed: XAccessibleComponent::getForeground", _xAccCompTest._getForeground());
+ assertTrue("failed: XAccessibleComponent::getLocation", _xAccCompTest._getLocation());
+ assertTrue("failed: XAccessibleComponent::getLocationOnScreen", _xAccCompTest._getLocationOnScreen());
+ assertTrue("failed: XAccessibleComponent::getSize", _xAccCompTest._getSize());
+ assertTrue("failed: XAccessibleComponent::grabFocus", _xAccCompTest._grabFocus());
+
+ System.out.println("*** Now testing XAccessibleContext ***");
_XAccessibleContext _xAccContext =
- new _XAccessibleContext(testObject, log);
- assure("failed: XAccessibleContext::getAccessibleChildCount", _xAccContext._getAccessibleChildCount());
- assure("failed: XAccessibleContext::getAccessibleChild", _xAccContext._getAccessibleChild());
- assure("failed: XAccessibleContext::getAccessibleDescription", _xAccContext._getAccessibleDescription());
- assure("failed: XAccessibleContext::getAccessibleName", _xAccContext._getAccessibleName());
- assure("failed: XAccessibleContext::getAccessibleParent", _xAccContext._getAccessibleParent());
- assure("failed: XAccessibleContext::getAccessibleIndexInParent", _xAccContext._getAccessibleIndexInParent());
- assure("failed: XAccessibleContext::getAccessibleRelationSet", _xAccContext._getAccessibleRelationSet());
- assure("failed: XAccessibleContext::getAccessibleRole", _xAccContext._getAccessibleRole());
- assure("failed: XAccessibleContext::getAccessibleStateSet", _xAccContext._getAccessibleStateSet());
- assure("failed: XAccessibleContext::getLocale", _xAccContext._getLocale());
-
- log.println("*** Now testing XAccessibleExtendedComponent ***");
+ new _XAccessibleContext(testObject);
+ assertTrue("failed: XAccessibleContext::getAccessibleChildCount", _xAccContext._getAccessibleChildCount());
+ assertTrue("failed: XAccessibleContext::getAccessibleChild", _xAccContext._getAccessibleChild());
+ assertTrue("failed: XAccessibleContext::getAccessibleDescription", _xAccContext._getAccessibleDescription());
+ assertTrue("failed: XAccessibleContext::getAccessibleName", _xAccContext._getAccessibleName());
+ assertTrue("failed: XAccessibleContext::getAccessibleParent", _xAccContext._getAccessibleParent());
+ assertTrue("failed: XAccessibleContext::getAccessibleIndexInParent", _xAccContext._getAccessibleIndexInParent());
+ assertTrue("failed: XAccessibleContext::getAccessibleRelationSet", _xAccContext._getAccessibleRelationSet());
+ assertTrue("failed: XAccessibleContext::getAccessibleRole", _xAccContext._getAccessibleRole());
+ assertTrue("failed: XAccessibleContext::getAccessibleStateSet", _xAccContext._getAccessibleStateSet());
+ assertTrue("failed: XAccessibleContext::getLocale", _xAccContext._getLocale());
+
+ System.out.println("*** Now testing XAccessibleExtendedComponent ***");
_XAccessibleExtendedComponent _xAccExtComp =
- new _XAccessibleExtendedComponent(testObject, log);
- assure("failed: XAccessibleExtendedComponent::getFont", _xAccExtComp._getFont());
- assure("failed: XAccessibleExtendedComponent::getTitledBorderText", _xAccExtComp._getTitledBorderText());
- assure("failed: XAccessibleExtendedComponent::getToolTipText", _xAccExtComp._getToolTipText());
+ new _XAccessibleExtendedComponent(testObject);
+ assertTrue("failed: XAccessibleExtendedComponent::getFont", _xAccExtComp._getFont());
+ assertTrue("failed: XAccessibleExtendedComponent::getTitledBorderText", _xAccExtComp._getTitledBorderText());
+ assertTrue("failed: XAccessibleExtendedComponent::getToolTipText", _xAccExtComp._getToolTipText());
- log.println("*** Now testing XAccessibleEventBroadcaster ***");
+ System.out.println("*** Now testing XAccessibleEventBroadcaster ***");
_XAccessibleEventBroadcaster _xAccEvBcast =
- new _XAccessibleEventBroadcaster(testObject, log, "Pfff", xWindow);
- assure("failed: XAccessibleEventBroadcaster::addEventListener", _xAccEvBcast._addEventListener());
- assure("failed: XAccessibleEventBroadcaster::removeEventListener", _xAccEvBcast._removeEventListener());
+ new _XAccessibleEventBroadcaster(testObject, "Pfff", xWindow);
+ assertTrue("failed: XAccessibleEventBroadcaster::addEventListener", _xAccEvBcast._addEventListener());
+ assertTrue("failed: XAccessibleEventBroadcaster::removeEventListener", _xAccEvBcast._removeEventListener());
}
+
+
+
+
+ @BeforeClass public static void setUpConnection() throws Exception {
+ System.out.println("setUpConnection()");
+ connection.setUp();
+ }
+
+ @AfterClass public static void tearDownConnection()
+ throws InterruptedException, com.sun.star.uno.Exception
+ {
+ System.out.println("tearDownConnection()");
+ connection.tearDown();
+ }
+
+ private static final OfficeConnection connection = new OfficeConnection();
+
}
diff --git a/toolkit/qa/complex/toolkit/CheckAccessibleStatusBarItem.java b/toolkit/qa/complex/toolkit/CheckAccessibleStatusBarItem.java
index 36394732ce78..537654c6aacc 100755
--- a/toolkit/qa/complex/toolkit/CheckAccessibleStatusBarItem.java
+++ b/toolkit/qa/complex/toolkit/CheckAccessibleStatusBarItem.java
@@ -27,18 +27,14 @@
package complex.toolkit;
-import complexlib.ComplexTestCase;
-import util.SOfficeFactory;
-import complexlib.ComplexTestCase;
+// import complexlib.ComplexTestCase;
+import lib.TestParameters;
+// import util.SOfficeFactory;
+// import complexlib.ComplexTestCase;
import util.SOfficeFactory;
import util.AccessibilityTools;
-import complex.toolkit.interface_tests._XAccessibleComponent;
-import complex.toolkit.interface_tests._XAccessibleContext;
-import complex.toolkit.interface_tests._XAccessibleEventBroadcaster;
-import complex.toolkit.interface_tests._XAccessibleExtendedComponent;
-import complex.toolkit.interface_tests._XAccessibleText;
import com.sun.star.awt.XWindow;
-import com.sun.star.chart.XChartDocument;
+// import com.sun.star.chart.XChartDocument;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.lang.XComponent;
import com.sun.star.lang.XServiceInfo;
@@ -51,21 +47,35 @@ import com.sun.star.accessibility.AccessibleRole;
import com.sun.star.accessibility.XAccessible;
import com.sun.star.accessibility.XAccessibleContext;
import com.sun.star.awt.XExtendedToolkit;
-import java.io.PrintWriter;
+// import java.io.PrintWriter;
+
+
+// import org.junit.After;
+import org.junit.AfterClass;
+// import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.openoffice.test.OfficeConnection;
+import static org.junit.Assert.*;
+
/**
*
*/
-public class CheckAccessibleStatusBarItem extends ComplexTestCase {
+public class CheckAccessibleStatusBarItem {
XMultiServiceFactory xMSF = null;
XAccessibleContext testObject = null;
XWindow xWindow = null;
+ /**
+ * The test parameters
+ */
+ private static TestParameters param = null;
- public String[] getTestMethodNames() {
- return new String[]{"checkDocs"};//{"checkWriterDoc", "checkDrawDoc",
-// "checkMathDoc", "checkImpressDoc", "checkCalcDoc"};
- }
+// public String[] getTestMethodNames() {
+// return new String[]{"checkDocs"};//{"checkWriterDoc", "checkDrawDoc",
+//// "checkMathDoc", "checkImpressDoc", "checkCalcDoc"};
+// }
/**
* Sleeps for 0.5 sec. to allow StarOffice to react on <code>
@@ -83,45 +93,67 @@ public class CheckAccessibleStatusBarItem extends ComplexTestCase {
try {
Thread.sleep(500);
} catch (InterruptedException e) {
- log.println("While waiting :" + e) ;
+ System.out.println("While waiting :" + e) ;
}
}
/**
* Check document types
*/
- public void checkDocs() {
+ @Test public void checkDocs()
+ {
+ param = new TestParameters();
Object doc = param.get("DocType");
String testDocType;
if (doc == null)
+ {
testDocType = "all";
+ }
else
+ {
testDocType = (String)doc;
+ }
System.out.println("Param was " + doc);
System.out.println("DocType " + testDocType);
if (testDocType.equalsIgnoreCase("writer") || testDocType.equalsIgnoreCase("all"))
+ {
checkWriterDoc();
+ }
if (testDocType.equalsIgnoreCase("math") || testDocType.equalsIgnoreCase("all"))
+ {
checkMathDoc();
+ }
if (testDocType.equalsIgnoreCase("draw") || testDocType.equalsIgnoreCase("all"))
+ {
checkDrawDoc();
+ }
if (testDocType.equalsIgnoreCase("impress") || testDocType.equalsIgnoreCase("all"))
+ {
checkImpressDoc();
+ }
if (testDocType.equalsIgnoreCase("calc") || testDocType.equalsIgnoreCase("all"))
+ {
checkCalcDoc();
+ }
}
+ private XMultiServiceFactory getMSF()
+ {
+ final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager());
+ return xMSF1;
+ }
+
/**
* Test the interfaces on a writer document
*/
- public void checkWriterDoc() {
- xMSF = (XMultiServiceFactory)param.getMSF();
+ private void checkWriterDoc() {
+ xMSF = getMSF();
SOfficeFactory xSOF = SOfficeFactory.getFactory(xMSF);
XTextDocument xTextDoc = null;
try {
- log.println("****** Open a new writer document");
+ System.out.println("****** Open a new writer document");
xTextDoc = xSOF.createTextDoc("_blank");
getTestObject();
}
@@ -131,7 +163,7 @@ public class CheckAccessibleStatusBarItem extends ComplexTestCase {
runAllInterfaceTests();
if (xTextDoc != null) {
- XCloseable xClose = (XCloseable)UnoRuntime.queryInterface(XCloseable.class, xTextDoc);
+ XCloseable xClose = UnoRuntime.queryInterface(XCloseable.class, xTextDoc);
try {
xClose.close(false);
}
@@ -145,11 +177,11 @@ public class CheckAccessibleStatusBarItem extends ComplexTestCase {
* Test the interfaces on a math document
*/
public void checkMathDoc() {
- xMSF = (XMultiServiceFactory)param.getMSF();
+ xMSF = getMSF();
SOfficeFactory xSOF = SOfficeFactory.getFactory(xMSF);
XComponent xMathDoc = null;
try {
- log.println("****** Open a new math document");
+ System.out.println("****** Open a new math document");
xMathDoc = xSOF.createMathDoc("_blank");
getTestObject();
}
@@ -159,7 +191,7 @@ public class CheckAccessibleStatusBarItem extends ComplexTestCase {
runAllInterfaceTests();
if (xMathDoc != null) {
- XCloseable xClose = (XCloseable)UnoRuntime.queryInterface(XCloseable.class, xMathDoc);
+ XCloseable xClose = UnoRuntime.queryInterface(XCloseable.class, xMathDoc);
try {
xClose.close(false);
}
@@ -173,11 +205,11 @@ public class CheckAccessibleStatusBarItem extends ComplexTestCase {
* Test the interfaces on a draw document
*/
public void checkDrawDoc() {
- xMSF = (XMultiServiceFactory)param.getMSF();
+ xMSF = getMSF();
SOfficeFactory xSOF = SOfficeFactory.getFactory(xMSF);
XComponent xDrawDoc = null;
try {
- log.println("****** Open a new draw document");
+ System.out.println("****** Open a new draw document");
xDrawDoc = xSOF.createDrawDoc("_blank");
getTestObject();
}
@@ -187,7 +219,7 @@ public class CheckAccessibleStatusBarItem extends ComplexTestCase {
runAllInterfaceTests();
if (xDrawDoc != null) {
- XCloseable xClose = (XCloseable)UnoRuntime.queryInterface(XCloseable.class, xDrawDoc);
+ XCloseable xClose = UnoRuntime.queryInterface(XCloseable.class, xDrawDoc);
try {
xClose.close(false);
}
@@ -201,11 +233,11 @@ public class CheckAccessibleStatusBarItem extends ComplexTestCase {
* Test the interfaces on an impress document
*/
public void checkImpressDoc() {
- xMSF = (XMultiServiceFactory)param.getMSF();
+ xMSF = getMSF();
SOfficeFactory xSOF = SOfficeFactory.getFactory(xMSF);
XComponent xImpressDoc = null;
try {
- log.println("****** Open a new impress document");
+ System.out.println("****** Open a new impress document");
xImpressDoc = xSOF.createImpressDoc("_blank");
getTestObject();
}
@@ -215,7 +247,7 @@ public class CheckAccessibleStatusBarItem extends ComplexTestCase {
runAllInterfaceTests();
if (xImpressDoc != null) {
- XCloseable xClose = (XCloseable)UnoRuntime.queryInterface(XCloseable.class, xImpressDoc);
+ XCloseable xClose = UnoRuntime.queryInterface(XCloseable.class, xImpressDoc);
try {
xClose.close(false);
}
@@ -228,11 +260,11 @@ public class CheckAccessibleStatusBarItem extends ComplexTestCase {
* Test the interfaces on an calc document
*/
public void checkCalcDoc() {
- xMSF = (XMultiServiceFactory)param.getMSF();
+ xMSF = getMSF();
SOfficeFactory xSOF = SOfficeFactory.getFactory(xMSF);
XSpreadsheetDocument xSpreadsheetDoc = null;
try {
- log.println("****** Open a new calc document");
+ System.out.println("****** Open a new calc document");
xSpreadsheetDoc = xSOF.createCalcDoc("_blank");
shortWait();
getTestObject();
@@ -243,7 +275,7 @@ public class CheckAccessibleStatusBarItem extends ComplexTestCase {
runAllInterfaceTests();
if (xSpreadsheetDoc != null) {
- XCloseable xClose = (XCloseable)UnoRuntime.queryInterface(XCloseable.class, xSpreadsheetDoc);
+ XCloseable xClose = UnoRuntime.queryInterface(XCloseable.class, xSpreadsheetDoc);
try {
xClose.close(false);
}
@@ -257,11 +289,11 @@ public class CheckAccessibleStatusBarItem extends ComplexTestCase {
try {
XInterface xIfc = (XInterface) xMSF.createInstance(
"com.sun.star.awt.Toolkit") ;
- XExtendedToolkit tk = (XExtendedToolkit)
+ XExtendedToolkit tk =
UnoRuntime.queryInterface(XExtendedToolkit.class,xIfc);
shortWait();
- xWindow = (XWindow)UnoRuntime.queryInterface(
+ xWindow = UnoRuntime.queryInterface(
XWindow.class,tk.getActiveTopWindow());
shortWait();
@@ -269,20 +301,22 @@ public class CheckAccessibleStatusBarItem extends ComplexTestCase {
XAccessible xRoot = at.getAccessibleObject(xWindow);
XAccessibleContext parentContext = null;
- log.println("Get the accessible status bar.");
+ System.out.println("Get the accessible status bar.");
parentContext = at.getAccessibleObjectForRole(
xRoot, AccessibleRole.STATUS_BAR, "");
shortWait();
if ( parentContext == null ) {
- log.println("Could not get the test object: set the correct focus in the next 30 seconds.");
+ System.out.println("Could not get the test object: set the correct focus in the next 30 seconds.");
shortWait(30000);
parentContext = at.getAccessibleObjectForRole(
xRoot, AccessibleRole.STATUS_BAR, "");
if ( parentContext == null )
- failed("Could not create a test object.");
+ {
+ fail("Could not create a test object.");
+ }
}
- log.println("...OK.");
+ System.out.println("...OK.");
testObject=parentContext;
}
@@ -297,10 +331,10 @@ public class CheckAccessibleStatusBarItem extends ComplexTestCase {
public void runAllInterfaceTests() {
int count = testObject.getAccessibleChildCount();
- log.println("*****");
- log.println("**** Found items to test: " + count);
+ System.out.println("*****");
+ System.out.println("**** Found items to test: " + count);
for (int i=0;i<count;i++){
- log.println("**** Now testing StatusBarItem " + i + ".");
+ System.out.println("**** Now testing StatusBarItem " + i + ".");
XAccessible object = null;
try {
object = testObject.getAccessibleChild(i);
@@ -309,77 +343,97 @@ public class CheckAccessibleStatusBarItem extends ComplexTestCase {
System.out.println("* Cannot get item Nr: " + i);
continue;
}
- XServiceInfo xSI = (XServiceInfo)UnoRuntime.queryInterface(
+ XServiceInfo xSI = UnoRuntime.queryInterface(
XServiceInfo.class,object);
String[] services = xSI.getSupportedServiceNames();
- log.println("* Implementation Name: " + xSI.getImplementationName());
+ System.out.println("* Implementation Name: " + xSI.getImplementationName());
String accName = object.getAccessibleContext().getAccessibleName();
- log.println("* Accessible Name: " + accName);
+ System.out.println("* Accessible Name: " + accName);
for (int j=0; i<services.length; i++)
- log.println("* ServiceName "+i+": "+ services[j]);
- log.println("*****");
+ {
+ System.out.println("* ServiceName "+i+": "+ services[j]);
+ }
+ System.out.println("*****");
- log.println("*** Now testing XAccessibleComponent ***");
+ System.out.println("*** Now testing XAccessibleComponent ***");
_XAccessibleComponent _xAccCompTest =
- new _XAccessibleComponent(object, log);
- assure("failed: "+accName+" - XAccessibleComponent::getBounds", _xAccCompTest._getBounds(), true);
- assure("failed: "+accName+" - XAccessibleComponent::contains", _xAccCompTest._containsPoint(), true);
- assure("failed: "+accName+" - XAccessibleComponent::getAccessibleAt", _xAccCompTest._getAccessibleAtPoint(), true);
- assure("failed: "+accName+" - XAccessibleComponent::getBackground", _xAccCompTest._getBackground(), true);
- assure("failed: "+accName+" - XAccessibleComponent::getForeground", _xAccCompTest._getForeground(), true);
- assure("failed: "+accName+" - XAccessibleComponent::getLocation", _xAccCompTest._getLocation(), true);
- assure("failed: "+accName+" - XAccessibleComponent::getLocationOnScreen", _xAccCompTest._getLocationOnScreen(), true);
- assure("failed: "+accName+" - XAccessibleComponent::getSize", _xAccCompTest._getSize(), true);
- assure("failed: "+accName+" - XAccessibleComponent::grabFocus", _xAccCompTest._grabFocus(), true);
-
- log.println("*** Now testing XAccessibleContext ***");
+ new _XAccessibleComponent(object);
+ assertTrue("failed: "+accName+" - XAccessibleComponent::getBounds", _xAccCompTest._getBounds());
+ assertTrue("failed: "+accName+" - XAccessibleComponent::contains", _xAccCompTest._containsPoint());
+ assertTrue("failed: "+accName+" - XAccessibleComponent::getAccessibleAt", _xAccCompTest._getAccessibleAtPoint());
+ assertTrue("failed: "+accName+" - XAccessibleComponent::getBackground", _xAccCompTest._getBackground());
+ assertTrue("failed: "+accName+" - XAccessibleComponent::getForeground", _xAccCompTest._getForeground());
+ assertTrue("failed: "+accName+" - XAccessibleComponent::getLocation", _xAccCompTest._getLocation());
+ assertTrue("failed: "+accName+" - XAccessibleComponent::getLocationOnScreen", _xAccCompTest._getLocationOnScreen());
+ assertTrue("failed: "+accName+" - XAccessibleComponent::getSize", _xAccCompTest._getSize());
+ assertTrue("failed: "+accName+" - XAccessibleComponent::grabFocus", _xAccCompTest._grabFocus());
+
+ System.out.println("*** Now testing XAccessibleContext ***");
_XAccessibleContext _xAccContext =
- new _XAccessibleContext(object, log);
- assure("failed: "+accName+" - XAccessibleContext::getAccessibleChildCount", _xAccContext._getAccessibleChildCount(), true);
- assure("failed: "+accName+" - XAccessibleContext::getAccessibleChild", _xAccContext._getAccessibleChild(), true);
- assure("failed: "+accName+" - XAccessibleContext::getAccessibleDescription", _xAccContext._getAccessibleDescription(), true);
- assure("failed: "+accName+" - XAccessibleContext::getAccessibleName", _xAccContext._getAccessibleName(), true);
- assure("failed: "+accName+" - XAccessibleContext::getAccessibleParent", _xAccContext._getAccessibleParent(), true);
- assure("failed: "+accName+" - XAccessibleContext::getAccessibleIndexInParent", _xAccContext._getAccessibleIndexInParent(), true);
- assure("failed: "+accName+" - XAccessibleContext::getAccessibleRelationSet", _xAccContext._getAccessibleRelationSet(), true);
- assure("failed: "+accName+" - XAccessibleContext::getAccessibleRole", _xAccContext._getAccessibleRole(), true);
- assure("failed: "+accName+" - XAccessibleContext::getAccessibleStateSet", _xAccContext._getAccessibleStateSet(), true);
- assure("failed: "+accName+" - XAccessibleContext::getLocale", _xAccContext._getLocale(), true);
-
- log.println("*** Now testing XAccessibleExtendedComponent ***");
+ new _XAccessibleContext(object);
+ assertTrue("failed: "+accName+" - XAccessibleContext::getAccessibleChildCount", _xAccContext._getAccessibleChildCount());
+ assertTrue("failed: "+accName+" - XAccessibleContext::getAccessibleChild", _xAccContext._getAccessibleChild());
+ assertTrue("failed: "+accName+" - XAccessibleContext::getAccessibleDescription", _xAccContext._getAccessibleDescription());
+ assertTrue("failed: "+accName+" - XAccessibleContext::getAccessibleName", _xAccContext._getAccessibleName());
+ assertTrue("failed: "+accName+" - XAccessibleContext::getAccessibleParent", _xAccContext._getAccessibleParent());
+ assertTrue("failed: "+accName+" - XAccessibleContext::getAccessibleIndexInParent", _xAccContext._getAccessibleIndexInParent());
+ assertTrue("failed: "+accName+" - XAccessibleContext::getAccessibleRelationSet", _xAccContext._getAccessibleRelationSet());
+ assertTrue("failed: "+accName+" - XAccessibleContext::getAccessibleRole", _xAccContext._getAccessibleRole());
+ assertTrue("failed: "+accName+" - XAccessibleContext::getAccessibleStateSet", _xAccContext._getAccessibleStateSet());
+ assertTrue("failed: "+accName+" - XAccessibleContext::getLocale", _xAccContext._getLocale());
+
+ System.out.println("*** Now testing XAccessibleExtendedComponent ***");
_XAccessibleExtendedComponent _xAccExtComp =
- new _XAccessibleExtendedComponent(object, log);
- assure("failed: "+accName+" - XAccessibleExtendedComponent::getFont", _xAccExtComp._getFont(), true);
- assure("failed: "+accName+" - XAccessibleExtendedComponent::getTitledBorderText", _xAccExtComp._getTitledBorderText(), true);
- assure("failed: "+accName+" - XAccessibleExtendedComponent::getToolTipText", _xAccExtComp._getToolTipText(), true);
+ new _XAccessibleExtendedComponent(object);
+ assertTrue("failed: "+accName+" - XAccessibleExtendedComponent::getFont", _xAccExtComp._getFont());
+ assertTrue("failed: "+accName+" - XAccessibleExtendedComponent::getTitledBorderText", _xAccExtComp._getTitledBorderText());
+ assertTrue("failed: "+accName+" - XAccessibleExtendedComponent::getToolTipText", _xAccExtComp._getToolTipText());
- log.println("*** Now testing XAccessibleEventBroadcaster ***");
+ System.out.println("*** Now testing XAccessibleEventBroadcaster ***");
_XAccessibleEventBroadcaster _xAccEvBcast =
- new _XAccessibleEventBroadcaster(object, log, "Pfff", xWindow);
- assure("failed: "+accName+" - XAccessibleEventBroadcaster::addEventListener", _xAccEvBcast._addEventListener(), true);
- assure("failed: "+accName+" - XAccessibleEventBroadcaster::removeEventListener", _xAccEvBcast._removeEventListener(), true);
+ new _XAccessibleEventBroadcaster(object, "Pfff", xWindow);
+ assertTrue("failed: "+accName+" - XAccessibleEventBroadcaster::addEventListener", _xAccEvBcast._addEventListener());
+ assertTrue("failed: "+accName+" - XAccessibleEventBroadcaster::removeEventListener", _xAccEvBcast._removeEventListener());
- log.println("*** Now testing XAccessibleText ***");
+ System.out.println("*** Now testing XAccessibleText ***");
_XAccessibleText _xAccText =
- new _XAccessibleText(object, log, xMSF, "true");
- assure("failed: "+accName+" - XAccessibleText::getText", _xAccText._getText(), true);
- assure("failed: "+accName+" - XAccessibleText::getCharacterCount", _xAccText._getCharacterCount(), true);
- assure("failed: "+accName+" - XAccessibleText::getCharacterBounds", _xAccText._getCharacterBounds(), true);
- assure("failed: "+accName+" - XAccessibleText::setSelection", _xAccText._setSelection(), true);
- assure("failed: "+accName+" - XAccessibleText::copyText", _xAccText._copyText(), true);
- assure("failed: "+accName+" - XAccessibleText::getCharacter", _xAccText._getCharacter(), true);
- assure("failed: "+accName+" - XAccessibleText::getCharacterAttributes", _xAccText._getCharacterAttributes(), true);
- assure("failed: "+accName+" - XAccessibleText::getIndexAtPoint", _xAccText._getIndexAtPoint(), true);
- assure("failed: "+accName+" - XAccessibleText::getSelectedText", _xAccText._getSelectedText(), true);
- assure("failed: "+accName+" - XAccessibleText::getSelectionEnd", _xAccText._getSelectionEnd(), true);
- assure("failed: "+accName+" - XAccessibleText::getSelectionStart", _xAccText._getSelectionStart(), true);
- assure("failed: "+accName+" - XAccessibleText::getTextAtIndex", _xAccText._getTextAtIndex(), true);
- assure("failed: "+accName+" - XAccessibleText::getTextBeforeIndex", _xAccText._getTextBeforeIndex(), true);
- assure("failed: "+accName+" - XAccessibleText::getBehindIndex", _xAccText._getTextBehindIndex(), true);
- assure("failed: "+accName+" - XAccessibleText::getTextRange", _xAccText._getTextRange(), true);
- assure("failed: "+accName+" - XAccessibleText::setCaretPosition", _xAccText._setCaretPosition(), true);
- assure("failed: "+accName+" - XAccessibleText::getCaretPosition", _xAccText._getCaretPosition(), true);
+ new _XAccessibleText(object, xMSF, "true");
+ assertTrue("failed: "+accName+" - XAccessibleText::getText", _xAccText._getText());
+ assertTrue("failed: "+accName+" - XAccessibleText::getCharacterCount", _xAccText._getCharacterCount());
+ assertTrue("failed: "+accName+" - XAccessibleText::getCharacterBounds", _xAccText._getCharacterBounds());
+ assertTrue("failed: "+accName+" - XAccessibleText::setSelection", _xAccText._setSelection());
+ assertTrue("failed: "+accName+" - XAccessibleText::copyText", _xAccText._copyText());
+ assertTrue("failed: "+accName+" - XAccessibleText::getCharacter", _xAccText._getCharacter());
+ assertTrue("failed: "+accName+" - XAccessibleText::getCharacterAttributes", _xAccText._getCharacterAttributes());
+ assertTrue("failed: "+accName+" - XAccessibleText::getIndexAtPoint", _xAccText._getIndexAtPoint());
+ assertTrue("failed: "+accName+" - XAccessibleText::getSelectedText", _xAccText._getSelectedText());
+ assertTrue("failed: "+accName+" - XAccessibleText::getSelectionEnd", _xAccText._getSelectionEnd());
+ assertTrue("failed: "+accName+" - XAccessibleText::getSelectionStart", _xAccText._getSelectionStart());
+ assertTrue("failed: "+accName+" - XAccessibleText::getTextAtIndex", _xAccText._getTextAtIndex());
+ assertTrue("failed: "+accName+" - XAccessibleText::getTextBeforeIndex", _xAccText._getTextBeforeIndex());
+ assertTrue("failed: "+accName+" - XAccessibleText::getBehindIndex", _xAccText._getTextBehindIndex());
+ assertTrue("failed: "+accName+" - XAccessibleText::getTextRange", _xAccText._getTextRange());
+ assertTrue("failed: "+accName+" - XAccessibleText::setCaretPosition", _xAccText._setCaretPosition());
+ assertTrue("failed: "+accName+" - XAccessibleText::getCaretPosition", _xAccText._getCaretPosition());
}
}
+
+
+
+ @BeforeClass public static void setUpConnection() throws Exception {
+ System.out.println("setUpConnection()");
+ connection.setUp();
+ }
+
+ @AfterClass public static void tearDownConnection()
+ throws InterruptedException, com.sun.star.uno.Exception
+ {
+ System.out.println("tearDownConnection()");
+ connection.tearDown();
+ }
+
+ private static final OfficeConnection connection = new OfficeConnection();
+
+
}
diff --git a/toolkit/qa/complex/toolkit/CheckAsyncCallback.java b/toolkit/qa/complex/toolkit/CheckAsyncCallback.java
index cc184f3c1a73..3a1e51729f11 100644
--- a/toolkit/qa/complex/toolkit/CheckAsyncCallback.java
+++ b/toolkit/qa/complex/toolkit/CheckAsyncCallback.java
@@ -27,36 +27,49 @@
package complex.toolkit;
-import complexlib.ComplexTestCase;
+// import complexlib.ComplexTestCase;
import util.SOfficeFactory;
-import complex.toolkit.interface_tests._XRequestCallback;
-import complex.toolkit.CallbackClass;
+// import complex.toolkit.CallbackClass;
import com.sun.star.awt.XRequestCallback;
import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.lang.XComponent;
-import com.sun.star.lang.XServiceInfo;
+// import com.sun.star.lang.XComponent;
+// import com.sun.star.lang.XServiceInfo;
import com.sun.star.uno.XInterface;
import com.sun.star.uno.UnoRuntime;
-import com.sun.star.awt.XExtendedToolkit;
-import java.io.PrintWriter;
+// import com.sun.star.awt.XExtendedToolkit;
+// import java.io.PrintWriter;
+
+// import org.junit.After;
+import org.junit.AfterClass;
+// import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.openoffice.test.OfficeConnection;
+import static org.junit.Assert.*;
/**
*
*/
-public class CheckAsyncCallback extends ComplexTestCase {
+public class CheckAsyncCallback /* extends ComplexTestCase*/ {
XInterface testObject = null;
XMultiServiceFactory xMSF = null;
- public String[] getTestMethodNames() {
- return new String[]{"checkService"};
- }
+// public String[] getTestMethodNames() {
+// return new String[]{"checkService"};
+// }
/* public String getTestObjectName() {
return "com.sun.star.awt.AccessibleStatusBar";
}
*/
+ private XMultiServiceFactory getMSF()
+ {
+ final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager());
+ return xMSF1;
+ }
+
/**
* Sleeps for 0.5 sec. to allow StarOffice to react on <code>
* reset</code> call.
@@ -65,14 +78,14 @@ public class CheckAsyncCallback extends ComplexTestCase {
try {
Thread.sleep(500) ;
} catch (InterruptedException e) {
- log.println("While waiting :" + e) ;
+ System.out.println("While waiting :" + e) ;
}
}
/**
* Check services
*/
- public void checkService() {
+ @Test public void checkService() {
checkAsyncCallbackService();
}
@@ -86,15 +99,14 @@ public class CheckAsyncCallback extends ComplexTestCase {
public void getTestObject() {
try {
- xMSF = (XMultiServiceFactory)param.getMSF();
+ xMSF = getMSF();
SOfficeFactory xSOF = SOfficeFactory.getFactory(xMSF);
XRequestCallback xAsyncCallback = null;
XInterface xIfc = (XInterface)xMSF.createInstance(
"com.sun.star.awt.AsyncCallback" );
- xAsyncCallback = (XRequestCallback)
- UnoRuntime.queryInterface(XRequestCallback.class,xIfc);
+ xAsyncCallback = UnoRuntime.queryInterface(XRequestCallback.class, xIfc);
testObject=xAsyncCallback;
}
@@ -109,19 +121,36 @@ public class CheckAsyncCallback extends ComplexTestCase {
public void runAllInterfaceTests() {
getTestObject();
- log.println("*** Now testing XRequestCallback ***");
+ System.out.println("*** Now testing XRequestCallback ***");
_XRequestCallback _xRequestCallback =
- new _XRequestCallback(testObject, log, xMSF );
- assure("failed: XRequestCallback::addCallback", _xRequestCallback._addCallback());
+ new _XRequestCallback(testObject, xMSF );
+ assertTrue("failed: XRequestCallback::addCallback", _xRequestCallback._addCallback());
}
public void checkCallback() {
getTestObject();
- log.println("*** Now testing asynchronous callback service ***");
+ System.out.println("*** Now testing asynchronous callback service ***");
XRequestCallback xAsyncCallback = null;
- xAsyncCallback = (XRequestCallback)
- UnoRuntime.queryInterface( XRequestCallback.class, testObject );
- CallbackClass aCallbackClass = new CallbackClass( log, xMSF );
+ xAsyncCallback = UnoRuntime.queryInterface(XRequestCallback.class, testObject);
+ CallbackClass aCallbackClass = new CallbackClass( xMSF );
xAsyncCallback.addCallback( aCallbackClass, null );
}
+
+
+
+ @BeforeClass public static void setUpConnection() throws Exception {
+ System.out.println("setUpConnection()");
+ connection.setUp();
+ }
+
+ @AfterClass public static void tearDownConnection()
+ throws InterruptedException, com.sun.star.uno.Exception
+ {
+ System.out.println("tearDownConnection()");
+ connection.tearDown();
+ }
+
+ private static final OfficeConnection connection = new OfficeConnection();
+
+
}
diff --git a/toolkit/qa/complex/toolkit/interface_tests/_XAccessibleComponent.java b/toolkit/qa/complex/toolkit/_XAccessibleComponent.java
index e3d80629be40..ae3e293e50fc 100755
--- a/toolkit/qa/complex/toolkit/interface_tests/_XAccessibleComponent.java
+++ b/toolkit/qa/complex/toolkit/_XAccessibleComponent.java
@@ -25,9 +25,9 @@
*
************************************************************************/
-package complex.toolkit.interface_tests;
+package complex.toolkit;
-import share.LogWriter;
+// import share.LogWriter;
import com.sun.star.awt.Point;
import com.sun.star.awt.Rectangle;
import com.sun.star.awt.Size;
@@ -56,7 +56,7 @@ import java.util.Vector;
*/
public class _XAccessibleComponent {
- private LogWriter log;
+ // private LogWriter log;
public XAccessibleComponent oObj = null;
@@ -67,11 +67,12 @@ public class _XAccessibleComponent {
/**
* Constructor
+ * @param object
*/
- public _XAccessibleComponent(XInterface object, LogWriter log) {
- oObj = (XAccessibleComponent)UnoRuntime.queryInterface(
+ public _XAccessibleComponent(XInterface object/*, LogWriter log*/) {
+ oObj = UnoRuntime.queryInterface(
XAccessibleComponent.class, object);
- this.log = log;
+ // this.log = log;
}
/**
@@ -87,7 +88,8 @@ public class _XAccessibleComponent {
* <ul>
* <li> <code> getBounds() </code> : to have size of a component.</li>
* </ul>
- */
+ * @return
+ */
public boolean _containsPoint() {
boolean result = true ;
@@ -96,13 +98,13 @@ public class _XAccessibleComponent {
//while (!oObj.containsPoint(new Point(curX, bounds.Y)) && curX < bounds.Width+bounds.X) {
while (!oObj.containsPoint(new Point(curX, 0)) && curX < bounds.Width) {
curX++;
- };
+ }
//if ((bounds.X <= curX) && (curX < bounds.Width+bounds.X)) {
if (curX < bounds.Width) {
- log.println("Upper bound of box contains point ("
+ System.out.println("Upper bound of box contains point ("
+ curX + ",0) - OK");
} else {
- log.println
+ System.out.println
("Upper bound of box contains no component points - FAILED");
result = false;
}
@@ -112,15 +114,15 @@ public class _XAccessibleComponent {
while (!oObj.containsPoint(new Point(curX, bounds.Height - 1))
&& curX < bounds.Width) {
- log.println("Contains returns false for ("+curX+","+bounds.Height+")");
+ System.out.println("Contains returns false for ("+curX+","+bounds.Height+")");
curX++;
- };
+ }
//if ((bounds.X <= curX) && (curX < bounds.Width+bounds.X)) {
if (curX < bounds.Width) {
- log.println("Lower bound of box contains point ("
+ System.out.println("Lower bound of box contains point ("
+ curX + "," + (bounds.Height - 1) + ") - OK");
} else {
- log.println
+ System.out.println
("Lower bound of box contains no component points - FAILED");
result = false;
}
@@ -129,13 +131,13 @@ public class _XAccessibleComponent {
//while (!oObj.containsPoint(new Point(bounds.X, curY)) && curY < bounds.Height+bounds.Y) {
while (!oObj.containsPoint(new Point(0, curY)) && curY < bounds.Height) {
curY++;
- };
+ }
//if ((bounds.Y <= curY) && (curY < bounds.Height+bounds.Y)) {
if (curY < bounds.Height) {
- log.println("Left bound of box contains point (0,"
+ System.out.println("Left bound of box contains point (0,"
+ curY + ") - OK");
} else {
- log.println
+ System.out.println
("Left bound of box contains no component points - FAILED");
result = false;
}
@@ -145,13 +147,13 @@ public class _XAccessibleComponent {
// && curY < bounds.Height+bounds.Y) {
while (!oObj.containsPoint(new Point(bounds.Width - 1, curY)) && curY < bounds.Height) {
curY++;
- };
+ }
//if ((bounds.Y <= curY) && (curY < bounds.Height + bounds.Y)) {
if (curY < bounds.Height) {
- log.println("Right bound of box contains point ("
+ System.out.println("Right bound of box contains point ("
+ (bounds.Width - 1) + "," + curY + ") - OK");
} else {
- log.println
+ System.out.println
("Right bound of box contains no component points - FAILED");
result = false;
}
@@ -162,10 +164,10 @@ public class _XAccessibleComponent {
locRes &= !oObj.containsPoint(new Point(x, bounds.Height+bounds.Y));
}
if (locRes) {
- log.println("Outer upper and lower bounds contain no component "
+ System.out.println("Outer upper and lower bounds contain no component "
+ "points - OK");
} else {
- log.println("Outer upper and lower bounds CONTAIN some component "
+ System.out.println("Outer upper and lower bounds CONTAIN some component "
+ "points - FAILED");
result = false;
}
@@ -176,10 +178,10 @@ public class _XAccessibleComponent {
locRes &= !oObj.containsPoint(new Point(bounds.X+bounds.Width, y));
}
if (locRes) {
- log.println("Outer left and right bounds contain no component "
+ System.out.println("Outer left and right bounds contain no component "
+ "points - OK");
} else {
- log.println("Outer left and right bounds CONTAIN some component "
+ System.out.println("Outer left and right bounds CONTAIN some component "
+ "points - FAILED");
result = false;
}
@@ -198,6 +200,7 @@ public class _XAccessibleComponent {
* Has <b> OK </b> status if in the first cases the right children
* are returned, and in the second <code>null</code> or
* another child is returned.
+ * @return
*/
public boolean _getAccessibleAtPoint() {
@@ -207,23 +210,26 @@ public class _XAccessibleComponent {
if (children.length > 0) {
for (int i = 0; i < children.length; i++) {
Rectangle chBnd = children[i].getBounds();
- if (chBnd.X == -1) continue;
- log.println("Checking child with bounds " +
+ if (chBnd.X == -1)
+ {
+ continue;
+ }
+ System.out.println("Checking child with bounds " +
"(" + chBnd.X + "," + chBnd.Y + "),("
+ chBnd.Width + "," + chBnd.Height + "): "
+ util.AccessibilityTools.accessibleToString(children[i]));
- log.println("finding the point which lies on the component");
+ System.out.println("finding the point which lies on the component");
int curX = 0;
int curY = 0;
while (!children[i].containsPoint(new Point(curX, curY))
&& curX < chBnd.Width) {
curX++;
curY++;
- };
+ }
if (curX==chBnd.Width) {
- log.println("Couldn't find a point with contains");
+ System.out.println("Couldn't find a point with contains");
continue;
}
@@ -231,29 +237,29 @@ public class _XAccessibleComponent {
XAccessible xAcc = oObj.getAccessibleAtPoint
(new Point(chBnd.X , chBnd.Y));
if (xAcc == null) {
- log.println("The child not found at point ("
+ System.out.println("The child not found at point ("
+ (chBnd.X ) + "," + chBnd.Y + ") - FAILED");
result = false;
} else {
- XAccessible xAccCh = (XAccessible) UnoRuntime.queryInterface
+ XAccessible xAccCh = UnoRuntime.queryInterface
(XAccessible.class, children[i]);
- log.println("Child found at point ("
+ System.out.println("Child found at point ("
+ (chBnd.X ) + "," + chBnd.Y + ") - OK");
boolean res = util.AccessibilityTools.equals(xAccCh, xAcc);
if (!res) {
int expIndex = xAccCh.getAccessibleContext().getAccessibleIndexInParent();
int gotIndex = xAcc.getAccessibleContext().getAccessibleIndexInParent();
if (expIndex < gotIndex) {
- log.println("The children found is not the same");
- log.println("The expected child " +
+ System.out.println("The children found is not the same");
+ System.out.println("The expected child " +
xAccCh.getAccessibleContext().getAccessibleName());
- log.println("is hidden behind the found Child ");
- log.println(xAcc.getAccessibleContext().getAccessibleName()+" - OK");
+ System.out.println("is hidden behind the found Child ");
+ System.out.println(xAcc.getAccessibleContext().getAccessibleName()+" - OK");
} else {
- log.println("The children found is not the same - FAILED");
- log.println("Expected: "
+ System.out.println("The children found is not the same - FAILED");
+ System.out.println("Expected: "
+xAccCh.getAccessibleContext().getAccessibleName());
- log.println("Found: "
+ System.out.println("Found: "
+xAcc.getAccessibleContext().getAccessibleName());
result = false ;
}
@@ -264,22 +270,21 @@ public class _XAccessibleComponent {
xAcc = oObj.getAccessibleAtPoint
(new Point(chBnd.X - 1, chBnd.Y - 1));
if (xAcc == null) {
- log.println("No children found at point ("
+ System.out.println("No children found at point ("
+ (chBnd.X - 1) + "," + (chBnd.Y - 1) + ") - OK");
result &= true;
} else {
- XAccessible xAccCh = (XAccessible) UnoRuntime.queryInterface
- (XAccessible.class, children[i]);
+ XAccessible xAccCh = UnoRuntime.queryInterface(XAccessible.class, children[i]);
boolean res = util.AccessibilityTools.equals(xAccCh, xAcc);
if (res) {
- log.println("The same child found outside "
+ System.out.println("The same child found outside "
+ "its bounds - FAILED");
result = false ;
}
}
}
} else {
- log.println("There are no children supporting "
+ System.out.println("There are no children supporting "
+ "XAccessibleComponent");
}
@@ -291,6 +296,7 @@ public class _XAccessibleComponent {
*
* Has <b> OK </b> status if boundary position (x,y) is not negative
* and size (Width, Height) is greater than 0.
+ * @return
*/
public boolean _getBounds() {
boolean result = true ;
@@ -300,7 +306,7 @@ public class _XAccessibleComponent {
&& bounds.X >=0 && bounds.Y >=0
&& bounds.Width >0 && bounds.Height >0;
- log.println("Bounds = " + (bounds != null
+ System.out.println("Bounds = " + (bounds != null
? "(" + bounds.X + "," + bounds.Y + "),("
+ bounds.Width + "," + bounds.Height + ")" : "null"));
@@ -317,6 +323,7 @@ public class _XAccessibleComponent {
* <ul>
* <li> <code> getBounds() </code> : to have bounds </li>
* </ul>
+ * @return
*/
public boolean _getLocation() {
@@ -341,6 +348,7 @@ public class _XAccessibleComponent {
* <li> <code> getBounds() </code> : to have location of the component
* relative to its parent</li>
* </ul>
+ * @return
*/
public boolean _getLocationOnScreen() {
@@ -348,11 +356,11 @@ public class _XAccessibleComponent {
boolean result = true ;
Point loc = oObj.getLocationOnScreen();
- log.println("Location is (" + loc.X + "," + loc.Y + ")");
+ System.out.println("Location is (" + loc.X + "," + loc.Y + ")");
if (parent != null) {
Point parLoc = parent.getLocationOnScreen();
- log.println("Parent location is ("
+ System.out.println("Parent location is ("
+ parLoc.X + "," + parLoc.Y + ")");
result &= parLoc.X + bounds.X == loc.X;
@@ -371,6 +379,7 @@ public class _XAccessibleComponent {
* <ul>
* <li> <code> getBounds() </code> </li>
* </ul>
+ * @return
*/
public boolean _getSize() {
@@ -387,6 +396,7 @@ public class _XAccessibleComponent {
* Just calls the method. <p>
*
* Has <b> OK </b> status if no runtime exceptions occured.
+ * @return
*/
public boolean _grabFocus() {
@@ -404,26 +414,26 @@ public class _XAccessibleComponent {
* such children were not found or some error occured.
*/
private XAccessibleComponent[] getChildrenComponents() {
- XAccessible xAcc = (XAccessible) UnoRuntime.queryInterface
- (XAccessible.class, oObj) ;
+ XAccessible xAcc = UnoRuntime.queryInterface(XAccessible.class, oObj) ;
if (xAcc == null) {
- log.println("Component doesn't support XAccessible.");
+ System.out.println("Component doesn't support XAccessible.");
return new XAccessibleComponent[0];
}
XAccessibleContext xAccCon = xAcc.getAccessibleContext();
int cnt = xAccCon.getAccessibleChildCount();
// for cases when too many children exist checking only first 50
- if (cnt > 50) cnt = 50 ;
+ if (cnt > 50)
+ {
+ cnt = 50;
+ }
Vector childComp = new Vector();
for (int i = 0; i < cnt; i++) {
try {
XAccessible child = xAccCon.getAccessibleChild(i);
XAccessibleContext xAccConCh = child.getAccessibleContext();
- XAccessibleComponent xChAccComp = (XAccessibleComponent)
- UnoRuntime.queryInterface(XAccessibleComponent.class,
- xAccConCh);
+ XAccessibleComponent xChAccComp = UnoRuntime.queryInterface(XAccessibleComponent.class, xAccConCh);
if (xChAccComp != null) {
childComp.add(xChAccComp) ;
}
@@ -442,10 +452,9 @@ public class _XAccessibleComponent {
* has no parent or some errors occured.
*/
private XAccessibleComponent getParentComponent() {
- XAccessible xAcc = (XAccessible) UnoRuntime.queryInterface
- (XAccessible.class, oObj) ;
+ XAccessible xAcc = UnoRuntime.queryInterface(XAccessible.class, oObj) ;
if (xAcc == null) {
- log.println("Component doesn't support XAccessible.");
+ System.out.println("Component doesn't support XAccessible.");
return null;
}
@@ -453,14 +462,13 @@ public class _XAccessibleComponent {
XAccessible xAccPar = xAccCon.getAccessibleParent();
if (xAccPar == null) {
- log.println("Component has no accessible parent.");
+ System.out.println("Component has no accessible parent.");
return null;
}
XAccessibleContext xAccConPar = xAccPar.getAccessibleContext();
- XAccessibleComponent parent = (XAccessibleComponent)
- UnoRuntime.queryInterface(XAccessibleComponent.class, xAccConPar);
+ XAccessibleComponent parent = UnoRuntime.queryInterface(XAccessibleComponent.class, xAccConPar);
if (parent == null) {
- log.println
+ System.out.println
("Accessible parent doesn't support XAccessibleComponent");
return null;
}
@@ -470,19 +478,21 @@ public class _XAccessibleComponent {
/**
* Just calls the method.
+ * @return
*/
public boolean _getForeground() {
int forColor = oObj.getForeground();
- log.println("getForeground(): " + forColor);
+ System.out.println("getForeground(): " + forColor);
return true;
}
/**
* Just calls the method.
+ * @return
*/
public boolean _getBackground() {
int backColor = oObj.getBackground();
- log.println("getBackground(): " + backColor);
+ System.out.println("getBackground(): " + backColor);
return true;
}
diff --git a/toolkit/qa/complex/toolkit/interface_tests/_XAccessibleContext.java b/toolkit/qa/complex/toolkit/_XAccessibleContext.java
index 230eb3d098d3..de2928fdabe3 100755
--- a/toolkit/qa/complex/toolkit/interface_tests/_XAccessibleContext.java
+++ b/toolkit/qa/complex/toolkit/_XAccessibleContext.java
@@ -25,7 +25,7 @@
*
************************************************************************/
-package complex.toolkit.interface_tests;
+package complex.toolkit;
import com.sun.star.lang.Locale;
import com.sun.star.uno.XInterface;
@@ -35,9 +35,9 @@ import com.sun.star.accessibility.XAccessible;
import com.sun.star.accessibility.XAccessibleContext;
import com.sun.star.accessibility.XAccessibleRelationSet;
import com.sun.star.accessibility.XAccessibleStateSet;
-import com.sun.star.accessibility.AccessibleRelationType;
+// import com.sun.star.accessibility.AccessibleRelationType;
import util.AccessibilityTools;
-import share.LogWriter;
+// import share.LogWriter;
/**
* Testing <code>com.sun.star.accessibility.XAccessibleContext</code>
@@ -59,7 +59,7 @@ import share.LogWriter;
*/
public class _XAccessibleContext {
- private LogWriter log;
+ // private LogWriter log;
private static final String className =
"com.sun.star.accessibility.XAccessibleContext" ;
@@ -69,19 +69,19 @@ public class _XAccessibleContext {
private int childCount = 0;
private XAccessible parent = null ;
- public _XAccessibleContext(XInterface object, LogWriter log) {
- oObj = (XAccessibleContext)UnoRuntime.queryInterface(
- XAccessibleContext.class, object);
- this.log = log;
+ public _XAccessibleContext(XInterface object) {
+ oObj = UnoRuntime.queryInterface(XAccessibleContext.class, object);
+ // this.log = log;
}
/**
* Calls the method and stores the number of children. <p>
* Has <b> OK </b> status if non-negative number rutrned.
+ * @return
*/
public boolean _getAccessibleChildCount() {
childCount = oObj.getAccessibleChildCount();
- log.println("" + childCount + " children found.");
+ System.out.println("" + childCount + " children found.");
return childCount > -1;
}
@@ -96,40 +96,44 @@ public class _XAccessibleContext {
* <li> <code> getAccessibleChildCount() </code> : to have a number of
* children </li>
* </ul>
+ * @return
*/
public boolean _getAccessibleChild() {
boolean bOK = true;
int counter = childCount;
- if (childCount > 500) counter = 500;
+ if (childCount > 500)
+ {
+ counter = 500;
+ }
for (int i = 0; i < counter; i++) {
try {
XAccessible ch = oObj.getAccessibleChild(i) ;
XAccessibleContext chAC = ch.getAccessibleContext();
- log.println(" Child " + i + ": " +
+ System.out.println(" Child " + i + ": " +
chAC.getAccessibleDescription()) ;
if (!AccessibilityTools.equals
(chAC.getAccessibleParent().getAccessibleContext(), oObj)){
- log.println("Role:");
- log.println("Getting: "+chAC.getAccessibleParent().getAccessibleContext().getAccessibleRole());
- log.println("Expected: "+oObj.getAccessibleRole());
+ System.out.println("Role:");
+ System.out.println("Getting: "+chAC.getAccessibleParent().getAccessibleContext().getAccessibleRole());
+ System.out.println("Expected: "+oObj.getAccessibleRole());
- log.println("ImplementationName:");
- log.println("Getting: "+util.utils.getImplName(chAC.getAccessibleParent().getAccessibleContext()));
- log.println("Expected: "+util.utils.getImplName(oObj));
+ System.out.println("ImplementationName:");
+ System.out.println("Getting: "+util.utils.getImplName(chAC.getAccessibleParent().getAccessibleContext()));
+ System.out.println("Expected: "+util.utils.getImplName(oObj));
- log.println("The parent of child and component "+
+ System.out.println("The parent of child and component "+
"itself differ.");
- log.println("Getting(Description): "
+ System.out.println("Getting(Description): "
+chAC.getAccessibleParent().getAccessibleContext().getAccessibleDescription());
- log.println("Expected(Description): "
+ System.out.println("Expected(Description): "
+oObj.getAccessibleDescription());
bOK = false;
} else {
- log.println("Getting the expected Child -- OK");
+ System.out.println("Getting the expected Child -- OK");
}
} catch (com.sun.star.lang.IndexOutOfBoundsException e) {
e.printStackTrace();
@@ -144,6 +148,7 @@ public class _XAccessibleContext {
* Just gets the parent. <p>
*
* Has <b> OK </b> status if parent is not null.
+ * @return
*/
public boolean _getAccessibleParent() {
// assume that the component is not ROOT
@@ -163,6 +168,7 @@ public class _XAccessibleContext {
* <ul>
* <li> <code> getAccessibleParent() </code> : to have a parent </li>
* </ul>
+ * @return
*/
public boolean _getAccessibleIndexInParent() {
@@ -174,8 +180,8 @@ public class _XAccessibleContext {
bOK &= AccessibilityTools.equals(
parentAC.getAccessibleChild(idx).getAccessibleContext(),oObj);
if (!bOK) {
- log.println("Expected: "+util.utils.getImplName(oObj));
- log.println("Getting: "+util.utils.getImplName(
+ System.out.println("Expected: "+util.utils.getImplName(oObj));
+ System.out.println("Getting: "+util.utils.getImplName(
parentAC.getAccessibleChild(idx).getAccessibleContext()));
}
} catch (com.sun.star.lang.IndexOutOfBoundsException e) {
@@ -189,10 +195,11 @@ public class _XAccessibleContext {
* Get the accessible role of component. <p>
*
* Has <b> OK </b> status if non-negative number rutrned.
+ * @return
*/
public boolean _getAccessibleRole() {
short role = oObj.getAccessibleRole();
- log.println("The role is " + role);
+ System.out.println("The role is " + role);
return role > -1;
}
@@ -200,10 +207,11 @@ public class _XAccessibleContext {
* Get the accessible name of the component. <p>
*
* Has <b> OK </b> status if the name has non-zero length.
+ * @return
*/
public boolean _getAccessibleName() {
String name = oObj.getAccessibleName();
- log.println("The name is '" + name + "'");
+ System.out.println("The name is '" + name + "'");
return name != null;
}
@@ -211,10 +219,11 @@ public class _XAccessibleContext {
* Get the accessible description of the component. <p>
*
* Has <b> OK </b> status if the description has non-zero length.
+ * @return
*/
public boolean _getAccessibleDescription() {
String descr = oObj.getAccessibleDescription();
- log.println("The description is '" + descr + "'");
+ System.out.println("The description is '" + descr + "'");
return descr != null;
}
@@ -222,6 +231,7 @@ public class _XAccessibleContext {
* Just gets the set. <p>
*
* Has <b> OK </b> status if the set is not null.
+ * @return
*/
public boolean _getAccessibleRelationSet() {
XAccessibleRelationSet set = oObj.getAccessibleRelationSet();
@@ -232,6 +242,7 @@ public class _XAccessibleContext {
* Just gets the set. <p>
*
* Has <b> OK </b> status if the set is not null.
+ * @return
*/
public boolean _getAccessibleStateSet() {
XAccessibleStateSet set = oObj.getAccessibleStateSet();
@@ -244,12 +255,13 @@ public class _XAccessibleContext {
* Has <b> OK </b> status if <code>Country</code> and
* <code>Language</code> fields of locale structure
* are not empty.
+ * @return
*/
public boolean _getLocale() {
Locale loc = null ;
try {
loc = oObj.getLocale();
- log.println("The locale is " + loc.Language + "," + loc.Country);
+ System.out.println("The locale is " + loc.Language + "," + loc.Country);
} catch (IllegalAccessibleComponentStateException e) {
e.printStackTrace();
}
diff --git a/toolkit/qa/complex/toolkit/interface_tests/_XAccessibleEventBroadcaster.java b/toolkit/qa/complex/toolkit/_XAccessibleEventBroadcaster.java
index 18a20d02e233..899028daec87 100755
--- a/toolkit/qa/complex/toolkit/interface_tests/_XAccessibleEventBroadcaster.java
+++ b/toolkit/qa/complex/toolkit/_XAccessibleEventBroadcaster.java
@@ -25,7 +25,7 @@
*
************************************************************************/
-package complex.toolkit.interface_tests;
+package complex.toolkit;
import com.sun.star.lang.EventObject;
import com.sun.star.awt.Rectangle;
@@ -33,13 +33,13 @@ import com.sun.star.awt.PosSize;
import com.sun.star.awt.XWindow;
import com.sun.star.accessibility.AccessibleEventObject;
import com.sun.star.accessibility.XAccessible;
-import com.sun.star.accessibility.XAccessibleComponent;
+// import com.sun.star.accessibility.XAccessibleComponent;
import com.sun.star.accessibility.XAccessibleEventBroadcaster;
import com.sun.star.accessibility.XAccessibleEventListener;
import com.sun.star.accessibility.XAccessibleContext;
import com.sun.star.uno.XInterface;
import com.sun.star.uno.UnoRuntime;
-import share.LogWriter;
+// import share.LogWriter;
/**
* Testing <code>
@@ -62,7 +62,7 @@ import share.LogWriter;
*/
public class _XAccessibleEventBroadcaster {
- private LogWriter log;
+ // private LogWriter log;
private static final String className =
"com.sun.star.accessibility.XAccessibleEventBroadcaster" ;
@@ -97,7 +97,7 @@ public class _XAccessibleEventBroadcaster {
private class EvListener implements XAccessibleEventListener {
public AccessibleEventObject notifiedEvent = null ;
public void notifyEvent(AccessibleEventObject ev) {
- log.println("Listener, Event : " + ev.EventId);
+ System.out.println("Listener, Event : " + ev.EventId);
System.out.println("EventID: " + ev.EventId);
Object old=ev.OldValue;
if (old instanceof com.sun.star.accessibility.XAccessible) {
@@ -116,11 +116,13 @@ public class _XAccessibleEventBroadcaster {
/**
* c'tor
+ * @param object
+ * @param eventMessage
+ * @param window
*/
- public _XAccessibleEventBroadcaster(XInterface object, LogWriter log, String eventMessage, XWindow window) {
- oObj = (XAccessibleEventBroadcaster)UnoRuntime.queryInterface(
- XAccessibleEventBroadcaster.class, object);
- this.log = log;
+ public _XAccessibleEventBroadcaster(XInterface object, String eventMessage, XWindow window) {
+ oObj = UnoRuntime.queryInterface(XAccessibleEventBroadcaster.class, object);
+ // this.log = log;
prod = new EventProducer(window);
EventMsg = eventMessage;
}
@@ -128,12 +130,13 @@ public class _XAccessibleEventBroadcaster {
/**
* Adds two listeners and fires event by mean of object relation. <p>
* Has <b> OK </b> status if both listeners were called
+ * @return
*/
public boolean _addEventListener() {
- log.println("adding two listeners");
+ System.out.println("adding two listeners");
oObj.addEventListener(list);
boolean isTransient = chkTransient(oObj);
- log.println("fire event");
+ System.out.println("fire event");
prod.fireEvent() ;
try {
@@ -146,15 +149,15 @@ public class _XAccessibleEventBroadcaster {
if (list.notifiedEvent == null) {
if (!isTransient) {
- log.println("listener wasn't called");
+ System.out.println("listener wasn't called");
works = false;
} else {
- log.println("Object is Transient, listener isn't expected to be called");
+ System.out.println("Object is Transient, listener isn't expected to be called");
}
oObj.removeEventListener(list);
}
-// log.println(EventMsg);
+// System.out.println(EventMsg);
return works;
}
@@ -168,15 +171,16 @@ public class _XAccessibleEventBroadcaster {
* <ul>
* <li> <code>addEventListener()</code> : to have added listeners </li>
* </ul>
+ * @return
*/
public boolean _removeEventListener() {
list.notifiedEvent = null;
- log.println("remove first listener");
+ System.out.println("remove first listener");
oObj.removeEventListener(list);
- log.println("fire event");
+ System.out.println("fire event");
prod.fireEvent() ;
try {
@@ -186,7 +190,7 @@ public class _XAccessibleEventBroadcaster {
}
if (list.notifiedEvent == null) {
- log.println("listener wasn't called -- OK");
+ System.out.println("listener wasn't called -- OK");
}
return list.notifiedEvent == null;
@@ -194,8 +198,7 @@ public class _XAccessibleEventBroadcaster {
}
protected static boolean chkTransient(Object Testcase) {
- XAccessibleContext accCon = (XAccessibleContext)
- UnoRuntime.queryInterface(XAccessibleContext.class,Testcase);
+ XAccessibleContext accCon = UnoRuntime.queryInterface(XAccessibleContext.class, Testcase);
if (accCon.getAccessibleStateSet().contains(
com.sun.star.accessibility.AccessibleStateType.TRANSIENT)){
if (!accCon.getAccessibleParent().getAccessibleContext().getAccessibleStateSet().contains(
diff --git a/toolkit/qa/complex/toolkit/interface_tests/_XAccessibleExtendedComponent.java b/toolkit/qa/complex/toolkit/_XAccessibleExtendedComponent.java
index e022e60d90c0..2ba5c190cf31 100755
--- a/toolkit/qa/complex/toolkit/interface_tests/_XAccessibleExtendedComponent.java
+++ b/toolkit/qa/complex/toolkit/_XAccessibleExtendedComponent.java
@@ -25,16 +25,16 @@
*
************************************************************************/
-package complex.toolkit.interface_tests;
+package complex.toolkit;
-import lib.MultiMethodTest;
+// import lib.MultiMethodTest;
import com.sun.star.accessibility.XAccessibleExtendedComponent;
-import com.sun.star.accessibility.XAccessibleStateSet;
-import com.sun.star.accessibility.AccessibleStateType;
+// import com.sun.star.accessibility.XAccessibleStateSet;
+// import com.sun.star.accessibility.AccessibleStateType;
import com.sun.star.awt.XFont;
import com.sun.star.uno.XInterface;
import com.sun.star.uno.UnoRuntime;
-import share.LogWriter;
+// import share.LogWriter;
/**
* Testing <code>com.sun.star.accessibility.XAccessibleExtendedComponent</code>
@@ -51,7 +51,7 @@ import share.LogWriter;
*/
public class _XAccessibleExtendedComponent {
- private LogWriter log;
+ // private LogWriter log;
private static final String className =
"com.sun.star.accessibility.XAccessibleExtendedComponent" ;
@@ -62,38 +62,40 @@ public class _XAccessibleExtendedComponent {
return className;
}
- public _XAccessibleExtendedComponent(XInterface object, LogWriter log) {
- oObj = (XAccessibleExtendedComponent)UnoRuntime.queryInterface(
- XAccessibleExtendedComponent.class, object);
- this.log = log;
+ public _XAccessibleExtendedComponent(XInterface object/*, LogWriter log*/) {
+ oObj = UnoRuntime.queryInterface(XAccessibleExtendedComponent.class, object);
+ // this.log = log;
}
/**
* Just calls the method.
+ * @return
*/
public boolean _getFont() {
XFont font = oObj.getFont();
- log.println("getFont(): " + font);
+ System.out.println("getFont(): " + font);
return true;
}
/**
* Calls the method and checks returned value.
* Has OK status if returned value isn't null.
+ * @return
*/
public boolean _getTitledBorderText() {
String titleBorderText = oObj.getTitledBorderText();
- log.println("getTitledBorderText(): '" + titleBorderText + "'");
+ System.out.println("getTitledBorderText(): '" + titleBorderText + "'");
return titleBorderText != null;
}
/**
* Calls the method and checks returned value.
* Has OK status if returned value isn't null.
+ * @return
*/
public boolean _getToolTipText() {
String toolTipText = oObj.getToolTipText();
- log.println("getToolTipText(): '" + toolTipText + "'");
+ System.out.println("getToolTipText(): '" + toolTipText + "'");
return toolTipText != null;
}
}
diff --git a/toolkit/qa/complex/toolkit/interface_tests/_XAccessibleText.java b/toolkit/qa/complex/toolkit/_XAccessibleText.java
index d6357e8f24bc..151e6b3f7d0b 100755
--- a/toolkit/qa/complex/toolkit/interface_tests/_XAccessibleText.java
+++ b/toolkit/qa/complex/toolkit/_XAccessibleText.java
@@ -25,10 +25,10 @@
*
************************************************************************/
-package complex.toolkit.interface_tests;
+package complex.toolkit;
import com.sun.star.accessibility.XAccessibleText;
-import lib.MultiMethodTest;
+// import lib.MultiMethodTest;
//import lib.StatusException;
//import lib.Status;
import com.sun.star.beans.PropertyValue;
@@ -39,7 +39,7 @@ import com.sun.star.accessibility.AccessibleTextType;
import com.sun.star.accessibility.TextSegment;
import com.sun.star.uno.XInterface;
import com.sun.star.uno.UnoRuntime;
-import share.LogWriter;
+// import share.LogWriter;
/**
* Testing <code>com.sun.star.accessibility.XAccessibleText</code>
@@ -76,7 +76,7 @@ import share.LogWriter;
*/
public class _XAccessibleText {
- private LogWriter log;
+ // private LogWriter log;
private static final String className =
"com.sun.star.accessibility.XAccessibleText" ;
@@ -91,11 +91,10 @@ public class _XAccessibleText {
String editOnly = null;
- public _XAccessibleText(XInterface object, LogWriter log, XMultiServiceFactory xMSF, String editOnly) {
- oObj = (XAccessibleText)UnoRuntime.queryInterface(
- XAccessibleText.class, object);
+ public _XAccessibleText(XInterface object, XMultiServiceFactory xMSF, String editOnly) {
+ oObj = UnoRuntime.queryInterface(XAccessibleText.class, object);
this.xMSF = xMSF;
- this.log = log;
+ // this.log = log;
this.editOnly = editOnly;
}
@@ -107,11 +106,12 @@ public class _XAccessibleText {
* <ul>
* <li> <code>setCaretPosition()</code> </li>
* </ul>
+ * @return
*/
public boolean _getCaretPosition() {
if (editOnly != null) {
- log.println(editOnly);
+ System.out.println(editOnly);
return true;
}
@@ -123,7 +123,7 @@ public class _XAccessibleText {
}
int carPos = oObj.getCaretPosition();
- log.println("getCaretPosition: " + carPos);
+ System.out.println("getCaretPosition: " + carPos);
res = carPos == (chCount - 1);
}
return res;
@@ -138,36 +138,37 @@ public class _XAccessibleText {
* <ul>
* <li> <code>getCharacterCount()</code> </li>
* </ul>
+ * @return
*/
public boolean _setCaretPosition() {
boolean res = true;
try {
- log.println("setCaretPosition(-1):");
+ System.out.println("setCaretPosition(-1):");
oObj.setCaretPosition(-1);
res &= false;
- log.println("exception was expected");
+ System.out.println("exception was expected");
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("expected exception");
+ System.out.println("expected exception");
res &= true;
}
try {
- log.println("setCaretPosition(chCount+1):");
+ System.out.println("setCaretPosition(chCount+1):");
oObj.setCaretPosition(chCount+1);
res &= false;
- log.println("exception was expected");
+ System.out.println("exception was expected");
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("expected exception");
+ System.out.println("expected exception");
res &= true;
}
if ( chCount > 0 ) {
try {
- log.println("setCaretPosition(chCount - 1)");
+ System.out.println("setCaretPosition(chCount - 1)");
oObj.setCaretPosition(chCount - 1);
res &= true;
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("unexpected exception");
+ System.out.println("unexpected exception");
e.printStackTrace();
res &= false;
}
@@ -186,46 +187,47 @@ public class _XAccessibleText {
* <ul>
* <li> <code>getCharacterCount()</code> </li>
* </ul>
+ * @return
*/
public boolean _getCharacter() {
boolean res = true;
try {
- log.println("getCharacter(-1)");
+ System.out.println("getCharacter(-1)");
oObj.getCharacter(-1);
- log.println("Exception was expected");
+ System.out.println("Exception was expected");
res = false;
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Expected exception");
+ System.out.println("Expected exception");
res = true;
}
try {
- log.println("getCharacter(chCount)");
+ System.out.println("getCharacter(chCount)");
oObj.getCharacter(chCount);
- log.println("Exception was expected");
+ System.out.println("Exception was expected");
res &= false;
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Expected exception");
+ System.out.println("Expected exception");
res &= true;
}
try {
- log.println("Checking of every character in the text...");
+ System.out.println("Checking of every character in the text...");
boolean isEqCh = true;
for(int i = 0; i < chCount; i++) {
char ch = oObj.getCharacter(i);
isEqCh = ch == text.charAt(i);
res &= isEqCh;
if (!isEqCh) {
- log.println("At the position " + i +
+ System.out.println("At the position " + i +
"was expected character: " + text.charAt(i));
- log.println("but was returned: " + ch);
+ System.out.println("but was returned: " + ch);
break;
}
}
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Unexpected exception");
+ System.out.println("Unexpected exception");
e.printStackTrace();
res &= false;
}
@@ -243,38 +245,39 @@ public class _XAccessibleText {
* <ul>
* <li> <code>getCharacterCount()</code> </li>
* </ul>
+ * @return
*/
public boolean _getCharacterAttributes() {
boolean res = true;
try {
- log.println("getCharacterAttributes(-1)");
+ System.out.println("getCharacterAttributes(-1)");
oObj.getCharacterAttributes(-1, new String[0]);
- log.println("Exception was expected");
+ System.out.println("Exception was expected");
res &= false;
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Expected exception");
+ System.out.println("Expected exception");
res &= true;
}
try {
- log.println("getCharacterAttributes(chCount)");
+ System.out.println("getCharacterAttributes(chCount)");
oObj.getCharacterAttributes(chCount, new String[0]);
- log.println("Exception was expected");
+ System.out.println("Exception was expected");
res &= false;
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Expected exception");
+ System.out.println("Expected exception");
res &= true;
}
try {
if ( chCount > 0 ) {
- log.println("getCharacterAttributes(chCount-1)");
+ System.out.println("getCharacterAttributes(chCount-1)");
PropertyValue[] props = oObj.getCharacterAttributes(chCount - 1, new String[0]);
res &= props != null;
}
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Unexpected exception");
+ System.out.println("Unexpected exception");
e.printStackTrace();
res &= false;
}
@@ -293,41 +296,42 @@ public class _XAccessibleText {
* <ul>
* <li> <code>getCharacterCount()</code> </li>
* </ul>
+ * @return
*/
public boolean _getCharacterBounds() {
boolean res = true;
try {
- log.println("getCharacterBounds(-1)");
+ System.out.println("getCharacterBounds(-1)");
oObj.getCharacterBounds(-1);
- log.println("Exception was expected");
+ System.out.println("Exception was expected");
res &= false;
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Expected exception");
+ System.out.println("Expected exception");
res &= true;
}
try {
- log.println("getCharacterBounds(chCount)");
+ System.out.println("getCharacterBounds(chCount)");
oObj.getCharacterBounds(chCount);
- log.println("Exception was expected");
+ System.out.println("Exception was expected");
res &= false;
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Expected exception");
+ System.out.println("Expected exception");
res &= true;
}
try {
if (chCount > 0) {
- log.println("getCharacterBounds(chCount-1)");
+ System.out.println("getCharacterBounds(chCount-1)");
chBounds = oObj.getCharacterBounds(chCount-1);
res &= chBounds != null;
- log.println("rect: " + chBounds.X + ", " + chBounds.Y + ", " +
+ System.out.println("rect: " + chBounds.X + ", " + chBounds.Y + ", " +
chBounds.Width + ", " + chBounds.Height);
}
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Unexpected exception");
+ System.out.println("Unexpected exception");
e.printStackTrace();
res &= false;
}
@@ -340,10 +344,11 @@ public class _XAccessibleText {
* Calls the method and stores a returned value to the variable
* <code>chCount</code>.
* Has OK status if a returned value is equal to the text length.
+ * @return
*/
public boolean _getCharacterCount() {
chCount = oObj.getCharacterCount();
- log.println("Character count:" + chCount);
+ System.out.println("Character count:" + chCount);
boolean res = chCount == text.length();
return res;
}
@@ -358,21 +363,22 @@ public class _XAccessibleText {
* <ul>
* <li> <code>getCharacterBounds()</code> </li>
* </ul>
+ * @return
*/
public boolean _getIndexAtPoint() {
boolean res = true;
- log.println("getIndexAtPoint(-1, -1):");
+ System.out.println("getIndexAtPoint(-1, -1):");
Point pt = new Point(-1, -1);
int index = oObj.getIndexAtPoint(pt);
- log.println(Integer.toString(index));
+ System.out.println(Integer.toString(index));
res &= index == -1;
if (chBounds != null) {
pt = new Point(chBounds.X , chBounds.Y );
- log.println("getIndexAtPoint(" + pt.X + ", " + pt.Y + "):");
+ System.out.println("getIndexAtPoint(" + pt.X + ", " + pt.Y + "):");
index = oObj.getIndexAtPoint(pt);
- log.println(Integer.toString(index));
+ System.out.println(Integer.toString(index));
res &= index == (chCount - 1);
}
@@ -386,40 +392,41 @@ public class _XAccessibleText {
* <ul>
* <li> <code>setSelection()</code> </li>
* </ul>
+ * @return
*/
public boolean _getSelectedText() {
if (editOnly != null) {
- log.println(editOnly);
+ System.out.println(editOnly);
return true;
}
boolean res = true;
try {
- log.println("setSelection(0, 0)");
+ System.out.println("setSelection(0, 0)");
oObj.setSelection(0, 0);
- log.println("getSelectedText():");
+ System.out.println("getSelectedText():");
String txt = oObj.getSelectedText();
- log.println("'" + txt + "'");
+ System.out.println("'" + txt + "'");
res &= txt.length() == 0;
- log.println("setSelection(0, chCount)");
+ System.out.println("setSelection(0, chCount)");
oObj.setSelection(0, chCount);
- log.println("getSelectedText():");
+ System.out.println("getSelectedText():");
txt = oObj.getSelectedText();
- log.println("'" + txt + "'");
+ System.out.println("'" + txt + "'");
res &= txt.equals(text);
if (chCount > 2) {
- log.println("setSelection(1, chCount-1)");
+ System.out.println("setSelection(1, chCount-1)");
oObj.setSelection(1, chCount - 1);
- log.println("getSelectedText():");
+ System.out.println("getSelectedText():");
txt = oObj.getSelectedText();
- log.println("'" + txt + "'");
+ System.out.println("'" + txt + "'");
res &= txt.equals(text.substring(1, chCount - 1));
}
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Unexpected exception");
+ System.out.println("Unexpected exception");
e.printStackTrace();
res &= false;
}
@@ -434,31 +441,32 @@ public class _XAccessibleText {
* <ul>
* <li> <code>setSelection()</code> </li>
* </ul>
+ * @return
*/
public boolean _getSelectionStart() {
if (editOnly != null) {
- log.println(editOnly);
+ System.out.println(editOnly);
return true;
}
boolean res = true;
try {
- log.println("setSelection(0, chCount)");
+ System.out.println("setSelection(0, chCount)");
oObj.setSelection(0, chCount);
int start = oObj.getSelectionStart();
- log.println("getSelectionStart():" + start);
+ System.out.println("getSelectionStart():" + start);
res &= start == 0;
if (chCount > 2) {
- log.println("setSelection(1, chCount-1)");
+ System.out.println("setSelection(1, chCount-1)");
oObj.setSelection(1, chCount - 1);
start = oObj.getSelectionStart();
- log.println("getSelectionStart():" + start);
+ System.out.println("getSelectionStart():" + start);
res &= start == 1;
}
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Unexpected exception");
+ System.out.println("Unexpected exception");
e.printStackTrace();
res &= false;
}
@@ -473,31 +481,32 @@ public class _XAccessibleText {
* <ul>
* <li> <code>setSelection()</code> </li>
* </ul>
+ * @return
*/
public boolean _getSelectionEnd() {
if (editOnly != null) {
- log.println(editOnly);
+ System.out.println(editOnly);
return true;
}
boolean res = true;
try {
- log.println("setSelection(0, chCount)");
+ System.out.println("setSelection(0, chCount)");
oObj.setSelection(0, chCount);
int end = oObj.getSelectionEnd();
- log.println("getSelectionEnd():" + end);
+ System.out.println("getSelectionEnd():" + end);
res &= end == chCount;
if (chCount > 2) {
- log.println("setSelection(1, chCount-1)");
+ System.out.println("setSelection(1, chCount-1)");
oObj.setSelection(1, chCount - 1);
end = oObj.getSelectionEnd();
- log.println("getSelectionEnd():" + end);
+ System.out.println("getSelectionEnd():" + end);
res &= end == chCount - 1;
}
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Unexpected exception");
+ System.out.println("Unexpected exception");
e.printStackTrace();
res &= false;
}
@@ -513,67 +522,68 @@ public class _XAccessibleText {
* <ul>
* <li> <code>getCharacterCount()</code> </li>
* </ul>
+ * @return
*/
public boolean _setSelection() {
boolean res = true;
boolean locRes = true;
if (editOnly != null) {
- log.println(editOnly);
+ System.out.println(editOnly);
return true;
}
try {
- log.println("setSelection(-1, chCount-1):");
+ System.out.println("setSelection(-1, chCount-1):");
locRes = oObj.setSelection(-1, chCount - 1);
- log.println(locRes + " exception was expected");
+ System.out.println(locRes + " exception was expected");
res &= !locRes;
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Expected exception");
+ System.out.println("Expected exception");
res &= true;
}
try {
- log.println("setSelection(0, chCount+1):");
+ System.out.println("setSelection(0, chCount+1):");
locRes = oObj.setSelection(0, chCount + 1);
- log.println(locRes + " excepion was expected");
+ System.out.println(locRes + " excepion was expected");
res &= !locRes;
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Expected exception");
+ System.out.println("Expected exception");
res &= true;
}
try {
if (chCount > 2) {
- log.println("setSelection(1, chCount-1):");
+ System.out.println("setSelection(1, chCount-1):");
locRes = oObj.setSelection(1, chCount - 1);
- log.println(Boolean.toString(locRes));
+ System.out.println(Boolean.toString(locRes));
res &= locRes;
- log.println("setSelection(chCount-1, 1):");
+ System.out.println("setSelection(chCount-1, 1):");
locRes = oObj.setSelection(chCount - 1, 1);
- log.println(Boolean.toString(locRes));
+ System.out.println(Boolean.toString(locRes));
res &= locRes;
}
if (chCount > 1) {
- log.println("setSelection(0, chCount-1):");
+ System.out.println("setSelection(0, chCount-1):");
locRes = oObj.setSelection(0, chCount-1);
- log.println(Boolean.toString(locRes));
+ System.out.println(Boolean.toString(locRes));
res &= locRes;
- log.println("setSelection(chCount-1, 0):");
+ System.out.println("setSelection(chCount-1, 0):");
locRes = oObj.setSelection(chCount-1, 0);
- log.println(Boolean.toString(locRes));
+ System.out.println(Boolean.toString(locRes));
res &= locRes;
}
- log.println("setSelection(0, 0):");
+ System.out.println("setSelection(0, 0):");
locRes = oObj.setSelection(0, 0);
- log.println(Boolean.toString(locRes));
+ System.out.println(Boolean.toString(locRes));
res &= locRes;
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Unexpected exception");
+ System.out.println("Unexpected exception");
e.printStackTrace();
res &= false;
}
@@ -585,10 +595,11 @@ public class _XAccessibleText {
* Calls the method and checks returned value.
* Has OK status if returned string is not null
* received from relation.
+ * @return
*/
public boolean _getText() {
text = oObj.getText();
- log.println("getText: '" + text + "'");
+ System.out.println("getText: '" + text + "'");
return (text != null);
}
@@ -602,6 +613,7 @@ public class _XAccessibleText {
* <ul>
* <li> <code>getCharacterCount()</code> </li>
* </ul>
+ * @return
*/
public boolean _getTextRange() {
boolean res = true;
@@ -609,75 +621,75 @@ public class _XAccessibleText {
try {
if (chCount > 3) {
- log.println("getTextRange(1, chCount - 2): ");
+ System.out.println("getTextRange(1, chCount - 2): ");
String txtRange = oObj.getTextRange(1, chCount - 2);
- log.println(txtRange);
+ System.out.println(txtRange);
locRes = txtRange.equals(text.substring(1, chCount - 2));
res &= locRes;
if (!locRes) {
- log.println("Was expected: " +
+ System.out.println("Was expected: " +
text.substring(1, chCount - 2));
}
}
if (chCount > 0) {
- log.println("getTextRange(0, chCount-1): ");
+ System.out.println("getTextRange(0, chCount-1): ");
String txtRange = oObj.getTextRange(0, chCount-1);
- log.println(txtRange);
+ System.out.println(txtRange);
locRes = txtRange.equals(text.substring(0, chCount - 1));
res &= locRes;
if (!locRes) {
- log.println("Was expected: " +
+ System.out.println("Was expected: " +
text.substring(0, chCount - 1));
}
- log.println("getTextRange(chCount, 0): ");
+ System.out.println("getTextRange(chCount, 0): ");
txtRange = oObj.getTextRange(chCount, 0);
- log.println(txtRange);
+ System.out.println(txtRange);
res &= txtRange.equals(text);
- log.println("getTextRange(0, 0): ");
+ System.out.println("getTextRange(0, 0): ");
txtRange = oObj.getTextRange(0, 0);
- log.println(txtRange);
+ System.out.println(txtRange);
locRes = txtRange.equals("");
res &= locRes;
if (!locRes) {
- log.println("Empty string was expected");
+ System.out.println("Empty string was expected");
}
}
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Unexpected exception");
+ System.out.println("Unexpected exception");
e.printStackTrace();
res &= false;
}
try {
- log.println("getTextRange(-1, chCount - 1): ");
+ System.out.println("getTextRange(-1, chCount - 1): ");
String txtRange = oObj.getTextRange(-1, chCount - 1);
- log.println("Exception was expected");
+ System.out.println("Exception was expected");
res &= false;
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Expected exception");
+ System.out.println("Expected exception");
res &= true;
}
try {
- log.println("getTextRange(0, chCount + 1): ");
+ System.out.println("getTextRange(0, chCount + 1): ");
String txtRange = oObj.getTextRange(0, chCount + 1);
- log.println("Exception was expected");
+ System.out.println("Exception was expected");
res &= false;
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Expected exception");
+ System.out.println("Expected exception");
res &= true;
}
try {
- log.println("getTextRange(chCount+1, -1): ");
+ System.out.println("getTextRange(chCount+1, -1): ");
String txtRange = oObj.getTextRange(chCount+1, -1);
- log.println("Exception was expected");
+ System.out.println("Exception was expected");
res &= false;
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Expected exception");
+ System.out.println("Expected exception");
res &= true;
}
@@ -694,62 +706,63 @@ public class _XAccessibleText {
* <ul>
* <li> <code>getCharacterCount()</code> </li>
* </ul>
+ * @return
*/
public boolean _getTextAtIndex() {
boolean res = true;
try {
- log.println("getTextAtIndex(-1, AccessibleTextType.PARAGRAPH):");
+ System.out.println("getTextAtIndex(-1, AccessibleTextType.PARAGRAPH):");
TextSegment txt =
oObj.getTextAtIndex(-1, AccessibleTextType.PARAGRAPH);
- log.println("Exception was expected");
+ System.out.println("Exception was expected");
res &= false;
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Expected exception");
+ System.out.println("Expected exception");
res &= true;
} catch(com.sun.star.lang.IllegalArgumentException e) {
- log.println("Expected exception");
+ System.out.println("Expected exception");
res &= true;
}
try {
- log.println("getTextAtIndex(chCount+1," +
+ System.out.println("getTextAtIndex(chCount+1," +
" AccessibleTextType.PARAGRAPH):");
TextSegment txt = oObj.getTextAtIndex(chCount + 1,
AccessibleTextType.PARAGRAPH);
- log.println("Exception was expected");
+ System.out.println("Exception was expected");
res &= false;
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Expected exception");
+ System.out.println("Expected exception");
res &= true;
} catch(com.sun.star.lang.IllegalArgumentException e) {
- log.println("Expected exception");
+ System.out.println("Expected exception");
res &= true;
}
try {
if ( chCount > 0 ) {
- log.println("getTextAtIndex(chCount," +
+ System.out.println("getTextAtIndex(chCount," +
" AccessibleTextType.PARAGRAPH):");
TextSegment txt = oObj.getTextAtIndex(chCount,
AccessibleTextType.PARAGRAPH);
- log.println("'" + txt.SegmentText + "'");
+ System.out.println("'" + txt.SegmentText + "'");
res &= txt.SegmentText.length() == 0;
- log.println("getTextAtIndex(1," +
+ System.out.println("getTextAtIndex(1," +
" AccessibleTextType.PARAGRAPH):");
txt = oObj.getTextAtIndex(1,
AccessibleTextType.PARAGRAPH);
- log.println("'" + txt.SegmentText + "'");
+ System.out.println("'" + txt.SegmentText + "'");
res &= txt.SegmentText.equals(text);
}
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Unexpected exception");
+ System.out.println("Unexpected exception");
e.printStackTrace();
res &= false;
} catch(com.sun.star.lang.IllegalArgumentException e) {
- log.println("Unexpected exception");
+ System.out.println("Unexpected exception");
res &= false;
}
@@ -767,78 +780,79 @@ public class _XAccessibleText {
* <ul>
* <li> <code>getCharacterCount()</code> </li>
* </ul>
+ * @return
*/
public boolean _getTextBeforeIndex() {
boolean res = true;
try {
- log.println("getTextBeforeIndex(-1, AccessibleTextType.PARAGRAPH):");
+ System.out.println("getTextBeforeIndex(-1, AccessibleTextType.PARAGRAPH):");
TextSegment txt = oObj.getTextBeforeIndex(-1,
AccessibleTextType.PARAGRAPH);
- log.println("Exception was expected");
+ System.out.println("Exception was expected");
res &= false;
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Expected exception");
+ System.out.println("Expected exception");
res &= true;
} catch(com.sun.star.lang.IllegalArgumentException e) {
- log.println("Expected exception");
+ System.out.println("Expected exception");
res &= true;
}
try {
- log.println("getTextBeforeIndex(chCount+1, " +
+ System.out.println("getTextBeforeIndex(chCount+1, " +
"AccessibleTextType.PARAGRAPH):");
TextSegment txt = oObj.getTextBeforeIndex(chCount + 1,
AccessibleTextType.PARAGRAPH);
- log.println("Exception was expected");
+ System.out.println("Exception was expected");
res &= false;
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Expected exception");
+ System.out.println("Expected exception");
res &= true;
} catch(com.sun.star.lang.IllegalArgumentException e) {
- log.println("Expected exception");
+ System.out.println("Expected exception");
res &= true;
}
TextSegment txt = null;
try {
if (chCount > 0) {
- log.println("getTextBeforeIndex(chCount," +
+ System.out.println("getTextBeforeIndex(chCount," +
" AccessibleTextType.PARAGRAPH):");
txt = oObj.getTextBeforeIndex(chCount,
AccessibleTextType.PARAGRAPH);
- log.println("'" + txt.SegmentText + "'");
+ System.out.println("'" + txt.SegmentText + "'");
res &= txt.SegmentText.length() == chCount ;
- log.println("getTextBeforeIndex(1," +
+ System.out.println("getTextBeforeIndex(1," +
" AccessibleTextType.PARAGRAPH):");
txt = oObj.getTextBeforeIndex(1,
AccessibleTextType.PARAGRAPH);
- log.println("'" + txt.SegmentText + "'");
+ System.out.println("'" + txt.SegmentText + "'");
res &= txt.SegmentText.length() == 0;
}
if (chCount > 2) {
- log.println("getTextBeforeIndex(chCount-1," +
+ System.out.println("getTextBeforeIndex(chCount-1," +
" AccessibleTextType.CHARACTER):");
txt = oObj.getTextBeforeIndex(chCount - 1,
AccessibleTextType.CHARACTER);
- log.println("'" + txt.SegmentText + "'");
+ System.out.println("'" + txt.SegmentText + "'");
res &= txt.SegmentText.equals(text.substring(chCount - 2, chCount - 1));
- log.println("getTextBeforeIndex(2," +
+ System.out.println("getTextBeforeIndex(2," +
" AccessibleTextType.CHARACTER):");
txt = oObj.getTextBeforeIndex(2,
AccessibleTextType.CHARACTER);
- log.println("'" + txt.SegmentText + "'");
+ System.out.println("'" + txt.SegmentText + "'");
res &= txt.SegmentText.equals(text.substring(1, 2));
}
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Unexpected exception");
+ System.out.println("Unexpected exception");
e.printStackTrace();
res &= false;
} catch(com.sun.star.lang.IllegalArgumentException e) {
- log.println("Unexpected exception");
+ System.out.println("Unexpected exception");
res &= false;
}
@@ -856,79 +870,80 @@ public class _XAccessibleText {
* <ul>
* <li> <code>getCharacterCount()</code> </li>
* </ul>
+ * @return
*/
public boolean _getTextBehindIndex() {
boolean res = true;
try {
- log.println("getTextBehindIndex(-1, AccessibleTextType.PARAGRAPH):");
+ System.out.println("getTextBehindIndex(-1, AccessibleTextType.PARAGRAPH):");
TextSegment txt = oObj.getTextBehindIndex(-1,
AccessibleTextType.PARAGRAPH);
- log.println("Exception was expected");
+ System.out.println("Exception was expected");
res &= false;
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Expected exception");
+ System.out.println("Expected exception");
res &= true;
} catch(com.sun.star.lang.IllegalArgumentException e) {
- log.println("Expected exception");
+ System.out.println("Expected exception");
res &= true;
}
try {
- log.println("getTextBehindIndex(chCount+1, " +
+ System.out.println("getTextBehindIndex(chCount+1, " +
"AccessibleTextType.PARAGRAPH):");
TextSegment txt = oObj.getTextBehindIndex(chCount + 1,
AccessibleTextType.PARAGRAPH);
- log.println("Exception was expected");
+ System.out.println("Exception was expected");
res &= false;
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Expected exception");
+ System.out.println("Expected exception");
res &= true;
} catch(com.sun.star.lang.IllegalArgumentException e) {
- log.println("Expected exception");
+ System.out.println("Expected exception");
res &= true;
}
try {
if ( chCount > 0 ) {
- log.println("getTextBehindIndex(chCount," +
+ System.out.println("getTextBehindIndex(chCount," +
" AccessibleTextType.PARAGRAPH):");
TextSegment txt = oObj.getTextBehindIndex(chCount,
AccessibleTextType.PARAGRAPH);
- log.println("'" + txt.SegmentText + "'");
+ System.out.println("'" + txt.SegmentText + "'");
res &= txt.SegmentText.length() == 0;
- log.println("getTextBehindIndex(chCount-1," +
+ System.out.println("getTextBehindIndex(chCount-1," +
" AccessibleTextType.PARAGRAPH):");
txt = oObj.getTextBehindIndex(chCount - 1,
AccessibleTextType.PARAGRAPH);
- log.println("'" + txt.SegmentText + "'");
+ System.out.println("'" + txt.SegmentText + "'");
res &= txt.SegmentText.length() == 0;
}
if ( chCount > 1 ) {
- log.println("getTextBehindIndex(1," +
+ System.out.println("getTextBehindIndex(1," +
" AccessibleTextType.CHARACTER):");
TextSegment txt = oObj.getTextBehindIndex(1,
AccessibleTextType.CHARACTER);
- log.println("'" + txt.SegmentText + "'");
+ System.out.println("'" + txt.SegmentText + "'");
res &= txt.SegmentText.equals(text.substring(2, 3));
}
if (chCount > 2) {
- log.println("getTextBehindIndex(chCount-2," +
+ System.out.println("getTextBehindIndex(chCount-2," +
" AccessibleTextType.CHARACTER):");
TextSegment txt = oObj.getTextBehindIndex(chCount - 2,
AccessibleTextType.CHARACTER);
- log.println("'" + txt.SegmentText + "'");
+ System.out.println("'" + txt.SegmentText + "'");
res &= txt.SegmentText.equals(text.substring(chCount - 1, chCount));
}
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Unexpected exception");
+ System.out.println("Unexpected exception");
e.printStackTrace();
res &= false;
} catch(com.sun.star.lang.IllegalArgumentException e) {
- log.println("Unexpected exception");
+ System.out.println("Unexpected exception");
res &= false;
}
@@ -942,40 +957,41 @@ public class _XAccessibleText {
* Has OK status if exception was thrown for invalid parameters,
* if exception wasn't thrown for valid parameter and if returned value for
* valid parameter is equal to <code>true</code>.
+ * @return
*/
public boolean _copyText() {
boolean res = true;
boolean locRes = true;
if (editOnly != null) {
- log.println(editOnly);
+ System.out.println(editOnly);
return true;
}
try {
- log.println("copyText(-1,chCount):");
+ System.out.println("copyText(-1,chCount):");
oObj.copyText(-1, chCount);
- log.println("Exception was expected");
+ System.out.println("Exception was expected");
res &= false;
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Expected exception");
+ System.out.println("Expected exception");
res &= true;
}
try {
- log.println("copyText(0,chCount+1):");
+ System.out.println("copyText(0,chCount+1):");
oObj.copyText(0, chCount + 1);
- log.println("Exception was expected");
+ System.out.println("Exception was expected");
res &= false;
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Expected exception");
+ System.out.println("Expected exception");
res &= true;
}
try {
- log.println("copyText(0,chCount):");
+ System.out.println("copyText(0,chCount):");
locRes = oObj.copyText(0, chCount);
- log.println(""+locRes);
+ System.out.println(""+locRes);
res &= locRes;
String cbText = null;
@@ -983,31 +999,31 @@ public class _XAccessibleText {
cbText =
util.SysUtils.getSysClipboardText(xMSF);
} catch (com.sun.star.uno.Exception e) {
- log.println("Couldn't access system clipboard :");
+ System.out.println("Couldn't access system clipboard :");
e.printStackTrace();
}
- log.println("Clipboard: '" + cbText + "'");
+ System.out.println("Clipboard: '" + cbText + "'");
res &= text.equals(cbText);
if (chCount > 2) {
- log.println("copyText(1,chCount-1):");
+ System.out.println("copyText(1,chCount-1):");
locRes = oObj.copyText(1, chCount - 1);
- log.println(""+locRes);
+ System.out.println(""+locRes);
res &= locRes;
try {
cbText = util.SysUtils.getSysClipboardText(xMSF);
} catch (com.sun.star.uno.Exception e) {
- log.println("Couldn't access system clipboard :");
+ System.out.println("Couldn't access system clipboard :");
e.printStackTrace();
}
- log.println("Clipboard: '" + cbText + "'");
+ System.out.println("Clipboard: '" + cbText + "'");
res &= text.substring(1, chCount - 1).equals(cbText);
}
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Unexpected exception");
+ System.out.println("Unexpected exception");
e.printStackTrace();
res &= false;
}
diff --git a/toolkit/qa/complex/toolkit/interface_tests/_XRequestCallback.java b/toolkit/qa/complex/toolkit/_XRequestCallback.java
index 472412e80aa6..b9486c04c80a 100644
--- a/toolkit/qa/complex/toolkit/interface_tests/_XRequestCallback.java
+++ b/toolkit/qa/complex/toolkit/_XRequestCallback.java
@@ -25,14 +25,14 @@
*
************************************************************************/
-package complex.toolkit.interface_tests;
+package complex.toolkit;
import com.sun.star.awt.XRequestCallback;
-import lib.MultiMethodTest;
+// import lib.MultiMethodTest;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.uno.XInterface;
import com.sun.star.uno.UnoRuntime;
-import share.LogWriter;
+// import share.LogWriter;
/**
* Testing <code>com.sun.star.awt.XRequestCallback</code>
@@ -44,7 +44,7 @@ import share.LogWriter;
*/
public class _XRequestCallback {
- private LogWriter log;
+ // private LogWriter log;
private static final String className =
"com.sun.star.awt.XRequestCallback" ;
@@ -55,11 +55,10 @@ public class _XRequestCallback {
String text = null;
- public _XRequestCallback(XInterface object, LogWriter log, XMultiServiceFactory xMSF ) {
- oObj = (XRequestCallback)UnoRuntime.queryInterface(
- XRequestCallback.class, object);
+ public _XRequestCallback(XInterface object, XMultiServiceFactory xMSF ) {
+ oObj = UnoRuntime.queryInterface(XRequestCallback.class, object);
this.xMSF = xMSF;
- this.log = log;
+ // this.log = log;
}
@@ -70,6 +69,7 @@ public class _XRequestCallback {
* <ul>
* <li> <code>addCallback()</code> </li>
* </ul>
+ * @return
*/
public boolean _addCallback() {
@@ -80,7 +80,7 @@ public class _XRequestCallback {
} catch (com.sun.star.uno.RuntimeException ie) {
res = false;
}
- log.println("addCallback called" );
+ System.out.println("addCallback called" );
return res;
}
diff --git a/toolkit/qa/complex/toolkit/interface_tests/makefile.mk b/toolkit/qa/complex/toolkit/interface_tests/makefile.mk
index 0e324109f28d..7d8c4c951d4e 100755
--- a/toolkit/qa/complex/toolkit/interface_tests/makefile.mk
+++ b/toolkit/qa/complex/toolkit/interface_tests/makefile.mk
@@ -25,10 +25,10 @@
#
#*************************************************************************
-PRJ = ..$/..$/..$/..
+PRJ = ../../../..
TARGET = Toolkit
PRJNAME = $(TARGET)
-PACKAGE = complex$/toolkit$/interface_tests
+PACKAGE = complex/toolkit/interface_tests
# --- Settings -----------------------------------------------------
.INCLUDE: settings.mk
@@ -36,14 +36,14 @@ PACKAGE = complex$/toolkit$/interface_tests
#----- compile .java files -----------------------------------------
-JARFILES = mysql.jar ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar
+JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar
JAVAFILES = _XAccessibleComponent.java \
_XAccessibleContext.java \
_XAccessibleExtendedComponent.java \
_XAccessibleEventBroadcaster.java \
_XAccessibleText.java \
_XRequestCallback.java
-JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class)
+JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)/$(PACKAGE)/$(i:b).class)
# --- Targets ------------------------------------------------------
diff --git a/toolkit/qa/complex/toolkit/makefile.mk b/toolkit/qa/complex/toolkit/makefile.mk
index 3a4e096719bb..70918d602624 100755
--- a/toolkit/qa/complex/toolkit/makefile.mk
+++ b/toolkit/qa/complex/toolkit/makefile.mk
@@ -25,58 +25,96 @@
#
#*************************************************************************
-PRJ = ..$/..$/..
-TARGET = Toolkit
-PRJNAME = $(TARGET)
-PACKAGE = complex$/toolkit
-
-# --- Settings -----------------------------------------------------
-.INCLUDE: settings.mk
-
-
-#----- compile .java files -----------------------------------------
-
-JARFILES = mysql.jar ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar
-JAVAFILES = CheckAccessibleStatusBar.java CheckAccessibleStatusBarItem.java CheckAsyncCallback.java CallbackClass.java
-JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class)
-SUBDIRS = interface_tests
-
-#----- make a jar from compiled files ------------------------------
-
-MAXLINELENGTH = 100000
-
-JARCLASSDIRS = $(PACKAGE)
-JARTARGET = $(TARGET).jar
-JARCOMPRESS = TRUE
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
+.ELSE
-# --- Parameters for the test --------------------------------------
+PRJ = ../../..
+PRJNAME = toolkit
+TARGET = qa_complex_toolkit
-# start an office if the parameter is set for the makefile
-.IF "$(OFFICE)" == ""
-CT_APPEXECCOMMAND =
-.ELSE
-CT_APPEXECCOMMAND = -AppExecutionCommand "$(OFFICE)$/soffice -accept=socket,host=localhost,port=8100;urp;"
-.ENDIF
+.IF "$(OOO_JUNIT_JAR)" != ""
+PACKAGE = complex/toolkit
-# test base is java complex
-CT_TESTBASE = -tb java_complex
+JAVATESTFILES = CheckAccessibleStatusBar.java \
+ CheckAccessibleStatusBarItem.java \
+ CheckAsyncCallback.java \
+ CallbackClass.java
-# build up package name with "." instead of $/
-CT_PACKAGE = -o $(PACKAGE:s\$/\.\)
+JAVAFILES = $(JAVATESTFILES) \
+ _XAccessibleComponent.java \
+ _XAccessibleContext.java \
+ _XAccessibleEventBroadcaster.java \
+ _XAccessibleExtendedComponent.java \
+ _XAccessibleText.java \
+ _XRequestCallback.java
-# start the runner application
-CT_APP = org.openoffice.Runner
+JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar
+EXTRAJARFILES = $(OOO_JUNIT_JAR)
-# --- Targets ------------------------------------------------------
+.END
-.INCLUDE : target.mk
+.INCLUDE: settings.mk
+.INCLUDE: target.mk
+.INCLUDE: installationtest.mk
-run: \
- CheckAccessibleStatusBarItem
+ALLTAR : javatest
-CheckAccessibleStatusBar:
- +java -cp $(CLASSPATH) $(CT_APP) $(CT_APPEXECCOMMAND) $(CT_TESTBASE) $(CT_PACKAGE).CheckAccessibleStatusBar
+.END
-CheckAccessibleStatusBarItem:
- +java -cp $(CLASSPATH) $(CT_APP) $(CT_APPEXECCOMMAND) $(CT_TESTBASE) $(CT_PACKAGE).CheckAccessibleStatusBarItem
+# PRJ = ..$/..$/..
+# TARGET = Toolkit
+# PRJNAME = $(TARGET)
+# PACKAGE = complex$/toolkit
+#
+# # --- Settings -----------------------------------------------------
+# .INCLUDE: settings.mk
+#
+#
+# #----- compile .java files -----------------------------------------
+#
+# JARFILES = mysql.jar ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar
+# JAVAFILES = CheckAccessibleStatusBar.java CheckAccessibleStatusBarItem.java CheckAsyncCallback.java CallbackClass.java
+# JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class)
+# SUBDIRS = interface_tests
+#
+# #----- make a jar from compiled files ------------------------------
+#
+# MAXLINELENGTH = 100000
+#
+# JARCLASSDIRS = $(PACKAGE)
+# JARTARGET = $(TARGET).jar
+# JARCOMPRESS = TRUE
+#
+# # --- Parameters for the test --------------------------------------
+#
+# # start an office if the parameter is set for the makefile
+# .IF "$(OFFICE)" == ""
+# CT_APPEXECCOMMAND =
+# .ELSE
+# CT_APPEXECCOMMAND = -AppExecutionCommand "$(OFFICE)$/soffice -accept=socket,host=localhost,port=8100;urp;"
+# .ENDIF
+#
+# # test base is java complex
+# CT_TESTBASE = -tb java_complex
+#
+# # build up package name with "." instead of $/
+# CT_PACKAGE = -o $(PACKAGE:s\$/\.\)
+#
+# # start the runner application
+# CT_APP = org.openoffice.Runner
+#
+# # --- Targets ------------------------------------------------------
+#
+# .INCLUDE : target.mk
+#
+# run: \
+# CheckAccessibleStatusBarItem
+#
+# CheckAccessibleStatusBar:
+# +java -cp $(CLASSPATH) $(CT_APP) $(CT_APPEXECCOMMAND) $(CT_TESTBASE) $(CT_PACKAGE).CheckAccessibleStatusBar
+#
+# CheckAccessibleStatusBarItem:
+# +java -cp $(CLASSPATH) $(CT_APP) $(CT_APPEXECCOMMAND) $(CT_TESTBASE) $(CT_PACKAGE).CheckAccessibleStatusBarItem
+#
diff --git a/toolkit/qa/complex/xunitconversion/XUnitConversionTest.java b/toolkit/qa/complex/xunitconversion/XUnitConversionTest.java
index 654f5ec69da5..f9840e4bde6f 100644
--- a/toolkit/qa/complex/xunitconversion/XUnitConversionTest.java
+++ b/toolkit/qa/complex/xunitconversion/XUnitConversionTest.java
@@ -29,13 +29,21 @@ package complex.xunitconversion;
import com.sun.star.awt.XUnitConversion;
import com.sun.star.uno.UnoRuntime;
-import complexlib.ComplexTestCase;
+
import com.sun.star.awt.XWindow;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.awt.XWindowPeer;
import util.DesktopTools;
+// import org.junit.After;
+import org.junit.AfterClass;
+// import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.openoffice.test.OfficeConnection;
+import static org.junit.Assert.*;
+
/**
* This complex test is only for testing the com.sun.star.awt.XUnitConversion methods
* These are converter methods to get the size of a well known awt component
@@ -44,12 +52,12 @@ import util.DesktopTools;
*
* @author ll93751
*/
-public class XUnitConversionTest extends ComplexTestCase
+public class XUnitConversionTest
{
- public String[] getTestMethodNames()
- {
- return new String[]{"testXUnitConversion"}; // function name of the test method
- }
+// public String[] getTestMethodNames()
+// {
+// return new String[]{"testXUnitConversion"}; // function name of the test method
+// }
/**
* returns the delta value between a and b
@@ -77,14 +85,14 @@ public class XUnitConversionTest extends ComplexTestCase
try
{
com.sun.star.awt.Size aSizeIn = m_xConversion.convertSizeToLogic(_aSize, _aMeasureUnit);
- log.println("Window size:");
- log.println("Width:" + aSizeIn.Width + " " + _sEinheit);
- log.println("Height:" + aSizeIn.Height + " " + _sEinheit);
- log.println("");
+ System.out.println("Window size:");
+ System.out.println("Width:" + aSizeIn.Width + " " + _sEinheit);
+ System.out.println("Height:" + aSizeIn.Height + " " + _sEinheit);
+ System.out.println("");
}
catch (com.sun.star.lang.IllegalArgumentException e)
{
- log.println("Caught IllegalArgumentException in convertSizeToLogic with '" + _sEinheit + "' " + e.getMessage());
+ System.out.println("Caught IllegalArgumentException in convertSizeToLogic with '" + _sEinheit + "' " + e.getMessage());
}
}
@@ -99,19 +107,22 @@ public class XUnitConversionTest extends ComplexTestCase
*
* If no test fails, the test is well done and returns with 'PASSED, OK'
*
- */ public void testXUnitConversion()
+ */
+ @Test public void testXUnitConversion()
{
- XMultiServiceFactory xMSF = (XMultiServiceFactory) param.getMSF();
- assure("failed: There is no office.", xMSF != null);
+ // XMultiServiceFactory xMSF = (XMultiServiceFactory) param.getMSF();
+ final XMultiServiceFactory xMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager());
+
+ assertNotNull("failed: There is no office.", xMSF);
// create a window
XWindowPeer xWindowPeer = DesktopTools.createFloatingWindow(xMSF);
- assure("failed: there is no window peer", xWindowPeer != null);
+ assertNotNull("failed: there is no window peer", xWindowPeer);
// resize and move the window to a well known position and size
- XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, xWindowPeer);
- assure("failed: there is no window, cast wrong?", xWindow != null);
+ XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, xWindowPeer);
+ assertNotNull("failed: there is no window, cast wrong?", xWindow);
xWindow.setVisible(Boolean.TRUE);
@@ -125,30 +136,30 @@ public class XUnitConversionTest extends ComplexTestCase
com.sun.star.awt.Point aPoint = new com.sun.star.awt.Point(aRect.X, aRect.Y);
com.sun.star.awt.Size aSize = new com.sun.star.awt.Size(aRect.Width, aRect.Height);
- log.println("Window position and size in pixel:");
- log.println("X:" + aPoint.X);
- log.println("Y:" + aPoint.Y);
- log.println("Width:" + aSize.Width);
- log.println("Height:" + aSize.Height);
- log.println("");
+ System.out.println("Window position and size in pixel:");
+ System.out.println("X:" + aPoint.X);
+ System.out.println("Y:" + aPoint.Y);
+ System.out.println("Width:" + aSize.Width);
+ System.out.println("Height:" + aSize.Height);
+ System.out.println("");
- assure("Window pos size wrong", aSize.Width == width && aSize.Height == height && aPoint.X == x && aPoint.Y == y);
+ assertTrue("Window pos size wrong", aSize.Width == width && aSize.Height == height && aPoint.X == x && aPoint.Y == y);
// XToolkit aToolkit = xWindowPeer.getToolkit();
- m_xConversion = (XUnitConversion) UnoRuntime.queryInterface(XUnitConversion.class, xWindowPeer);
+ m_xConversion = UnoRuntime.queryInterface(XUnitConversion.class, xWindowPeer);
// try to get the position of the window in 1/100mm with the XUnitConversion method
try
{
com.sun.star.awt.Point aPointInMM_100TH = m_xConversion.convertPointToLogic(aPoint, com.sun.star.util.MeasureUnit.MM_100TH);
- log.println("Window position:");
- log.println("X:" + aPointInMM_100TH.X + " 1/100mm");
- log.println("Y:" + aPointInMM_100TH.Y + " 1/100mm");
- log.println("");
+ System.out.println("Window position:");
+ System.out.println("X:" + aPointInMM_100TH.X + " 1/100mm");
+ System.out.println("Y:" + aPointInMM_100TH.Y + " 1/100mm");
+ System.out.println("");
}
catch (com.sun.star.lang.IllegalArgumentException e)
{
- assure("failed: IllegalArgumentException caught in convertPointToLogic " + e.getMessage(), Boolean.FALSE);
+ fail("failed: IllegalArgumentException caught in convertPointToLogic " + e.getMessage());
}
// try to get the size of the window in 1/100mm with the XUnitConversion method
@@ -157,22 +168,22 @@ public class XUnitConversionTest extends ComplexTestCase
try
{
aSizeInMM_100TH = m_xConversion.convertSizeToLogic(aSize, com.sun.star.util.MeasureUnit.MM_100TH);
- log.println("Window size:");
- log.println("Width:" + aSizeInMM_100TH.Width + " 1/100mm");
- log.println("Height:" + aSizeInMM_100TH.Height + " 1/100mm");
- log.println("");
+ System.out.println("Window size:");
+ System.out.println("Width:" + aSizeInMM_100TH.Width + " 1/100mm");
+ System.out.println("Height:" + aSizeInMM_100TH.Height + " 1/100mm");
+ System.out.println("");
// try to get the size of the window in 1/10mm with the XUnitConversion method
aSizeInMM_10TH = m_xConversion.convertSizeToLogic(aSize, com.sun.star.util.MeasureUnit.MM_10TH);
- log.println("Window size:");
- log.println("Width:" + aSizeInMM_10TH.Width + " 1/10mm");
- log.println("Height:" + aSizeInMM_10TH.Height + " 1/10mm");
- log.println("");
+ System.out.println("Window size:");
+ System.out.println("Width:" + aSizeInMM_10TH.Width + " 1/10mm");
+ System.out.println("Height:" + aSizeInMM_10TH.Height + " 1/10mm");
+ System.out.println("");
// check the size with a delta which must be smaller a given difference
- assure("Size.Width not correct", delta(aSizeInMM_100TH.Width, aSizeInMM_10TH.Width * 10) < 10);
- assure("Size.Height not correct", delta(aSizeInMM_100TH.Height, aSizeInMM_10TH.Height * 10) < 10);
+ assertTrue("Size.Width not correct", delta(aSizeInMM_100TH.Width, aSizeInMM_10TH.Width * 10) < 10);
+ assertTrue("Size.Height not correct", delta(aSizeInMM_100TH.Height, aSizeInMM_10TH.Height * 10) < 10);
// new
checkSize(aSize, com.sun.star.util.MeasureUnit.PIXEL, "pixel");
@@ -196,27 +207,44 @@ public class XUnitConversionTest extends ComplexTestCase
}
catch (com.sun.star.lang.IllegalArgumentException e)
{
- assure("failed: IllegalArgumentException caught in convertSizeToLogic " + e.getMessage(), Boolean.FALSE);
+ fail("failed: IllegalArgumentException caught in convertSizeToLogic " + e.getMessage());
}
// convert the 1/100mm window size back to pixel
try
{
com.sun.star.awt.Size aNewSize = m_xConversion.convertSizeToPixel(aSizeInMM_100TH, com.sun.star.util.MeasureUnit.MM_100TH);
- log.println("Window size:");
- log.println("Width:" + aNewSize.Width + " pixel");
- log.println("Height:" + aNewSize.Height + " pixel");
+ System.out.println("Window size:");
+ System.out.println("Width:" + aNewSize.Width + " pixel");
+ System.out.println("Height:" + aNewSize.Height + " pixel");
// assure the pixels are the same as we already know
- assure("failed: Size from pixel to 1/100mm to pixel", aSize.Width == aNewSize.Width && aSize.Height == aNewSize.Height);
+ assertTrue("failed: Size from pixel to 1/100mm to pixel", aSize.Width == aNewSize.Width && aSize.Height == aNewSize.Height);
}
catch (com.sun.star.lang.IllegalArgumentException e)
{
- assure("failed: IllegalArgumentException caught in convertSizeToPixel " + e.getMessage(), Boolean.FALSE);
+ fail("failed: IllegalArgumentException caught in convertSizeToPixel " + e.getMessage());
}
// close the window.
// IMHO a little bit stupid, but the XWindow doesn't support a XCloseable interface
xWindow.dispose();
}
+
+
+
+ @BeforeClass public static void setUpConnection() throws Exception {
+ System.out.println("setUpConnection()");
+ connection.setUp();
+ }
+
+ @AfterClass public static void tearDownConnection()
+ throws InterruptedException, com.sun.star.uno.Exception
+ {
+ System.out.println("tearDownConnection()");
+ connection.tearDown();
+ }
+
+ private static final OfficeConnection connection = new OfficeConnection();
+
}
diff --git a/toolkit/qa/complex/xunitconversion/makefile.mk b/toolkit/qa/complex/xunitconversion/makefile.mk
index 18b59ee19f18..bc5a0e7c5949 100644
--- a/toolkit/qa/complex/xunitconversion/makefile.mk
+++ b/toolkit/qa/complex/xunitconversion/makefile.mk
@@ -25,53 +25,28 @@
#
#*************************************************************************
-PRJ = ..$/..$/..
-TARGET = XUnitConversionTest
-PRJNAME = $(TARGET)
-PACKAGE = complex$/xunitconversion
-
-# --- Settings -----------------------------------------------------
-.INCLUDE: settings.mk
-
-
-#----- compile .java files -----------------------------------------
-
-JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar
-JAVAFILES = XUnitConversionTest.java
-JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class)
-SUBDIRS =
-
-#----- make a jar from compiled files ------------------------------
-
-MAXLINELENGTH = 100000
-
-JARCLASSDIRS = $(PACKAGE)
-JARTARGET = $(TARGET).jar
-JARCOMPRESS = TRUE
-
-# --- Parameters for the test --------------------------------------
-
-# start an office if the parameter is set for the makefile
-.IF "$(OFFICE)" == ""
-CT_APPEXECCOMMAND =
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
.ELSE
-CT_APPEXECCOMMAND = -AppExecutionCommand "$(OFFICE)$/soffice -accept=socket,host=localhost,port=8100;urp;"
-.ENDIF
-
-# test base is java complex
-CT_TESTBASE = -tb java_complex
-# build up package name with "." instead of $/
-CT_PACKAGE = -o $(PACKAGE:s\$/\.\)
+PRJ = ../../..
+PRJNAME = sc
+TARGET = qa_complex_xunitconversiontest
-# start the runner application
-CT_APP = org.openoffice.Runner
+.IF "$(OOO_JUNIT_JAR)" != ""
+PACKAGE = complex/xunitconversion
-# --- Targets ------------------------------------------------------
+JAVATESTFILES = \
+ XUnitConversionTest.java
+JAVAFILES = $(JAVATESTFILES)
+JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar
+EXTRAJARFILES = $(OOO_JUNIT_JAR)
+.END
-.INCLUDE : target.mk
+.INCLUDE: settings.mk
+.INCLUDE: target.mk
+.INCLUDE: installationtest.mk
-run: $(JAVAFILES) XUnitConversionTest
+ALLTAR : javatest
-XUnitConversionTest:
- +java -cp $(CLASSPATH) $(CT_APP) $(CT_APPEXECCOMMAND) $(CT_TESTBASE) $(CT_PACKAGE).XUnitConversionTest
+.END
diff --git a/toolkit/qa/unoapi/knownissues.xcl b/toolkit/qa/unoapi/knownissues.xcl
index 429d7693c833..8df098a98c63 100644
--- a/toolkit/qa/unoapi/knownissues.xcl
+++ b/toolkit/qa/unoapi/knownissues.xcl
@@ -241,12 +241,21 @@ toolkit.AccessibleMenu::com::sun::star::accessibility::XAccessibleValue
toolkit.AccessibleMenuBar::com::sun::star::accessibility::XAccessibleEventBroadcaster
toolkit.AccessibleMenuBar::com::sun::star::accessibility::XAccessibleSelection
-### i111076 ###
-toolkit.Toolkit::com::sun::star::awt::XDataTransferProviderAccess
-
### i111113 ###
toolkit.AccessibleStatusBarItem::com::sun::star::accessibility::XAccessibleComponent
toolkit.AccessibleStatusBarItem::com::sun::star::accessibility::XAccessibleContext
### i111195 ###
toolkit.AccessibleScrollBar::com::sun::star::accessibility::XAccessibleValue
+
+### i113489 ###
+toolkit.AccessibleMenu::com::sun::star::accessibility::XAccessibleText
+toolkit.AccessibleMenuBar::com::sun::star::accessibility::XAccessibleComponent
+toolkit.AccessibleMenuSeparator::com::sun::star::accessibility::XAccessibleComponent
+
+### i114213 ###
+toolkit.AccessibleMenu::com::sun::star::accessibility::XAccessibleSelection
+
+### i114636 ###
+toolkit.AccessibleScrollBar::com::sun::star::accessibility::XAccessibleAction
+toolkit.AccessibleScrollBar::com::sun::star::accessibility::XAccessibleContext
diff --git a/toolkit/qa/unoapi/toolkit.sce b/toolkit/qa/unoapi/toolkit.sce
index 5a148feee573..00af010d23d6 100644
--- a/toolkit/qa/unoapi/toolkit.sce
+++ b/toolkit/qa/unoapi/toolkit.sce
@@ -8,10 +8,10 @@
#i86110 -o toolkit.AccessibleList
#i86110 -o toolkit.AccessibleListBox
#i86110 -o toolkit.AccessibleListItem
-#i111047# -o toolkit.AccessibleMenu
-#i111047# -o toolkit.AccessibleMenuBar
+-o toolkit.AccessibleMenu
+-o toolkit.AccessibleMenuBar
#i86009 -o toolkit.AccessibleMenuItem
-#i111047# -o toolkit.AccessibleMenuSeparator
+-o toolkit.AccessibleMenuSeparator
#i52607 -o toolkit.AccessiblePopupMenu
#i86107,i86110 -o toolkit.AccessibleRadioButton
-o toolkit.AccessibleScrollBar
diff --git a/toolkit/source/awt/asynccallback.cxx b/toolkit/source/awt/asynccallback.cxx
index 593feb582274..9e5334b2d28c 100644
--- a/toolkit/source/awt/asynccallback.cxx
+++ b/toolkit/source/awt/asynccallback.cxx
@@ -191,9 +191,3 @@ void * SAL_CALL comp_AsyncCallback_component_getFactory(
return ::cppu::component_getFactoryHelper(
implName, serviceManager, registryKey, entries);
}
-
-sal_Bool SAL_CALL comp_AsyncCallback_component_writeInfo(
- void * serviceManager, void * registryKey)
-{
- return ::cppu::component_writeInfoHelper(serviceManager, registryKey, entries);
-}
diff --git a/toolkit/source/awt/vclxdialog.cxx b/toolkit/source/awt/vclxdialog.cxx
index 43861c3ed347..70ebade69ddc 100644
--- a/toolkit/source/awt/vclxdialog.cxx
+++ b/toolkit/source/awt/vclxdialog.cxx
@@ -206,13 +206,13 @@ void VCLXDialog::setTitle( const ::rtl::OUString& Title ) throw(::com::sun::star
pWindow->SetText( Title );
}
-void VCLXDialog::setHelpId( sal_Int32 id ) throw(::com::sun::star::uno::RuntimeException)
+void VCLXDialog::setHelpId( const rtl::OUString& rId ) throw(::com::sun::star::uno::RuntimeException)
{
::vos::OGuard aGuard( GetMutex() );
Window* pWindow = GetWindow();
if ( pWindow )
- pWindow->SetHelpId( id );
+ pWindow->SetHelpId( rtl::OUStringToOString( rId, RTL_TEXTENCODING_UTF8 ) );
}
::rtl::OUString VCLXDialog::getTitle() throw(::com::sun::star::uno::RuntimeException)
diff --git a/toolkit/source/awt/vclxdialog.hxx b/toolkit/source/awt/vclxdialog.hxx
index 64b2c03f90d5..9d52064c68bf 100644
--- a/toolkit/source/awt/vclxdialog.hxx
+++ b/toolkit/source/awt/vclxdialog.hxx
@@ -98,7 +98,7 @@ public:
// ::com::sun::star::awt::XDialog2
void SAL_CALL endDialog( sal_Int32 nResult ) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL setHelpId( sal_Int32 id ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setHelpId( const rtl::OUString& id ) throw(::com::sun::star::uno::RuntimeException);
};
diff --git a/toolkit/source/awt/vclxgraphics.cxx b/toolkit/source/awt/vclxgraphics.cxx
index bfbdb531e8d2..edaf64799d43 100644
--- a/toolkit/source/awt/vclxgraphics.cxx
+++ b/toolkit/source/awt/vclxgraphics.cxx
@@ -109,7 +109,7 @@ void VCLXGraphics::InitOutputDevice( sal_uInt16 nFlags )
{
if(mpOutputDevice)
{
- NAMESPACE_VOS(OGuard) aVclGuard( Application::GetSolarMutex() );
+ vos::OGuard aVclGuard( Application::GetSolarMutex() );
if ( nFlags & INITOUTDEV_FONT )
{
diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx
index f85e29c21099..1af422bf7f00 100644
--- a/toolkit/source/awt/vclxtoolkit.cxx
+++ b/toolkit/source/awt/vclxtoolkit.cxx
@@ -659,7 +659,7 @@ Window* VCLXToolkit::ImplCreateWindow( VCLXWindow** ppNewComp,
if ( nType )
{
- NAMESPACE_VOS(OGuard) aVclGuard( Application::GetSolarMutex() );
+ vos::OGuard aVclGuard( Application::GetSolarMutex() );
switch ( (WindowType)nType )
{
case WINDOW_CANCELBUTTON:
diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx
index 1022d78a43ed..808f3578ef97 100644
--- a/toolkit/source/awt/vclxwindow.cxx
+++ b/toolkit/source/awt/vclxwindow.cxx
@@ -67,7 +67,7 @@
#include <comphelper/asyncnotification.hxx>
#include <toolkit/helper/solarrelease.hxx>
#include "stylesettings.hxx"
-
+#include <tools/urlobj.hxx>
#include <toolkit/helper/unopropertyarrayhelper.hxx>
#include <boost/bind.hpp>
@@ -1600,17 +1600,11 @@ void VCLXWindow::setProperty( const ::rtl::OUString& PropertyName, const ::com::
::rtl::OUString aURL;
if ( Value >>= aURL )
{
- String aHelpURL( aURL );
- String aPattern( RTL_CONSTASCII_USTRINGPARAM( "HID:" ) );
- if ( aHelpURL.CompareIgnoreCaseToAscii( aPattern, aPattern.Len() ) == COMPARE_EQUAL )
- {
- String aID = aHelpURL.Copy( aPattern.Len() );
- pWindow->SetHelpId( aID.ToInt32() );
- }
+ INetURLObject aHelpURL( aURL );
+ if ( aHelpURL.GetProtocol() == INET_PROT_HID )
+ pWindow->SetHelpId( rtl::OUStringToOString( aHelpURL.GetURLPath(), RTL_TEXTENCODING_UTF8 ) );
else
- {
- pWindow->SetSmartHelpId( SmartId( aHelpURL ) );
- }
+ pWindow->SetHelpId( rtl::OUStringToOString( aURL, RTL_TEXTENCODING_UTF8 ) );
}
}
break;
@@ -2081,19 +2075,8 @@ void VCLXWindow::setProperty( const ::rtl::OUString& PropertyName, const ::com::
break;
case BASEPROPERTY_HELPURL:
{
- SmartId aSmartId = GetWindow()->GetSmartHelpId();
- if( aSmartId.HasString() )
- {
- String aStrHelpId = aSmartId.GetStr();
- aProp <<= ::rtl::OUString( aStrHelpId );
- }
- else
- {
- ::rtl::OUStringBuffer aURL;
- aURL.appendAscii( "HID:" );
- aURL.append( (sal_Int32) GetWindow()->GetHelpId() );
- aProp <<= aURL.makeStringAndClear();
- }
+ rtl::OUString aHelpId( rtl::OStringToOUString( GetWindow()->GetHelpId(), RTL_TEXTENCODING_UTF8 ) );
+ aProp <<= ::rtl::OUString( aHelpId );
}
break;
case BASEPROPERTY_FONTDESCRIPTOR:
diff --git a/toolkit/source/awt/vclxwindow1.cxx b/toolkit/source/awt/vclxwindow1.cxx
index daea557d241a..3572607772dc 100644
--- a/toolkit/source/awt/vclxwindow1.cxx
+++ b/toolkit/source/awt/vclxwindow1.cxx
@@ -93,7 +93,7 @@ void VCLXWindow::SetSystemParent_Impl( const com::sun::star::uno::Any& rHandle )
// create system parent data
SystemParentData aSysParentData;
aSysParentData.nSize = sizeof ( SystemParentData );
-#if defined( WIN ) || defined( WNT ) || defined ( OS2 )
+#if defined( WNT ) || defined ( OS2 )
aSysParentData.hWnd = (HWND) nHandle;
#elif defined( QUARTZ )
aSysParentData.pView = reinterpret_cast<NSView*>(nHandle);
diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx
index db34c840f8eb..06c9167336a8 100644
--- a/toolkit/source/awt/vclxwindows.cxx
+++ b/toolkit/source/awt/vclxwindows.cxx
@@ -2324,13 +2324,13 @@ void SAL_CALL VCLXDialog::endDialog( ::sal_Int32 i_result ) throw (RuntimeExcept
pDialog->EndDialog( i_result );
}
-void SAL_CALL VCLXDialog::setHelpId( ::sal_Int32 i_id ) throw (RuntimeException)
+void SAL_CALL VCLXDialog::setHelpId( const ::rtl::OUString& rId ) throw (RuntimeException)
{
::vos::OGuard aGuard( GetMutex() );
Window* pWindow = GetWindow();
if ( pWindow )
- pWindow->SetHelpId( i_id );
+ pWindow->SetHelpId( rtl::OUStringToOString( rId, RTL_TEXTENCODING_UTF8 ) );
}
void VCLXDialog::setTitle( const ::rtl::OUString& Title ) throw(::com::sun::star::uno::RuntimeException)
diff --git a/toolkit/source/controls/dialogcontrol.cxx b/toolkit/source/controls/dialogcontrol.cxx
index c54549baed5e..ecb4d7765723 100644
--- a/toolkit/source/controls/dialogcontrol.cxx
+++ b/toolkit/source/controls/dialogcontrol.cxx
@@ -1990,7 +1990,7 @@ void SAL_CALL UnoDialogControl::endDialog( ::sal_Int32 i_result ) throw (Runtime
xPeerDialog->endDialog( i_result );
}
-void SAL_CALL UnoDialogControl::setHelpId( ::sal_Int32 i_id ) throw (RuntimeException)
+void SAL_CALL UnoDialogControl::setHelpId( const rtl::OUString& i_id ) throw (RuntimeException)
{
Reference< XDialog2 > xPeerDialog( getPeer(), UNO_QUERY );
if ( xPeerDialog.is() )
diff --git a/toolkit/source/controls/unocontrol.cxx b/toolkit/source/controls/unocontrol.cxx
index eb45dd521d9a..075080906900 100644
--- a/toolkit/source/controls/unocontrol.cxx
+++ b/toolkit/source/controls/unocontrol.cxx
@@ -653,7 +653,7 @@ void UnoControl::ImplModelPropertiesChanged( const Sequence< PropertyChangeEvent
// #82300# - 2000-12-21 - fs@openoffice.org
if (bNeedNewPeer && xParent.is())
{
- NAMESPACE_VOS(OGuard) aVclGuard( Application::GetSolarMutex() );
+ vos::OGuard aVclGuard( Application::GetSolarMutex() );
// and now this is the final withdrawal:
// With 83561, I have no other idea than locking the SolarMutex here ....
// I really hate the fact that VCL is not theadsafe ....
diff --git a/toolkit/source/controls/unocontrols.cxx b/toolkit/source/controls/unocontrols.cxx
index d0961188d06c..d3838a7421a4 100644
--- a/toolkit/source/controls/unocontrols.cxx
+++ b/toolkit/source/controls/unocontrols.cxx
@@ -592,7 +592,7 @@ void SAL_CALL GraphicControlModel::setFastPropertyValue_NoBroadcast( sal_Int32 n
mbAdjustingGraphic = true;
::rtl::OUString sImageURL;
OSL_VERIFY( rValue >>= sImageURL );
- setPropertyValue( GetPropertyName( BASEPROPERTY_GRAPHIC ), uno::makeAny( getGraphicFromURL_nothrow( sImageURL ) ) );
+ setDependentFastPropertyValue( BASEPROPERTY_GRAPHIC, uno::makeAny( getGraphicFromURL_nothrow( sImageURL ) ) );
mbAdjustingGraphic = false;
}
break;
@@ -601,7 +601,7 @@ void SAL_CALL GraphicControlModel::setFastPropertyValue_NoBroadcast( sal_Int32 n
if ( !mbAdjustingGraphic && ImplHasProperty( BASEPROPERTY_IMAGEURL ) )
{
mbAdjustingGraphic = true;
- setPropertyValue( GetPropertyName( BASEPROPERTY_IMAGEURL ), uno::makeAny( ::rtl::OUString() ) );
+ setDependentFastPropertyValue( BASEPROPERTY_IMAGEURL, uno::makeAny( ::rtl::OUString() ) );
mbAdjustingGraphic = false;
}
break;
@@ -612,7 +612,7 @@ void SAL_CALL GraphicControlModel::setFastPropertyValue_NoBroadcast( sal_Int32 n
mbAdjustingImagePosition = true;
sal_Int16 nUNOValue = 0;
OSL_VERIFY( rValue >>= nUNOValue );
- setPropertyValue( GetPropertyName( BASEPROPERTY_IMAGEPOSITION ), uno::makeAny( getExtendedImagePosition( nUNOValue ) ) );
+ setDependentFastPropertyValue( BASEPROPERTY_IMAGEPOSITION, uno::makeAny( getExtendedImagePosition( nUNOValue ) ) );
mbAdjustingImagePosition = false;
}
break;
@@ -622,7 +622,7 @@ void SAL_CALL GraphicControlModel::setFastPropertyValue_NoBroadcast( sal_Int32 n
mbAdjustingImagePosition = true;
sal_Int16 nUNOValue = 0;
OSL_VERIFY( rValue >>= nUNOValue );
- setPropertyValue( GetPropertyName( BASEPROPERTY_IMAGEALIGN ), uno::makeAny( getCompatibleImageAlign( translateImagePosition( nUNOValue ) ) ) );
+ setDependentFastPropertyValue( BASEPROPERTY_IMAGEALIGN, uno::makeAny( getCompatibleImageAlign( translateImagePosition( nUNOValue ) ) ) );
mbAdjustingImagePosition = false;
}
break;
@@ -888,7 +888,7 @@ void SAL_CALL UnoControlImageControlModel::setFastPropertyValue_NoBroadcast( sal
mbAdjustingImageScaleMode = true;
sal_Int16 nScaleMode( awt::ImageScaleMode::Anisotropic );
OSL_VERIFY( _rValue >>= nScaleMode );
- setPropertyValue( GetPropertyName( BASEPROPERTY_SCALEIMAGE ), uno::makeAny( sal_Bool( nScaleMode != awt::ImageScaleMode::None ) ) );
+ setDependentFastPropertyValue( BASEPROPERTY_SCALEIMAGE, uno::makeAny( sal_Bool( nScaleMode != awt::ImageScaleMode::None ) ) );
mbAdjustingImageScaleMode = false;
}
break;
@@ -898,7 +898,7 @@ void SAL_CALL UnoControlImageControlModel::setFastPropertyValue_NoBroadcast( sal
mbAdjustingImageScaleMode = true;
sal_Bool bScale = sal_True;
OSL_VERIFY( _rValue >>= bScale );
- setPropertyValue( GetPropertyName( BASEPROPERTY_IMAGE_SCALE_MODE ), uno::makeAny( bScale ? awt::ImageScaleMode::Anisotropic : awt::ImageScaleMode::None ) );
+ setDependentFastPropertyValue( BASEPROPERTY_IMAGE_SCALE_MODE, uno::makeAny( bScale ? awt::ImageScaleMode::Anisotropic : awt::ImageScaleMode::None ) );
mbAdjustingImageScaleMode = false;
}
break;
@@ -1917,7 +1917,7 @@ void SAL_CALL UnoControlListBoxModel::setFastPropertyValue_NoBroadcast( sal_Int3
uno::Sequence<sal_Int16> aSeq;
uno::Any aAny;
aAny <<= aSeq;
- setPropertyValue( GetPropertyName( BASEPROPERTY_SELECTEDITEMS ), aAny );
+ setDependentFastPropertyValue( BASEPROPERTY_SELECTEDITEMS, aAny );
if ( !m_pData->m_bSettingLegacyProperty )
{
diff --git a/toolkit/source/helper/registerservices.cxx b/toolkit/source/helper/registerservices.cxx
index aedf4024f2b9..477032538af8 100644
--- a/toolkit/source/helper/registerservices.cxx
+++ b/toolkit/source/helper/registerservices.cxx
@@ -205,10 +205,8 @@ extern ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL
extern ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL DefaultGridColumnModel_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& );
extern ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL GridColumn_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& );
-extern sal_Bool SAL_CALL comp_AsyncCallback_component_writeInfo( void * serviceManager, void * registryKey );
extern void * SAL_CALL comp_AsyncCallback_component_getFactory( const char * implName, void * serviceManager, void * registryKey );
-extern sal_Bool SAL_CALL comp_Layout_component_writeInfo( void * serviceManager, void * registryKey );
extern void * SAL_CALL comp_Layout_component_getFactory( const char * implName, void * serviceManager, void * registryKey );
extern "C"
@@ -219,91 +217,6 @@ TOOLKIT_DLLPUBLIC void SAL_CALL component_getImplementationEnvironment( const sa
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-TOOLKIT_DLLPUBLIC sal_Bool SAL_CALL component_writeInfo( void* _pServiceManager, void* _pRegistryKey )
-{
- if (_pRegistryKey)
- {
- ::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey > xRegistryKey =
- static_cast< ::com::sun::star::registry::XRegistryKey* >( _pRegistryKey );
-
- registerServices( xRegistryKey, "VCLXToolkit", szServiceName_Toolkit, szServiceName2_Toolkit );
- registerServices( xRegistryKey, "VCLXPopupMenu", szServiceName_PopupMenu, szServiceName2_PopupMenu );
- registerServices( xRegistryKey, "VCLXMenuBar", szServiceName_MenuBar, szServiceName2_MenuBar );
- registerServices( xRegistryKey, "VCLXPointer", szServiceName_Pointer, szServiceName2_Pointer );
- registerServices( xRegistryKey, "UnoControlContainer", szServiceName_UnoControlContainer, szServiceName2_UnoControlContainer );
- registerServices( xRegistryKey, "UnoControlContainerModel", szServiceName_UnoControlContainerModel, szServiceName2_UnoControlContainerModel );
- registerServices( xRegistryKey, "StdTabController", szServiceName_TabController, szServiceName2_TabController );
- registerServices( xRegistryKey, "StdTabControllerModel", szServiceName_TabControllerModel, szServiceName2_TabControllerModel );
- registerServices( xRegistryKey, "UnoDialogControl", szServiceName_UnoControlDialog, szServiceName2_UnoControlDialog );
- registerServices( xRegistryKey, "UnoControlDialogModel", szServiceName_UnoControlDialogModel, szServiceName2_UnoControlDialogModel );
- registerServices( xRegistryKey, "UnoEditControl", szServiceName_UnoControlEdit, szServiceName2_UnoControlEdit );
- registerServices( xRegistryKey, "UnoControlEditModel", szServiceName_UnoControlEditModel, szServiceName2_UnoControlEditModel );
- registerServices( xRegistryKey, "UnoDateFieldControl", szServiceName_UnoControlDateField, szServiceName2_UnoControlDateField );
- registerServices( xRegistryKey, "UnoControlDateFieldModel", szServiceName_UnoControlDateFieldModel, szServiceName2_UnoControlDateFieldModel );
- registerServices( xRegistryKey, "UnoTimeFieldControl", szServiceName_UnoControlTimeField, szServiceName2_UnoControlTimeField );
- registerServices( xRegistryKey, "UnoControlTimeFieldModel", szServiceName_UnoControlTimeFieldModel, szServiceName2_UnoControlTimeFieldModel );
- registerServices( xRegistryKey, "UnoNumericFieldControl", szServiceName_UnoControlNumericField, szServiceName2_UnoControlNumericField );
- registerServices( xRegistryKey, "UnoControlNumericFieldModel", szServiceName_UnoControlNumericFieldModel, szServiceName2_UnoControlNumericFieldModel );
- registerServices( xRegistryKey, "UnoCurrencyFieldControl", szServiceName_UnoControlCurrencyField, szServiceName2_UnoControlCurrencyField );
- registerServices( xRegistryKey, "UnoControlCurrencyFieldModel", szServiceName_UnoControlCurrencyFieldModel, szServiceName2_UnoControlCurrencyFieldModel );
- registerServices( xRegistryKey, "UnoPatternFieldControl", szServiceName_UnoControlPatternField, szServiceName2_UnoControlPatternField );
- registerServices( xRegistryKey, "UnoControlPatternFieldModel", szServiceName_UnoControlPatternFieldModel, szServiceName2_UnoControlPatternFieldModel );
- registerServices( xRegistryKey, "UnoFormattedFieldControl", szServiceName_UnoControlFormattedField, szServiceName2_UnoControlFormattedField );
- registerServices( xRegistryKey, "UnoControlFormattedFieldModel", szServiceName_UnoControlFormattedFieldModel, szServiceName2_UnoControlFormattedFieldModel );
- registerServices( xRegistryKey, "UnoFileControl", szServiceName_UnoControlFileControl, szServiceName2_UnoControlFileControl );
- registerServices( xRegistryKey, "UnoControlFileControlModel", szServiceName_UnoControlFileControlModel, szServiceName2_UnoControlFileControlModel );
- registerServices( xRegistryKey, "UnoButtonControl", szServiceName_UnoControlButton, szServiceName2_UnoControlButton );
- registerServices( xRegistryKey, "UnoControlButtonModel", szServiceName_UnoControlButtonModel, szServiceName2_UnoControlButtonModel );
- registerServices( xRegistryKey, "UnoImageControlControl", szServiceName_UnoControlImageButton, szServiceName2_UnoControlImageButton );
- registerServices( xRegistryKey, "UnoControlImageControlModel", szServiceName_UnoControlImageButtonModel, szServiceName2_UnoControlImageButtonModel );
- registerServices( xRegistryKey, "UnoImageControlControl", szServiceName_UnoControlImageControl, szServiceName2_UnoControlImageControl );
- registerServices( xRegistryKey, "UnoControlImageControlModel", szServiceName_UnoControlImageControlModel, szServiceName2_UnoControlImageControlModel );
- registerServices( xRegistryKey, "UnoRadioButtonControl", szServiceName_UnoControlRadioButton, szServiceName2_UnoControlRadioButton );
- registerServices( xRegistryKey, "UnoControlRadioButtonModel", szServiceName_UnoControlRadioButtonModel, szServiceName2_UnoControlRadioButtonModel );
- registerServices( xRegistryKey, "UnoCheckBoxControl", szServiceName_UnoControlCheckBox, szServiceName2_UnoControlCheckBox );
- registerServices( xRegistryKey, "UnoControlCheckBoxModel", szServiceName_UnoControlCheckBoxModel, szServiceName2_UnoControlCheckBoxModel );
- registerServices( xRegistryKey, "UnoListBoxControl", szServiceName_UnoControlListBox, szServiceName2_UnoControlListBox );
- registerServices( xRegistryKey, "UnoControlListBoxModel", szServiceName_UnoControlListBoxModel, szServiceName2_UnoControlListBoxModel );
- registerServices( xRegistryKey, "UnoComboBoxControl", szServiceName_UnoControlComboBox, szServiceName2_UnoControlComboBox );
- registerServices( xRegistryKey, "UnoControlComboBoxModel", szServiceName_UnoControlComboBoxModel, szServiceName2_UnoControlComboBoxModel );
- registerServices( xRegistryKey, "UnoFixedTextControl", szServiceName_UnoControlFixedText, szServiceName2_UnoControlFixedText );
- registerServices( xRegistryKey, "UnoControlFixedTextModel", szServiceName_UnoControlFixedTextModel, szServiceName2_UnoControlFixedTextModel );
- registerServices( xRegistryKey, "UnoGroupBoxControl", szServiceName_UnoControlGroupBox, szServiceName2_UnoControlGroupBox );
- registerServices( xRegistryKey, "UnoControlGroupBoxModel", szServiceName_UnoControlGroupBoxModel, szServiceName2_UnoControlGroupBoxModel );
- registerServices( xRegistryKey, "UnoProgressBarControl", szServiceName_UnoControlProgressBar, szServiceName2_UnoControlProgressBar );
- registerServices( xRegistryKey, "UnoControlProgressBarModel", szServiceName_UnoControlProgressBarModel, szServiceName2_UnoControlProgressBarModel );
- registerServices( xRegistryKey, "UnoScrollBarControl", szServiceName_UnoControlScrollBar, szServiceName2_UnoControlScrollBar );
- registerServices( xRegistryKey, "UnoControlScrollBarModel", szServiceName_UnoControlScrollBarModel, szServiceName2_UnoControlScrollBarModel );
- registerServices( xRegistryKey, "UnoSpinButtonModel", szServiceName_UnoSpinButtonModel );
- registerServices( xRegistryKey, "UnoSpinButtonControl", szServiceName_UnoSpinButtonControl );
- registerServices( xRegistryKey, "UnoFixedLineControl", szServiceName_UnoControlFixedLine, szServiceName2_UnoControlFixedLine );
- registerServices( xRegistryKey, "UnoControlFixedLineModel", szServiceName_UnoControlFixedLineModel, szServiceName2_UnoControlFixedLineModel );
- registerServices( xRegistryKey, "VCLXPrinterServer", szServiceName_PrinterServer, szServiceName2_PrinterServer );
- registerServices( xRegistryKey, "UnoRoadmapControl", szServiceName_UnoControlRoadmap, szServiceName2_UnoControlRoadmap );
- registerServices( xRegistryKey, "UnoControlRoadmapModel", szServiceName_UnoControlRoadmapModel, szServiceName2_UnoControlRoadmapModel );
- registerServices( xRegistryKey, "TreeControl", szServiceName_TreeControl );
- registerServices( xRegistryKey, "TreeControlModel", szServiceName_TreeControlModel );
- registerServices( xRegistryKey, "MutableTreeDataModel", szServiceName_MutableTreeDataModel );
- registerServices( xRegistryKey, "UnoSimpleAnimationControlModel", szServiceName_UnoSimpleAnimationControlModel, szServiceName2_UnoSimpleAnimationControlModel );
- registerServices( xRegistryKey, "UnoSimpleAnimationControl", szServiceName_UnoSimpleAnimationControl, szServiceName2_UnoSimpleAnimationControl );
- registerServices( xRegistryKey, "UnoThrobberControlModel", szServiceName_UnoThrobberControlModel, szServiceName2_UnoThrobberControlModel );
- registerServices( xRegistryKey, "UnoThrobberControl", szServiceName_UnoThrobberControl, szServiceName2_UnoThrobberControl );
- registerServices( xRegistryKey, "UnoFixedHyperlinkControl", szServiceName_UnoControlFixedHyperlink );
- registerServices( xRegistryKey, "UnoControlFixedHyperlinkModel", szServiceName_UnoControlFixedHyperlinkModel );
- registerServices( xRegistryKey, "GridControl", szServiceName_GridControl );
- registerServices( xRegistryKey, "GridControlModel", szServiceName_GridControlModel );
- registerServices( xRegistryKey, "DefaultGridDataModel", szServiceName_DefaultGridDataModel );
- registerServices( xRegistryKey, "DefaultGridColumnModel", szServiceName_DefaultGridColumnModel );
- registerServices( xRegistryKey, "GridColumn", szServiceName_GridColumn );
-
- comp_AsyncCallback_component_writeInfo( _pServiceManager, _pRegistryKey );
- comp_Layout_component_writeInfo( _pServiceManager, _pRegistryKey );
-
- return sal_True;
- }
- return sal_False;
-}
-
TOOLKIT_DLLPUBLIC void* SAL_CALL component_getFactory( const sal_Char* sImplementationName, void* _pServiceManager, void* _pRegistryKey )
{
void* pRet = NULL;
diff --git a/toolkit/source/layout/core/factory.cxx b/toolkit/source/layout/core/factory.cxx
index db9616a8cc77..1390d9405f71 100644
--- a/toolkit/source/layout/core/factory.cxx
+++ b/toolkit/source/layout/core/factory.cxx
@@ -57,33 +57,6 @@ void * SAL_CALL comp_Layout_component_getFactory( const char * pImplName, void *
return pRet;
}
-sal_Bool SAL_CALL comp_Layout_component_writeInfo( void * /*serviceManager*/, void * pRegistryKey )
- {
- if ( pRegistryKey )
- {
- try
- {
- uno::Reference< registry::XRegistryKey > xKey( reinterpret_cast< registry::XRegistryKey* >( pRegistryKey ) );
- uno::Reference< registry::XRegistryKey > xNewKey;
-
- xNewKey = xKey->createKey( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) +
- LayoutFactory::impl_staticGetImplementationName() +
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES") ) );
-
- const uno::Sequence< ::rtl::OUString > aServices = LayoutFactory::impl_staticGetSupportedServiceNames();
- for ( sal_Int32 i = 0; i < aServices.getLength(); i++ )
- xNewKey->createKey( aServices.getConstArray()[i] );
-
- return sal_True;
- }
- catch (registry::InvalidRegistryException &)
- {
- OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
- }
- }
- return sal_False;
- }
-
// Component registration
::rtl::OUString SAL_CALL LayoutFactory::impl_staticGetImplementationName()
{
diff --git a/toolkit/source/layout/core/import.cxx b/toolkit/source/layout/core/import.cxx
index 6d161cf1b07e..84e46f5b68f1 100644
--- a/toolkit/source/layout/core/import.cxx
+++ b/toolkit/source/layout/core/import.cxx
@@ -101,7 +101,7 @@ SAL_THROW (())
if ( findAndRemove( "help-id", aProps, aHelpId ) )
{
OSL_TRACE("Setting help-id: %s", OUSTRING_CSTR( aHelpId ) );
- xDialog->setHelpId( aHelpId.toInt32 () );
+ xDialog->setHelpId( aHelpId );
}
} // DEBUG:
else if ( pParent == NULL )
diff --git a/toolkit/source/layout/vcl/wrapper.cxx b/toolkit/source/layout/vcl/wrapper.cxx
index a8133250eb58..3b23ee92636b 100644
--- a/toolkit/source/layout/vcl/wrapper.cxx
+++ b/toolkit/source/layout/vcl/wrapper.cxx
@@ -304,13 +304,17 @@ void Window::setRes (ResId const& res)
{
return Resource::ReadStringRes ();
}
+ rtl::OString ReadByteStringRes()
+ {
+ return Resource::ReadByteStringRes();
+ }
};
Resource_open_up r (res);
#endif /* !RESOURCE_PUBLISH_PROTECTED */
- if (sal_uInt32 help_id = (sal_uInt32)r.GetLongRes (static_cast<char *> (r.GetClassRes ()) + 12))
- SetHelpId (help_id);
sal_uInt32 mask = r.ReadLongRes ();
+ if (mask & WINDOW_HELPID)
+ SetHelpId (r.ReadByteStringRes());
if ( mask & WINDOW_TEXT )
SetText( r.ReadStringRes ());
}
@@ -366,26 +370,16 @@ VCLXWindow* Window::GetVCLXWindow() const
return GetWindow()->GetParent();
}
-void Window::SetHelpId( sal_uIntPtr id )
+void Window::SetHelpId( const rtl::OString& id )
{
GetWindow()->SetHelpId( id );
}
-sal_uIntPtr Window::GetHelpId() const
+const rtl::OString& Window::GetHelpId() const
{
return GetWindow()->GetHelpId();
}
-void Window::SetSmartHelpId( SmartId const& id, SmartIdUpdateMode mode )
-{
- GetWindow()->SetSmartHelpId( id, mode );
-}
-
-SmartId Window::GetSmartHelpId() const
-{
- return GetWindow()->GetSmartHelpId();
-}
-
void Window::EnterWait ()
{
GetWindow()->EnterWait ();
@@ -866,7 +860,7 @@ void Dialog::Initialize (SfxChildWinInfo*)
, yesButton (this, "BTN_YES")
MessageBox::MessageBox (::Window *parent, char const* message,
- char const* yes, char const* no, sal_uIntPtr help_id,
+ char const* yes, char const* no, const rtl::OString& help_id,
char const* xml_file, char const* id)
: MESSAGE_BOX_MEMBER_INIT
{
@@ -876,7 +870,7 @@ MessageBox::MessageBox (::Window *parent, char const* message,
}
MessageBox::MessageBox (::Window *parent, OUString const& message,
- OUString yes, OUString no, sal_uIntPtr help_id,
+ OUString yes, OUString no, const rtl::OString& help_id,
char const* xml_file, char const* id)
: MESSAGE_BOX_MEMBER_INIT
{
@@ -890,7 +884,7 @@ MessageBox::MessageBox (::Window *parent, OUString const& message,
#endif /* !__GNUC__ */
MessageBox::MessageBox (::Window *parent, WinBits bits, char const* message,
- char const* yes, char const* no, sal_uIntPtr help_id,
+ char const* yes, char const* no, const rtl::OString& help_id,
char const* xml_file, char const* id)
: MESSAGE_BOX_MEMBER_INIT
{
@@ -903,7 +897,7 @@ MessageBox::MessageBox (::Window *parent, WinBits bits, char const* message,
}
MessageBox::MessageBox (::Window *parent, WinBits bits, OUString const& message,
- OUString yes, OUString no, sal_uIntPtr help_id,
+ OUString yes, OUString no, const rtl::OString& help_id,
char const* xml_file, char const* id)
: MESSAGE_BOX_MEMBER_INIT
{
@@ -916,7 +910,7 @@ MessageBox::MessageBox (::Window *parent, WinBits bits, OUString const& message,
}
void MessageBox::bits_init (WinBits bits, OUString const& message,
- OUString yes, OUString no, sal_uIntPtr help_id)
+ OUString yes, OUString no, const rtl::OString& help_id)
{
if ( bits & ( WB_OK_CANCEL | WB_OK ))
yes = Button::GetStandardText ( BUTTON_OK );
@@ -941,12 +935,12 @@ void MessageBox::bits_init (WinBits bits, OUString const& message,
init (message, yes, no, help_id);
}
-void MessageBox::init (char const* message, char const* yes, char const* no, sal_uIntPtr help_id)
+void MessageBox::init (char const* message, char const* yes, char const* no, const rtl::OString& help_id)
{
init ( OUString::createFromAscii (message), OUString::createFromAscii (yes), OUString::createFromAscii (no), help_id);
}
-void MessageBox::init (OUString const& message, OUString const& yes, OUString const& no, sal_uIntPtr help_id)
+void MessageBox::init (OUString const& message, OUString const& yes, OUString const& no, const rtl::OString& help_id)
{
imageError.Hide ();
imageInfo.Hide ();
@@ -974,28 +968,28 @@ void MessageBox::init (OUString const& message, OUString const& yes, OUString co
#undef MESSAGE_BOX_IMPL
#define MESSAGE_BOX_IMPL(Name)\
Name##Box::Name##Box (::Window *parent, char const* message,\
- char const* yes, char const* no, sal_uIntPtr help_id,\
+ char const* yes, char const* no, const rtl::OString& help_id,\
char const* xml_file, char const* id)\
: MessageBox (parent, message, yes, no, help_id, xml_file, id)\
{\
image##Name.Show ();\
}\
Name##Box::Name##Box (::Window *parent, OUString const& message,\
- OUString yes, OUString no, sal_uIntPtr help_id,\
+ OUString yes, OUString no, const rtl::OString& help_id,\
char const* xml_file, char const* id)\
: MessageBox (parent, message, yes, no, help_id, xml_file, id)\
{\
image##Name.Show ();\
}\
Name##Box::Name##Box (::Window *parent, WinBits bits, char const* message,\
- char const* yes, char const* no, sal_uIntPtr help_id,\
+ char const* yes, char const* no, const rtl::OString& help_id,\
char const* xml_file, char const* id)\
: MessageBox (parent, bits, message, yes, no, help_id, xml_file, id)\
{\
image##Name.Show ();\
}\
Name##Box::Name##Box (::Window *parent, WinBits bits, OUString const& message,\
- OUString yes, OUString no, sal_uIntPtr help_id,\
+ OUString yes, OUString no, const rtl::OString& help_id,\
char const* xml_file, char const* id)\
: MessageBox (parent, bits, message, yes, no, help_id, xml_file, id)\
{\
diff --git a/toolkit/util/makefile.mk b/toolkit/util/makefile.mk
index 48d534a8a9b3..2e9adce4f6bd 100644
--- a/toolkit/util/makefile.mk
+++ b/toolkit/util/makefile.mk
@@ -83,3 +83,11 @@ RESLIB1SRSFILES=$(RES1FILELIST)
# --- Footer -------------------------------------------------------------
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/tk.component
+
+$(MISC)/tk.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ tk.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt tk.component
diff --git a/toolkit/util/tk.component b/toolkit/util/tk.component
new file mode 100644
index 000000000000..e782283c39eb
--- /dev/null
+++ b/toolkit/util/tk.component
@@ -0,0 +1,298 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.awt.comp.AsyncCallback">
+ <service name="com.sun.star.awt.AsyncCallback"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.awt.Layout">
+ <service name="com.sun.star.awt.Layout"/>
+ <service name="com.sun.star.comp.awt.Layout"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.DefaultGridColumnModel">
+ <service name="com.sun.star.awt.grid.DefaultGridColumnModel"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.DefaultGridDataModel">
+ <service name="com.sun.star.awt.grid.DefaultGridDataModel"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.GridColumn">
+ <service name="com.sun.star.awt.grid.GridColumn"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.GridControl">
+ <service name="com.sun.star.awt.grid.UnoControlGrid"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.GridControlModel">
+ <service name="com.sun.star.awt.grid.UnoControlGridModel"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.MutableTreeDataModel">
+ <service name="com.sun.star.awt.tree.MutableTreeDataModel"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.StdTabController">
+ <service name="com.sun.star.awt.TabController"/>
+ <service name="stardiv.vcl.control.TabController"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.StdTabControllerModel">
+ <service name="com.sun.star.awt.TabControllerModel"/>
+ <service name="stardiv.vcl.controlmodel.TabController"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.TreeControl">
+ <service name="com.sun.star.awt.tree.TreeControl"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.TreeControlModel">
+ <service name="com.sun.star.awt.tree.TreeControlModel"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoButtonControl">
+ <service name="com.sun.star.awt.UnoControlButton"/>
+ <service name="stardiv.vcl.control.Button"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoCheckBoxControl">
+ <service name="com.sun.star.awt.UnoControlCheckBox"/>
+ <service name="stardiv.vcl.control.CheckBox"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoComboBoxControl">
+ <service name="com.sun.star.awt.UnoControlComboBox"/>
+ <service name="stardiv.vcl.control.ComboBox"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoControlButtonModel">
+ <service name="com.sun.star.awt.UnoControlButtonModel"/>
+ <service name="stardiv.vcl.controlmodel.Button"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoControlCheckBoxModel">
+ <service name="com.sun.star.awt.UnoControlCheckBoxModel"/>
+ <service name="stardiv.vcl.controlmodel.CheckBox"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoControlComboBoxModel">
+ <service name="com.sun.star.awt.UnoControlComboBoxModel"/>
+ <service name="stardiv.vcl.controlmodel.ComboBox"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoControlContainer">
+ <service name="com.sun.star.awt.UnoControlContainer"/>
+ <service name="stardiv.vcl.control.ControlContainer"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoControlContainerModel">
+ <service name="com.sun.star.awt.UnoControlContainerModel"/>
+ <service name="stardiv.vcl.controlmodel.ControlContainer"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoControlCurrencyFieldModel">
+ <service name="com.sun.star.awt.UnoControlCurrencyFieldModel"/>
+ <service name="stardiv.vcl.controlmodel.CurrencyField"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoControlDateFieldModel">
+ <service name="com.sun.star.awt.UnoControlDateFieldModel"/>
+ <service name="stardiv.vcl.controlmodel.DateField"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoControlDialogModel">
+ <service name="com.sun.star.awt.UnoControlDialogModel"/>
+ <service name="stardiv.vcl.controlmodel.Dialog"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoControlEditModel">
+ <service name="com.sun.star.awt.UnoControlEditModel"/>
+ <service name="stardiv.vcl.controlmodel.Edit"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoControlFileControlModel">
+ <service name="com.sun.star.awt.UnoControlFileControlModel"/>
+ <service name="stardiv.vcl.controlmodel.FileControl"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoControlFixedHyperlinkModel">
+ <service name="com.sun.star.awt.UnoControlFixedHyperlinkModel"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoControlFixedLineModel">
+ <service name="com.sun.star.awt.UnoControlFixedLineModel"/>
+ <service name="stardiv.vcl.controlmodel.FixedLine"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoControlFixedTextModel">
+ <service name="com.sun.star.awt.UnoControlFixedTextModel"/>
+ <service name="stardiv.vcl.controlmodel.FixedText"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoControlFormattedFieldModel">
+ <service name="com.sun.star.awt.UnoControlFormattedFieldModel"/>
+ <service name="stardiv.vcl.controlmodel.FormattedField"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoControlGroupBoxModel">
+ <service name="com.sun.star.awt.UnoControlGroupBoxModel"/>
+ <service name="stardiv.vcl.controlmodel.GroupBox"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoControlImageControlModel">
+ <service name="com.sun.star.awt.UnoControlImageButtonModel"/>
+ <service name="com.sun.star.awt.UnoControlImageControlModel"/>
+ <service name="stardiv.vcl.controlmodel.ImageButton"/>
+ <service name="stardiv.vcl.controlmodel.ImageControl"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoControlListBoxModel">
+ <service name="com.sun.star.awt.UnoControlListBoxModel"/>
+ <service name="stardiv.vcl.controlmodel.ListBox"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoControlNumericFieldModel">
+ <service name="com.sun.star.awt.UnoControlNumericFieldModel"/>
+ <service name="stardiv.vcl.controlmodel.NumericField"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoControlPatternFieldModel">
+ <service name="com.sun.star.awt.UnoControlPatternFieldModel"/>
+ <service name="stardiv.vcl.controlmodel.PatternField"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoControlProgressBarModel">
+ <service name="com.sun.star.awt.UnoControlProgressBarModel"/>
+ <service name="stardiv.vcl.controlmodel.ProgressBar"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoControlRadioButtonModel">
+ <service name="com.sun.star.awt.UnoControlRadioButtonModel"/>
+ <service name="stardiv.vcl.controlmodel.RadioButton"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoControlRoadmapModel">
+ <service name="com.sun.star.awt.UnoControlRoadmapModel"/>
+ <service name="stardiv.vcl.controlmodel.Roadmap"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoControlScrollBarModel">
+ <service name="com.sun.star.awt.UnoControlScrollBarModel"/>
+ <service name="stardiv.vcl.controlmodel.ScrollBar"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoControlTimeFieldModel">
+ <service name="com.sun.star.awt.UnoControlTimeFieldModel"/>
+ <service name="stardiv.vcl.controlmodel.TimeField"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoCurrencyFieldControl">
+ <service name="com.sun.star.awt.UnoControlCurrencyField"/>
+ <service name="stardiv.vcl.control.CurrencyField"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoDateFieldControl">
+ <service name="com.sun.star.awt.UnoControlDateField"/>
+ <service name="stardiv.vcl.control.DateField"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoDialogControl">
+ <service name="com.sun.star.awt.UnoControlDialog"/>
+ <service name="stardiv.vcl.control.Dialog"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoEditControl">
+ <service name="com.sun.star.awt.UnoControlEdit"/>
+ <service name="stardiv.vcl.control.Edit"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoFileControl">
+ <service name="com.sun.star.awt.UnoControlFileControl"/>
+ <service name="stardiv.vcl.control.FileControl"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoFixedHyperlinkControl">
+ <service name="com.sun.star.awt.UnoControlFixedHyperlink"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoFixedLineControl">
+ <service name="com.sun.star.awt.UnoControlFixedLine"/>
+ <service name="stardiv.vcl.control.FixedLine"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoFixedTextControl">
+ <service name="com.sun.star.awt.UnoControlFixedText"/>
+ <service name="stardiv.vcl.control.FixedText"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoFormattedFieldControl">
+ <service name="com.sun.star.awt.UnoControlFormattedField"/>
+ <service name="stardiv.vcl.control.FormattedField"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoGroupBoxControl">
+ <service name="com.sun.star.awt.UnoControlGroupBox"/>
+ <service name="stardiv.vcl.control.GroupBox"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoImageControlControl">
+ <service name="com.sun.star.awt.UnoControlImageButton"/>
+ <service name="com.sun.star.awt.UnoControlImageControl"/>
+ <service name="stardiv.vcl.control.ImageButton"/>
+ <service name="stardiv.vcl.control.ImageControl"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoListBoxControl">
+ <service name="com.sun.star.awt.UnoControlListBox"/>
+ <service name="stardiv.vcl.control.ListBox"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoNumericFieldControl">
+ <service name="com.sun.star.awt.UnoControlNumericField"/>
+ <service name="stardiv.vcl.control.NumericField"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoPatternFieldControl">
+ <service name="com.sun.star.awt.UnoControlPatternField"/>
+ <service name="stardiv.vcl.control.PatternField"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoProgressBarControl">
+ <service name="com.sun.star.awt.UnoControlProgressBar"/>
+ <service name="stardiv.vcl.control.ProgressBar"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoRadioButtonControl">
+ <service name="com.sun.star.awt.UnoControlRadioButton"/>
+ <service name="stardiv.vcl.control.RadioButton"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoRoadmapControl">
+ <service name="com.sun.star.awt.UnoControlRoadmap"/>
+ <service name="stardiv.vcl.control.Roadmap"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoScrollBarControl">
+ <service name="com.sun.star.awt.UnoControlScrollBar"/>
+ <service name="stardiv.vcl.control.ScrollBar"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoSimpleAnimationControl">
+ <service name="com.sun.star.awt.UnoControlSimpleAnimation"/>
+ <service name="com.sun.star.awt.UnoSimpleAnimationControl"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoSimpleAnimationControlModel">
+ <service name="com.sun.star.awt.UnoControlSimpleAnimationModel"/>
+ <service name="com.sun.star.awt.UnoSimpleAnimationControlModel"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoSpinButtonControl">
+ <service name="com.sun.star.awt.UnoControlSpinButton"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoSpinButtonModel">
+ <service name="com.sun.star.awt.UnoControlSpinButtonModel"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoThrobberControl">
+ <service name="com.sun.star.awt.UnoControlThrobber"/>
+ <service name="com.sun.star.awt.UnoThrobberControl"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoThrobberControlModel">
+ <service name="com.sun.star.awt.UnoControlThrobberModel"/>
+ <service name="com.sun.star.awt.UnoThrobberControlModel"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoTimeFieldControl">
+ <service name="com.sun.star.awt.UnoControlTimeField"/>
+ <service name="stardiv.vcl.control.TimeField"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.VCLXMenuBar">
+ <service name="com.sun.star.awt.MenuBar"/>
+ <service name="stardiv.vcl.MenuBar"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.VCLXPointer">
+ <service name="com.sun.star.awt.Pointer"/>
+ <service name="stardiv.vcl.Pointer"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.VCLXPopupMenu">
+ <service name="com.sun.star.awt.PopupMenu"/>
+ <service name="stardiv.vcl.PopupMenu"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.VCLXPrinterServer">
+ <service name="com.sun.star.awt.PrinterServer"/>
+ <service name="stardiv.vcl.PrinterServer"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.VCLXToolkit">
+ <service name="com.sun.star.awt.Toolkit"/>
+ <service name="stardiv.vcl.VclToolkit"/>
+ </implementation>
+</component>
diff --git a/toolkit/workben/layout/sortdlg.src b/toolkit/workben/layout/sortdlg.src
index 5e855962af96..e9e2b7a0a26b 100644
--- a/toolkit/workben/layout/sortdlg.src
+++ b/toolkit/workben/layout/sortdlg.src
@@ -33,6 +33,7 @@ TabPage RID_SCPAGE_SORT_FIELDS
Size = MAP_APPFONT ( 260 , 185 ) ;
ListBox LB_SORT1
{
+ HelpID = "toolkit:ListBox:RID_SCPAGE_SORT_FIELDS:LB_SORT1";
Border = TRUE ;
Pos = MAP_APPFONT ( 12 , 19 ) ;
Size = MAP_APPFONT ( 154 , 90 ) ;
@@ -41,6 +42,7 @@ TabPage RID_SCPAGE_SORT_FIELDS
};
RadioButton BTN_UP1
{
+ HelpID = "toolkit:RadioButton:RID_SCPAGE_SORT_FIELDS:BTN_UP1";
Pos = MAP_APPFONT ( 172 , 14 ) ;
Size = MAP_APPFONT ( 79 , 10 ) ;
Text [ en-US ] = "~Ascending" ;
@@ -48,6 +50,7 @@ TabPage RID_SCPAGE_SORT_FIELDS
};
RadioButton BTN_DOWN1
{
+ HelpID = "toolkit:RadioButton:RID_SCPAGE_SORT_FIELDS:BTN_DOWN1";
Pos = MAP_APPFONT ( 172 , 28 ) ;
Size = MAP_APPFONT ( 79 , 10 ) ;
Text [ en-US ] = "~Descending" ;
@@ -61,6 +64,7 @@ TabPage RID_SCPAGE_SORT_FIELDS
};
ListBox LB_SORT2
{
+ HelpID = "toolkit:ListBox:RID_SCPAGE_SORT_FIELDS:LB_SORT2";
Border = TRUE ;
Pos = MAP_APPFONT ( 12 , 60 ) ;
Size = MAP_APPFONT ( 154 , 90 ) ;
@@ -69,6 +73,7 @@ TabPage RID_SCPAGE_SORT_FIELDS
};
RadioButton BTN_UP2
{
+ HelpID = "toolkit:RadioButton:RID_SCPAGE_SORT_FIELDS:BTN_UP2";
Pos = MAP_APPFONT ( 172 , 55 ) ;
Size = MAP_APPFONT ( 79 , 10 ) ;
Text [ en-US ] = "A~scending" ;
@@ -76,6 +81,7 @@ TabPage RID_SCPAGE_SORT_FIELDS
};
RadioButton BTN_DOWN2
{
+ HelpID = "toolkit:RadioButton:RID_SCPAGE_SORT_FIELDS:BTN_DOWN2";
Pos = MAP_APPFONT ( 172 , 69 ) ;
Size = MAP_APPFONT ( 79 , 10 ) ;
Text [ en-US ] = "D~escending" ;
@@ -89,6 +95,7 @@ TabPage RID_SCPAGE_SORT_FIELDS
};
ListBox LB_SORT3
{
+ HelpID = "toolkit:ListBox:RID_SCPAGE_SORT_FIELDS:LB_SORT3";
Border = TRUE ;
Pos = MAP_APPFONT ( 12 , 101 ) ;
Size = MAP_APPFONT ( 154 , 90 ) ;
@@ -97,6 +104,7 @@ TabPage RID_SCPAGE_SORT_FIELDS
};
RadioButton BTN_UP3
{
+ HelpID = "toolkit:RadioButton:RID_SCPAGE_SORT_FIELDS:BTN_UP3";
Pos = MAP_APPFONT ( 172 , 96 ) ;
Size = MAP_APPFONT ( 79 , 10 ) ;
Text [ en-US ] = "As~cending" ;
@@ -104,6 +112,7 @@ TabPage RID_SCPAGE_SORT_FIELDS
};
RadioButton BTN_DOWN3
{
+ HelpID = "toolkit:RadioButton:RID_SCPAGE_SORT_FIELDS:BTN_DOWN3";
Pos = MAP_APPFONT ( 172 , 110 ) ;
Size = MAP_APPFONT ( 79 , 10 ) ;
Text [ en-US ] = "Desce~nding" ;
@@ -125,6 +134,7 @@ TabPage RID_SCPAGE_SORT_OPTIONS
Size = MAP_APPFONT ( 260 , 185 ) ;
CheckBox BTN_CASESENSITIVE
{
+ HelpID = "toolkit:CheckBox:RID_SCPAGE_SORT_OPTIONS:BTN_CASESENSITIVE";
Pos = MAP_APPFONT ( 12 , 6 ) ;
Size = MAP_APPFONT ( 242 , 10 ) ;
Text [ en-US ] = "Case ~sensitive" ;
@@ -132,6 +142,7 @@ TabPage RID_SCPAGE_SORT_OPTIONS
};
CheckBox BTN_LABEL
{
+ HelpID = "toolkit:CheckBox:RID_SCPAGE_SORT_OPTIONS:BTN_LABEL";
Pos = MAP_APPFONT ( 12 , 20 ) ;
Size = MAP_APPFONT ( 242 , 10 ) ;
TabStop = TRUE ;
@@ -146,6 +157,7 @@ TabPage RID_SCPAGE_SORT_OPTIONS
};
CheckBox BTN_FORMATS
{
+ HelpID = "toolkit:CheckBox:RID_SCPAGE_SORT_OPTIONS:BTN_FORMATS";
Pos = MAP_APPFONT ( 12 , 34 ) ;
Size = MAP_APPFONT ( 242 , 10 ) ;
Text [ en-US ] = "Include ~formats" ;
@@ -153,6 +165,7 @@ TabPage RID_SCPAGE_SORT_OPTIONS
};
CheckBox BTN_NATURALSORT
{
+ HelpID = "toolkit:CheckBox:RID_SCPAGE_SORT_OPTIONS:BTN_NATURALSORT";
Pos = MAP_APPFONT ( 12 , 48 ) ;
Size = MAP_APPFONT ( 242 , 10 ) ;
Text [ de ] = "Enable ~natural sort" ;
@@ -164,6 +177,7 @@ TabPage RID_SCPAGE_SORT_OPTIONS
};
CheckBox BTN_COPYRESULT
{
+ HelpID = "toolkit:CheckBox:RID_SCPAGE_SORT_OPTIONS:BTN_COPYRESULT";
Pos = MAP_APPFONT ( 12 , 62 ) ;
Size = MAP_APPFONT ( 242 , 10 ) ;
Text [ en-US ] = "~Copy sort results to:" ;
@@ -171,6 +185,7 @@ TabPage RID_SCPAGE_SORT_OPTIONS
};
ListBox LB_OUTAREA
{
+ HelpID = "toolkit:ListBox:RID_SCPAGE_SORT_OPTIONS:LB_OUTAREA";
Border = TRUE ;
Pos = MAP_APPFONT ( 20 , 73 ) ;
Size = MAP_APPFONT ( 93 , 90 ) ;
@@ -179,6 +194,7 @@ TabPage RID_SCPAGE_SORT_OPTIONS
};
Edit ED_OUTAREA
{
+ HelpID = "toolkit:Edit:RID_SCPAGE_SORT_OPTIONS:ED_OUTAREA";
Disable = TRUE ;
Border = TRUE ;
Pos = MAP_APPFONT ( 119 , 73 ) ;
@@ -187,6 +203,7 @@ TabPage RID_SCPAGE_SORT_OPTIONS
};
CheckBox BTN_SORT_USER
{
+ HelpID = "toolkit:CheckBox:RID_SCPAGE_SORT_OPTIONS:BTN_SORT_USER";
Pos = MAP_APPFONT ( 12 , 89 ) ;
Size = MAP_APPFONT ( 242 , 10 ) ;
Text [ en-US ] = "Custom sort ~order" ;
@@ -194,6 +211,7 @@ TabPage RID_SCPAGE_SORT_OPTIONS
};
ListBox LB_SORT_USER
{
+ HelpID = "toolkit:ListBox:RID_SCPAGE_SORT_OPTIONS:LB_SORT_USER";
Disable = TRUE ;
Border = TRUE ;
Pos = MAP_APPFONT ( 20 , 100 ) ;
@@ -209,6 +227,7 @@ TabPage RID_SCPAGE_SORT_OPTIONS
};
ListBox LB_LANGUAGE
{
+ HelpID = "toolkit:ListBox:RID_SCPAGE_SORT_OPTIONS:LB_LANGUAGE";
Border = TRUE ;
Pos = MAP_APPFONT ( 12 , 129 ) ;
Size = MAP_APPFONT ( 101 , 90 ) ;
@@ -224,6 +243,7 @@ TabPage RID_SCPAGE_SORT_OPTIONS
};
ListBox LB_ALGORITHM
{
+ HelpID = "toolkit:ListBox:RID_SCPAGE_SORT_OPTIONS:LB_ALGORITHM";
Border = TRUE ;
Pos = MAP_APPFONT ( 119 , 129 ) ;
Size = MAP_APPFONT ( 132 , 90 ) ;
@@ -238,6 +258,7 @@ TabPage RID_SCPAGE_SORT_OPTIONS
};
RadioButton BTN_TOP_DOWN
{
+ HelpID = "toolkit:RadioButton:RID_SCPAGE_SORT_OPTIONS:BTN_TOP_DOWN";
Pos = MAP_APPFONT ( 12 , 158 ) ;
Size = MAP_APPFONT ( 242 , 10 ) ;
Text [ en-US ] = "~Top to bottom (sort rows)" ;
@@ -245,6 +266,7 @@ TabPage RID_SCPAGE_SORT_OPTIONS
};
RadioButton BTN_LEFT_RIGHT
{
+ HelpID = "toolkit:RadioButton:RID_SCPAGE_SORT_OPTIONS:BTN_LEFT_RIGHT";
Pos = MAP_APPFONT ( 12 , 172 ) ;
Size = MAP_APPFONT ( 242 , 10 ) ;
Text [ en-US ] = "L~eft to right (sort columns)" ;
diff --git a/tools/inc/bootstrp/prj.hxx b/tools/inc/bootstrp/prj.hxx
index 2d7664b8b69f..994418bae4b5 100644
--- a/tools/inc/bootstrp/prj.hxx
+++ b/tools/inc/bootstrp/prj.hxx
@@ -264,7 +264,7 @@ private:
static Link aDBNotFoundHdl;
protected:
- NAMESPACE_VOS( OMutex ) aMutex;
+ vos:: OMutex aMutex;
USHORT nStarMode;
SolarFileList aFileList;
diff --git a/tools/inc/poly.h b/tools/inc/poly.h
index e6678e071f28..9228715b8da7 100644
--- a/tools/inc/poly.h
+++ b/tools/inc/poly.h
@@ -39,15 +39,8 @@
class ImplPolygonData
{
public:
-#ifdef WIN
- Point huge* mpPointAry;
- BYTE* mpFlagAry;
- GLOBALHANDLE mhPoints;
-#else
Point* mpPointAry;
BYTE* mpFlagAry;
-#endif
-
USHORT mnPoints;
ULONG mnRefCount;
};
diff --git a/tools/inc/tools/agapi.hxx b/tools/inc/tools/agapi.hxx
deleted file mode 100644
index 9c71bd35c6cc..000000000000
--- a/tools/inc/tools/agapi.hxx
+++ /dev/null
@@ -1,67 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _AGAPI_HXX
-#define _AGAPI_HXX
-
-#include <tools/solar.h>
-
-class INetURLObject;
-class ChannelList;
-class AgentItem;
-class String;
-
-class AgentApi
-{
-protected:
- friend class ChannelList;
-
- AgentItem* pChannelAgent;
- virtual BOOL StartAgent() = 0;
-
- AgentApi(AgentItem* pAgent) { pChannelAgent = pAgent; }
-
-public:
- virtual ~AgentApi() {}
-
- virtual void InitAgent() = 0;
- virtual void ShutDownAgent() = 0;
-
- virtual BOOL NewDataPermission(const String& rChannelName) = 0;
- virtual void NewData(const String& rChannelName,
- const INetURLObject& rURL) = 0;
- virtual void NotifyChannelObjFile(const INetURLObject& rURL,
- const String& rFileName) = 0;
- virtual void NotifyChannelObjData(const INetURLObject& rURL,
- void* pBuffer, long nOffset, long nLen, long nTotalLen) = 0;
-
- virtual void RegisterChannels() = 0;
- virtual void RegisterUpdateTransmitter() = 0;
-};
-
-#endif //_AGAPI_HXX
-
diff --git a/tools/inc/tools/agitem.hxx b/tools/inc/tools/agitem.hxx
deleted file mode 100644
index 3177bdffa0a8..000000000000
--- a/tools/inc/tools/agitem.hxx
+++ /dev/null
@@ -1,51 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _AGITEM_HXX
-#define _AGITEM_HXX
-
-#include <tools/solar.h>
-
-class String;
-class INetURLObject;
-class AgentApi;
-class ChApi;
-
-class AgentItem
-{
-public:
- virtual const String& GetChAgentName() const = 0;
- virtual const INetURLObject& GetLocation() const = 0;
- virtual AgentApi* GetApi() const = 0;
- virtual ChApi* GetChApi() const = 0;
-
- virtual void SetIsActive(BOOL bNew) = 0;
- virtual BOOL IsActive() const = 0;
-};
-
-#endif //_AGITEM_HXX
-
diff --git a/tools/inc/tools/chapi.hxx b/tools/inc/tools/chapi.hxx
deleted file mode 100644
index 0acfe4cb2ca5..000000000000
--- a/tools/inc/tools/chapi.hxx
+++ /dev/null
@@ -1,68 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CHAPI_HXX
-#define _CHAPI_HXX
-
-#include <tools/solar.h>
-
-class ChannelAgentItem;
-class INetURLObject;
-class String;
-
-enum RequestType {
- REQTYP_LOCAL_FILE = 1,
- REQTYP_MEMORY = 2
-};
-
-class ChApi
-{
-public:
- virtual ~ChApi() {}
-
- virtual void ShutDownAgent() = 0;
- virtual void SetLastSuccUpd() = 0;
-
- virtual void GetChannelObject( const INetURLObject& rURL, RequestType eStreamType,
- const String& rFileName ) = 0;
- virtual void AddChannelItem( const String& aChName, const INetURLObject& aTransmitter,
- const String& aChannel, USHORT nUpdPeriode,
- const String& rChAgentName ) = 0;
- virtual void DelChannelItem( const String& aChName ) = 0;
- virtual void SetChTransmitter( const String& aChName, const String& rNewVal ) = 0;
- virtual void SetChannel( const String& aChName, const String& rNewVal ) = 0;
- virtual void SetChannelName( const String& aChName, const String& rNewVal ) = 0;
- virtual void SetChUpdPeriode( const String& aChName, USHORT nUpdPeriode ) = 0;
- virtual void SetChannelAgentName( const String& aChName, const String& rNewVal ) = 0;
-
- virtual void SetUpdateTransmitter(ChannelAgentItem* pAgent, const INetURLObject& rTransmitter) = 0;
-};
-
-////////////////////////////////////////////////////////////////////////////////
-//
-
-#endif //_CHAPI_HXX
diff --git a/tools/inc/tools/download.hxx b/tools/inc/tools/download.hxx
deleted file mode 100644
index b187433927cd..000000000000
--- a/tools/inc/tools/download.hxx
+++ /dev/null
@@ -1,56 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _DOWNLOAD_HXX
-#define _DOWNLOAD_HXX
-
-// Forward declarations
-class String;
-class Link;
-
-#define DOWNLOAD_SUCCESS 0
-#define DOWNLOAD_CONNECT 1
-#define DOWNLOAD_LOCATION 2
-#define DOWNLOAD_ABORT 3
-#define DOWNLOAD_FILEACCESS 4
-#define DOWNLOAD_INSTALL 5
-#define DOWNLOAD_ERROR 6
-
-class Downloader
-/* ***************************************************************************
-Purpose: Abstract base class for a file downloader
-*************************************************************************** */
-{
-public:
- Downloader() {};
-
- virtual void Download(const String &rDestLocation,
- const String &rSourceLocation,
- const Link &rFinishedLink) = 0;
-};
-
-#endif
diff --git a/tools/inc/tools/eacopier.hxx b/tools/inc/tools/eacopier.hxx
deleted file mode 100644
index c80eeb0d35cc..000000000000
--- a/tools/inc/tools/eacopier.hxx
+++ /dev/null
@@ -1,47 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _EACOPIER_HXX
-#define _EACOPIER_HXX
-
-#include <tools/solar.h>
-
-class SvFileStream;
-
-class EA_Copier
-{
- static EA_Copier* _pCopier;
-
-public:
- static void Register( EA_Copier* pCopier );
- static EA_Copier* Get();
-
- virtual ~EA_Copier();
- virtual BOOL Copy( const SvFileStream& rFrom, const SvFileStream& rTo ) const = 0;
-};
-
-#endif
-
diff --git a/tools/inc/tools/fsys.hxx b/tools/inc/tools/fsys.hxx
index 880768c89d8c..5ef51803734b 100644
--- a/tools/inc/tools/fsys.hxx
+++ b/tools/inc/tools/fsys.hxx
@@ -159,21 +159,10 @@ enum FSysExact
// - Char-Set -
// ------------
-#if defined(WIN) || defined(W30)
-
-// MS-Windows has different char-sets for file-system and user-interface
-String Gui2FSys( const String& rStr );
-String FSys2Gui( const String& rStr );
-#define GUI2FSYS(s) Gui2FSys( s )
-#define FSYS2GUI(s) FSys2Gui( s )
-
-#else
-
-// all other OS have the same char-set for both
+// Was different for WIN, no longer needed...
#define GUI2FSYS(s) s
#define FSYS2GUI(s) s
-#endif
// ------------
// - FileStat -
diff --git a/tools/inc/tools/postextstl.h b/tools/inc/tools/postextstl.h
deleted file mode 100644
index 81a21e25c15b..000000000000
--- a/tools/inc/tools/postextstl.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifdef std_was_redefined_as_stlport
-// put things back the way they were
-# define std std_was_redefined_as_stlport
-# undef _STLP_OUTERMOST_HEADER_ID
-// force config to be re-read
-# undef _STLP_NOTHROW_INHERENTLY
-# undef _STLP_CONFIG_H
-# include <stddef.h>
-#endif
diff --git a/tools/inc/tools/preextstl.h b/tools/inc/tools/preextstl.h
deleted file mode 100644
index 27aed38686f0..000000000000
--- a/tools/inc/tools/preextstl.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-//1. Force inclusion of a std:: using header to ensure the stlport define
-//of std as "stlport"
-#include <algorithm>
-#if defined(ADAPT_EXT_STL)
-//2. Force inclusion of stlport headers to get their stlport:: definitions
-# include <ostream>
-# include <istream>
-# include <fstream>
-# include <iostream>
-# include <vector>
-# include <list>
-# include <map>
-//3. Now force inclusion of native headers to get their std:: definitions
-# if defined(std)
-# define std_was_redefined_as_stlport std
-# undef std
-# define _STLP_OUTERMOST_HEADER_ID 0xdeadbeaf
-# if defined(_GNUC__)
-# pragma GCC visibility push(default)
-# endif
-# include _STLP_NATIVE_HEADER(exception_defines.h)
-# include _STLP_NATIVE_HEADER(limits)
-# include _STLP_NATIVE_HEADER(memory)
-# include _STLP_NATIVE_HEADER(exception)
-# include _STLP_NATIVE_HEADER(iosfwd)
-# include _STLP_NATIVE_HEADER(algorithm)
-# include _STLP_NATIVE_HEADER(string)
-# include _STLP_NATIVE_HEADER(streambuf)
-# include _STLP_NATIVE_HEADER(ios)
-# include _STLP_NATIVE_HEADER(locale)
-# include _STLP_NATIVE_HEADER(stdexcept)
-# include _STLP_NATIVE_HEADER(ostream)
-# include _STLP_NATIVE_HEADER(istream)
-# include _STLP_NATIVE_HEADER(iostream)
-# include _STLP_NATIVE_HEADER(vector)
-# include _STLP_NATIVE_HEADER(list)
-# include _STLP_NATIVE_HEADER(map)
-# if defined(_GNUC__)
-# pragma GCC visibility pop
-# endif
-# endif
-#endif
-//ext_std resolves to the std that external c++ libs, e.g. Graphite were built
-//against regardless of whether that is stlport or system stl
-namespace ext_std = std;
diff --git a/tools/inc/tools/pstm.hxx b/tools/inc/tools/pstm.hxx
index 0d14385e5f08..2575ccae8f3e 100644
--- a/tools/inc/tools/pstm.hxx
+++ b/tools/inc/tools/pstm.hxx
@@ -60,16 +60,7 @@ public:
};
/************************** S v R t t i B a s e **************************/
-/*
-#if defined (DOS) && defined (STC)
-#ifdef WIN
-#error Fuer Win muss der Kram virtual sein (MM/MH)
-#endif
-class SvRttiBase : public SvRefBase
-#else
-class SvRttiBase : virtual public SvRefBase
-#endif
-*/
+
class TOOLS_DLLPUBLIC SvRttiBase : public SvRefBase
{
public:
diff --git a/tools/inc/tools/rc.h b/tools/inc/tools/rc.h
index bd499717a3a4..e11aed2937fd 100644
--- a/tools/inc/tools/rc.h
+++ b/tools/inc/tools/rc.h
@@ -50,6 +50,7 @@ typedef short RSWND_STYLE;
#define WINDOW_EXTRALONG 0x0800
#define WINDOW_UNIQUEID 0x1000
#define WINDOW_BORDER_STYLE 0x2000
+#define WINDOW_HELPID 0x4000
// Definition der Struktur die alle "WorkWindow"-Resourcen haben
#define WORKWIN_SHOWNORMAL 0
diff --git a/tools/inc/tools/rc.hxx b/tools/inc/tools/rc.hxx
index 4bf1827a1ab6..15e077c3c62c 100644
--- a/tools/inc/tools/rc.hxx
+++ b/tools/inc/tools/rc.hxx
@@ -87,6 +87,9 @@ class TOOLS_DLLPUBLIC Resource
// read a string from resource data and increment pointer
UniString ReadStringRes()
{ return m_pResMgr->ReadString(); }
+ // read a byte string from resource data and increment pointer
+ rtl::OString ReadByteStringRes()
+ { return m_pResMgr->ReadByteString(); }
// Gibt die Resource frei (this-Zeiger fuer Fehlerueberpruefung)
// free the resource from m_pResMgr's stack (pass this ptr for validation)
diff --git a/tools/inc/tools/resmgr.hxx b/tools/inc/tools/resmgr.hxx
index b19524139078..4b79040921b3 100644
--- a/tools/inc/tools/resmgr.hxx
+++ b/tools/inc/tools/resmgr.hxx
@@ -181,13 +181,15 @@ public:
static sal_uInt32 GetObjSize( RSHEADER_TYPE* pHT )
{ return( pHT->GetGlobOff() ); }
- // Liefert einen String aus der Resource
+ // returns a string and its length out of the resource
static sal_uInt32 GetString( UniString& rStr, const BYTE* pStr );
+ // returns a byte string and its length out of the resource
+ static sal_uInt32 GetByteString( rtl::OString& rStr, const BYTE* pStr );
// Groesse eines Strings in der Resource
static sal_uInt32 GetStringSize( sal_uInt32 nLen )
{ nLen++; return (nLen + nLen%2); }
- static sal_uInt32 GetStringSize( const BYTE* pStr );
+ static sal_uInt32 GetStringSize( const BYTE* pStr, sal_uInt32& nLen );
// return a int64
static sal_uInt64 GetUInt64( void* pDatum );
@@ -209,9 +211,10 @@ public:
INT16 ReadShort();
INT32 ReadLong();
UniString ReadString();
+ rtl::OString ReadByteString();
- // generate auto help id for current resource stack
- ULONG GetAutoHelpId();
+ // generate auto help id for current resource stack
+ rtl::OString GetAutoHelpId();
static void SetReadStringHook( ResHookProc pProc );
static ResHookProc GetReadStringHook();
diff --git a/tools/inc/tools/simplerm.hxx b/tools/inc/tools/simplerm.hxx
index c16fe41abc0b..6b8f31147f96 100644
--- a/tools/inc/tools/simplerm.hxx
+++ b/tools/inc/tools/simplerm.hxx
@@ -46,7 +46,7 @@ class InternalResMgr;
class TOOLS_DLLPUBLIC SimpleResMgr
{
protected:
- NAMESPACE_VOS(OMutex) m_aAccessSafety;
+ vos::OMutex m_aAccessSafety;
InternalResMgr* m_pResImpl;
public:
diff --git a/tools/inc/tools/solar.h b/tools/inc/tools/solar.h
index 096d34d05b9e..cc7c189fbf84 100644
--- a/tools/inc/tools/solar.h
+++ b/tools/inc/tools/solar.h
@@ -275,42 +275,6 @@ template<typename T> inline T Abs(T a) { return (a>=0?a:-a); }
/* dll file extensions *******************************************************/
-/* many of these platforms are historic */
-#define SYSTEM_WINMSCI 1
-#define SYSTEM_WNTMSCI 2
-#define SYSTEM_WNTMSCA 3
-#define SYSTEM_WNTMSCP 4
-#define SYSTEM_WNTMSCM 5
-#define SYSTEM_OS2BLCI 6
-#define SYSTEM_OS2ICCI 7
-#define SYSTEM_OS2ICCI3 8
-#define SYSTEM_UNXLNXI 9
-#define SYSTEM_UNXSOLS 10
-#define SYSTEM_UNXBSDI 11
-#define SYSTEM_UNXBSDA 12
-#define SYSTEM_UNXSCOI 13
-#define SYSTEM_UNXAIXP 14
-#define SYSTEM_UNXHPXR 15
-#define SYSTEM_UNXSNIM 16
-#define SYSTEM_UNXMVSG 17
-#define SYSTEM_UNXIRXM 18
-// #define SYSTEM_MACOSP 19
-#define SYSTEM_UNXFBSDI 20
-#define SYSTEM_UNXSOLI 21
-#define SYSTEM_WINBLCI 22
-#define SYSTEM_UNXMACXP 23
-#define SYSTEM_UNXLNXP 24
-#define SYSTEM_UNXBSDS 25
-#define SYSTEM_UNXLNXR 26
-#define SYSTEM_UNXLNX3 28
-#define SYSTEM_UNXLNXS 29
-#define SYSTEM_UNXLNXX 30
-#define SYSTEM_UNXSOGS 31
-#define SYSTEM_UNXSOGI 32
-#define SYSTEM_UNXMACXI 33
-#define SYSTEM_OS2GCCI 34
-#define SYSTEM_WNTGCCI 99
-
#if defined WNT
#if defined(__MINGW32__)
#define __DLLEXTENSION "gi"
@@ -383,7 +347,6 @@ template<typename T> inline T Abs(T a) { return (a>=0?a:-a); }
// -----------------------------------------------------------------------
-#define NOOLDSTRING
#ifndef NOREPLACESTRING
#define UniString String
#define XubString String
@@ -409,7 +372,7 @@ template<typename T> inline T Abs(T a) { return (a>=0?a:-a); }
#define LIBRARY_CONCAT4( s1, s2, s3, s4 ) \
s1 s2 s3 s4
-#if defined WIN || defined WNT || defined OS2
+#if defined WNT || defined OS2
#define SVLIBRARY( Base ) \
LIBRARY_CONCAT3( Base, __DLLEXTENSION, ".DLL" )
#define SVLIBRARYLANG( Base, Lang ) \
diff --git a/tools/inc/tools/string.hxx b/tools/inc/tools/string.hxx
index 8b86a1835596..1e438a1296b6 100644
--- a/tools/inc/tools/string.hxx
+++ b/tools/inc/tools/string.hxx
@@ -441,14 +441,6 @@ typedef struct _UniStringData
#pragma pack()
#endif
-// -------------------
-// - UniString-Types -
-// -------------------
-
-#ifndef NOOLDSTRING
-#define WSTRING_MAXLEN STRING_MAXLEN
-#endif
-
// -------------
// - UniString -
// -------------
diff --git a/tools/inc/tools/urlkeys.hxx b/tools/inc/tools/urlkeys.hxx
deleted file mode 100644
index 28122657b7d4..000000000000
--- a/tools/inc/tools/urlkeys.hxx
+++ /dev/null
@@ -1,77 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef __URLKEYS_HXX
-#define __URLKEYS_HXX
-
-// Defines for common keys in URL files
-
-// ANSI version
-
-#define A_URLSECTION_SHORTCUT "InternetShortcut"
-#define A_URLKEY_URL "URL"
-#define A_URLKEY_TITLE "Title"
-#define A_URLKEY_TARGET "Target"
-#define A_URLKEY_FRAME "Frame"
-#define A_URLKEY_OPENAS "OpenAs"
-#define A_URLKEY_SOICON "SOIcon"
-#define A_URLKEY_WIN_ICONFILE "IconFile"
-#define A_URLKEY_WIN_ICONINDEX "IconIndex"
-#define A_URLKEY_WORKDIR "WorkingDirectory"
-#define A_URLKEY_ARGUMENTS "Arguments"
-#define A_URLKEY_INTERN_ORIGURL "[URL]"
-
-// Unicode version
-
-#define U_URLSECTION_SHORTCUT L"InternetShortcut"
-#define U_URLKEY_URL L"URL"
-#define U_URLKEY_TITLE L"Title"
-#define U_URLKEY_TARGET L"Target"
-#define U_URLKEY_FRAME L"Frame"
-#define U_URLKEY_OPENAS L"OpenAs"
-#define U_URLKEY_SOICON L"SOIcon"
-#define U_URLKEY_WIN_ICONFILE L"IconFile"
-#define U_URLKEY_WIN_ICONINDEX L"IconIndex"
-#define U_URLKEY_WORKDIR L"WorkingDirectory"
-#define U_URLKEY_ARGUMENTS L"Arguments"
-#define U_URLKEY_INTERN_ORIGURL L"[URL]"
-
-# define URLSECTION_SHORTCUT U_URLSECTION_SHORTCUT
-# define URLKEY_URL U_URLKEY_URL
-# define URLKEY_TITLE U_URLKEY_TITLE
-# define URLKEY_TARGET U_URLKEY_TARGET
-# define URLKEY_FRAME U_URLKEY_FRAME
-# define URLKEY_OPENAS U_URLKEY_OPENAS
-# define URLKEY_SOICON U_URLKEY_SOICON
-# define URLKEY_WIN_ICONFILE U_URLKEY_WIN_ICONFILE
-# define URLKEY_WIN_ICONINDEX U_URLKEY_WIN_ICONINDEX
-# define URLKEY_WORKDIR U_URLKEY_WORKDIR
-# define URLKEY_ARGUMENTS U_URLKEY_ARGUMENTS
-# define URLKEY_INTERN_ORIGURL U_URLKEY_INTERN_ORIGURL
-
-#endif // __URLKEYS_HXX
-
diff --git a/tools/inc/tools/urlobj.hxx b/tools/inc/tools/urlobj.hxx
index 17d52432e206..cb9c7e407bcc 100644
--- a/tools/inc/tools/urlobj.hxx
+++ b/tools/inc/tools/urlobj.hxx
@@ -81,6 +81,7 @@ namespace com { namespace sun { namespace star { namespace util {
#define INET_DB_SCHEME "db:"
#define INET_BUGID_SCHEME "bugid:"
#define INET_TELNET_SCHEME "telnet://"
+#define INET_HID_SCHEME "hid:"
#define URL_PREFIX_PRIV_SOFFICE "private:"
enum
@@ -139,7 +140,8 @@ enum INetProtocol
INET_PROT_VND_SUN_STAR_TDOC = 29,
INET_PROT_GENERIC = 30,
INET_PROT_SMB = 31,
- INET_PROT_END = 32
+ INET_PROT_HID = 32,
+ INET_PROT_END = 33
};
//============================================================================
diff --git a/tools/inc/tools/wintypes.hxx b/tools/inc/tools/wintypes.hxx
index 7d6296b76e8c..9c7052e22d77 100644
--- a/tools/inc/tools/wintypes.hxx
+++ b/tools/inc/tools/wintypes.hxx
@@ -274,9 +274,16 @@ typedef sal_Int64 WinBits;
#define WB_STDTABCONTROL 0
// For TreeListBox
-#define WB_HASBUTTONS ((WinBits)0x00800000)
-#define WB_HASLINES ((WinBits)0x01000000)
-#define WB_HASLINESATROOT ((WinBits)0x02000000)
+#define WB_HASBUTTONS ((WinBits)SAL_CONST_INT64(0x000100000000))
+#define WB_HASLINES ((WinBits)SAL_CONST_INT64(0x000200000000))
+#define WB_HASLINESATROOT ((WinBits)SAL_CONST_INT64(0x000400000000))
+#define WB_HASBUTTONSATROOT ((WinBits)SAL_CONST_INT64(0x000800000000))
+#define WB_NOINITIALSELECTION ((WinBits)SAL_CONST_INT64(0x001000000000))
+#define WB_HIDESELECTION ((WinBits)SAL_CONST_INT64(0x002000000000))
+#define WB_FORCE_MAKEVISIBLE ((WinBits)SAL_CONST_INT64(0x004000000000))
+// DO NOT USE: 0x008000000000, that's WB_SYSTEMCHILDWINDOW
+#define WB_QUICK_SEARCH ((WinBits)SAL_CONST_INT64(0x010000000000))
+
// For FileOpen Dialog
#define WB_PATH ((WinBits)0x00100000)
diff --git a/tools/prj/d.lst b/tools/prj/d.lst
index e0291c2f8ad0..f2c508342015 100644
--- a/tools/prj/d.lst
+++ b/tools/prj/d.lst
@@ -34,9 +34,6 @@ mkdir: %_DEST%\inc%_EXT%\bootstrp
..\inc\tools\postx.h %_DEST%\inc%_EXT%\tools\postx.h
..\inc\tools\prex.h %_DEST%\inc%_EXT%\tools\prex.h
-..\inc\tools\postextstl.h %_DEST%\inc%_EXT%\tools\postextstl.h
-..\inc\tools\preextstl.h %_DEST%\inc%_EXT%\tools\preextstl.h
-
..\inc\tools\svlibrary.hxx %_DEST%\inc%_EXT%\tools\svlibrary.hxx
..\inc\tools\solarmutex.hxx %_DEST%\inc%_EXT%\tools\solarmutex.hxx
..\inc\tools\wintypes.hxx %_DEST%\inc%_EXT%\tools\wintypes.hxx
@@ -48,7 +45,6 @@ mkdir: %_DEST%\inc%_EXT%\bootstrp
..\inc\tools\appendunixshellword.hxx %_DEST%\inc%_EXT%\tools\appendunixshellword.hxx
..\inc\tools\bigint.hxx %_DEST%\inc%_EXT%\tools\bigint.hxx
..\inc\tools\cachestr.hxx %_DEST%\inc%_EXT%\tools\cachestr.hxx
-..\inc\tools\chapi.hxx %_DEST%\inc%_EXT%\tools\chapi.hxx
..\inc\tools\color.hxx %_DEST%\inc%_EXT%\tools\color.hxx
..\inc\tools\contnr.hxx %_DEST%\inc%_EXT%\tools\contnr.hxx
..\inc\tools\date.hxx %_DEST%\inc%_EXT%\tools\date.hxx
diff --git a/tools/source/fsys/dirent.cxx b/tools/source/fsys/dirent.cxx
index 1bd43bffc4e7..74a2142db692 100644
--- a/tools/source/fsys/dirent.cxx
+++ b/tools/source/fsys/dirent.cxx
@@ -136,13 +136,13 @@ BOOL bInRedirection = TRUE;
#else
BOOL bInRedirection = FALSE;
#endif
-static NAMESPACE_VOS( OMutex )* pRedirectMutex = 0;
+static vos:: OMutex * pRedirectMutex = 0;
//------------------------------------------------------------------------
void FSysRedirector::Register( FSysRedirector *pRedirector )
{
if ( pRedirector )
- pRedirectMutex = new NAMESPACE_VOS( OMutex );
+ pRedirectMutex = new vos:: OMutex ;
else
DELETEZ( pRedirectMutex );
_pRedirector = pRedirector;
@@ -165,7 +165,7 @@ void FSysRedirector::DoRedirect( String &rPath )
// Redirection is acessible only by one thread per time
// dont move the guard behind the bInRedirection check!!!
// think of nested calls (when called from callback)
- NAMESPACE_VOS( OGuard ) aGuard( pRedirectMutex );
+ vos:: OGuard aGuard( pRedirectMutex );
// if already in redirection, dont redirect
if ( bInRedirection )
@@ -1040,8 +1040,8 @@ DirEntry* DirEntry::ImpChangeParent( DirEntry* pNewParent, BOOL bNormalize )
BOOL DirEntry::Exists( FSysAccess nAccess ) const
{
#ifndef BOOTSTRAP
- static NAMESPACE_VOS(OMutex) aLocalMutex;
- NAMESPACE_VOS(OGuard) aGuard( aLocalMutex );
+ static vos::OMutex aLocalMutex;
+ vos::OGuard aGuard( aLocalMutex );
#endif
if ( !IsValid() )
return FALSE;
diff --git a/tools/source/fsys/fstat.cxx b/tools/source/fsys/fstat.cxx
index acdbe6bae510..a55c56b6efbb 100644
--- a/tools/source/fsys/fstat.cxx
+++ b/tools/source/fsys/fstat.cxx
@@ -28,11 +28,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_tools.hxx"
-#if defined( WIN)
-#include <stdio.h>
-#include <dos.h>
-#endif
-
#ifdef UNX
#include <errno.h>
#endif
diff --git a/tools/source/fsys/urlobj.cxx b/tools/source/fsys/urlobj.cxx
index a6d7bc6fd04e..56e6b8ef47cc 100644
--- a/tools/source/fsys/urlobj.cxx
+++ b/tools/source/fsys/urlobj.cxx
@@ -424,7 +424,9 @@ static INetURLObject::SchemeInfo const aSchemeInfoMap[INET_PROT_END]
false, false, false, true, false },
{ "", "", 0, false, false, false, false, true, true, true, false },
{ "smb", "smb://", 139, true, true, false, true, true, true, true,
- true } };
+ true },
+ { "hid", "hid:", 0, false, false, false, false, false, false,
+ false, true } };
// static
inline INetURLObject::SchemeInfo const &
@@ -2094,6 +2096,8 @@ INetURLObject::getPrefix(sal_Unicode const *& rBegin,
{ "db:", "staroffice.db:", INET_PROT_DB, PrefixInfo::INTERNAL },
{ "file:", 0, INET_PROT_FILE, PrefixInfo::OFFICIAL },
{ "ftp:", 0, INET_PROT_FTP, PrefixInfo::OFFICIAL },
+ { "hid:", "staroffice.hid:", INET_PROT_HID,
+ PrefixInfo::INTERNAL },
{ "http:", 0, INET_PROT_HTTP, PrefixInfo::OFFICIAL },
{ "https:", 0, INET_PROT_HTTPS, PrefixInfo::OFFICIAL },
{ "imap:", 0, INET_PROT_IMAP, PrefixInfo::OFFICIAL },
@@ -2129,6 +2133,8 @@ INetURLObject::getPrefix(sal_Unicode const *& rBegin,
INET_PROT_PRIV_SOFFICE, PrefixInfo::EXTERNAL },
{ "staroffice.helpid:", "private:helpid/", INET_PROT_PRIV_SOFFICE,
PrefixInfo::EXTERNAL },
+ { "staroffice.hid:", "hid:", INET_PROT_HID,
+ PrefixInfo::EXTERNAL },
{ "staroffice.java:", "private:java/", INET_PROT_PRIV_SOFFICE,
PrefixInfo::EXTERNAL },
{ "staroffice.macro:", "macro:", INET_PROT_MACRO,
@@ -3120,6 +3126,7 @@ bool INetURLObject::parsePath(INetProtocol eScheme,
case INET_PROT_PRIV_SOFFICE:
case INET_PROT_SLOT:
+ case INET_PROT_HID:
case INET_PROT_MACRO:
case INET_PROT_UNO:
case INET_PROT_COMPONENT:
diff --git a/tools/source/generic/color.cxx b/tools/source/generic/color.cxx
index 37e9dedf9259..5dc41f292668 100644
--- a/tools/source/generic/color.cxx
+++ b/tools/source/generic/color.cxx
@@ -244,8 +244,8 @@ ColorData Color::HSBtoRGB( USHORT nHue, USHORT nSat, USHORT nBri )
f = dH - n;
UINT8 a = (UINT8) ( nB * ( 100 - nSat ) / 100 );
- UINT8 b = (UINT8) ( nB * ( 100 - ( (double)nSat * f + 0.5 ) ) / 100 );
- UINT8 c = (UINT8) ( nB * ( 100 - ( (double)nSat * ( 1.0 - f ) + 0.5 ) ) / 100 );
+ UINT8 b = (UINT8) ( nB * ( 100 - ( (double)nSat * f ) ) / 100 );
+ UINT8 c = (UINT8) ( nB * ( 100 - ( (double)nSat * ( 1.0 - f ) ) ) / 100 );
switch( n )
{
diff --git a/tools/source/misc/extendapplicationenvironment.cxx b/tools/source/misc/extendapplicationenvironment.cxx
index fe76e5329cbb..440f5a5cb207 100644
--- a/tools/source/misc/extendapplicationenvironment.cxx
+++ b/tools/source/misc/extendapplicationenvironment.cxx
@@ -29,8 +29,6 @@
#include "sal/config.h"
#include <stdlib.h>
- // not <cstdlib> as putenv is POSIX-only; setenv instead of putenv would be
- // better but is not supported by Solaris 9 and earlier
#if defined UNX
#include <sys/resource.h>
@@ -63,10 +61,9 @@ void extendApplicationEnvironment() {
// Make sure URE_BOOTSTRAP environment variable is set (failure is fatal):
rtl::OUStringBuffer env;
- env.appendAscii(RTL_CONSTASCII_STRINGPARAM("URE_BOOTSTRAP="));
+ rtl::OUString envVar(RTL_CONSTASCII_USTRINGPARAM("URE_BOOTSTRAP"));
rtl::OUString uri;
- if (rtl::Bootstrap::get(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("URE_BOOTSTRAP")), uri))
+ if (rtl::Bootstrap::get(envVar, uri))
{
if (!uri.matchIgnoreAsciiCaseAsciiL(
RTL_CONSTASCII_STRINGPARAM("vnd.sun.star.pathname:")))
@@ -86,16 +83,8 @@ void extendApplicationEnvironment() {
env.appendAscii(
RTL_CONSTASCII_STRINGPARAM(SAL_CONFIGFILE("fundamental")));
}
- rtl::OString s;
- if (!env.makeStringAndClear().convertToString(
- &s, osl_getThreadTextEncoding(),
- RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR
- | RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR))
- {
- abort();
- }
- rtl_string_acquire(s.pData); // argument to putenv must leak
- if (putenv(const_cast< char * >(s.getStr())) != 0) {
+ rtl::OUString envValue(env.makeStringAndClear());
+ if (osl_setEnvironment(envVar.pData, envValue.pData) != osl_Process_E_None) {
abort();
}
}
diff --git a/tools/source/rc/resmgr.cxx b/tools/source/rc/resmgr.cxx
index daeaf8e4c3a5..2e6401f5a19f 100644
--- a/tools/source/rc/resmgr.cxx
+++ b/tools/source/rc/resmgr.cxx
@@ -46,6 +46,7 @@
#include <osl/file.hxx>
#include <osl/mutex.hxx>
#include <rtl/ustrbuf.hxx>
+#include <rtl/strbuf.hxx>
#include <tools/urlobj.hxx>
#include <rtl/instance.hxx>
#include <rtl/bootstrap.hxx>
@@ -837,18 +838,18 @@ void ResMgr::RscError_Impl( const sal_Char* pMessage, ResMgr* pResMgr,
static void RscException_Impl()
{
- switch ( NAMESPACE_VOS(OSignalHandler)::raise( OSL_SIGNAL_USER_RESOURCEFAILURE, (void*)"" ) )
+ switch ( vos::OSignalHandler::raise( OSL_SIGNAL_USER_RESOURCEFAILURE, (void*)"" ) )
{
- case NAMESPACE_VOS(OSignalHandler)::TAction_CallNextHandler:
+ case vos::OSignalHandler::TAction_CallNextHandler:
abort();
- case NAMESPACE_VOS(OSignalHandler)::TAction_Ignore:
+ case vos::OSignalHandler::TAction_Ignore:
return;
- case NAMESPACE_VOS(OSignalHandler)::TAction_AbortApplication:
+ case vos::OSignalHandler::TAction_AbortApplication:
abort();
- case NAMESPACE_VOS(OSignalHandler)::TAction_KillApplication:
+ case vos::OSignalHandler::TAction_KillApplication:
exit(-1);
}
}
@@ -1351,7 +1352,8 @@ sal_uInt64 ResMgr::GetUInt64( void* pDatum )
// -----------------------------------------------------------------------
sal_uInt32 ResMgr::GetStringWithoutHook( UniString& rStr, const BYTE* pStr )
{
- sal_uInt32 nRet = GetStringSize( pStr );
+ sal_uInt32 nLen=0;
+ sal_uInt32 nRet = GetStringSize( pStr, nLen );
UniString aString( (sal_Char*)pStr, RTL_TEXTENCODING_UTF8,
RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_MAPTOPRIVATE |
RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_DEFAULT |
@@ -1370,11 +1372,20 @@ sal_uInt32 ResMgr::GetString( UniString& rStr, const BYTE* pStr )
return nRet;
}
+sal_uInt32 ResMgr::GetByteString( rtl::OString& rStr, const BYTE* pStr )
+{
+ sal_uInt32 nLen=0;
+ sal_uInt32 nRet = GetStringSize( pStr, nLen );
+ rStr = rtl::OString( (const sal_Char*)pStr, nLen );
+ return nRet;
+}
+
// ------------------------------------------------------------------
-sal_uInt32 ResMgr::GetStringSize( const BYTE* pStr )
+sal_uInt32 ResMgr::GetStringSize( const BYTE* pStr, sal_uInt32& nLen )
{
- return GetStringSize( strlen( (const char*)pStr ) );
+ nLen = static_cast< sal_uInt32 >( strlen( (const char*)pStr ) );
+ return GetStringSize( nLen );
}
// -----------------------------------------------------------------------
@@ -1765,90 +1776,125 @@ UniString ResMgr::ReadString()
return aRet;
}
+rtl::OString ResMgr::ReadByteString()
+{
+ osl::Guard<osl::Mutex> aGuard( getResMgrMutex() );
+
+ if( pFallbackResMgr )
+ return pFallbackResMgr->ReadByteString();
+
+ rtl::OString aRet;
+
+ const ImpRCStack& rTop = aStack[nCurStack];
+ if( (rTop.Flags & RC_NOTFOUND) )
+ {
+ #if OSL_DEBUG_LEVEL > 0
+ aRet = OString( "<resource not found>" );
+ #endif
+ }
+ else
+ Increment( GetByteString( aRet, (const BYTE*)GetClass() ) );
+
+ return aRet;
+}
+
// -----------------------------------------------------------------------
-ULONG ResMgr::GetAutoHelpId()
+rtl::OString ResMgr::GetAutoHelpId()
{
osl::Guard<osl::Mutex> aGuard( getResMgrMutex() );
if( pFallbackResMgr )
return pFallbackResMgr->GetAutoHelpId();
- DBG_ASSERT( nCurStack, "resource stack empty in Auto help id generation" );
+ OSL_ENSURE( nCurStack, "resource stack empty in Auto help id generation" );
if( nCurStack < 1 || nCurStack > 2 )
- return 0;
-
- const ImpRCStack *pRC = StackTop( nCurStack==1 ? 0 : 1 );
-
- DBG_ASSERT( pRC->pResource, "MM hat gesagt, dass der immer einen hat" );
- ULONG nGID = pRC->pResource->GetId();
-
- if( !nGID || nGID > 32767 )
- return 0;
-
- ULONG nHID = 0;
-
- // GGGg gggg::gggg gggg::ggLL LLLl::llll llll
- switch( pRC->pResource->GetRT() ) { // maximal 7
- case RSC_DOCKINGWINDOW:
- nHID += 0x20000000L;
- case RSC_WORKWIN:
- nHID += 0x20000000L;
- case RSC_MODELESSDIALOG:
- nHID += 0x20000000L;
- case RSC_FLOATINGWINDOW:
- nHID += 0x20000000L;
- case RSC_MODALDIALOG:
- nHID += 0x20000000L;
- case RSC_TABPAGE:
- nHID += 0x20000000L;
-
- if( nCurStack == 2 ) {
- pRC = StackTop();
- ULONG nLID = pRC->pResource->GetId();
-
- if( !nLID || nLID > 511 )
- return 0;
-
- switch( pRC->pResource->GetRT() ) { // maximal 32
- case RSC_TABCONTROL: nHID |= 0x0000; break;
- case RSC_RADIOBUTTON: nHID |= 0x0200; break;
- case RSC_CHECKBOX: nHID |= 0x0400; break;
- case RSC_TRISTATEBOX: nHID |= 0x0600; break;
- case RSC_EDIT: nHID |= 0x0800; break;
- case RSC_MULTILINEEDIT: nHID |= 0x0A00; break;
- case RSC_MULTILISTBOX: nHID |= 0x0C00; break;
- case RSC_LISTBOX: nHID |= 0x0E00; break;
- case RSC_COMBOBOX: nHID |= 0x1000; break;
- case RSC_PUSHBUTTON: nHID |= 0x1200; break;
- case RSC_SPINFIELD: nHID |= 0x1400; break;
- case RSC_PATTERNFIELD: nHID |= 0x1600; break;
- case RSC_NUMERICFIELD: nHID |= 0x1800; break;
- case RSC_METRICFIELD: nHID |= 0x1A00; break;
- case RSC_CURRENCYFIELD: nHID |= 0x1C00; break;
- case RSC_DATEFIELD: nHID |= 0x1E00; break;
- case RSC_TIMEFIELD: nHID |= 0x2000; break;
- case RSC_IMAGERADIOBUTTON: nHID |= 0x2200; break;
- case RSC_NUMERICBOX: nHID |= 0x2400; break;
- case RSC_METRICBOX: nHID |= 0x2600; break;
- case RSC_CURRENCYBOX: nHID |= 0x2800; break;
- case RSC_DATEBOX: nHID |= 0x2A00; break;
- case RSC_TIMEBOX: nHID |= 0x2C00; break;
- case RSC_IMAGEBUTTON: nHID |= 0x2E00; break;
- case RSC_MENUBUTTON: nHID |= 0x3000; break;
- case RSC_MOREBUTTON: nHID |= 0x3200; break;
+ return rtl::OString();
+
+ // prepare HID, start with resource prefix
+ rtl::OStringBuffer aHID( 32 );
+ aHID.append( rtl::OUStringToOString( pImpRes->aPrefix, RTL_TEXTENCODING_UTF8 ) );
+ aHID.append( '.' );
+
+ // append type
+ const ImpRCStack *pRC = StackTop();
+ OSL_ENSURE( pRC, "missing resource stack level" );
+
+ if ( nCurStack == 1 )
+ {
+ // auto help ids for top level windows
+ switch( pRC->pResource->GetRT() ) {
+ case RSC_DOCKINGWINDOW: aHID.append( "DockingWindow" ); break;
+ case RSC_WORKWIN: aHID.append( "WorkWindow" ); break;
+ case RSC_MODELESSDIALOG: aHID.append( "ModelessDialog" ); break;
+ case RSC_FLOATINGWINDOW: aHID.append( "FloatingWindow" ); break;
+ case RSC_MODALDIALOG: aHID.append( "ModalDialog" ); break;
+ case RSC_TABPAGE: aHID.append( "TabPage" ); break;
+ default: return rtl::OString();
+ }
+ }
+ else
+ {
+ // only controls with the following parents get auto help ids
+ const ImpRCStack *pRC1 = StackTop(1);
+ switch( pRC1->pResource->GetRT() ) {
+ case RSC_DOCKINGWINDOW:
+ case RSC_WORKWIN:
+ case RSC_MODELESSDIALOG:
+ case RSC_FLOATINGWINDOW:
+ case RSC_MODALDIALOG:
+ case RSC_TABPAGE:
+ // intentionally no breaks!
+ // auto help ids for controls
+ switch( pRC->pResource->GetRT() ) {
+ case RSC_TABCONTROL: aHID.append( "TabControl" ); break;
+ case RSC_RADIOBUTTON: aHID.append( "RadioButton" ); break;
+ case RSC_CHECKBOX: aHID.append( "CheckBox" ); break;
+ case RSC_TRISTATEBOX: aHID.append( "TriStateBox" ); break;
+ case RSC_EDIT: aHID.append( "Edit" ); break;
+ case RSC_MULTILINEEDIT: aHID.append( "MultiLineEdit" ); break;
+ case RSC_MULTILISTBOX: aHID.append( "MultiListBox" ); break;
+ case RSC_LISTBOX: aHID.append( "ListBox" ); break;
+ case RSC_COMBOBOX: aHID.append( "ComboBox" ); break;
+ case RSC_PUSHBUTTON: aHID.append( "PushButton" ); break;
+ case RSC_SPINFIELD: aHID.append( "SpinField" ); break;
+ case RSC_PATTERNFIELD: aHID.append( "PatternField" ); break;
+ case RSC_NUMERICFIELD: aHID.append( "NumericField" ); break;
+ case RSC_METRICFIELD: aHID.append( "MetricField" ); break;
+ case RSC_CURRENCYFIELD: aHID.append( "CurrencyField" ); break;
+ case RSC_DATEFIELD: aHID.append( "DateField" ); break;
+ case RSC_TIMEFIELD: aHID.append( "TimeField" ); break;
+ case RSC_IMAGERADIOBUTTON: aHID.append( "ImageRadioButton" ); break;
+ case RSC_NUMERICBOX: aHID.append( "NumericBox" ); break;
+ case RSC_METRICBOX: aHID.append( "MetricBox" ); break;
+ case RSC_CURRENCYBOX: aHID.append( "CurrencyBox" ); break;
+ case RSC_DATEBOX: aHID.append( "DateBox" ); break;
+ case RSC_TIMEBOX: aHID.append( "TimeBox" ); break;
+ case RSC_IMAGEBUTTON: aHID.append( "ImageButton" ); break;
+ case RSC_MENUBUTTON: aHID.append( "MenuButton" ); break;
+ case RSC_MOREBUTTON: aHID.append( "MoreButton" ); break;
default:
- return 0;
- } // of switch
- nHID |= nLID;
- } // of if
- break;
- default:
- return 0;
- } // of switch
- nHID |= nGID << 14;
+ // no type, no auto HID
+ return rtl::OString();
+ }
+ break;
+ default:
+ return rtl::OString();
+ }
+ }
+
+ // append resource id hierarchy
+ for( int nOff = nCurStack-1; nOff >= 0; nOff-- )
+ {
+ aHID.append( '.' );
+ pRC = StackTop( nOff );
+
+ OSL_ENSURE( pRC->pResource, "missing resource in resource stack level !" );
+ if( pRC->pResource )
+ aHID.append( sal_Int32( pRC->pResource->GetId() ) );
+ }
- return nHID;
+ return aHID.makeStringAndClear();
}
// -----------------------------------------------------------------------
@@ -1919,7 +1965,7 @@ SimpleResMgr* SimpleResMgr::Create( const sal_Char* pPrefixName, com::sun::star:
// -----------------------------------------------------------------------
bool SimpleResMgr::IsAvailable( RESOURCE_TYPE _resourceType, sal_uInt32 _resourceId )
{
- NAMESPACE_VOS(OGuard) aGuard(m_aAccessSafety);
+ vos::OGuard aGuard(m_aAccessSafety);
if ( ( RSC_STRING != _resourceType ) && ( RSC_RESOURCE != _resourceType ) )
return false;
@@ -1931,7 +1977,7 @@ bool SimpleResMgr::IsAvailable( RESOURCE_TYPE _resourceType, sal_uInt32 _resourc
// -----------------------------------------------------------------------
UniString SimpleResMgr::ReadString( sal_uInt32 nId )
{
- NAMESPACE_VOS(OGuard) aGuard(m_aAccessSafety);
+ vos::OGuard aGuard(m_aAccessSafety);
DBG_ASSERT( m_pResImpl, "SimpleResMgr::ReadString : have no impl class !" );
// perhaps constructed with an invalid filename ?
@@ -2002,7 +2048,7 @@ const ::com::sun::star::lang::Locale& SimpleResMgr::GetLocale() const
sal_uInt32 SimpleResMgr::ReadBlob( sal_uInt32 nId, void** pBuffer )
{
- NAMESPACE_VOS(OGuard) aGuard(m_aAccessSafety);
+ vos::OGuard aGuard(m_aAccessSafety);
DBG_ASSERT( m_pResImpl, "SimpleResMgr::ReadBlob : have no impl class !" );
diff --git a/tools/source/solar/solar.c b/tools/source/solar/solar.c
deleted file mode 100644
index 608f0baf5129..000000000000
--- a/tools/source/solar/solar.c
+++ /dev/null
@@ -1,562 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-/* POSIX defines that a program is undefined after a SIG_SEGV. The
- * code stopped working on Linux Kernel 2.6 so I have moved this back to
- * use FORK.
- * If at a later time the signals work correctly with the Linux Kernel 2.6
- * then this change may be reverted although not strictly posix safe. */
-#define USE_FORK_TO_CHECK 1
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <string.h>
-
-#include <unistd.h>
-#include <sys/types.h>
-
-#define I_STDARG
-#ifdef I_STDARG
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-
-#define NO_USE_FORK_TO_CHECK
-#ifdef USE_FORK_TO_CHECK
-#include <sys/wait.h>
-#else
-#include <signal.h>
-#include <setjmp.h>
-#endif
-
-#define printTypeSize(Type,Name) printf( "sizeof(%s)\t= %d\n", Name, sizeof (Type) )
-
-#define isSignedType(Type) (((Type)-1) < 0)
-#define printTypeSign(Type,Name) printf( "%s\t= %s %s\n", Name, ( isSignedType(Type) ? "signed" : "unsigned" ), Name )
-
-
-/*************************************************************************
-|*
-|* IsBigEndian()
-|*
-|* Beschreibung True, wenn CPU BigEndian ist
-|*
-|* Ersterstellung EG 26.06.96
-|* Letzte Aenderung
-|*
-*************************************************************************/
-int IsBigEndian()
-{
- long l = 1;
- return ! *(char*)&l;
-}
-
-/*************************************************************************
-|*
-|* IsStackGrowingDown()
-|*
-|* Beschreibung True, wenn der Stack nach unten waechst
-|*
-|* Ersterstellung EG 26.06.96
-|* Letzte Aenderung
-|*
-*************************************************************************/
-int IsStackGrowingDown_2( int * pI )
-{
- int i = 1;
- return ((unsigned long)&i) < (unsigned long)pI;
-}
-
-int IsStackGrowingDown()
-{
- int i = 1;
- return IsStackGrowingDown_2(&i);
-}
-
-/*************************************************************************
-|*
-|* GetStackAlignment()
-|*
-|* Beschreibung Alignment von char Parametern, die (hoffentlich)
-|* ueber den Stack uebergeben werden
-|*
-|* Ersterstellung EG 26.06.96
-|* Letzte Aenderung
-|*
-*************************************************************************/
-int GetStackAlignment_3( char*p, long l, int i, short s, char b, char c, ... )
-{
- if ( IsStackGrowingDown() )
- return &c - &b;
- else
- return &b - &c;
-}
-
-int GetStackAlignment_2( char*p, long l, int i, short s, char b, char c )
-{
- if ( IsStackGrowingDown() )
- return &c - &b;
- else
- return &b - &c;
-}
-
-int GetStackAlignment()
-{
- int nStackAlignment = GetStackAlignment_3(0,1,2,3,4,5);
- if ( nStackAlignment != GetStackAlignment_2(0,1,2,3,4,5) )
- printf( "Pascal calling convention\n" );
- return nStackAlignment;
-}
-
-
-/*************************************************************************
-|*
-|* Typdeclarations for memory access test functions
-|*
-*************************************************************************/
-typedef enum { t_char, t_short, t_int, t_long, t_double } Type;
-typedef int (*TestFunc)( Type, void* );
-
-
-/*************************************************************************
-|*
-|* PrintArgs()
-|*
-|* Beschreibung Testfunktion fuer variable Parameter
-|*
-|* Ersterstellung EG 26.06.96
-|* Letzte Aenderung
-|*
-*************************************************************************/
-#ifdef I_STDARG
-void PrintArgs( int p, ... )
-#else
-void PrintArgs( p, va_alist )
-int p;
-va_dcl
-#endif
-{
- int value;
- va_list ap;
-
-#ifdef I_STDARG
- va_start( ap, p );
-#else
- va_start( ap );
-#endif
-
- printf( "value = %d", p );
-
- while ( ( value = va_arg(ap, int) ) != 0 )
- printf( " %d", value );
-
- printf( "\n" );
- va_end(ap);
-}
-
-#ifndef USE_FORK_TO_CHECK
-/*************************************************************************
-|*
-|* SignalHdl()
-|*
-|* Beschreibung faengt SIGBUS und SIGSEGV in check() ab
-|*
-|* Ersterstellung EG 26.06.96
-|* Letzte Aenderung
-|*
-*************************************************************************/
-static jmp_buf check_env;
-static int bSignal;
-void SignalHdl( int sig )
-{
- bSignal = 1;
-
- fprintf( stderr, "Signal %d caught\n", sig );
- signal( SIGSEGV, SIG_DFL );
- signal( SIGBUS, SIG_DFL );
- siglongjmp( check_env, sig );
-}
-#endif
-
-/*************************************************************************
-|*
-|* check()
-|*
-|* Beschreibung Testet MemoryZugriff (read/write)
-|*
-|* Ersterstellung EG 26.06.96
-|* Letzte Aenderung
-|*
-*************************************************************************/
-int check( TestFunc func, Type eT, void* p )
-{
-#ifdef USE_FORK_TO_CHECK
- pid_t nChild = fork();
- if ( nChild )
- {
- int exitVal;
- wait( &exitVal );
- if ( exitVal & 0xff )
- return -1;
- else
- return exitVal >> 8;
- }
- else
- {
- exit( func( eT, p ) );
- }
-#else
- int result;
-
- bSignal = 0;
-
- if ( !sigsetjmp( check_env, 1 ) )
- {
- signal( SIGSEGV, SignalHdl );
- signal( SIGBUS, SignalHdl );
- result = func( eT, p );
- signal( SIGSEGV, SIG_DFL );
- signal( SIGBUS, SIG_DFL );
- }
-
- if ( bSignal )
- return -1;
- else
- return 0;
-#endif
-}
-
-/*************************************************************************
-|*
-|* GetAtAddress()
-|*
-|* Beschreibung memory read access
-|*
-|* Ersterstellung EG 26.06.96
-|* Letzte Aenderung
-|*
-*************************************************************************/
-int GetAtAddress( Type eT, void* p )
-{
- switch ( eT )
- {
- case t_char: return *((char*)p);
- case t_short: return *((short*)p);
- case t_int: return *((int*)p);
- case t_long: return *((long*)p);
- case t_double: return *((double*)p);
- }
- abort();
-}
-
-/*************************************************************************
-|*
-|* SetAtAddress()
-|*
-|* Beschreibung memory write access
-|*
-|* Ersterstellung EG 26.06.96
-|* Letzte Aenderung
-|*
-*************************************************************************/
-int SetAtAddress( Type eT, void* p )
-{
- switch ( eT )
- {
- case t_char: return *((char*)p) = 0;
- case t_short: return *((short*)p) = 0;
- case t_int: return *((int*)p) = 0;
- case t_long: return *((long*)p) = 0;
- case t_double: return *((double*)p)= 0;
- }
- abort();
-}
-
-char* TypeName( Type eT )
-{
- switch ( eT )
- {
- case t_char: return "char";
- case t_short: return "short";
- case t_int: return "int";
- case t_long: return "long";
- case t_double: return "double";
- }
- abort();
-}
-
-/*************************************************************************
-|*
-|* Check(Get|Set)Access()
-|*
-|* Beschreibung Testet MemoryZugriff (read/write)
-|* Zugriffsverletzungen werden abgefangen
-|*
-|* Ersterstellung EG 26.06.96
-|* Letzte Aenderung
-|*
-*************************************************************************/
-int CheckGetAccess( Type eT, void* p )
-{
- int b;
- b = -1 != check( (TestFunc)GetAtAddress, eT, p );
-#if OSL_DEBUG_LEVEL > 1
- fprintf( stderr,
- "%s read %s at %p\n",
- (b? "can" : "can not" ), TypeName(eT), p );
-#endif
- return b;
-}
-int CheckSetAccess( Type eT, void* p )
-{
- int b;
-
- b = -1 != check( (TestFunc)SetAtAddress, eT, p );
-#if OSL_DEBUG_LEVEL > 1
- fprintf( stderr,
- "%s write %s at %p\n",
- (b? "can" : "can not" ), TypeName(eT), p );
-#endif
- return b;
-}
-
-/*************************************************************************
-|*
-|* GetAlignment()
-|*
-|* Beschreibung Bestimmt das Alignment verschiedener Typen
-|*
-|* Ersterstellung EG 26.06.96
-|* Letzte Aenderung
-|*
-*************************************************************************/
-int GetAlignment( Type eT )
-{
- char a[ 16*8 ];
- long p = (long)(void*)a;
- int i;
-
- /* clear a[...] to set legal value for double access */
- for ( i = 0; i < 16*8; i++ )
- a[i] = 0;
-
- p = ( p + 0xF ) & ~0xF;
- for ( i = 1; i < 16; i++ )
- if ( CheckGetAccess( eT, (void*)(p+i) ) )
- return i;
- return 0;
-}
-
-/*************************************************************************
-|*
-|* struct Description
-|*
-|* Beschreibung Beschreibt die Parameter der Architektur
-|*
-|* Ersterstellung EG 26.06.96
-|* Letzte Aenderung
-|*
-*************************************************************************/
-struct Description
-{
- int bBigEndian;
- int bStackGrowsDown;
- int nStackAlignment;
- int nAlignment[3]; /* 2,4,8 */
-};
-
-/*************************************************************************
-|*
-|* Description_Ctor()
-|*
-|* Beschreibung Bestimmt die Parameter der Architektur
-|*
-|* Ersterstellung EG 26.06.96
-|* Letzte Aenderung
-|*
-*************************************************************************/
-void Description_Ctor( struct Description* pThis )
-{
- pThis->bBigEndian = IsBigEndian();
- pThis->bStackGrowsDown = IsStackGrowingDown();
- pThis->nStackAlignment = GetStackAlignment();
-
- if ( sizeof(short) != 2 )
- abort();
- pThis->nAlignment[0] = GetAlignment( t_short );
- if ( sizeof(int) != 4 )
- abort();
- pThis->nAlignment[1] = GetAlignment( t_int );
-
- if ( sizeof(long) == 8 )
- pThis->nAlignment[2] = GetAlignment( t_long );
- else if ( sizeof(double) == 8 )
- pThis->nAlignment[2] = GetAlignment( t_double );
- else
- abort();
-}
-
-/*************************************************************************
-|*
-|* Description_Print()
-|*
-|* Beschreibung Schreibt die Parameter der Architektur als Header
-|*
-|* Ersterstellung EG 26.06.96
-|* Letzte Aenderung
-|*
-*************************************************************************/
-void Description_Print( struct Description* pThis, char* name )
-{
- int i;
- FILE* f = fopen( name, "w" );
- if( ! f ) {
- fprintf( stderr, "Unable to open file %s: %s\n", name, strerror( errno ) );
- exit( 99 );
- }
- fprintf( f, "#define __%s\n",
- pThis->bBigEndian ? "BIGENDIAN" : "LITTLEENDIAN" );
- for ( i = 0; i < 3; i++ )
- fprintf( f, "#define __ALIGNMENT%d\t%d\n",
- 1 << (i+1), pThis->nAlignment[i] );
- fprintf( f, "/* Stack alignment is not used... */\n" );
- fprintf( f, "#define __STACKALIGNMENT\t%d\n", pThis->nStackAlignment );
- fprintf( f, "#define __STACKDIRECTION\t%d\n",
- pThis->bStackGrowsDown ? -1 : 1 );
- fprintf( f, "#define __SIZEOFCHAR\t%d\n", sizeof( char ) );
- fprintf( f, "#define __SIZEOFSHORT\t%d\n", sizeof( short ) );
- fprintf( f, "#define __SIZEOFINT\t%d\n", sizeof( int ) );
- fprintf( f, "#define __SIZEOFLONG\t%d\n", sizeof( long ) );
- fprintf( f, "#define __SIZEOFPOINTER\t%d\n", sizeof( void* ) );
- fprintf( f, "#define __SIZEOFDOUBLE\t%d\n", sizeof( double ) );
- fprintf( f, "#define __IEEEDOUBLE\n" );
- fclose( f );
-}
-
-/*************************************************************************
-|*
-|* InfoMemoryAccess()
-|*
-|* Beschreibung Informeller Bytezugriffstest
-|*
-|* Ersterstellung EG 26.06.96
-|* Letzte Aenderung
-|*
-*************************************************************************/
-void InfoMemoryAccess( char* p )
-{
- if ( CheckGetAccess( t_char, p ) )
- printf( "can read address %p\n", p );
- else
- printf( "can not read address %p\n", p );
-
- if ( CheckSetAccess( t_char, p ) )
- printf( "can write address %p\n", p );
- else
- printf( "can not write address %p\n", p );
-}
-
-/*************************************************************************
-|*
-|* InfoMemoryTypeAccess()
-|*
-|* Beschreibung Informeller Zugriffstest verschiedener Typen
-|*
-|* Ersterstellung EG 15.08.96
-|* Letzte Aenderung
-|*
-*************************************************************************/
-void InfoMemoryTypeAccess( Type eT )
-{
- char a[64];
- int i;
-
- /* clear a[...] to set legal value for double access */
- for ( i = 0; i < 64; i++ )
- a[i] = 0;
-
- for ( i = 56; i >= 7; i >>= 1 )
- {
- printf( "Zugriff %s auf %i-Aligned Adresse : ", TypeName( eT ), i / 7 );
- printf( ( CheckGetAccess( eT, (long*)&a[i] ) ? "OK\n" : "ERROR\n" ) );
- }
-}
-/************************************************************************
- *
- * Use C code to determine the characteristics of the building platform.
- *
- ************************************************************************/
-int main( int argc, char* argv[] )
-{
- printTypeSign( char, "char" );
- printTypeSign( short, "short" );
- printTypeSign( int, "int" );
- printTypeSign( long, "long" );
-
- printTypeSize( char, "char" );
- printTypeSize( short, "short" );
- printTypeSize( int, "int" );
- printTypeSize( long, "long" );
- printTypeSize( float, "float" );
- printTypeSize( double, "double" );
- printTypeSize( void *, "void *" );
-
- if ( IsBigEndian() )
- printf( "BIGENDIAN (Sparc, MC680x0, RS6000, IP22, IP32, g3)\n" );
- else
- printf( "LITTLEENDIAN (Intel, VAX, PowerPC)\n" );
-
- if( IsStackGrowingDown() )
- printf( "Stack waechst nach unten\n" );
- else
- printf( "Stack waechst nach oben\n" );
-
- printf( "STACKALIGNMENT : %d\n", GetStackAlignment() );
-
- /* PrintArgs( 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 ); */
-
- if ( argc > 1 )
- {
- struct Description description;
- Description_Ctor( &description );
- Description_Print( &description, argv[1] );
- }
- {
- char* p = NULL;
- InfoMemoryAccess( p );
- p = (char*)&p;
- InfoMemoryAccess( p );
- InfoMemoryTypeAccess( t_short );
- InfoMemoryTypeAccess( t_int );
- InfoMemoryTypeAccess( t_long );
- InfoMemoryTypeAccess( t_double );
- }
-
- exit( 0 );
-}
diff --git a/tools/source/stream/strmos2.cxx b/tools/source/stream/strmos2.cxx
index d211d7790b08..a35fc7731767 100644
--- a/tools/source/stream/strmos2.cxx
+++ b/tools/source/stream/strmos2.cxx
@@ -757,108 +757,4 @@ void SvFileStream::SetSize( ULONG nSize )
}
}
-#if 0
-/*************************************************************************
-|*
-|* SvSharedMemoryStream::AllocateMemory()
-|*
-|* Beschreibung STREAM.SDW
-|* Ersterstellung CL 05.05.95
-|* Letzte Aenderung CL 05.05.95
-|*
-*************************************************************************/
-
-sal_Bool SvSharedMemoryStream::AllocateMemory( ULONG nNewSize )
-{
- DBG_ASSERT(aHandle==0,"Keine Handles unter OS/2");
- DBG_ASSERT(nNewSize,"Cannot allocate zero Bytes");
- APIRET nRet = DosAllocSharedMem( (void**)&pBuf, (PSZ)NULL, nNewSize,
- PAG_READ | PAG_WRITE | PAG_COMMIT |
- OBJ_GIVEABLE | OBJ_GETTABLE | OBJ_ANY);
- return( nRet == 0 );
-}
-
-/*************************************************************************
-|*
-|* SvSharedMemoryStream::ReAllocateMemory() (Bozo-Algorithmus)
-|*
-|* Beschreibung STREAM.SDW
-|* Ersterstellung CL 05.05.95
-|* Letzte Aenderung CL 05.05.95
-|*
-*************************************************************************/
-
-sal_Bool SvSharedMemoryStream::ReAllocateMemory( long nDiff )
-{
- DBG_ASSERT(aHandle==0,"Keine Handles unter OS/2");
- sal_Bool bRetVal = FALSE;
- ULONG nNewSize = nSize + nDiff;
- if( nNewSize )
- {
- // neuen Speicher nicht ueber AllocateMemory holen, da wir den
- // alten Speicher behalten wollen, falls nicht genuegend Platz
- // fuer den neuen Block da ist
- char* pNewBuf;
- APIRET nRet = DosAllocSharedMem( (void**)&pNewBuf,(PSZ)NULL,nNewSize,
- PAG_READ | PAG_WRITE | PAG_COMMIT |
- OBJ_GIVEABLE | OBJ_GETTABLE | OBJ_ANY);
- DBG_ASSERT(!nRet,"DosAllocSharedMem failed");
-
- if( !nRet )
- {
- bRetVal = TRUE; // Success!
- if( nNewSize < nSize ) // Verkleinern ?
- {
- memcpy( pNewBuf, pBuf, (size_t)nNewSize );
- if( nPos > nNewSize )
- nPos = 0L;
- if( nEndOfData >= nNewSize )
- nEndOfData = nNewSize-1L;
- }
- else
- memcpy( pNewBuf, pBuf, (size_t)nSize );
-
- FreeMemory(); // den alten Block loeschen ...
- // und den neuen Block in Dienst stellen
- pBuf = (sal_uInt8*)pNewBuf;
- nSize = nNewSize;
- }
- }
- else
- {
- bRetVal = TRUE;
- FreeMemory();
- pBuf = 0;
- nSize = 0;
- nEndOfData = 0;
- }
- return bRetVal;
-}
-
-void SvSharedMemoryStream::FreeMemory()
-{
- DBG_ASSERT(aHandle==0,"Keine Handles unter OS/2");
- DosFreeMem( pBuf );
-}
-
-/*************************************************************************
-|*
-|* SvSharedMemoryStream::SetHandle()
-|*
-|* Beschreibung STREAM.SDW
-|* Ersterstellung OV 05.10.95
-|* Letzte Aenderung OV 05.10.95
-|*
-*************************************************************************/
-
-void* SvSharedMemoryStream::SetHandle( void* aNewHandle, sal_Size nSize,
- sal_Bool bOwnsData, sal_Size nEOF )
-{
- DBG_ERROR("OS/2 does not support memory handles");
- // return SetBuffer(aNewHandle, nSize, bOwnsData, nEOF );
- return 0;
-}
-
-
-#endif // 0
diff --git a/tools/source/stream/strmunx.cxx b/tools/source/stream/strmunx.cxx
index 88ccb2113e0d..f3c5d642ed6e 100644
--- a/tools/source/stream/strmunx.cxx
+++ b/tools/source/stream/strmunx.cxx
@@ -60,7 +60,7 @@ DECLARE_LIST( InternalStreamLockList, InternalStreamLock* )
namespace { struct LockList : public rtl::Static< InternalStreamLockList, LockList > {}; }
#ifndef BOOTSTRAP
-namespace { struct LockMutex : public rtl::Static< NAMESPACE_VOS(OMutex), LockMutex > {}; }
+namespace { struct LockMutex : public rtl::Static< vos::OMutex, LockMutex > {}; }
#endif
class InternalStreamLock
@@ -111,7 +111,7 @@ InternalStreamLock::~InternalStreamLock()
sal_Bool InternalStreamLock::LockFile( sal_Size nStart, sal_Size nEnd, SvFileStream* pStream )
{
#ifndef BOOTSTRAP
- NAMESPACE_VOS( OGuard ) aGuard( LockMutex::get() );
+ vos:: OGuard aGuard( LockMutex::get() );
#endif
ByteString aFileName(pStream->GetFileName(), osl_getThreadTextEncoding());
struct stat aStat;
@@ -161,7 +161,7 @@ sal_Bool InternalStreamLock::LockFile( sal_Size nStart, sal_Size nEnd, SvFileStr
void InternalStreamLock::UnlockFile( sal_Size nStart, sal_Size nEnd, SvFileStream* pStream )
{
#ifndef BOOTSTRAP
- NAMESPACE_VOS( OGuard ) aGuard( LockMutex::get() );
+ vos:: OGuard aGuard( LockMutex::get() );
#endif
InternalStreamLock* pLock = NULL;
InternalStreamLockList &rLockList = LockList::get();
diff --git a/tools/source/testtoolloader/testtoolloader.cxx b/tools/source/testtoolloader/testtoolloader.cxx
index ca269ef6eea2..21a1a715dc08 100644
--- a/tools/source/testtoolloader/testtoolloader.cxx
+++ b/tools/source/testtoolloader/testtoolloader.cxx
@@ -56,16 +56,16 @@ static bool bLoggerStarted = false;
sal_uInt32 GetCommandLineParamCount()
{
- NAMESPACE_VOS( OStartupInfo ) aStartInfo;
+ vos:: OStartupInfo aStartInfo;
return aStartInfo.getCommandArgCount();
}
String GetCommandLineParam( sal_uInt32 nParam )
{
- NAMESPACE_VOS( OStartupInfo ) aStartInfo;
+ vos:: OStartupInfo aStartInfo;
::rtl::OUString aParam;
- NAMESPACE_VOS( OStartupInfo )::TStartupError eError = aStartInfo.getCommandArg( nParam, aParam );
- if ( eError == NAMESPACE_VOS( OStartupInfo )::E_None )
+ vos:: OStartupInfo ::TStartupError eError = aStartInfo.getCommandArg( nParam, aParam );
+ if ( eError == vos:: OStartupInfo ::E_None )
return String( aParam );
else
{
diff --git a/tools/win/inc/dll.hxx b/tools/win/inc/dll.hxx
index 2a91aefc0fa9..f28b07974c61 100644
--- a/tools/win/inc/dll.hxx
+++ b/tools/win/inc/dll.hxx
@@ -28,31 +28,6 @@
#ifndef _DLL_HXX
#define _DLL_HXX
-#ifdef WIN
-
-#include <tools/svwin.h>
-
-// ----------------------
-// - Zugriffsfunktionen -
-// ----------------------
-
-struct SVDATA;
-
-extern "C"
-{
-// IN APPDATA.ASM
-SVDATA* FAR PASCAL GetSVData();
-}
-
-// IN TOOLSDLL.CXX
-void SetSVData( SVDATA* pSVData );
-
-#endif
-
-// -------------------------------
-// - Sonstige Funktionen fuer SV -
-// -------------------------------
-
// Um Resourcen wieder freizugeben
inline void ImpDeInitWinTools() {}
diff --git a/tools/win/inc/toolsdll.hxx b/tools/win/inc/toolsdll.hxx
deleted file mode 100644
index a6b1546763bc..000000000000
--- a/tools/win/inc/toolsdll.hxx
+++ /dev/null
@@ -1,88 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _TOOLSDLL_HXX
-#define _TOOLSDLL_HXX
-
-#ifdef WIN
-
-#ifndef _STRING_H
-#include <string.h>
-#endif
-#include <tools/svwin.h>
-#include <tools/solar.h>
-#include <tools/shl.hxx>
-
-// ----------------
-// - MemMgr-Daten -
-// ----------------
-
-// Anzahl Freispeicherlisten
-#define MEM_FREELIST_COUNT 15
-
-
-// --------------
-// - Tools-Data -
-// --------------
-
-struct SVDATA;
-struct FreeBlock;
-
-struct MemData
-{
- FreeBlock* pFirstBlocks[MEM_FREELIST_COUNT]; // Erste Bloecke in Freispeicherlisten
- void* pNewHandler; // New-Handler
- int nMultiThread; // MultiThread an/aus
-};
-
-struct ToolsData
-{
- // !!! SVDATA muss in jedem Fall ganz vorne in der Struktur stehen !!!
- SVDATA* pSVData; // Pointer auf StarView-Daten
- HANDLE hMem; // Handler der Tools-Daten
- MemData aMemD; // Daten der Speicherverwaltung
- void* aAppData[SHL_COUNT]; // Daten fuer andere Shared Libs
-};
-
-
-// ----------------------
-// - Zugriffsfunktionen -
-// ----------------------
-
-// IN APPDATA.ASM
-extern "C"
-{
-ToolsData* FAR PASCAL ImpGetAppData();
-void FAR PASCAL ImpSetAppData( ToolsData* pData );
-}
-
-// IN TOOLSDLL.CXX
-ToolsData* ImpGetToolsData();
-
-#endif
-
-#endif // _DLL_HXX
diff --git a/tools/win/source/dll/toolsdll.cxx b/tools/win/source/dll/toolsdll.cxx
index 8fc9888021bb..3d934edfe71d 100644
--- a/tools/win/source/dll/toolsdll.cxx
+++ b/tools/win/source/dll/toolsdll.cxx
@@ -29,7 +29,6 @@
#include "precompiled_tools.hxx"
#include <tools/svwin.h>
#include <dll.hxx>
-#include <toolsdll.hxx>
#include <tools/shl.hxx>
// =======================================================================
diff --git a/ucbhelper/inc/ucbhelper/simplenameclashresolverequest.hxx b/ucbhelper/inc/ucbhelper/simplenameclashresolverequest.hxx
index 7f3da27ece7c..8ab8ead7cffb 100644
--- a/ucbhelper/inc/ucbhelper/simplenameclashresolverequest.hxx
+++ b/ucbhelper/inc/ucbhelper/simplenameclashresolverequest.hxx
@@ -37,7 +37,7 @@ namespace ucbhelper {
/**
* This class implements a simple name clash resolve interaction request.
* Instances can be passed directly to XInteractionHandler::handle(...). Each
- * instance contains an NameClashResolveRequest and two interaction
+ * instance contains a NameClashResolveRequest and two interaction
* continuations: "Abort" and "SupplyName". Another continuation
* ("ReplaceExistingData") may be supplied optionally.
*
@@ -56,11 +56,11 @@ public:
*
* @param rTargetFolderURL contains the URL of the folder that contains
* the clashing resource.
- * @param rClashingName contains the clashing name,
+ * @param rClashingName contains the clashing name.
* @param rProposedNewName contains a proposal for the new name or is
* empty.
- * @param bSupportsOverwriteData indictes whether an
- * InteractioneplaceExistingData continuation shall be supplied
+ * @param bSupportsOverwriteData indicates whether an
+ * InteractionReplaceExistingData continuation shall be supplied
* with the interaction request.
*/
SimpleNameClashResolveRequest( const rtl::OUString & rTargetFolderURL,
diff --git a/ucbhelper/source/client/proxydecider.cxx b/ucbhelper/source/client/proxydecider.cxx
index 8505472e1b1f..d6fc260f558b 100644
--- a/ucbhelper/source/client/proxydecider.cxx
+++ b/ucbhelper/source/client/proxydecider.cxx
@@ -51,13 +51,15 @@
using namespace com::sun::star;
using namespace ucbhelper;
-#define CONFIG_ROOT_KEY "org.openoffice.Inet/Settings"
-#define PROXY_TYPE_KEY "ooInetProxyType"
-#define NO_PROXY_LIST_KEY "ooInetNoProxy"
-#define HTTP_PROXY_NAME_KEY "ooInetHTTPProxyName"
-#define HTTP_PROXY_PORT_KEY "ooInetHTTPProxyPort"
-#define FTP_PROXY_NAME_KEY "ooInetFTPProxyName"
-#define FTP_PROXY_PORT_KEY "ooInetFTPProxyPort"
+#define CONFIG_ROOT_KEY "org.openoffice.Inet/Settings"
+#define PROXY_TYPE_KEY "ooInetProxyType"
+#define NO_PROXY_LIST_KEY "ooInetNoProxy"
+#define HTTP_PROXY_NAME_KEY "ooInetHTTPProxyName"
+#define HTTP_PROXY_PORT_KEY "ooInetHTTPProxyPort"
+#define HTTPS_PROXY_NAME_KEY "ooInetHTTPSProxyName"
+#define HTTPS_PROXY_PORT_KEY "ooInetHTTPSProxyPort"
+#define FTP_PROXY_NAME_KEY "ooInetFTPProxyName"
+#define FTP_PROXY_PORT_KEY "ooInetFTPProxyPort"
//=========================================================================
namespace ucbhelper
@@ -132,6 +134,7 @@ class InternetProxyDecider_Impl :
{
mutable osl::Mutex m_aMutex;
InternetProxyServer m_aHttpProxy;
+ InternetProxyServer m_aHttpsProxy;
InternetProxyServer m_aFtpProxy;
const InternetProxyServer m_aEmptyProxy;
sal_Int32 m_nProxyType;
@@ -246,6 +249,63 @@ bool WildCard::Matches( const rtl::OUString& rString ) const
}
//=========================================================================
+bool getConfigStringValue(
+ const uno::Reference< container::XNameAccess > & xNameAccess,
+ const char * key,
+ rtl::OUString & value )
+{
+ try
+ {
+ if ( !( xNameAccess->getByName( rtl::OUString::createFromAscii( key ) )
+ >>= value ) )
+ {
+ OSL_ENSURE( sal_False,
+ "InternetProxyDecider - "
+ "Error getting config item value!" );
+ return false;
+ }
+ }
+ catch ( lang::WrappedTargetException const & )
+ {
+ return false;
+ }
+ catch ( container::NoSuchElementException const & )
+ {
+ return false;
+ }
+ return true;
+}
+
+//=========================================================================
+bool getConfigInt32Value(
+ const uno::Reference< container::XNameAccess > & xNameAccess,
+ const char * key,
+ sal_Int32 & value )
+{
+ try
+ {
+ uno::Any aValue = xNameAccess->getByName(
+ rtl::OUString::createFromAscii( key ) );
+ if ( aValue.hasValue() && !( aValue >>= value ) )
+ {
+ OSL_ENSURE( sal_False,
+ "InternetProxyDecider - "
+ "Error getting config item value!" );
+ return false;
+ }
+ }
+ catch ( lang::WrappedTargetException const & )
+ {
+ return false;
+ }
+ catch ( container::NoSuchElementException const & )
+ {
+ return false;
+ }
+ return true;
+}
+
+//=========================================================================
//=========================================================================
//
// InternetProxyDecider_Impl Implementation.
@@ -291,127 +351,43 @@ InternetProxyDecider_Impl::InternetProxyDecider_Impl(
if ( xNameAccess.is() )
{
- try
- {
- if ( !( xNameAccess->getByName(
- rtl::OUString::createFromAscii(
- PROXY_TYPE_KEY ) ) >>= m_nProxyType ) )
- {
- OSL_ENSURE( sal_False,
- "InternetProxyDecider - "
- "Error getting config item value!" );
- }
- }
- catch ( lang::WrappedTargetException const & )
- {
- }
- catch ( container::NoSuchElementException const & )
- {
- }
+ // *** Proxy type ***
+ getConfigInt32Value(
+ xNameAccess, PROXY_TYPE_KEY, m_nProxyType );
+ // *** No proxy list ***
rtl::OUString aNoProxyList;
- try
- {
- if ( !( xNameAccess->getByName(
- rtl::OUString::createFromAscii(
- NO_PROXY_LIST_KEY ) ) >>= aNoProxyList ) )
- {
- OSL_ENSURE( sal_False,
- "InternetProxyDecider - "
- "Error getting config item value!" );
- }
- }
- catch ( lang::WrappedTargetException const & )
- {
- }
- catch ( container::NoSuchElementException const & )
- {
- }
-
+ getConfigStringValue(
+ xNameAccess, NO_PROXY_LIST_KEY, aNoProxyList );
setNoProxyList( aNoProxyList );
- try
- {
- if ( !( xNameAccess->getByName(
- rtl::OUString::createFromAscii(
- HTTP_PROXY_NAME_KEY ) )
- >>= m_aHttpProxy.aName ) )
- {
- OSL_ENSURE( sal_False,
- "InternetProxyDecider - "
- "Error getting config item value!" );
- }
- }
- catch ( lang::WrappedTargetException const & )
- {
- }
- catch ( container::NoSuchElementException const & )
- {
- }
+ // *** HTTP ***
+ getConfigStringValue(
+ xNameAccess, HTTP_PROXY_NAME_KEY, m_aHttpProxy.aName );
m_aHttpProxy.nPort = -1;
- try
- {
- uno::Any aValue = xNameAccess->getByName(
- rtl::OUString::createFromAscii(
- HTTP_PROXY_PORT_KEY ) );
- if ( aValue.hasValue() &&
- !( aValue >>= m_aHttpProxy.nPort ) )
- {
- OSL_ENSURE( sal_False,
- "InternetProxyDecider - "
- "Error getting config item value!" );
- }
- }
- catch ( lang::WrappedTargetException const & )
- {
- }
- catch ( container::NoSuchElementException const & )
- {
- }
-
+ getConfigInt32Value(
+ xNameAccess, HTTP_PROXY_PORT_KEY, m_aHttpProxy.nPort );
if ( m_aHttpProxy.nPort == -1 )
m_aHttpProxy.nPort = 80; // standard HTTP port.
- try
- {
- if ( !( xNameAccess->getByName(
- rtl::OUString::createFromAscii(
- FTP_PROXY_NAME_KEY ) )
- >>= m_aFtpProxy.aName ) )
- {
- OSL_ENSURE( sal_False,
- "InternetProxyDecider - "
- "Error getting config item value!" );
- }
- }
- catch ( lang::WrappedTargetException const & )
- {
- }
- catch ( container::NoSuchElementException const & )
- {
- }
+ // *** HTTPS ***
+ getConfigStringValue(
+ xNameAccess, HTTPS_PROXY_NAME_KEY, m_aHttpsProxy.aName );
+
+ m_aHttpsProxy.nPort = -1;
+ getConfigInt32Value(
+ xNameAccess, HTTPS_PROXY_PORT_KEY, m_aHttpsProxy.nPort );
+ if ( m_aHttpsProxy.nPort == -1 )
+ m_aHttpsProxy.nPort = 443; // standard HTTPS port.
+
+ // *** FTP ***
+ getConfigStringValue(
+ xNameAccess, FTP_PROXY_NAME_KEY, m_aFtpProxy.aName );
m_aFtpProxy.nPort = -1;
- try
- {
- uno::Any aValue = xNameAccess->getByName(
- rtl::OUString::createFromAscii(
- FTP_PROXY_PORT_KEY ) );
- if ( aValue.hasValue() &&
- !( aValue >>= m_aFtpProxy.nPort ) )
- {
- OSL_ENSURE( sal_False,
- "InternetProxyDecider - "
- "Error getting config item value!" );
- }
- }
- catch ( lang::WrappedTargetException const & )
- {
- }
- catch ( container::NoSuchElementException const & )
- {
- }
+ getConfigInt32Value(
+ xNameAccess, FTP_PROXY_PORT_KEY, m_aFtpProxy.nPort );
}
// Register as listener for config changes.
@@ -588,6 +564,12 @@ const InternetProxyServer & InternetProxyDecider_Impl::getProxy(
if ( m_aFtpProxy.aName.getLength() > 0 && m_aFtpProxy.nPort >= 0 )
return m_aFtpProxy;
}
+ else if ( rProtocol.toAsciiLowerCase()
+ .equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "https" ) ) )
+ {
+ if ( m_aHttpsProxy.aName.getLength() )
+ return m_aHttpsProxy;
+ }
else if ( m_aHttpProxy.aName.getLength() )
{
// All other protocols use the HTTP proxy.
@@ -662,6 +644,29 @@ void SAL_CALL InternetProxyDecider_Impl::changesOccurred(
m_aHttpProxy.nPort = 80; // standard HTTP port.
}
else if ( aKey.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(
+ HTTPS_PROXY_NAME_KEY ) ) )
+ {
+ if ( !( rElem.Element >>= m_aHttpsProxy.aName ) )
+ {
+ OSL_ENSURE( sal_False,
+ "InternetProxyDecider - changesOccurred - "
+ "Error getting config item value!" );
+ }
+ }
+ else if ( aKey.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(
+ HTTPS_PROXY_PORT_KEY ) ) )
+ {
+ if ( !( rElem.Element >>= m_aHttpsProxy.nPort ) )
+ {
+ OSL_ENSURE( sal_False,
+ "InternetProxyDecider - changesOccurred - "
+ "Error getting config item value!" );
+ }
+
+ if ( m_aHttpsProxy.nPort == -1 )
+ m_aHttpsProxy.nPort = 443; // standard HTTPS port.
+ }
+ else if ( aKey.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(
FTP_PROXY_NAME_KEY ) ) )
{
if ( !( rElem.Element >>= m_aFtpProxy.aName ) )
diff --git a/ucbhelper/workben/ucbexplorer/ucbexplorer.src b/ucbhelper/workben/ucbexplorer/ucbexplorer.src
index 4bee5900eaaf..523813324710 100644
--- a/ucbhelper/workben/ucbexplorer/ucbexplorer.src
+++ b/ucbhelper/workben/ucbexplorer/ucbexplorer.src
@@ -100,6 +100,7 @@ Bitmap BMP_LINK
ModalDialog DLG_STRINGINPUT
{
+ HelpID = "ucbhelper:ModalDialog:DLG_STRINGINPUT";
Border = TRUE ;
Moveable = TRUE ;
OutputSize = TRUE ;
@@ -113,6 +114,7 @@ ModalDialog DLG_STRINGINPUT
};
Edit ED_STRINGINPUT_DLG_NAME
{
+ HelpID = "ucbhelper:Edit:DLG_STRINGINPUT:ED_STRINGINPUT_DLG_NAME";
Pos = MAP_APPFONT ( 40 , 16 ) ;
Size = MAP_APPFONT ( 110 , 12 ) ;
Border = TRUE ;
diff --git a/unotools/prj/build.lst b/unotools/prj/build.lst
index bb63ba975ed2..70402fb3dbd5 100644
--- a/unotools/prj/build.lst
+++ b/unotools/prj/build.lst
@@ -10,3 +10,5 @@ ut unotools\source\i18n nmake - all ut_i18n ut_inc NULL
ut unotools\source\property nmake - all ut_property ut_inc NULL
ut unotools\source\accessibility nmake - all ut_accessibility ut_inc NULL
ut unotools\util nmake - all ut_util ut_config ut_i18n ut_misc ut_procfact ut_streaming ut_ucbhelper ut_property ut_accessibility NULL
+
+ut unotools\qa\complex\tempfile nmake - all ut_qa_complex ut_util NULL
diff --git a/unotools/prj/d.lst b/unotools/prj/d.lst
index ad8a764055b2..38cafd0cc1f8 100644
--- a/unotools/prj/d.lst
+++ b/unotools/prj/d.lst
@@ -9,3 +9,4 @@
mkdir: %_DEST%\inc%_EXT%\unotools
..\inc\unotools\*.hxx %_DEST%\inc%_EXT%\unotools\*.hxx
..\inc\unotools\unotoolsdllapi.h %_DEST%\inc%_EXT%\unotools\unotoolsdllapi.h
+..\%__SRC%\misc\utl.component %_DEST%\xml%_EXT%\utl.component
diff --git a/unotools/qa/complex/tempfile/TempFileUnitTest.java b/unotools/qa/complex/tempfile/TempFileUnitTest.java
index 5cd0b7292105..e5f1f2d6d6b2 100644
--- a/unotools/qa/complex/tempfile/TempFileUnitTest.java
+++ b/unotools/qa/complex/tempfile/TempFileUnitTest.java
@@ -26,60 +26,89 @@
************************************************************************/
package complex.tempfile;
-import complexlib.ComplexTestCase;
+// import complexlib.ComplexTestCase;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.ucb.XSimpleFileAccess;
import com.sun.star.uno.UnoRuntime;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.openoffice.test.OfficeConnection;
+import static org.junit.Assert.*;
+
/* Document.
*/
-public class TempFileUnitTest extends ComplexTestCase {
+public class TempFileUnitTest /* extends ComplexTestCase */ {
private XMultiServiceFactory m_xMSF = null;
private XSimpleFileAccess m_xSFA = null;
- public String[] getTestMethodNames() {
- return new String[] {
- "ExecuteTest01",
- "ExecuteTest02"};
- }
-
- public String getTestObjectName() {
- return "TempFileUnitTest";
- }
+// public String[] getTestMethodNames() {
+// return new String[] {
+// "ExecuteTest01",
+// "ExecuteTest02"};
+// }
+//
+// public String getTestObjectName() {
+// return "TempFileUnitTest";
+// }
- public void before() {
- m_xMSF = (XMultiServiceFactory)param.getMSF();
+ @Before public void before() {
+ m_xMSF = getMSF();
if ( m_xMSF == null ) {
- failed ( "Cannot create service factory!" );
+ fail ( "Cannot create service factory!" );
}
try
{
Object oSFA = m_xMSF.createInstance( "com.sun.star.ucb.SimpleFileAccess" );
- m_xSFA = ( XSimpleFileAccess )UnoRuntime.queryInterface( XSimpleFileAccess.class,
- oSFA );
+ m_xSFA = UnoRuntime.queryInterface( XSimpleFileAccess.class, oSFA );
}
catch ( Exception e )
{
- failed ( "Cannot get simple file access! Exception: " + e);
+ fail ( "Cannot get simple file access! Exception: " + e);
}
if ( m_xSFA == null ) {
- failed ( "Cannot get simple file access!" );
+ fail ( "Cannot get simple file access!" );
}
}
- public void after() {
+ @After public void after() {
m_xMSF = null;
m_xSFA = null;
}
- public void ExecuteTest01() {
- TempFileTest aTest = new Test01( m_xMSF, m_xSFA, log );
- assure( "Test01 failed!", aTest.test() );
+ @Test public void ExecuteTest01() {
+ TempFileTest aTest = new Test01( m_xMSF, m_xSFA );
+ assertTrue( "Test01 failed!", aTest.test() );
+ }
+
+ @Test public void ExecuteTest02() {
+ TempFileTest aTest = new Test02( m_xMSF, m_xSFA );
+ assertTrue( "Test02 failed!", aTest.test() );
}
- public void ExecuteTest02() {
- TempFileTest aTest = new Test02( m_xMSF, m_xSFA, log );
- assure( "Test02 failed!", aTest.test() );
+ private XMultiServiceFactory getMSF()
+ {
+ final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager());
+ return xMSF1;
}
-}; \ No newline at end of file
+
+ // setup and close connections
+ @BeforeClass public static void setUpConnection() throws Exception {
+ System.out.println("setUpConnection()");
+ connection.setUp();
+ }
+
+ @AfterClass public static void tearDownConnection()
+ throws InterruptedException, com.sun.star.uno.Exception
+ {
+ System.out.println("tearDownConnection()");
+ connection.tearDown();
+ }
+
+ private static final OfficeConnection connection = new OfficeConnection();
+};
+
diff --git a/unotools/qa/complex/tempfile/Test01.java b/unotools/qa/complex/tempfile/Test01.java
index dbf3d6c15de2..3eac1c2ecf44 100644
--- a/unotools/qa/complex/tempfile/Test01.java
+++ b/unotools/qa/complex/tempfile/Test01.java
@@ -26,7 +26,7 @@
************************************************************************/
package complex.tempfile;
-import complexlib.ComplexTestCase;
+// import complexlib.ComplexTestCase;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.ucb.XSimpleFileAccess;
@@ -42,10 +42,10 @@ public class Test01 implements TempFileTest {
XSimpleFileAccess m_xSFA = null;
TestHelper m_aTestHelper = null;
- public Test01(XMultiServiceFactory xMSF, XSimpleFileAccess xSFA, LogWriter aLogWriter) {
+ public Test01(XMultiServiceFactory xMSF, XSimpleFileAccess xSFA) {
m_xMSF = xMSF;
m_xSFA = xSFA;
- m_aTestHelper = new TestHelper(aLogWriter, "Test01: ");
+ m_aTestHelper = new TestHelper( "Test01: ");
}
public boolean test() {
@@ -56,11 +56,9 @@ public class Test01 implements TempFileTest {
//create a temporary file.
try {
Object oTempFile = m_xMSF.createInstance( "com.sun.star.io.TempFile" );
- xTempFile = (XTempFile) UnoRuntime.queryInterface( XTempFile.class,
- oTempFile );
+ xTempFile = UnoRuntime.queryInterface(XTempFile.class, oTempFile);
m_aTestHelper.Message( "Tempfile created." );
- xTruncate = (XTruncate)UnoRuntime.queryInterface( XTruncate.class,
- oTempFile );
+ xTruncate = UnoRuntime.queryInterface(XTruncate.class, oTempFile);
} catch( Exception e ) {
m_aTestHelper.Error( "Cannot create TempFile. exception: " + e );
return false;
diff --git a/unotools/qa/complex/tempfile/Test02.java b/unotools/qa/complex/tempfile/Test02.java
index 18ca4de2e04b..79e27720b31e 100644
--- a/unotools/qa/complex/tempfile/Test02.java
+++ b/unotools/qa/complex/tempfile/Test02.java
@@ -26,15 +26,13 @@
************************************************************************/
package complex.tempfile;
-import complexlib.ComplexTestCase;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.ucb.XSimpleFileAccess;
import com.sun.star.io.*;
-import com.sun.star.lang.XServiceInfo;
+
import com.sun.star.uno.UnoRuntime;
import java.util.Random;
-import share.LogWriter;
public class Test02 implements TempFileTest {
@@ -42,10 +40,10 @@ public class Test02 implements TempFileTest {
XSimpleFileAccess m_xSFA;
TestHelper m_aTestHelper;
- public Test02(XMultiServiceFactory xMSF, XSimpleFileAccess xSFA, LogWriter aLogWriter) {
+ public Test02(XMultiServiceFactory xMSF, XSimpleFileAccess xSFA) {
m_xMSF = xMSF;
m_xSFA = xSFA;
- m_aTestHelper = new TestHelper(aLogWriter, "Test02: ");
+ m_aTestHelper = new TestHelper( "Test02: ");
}
public boolean test() {
@@ -57,11 +55,9 @@ public class Test02 implements TempFileTest {
//create a temporary file.
try {
oTempFile = m_xMSF.createInstance( "com.sun.star.io.TempFile" );
- xTempFile = (XTempFile) UnoRuntime.queryInterface( XTempFile.class,
- oTempFile );
+ xTempFile = UnoRuntime.queryInterface(XTempFile.class, oTempFile);
m_aTestHelper.Message( "Tempfile created." );
- xTruncate = (XTruncate)UnoRuntime.queryInterface( XTruncate.class,
- oTempFile );
+ xTruncate = UnoRuntime.queryInterface(XTruncate.class, oTempFile);
} catch(Exception e) {
m_aTestHelper.Error( "Cannot create TempFile. exception: " + e );
return false;
diff --git a/unotools/qa/complex/tempfile/TestHelper.java b/unotools/qa/complex/tempfile/TestHelper.java
index 6edc2c362fa8..cf93828624f5 100644
--- a/unotools/qa/complex/tempfile/TestHelper.java
+++ b/unotools/qa/complex/tempfile/TestHelper.java
@@ -26,22 +26,20 @@
************************************************************************/
package complex.tempfile;
-import complexlib.ComplexTestCase;
-import com.sun.star.lang.XMultiServiceFactory;
+
import com.sun.star.io.*;
import com.sun.star.uno.AnyConverter;
import com.sun.star.ucb.XSimpleFileAccess;
-import com.sun.star.uno.UnoRuntime;
-import share.LogWriter;
+
public class TestHelper {
- LogWriter m_aLogWriter;
+
String m_sTestPrefix;
- public TestHelper( LogWriter aLogWriter, String sTestPrefix ) {
- m_aLogWriter = aLogWriter;
+ public TestHelper( String sTestPrefix ) {
+
m_sTestPrefix = sTestPrefix;
}
public void SetTempFileRemove( XTempFile xTempFile, boolean b ) {
@@ -69,7 +67,7 @@ public class TestHelper {
} catch (Exception e) {
Error ( "Cannot get TempFileURL. exception: " + e );
}
- if ( sTempFileURL == null || sTempFileURL == "" ) {
+ if ( sTempFileURL == null || sTempFileURL.equals("") ) {
Error ( "Temporary file not valid." );
}
return sTempFileURL;
@@ -82,7 +80,7 @@ public class TestHelper {
} catch ( Exception e ) {
Error( "Cannot get TempFileName. exception: " + e );
}
- if ( sTempFileName == null || sTempFileName == "") {
+ if ( sTempFileName == null || sTempFileName.equals("") ) {
Error( "Temporary file not valid." );
}
return sTempFileName;
@@ -216,10 +214,10 @@ public class TestHelper {
}
public void Error( String sError ) {
- m_aLogWriter.println( m_sTestPrefix + "Error: " + sError );
+ System.out.println( m_sTestPrefix + "Error: " + sError );
}
public void Message( String sMessage ) {
- m_aLogWriter.println( m_sTestPrefix + sMessage );
+ System.out.println( m_sTestPrefix + sMessage );
}
}
diff --git a/unotools/qa/complex/tempfile/makefile.mk b/unotools/qa/complex/tempfile/makefile.mk
index 13d66ca3edd1..30a5eb7261ec 100644
--- a/unotools/qa/complex/tempfile/makefile.mk
+++ b/unotools/qa/complex/tempfile/makefile.mk
@@ -25,61 +25,33 @@
#
#*************************************************************************
-PRJ = ..$/..$/..
-TARGET = TempFileUnitTest
-PRJNAME = unotools
-PACKAGE = complex$/tempfile
-
-# --- Settings -----------------------------------------------------
-.INCLUDE: settings.mk
-
-
-#----- compile .java files -----------------------------------------
-
-JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar
-
-JAVAFILES =\
- TempFileUnitTest.java\
- TempFileTest.java\
- TestHelper.java\
- Test01.java\
- Test02.java
-
-JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class)
-
-#----- make a jar from compiled files ------------------------------
-
-MAXLINELENGTH = 100000
-
-JARCLASSDIRS = $(PACKAGE)
-JARTARGET = $(TARGET).jar
-JARCOMPRESS = TRUE
-
-# --- Parameters for the test --------------------------------------
-
-# start an office if the parameter is set for the makefile
-.IF "$(OFFICE)" == ""
-CT_APPEXECCOMMAND =
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
.ELSE
-CT_APPEXECCOMMAND = -AppExecutionCommand "$(OFFICE)$/soffice -accept=socket,host=localhost,port=8100;urp;"
-.ENDIF
-# test base is java complex
-CT_TESTBASE = -TestBase java_complex
+PRJ = ../../..
+PRJNAME = unotools
+TARGET = qa_complex_tempfile
-# test looks something like the.full.package.TestName
-CT_TEST = -o $(PACKAGE:s\$/\.\).$(JAVAFILES:b)
+.IF "$(OOO_JUNIT_JAR)" != ""
+PACKAGE = complex/tempfile
+JAVATESTFILES = \
+ TempFileUnitTest.java
-# start the runner application
-CT_APP = org.openoffice.Runner
+JAVAFILES = $(JAVATESTFILES) \
+ TempFileTest.java \
+ Test01.java \
+ Test02.java \
+ TestHelper.java
-# --- Targets ------------------------------------------------------
+JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar jurt.jar
+EXTRAJARFILES = $(OOO_JUNIT_JAR)
+.END
+.INCLUDE: settings.mk
.INCLUDE: target.mk
+.INCLUDE: installationtest.mk
-RUN: run
-
-run:
- +java -cp $(CLASSPATH) $(CT_APP) $(CT_TESTBASE) $(CT_APPEXECCOMMAND) $(CT_TEST)
-
+ALLTAR : javatest
+.END
diff --git a/unotools/source/config/menuoptions.cxx b/unotools/source/config/menuoptions.cxx
deleted file mode 100644
index 2c5756c2140c..000000000000
--- a/unotools/source/config/menuoptions.cxx
+++ /dev/null
@@ -1,561 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_unotools.hxx"
-#ifndef GCC
-#endif
-
-//_________________________________________________________________________________________________________________
-// includes
-//_________________________________________________________________________________________________________________
-
-#include <unotools/menuoptions.hxx>
-#include <unotools/configmgr.hxx>
-#include <unotools/configitem.hxx>
-#include <tools/debug.hxx>
-#include <com/sun/star/uno/Any.hxx>
-#include <com/sun/star/uno/Sequence.hxx>
-#include <vcl/svapp.hxx>
-
-#include <rtl/logfile.hxx>
-#include "itemholder1.hxx"
-
-//_________________________________________________________________________________________________________________
-// namespaces
-//_________________________________________________________________________________________________________________
-
-using namespace ::utl ;
-using namespace ::rtl ;
-using namespace ::osl ;
-using namespace ::com::sun::star::uno ;
-
-//_________________________________________________________________________________________________________________
-// const
-//_________________________________________________________________________________________________________________
-
-#define ROOTNODE_MENU OUString(RTL_CONSTASCII_USTRINGPARAM("Office.Common/View/Menu" ))
-#define DEFAULT_DONTHIDEDISABLEDENTRIES sal_False
-#define DEFAULT_FOLLOWMOUSE sal_True
-#define DEFAULT_MENUICONS 2
-
-#define PROPERTYNAME_DONTHIDEDISABLEDENTRIES OUString(RTL_CONSTASCII_USTRINGPARAM("DontHideDisabledEntry" ))
-#define PROPERTYNAME_FOLLOWMOUSE OUString(RTL_CONSTASCII_USTRINGPARAM("FollowMouse" ))
-#define PROPERTYNAME_SHOWICONSINMENUES OUString(RTL_CONSTASCII_USTRINGPARAM("ShowIconsInMenues" ))
-#define PROPERTYNAME_SYSTEMICONSINMENUES OUString(RTL_CONSTASCII_USTRINGPARAM("IsSystemIconsInMenus" ))
-
-#define PROPERTYHANDLE_DONTHIDEDISABLEDENTRIES 0
-#define PROPERTYHANDLE_FOLLOWMOUSE 1
-#define PROPERTYHANDLE_SHOWICONSINMENUES 2
-#define PROPERTYHANDLE_SYSTEMICONSINMENUES 3
-
-#define PROPERTYCOUNT 4
-
-#include <tools/link.hxx>
-#include <tools/list.hxx>
-DECLARE_LIST( LinkList, Link * )
-
-//_________________________________________________________________________________________________________________
-// private declarations!
-//_________________________________________________________________________________________________________________
-
-class SvtMenuOptions_Impl : public ConfigItem
-{
- //-------------------------------------------------------------------------------------------------------------
- // private member
- //-------------------------------------------------------------------------------------------------------------
-
- private:
- LinkList aList;
- sal_Bool m_bDontHideDisabledEntries ; /// cache "DontHideDisabledEntries" of Menu section
- sal_Bool m_bFollowMouse ; /// cache "FollowMouse" of Menu section
- sal_Int16 m_nMenuIcons ; /// cache "MenuIcons" of Menu section
-
- //-------------------------------------------------------------------------------------------------------------
- // public methods
- //-------------------------------------------------------------------------------------------------------------
-
- public:
-
- //---------------------------------------------------------------------------------------------------------
- // constructor / destructor
- //---------------------------------------------------------------------------------------------------------
-
- SvtMenuOptions_Impl();
- ~SvtMenuOptions_Impl();
-
- void AddListener( const Link& rLink );
- void RemoveListener( const Link& rLink );
-
- //---------------------------------------------------------------------------------------------------------
- // overloaded methods of baseclass
- //---------------------------------------------------------------------------------------------------------
-
- /*-****************************************************************************************************//**
- @short called for notify of configmanager
- @descr These method is called from the ConfigManager before application ends or from the
- PropertyChangeListener if the sub tree broadcasts changes. You must update your
- internal values.
-
- @seealso baseclass ConfigItem
-
- @param "seqPropertyNames" is the list of properties which should be updated.
- @return -
-
- @onerror -
- *//*-*****************************************************************************************************/
-
- virtual void Notify( const Sequence< OUString >& seqPropertyNames );
-
- /*-****************************************************************************************************//**
- @short write changes to configuration
- @descr These method writes the changed values into the sub tree
- and should always called in our destructor to guarantee consistency of config data.
-
- @seealso baseclass ConfigItem
-
- @param -
- @return -
-
- @onerror -
- *//*-*****************************************************************************************************/
-
- virtual void Commit();
-
- //---------------------------------------------------------------------------------------------------------
- // public interface
- //---------------------------------------------------------------------------------------------------------
-
- /*-****************************************************************************************************//**
- @short access method to get internal values
- @descr These method give us a chance to regulate acces to ouer internal values.
- It's not used in the moment - but it's possible for the feature!
-
- @seealso -
-
- @param -
- @return -
-
- @onerror -
- *//*-*****************************************************************************************************/
-
- sal_Bool IsEntryHidingEnabled() const
- { return m_bDontHideDisabledEntries; }
-
- sal_Bool IsFollowMouseEnabled() const
- { return m_bFollowMouse; }
-
- sal_Int16 GetMenuIconsState() const
- { return m_nMenuIcons; }
-
- void SetEntryHidingState ( sal_Bool bState )
- {
- m_bDontHideDisabledEntries = bState;
- SetModified();
- for ( USHORT n=0; n<aList.Count(); n++ )
- aList.GetObject(n)->Call( this );
- Commit();
- }
-
- void SetFollowMouseState ( sal_Bool bState )
- {
- m_bFollowMouse = bState;
- SetModified();
- for ( USHORT n=0; n<aList.Count(); n++ )
- aList.GetObject(n)->Call( this );
- Commit();
- }
-
- void SetMenuIconsState ( sal_Int16 bState )
- {
- m_nMenuIcons = bState;
- SetModified();
- for ( USHORT n=0; n<aList.Count(); n++ )
- aList.GetObject(n)->Call( this );
- Commit();
- }
-
- //-------------------------------------------------------------------------------------------------------------
- // private methods
- //-------------------------------------------------------------------------------------------------------------
-
- private:
-
- /*-****************************************************************************************************//**
- @short return list of fix key names of ouer configuration management which represent oue module tree
- @descr These methods return a static const list of key names. We need it to get needed values from our
- configuration management.
-
- @seealso -
-
- @param -
- @return A list of needed configuration keys is returned.
-
- @onerror -
- *//*-*****************************************************************************************************/
-
- static Sequence< OUString > impl_GetPropertyNames();
-};
-
-//_________________________________________________________________________________________________________________
-// definitions
-//_________________________________________________________________________________________________________________
-
-//*****************************************************************************************************************
-// constructor
-//*****************************************************************************************************************
-SvtMenuOptions_Impl::SvtMenuOptions_Impl()
- // Init baseclasses first
- : ConfigItem ( ROOTNODE_MENU )
- // Init member then.
- , m_bDontHideDisabledEntries ( DEFAULT_DONTHIDEDISABLEDENTRIES )
- , m_bFollowMouse ( DEFAULT_FOLLOWMOUSE )
- , m_nMenuIcons ( DEFAULT_MENUICONS )
-{
- // Use our static list of configuration keys to get his values.
- Sequence< OUString > seqNames = impl_GetPropertyNames();
- Sequence< Any > seqValues = GetProperties( seqNames ) ;
-
- // Safe impossible cases.
- // We need values from ALL configuration keys.
- // Follow assignment use order of values in relation to our list of key names!
- DBG_ASSERT( !(seqNames.getLength()!=seqValues.getLength()), "SvtMenuOptions_Impl::SvtMenuOptions_Impl()\nI miss some values of configuration keys!\n" );
-
- sal_Bool bMenuIcons = true;
- sal_Bool bSystemMenuIcons = true;
-
- // Copy values from list in right order to ouer internal member.
- sal_Int32 nPropertyCount = seqValues.getLength() ;
- sal_Int32 nProperty = 0 ;
- for( nProperty=0; nProperty<nPropertyCount; ++nProperty )
- {
- // Safe impossible cases.
- // Check any for valid value.
- DBG_ASSERT( !(seqValues[nProperty].hasValue()==sal_False), "SvtMenuOptions_Impl::SvtMenuOptions_Impl()\nInvalid property value for property detected!\n" );
- switch( nProperty )
- {
- case PROPERTYHANDLE_DONTHIDEDISABLEDENTRIES : {
- DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtMenuOptions_Impl::SvtMenuOptions_Impl()\nWho has changed the value type of \"Office.Common\\View\\Menu\\DontHideDisabledEntry\"?" );
- seqValues[nProperty] >>= m_bDontHideDisabledEntries;
- }
- break;
-
- case PROPERTYHANDLE_FOLLOWMOUSE : {
- DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtMenuOptions_Impl::SvtMenuOptions_Impl()\nWho has changed the value type of \"Office.Common\\View\\Menu\\FollowMouse\"?" );
- seqValues[nProperty] >>= m_bFollowMouse;
- }
- break;
- case PROPERTYHANDLE_SHOWICONSINMENUES : {
- DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtMenuOptions_Impl::SvtMenuOptions_Impl()\nWho has changed the value type of \"Office.Common\\View\\Menu\\ShowIconsInMenues\"?" );
- seqValues[nProperty] >>= bMenuIcons;
- }
- break;
- case PROPERTYHANDLE_SYSTEMICONSINMENUES : {
- DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtMenuOptions_Impl::SvtMenuOptions_Impl()\nWho has changed the value type of \"Office.Common\\View\\Menu\\IsSystemIconsInMenus\"?" );
- seqValues[nProperty] >>= bSystemMenuIcons;
- }
- break;
- }
- }
-
- m_nMenuIcons = bSystemMenuIcons ? 2 : bMenuIcons;
-
- EnableNotification( seqNames );
-}
-
-//*****************************************************************************************************************
-// destructor
-//*****************************************************************************************************************
-SvtMenuOptions_Impl::~SvtMenuOptions_Impl()
-{
- // Flush data to configuration!
- // User has no chance to do that.
- if( IsModified() == sal_True )
- {
- Commit();
- }
-
- for ( USHORT n=0; n<aList.Count(); )
- delete aList.Remove(n);
-}
-
-//*****************************************************************************************************************
-// public method
-//*****************************************************************************************************************
-void SvtMenuOptions_Impl::Notify( const Sequence< OUString >& seqPropertyNames )
-{
- // Use given list of updated properties to get his values from configuration directly!
- Sequence< Any > seqValues = GetProperties( seqPropertyNames );
- // Safe impossible cases.
- // We need values from ALL notified configuration keys.
- DBG_ASSERT( !(seqPropertyNames.getLength()!=seqValues.getLength()), "SvtMenuOptions_Impl::Notify()\nI miss some values of configuration keys!\n" );
-
- sal_Bool bMenuIcons = true;
- sal_Bool bSystemMenuIcons = true;
-
- // Step over list of property names and get right value from coreesponding value list to set it on internal members!
- sal_Int32 nCount = seqPropertyNames.getLength();
- for( sal_Int32 nProperty=0; nProperty<nCount; ++nProperty )
- {
- if( seqPropertyNames[nProperty] == PROPERTYNAME_DONTHIDEDISABLEDENTRIES )
- {
- DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtMenuOptions_Impl::Notify()\nWho has changed the value type of \"Office.Common\\View\\Menu\\DontHideDisabledEntry\"?" );
- seqValues[nProperty] >>= m_bDontHideDisabledEntries;
- }
- else if( seqPropertyNames[nProperty] == PROPERTYNAME_FOLLOWMOUSE )
- {
- DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtMenuOptions_Impl::Notify()\nWho has changed the value type of \"Office.Common\\View\\Menu\\FollowMouse\"?" );
- seqValues[nProperty] >>= m_bFollowMouse;
- }
- else if( seqPropertyNames[nProperty] == PROPERTYNAME_SHOWICONSINMENUES )
- {
- DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtMenuOptions_Impl::SvtMenuOptions_Impl()\nWho has changed the value type of \"Office.Common\\View\\Menu\\ShowIconsInMenues\"?" );
- seqValues[nProperty] >>= bMenuIcons;
- }
- else if( seqPropertyNames[nProperty] == PROPERTYNAME_SYSTEMICONSINMENUES )
- {
- DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtMenuOptions_Impl::SvtMenuOptions_Impl()\nWho has changed the value type of \"Office.Common\\View\\Menu\\IsSystemIconsInMenus\"?" );
- seqValues[nProperty] >>= bSystemMenuIcons;
- }
-
- #if OSL_DEBUG_LEVEL > 1
- else DBG_ASSERT( sal_False, "SvtMenuOptions_Impl::Notify()\nUnkown property detected ... I can't handle these!\n" );
- #endif
- }
-
- m_nMenuIcons = bSystemMenuIcons ? 2 : bMenuIcons;
-
- for ( USHORT n=0; n<aList.Count(); n++ )
- aList.GetObject(n)->Call( this );
-}
-
-//*****************************************************************************************************************
-// public method
-//*****************************************************************************************************************
-void SvtMenuOptions_Impl::Commit()
-{
- // Get names of supported properties, create a list for values and copy current values to it.
- Sequence< OUString > seqNames = impl_GetPropertyNames();
- sal_Int32 nCount = seqNames.getLength();
- Sequence< Any > seqValues ( nCount );
- for( sal_Int32 nProperty=0; nProperty<nCount; ++nProperty )
- {
- switch( nProperty )
- {
- case PROPERTYHANDLE_DONTHIDEDISABLEDENTRIES : {
- seqValues[nProperty] <<= m_bDontHideDisabledEntries;
- }
- break;
-
- case PROPERTYHANDLE_FOLLOWMOUSE : {
- seqValues[nProperty] <<= m_bFollowMouse;
- }
- break;
- //Output cache of current setting as possibly modified by System Theme for older version
- case PROPERTYHANDLE_SHOWICONSINMENUES : {
- seqValues[nProperty] <<=(sal_Bool)(Application::GetSettings().GetStyleSettings().GetUseImagesInMenus());
- }
- break;
- case PROPERTYHANDLE_SYSTEMICONSINMENUES : {
- seqValues[nProperty] <<= (m_nMenuIcons == 2 ? sal_True : sal_False) ;
- }
- break;
- }
- }
- // Set properties in configuration.
- PutProperties( seqNames, seqValues );
-}
-
-//*****************************************************************************************************************
-// private method
-//*****************************************************************************************************************
-Sequence< OUString > SvtMenuOptions_Impl::impl_GetPropertyNames()
-{
- // Build static list of configuration key names.
- static const OUString pProperties[] =
- {
- PROPERTYNAME_DONTHIDEDISABLEDENTRIES ,
- PROPERTYNAME_FOLLOWMOUSE ,
- PROPERTYNAME_SHOWICONSINMENUES ,
- PROPERTYNAME_SYSTEMICONSINMENUES
- };
- // Initialize return sequence with these list ...
- static const Sequence< OUString > seqPropertyNames( pProperties, PROPERTYCOUNT );
- // ... and return it.
- return seqPropertyNames;
-}
-
-void SvtMenuOptions_Impl::AddListener( const Link& rLink )
-{
- aList.Insert( new Link( rLink ) );
-}
-
-void SvtMenuOptions_Impl::RemoveListener( const Link& rLink )
-{
- for ( USHORT n=0; n<aList.Count(); n++ )
- {
- if ( (*aList.GetObject(n) ) == rLink )
- {
- delete aList.Remove(n);
- break;
- }
- }
-}
-
-//*****************************************************************************************************************
-// initialize static member
-// DON'T DO IT IN YOUR HEADER!
-// see definition for further informations
-//*****************************************************************************************************************
-SvtMenuOptions_Impl* SvtMenuOptions::m_pDataContainer = NULL ;
-sal_Int32 SvtMenuOptions::m_nRefCount = 0 ;
-
-//*****************************************************************************************************************
-// constructor
-//*****************************************************************************************************************
-SvtMenuOptions::SvtMenuOptions()
-{
- // Global access, must be guarded (multithreading!).
- MutexGuard aGuard( GetOwnStaticMutex() );
- // Increase ouer refcount ...
- ++m_nRefCount;
- // ... and initialize ouer data container only if it not already!
- if( m_pDataContainer == NULL )
- {
- RTL_LOGFILE_CONTEXT(aLog, "unotools ( ??? ) ::SvtMenuOptions_Impl::ctor()");
- m_pDataContainer = new SvtMenuOptions_Impl();
-
- ItemHolder1::holdConfigItem(E_MENUOPTIONS);
- }
-}
-
-//*****************************************************************************************************************
-// destructor
-//*****************************************************************************************************************
-SvtMenuOptions::~SvtMenuOptions()
-{
- // Global access, must be guarded (multithreading!)
- MutexGuard aGuard( GetOwnStaticMutex() );
- // Decrease ouer refcount.
- --m_nRefCount;
- // If last instance was deleted ...
- // we must destroy ouer static data container!
- if( m_nRefCount <= 0 )
- {
- delete m_pDataContainer;
- m_pDataContainer = NULL;
- }
-}
-
-//*****************************************************************************************************************
-// public method
-//*****************************************************************************************************************
-sal_Bool SvtMenuOptions::IsEntryHidingEnabled() const
-{
- MutexGuard aGuard( GetOwnStaticMutex() );
- return m_pDataContainer->IsEntryHidingEnabled();
-}
-
-//*****************************************************************************************************************
-// public method
-//*****************************************************************************************************************
-sal_Bool SvtMenuOptions::IsFollowMouseEnabled() const
-{
- MutexGuard aGuard( GetOwnStaticMutex() );
- return m_pDataContainer->IsFollowMouseEnabled();
-}
-
-//*****************************************************************************************************************
-// public method
-//*****************************************************************************************************************
-void SvtMenuOptions::SetEntryHidingState( sal_Bool bState )
-{
- MutexGuard aGuard( GetOwnStaticMutex() );
- m_pDataContainer->SetEntryHidingState( bState );
-}
-
-//*****************************************************************************************************************
-// public method
-//*****************************************************************************************************************
-void SvtMenuOptions::SetFollowMouseState( sal_Bool bState )
-{
- MutexGuard aGuard( GetOwnStaticMutex() );
- m_pDataContainer->SetFollowMouseState( bState );
-}
-
-//*****************************************************************************************************************
-// public method
-//*****************************************************************************************************************
-sal_Int16 SvtMenuOptions::GetMenuIconsState() const
-{
- MutexGuard aGuard( GetOwnStaticMutex() );
- return m_pDataContainer->GetMenuIconsState();
-}
-
-//*****************************************************************************************************************
-// public method
-//*****************************************************************************************************************
-void SvtMenuOptions::SetMenuIconsState( sal_Int16 bState )
-{
- MutexGuard aGuard( GetOwnStaticMutex() );
- m_pDataContainer->SetMenuIconsState( bState );
-}
-
-//*****************************************************************************************************************
-// private method
-//*****************************************************************************************************************
-Mutex& SvtMenuOptions::GetOwnStaticMutex()
-{
- // Initialize static mutex only for one time!
- static Mutex* pMutex = NULL;
- // If these method first called (Mutex not already exist!) ...
- if( pMutex == NULL )
- {
- // ... we must create a new one. Protect follow code with the global mutex -
- // It must be - we create a static variable!
- MutexGuard aGuard( Mutex::getGlobalMutex() );
- // We must check our pointer again - because it can be that another instance of ouer class will be fastr then these!
- if( pMutex == NULL )
- {
- // Create the new mutex and set it for return on static variable.
- static Mutex aMutex;
- pMutex = &aMutex;
- }
- }
- // Return new created or already existing mutex object.
- return *pMutex;
-}
-
-void SvtMenuOptions::AddListener( const Link& rLink )
-{
- m_pDataContainer->AddListener( rLink );
-}
-
-void SvtMenuOptions::RemoveListener( const Link& rLink )
-{
- m_pDataContainer->RemoveListener( rLink );
-}
diff --git a/unotools/source/config/pathoptions.cxx b/unotools/source/config/pathoptions.cxx
index 2ae6f0c97f0c..3cf43a1f3bc9 100644
--- a/unotools/source/config/pathoptions.cxx
+++ b/unotools/source/config/pathoptions.cxx
@@ -46,12 +46,14 @@
#include <unotools/ucbhelper.hxx>
#include <vos/process.hxx>
#include <comphelper/processfactory.hxx>
+#include <comphelper/componentcontext.hxx>
#include <com/sun/star/beans/XFastPropertySet.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/beans/XPropertySetInfo.hpp>
#include <com/sun/star/util/XStringSubstitution.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/util/XMacroExpander.hpp>
#include <rtl/instance.hxx>
#include <itemholder1.hxx>
@@ -998,6 +1000,17 @@ sal_Bool SvtPathOptions::SearchFile( String& rIniFile, Pathes ePath )
if ( LocalFileHelper::ConvertPhysicalNameToURL( aPathToken, aURL ) )
aObj.SetURL( aURL );
}
+ if ( aObj.GetProtocol() == INET_PROT_VND_SUN_STAR_EXPAND )
+ {
+ ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() );
+ Reference< XMacroExpander > xMacroExpander( aContext.getSingleton( "com.sun.star.util.theMacroExpander" ), UNO_QUERY );
+ OSL_ENSURE( xMacroExpander.is(), "SvtPathOptions::SearchFile: unable to access the MacroExpander singleton!" );
+ if ( xMacroExpander.is() )
+ {
+ const ::rtl::OUString sExpandedPath = xMacroExpander->expandMacros( aObj.GetURLPath( INetURLObject::DECODE_WITH_CHARSET ) );
+ aObj.SetURL( sExpandedPath );
+ }
+ }
xub_StrLen i, nCount = aIniFile.GetTokenCount( '/' );
for ( i = 0; i < nCount; ++i )
diff --git a/unotools/source/ucbhelper/tempfile.cxx b/unotools/source/ucbhelper/tempfile.cxx
index e77dc529e410..87fddc0c65cd 100644
--- a/unotools/source/ucbhelper/tempfile.cxx
+++ b/unotools/source/ucbhelper/tempfile.cxx
@@ -198,19 +198,19 @@ String ConstructTempDir_Impl( const String* pParent )
void CreateTempName_Impl( String& rName, sal_Bool bKeep, sal_Bool bDir = sal_True )
{
// add a suitable tempname
- // Prefix can have 5 chars, leaving 3 for numbers. 26 ** 3 == 17576
- // ER 13.07.00 why not radix 36 [0-9A-Z] ?!?
- const unsigned nRadix = 26;
+ // 36 ** 6 == 2176782336
+ unsigned const nRadix = 36;
+ unsigned long const nMax = (nRadix*nRadix*nRadix*nRadix*nRadix*nRadix);
String aName( rName );
aName += String::CreateFromAscii( "sv" );
rName.Erase();
- static unsigned long u = Time::GetSystemTicks();
- for ( unsigned long nOld = u; ++u != nOld; )
+ unsigned long nSeed = Time::GetSystemTicks() % nMax;
+ for ( unsigned long u = nSeed; ++u != nSeed; )
{
- u %= (nRadix*nRadix*nRadix);
+ u %= nMax;
String aTmp( aName );
- aTmp += String::CreateFromInt32( (sal_Int32) (unsigned) u, nRadix );
+ aTmp += String::CreateFromInt64( static_cast<sal_Int64>(u), nRadix );
aTmp += String::CreateFromAscii( ".tmp" );
if ( bDir )
diff --git a/unotools/source/ucbhelper/xtempfile.cxx b/unotools/source/ucbhelper/xtempfile.cxx
index 023211dc3527..525596fae854 100644
--- a/unotools/source/ucbhelper/xtempfile.cxx
+++ b/unotools/source/ucbhelper/xtempfile.cxx
@@ -28,12 +28,6 @@
#include <XTempFile.hxx>
#include <cppuhelper/factory.hxx>
#include <cppuhelper/typeprovider.hxx>
-#ifndef _COM_SUN_STAR_REGISTRY_XREGISTRYKEY_HPP
-#include <com/sun/star/registry/XRegistryKey.hpp>
-#endif
-#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP
-#include <com/sun/star/beans/PropertyAttribute.hpp>
-#endif
#include <unotools/tempfile.hxx>
#include <osl/file.hxx>
#include <unotools/configmgr.hxx>
@@ -489,43 +483,6 @@ throw ( ::css::uno::RuntimeException )
return ::cppu::createSingleComponentFactory( XTempFile_createInstance, getImplementationName_Static(), getSupportedServiceNames_Static() );
}
-static sal_Bool writeInfo( void * pRegistryKey,
- const ::rtl::OUString & rImplementationName,
- ::css::uno::Sequence< ::rtl::OUString > const & rServiceNames )
-{
- ::rtl::OUString aKeyName( RTL_CONSTASCII_USTRINGPARAM ( "/" ) );
- aKeyName += rImplementationName;
- aKeyName += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "/UNO/SERVICES" ) );
-
- ::css::uno::Reference< ::css::registry::XRegistryKey > xKey;
- try
- {
- xKey = static_cast< ::css::registry::XRegistryKey * >(
- pRegistryKey )->createKey( aKeyName );
- }
- catch ( ::css::registry::InvalidRegistryException const & )
- {
- }
-
- if ( !xKey.is() )
- return sal_False;
-
- sal_Bool bSuccess = sal_True;
-
- for ( sal_Int32 n = 0; n < rServiceNames.getLength(); ++n )
- {
- try
- {
- xKey->createKey( rServiceNames[ n ] );
- }
- catch ( ::css::registry::InvalidRegistryException const & )
- {
- bSuccess = sal_False;
- break;
- }
- }
- return bSuccess;
-}
// C functions to implement this as a component
extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
@@ -535,21 +492,6 @@ extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnviron
}
/**
- * This function creates an implementation section in the registry and another subkey
- * for each supported service.
- * @param pServiceManager generic uno interface providing a service manager
- * @param pRegistryKey generic uno interface providing registry key to write
- */
-extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( void* /*pServiceManager*/, void* pRegistryKey )
-{
- return pRegistryKey &&
- writeInfo (pRegistryKey,
- OTempFileService::getImplementationName_Static(),
- OTempFileService::getSupportedServiceNames_Static() );
-}
-
-
-/**
* This function is called to get service factories for an implementation.
* @param pImplName name of implementation
* @param pServiceManager generic uno interface providing a service manager to instantiate components
diff --git a/unotools/util/makefile.mk b/unotools/util/makefile.mk
index 8e725d2de2fa..343e56f04169 100644
--- a/unotools/util/makefile.mk
+++ b/unotools/util/makefile.mk
@@ -94,3 +94,11 @@ $(MISC)$/$(SHL1TARGET).flt: makefile.mk
@echo UpdateToConfig >> $@
@echo _Impl >> $@
+
+ALLTAR : $(MISC)/utl.component
+
+$(MISC)/utl.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ utl.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt utl.component
diff --git a/unotools/util/utl.component b/unotools/util/utl.component
new file mode 100644
index 000000000000..8c8198741f55
--- /dev/null
+++ b/unotools/util/utl.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.io.comp.TempFile">
+ <service name="com.sun.star.io.TempFile"/>
+ </implementation>
+</component>
diff --git a/vcl/aqua/inc/salframeview.h b/vcl/aqua/inc/salframeview.h
index d812523c472d..e7d9a14b52aa 100755
--- a/vcl/aqua/inc/salframeview.h
+++ b/vcl/aqua/inc/salframeview.h
@@ -37,6 +37,7 @@
}
-(id)initWithSalFrame: (AquaSalFrame*)pFrame;
-(MacOSBOOL)canBecomeKeyWindow;
+-(void)displayIfNeeded;
-(void)windowDidBecomeKey: (NSNotification*)pNotification;
-(void)windowDidResignKey: (NSNotification*)pNotification;
-(void)windowDidChangeScreen: (NSNotification*)pNotification;
diff --git a/vcl/aqua/inc/salgdi.h b/vcl/aqua/inc/salgdi.h
index 8867d1d26078..17c4aa7acd44 100644
--- a/vcl/aqua/inc/salgdi.h
+++ b/vcl/aqua/inc/salgdi.h
@@ -59,7 +59,7 @@ public:
virtual ImplFontEntry* CreateFontInstance( ImplFontSelectData& ) const;
virtual sal_IntPtr GetFontId() const;
- ImplFontCharMap* GetImplFontCharMap() const;
+ const ImplFontCharMap* GetImplFontCharMap() const;
bool HasChar( sal_uInt32 cChar ) const;
void ReadOs2Table() const;
@@ -68,7 +68,7 @@ public:
private:
const ATSUFontID mnFontId;
- mutable ImplFontCharMap* mpCharMap;
+ mutable const ImplFontCharMap* mpCharMap;
mutable bool mbOs2Read; // true if OS2-table related info is valid
mutable bool mbHasOs2Table;
mutable bool mbCmapEncodingRead; // true if cmap encoding of Mac font is read
@@ -276,12 +276,12 @@ public:
// set the font
virtual USHORT SetFont( ImplFontSelectData*, int nFallbackLevel );
// get the current font's etrics
- virtual void GetFontMetric( ImplFontMetricData* );
+ virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel );
// get kernign pairs of the current font
// return only PairCount if (pKernPairs == NULL)
virtual ULONG GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs );
// get the repertoire of the current font
- virtual ImplFontCharMap* GetImplFontCharMap() const;
+ virtual const ImplFontCharMap* GetImplFontCharMap() const;
// graphics must fill supplied font list
virtual void GetDevFontList( ImplDevFontList* );
// graphics should call ImplAddDevFontSubstitute on supplied
diff --git a/vcl/aqua/inc/salinst.h b/vcl/aqua/inc/salinst.h
index 0bceb99d1d0e..4b0385844eed 100644
--- a/vcl/aqua/inc/salinst.h
+++ b/vcl/aqua/inc/salinst.h
@@ -134,9 +134,10 @@ public:
virtual vos::IMutex* GetYieldMutex();
virtual ULONG ReleaseYieldMutex();
virtual void AcquireYieldMutex( ULONG nCount );
+ virtual bool CheckYieldMutex();
virtual void Yield( bool bWait, bool bHandleAllCurrentEvents );
virtual bool AnyInput( USHORT nType );
- virtual SalMenu* CreateMenu( BOOL bMenuBar );
+ virtual SalMenu* CreateMenu( BOOL bMenuBar, Menu* pVCLMenu );
virtual void DestroyMenu( SalMenu* );
virtual SalMenuItem* CreateMenuItem( const SalItemParams* pItemData );
virtual void DestroyMenuItem( SalMenuItem* );
diff --git a/vcl/aqua/inc/salsys.h b/vcl/aqua/inc/salsys.h
index 6f5c45880e68..ae20706a1756 100644
--- a/vcl/aqua/inc/salsys.h
+++ b/vcl/aqua/inc/salsys.h
@@ -55,11 +55,6 @@ public:
virtual Rectangle GetDisplayWorkAreaPosSizePixel( unsigned int nScreen );
virtual rtl::OUString GetScreenName( unsigned int nScreen );
- // overload pure virtual methods
- virtual int ShowNativeDialog( const String& rTitle,
- const String& rMessage,
- const std::list< String >& rButtons,
- int nDefButton );
virtual int ShowNativeMessageBox( const String& rTitle,
const String& rMessage,
int nButtonCombination,
diff --git a/vcl/aqua/source/app/salinst.cxx b/vcl/aqua/source/app/salinst.cxx
index b8a2261ed9db..5d2fc3f00741 100644
--- a/vcl/aqua/source/app/salinst.cxx
+++ b/vcl/aqua/source/app/salinst.cxx
@@ -371,13 +371,13 @@ SalYieldMutex::SalYieldMutex()
void SalYieldMutex::acquire()
{
OMutex::acquire();
- mnThreadId = NAMESPACE_VOS(OThread)::getCurrentIdentifier();
+ mnThreadId = vos::OThread::getCurrentIdentifier();
mnCount++;
}
void SalYieldMutex::release()
{
- if ( mnThreadId == NAMESPACE_VOS(OThread)::getCurrentIdentifier() )
+ if ( mnThreadId == vos::OThread::getCurrentIdentifier() )
{
if ( mnCount == 1 )
mnThreadId = 0;
@@ -390,7 +390,7 @@ sal_Bool SalYieldMutex::tryToAcquire()
{
if ( OMutex::tryToAcquire() )
{
- mnThreadId = NAMESPACE_VOS(OThread)::getCurrentIdentifier();
+ mnThreadId = vos::OThread::getCurrentIdentifier();
mnCount++;
return sal_True;
}
@@ -449,7 +449,7 @@ SalInstance* CreateSalInstance()
ImplGetSVData()->maNWFData.mbCenteredTabs = true;
ImplGetSVData()->maNWFData.mbProgressNeedsErase = true;
ImplGetSVData()->maNWFData.mbCheckBoxNeedsErase = true;
- ImplGetSVData()->maGDIData.mbPrinterPullModel = true;
+ ImplGetSVData()->maNWFData.mnStatusBarLowerRightOffset = 10;
ImplGetSVData()->maGDIData.mbNoXORClipping = true;
ImplGetSVData()->maWinData.mbNoSaveBackground = true;
@@ -536,7 +536,7 @@ ULONG AquaSalInstance::ReleaseYieldMutex()
{
SalYieldMutex* pYieldMutex = mpSalYieldMutex;
if ( pYieldMutex->GetThreadId() ==
- NAMESPACE_VOS(OThread)::getCurrentIdentifier() )
+ vos::OThread::getCurrentIdentifier() )
{
ULONG nCount = pYieldMutex->GetAcquireCount();
ULONG n = nCount;
@@ -566,6 +566,22 @@ void AquaSalInstance::AcquireYieldMutex( ULONG nCount )
// -----------------------------------------------------------------------
+bool AquaSalInstance::CheckYieldMutex()
+{
+ bool bRet = true;
+
+ SalYieldMutex* pYieldMutex = mpSalYieldMutex;
+ if ( pYieldMutex->GetThreadId() !=
+ vos::OThread::getCurrentIdentifier() )
+ {
+ bRet = false;
+ }
+
+ return bRet;
+}
+
+// -----------------------------------------------------------------------
+
bool AquaSalInstance::isNSAppThread() const
{
return vos::OThread::getCurrentIdentifier() == maMainThread;
@@ -975,6 +991,9 @@ void AquaSalInstance::DeletePrinterQueueInfo( SalPrinterQueueInfo* pInfo )
XubString AquaSalInstance::GetDefaultPrinter()
{
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
if( ! maDefaultPrinter.getLength() )
{
NSPrintInfo* pPI = [NSPrintInfo sharedPrintInfo];
@@ -999,6 +1018,9 @@ XubString AquaSalInstance::GetDefaultPrinter()
SalInfoPrinter* AquaSalInstance::CreateInfoPrinter( SalPrinterQueueInfo* pQueueInfo,
ImplJobSetup* pSetupData )
{
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
SalInfoPrinter* pNewInfoPrinter = NULL;
if( pQueueInfo )
{
@@ -1014,6 +1036,9 @@ SalInfoPrinter* AquaSalInstance::CreateInfoPrinter( SalPrinterQueueInfo* pQueueI
void AquaSalInstance::DestroyInfoPrinter( SalInfoPrinter* pPrinter )
{
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
delete pPrinter;
}
diff --git a/vcl/aqua/source/app/salsys.cxx b/vcl/aqua/source/app/salsys.cxx
index 3b548099feef..cf5cf00b7fe4 100644
--- a/vcl/aqua/source/app/salsys.cxx
+++ b/vcl/aqua/source/app/salsys.cxx
@@ -30,9 +30,11 @@
#include "tools/rc.hxx"
#include "vcl/svids.hrc"
+#include "vcl/button.hxx"
#include "salsys.h"
#include "saldata.hxx"
+#include "salinst.h"
#include "rtl/ustrbuf.hxx"
using namespace rtl;
@@ -114,12 +116,22 @@ rtl::OUString AquaSalSystem::GetScreenName( unsigned int nScreen )
return aRet;
}
-int AquaSalSystem::ShowNativeDialog( const String& rTitle,
- const String& rMessage,
- const std::list< String >& rButtons,
- int nDefButton )
+static NSString* getStandardString( int nButtonId )
{
- return 0;
+ rtl::OUString aText( Button::GetStandardText( nButtonId ) );
+ if( ! aText.getLength() ) // this is for bad cases, we might be missing the vcl resource
+ {
+ switch( nButtonId )
+ {
+ case BUTTON_OK: aText = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OK" ) );break;
+ case BUTTON_ABORT: aText = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Abort" ) );break;
+ case BUTTON_CANCEL: aText = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Cancel" ) );break;
+ case BUTTON_RETRY: aText = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Retry" ) );break;
+ case BUTTON_YES: aText = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Yes" ) );break;
+ case BUTTON_NO : aText = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "No" ) );break;
+ }
+ }
+ return aText.getLength() ? CreateNSString( aText) : nil;
}
int AquaSalSystem::ShowNativeMessageBox( const String& rTitle,
@@ -127,5 +139,82 @@ int AquaSalSystem::ShowNativeMessageBox( const String& rTitle,
int nButtonCombination,
int nDefaultButton)
{
- return 0;
+ NSString* pTitle = CreateNSString( rTitle );
+ NSString* pMessage = CreateNSString( rMessage );
+
+ struct id_entry
+ {
+ int nCombination;
+ int nDefaultButton;
+ int nTextIds[3];
+ } aButtonIds[] =
+ {
+ { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_OK, { BUTTON_OK, -1, -1 } },
+ { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK_CANCEL, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_OK, { BUTTON_OK, BUTTON_CANCEL, -1 } },
+ { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK_CANCEL, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL, { BUTTON_CANCEL, BUTTON_OK, -1 } },
+ { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_ABORT_RETRY_IGNORE, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_ABORT, { BUTTON_ABORT, BUTTON_IGNORE, BUTTON_RETRY } },
+ { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_ABORT_RETRY_IGNORE, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_RETRY, { BUTTON_RETRY, BUTTON_IGNORE, BUTTON_ABORT } },
+ { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_ABORT_RETRY_IGNORE, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_IGNORE, { BUTTON_IGNORE, BUTTON_IGNORE, BUTTON_ABORT } },
+ { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_YES_NO_CANCEL, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_YES, { BUTTON_YES, BUTTON_NO, BUTTON_CANCEL } },
+ { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_YES_NO_CANCEL, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_NO, { BUTTON_NO, BUTTON_YES, BUTTON_CANCEL } },
+ { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_YES_NO_CANCEL, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL, { BUTTON_CANCEL, BUTTON_YES, BUTTON_NO } },
+ { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_YES_NO, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_YES, { BUTTON_YES, BUTTON_NO, -1 } },
+ { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_YES_NO, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_NO, { BUTTON_NO, BUTTON_YES, -1 } },
+ { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_RETRY_CANCEL, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_RETRY, { BUTTON_RETRY, BUTTON_CANCEL, -1 } },
+ { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_RETRY_CANCEL, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL, { BUTTON_CANCEL, BUTTON_RETRY, -1 } }
+ };
+
+ NSString* pDefText = nil;
+ NSString* pAltText = nil;
+ NSString* pOthText = nil;
+
+ unsigned int nC;
+ for( nC = 0; nC < sizeof(aButtonIds)/sizeof(aButtonIds[0]); nC++ )
+ {
+ if( aButtonIds[nC].nCombination == nButtonCombination )
+ {
+ if( aButtonIds[nC].nDefaultButton == nDefaultButton )
+ {
+ if( aButtonIds[nC].nTextIds[0] != -1 )
+ pDefText = getStandardString( aButtonIds[nC].nTextIds[0] );
+ if( aButtonIds[nC].nTextIds[1] != -1 )
+ pAltText = getStandardString( aButtonIds[nC].nTextIds[1] );
+ if( aButtonIds[nC].nTextIds[2] != -1 )
+ pOthText = getStandardString( aButtonIds[nC].nTextIds[2] );
+ break;
+ }
+ }
+ }
+
+
+ int nResult = NSRunAlertPanel( pTitle, pMessage, pDefText, pAltText, pOthText );
+
+ if( pTitle )
+ [pTitle release];
+ if( pMessage )
+ [pMessage release];
+ if( pDefText )
+ [pDefText release];
+ if( pAltText )
+ [pAltText release];
+ if( pOthText )
+ [pOthText release];
+
+ int nRet = 0;
+ if( nC < sizeof(aButtonIds)/sizeof(aButtonIds[0]) && nResult >= 1 && nResult <= 3 )
+ {
+ int nPressed = aButtonIds[nC].nTextIds[nResult-1];
+ switch( nPressed )
+ {
+ case BUTTON_NO: nRet = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_NO; break;
+ case BUTTON_YES: nRet = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_YES; break;
+ case BUTTON_OK: nRet = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_OK; break;
+ case BUTTON_CANCEL: nRet = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL; break;
+ case BUTTON_ABORT: nRet = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_ABORT; break;
+ case BUTTON_RETRY: nRet = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_RETRY; break;
+ case BUTTON_IGNORE: nRet = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_IGNORE; break;
+ }
+ }
+
+ return nRet;
}
diff --git a/vcl/aqua/source/app/vclnsapp.mm b/vcl/aqua/source/app/vclnsapp.mm
index 4264f8802126..06af0358c52b 100755
--- a/vcl/aqua/source/app/vclnsapp.mm
+++ b/vcl/aqua/source/app/vclnsapp.mm
@@ -360,6 +360,8 @@
-(NSApplicationTerminateReply)applicationShouldTerminate: (NSApplication *) app
{
+ YIELD_GUARD;
+
SalData* pSalData = GetSalData();
#if 1 // currently do some really bad hack
if( ! pSalData->maFrames.empty() )
@@ -424,6 +426,8 @@
-(void)systemColorsChanged: (NSNotification*) pNotification
{
+ YIELD_GUARD;
+
const SalData* pSalData = GetSalData();
if( !pSalData->maFrames.empty() )
pSalData->maFrames.front()->CallCallback( SALEVENT_SETTINGSCHANGED, NULL );
@@ -431,6 +435,8 @@
-(void)screenParametersChanged: (NSNotification*) pNotification
{
+ YIELD_GUARD;
+
SalData* pSalData = GetSalData();
std::list< AquaSalFrame* >::iterator it;
for( it = pSalData->maFrames.begin(); it != pSalData->maFrames.end(); ++it )
diff --git a/vcl/aqua/source/dtrans/DataFlavorMapping.cxx b/vcl/aqua/source/dtrans/DataFlavorMapping.cxx
index e0a95a532bf8..01f989cbc1c1 100644
--- a/vcl/aqua/source/dtrans/DataFlavorMapping.cxx
+++ b/vcl/aqua/source/dtrans/DataFlavorMapping.cxx
@@ -575,11 +575,19 @@ DataProviderPtr_t DataFlavorMapper::getDataProvider(NSString* systemFlavor, Refe
if (isByteSequenceType(data.getValueType()))
{
+ /*
+ the HTMLFormatDataProvider prepends segment information to HTML
+ this is useful for exchange with MS Word (which brings this stuff from Windows)
+ but annoying for other applications. Since this extension is not a standard datatype
+ on the Mac, let us not provide but provide normal HTML
+
if ([systemFlavor caseInsensitiveCompare: NSHTMLPboardType] == NSOrderedSame)
{
dp = DataProviderPtr_t(new HTMLFormatDataProvider(data));
}
- else if ([systemFlavor caseInsensitiveCompare: NSPICTPboardType] == NSOrderedSame)
+ else
+ */
+ if ([systemFlavor caseInsensitiveCompare: NSPICTPboardType] == NSOrderedSame)
{
dp = DataProviderPtr_t(new BMPDataProvider(data, PICTImageFileType));
}
diff --git a/vcl/aqua/source/dtrans/DragSource.cxx b/vcl/aqua/source/dtrans/DragSource.cxx
index adb247d70711..1a8f950e50d4 100644
--- a/vcl/aqua/source/dtrans/DragSource.cxx
+++ b/vcl/aqua/source/dtrans/DragSource.cxx
@@ -38,6 +38,7 @@
#include "DragSourceContext.hxx"
#include "aqua_clipboard.hxx"
#include "DragActionConversion.hxx"
+#include "salframe.h"
#include <rtl/ustring.h>
#include <memory>
@@ -158,6 +159,7 @@ Sequence<OUString> dragSource_getSupportedServiceNames()
DragSource::DragSource():
WeakComponentImplHelper3<XDragSource, XInitialization, XServiceInfo>(m_aMutex),
mView(NULL),
+ mpFrame(NULL),
mLastMouseEventBeforeStartDrag(nil),
m_MouseButton(0)
{
@@ -166,8 +168,9 @@ DragSource::DragSource():
DragSource::~DragSource()
{
- [(id <MouseEventListener>)mView unregisterMouseEventListener: mDragSourceHelper];
- [mDragSourceHelper release];
+ if( mpFrame && AquaSalFrame::isAlive( mpFrame ) )
+ [(id <MouseEventListener>)mView unregisterMouseEventListener: mDragSourceHelper];
+ [mDragSourceHelper release];
}
@@ -197,6 +200,13 @@ void SAL_CALL DragSource::initialize(const Sequence< Any >& aArguments)
throw Exception(OUString(RTL_CONSTASCII_USTRINGPARAM("DragSource::initialize: Provided view doesn't support mouse listener")),
static_cast<OWeakObject*>(this));
}
+ NSWindow* pWin = [mView window];
+ if( ! pWin || ![pWin respondsToSelector: @selector(getSalFrame)] )
+ {
+ throw Exception(OUString(RTL_CONSTASCII_USTRINGPARAM("DragSource::initialize: Provided view is not attached to a vcl frame")),
+ static_cast<OWeakObject*>(this));
+ }
+ mpFrame = (AquaSalFrame*)[pWin performSelector: @selector(getSalFrame)];
mDragSourceHelper = [[DragSourceHelper alloc] initWithDragSource: this];
diff --git a/vcl/aqua/source/dtrans/DragSource.hxx b/vcl/aqua/source/dtrans/DragSource.hxx
index 5d02b9874149..f8f55176a308 100644
--- a/vcl/aqua/source/dtrans/DragSource.hxx
+++ b/vcl/aqua/source/dtrans/DragSource.hxx
@@ -46,6 +46,7 @@
class DragSource;
+class AquaSalFrame;
/* The functions declared in this protocol are actually
declared in vcl/aqua/inc/salframe.h. Because we want
@@ -120,6 +121,7 @@ public:
com::sun::star::uno::Reference< com::sun::star::datatransfer::dnd::XDragSourceContext > mXCurrentContext;
id mView;
+ AquaSalFrame* mpFrame;
NSEvent* mLastMouseEventBeforeStartDrag;
DragSourceHelper* mDragSourceHelper;
com::sun::star::awt::MouseEvent mMouseEvent;
diff --git a/vcl/aqua/source/dtrans/aqua_service.cxx b/vcl/aqua/source/dtrans/aqua_service.cxx
index 571bea2e554f..57ef1f11175c 100644
--- a/vcl/aqua/source/dtrans/aqua_service.cxx
+++ b/vcl/aqua/source/dtrans/aqua_service.cxx
@@ -58,28 +58,6 @@ void SAL_CALL component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-sal_Bool SAL_CALL component_writeInfo( void* pServiceManager, void* pRegistryKey )
-{
- sal_Bool bRetVal = sal_False;
-
- if ( pRegistryKey )
- {
- try
- {
- Reference< XRegistryKey > pXNewKey( static_cast< XRegistryKey* >( pRegistryKey ) );
- pXNewKey->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM( AQUA_CLIPBOARD_REGKEY_NAME ) ) );
- bRetVal = sal_True;
- }
- 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;
diff --git a/vcl/aqua/source/gdi/aquaprintaccessoryview.mm b/vcl/aqua/source/gdi/aquaprintaccessoryview.mm
index d00fc9a6cd0e..d19290d8320a 100644
--- a/vcl/aqua/source/gdi/aquaprintaccessoryview.mm
+++ b/vcl/aqua/source/gdi/aquaprintaccessoryview.mm
@@ -112,7 +112,7 @@ class ControllerProperties
maLocalizedStrings( VclResId( SV_PRINT_NATIVE_STRINGS ) )
{
mpState->bNeedRestart = false;
- DBG_ASSERT( maLocalizedStrings.Count() >= 4, "resources not found !" );
+ DBG_ASSERT( maLocalizedStrings.Count() >= 5, "resources not found !" );
}
rtl::OUString getMoreString()
@@ -122,6 +122,13 @@ class ControllerProperties
: rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "More" ) );
}
+ rtl::OUString getPrintSelectionString()
+ {
+ return maLocalizedStrings.Count() >= 5
+ ? rtl::OUString( maLocalizedStrings.GetString( 4 ) )
+ : rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Print selection only" ) );
+ }
+
void updatePrintJob()
{
// TODO: refresh page count etc from mpController
@@ -246,7 +253,11 @@ class ControllerProperties
PropertyValue* pVal = mpController->getValue( name_it->second );
if( pVal )
{
- pVal->Value <<= i_bValue;
+ // ugly
+ if( name_it->second.equalsAscii( "PrintContent" ) )
+ pVal->Value <<= i_bValue ? sal_Int32(2) : sal_Int32(0);
+ else
+ pVal->Value <<= i_bValue;
updatePrintJob();
}
}
@@ -283,7 +294,7 @@ class ControllerProperties
-1;
std::map< int, rtl::OUString >::const_iterator name_it = maTagToPropertyName.find( nTag );
- if( name_it != maTagToPropertyName.end() )
+ if( name_it != maTagToPropertyName.end() && ! name_it->second.equalsAscii( "PrintContent" ) )
{
MacOSBOOL bEnabled = mpController->isUIOptionEnabled( name_it->second ) ? YES : NO;
if( pCtrl )
@@ -768,6 +779,319 @@ static void linebreakCell( NSCell* pBtn, const rtl::OUString& i_rText )
}
}
+static void addSubgroup( NSView* pCurParent, long& rCurY, const rtl::OUString& rText )
+{
+ NSControl* pTextView = createLabel( rText );
+ [pCurParent addSubview: [pTextView autorelease]];
+ NSRect aTextRect = [pTextView frame];
+ // move to nCurY
+ aTextRect.origin.y = rCurY - aTextRect.size.height;
+ [pTextView setFrame: aTextRect];
+
+ NSRect aSepRect = { { aTextRect.size.width + 1, aTextRect.origin.y }, { 100, 6 } };
+ NSBox* pBox = [[NSBox alloc] initWithFrame: aSepRect];
+ [pBox setBoxType: NSBoxSeparator];
+ [pCurParent addSubview: [pBox autorelease]];
+
+ // update nCurY
+ rCurY = aTextRect.origin.y - 5;
+}
+
+static void addBool( NSView* pCurParent, long& rCurX, long& rCurY, long nAttachOffset,
+ const rtl::OUString& rText, sal_Bool bEnabled,
+ const rtl::OUString& rProperty, sal_Bool bValue,
+ std::vector<ColumnItem >& rRightColumn,
+ ControllerProperties* pControllerProperties,
+ ControlTarget* pCtrlTarget
+ )
+{
+ NSRect aCheckRect = { { rCurX + nAttachOffset, 0 }, { 0, 15 } };
+ NSButton* pBtn = [[NSButton alloc] initWithFrame: aCheckRect];
+ [pBtn setButtonType: NSSwitchButton];
+ [pBtn setState: bValue ? NSOnState : NSOffState];
+ if( ! bEnabled )
+ [pBtn setEnabled: NO];
+ linebreakCell( [pBtn cell], rText );
+ [pBtn sizeToFit];
+ [pCurParent addSubview: [pBtn autorelease]];
+
+ rRightColumn.push_back( ColumnItem( pBtn ) );
+
+ // connect target
+ [pBtn setTarget: pCtrlTarget];
+ [pBtn setAction: @selector(triggered:)];
+ int nTag = pControllerProperties->addNameTag( rProperty );
+ pControllerProperties->addObservedControl( pBtn );
+ [pBtn setTag: nTag];
+
+ aCheckRect = [pBtn frame];
+
+ // move to rCurY
+ aCheckRect.origin.y = rCurY - aCheckRect.size.height;
+ [pBtn setFrame: aCheckRect];
+
+ // update rCurY
+ rCurY = aCheckRect.origin.y - 5;
+}
+
+static void addRadio( NSView* pCurParent, long& rCurX, long& rCurY, long nAttachOffset,
+ const rtl::OUString& rText,
+ const rtl::OUString& rProperty, Sequence< rtl::OUString > rChoices, sal_Int32 nSelectValue,
+ std::vector<ColumnItem >& rLeftColumn,
+ std::vector<ColumnItem >& rRightColumn,
+ ControllerProperties* pControllerProperties,
+ ControlTarget* pCtrlTarget
+ )
+{
+ sal_Int32 nOff = 0;
+ if( rText.getLength() )
+ {
+ // add a label
+ NSControl* pTextView = createLabel( rText );
+ NSRect aTextRect = [pTextView frame];
+ aTextRect.origin.x = rCurX + nAttachOffset;
+ [pCurParent addSubview: [pTextView autorelease]];
+
+ rLeftColumn.push_back( ColumnItem( pTextView ) );
+
+ // move to nCurY
+ aTextRect.origin.y = rCurY - aTextRect.size.height;
+ [pTextView setFrame: aTextRect];
+
+ // update nCurY
+ rCurY = aTextRect.origin.y - 5;
+
+ // indent the radio group relative to the text
+ // nOff = 20;
+ }
+
+ // setup radio matrix
+ NSButtonCell* pProto = [[NSButtonCell alloc] init];
+
+ NSRect aRadioRect = { { rCurX + nOff, 0 }, { 280 - rCurX, 5*rChoices.getLength() } };
+ [pProto setTitle: @"RadioButtonGroup"];
+ [pProto setButtonType: NSRadioButton];
+ NSMatrix* pMatrix = [[NSMatrix alloc] initWithFrame: aRadioRect
+ mode: NSRadioModeMatrix
+ prototype: (NSCell*)pProto
+ numberOfRows: rChoices.getLength()
+ numberOfColumns: 1];
+ // set individual titles
+ NSArray* pCells = [pMatrix cells];
+ for( sal_Int32 m = 0; m < rChoices.getLength(); m++ )
+ {
+ NSCell* pCell = [pCells objectAtIndex: m];
+ filterAccelerator( rChoices[m] );
+ linebreakCell( pCell, rChoices[m] );
+ // connect target and action
+ [pCell setTarget: pCtrlTarget];
+ [pCell setAction: @selector(triggered:)];
+ int nTag = pControllerProperties->addNameAndValueTag( rProperty, m );
+ pControllerProperties->addObservedControl( pCell );
+ [pCell setTag: nTag];
+ // set current selection
+ if( nSelectValue == m )
+ [pMatrix selectCellAtRow: m column: 0];
+ }
+ [pMatrix sizeToFit];
+ aRadioRect = [pMatrix frame];
+
+ // move it down, so it comes to the correct position
+ aRadioRect.origin.y = rCurY - aRadioRect.size.height;
+ [pMatrix setFrame: aRadioRect];
+ [pCurParent addSubview: [pMatrix autorelease]];
+
+ rRightColumn.push_back( ColumnItem( pMatrix ) );
+
+ // update nCurY
+ rCurY = aRadioRect.origin.y - 5;
+
+ [pProto release];
+}
+
+static void addList( NSView* pCurParent, long& rCurX, long& rCurY, long nAttachOffset,
+ const rtl::OUString& rText,
+ const rtl::OUString& rProperty, const Sequence< rtl::OUString > rChoices, sal_Int32 nSelectValue,
+ std::vector<ColumnItem >& rLeftColumn,
+ std::vector<ColumnItem >& rRightColumn,
+ ControllerProperties* pControllerProperties,
+ ControlTarget* pCtrlTarget
+ )
+{
+ // don't indent attached lists, looks bad in the existing cases
+ NSControl* pTextView = createLabel( rText );
+ [pCurParent addSubview: [pTextView autorelease]];
+ rLeftColumn.push_back( ColumnItem( pTextView ) );
+ NSRect aTextRect = [pTextView frame];
+ aTextRect.origin.x = rCurX /* + nAttachOffset*/;
+
+ // don't indent attached lists, looks bad in the existing cases
+ NSRect aBtnRect = { { rCurX /*+ nAttachOffset*/ + aTextRect.size.width, 0 }, { 0, 15 } };
+ NSPopUpButton* pBtn = [[NSPopUpButton alloc] initWithFrame: aBtnRect pullsDown: NO];
+
+ // iterate options
+ for( sal_Int32 m = 0; m < rChoices.getLength(); m++ )
+ {
+ NSString* pItemText = CreateNSString( rChoices[m] );
+ [pBtn addItemWithTitle: pItemText];
+ NSMenuItem* pItem = [pBtn itemWithTitle: pItemText];
+ int nTag = pControllerProperties->addNameAndValueTag( rProperty, m );
+ [pItem setTag: nTag];
+ [pItemText release];
+ }
+
+ [pBtn selectItemAtIndex: nSelectValue];
+
+ // add the button to observed controls for enabled state changes
+ // also add a tag just for this purpose
+ pControllerProperties->addObservedControl( pBtn );
+ [pBtn setTag: pControllerProperties->addNameTag( rProperty )];
+
+ [pBtn sizeToFit];
+ [pCurParent addSubview: [pBtn autorelease]];
+
+ rRightColumn.push_back( ColumnItem( pBtn ) );
+
+ // connect target and action
+ [pBtn setTarget: pCtrlTarget];
+ [pBtn setAction: @selector(triggered:)];
+
+ // move to nCurY
+ aBtnRect = [pBtn frame];
+ aBtnRect.origin.y = rCurY - aBtnRect.size.height;
+ [pBtn setFrame: aBtnRect];
+
+ // align label
+ aTextRect.origin.y = aBtnRect.origin.y + (aBtnRect.size.height - aTextRect.size.height)/2;
+ [pTextView setFrame: aTextRect];
+
+ // update rCurY
+ rCurY = aBtnRect.origin.y - 5;
+}
+
+static void addEdit( NSView* pCurParent, long& rCurX, long& rCurY, long nAttachOffset,
+ const rtl::OUString rCtrlType,
+ const rtl::OUString& rText,
+ const rtl::OUString& rProperty, const PropertyValue* pValue,
+ sal_Int64 nMinValue, sal_Int64 nMaxValue,
+ std::vector<ColumnItem >& rLeftColumn,
+ std::vector<ColumnItem >& rRightColumn,
+ ControllerProperties* pControllerProperties,
+ ControlTarget* pCtrlTarget
+ )
+{
+ sal_Int32 nOff = 0;
+ if( rText.getLength() )
+ {
+ // add a label
+ NSControl* pTextView = createLabel( rText );
+ [pCurParent addSubview: [pTextView autorelease]];
+
+ rLeftColumn.push_back( ColumnItem( pTextView ) );
+
+ // move to nCurY
+ NSRect aTextRect = [pTextView frame];
+ aTextRect.origin.x = rCurX + nAttachOffset;
+ aTextRect.origin.y = rCurY - aTextRect.size.height;
+ [pTextView setFrame: aTextRect];
+
+ // update nCurY
+ rCurY = aTextRect.origin.y - 5;
+
+ // and set the offset for the real edit field
+ nOff = aTextRect.size.width + 5;
+ }
+
+ NSRect aFieldRect = { { rCurX + nOff + nAttachOffset, 0 }, { 100, 25 } };
+ NSTextField* pFieldView = [[NSTextField alloc] initWithFrame: aFieldRect];
+ [pFieldView setEditable: YES];
+ [pFieldView setSelectable: YES];
+ [pFieldView setDrawsBackground: YES];
+ [pFieldView sizeToFit]; // FIXME: this does nothing
+ [pCurParent addSubview: [pFieldView autorelease]];
+
+ rRightColumn.push_back( ColumnItem( pFieldView ) );
+
+ // add the field to observed controls for enabled state changes
+ // also add a tag just for this purpose
+ pControllerProperties->addObservedControl( pFieldView );
+ int nTag = pControllerProperties->addNameTag( rProperty );
+ [pFieldView setTag: nTag];
+ // pControllerProperties->addNamedView( pFieldView, aPropertyName );
+
+ // move to nCurY
+ aFieldRect.origin.y = rCurY - aFieldRect.size.height;
+ [pFieldView setFrame: aFieldRect];
+
+ if( rCtrlType.equalsAscii( "Range" ) )
+ {
+ // add a stepper control
+ NSRect aStepFrame = { { aFieldRect.origin.x + aFieldRect.size.width + 5,
+ aFieldRect.origin.y },
+ { 15, aFieldRect.size.height } };
+ NSStepper* pStep = [[NSStepper alloc] initWithFrame: aStepFrame];
+ [pStep setIncrement: 1];
+ [pStep setValueWraps: NO];
+ [pStep setTag: nTag];
+ [pCurParent addSubview: [pStep autorelease]];
+
+ rRightColumn.back().pSubControl = pStep;
+
+ pControllerProperties->addObservedControl( pStep );
+ [pStep setTarget: pCtrlTarget];
+ [pStep setAction: @selector(triggered:)];
+
+ // constrain the text field to decimal numbers
+ NSNumberFormatter* pFormatter = [[NSNumberFormatter alloc] init];
+ [pFormatter setFormatterBehavior: NSNumberFormatterBehavior10_4];
+ [pFormatter setNumberStyle: NSNumberFormatterDecimalStyle];
+ [pFormatter setAllowsFloats: NO];
+ [pFormatter setMaximumFractionDigits: 0];
+ if( nMinValue != nMaxValue )
+ {
+ [pFormatter setMinimum: [[NSNumber numberWithInt: nMinValue] autorelease]];
+ [pStep setMinValue: nMinValue];
+ [pFormatter setMaximum: [[NSNumber numberWithInt: nMaxValue] autorelease]];
+ [pStep setMaxValue: nMaxValue];
+ }
+ [pFieldView setFormatter: pFormatter];
+
+ sal_Int64 nSelectVal = 0;
+ if( pValue && pValue->Value.hasValue() )
+ pValue->Value >>= nSelectVal;
+
+ [pFieldView setIntValue: nSelectVal];
+ [pStep setIntValue: nSelectVal];
+
+ pControllerProperties->addViewPair( pFieldView, pStep );
+ // connect target and action
+ [pFieldView setTarget: pCtrlTarget];
+ [pFieldView setAction: @selector(triggeredNumeric:)];
+ [pStep setTarget: pCtrlTarget];
+ [pStep setAction: @selector(triggeredNumeric:)];
+ }
+ else
+ {
+ // connect target and action
+ [pFieldView setTarget: pCtrlTarget];
+ [pFieldView setAction: @selector(triggered:)];
+
+ if( pValue && pValue->Value.hasValue() )
+ {
+ rtl::OUString aValue;
+ pValue->Value >>= aValue;
+ if( aValue.getLength() )
+ {
+ NSString* pText = CreateNSString( aValue );
+ [pFieldView setStringValue: pText];
+ [pText release];
+ }
+ }
+ }
+
+ // update nCurY
+ rCurY = aFieldRect.origin.y - 5;
+}
@implementation AquaPrintAccessoryView
+(NSObject*)setupPrinterPanel: (NSPrintOperation*)pOp withController: (vcl::PrinterController*)pController withState: (PrintAccessoryViewState*)pState;
@@ -792,6 +1116,54 @@ static void linebreakCell( NSCell* pBtn, const rtl::OUString& i_rText )
ControlTarget* pCtrlTarget = [[ControlTarget alloc] initWithControllerMap: pControllerProperties];
std::vector< ColumnItem > aLeftColumn, aRightColumn;
+
+ // ugly:
+ // prepend a "selection" checkbox if the properties have such a selection in PrintContent
+ bool bAddSelectionCheckBox = false, bSelectionBoxEnabled = false, bSelectionBoxChecked = false;
+ for( int i = 0; i < rOptions.getLength(); i++ )
+ {
+ Sequence< beans::PropertyValue > aOptProp;
+ rOptions[i].Value >>= aOptProp;
+
+ rtl::OUString aCtrlType;
+ rtl::OUString aPropertyName;
+ Sequence< rtl::OUString > aChoices;
+ Sequence< sal_Bool > aChoicesDisabled;
+ sal_Int32 aSelectionChecked = 0;
+ for( int n = 0; n < aOptProp.getLength(); n++ )
+ {
+ const beans::PropertyValue& rEntry( aOptProp[ n ] );
+ if( rEntry.Name.equalsAscii( "ControlType" ) )
+ {
+ rEntry.Value >>= aCtrlType;
+ }
+ else if( rEntry.Name.equalsAscii( "Choices" ) )
+ {
+ rEntry.Value >>= aChoices;
+ }
+ else if( rEntry.Name.equalsAscii( "ChoicesDisabled" ) )
+ {
+ rEntry.Value >>= aChoicesDisabled;
+ }
+ else if( rEntry.Name.equalsAscii( "Property" ) )
+ {
+ PropertyValue aVal;
+ rEntry.Value >>= aVal;
+ aPropertyName = aVal.Name;
+ if( aPropertyName.equalsAscii( "PrintContent" ) )
+ aVal.Value >>= aSelectionChecked;
+ }
+ }
+ if( aCtrlType.equalsAscii( "Radio" ) &&
+ aPropertyName.equalsAscii( "PrintContent" ) &&
+ aChoices.getLength() > 2 )
+ {
+ bAddSelectionCheckBox = true;
+ bSelectionBoxEnabled = aChoicesDisabled.getLength() < 2 || ! aChoicesDisabled[2];
+ bSelectionBoxChecked = (aSelectionChecked==2);
+ break;
+ }
+ }
for( int i = 0; i < rOptions.getLength(); i++ )
{
@@ -803,6 +1175,7 @@ static void linebreakCell( NSCell* pBtn, const rtl::OUString& i_rText )
rtl::OUString aCtrlType;
rtl::OUString aText;
rtl::OUString aPropertyName;
+ rtl::OUString aGroupHint;
Sequence< rtl::OUString > aChoices;
sal_Int64 nMinValue = 0, nMaxValue = 0;
long nAttachOffset = 0;
@@ -852,6 +1225,10 @@ static void linebreakCell( NSCell* pBtn, const rtl::OUString& i_rText )
{
rEntry.Value >>= bIgnore;
}
+ else if( rEntry.Name.equalsAscii( "GroupingHint" ) )
+ {
+ rEntry.Value >>= aGroupHint;
+ }
}
if( aCtrlType.equalsAscii( "Group" ) ||
@@ -894,6 +1271,15 @@ static void linebreakCell( NSCell* pBtn, const rtl::OUString& i_rText )
// clear columns
aLeftColumn.clear();
aRightColumn.clear();
+
+ if( bAddSelectionCheckBox )
+ {
+ addBool( pCurParent, nCurX, nCurY, 0,
+ pControllerProperties->getPrintSelectionString(), bSelectionBoxEnabled,
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintContent" ) ), bSelectionBoxChecked,
+ aRightColumn, pControllerProperties, pCtrlTarget );
+ bAddSelectionCheckBox = false;
+ }
}
if( aCtrlType.equalsAscii( "Subgroup" ) && pCurParent )
@@ -902,302 +1288,56 @@ static void linebreakCell( NSCell* pBtn, const rtl::OUString& i_rText )
if( bIgnore )
continue;
- NSControl* pTextView = createLabel( aText );
- [pCurParent addSubview: [pTextView autorelease]];
- NSRect aTextRect = [pTextView frame];
- // move to nCurY
- aTextRect.origin.y = nCurY - aTextRect.size.height;
- [pTextView setFrame: aTextRect];
-
- NSRect aSepRect = { { aTextRect.size.width + 1, aTextRect.origin.y }, { 100, 6 } };
- NSBox* pBox = [[NSBox alloc] initWithFrame: aSepRect];
- [pBox setBoxType: NSBoxSeparator];
- [pCurParent addSubview: [pBox autorelease]];
-
- // update nCurY
- nCurY = aTextRect.origin.y - 5;
+ addSubgroup( pCurParent, nCurY, aText );
}
else if( bIgnoreSubgroup || bIgnore )
+ {
continue;
+ }
else if( aCtrlType.equalsAscii( "Bool" ) && pCurParent )
{
- NSRect aCheckRect = { { nCurX + nAttachOffset, 0 }, { 0, 15 } };
- NSButton* pBtn = [[NSButton alloc] initWithFrame: aCheckRect];
- [pBtn setButtonType: NSSwitchButton];
sal_Bool bVal = sal_False;
PropertyValue* pVal = pController->getValue( aPropertyName );
if( pVal )
pVal->Value >>= bVal;
- [pBtn setState: bVal ? NSOnState : NSOffState];
- linebreakCell( [pBtn cell], aText );
- [pBtn sizeToFit];
- [pCurParent addSubview: [pBtn autorelease]];
-
- aRightColumn.push_back( ColumnItem( pBtn ) );
-
- // connect target
- [pBtn setTarget: pCtrlTarget];
- [pBtn setAction: @selector(triggered:)];
- int nTag = pControllerProperties->addNameTag( aPropertyName );
- pControllerProperties->addObservedControl( pBtn );
- [pBtn setTag: nTag];
-
- aCheckRect = [pBtn frame];
-
- // move to nCurY
- aCheckRect.origin.y = nCurY - aCheckRect.size.height;
- [pBtn setFrame: aCheckRect];
-
- // update nCurY
- nCurY = aCheckRect.origin.y - 5;
+ addBool( pCurParent, nCurX, nCurY, nAttachOffset,
+ aText, true, aPropertyName, bVal,
+ aRightColumn, pControllerProperties, pCtrlTarget );
}
else if( aCtrlType.equalsAscii( "Radio" ) && pCurParent )
{
- sal_Int32 nOff = 0;
- if( aText.getLength() )
- {
- // add a label
- NSControl* pTextView = createLabel( aText );
- NSRect aTextRect = [pTextView frame];
- aTextRect.origin.x = nCurX + nAttachOffset;
- [pCurParent addSubview: [pTextView autorelease]];
-
- aLeftColumn.push_back( ColumnItem( pTextView ) );
-
- // move to nCurY
- aTextRect.origin.y = nCurY - aTextRect.size.height;
- [pTextView setFrame: aTextRect];
-
- // update nCurY
- nCurY = aTextRect.origin.y - 5;
-
- // indent the radio group relative to the text
- // nOff = 20;
- }
-
- // setup radio matrix
- NSButtonCell* pProto = [[NSButtonCell alloc] init];
-
- NSRect aRadioRect = { { nCurX + nOff, 0 }, { 280 - nCurX, 5*aChoices.getLength() } };
- [pProto setTitle: @"RadioButtonGroup"];
- [pProto setButtonType: NSRadioButton];
- NSMatrix* pMatrix = [[NSMatrix alloc] initWithFrame: aRadioRect
- mode: NSRadioModeMatrix
- prototype: (NSCell*)pProto
- numberOfRows: aChoices.getLength()
- numberOfColumns: 1];
// get currently selected value
sal_Int32 nSelectVal = 0;
PropertyValue* pVal = pController->getValue( aPropertyName );
if( pVal && pVal->Value.hasValue() )
pVal->Value >>= nSelectVal;
- // set individual titles
- NSArray* pCells = [pMatrix cells];
- for( sal_Int32 m = 0; m < aChoices.getLength(); m++ )
- {
- NSCell* pCell = [pCells objectAtIndex: m];
- filterAccelerator( aChoices[m] );
- linebreakCell( pCell, aChoices[m] );
- //NSString* pTitle = CreateNSString( aChoices[m] );
- //[pCell setTitle: pTitle];
- // connect target and action
- [pCell setTarget: pCtrlTarget];
- [pCell setAction: @selector(triggered:)];
- int nTag = pControllerProperties->addNameAndValueTag( aPropertyName, m );
- pControllerProperties->addObservedControl( pCell );
- [pCell setTag: nTag];
- //[pTitle release];
- // set current selection
- if( nSelectVal == m )
- [pMatrix selectCellAtRow: m column: 0];
- }
- [pMatrix sizeToFit];
- aRadioRect = [pMatrix frame];
- // move it down, so it comes to the correct position
- aRadioRect.origin.y = nCurY - aRadioRect.size.height;
- [pMatrix setFrame: aRadioRect];
- [pCurParent addSubview: [pMatrix autorelease]];
-
- aRightColumn.push_back( ColumnItem( pMatrix ) );
-
- // update nCurY
- nCurY = aRadioRect.origin.y - 5;
-
- [pProto release];
+ addRadio( pCurParent, nCurX, nCurY, nAttachOffset,
+ aText, aPropertyName, aChoices, nSelectVal,
+ aLeftColumn, aRightColumn,
+ pControllerProperties, pCtrlTarget );
}
else if( aCtrlType.equalsAscii( "List" ) && pCurParent )
{
- // don't indent attached lists, looks bad in the existing cases
- NSControl* pTextView = createLabel( aText );
- [pCurParent addSubview: [pTextView autorelease]];
- aLeftColumn.push_back( ColumnItem( pTextView ) );
- NSRect aTextRect = [pTextView frame];
- aTextRect.origin.x = nCurX /* + nAttachOffset*/;
-
- // don't indent attached lists, looks bad in the existing cases
- NSRect aBtnRect = { { nCurX /*+ nAttachOffset*/ + aTextRect.size.width, 0 }, { 0, 15 } };
- NSPopUpButton* pBtn = [[NSPopUpButton alloc] initWithFrame: aBtnRect pullsDown: NO];
-
- // iterate options
- for( sal_Int32 m = 0; m < aChoices.getLength(); m++ )
- {
- NSString* pItemText = CreateNSString( aChoices[m] );
- [pBtn addItemWithTitle: pItemText];
- NSMenuItem* pItem = [pBtn itemWithTitle: pItemText];
- int nTag = pControllerProperties->addNameAndValueTag( aPropertyName, m );
- [pItem setTag: nTag];
- [pItemText release];
- }
-
PropertyValue* pVal = pController->getValue( aPropertyName );
sal_Int32 aSelectVal = 0;
if( pVal && pVal->Value.hasValue() )
pVal->Value >>= aSelectVal;
- [pBtn selectItemAtIndex: aSelectVal];
-
- // add the button to observed controls for enabled state changes
- // also add a tag just for this purpose
- pControllerProperties->addObservedControl( pBtn );
- [pBtn setTag: pControllerProperties->addNameTag( aPropertyName )];
-
- [pBtn sizeToFit];
- [pCurParent addSubview: [pBtn autorelease]];
-
- aRightColumn.push_back( ColumnItem( pBtn ) );
-
- // connect target and action
- [pBtn setTarget: pCtrlTarget];
- [pBtn setAction: @selector(triggered:)];
-
- // move to nCurY
- aBtnRect = [pBtn frame];
- aBtnRect.origin.y = nCurY - aBtnRect.size.height;
- [pBtn setFrame: aBtnRect];
-
- // align label
- aTextRect.origin.y = aBtnRect.origin.y + (aBtnRect.size.height - aTextRect.size.height)/2;
- [pTextView setFrame: aTextRect];
- // update nCurY
- nCurY = aBtnRect.origin.y - 5;
+ addList( pCurParent, nCurX, nCurY, nAttachOffset,
+ aText, aPropertyName, aChoices, aSelectVal,
+ aLeftColumn, aRightColumn,
+ pControllerProperties, pCtrlTarget );
}
else if( (aCtrlType.equalsAscii( "Edit" ) || aCtrlType.equalsAscii( "Range" )) && pCurParent )
{
- sal_Int32 nOff = 0;
- if( aText.getLength() )
- {
- // add a label
- NSControl* pTextView = createLabel( aText );
- [pCurParent addSubview: [pTextView autorelease]];
-
- aLeftColumn.push_back( ColumnItem( pTextView ) );
-
- // move to nCurY
- NSRect aTextRect = [pTextView frame];
- aTextRect.origin.x = nCurX + nAttachOffset;
- aTextRect.origin.y = nCurY - aTextRect.size.height;
- [pTextView setFrame: aTextRect];
-
- // update nCurY
- nCurY = aTextRect.origin.y - 5;
-
- // and set the offset for the real edit field
- nOff = aTextRect.size.width + 5;
- }
-
- NSRect aFieldRect = { { nCurX + nOff + nAttachOffset, 0 }, { 100, 25 } };
- NSTextField* pFieldView = [[NSTextField alloc] initWithFrame: aFieldRect];
- [pFieldView setEditable: YES];
- [pFieldView setSelectable: YES];
- [pFieldView setDrawsBackground: YES];
- [pFieldView sizeToFit]; // FIXME: this does nothing
- [pCurParent addSubview: [pFieldView autorelease]];
-
- aRightColumn.push_back( ColumnItem( pFieldView ) );
-
- // add the field to observed controls for enabled state changes
- // also add a tag just for this purpose
- pControllerProperties->addObservedControl( pFieldView );
- int nTag = pControllerProperties->addNameTag( aPropertyName );
- [pFieldView setTag: nTag];
- // pControllerProperties->addNamedView( pFieldView, aPropertyName );
-
- // move to nCurY
- aFieldRect.origin.y = nCurY - aFieldRect.size.height;
- [pFieldView setFrame: aFieldRect];
-
// current value
PropertyValue* pVal = pController->getValue( aPropertyName );
- if( aCtrlType.equalsAscii( "Range" ) )
- {
- // add a stepper control
- NSRect aStepFrame = { { aFieldRect.origin.x + aFieldRect.size.width + 5,
- aFieldRect.origin.y },
- { 15, aFieldRect.size.height } };
- NSStepper* pStep = [[NSStepper alloc] initWithFrame: aStepFrame];
- [pStep setIncrement: 1];
- [pStep setValueWraps: NO];
- [pStep setTag: nTag];
- [pCurParent addSubview: [pStep autorelease]];
-
- aRightColumn.back().pSubControl = pStep;
-
- pControllerProperties->addObservedControl( pStep );
- [pStep setTarget: pCtrlTarget];
- [pStep setAction: @selector(triggered:)];
-
- // constrain the text field to decimal numbers
- NSNumberFormatter* pFormatter = [[NSNumberFormatter alloc] init];
- [pFormatter setFormatterBehavior: NSNumberFormatterBehavior10_4];
- [pFormatter setNumberStyle: NSNumberFormatterDecimalStyle];
- [pFormatter setAllowsFloats: NO];
- [pFormatter setMaximumFractionDigits: 0];
- if( nMinValue != nMaxValue )
- {
- [pFormatter setMinimum: [[NSNumber numberWithInt: nMinValue] autorelease]];
- [pStep setMinValue: nMinValue];
- [pFormatter setMaximum: [[NSNumber numberWithInt: nMaxValue] autorelease]];
- [pStep setMaxValue: nMaxValue];
- }
- [pFieldView setFormatter: pFormatter];
-
- sal_Int64 nSelectVal = 0;
- if( pVal && pVal->Value.hasValue() )
- pVal->Value >>= nSelectVal;
-
- [pFieldView setIntValue: nSelectVal];
- [pStep setIntValue: nSelectVal];
-
- pControllerProperties->addViewPair( pFieldView, pStep );
- // connect target and action
- [pFieldView setTarget: pCtrlTarget];
- [pFieldView setAction: @selector(triggeredNumeric:)];
- [pStep setTarget: pCtrlTarget];
- [pStep setAction: @selector(triggeredNumeric:)];
- }
- else
- {
- // connect target and action
- [pFieldView setTarget: pCtrlTarget];
- [pFieldView setAction: @selector(triggered:)];
-
- if( pVal && pVal->Value.hasValue() )
- {
- rtl::OUString aValue;
- pVal->Value >>= aValue;
- if( aValue.getLength() )
- {
- NSString* pText = CreateNSString( aValue );
- [pFieldView setStringValue: pText];
- [pText release];
- }
- }
- }
-
- // update nCurY
- nCurY = aFieldRect.origin.y - 5;
-
+ addEdit( pCurParent, nCurX, nCurY, nAttachOffset,
+ aCtrlType, aText, aPropertyName, pVal,
+ nMinValue, nMaxValue,
+ aLeftColumn, aRightColumn,
+ pControllerProperties, pCtrlTarget );
}
}
else
@@ -1205,7 +1345,7 @@ static void linebreakCell( NSCell* pBtn, const rtl::OUString& i_rText )
DBG_ERROR( "Unsupported UI option" );
}
}
-
+
pControllerProperties->updateEnableState();
adjustViewAndChildren( pCurParent, aMaxTabSize, aLeftColumn, aRightColumn );
diff --git a/vcl/aqua/source/gdi/salgdi.cxx b/vcl/aqua/source/gdi/salgdi.cxx
index ca3fcc04769a..e1daf649f6da 100644
--- a/vcl/aqua/source/gdi/salgdi.cxx
+++ b/vcl/aqua/source/gdi/salgdi.cxx
@@ -116,17 +116,15 @@ inline FourCharCode GetTag(const char aTagName[5])
static unsigned GetUShort( const unsigned char* p ){return((p[0]<<8)+p[1]);}
static unsigned GetUInt( const unsigned char* p ) { return((p[0]<<24)+(p[1]<<16)+(p[2]<<8)+p[3]);}
-ImplFontCharMap* ImplMacFontData::GetImplFontCharMap() const
+const ImplFontCharMap* ImplMacFontData::GetImplFontCharMap() const
{
+ // return the cached charmap
if( mpCharMap )
- {
- // return the cached charmap
- mpCharMap->AddReference();
return mpCharMap;
- }
// set the default charmap
mpCharMap = ImplFontCharMap::GetDefaultMap();
+ mpCharMap->AddReference();
// get the CMAP byte size
ATSFontRef rFont = FMGetATSFontRefFromFont( mnFontId );
@@ -149,10 +147,14 @@ ImplFontCharMap* ImplMacFontData::GetImplFontCharMap() const
// parse the CMAP
CmapResult aCmapResult;
- if( !ParseCMAP( &aBuffer[0], nRawLength, aCmapResult ) )
- return mpCharMap;
+ if( ParseCMAP( &aBuffer[0], nRawLength, aCmapResult ) )
+ {
+ // create the matching charmap
+ mpCharMap->DeReference();
+ mpCharMap = new ImplFontCharMap( aCmapResult );
+ mpCharMap->AddReference();
+ }
- mpCharMap = new ImplFontCharMap( aCmapResult );
return mpCharMap;
}
@@ -1555,8 +1557,10 @@ void AquaSalGraphics::SetTextColor( SalColor nSalColor )
// -----------------------------------------------------------------------
-void AquaSalGraphics::GetFontMetric( ImplFontMetricData* pMetric )
+void AquaSalGraphics::GetFontMetric( ImplFontMetricData* pMetric, int nFallbackLevel )
{
+ (void)nFallbackLevel; // glyph-fallback on ATSU is done differently -> no fallback level
+
// get the ATSU font metrics (in point units)
// of the font that has eventually been size-limited
@@ -1990,7 +1994,7 @@ USHORT AquaSalGraphics::SetFont( ImplFontSelectData* pReqFont, int nFallbackLeve
// -----------------------------------------------------------------------
-ImplFontCharMap* AquaSalGraphics::GetImplFontCharMap() const
+const ImplFontCharMap* AquaSalGraphics::GetImplFontCharMap() const
{
if( !mpMacFontData )
return ImplFontCharMap::GetDefaultMap();
@@ -2365,6 +2369,8 @@ void AquaSalGraphics::GetGlyphWidths( const ImplFontData* pFontData, bool bVerti
if( nGlyph > 0 )
rUnicodeEnc[ nUcsChar ] = nGlyph;
}
+
+ pMap->DeReference(); // TODO: add and use RAII object instead
}
::CloseTTFont( pSftFont );
diff --git a/vcl/aqua/source/gdi/salprn.cxx b/vcl/aqua/source/gdi/salprn.cxx
index ff4edcbf83f9..c79add81d791 100644
--- a/vcl/aqua/source/gdi/salprn.cxx
+++ b/vcl/aqua/source/gdi/salprn.cxx
@@ -460,6 +460,8 @@ ULONG AquaSalInfoPrinter::GetCapabilities( const ImplJobSetup* i_pSetupData, USH
return getUseNativeDialog() ? 1 : 0;
case PRINTER_CAPABILITIES_PDF:
return 1;
+ case PRINTER_CAPABILITIES_USEPULLMODEL:
+ return 1;
default: break;
};
return 0;
diff --git a/vcl/aqua/source/window/salframe.cxx b/vcl/aqua/source/window/salframe.cxx
index b14354e1b4bd..4530778c5775 100644
--- a/vcl/aqua/source/window/salframe.cxx
+++ b/vcl/aqua/source/window/salframe.cxx
@@ -207,8 +207,6 @@ void AquaSalFrame::initWindowAndView()
UpdateFrameGeometry();
- // setContentView causes a display; in multithreaded use this can deadlock
- //YieldMutexReleaser aRel;
[mpWindow setContentView: mpView];
}
@@ -293,6 +291,9 @@ BOOL AquaSalFrame::PostEvent( void *pData )
// -----------------------------------------------------------------------
void AquaSalFrame::SetTitle(const XubString& rTitle)
{
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
NSString* pTitle = CreateNSString( rTitle );
[mpWindow setTitle: pTitle];
@@ -331,6 +332,9 @@ void AquaSalFrame::SetIcon( USHORT )
void AquaSalFrame::SetRepresentedURL( const rtl::OUString& i_rDocURL )
{
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
if( i_rDocURL.indexOfAsciiL( "file:", 5 ) == 0 )
{
rtl::OUString aSysPath;
@@ -356,12 +360,12 @@ void AquaSalFrame::initShow()
if( mpParent ) // center relative to parent
{
// center on parent
- long nNewX = mpParent->maGeometry.nX + (mpParent->maGeometry.nWidth - maGeometry.nWidth)/2;
+ long nNewX = mpParent->maGeometry.nX + ((long)mpParent->maGeometry.nWidth - (long)maGeometry.nWidth)/2;
if( nNewX < aScreenRect.Left() )
nNewX = aScreenRect.Left();
if( long(nNewX + maGeometry.nWidth) > aScreenRect.Right() )
nNewX = aScreenRect.Right() - maGeometry.nWidth-1;
- long nNewY = mpParent->maGeometry.nY + (mpParent->maGeometry.nHeight - maGeometry.nHeight)/2;
+ long nNewY = mpParent->maGeometry.nY + ((long)mpParent->maGeometry.nHeight - (long)maGeometry.nHeight)/2;
if( nNewY < aScreenRect.Top() )
nNewY = aScreenRect.Top();
if( nNewY > aScreenRect.Bottom() )
@@ -401,6 +405,9 @@ void AquaSalFrame::SendPaintEvent( const Rectangle* pRect )
void AquaSalFrame::Show(BOOL bVisible, BOOL bNoActivate)
{
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
mbShown = bVisible;
if(bVisible)
{
@@ -411,8 +418,6 @@ void AquaSalFrame::Show(BOOL bVisible, BOOL bNoActivate)
// trigger filling our backbuffer
SendPaintEvent();
- //YieldMutexReleaser aRel;
-
if( bNoActivate || [mpWindow canBecomeKeyWindow] == NO )
[mpWindow orderFront: NSApp];
else
@@ -443,8 +448,6 @@ void AquaSalFrame::Show(BOOL bVisible, BOOL bNoActivate)
if( mpMenu && mpMenu->mbMenuBar && AquaSalMenu::pCurrentMenuBar == mpMenu )
AquaSalMenu::setDefaultMenu();
- //YieldMutexReleaser aRel;
-
// #i90440# #i94443# work around the focus going back to some other window
// if a child gets hidden for a parent window
if( mpParent && mpParent->mbShown && [mpWindow isKeyWindow] )
@@ -468,6 +471,9 @@ void AquaSalFrame::Enable( BOOL bEnable )
void AquaSalFrame::SetMinClientSize( long nWidth, long nHeight )
{
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
mnMinWidth = nWidth;
mnMinHeight = nHeight;
@@ -490,6 +496,9 @@ void AquaSalFrame::SetMinClientSize( long nWidth, long nHeight )
void AquaSalFrame::SetMaxClientSize( long nWidth, long nHeight )
{
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
mnMaxWidth = nWidth;
mnMaxHeight = nHeight;
@@ -516,6 +525,9 @@ void AquaSalFrame::SetMaxClientSize( long nWidth, long nHeight )
void AquaSalFrame::SetClientSize( long nWidth, long nHeight )
{
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
if( mpWindow )
{
NSSize aSize = { nWidth, nHeight };
@@ -548,6 +560,9 @@ void AquaSalFrame::GetClientSize( long& rWidth, long& rHeight )
void AquaSalFrame::SetWindowState( const SalFrameState* pState )
{
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
// set normal state
NSRect aStateRect = [mpWindow frame];
aStateRect = [NSWindow contentRectForFrameRect: aStateRect styleMask: mnStyleMask];
@@ -563,13 +578,27 @@ void AquaSalFrame::SetWindowState( const SalFrameState* pState )
VCLToCocoa( aStateRect );
aStateRect = [NSWindow frameRectForContentRect: aStateRect styleMask: mnStyleMask];
- // relase and acquire mutex again since this call can block waiting for an internal lock
+ [mpWindow setFrame: aStateRect display: NO];
+ if( pState->mnState == SAL_FRAMESTATE_MINIMIZED )
+ [mpWindow miniaturize: NSApp];
+ else if( [mpWindow isMiniaturized] )
+ [mpWindow deminiaturize: NSApp];
+
+
+ /* ZOOMED is not really maximized (actually it toggles between a user set size and
+ the program specified one), but comes closest since the default behavior is
+ "maximized" if the user did not intervene
+ */
+ if( pState->mnState == SAL_FRAMESTATE_MAXIMIZED )
{
- //YieldMutexReleaser aRel;
- [mpWindow setFrame: aStateRect display: NO];
+ if(! [mpWindow isZoomed])
+ [mpWindow zoom: NSApp];
+ }
+ else
+ {
+ if( [mpWindow isZoomed] )
+ [mpWindow zoom: NSApp];
}
-
- // FIXME: HTH maximized state ?
// get new geometry
UpdateFrameGeometry();
@@ -596,8 +625,6 @@ void AquaSalFrame::SetWindowState( const SalFrameState* pState )
SendPaintEvent();
// tell the system the views need to be updated
- //YieldMutexReleaser aRel;
-
[mpWindow display];
}
}
@@ -606,6 +633,9 @@ void AquaSalFrame::SetWindowState( const SalFrameState* pState )
BOOL AquaSalFrame::GetWindowState( SalFrameState* pState )
{
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
pState->mnMask = SAL_FRAMESTATE_MASK_X |
SAL_FRAMESTATE_MASK_Y |
SAL_FRAMESTATE_MASK_WIDTH |
@@ -626,8 +656,6 @@ BOOL AquaSalFrame::GetWindowState( SalFrameState* pState )
pState->mnWidth = long(aStateRect.size.width);
pState->mnHeight = long(aStateRect.size.height);
- // FIXME: HTH maximized state ?
-
if( [mpWindow isMiniaturized] )
pState->mnState = SAL_FRAMESTATE_MINIMIZED;
else if( ! [mpWindow isZoomed] )
@@ -642,6 +670,9 @@ BOOL AquaSalFrame::GetWindowState( SalFrameState* pState )
void AquaSalFrame::SetScreenNumber(unsigned int nScreen)
{
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
NSArray* pScreens = [NSScreen screens];
Rectangle aRet;
NSScreen* pScreen = nil;
@@ -673,6 +704,9 @@ void AquaSalFrame::SetScreenNumber(unsigned int nScreen)
void AquaSalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nDisplay )
{
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
if( mbFullScreen == bFullScreen )
return;
@@ -731,7 +765,6 @@ void AquaSalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nDisplay )
maFullScreenRect = [mpWindow frame];
{
- //YieldMutexReleaser aRel;
[mpWindow setFrame: [NSWindow frameRectForContentRect: aNewContentRect styleMask: mnStyleMask] display: mbShown ? YES : NO];
}
@@ -743,7 +776,6 @@ void AquaSalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nDisplay )
else
{
{
- //YieldMutexReleaser aRel;
[mpWindow setFrame: maFullScreenRect display: mbShown ? YES : NO];
}
UpdateFrameGeometry();
@@ -782,6 +814,9 @@ public:
void AquaSalFrame::StartPresentation( BOOL bStart )
{
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
if( bStart )
{
mpActivityTimer.reset( new PreventSleepTimer() );
@@ -806,6 +841,12 @@ void AquaSalFrame::SetAlwaysOnTop( BOOL bOnTop )
void AquaSalFrame::ToTop(USHORT nFlags)
{
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
if( ! (nFlags & SAL_FRAME_TOTOP_RESTOREWHENMIN) )
{
if( ! [mpWindow isVisible] || [mpWindow isMiniaturized] )
@@ -859,6 +900,9 @@ NSCursor* AquaSalFrame::getCurrentCursor() const
void AquaSalFrame::SetPointer( PointerStyle ePointerStyle )
{
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
if( ePointerStyle >= POINTER_COUNT || ePointerStyle == mePointerStyle )
return;
mePointerStyle = ePointerStyle;
@@ -885,6 +929,10 @@ void AquaSalFrame::Flush( void )
if( !(mbGraphics && mpGraphics && mpView && mbShown) )
return;
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
+
[mpView setNeedsDisplay: YES];
// outside of the application's event loop (e.g. IntroWindow)
@@ -903,6 +951,9 @@ void AquaSalFrame::Flush( const Rectangle& rRect )
if( !(mbGraphics && mpGraphics && mpView && mbShown) )
return;
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
NSRect aNSRect = { {rRect.Left(), rRect.Top()}, { rRect.GetWidth(), rRect.GetHeight() } };
VCLToCocoa( aNSRect, false );
[mpView setNeedsDisplayInRect: aNSRect];
@@ -922,7 +973,8 @@ void AquaSalFrame::Sync()
{
if( mbGraphics && mpGraphics && mpView && mbShown )
{
- //YieldMutexReleaser aRel;
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
[mpView setNeedsDisplay: YES];
[mpView display];
@@ -1146,6 +1198,9 @@ void AquaSalFrame::getResolution( long& o_rDPIX, long& o_rDPIY )
// doesn't make the anything cleaner for now
void AquaSalFrame::UpdateSettings( AllSettings& rSettings )
{
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
[mpView lockFocus];
StyleSettings aStyleSettings = rSettings.GetStyleSettings();
@@ -1257,6 +1312,9 @@ void AquaSalFrame::Beep( SoundType eSoundType )
void AquaSalFrame::SetPosSize(long nX, long nY, long nWidth, long nHeight, USHORT nFlags)
{
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
USHORT nEvent = 0;
if( [mpWindow isMiniaturized] )
@@ -1321,7 +1379,6 @@ void AquaSalFrame::SetPosSize(long nX, long nY, long nWidth, long nHeight, USHOR
// do not display yet, we need to update our backbuffer
{
- //YieldMutexReleaser aRel;
[mpWindow setFrame: [NSWindow frameRectForContentRect: aContentRect styleMask: mnStyleMask] display: NO];
}
@@ -1336,13 +1393,15 @@ void AquaSalFrame::SetPosSize(long nX, long nY, long nWidth, long nHeight, USHOR
SendPaintEvent();
// now inform the system that the views need to be drawn
- //YieldMutexReleaser aRel;
[mpWindow display];
}
}
void AquaSalFrame::GetWorkArea( Rectangle& rRect )
{
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
NSScreen* pScreen = [mpWindow screen];
if( pScreen == nil )
pScreen = [NSScreen mainScreen];
@@ -1356,6 +1415,9 @@ void AquaSalFrame::GetWorkArea( Rectangle& rRect )
SalPointerState AquaSalFrame::GetPointerState()
{
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
SalPointerState state;
state.mnState = 0;
@@ -1463,6 +1525,9 @@ void AquaSalFrame::DrawMenuBar()
void AquaSalFrame::SetMenu( SalMenu* pSalMenu )
{
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
AquaSalMenu* pMenu = static_cast<AquaSalMenu*>(pSalMenu);
DBG_ASSERT( ! pMenu || pMenu->mbMenuBar, "setting non menubar on frame" );
mpMenu = pMenu;
@@ -1472,6 +1537,9 @@ void AquaSalFrame::SetMenu( SalMenu* pSalMenu )
void AquaSalFrame::SetExtendedFrameStyle( SalExtStyle nStyle )
{
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
if( (mnExtStyle & SAL_FRAME_EXT_STYLE_DOCMODIFIED) != (nStyle & SAL_FRAME_EXT_STYLE_DOCMODIFIED) )
[mpWindow setDocumentEdited: (nStyle & SAL_FRAME_EXT_STYLE_DOCMODIFIED) ? YES : NO];
mnExtStyle = nStyle;
@@ -1576,6 +1644,9 @@ void AquaSalFrame::CaptureMouse( BOOL bCapture )
void AquaSalFrame::ResetClipRegion()
{
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
// release old path and indicate no clipping
CGPathRelease( mrClippingPath );
mrClippingPath = NULL;
@@ -1591,6 +1662,9 @@ void AquaSalFrame::ResetClipRegion()
void AquaSalFrame::BeginSetClipRegion( ULONG nRects )
{
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
// release old path
if( mrClippingPath )
{
@@ -1609,6 +1683,9 @@ void AquaSalFrame::BeginSetClipRegion( ULONG nRects )
void AquaSalFrame::UnionClipRegion( long nX, long nY, long nWidth, long nHeight )
{
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
if( nWidth && nHeight )
{
NSRect aRect = { { nX, nY }, { nWidth, nHeight } };
@@ -1619,6 +1696,9 @@ void AquaSalFrame::UnionClipRegion( long nX, long nY, long nWidth, long nHeight
void AquaSalFrame::EndSetClipRegion()
{
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
if( ! maClippingRects.empty() )
{
mrClippingPath = CGPathCreateMutable();
diff --git a/vcl/aqua/source/window/salframeview.mm b/vcl/aqua/source/window/salframeview.mm
index 2f9959ab43f4..240a915e4e12 100755
--- a/vcl/aqua/source/window/salframeview.mm
+++ b/vcl/aqua/source/window/salframeview.mm
@@ -162,6 +162,20 @@ static AquaSalFrame* getMouseContainerFrame()
return mpFrame;
}
+-(void)displayIfNeeded
+{
+ if( GetSalData() && GetSalData()->mpFirstInstance )
+ {
+ vos::IMutex* pMutex = GetSalData()->mpFirstInstance->GetYieldMutex();
+ if( pMutex )
+ {
+ pMutex->acquire();
+ [super displayIfNeeded];
+ pMutex->release();
+ }
+ }
+}
+
-(MacOSBOOL)containsMouse
{
// is this event actually inside that NSWindow ?
@@ -573,8 +587,11 @@ private:
-(void)mouseEntered: (NSEvent*)pEvent
{
s_pMouseFrame = mpFrame;
-
- [self sendMouseEventToFrame:pEvent button:s_nLastButton eventtype:SALEVENT_MOUSEMOVE];
+
+ // #i107215# the only mouse events we get when inactive are enter/exit
+ // actually we would like to have all of them, but better none than some
+ if( [NSApp isActive] )
+ [self sendMouseEventToFrame:pEvent button:s_nLastButton eventtype:SALEVENT_MOUSEMOVE];
}
-(void)mouseExited: (NSEvent*)pEvent
@@ -582,7 +599,10 @@ private:
if( s_pMouseFrame == mpFrame )
s_pMouseFrame = NULL;
- [self sendMouseEventToFrame:pEvent button:s_nLastButton eventtype:SALEVENT_MOUSELEAVE];
+ // #i107215# the only mouse events we get when inactive are enter/exit
+ // actually we would like to have all of them, but better none than some
+ if( [NSApp isActive] )
+ [self sendMouseEventToFrame:pEvent button:s_nLastButton eventtype:SALEVENT_MOUSELEAVE];
}
-(void)rightMouseDown: (NSEvent*)pEvent
diff --git a/vcl/aqua/source/window/salmenu.cxx b/vcl/aqua/source/window/salmenu.cxx
index ed3086d8506f..82102f2e7095 100644
--- a/vcl/aqua/source/window/salmenu.cxx
+++ b/vcl/aqua/source/window/salmenu.cxx
@@ -79,10 +79,14 @@ const AquaSalMenu* AquaSalMenu::pCurrentMenuBar = NULL;
-(void)showPreferences: (id) sender
{
+ YIELD_GUARD;
+
[self showDialog: SHOWDIALOG_ID_PREFERENCES];
}
-(void)showAbout: (id) sender
{
+ YIELD_GUARD;
+
[self showDialog: SHOWDIALOG_ID_ABOUT];
}
@end
@@ -203,11 +207,12 @@ static void initAppMenu()
// =======================================================================
-SalMenu* AquaSalInstance::CreateMenu( BOOL bMenuBar )
+SalMenu* AquaSalInstance::CreateMenu( BOOL bMenuBar, Menu* pVCLMenu )
{
initAppMenu();
AquaSalMenu *pAquaSalMenu = new AquaSalMenu( bMenuBar );
+ pAquaSalMenu->mpVCLMenu = pVCLMenu;
return pAquaSalMenu;
}
diff --git a/vcl/inc/cupsmgr.hxx b/vcl/inc/cupsmgr.hxx
index b413184f477f..0250cece817e 100644
--- a/vcl/inc/cupsmgr.hxx
+++ b/vcl/inc/cupsmgr.hxx
@@ -70,7 +70,7 @@ class CUPSManager : public PrinterInfoManager
virtual void initialize();
- void getOptionsFromDocumentSetup( const JobData& rJob, int& rNumOptions, void** rOptions ) const;
+ void getOptionsFromDocumentSetup( const JobData& rJob, bool bBanner, int& rNumOptions, void** rOptions ) const;
void runDests();
public:
// public for stub
@@ -84,7 +84,7 @@ public:
const char* authenticateUser( const char* );
virtual FILE* startSpool( const rtl::OUString& rPrinterName, bool bQuickCommand );
- virtual int endSpool( const rtl::OUString& rPrinterName, const rtl::OUString& rJobTitle, FILE* pFile, const JobData& rDocumentJobData );
+ virtual int endSpool( const rtl::OUString& rPrinterName, const rtl::OUString& rJobTitle, FILE* pFile, const JobData& rDocumentJobData, bool bBanner );
virtual void setupJobContextData( JobData& rData );
// changes the info about a named printer
diff --git a/vcl/inc/vcl/arrange.hxx b/vcl/inc/vcl/arrange.hxx
index 8846d9bbe948..327494b216e4 100644
--- a/vcl/inc/vcl/arrange.hxx
+++ b/vcl/inc/vcl/arrange.hxx
@@ -48,7 +48,7 @@ namespace vcl
or a child WindowArranger (a node in the hierarchy), but never both
*/
- class WindowArranger
+ class VCL_DLLPUBLIC WindowArranger
{
protected:
struct Element
@@ -76,11 +76,13 @@ namespace vcl
Element( Window* i_pWin,
boost::shared_ptr<WindowArranger> const & i_pChild = boost::shared_ptr<WindowArranger>(),
- sal_Int32 i_nExpandPriority = 0
+ sal_Int32 i_nExpandPriority = 0,
+ const Size& i_rMinSize = Size()
)
: m_pElement( i_pWin )
, m_pChild( i_pChild )
, m_nExpandPriority( i_nExpandPriority )
+ , m_aMinSize( i_rMinSize )
, m_bHidden( false )
, m_nLeftBorder( 0 )
, m_nTopBorder( 0 )
@@ -101,12 +103,19 @@ namespace vcl
Rectangle m_aManagedArea;
long m_nOuterBorder;
+ rtl::OUString m_aIdentifier;
+
virtual Element* getElement( size_t i_nIndex ) = 0;
const Element* getConstElement( size_t i_nIndex ) const
{ return const_cast<WindowArranger*>(this)->getElement( i_nIndex ); }
public:
+ static long getDefaultBorder();
+
+ static long getBorderValue( long nBorder )
+ { return nBorder >= 0 ? nBorder : -nBorder * getDefaultBorder(); }
+
WindowArranger( WindowArranger* i_pParent = NULL )
: m_pParentWindow( i_pParent ? i_pParent->m_pParentWindow : NULL )
, m_pParentArranger( i_pParent )
@@ -141,6 +150,9 @@ namespace vcl
virtual bool isVisible() const; // true if any element is visible
+ virtual com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > getProperties() const;
+ virtual void setProperties( const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& );
+
sal_Int32 getExpandPriority( size_t i_nIndex ) const
{
const Element* pEle = getConstElement( i_nIndex );
@@ -173,6 +185,19 @@ namespace vcl
}
}
+ void getBorders( size_t i_nIndex, long* i_pLeft = NULL, long* i_pTop = NULL, long* i_pRight = NULL, long* i_pBottom = NULL ) const
+ {
+ const Element* pEle = getConstElement( i_nIndex );
+ if( pEle )
+ {
+ if( i_pLeft ) *i_pLeft = pEle->m_nLeftBorder;
+ if( i_pTop ) *i_pTop = pEle->m_nTopBorder;
+ if( i_pRight ) *i_pRight = pEle->m_nRightBorder;
+ if( i_pBottom ) *i_pBottom = pEle->m_nBottomBorder;
+ }
+ }
+
+
void show( bool i_bShow = true, bool i_bImmediateUpdate = true );
void setManagedArea( const Rectangle& i_rArea )
@@ -187,9 +212,15 @@ namespace vcl
m_nOuterBorder = i_nBorder;
resize();
}
+
+ const rtl::OUString getIdentifier() const
+ { return m_aIdentifier; }
+
+ void setIdentifier( const rtl::OUString& i_rId )
+ { m_aIdentifier = i_rId; }
};
- class RowOrColumn : public WindowArranger
+ class VCL_DLLPUBLIC RowOrColumn : public WindowArranger
{
long m_nBorderWidth;
bool m_bColumn;
@@ -204,7 +235,7 @@ namespace vcl
public:
RowOrColumn( WindowArranger* i_pParent = NULL,
- bool bColumn = true, long i_nBorderWidth = 5 )
+ bool bColumn = true, long i_nBorderWidth = -1 )
: WindowArranger( i_pParent )
, m_nBorderWidth( i_nBorderWidth )
, m_bColumn( bColumn )
@@ -218,7 +249,7 @@ namespace vcl
// add a managed window at the given index
// an index smaller than zero means add the window at the end
- size_t addWindow( Window*, sal_Int32 i_nExpandPrio = 0, size_t i_nIndex = ~0 );
+ size_t addWindow( Window*, sal_Int32 i_nExpandPrio = 0, const Size& i_rMinSize = Size(), size_t i_nIndex = ~0 );
void remove( Window* );
size_t addChild( boost::shared_ptr<WindowArranger> const &, sal_Int32 i_nExpandPrio = 0, size_t i_nIndex = ~0 );
@@ -230,7 +261,7 @@ namespace vcl
long getBorderWidth() const { return m_nBorderWidth; }
};
- class LabeledElement : public WindowArranger
+ class VCL_DLLPUBLIC LabeledElement : public WindowArranger
{
WindowArranger::Element m_aLabel;
WindowArranger::Element m_aElement;
@@ -248,7 +279,7 @@ namespace vcl
}
public:
- LabeledElement( WindowArranger* i_pParent = NULL, int i_nLabelStyle = 0, long i_nDistance = 5 )
+ LabeledElement( WindowArranger* i_pParent = NULL, int i_nLabelStyle = 0, long i_nDistance = -1 )
: WindowArranger( i_pParent )
, m_nDistance( i_nDistance )
, m_nLabelColumnWidth( 0 )
@@ -274,11 +305,11 @@ namespace vcl
{ return m_aElement.getOptimalSize( i_eType ); }
};
- class LabelColumn : public RowOrColumn
+ class VCL_DLLPUBLIC LabelColumn : public RowOrColumn
{
long getLabelWidth() const;
public:
- LabelColumn( WindowArranger* i_pParent = NULL, long i_nBorderWidth = 5 )
+ LabelColumn( WindowArranger* i_pParent = NULL, long i_nBorderWidth = -1 )
: RowOrColumn( i_pParent, true, i_nBorderWidth )
{}
virtual ~LabelColumn();
@@ -288,10 +319,10 @@ namespace vcl
// returns the index of the added label
size_t addRow( Window* i_pLabel, boost::shared_ptr<WindowArranger> const& i_rElement, long i_nIndent = 0 );
- size_t addRow( Window* i_pLabel, Window* i_pElement, long i_nIndent = 0 );
+ size_t addRow( Window* i_pLabel, Window* i_pElement, long i_nIndent = 0, const Size& i_rElementMinSize = Size() );
};
- class Indenter : public WindowArranger
+ class VCL_DLLPUBLIC Indenter : public WindowArranger
{
long m_nIndent;
WindowArranger::Element m_aElement;
@@ -301,7 +332,7 @@ namespace vcl
{ return i_nIndex == 0 ? &m_aElement : NULL; }
public:
- Indenter( WindowArranger* i_pParent = NULL, long i_nIndent = 15 )
+ Indenter( WindowArranger* i_pParent = NULL, long i_nIndent = 3*getDefaultBorder() )
: WindowArranger( i_pParent )
, m_nIndent( i_nIndent )
{}
@@ -325,7 +356,7 @@ namespace vcl
{ setChild( boost::shared_ptr<WindowArranger>( i_pChild ), i_nExpandPrio ); }
};
- class Spacer : public WindowArranger
+ class VCL_DLLPUBLIC Spacer : public WindowArranger
{
WindowArranger::Element m_aElement;
Size m_aSize;
@@ -351,7 +382,7 @@ namespace vcl
virtual bool isVisible() const { return true; }
};
- class MatrixArranger : public WindowArranger
+ class VCL_DLLPUBLIC MatrixArranger : public WindowArranger
{
long m_nBorderX;
long m_nBorderY;
@@ -370,9 +401,10 @@ namespace vcl
MatrixElement( Window* i_pWin,
sal_uInt32 i_nX, sal_uInt32 i_nY,
boost::shared_ptr<WindowArranger> const & i_pChild = boost::shared_ptr<WindowArranger>(),
- sal_Int32 i_nExpandPriority = 0
+ sal_Int32 i_nExpandPriority = 0,
+ const Size& i_rMinSize = Size()
)
- : WindowArranger::Element( i_pWin, i_pChild, i_nExpandPriority )
+ : WindowArranger::Element( i_pWin, i_pChild, i_nExpandPriority, i_rMinSize )
, m_nX( i_nX )
, m_nY( i_nY )
{
@@ -385,15 +417,20 @@ namespace vcl
sal_uInt64 getMap( sal_uInt32 i_nX, sal_uInt32 i_nY )
{ return static_cast< sal_uInt64 >(i_nX) | (static_cast< sal_uInt64>(i_nY) << 32 ); }
- Size getOptimalSize( WindowSizeType, std::vector<long>& o_rColumnWidths, std::vector<long>& o_rRowHeights ) const;
+ static void distributeExtraSize( std::vector<long>& io_rSizes, const std::vector<sal_Int32>& i_rPrios, long i_nExtraWidth );
+
+ Size getOptimalSize( WindowSizeType,
+ std::vector<long>& o_rColumnWidths, std::vector<long>& o_rRowHeights,
+ std::vector<sal_Int32>& o_rColumnPrio, std::vector<sal_Int32>& o_rRowPrio
+ ) const;
protected:
virtual Element* getElement( size_t i_nIndex )
{ return i_nIndex < m_aElements.size() ? &m_aElements[ i_nIndex ] : 0; }
public:
MatrixArranger( WindowArranger* i_pParent = NULL,
- long i_nBorderX = 5,
- long i_nBorderY = 5 )
+ long i_nBorderX = -1,
+ long i_nBorderY = -1 )
: WindowArranger( i_pParent )
, m_nBorderX( i_nBorderX )
, m_nBorderY( i_nBorderY )
@@ -406,7 +443,7 @@ namespace vcl
virtual size_t countElements() const { return m_aElements.size(); }
// add a managed window at the given matrix position
- size_t addWindow( Window*, sal_uInt32 i_nX, sal_uInt32 i_nY, sal_Int32 i_nExpandPrio = 0 );
+ size_t addWindow( Window*, sal_uInt32 i_nX, sal_uInt32 i_nY, sal_Int32 i_nExpandPrio = 0, const Size& i_rMinSize = Size() );
void remove( Window* );
size_t addChild( boost::shared_ptr<WindowArranger> const &, sal_uInt32 i_nX, sal_uInt32 i_nY, sal_Int32 i_nExpandPrio = 0 );
diff --git a/vcl/inc/vcl/btndlg.hxx b/vcl/inc/vcl/btndlg.hxx
index dbeb8350a0d4..3186ba5f6399 100644
--- a/vcl/inc/vcl/btndlg.hxx
+++ b/vcl/inc/vcl/btndlg.hxx
@@ -104,8 +104,8 @@ public:
XubString GetButtonText( USHORT nId ) const;
void SetButtonHelpText( USHORT nId, const XubString& rText );
XubString GetButtonHelpText( USHORT nId ) const;
- void SetButtonHelpId( USHORT nId, ULONG nHelpId );
- ULONG GetButtonHelpId( USHORT nId ) const;
+ void SetButtonHelpId( USHORT nId, const rtl::OString& rHelpId );
+ rtl::OString GetButtonHelpId( USHORT nId ) const;
void SetFocusButton( USHORT nId = BUTTONDIALOG_BUTTON_NOTFOUND ) { mnFocusButtonId = nId; }
USHORT GetFocusButton() const { return mnFocusButtonId; }
diff --git a/vcl/inc/vcl/button.hxx b/vcl/inc/vcl/button.hxx
index fa185c32dcda..ab92445b5e03 100644
--- a/vcl/inc/vcl/button.hxx
+++ b/vcl/inc/vcl/button.hxx
@@ -132,7 +132,7 @@ protected:
SAL_DLLPRIVATE WinBits ImplInitStyle( const Window* pPrevWindow, WinBits nStyle );
SAL_DLLPRIVATE void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
SAL_DLLPRIVATE void ImplDrawPushButtonContent( OutputDevice* pDev, ULONG nDrawFlags,
- const Rectangle& rRect, bool bLayout );
+ const Rectangle& rRect, bool bLayout, bool bMenuBtnSep );
SAL_DLLPRIVATE void ImplDrawPushButton( bool bLayout = false );
using Button::ImplGetTextStyle;
SAL_DLLPRIVATE USHORT ImplGetTextStyle( ULONG nDrawFlags ) const;
diff --git a/vcl/inc/vcl/edit.hxx b/vcl/inc/vcl/edit.hxx
index a40de9503367..9dc427d83943 100644..100755
--- a/vcl/inc/vcl/edit.hxx
+++ b/vcl/inc/vcl/edit.hxx
@@ -247,6 +247,10 @@ public:
virtual XubString GetSurroundingText() const;
virtual Selection GetSurroundingTextSelection() const;
+
+ // returns the minimum size a bordered Edit should have given the current
+ // global style settings (needed by sc's inputwin.cxx)
+ static Size GetMinimumEditSize();
};
inline ULONG Edit::IsUpdateDataEnabled() const
diff --git a/vcl/inc/vcl/glyphcache.hxx b/vcl/inc/vcl/glyphcache.hxx
index a77c1626dc24..0e77d5dd6bc4 100644
--- a/vcl/inc/vcl/glyphcache.hxx
+++ b/vcl/inc/vcl/glyphcache.hxx
@@ -48,7 +48,6 @@ class ImplFontOptions;
namespace basegfx { class B2DPolyPolygon; }
class RawBitmap;
-class CmapResult;
#include <vcl/outfont.hxx>
#include <vcl/impfont.hxx>
@@ -190,7 +189,7 @@ public:
virtual void FetchFontMetric( ImplFontMetricData&, long& rFactor ) const = 0;
virtual ULONG GetKernPairs( ImplKernPairData** ) const { return 0; }
virtual int GetGlyphKernValue( int, int ) const { return 0; }
- virtual bool GetFontCodeRanges( CmapResult& ) const { return false; }
+ virtual const ImplFontCharMap* GetImplFontCharMap() const = 0;
Point TransformPoint( const Point& ) const;
GlyphData& GetGlyphData( int nGlyphIndex );
diff --git a/vcl/inc/vcl/graphite_adaptors.hxx b/vcl/inc/vcl/graphite_adaptors.hxx
index e58881c9f463..ae2ff2962adb 100644
--- a/vcl/inc/vcl/graphite_adaptors.hxx
+++ b/vcl/inc/vcl/graphite_adaptors.hxx
@@ -55,11 +55,11 @@
#include "vcl/dllapi.h"
// Libraries
-#include <tools/preextstl.h>
+#include <preextstl.h>
#include <graphite/GrClient.h>
#include <graphite/Font.h>
#include <graphite/ITextSource.h>
-#include <tools/postextstl.h>
+#include <postextstl.h>
// Module type definitions and forward declarations.
//
diff --git a/vcl/inc/vcl/graphite_features.hxx b/vcl/inc/vcl/graphite_features.hxx
index 47f4c3a01e7f..47b8f062e299 100644
--- a/vcl/inc/vcl/graphite_features.hxx
+++ b/vcl/inc/vcl/graphite_features.hxx
@@ -29,11 +29,11 @@
// Parse a string of features specified as ; separated pairs.
// e.g.
// 1001=1&2002=2&fav1=0
-#include <tools/preextstl.h>
+#include <preextstl.h>
#include <graphite/GrClient.h>
#include <graphite/Font.h>
#include <graphite/GrFeature.h>
-#include <tools/postextstl.h>
+#include <postextstl.h>
namespace grutils
{
diff --git a/vcl/inc/vcl/graphite_layout.hxx b/vcl/inc/vcl/graphite_layout.hxx
index 765a154a9898..cd22abdcdb26 100644
--- a/vcl/inc/vcl/graphite_layout.hxx
+++ b/vcl/inc/vcl/graphite_layout.hxx
@@ -40,13 +40,13 @@
#include <vector>
#include <utility>
// Libraries
-#include <tools/preextstl.h>
+#include <preextstl.h>
#include <graphite/GrClient.h>
#include <graphite/Font.h>
#include <graphite/GrConstants.h>
#include <graphite/GrAppData.h>
#include <graphite/SegmentAux.h>
-#include <tools/postextstl.h>
+#include <postextstl.h>
// Platform
#include <vcl/sallayout.hxx>
#include <vcl/dllapi.h>
diff --git a/vcl/inc/vcl/help.hxx b/vcl/inc/vcl/help.hxx
index 30308aa8a723..1f4ba36d8f43 100644
--- a/vcl/inc/vcl/help.hxx
+++ b/vcl/inc/vcl/help.hxx
@@ -52,8 +52,8 @@ class Window;
#define QUICKHELP_BIDI_RTL ((USHORT)0x8000)
// By changes you must also change: rsc/vclrsc.hxx
-#define OOO_HELP_INDEX ((ULONG)0xFFFFFFFF)
-#define OOO_HELP_HELPONHELP ((ULONG)0xFFFFFFFE)
+#define OOO_HELP_INDEX ".help:index"
+#define OOO_HELP_HELPONHELP ".help:helponhelp"
// --------
// - Help -
@@ -71,10 +71,9 @@ public:
void SetHelpFile( const String& rFileName ) { maHelpFile = rFileName; }
const String& GetHelpFile() const { return maHelpFile; }
- virtual BOOL Start( ULONG nHelpId, const Window* pWindow );
- virtual BOOL Start( const XubString& rKeyWord, const Window* pWindow );
- virtual void OpenHelpAgent( ULONG nHelpId );
- virtual XubString GetHelpText( ULONG nHelpId, const Window* pWindow );
+ virtual BOOL Start( const XubString& rHelpId, const Window* pWindow );
+ virtual BOOL SearchKeyword( const XubString& rKeyWord );
+ virtual void OpenHelpAgent( const rtl::OString& rHelpId );
virtual XubString GetHelpText( const String& aHelpURL, const Window* pWindow );
static void EnableContextHelp();
diff --git a/vcl/inc/vcl/ilstbox.hxx b/vcl/inc/vcl/ilstbox.hxx
index ac278f76f65b..6580538f5d10 100644
--- a/vcl/inc/vcl/ilstbox.hxx
+++ b/vcl/inc/vcl/ilstbox.hxx
@@ -36,6 +36,7 @@
#include <vcl/lstbox.h>
#include <vcl/timer.hxx>
+#include "vcl/quickselectionengine.hxx"
class ScrollBar;
class ScrollBarBox;
@@ -193,13 +194,11 @@ public:
// - ImplListBoxWindow -
// ---------------------
-class ImplListBoxWindow : public Control
+class ImplListBoxWindow : public Control, public ::vcl::ISearchableStringList
{
private:
ImplEntryList* mpEntryList; // EntryListe
Rectangle maFocusRect;
- String maSearchStr;
- Timer maSearchTimeout;
Size maUserItemSize;
@@ -254,9 +253,10 @@ private:
Link maUserDrawHdl;
Link maMRUChangedHdl;
-protected:
- DECL_LINK( SearchStringTimeout, Timer* );
+ ::vcl::QuickSelectionEngine
+ maQuickSelectionEngine;
+protected:
virtual void KeyInput( const KeyEvent& rKEvt );
virtual void MouseButtonDown( const MouseEvent& rMEvt );
virtual void MouseMove( const MouseEvent& rMEvt );
@@ -379,6 +379,12 @@ public:
// pb: #106948# explicit mirroring for calc
inline void EnableMirroring() { mbMirroring = TRUE; }
inline BOOL IsMirroring() const { return mbMirroring; }
+
+protected:
+ // ISearchableStringList
+ virtual ::vcl::StringEntryIdentifier CurrentEntry( String& _out_entryText ) const;
+ virtual ::vcl::StringEntryIdentifier NextEntry( ::vcl::StringEntryIdentifier _currentEntry, String& _out_entryText ) const;
+ virtual void SelectEntry( ::vcl::StringEntryIdentifier _entry );
};
// ---------------
diff --git a/vcl/inc/vcl/impfont.hxx b/vcl/inc/vcl/impfont.hxx
index a1104bbf4a86..e38e1dea78d4 100644
--- a/vcl/inc/vcl/impfont.hxx
+++ b/vcl/inc/vcl/impfont.hxx
@@ -196,8 +196,8 @@ public:
int GetIndexFromChar( sal_uInt32 ) const;
sal_uInt32 GetCharFromIndex( int ) const;
- void AddReference();
- void DeReference();
+ void AddReference() const;
+ void DeReference() const;
int GetGlyphIndex( sal_uInt32 ) const;
@@ -213,8 +213,8 @@ private:
const int* mpStartGlyphs; // range-specific mapper to glyphs
const USHORT* mpGlyphIds; // individual glyphid mappings
int mnRangeCount;
- int mnCharCount;
- int mnRefCount;
+ int mnCharCount; // covered codepoints
+ mutable int mnRefCount;
};
// CmapResult is a normalized version of the many CMAP formats
diff --git a/vcl/inc/vcl/javachild.hxx b/vcl/inc/vcl/javachild.hxx
index 62b447f26571..c5ec3c678900 100644
--- a/vcl/inc/vcl/javachild.hxx
+++ b/vcl/inc/vcl/javachild.hxx
@@ -47,8 +47,6 @@ public:
private:
- SAL_DLLPRIVATE void implTestJavaException( void* pEnv );
-
// Copy assignment is forbidden and not implemented.
SAL_DLLPRIVATE JavaChildWindow (const JavaChildWindow &);
SAL_DLLPRIVATE JavaChildWindow & operator= (const JavaChildWindow &);
diff --git a/vcl/inc/vcl/jobdata.hxx b/vcl/inc/vcl/jobdata.hxx
index f576b816dab0..18330ae3508d 100644
--- a/vcl/inc/vcl/jobdata.hxx
+++ b/vcl/inc/vcl/jobdata.hxx
@@ -50,6 +50,7 @@ struct JobData
int m_nColorDepth;
int m_nPSLevel; // 0: no override, else languaglevel to use
int m_nColorDevice; // 0: no override, -1 grey scale, +1 color
+ int m_nPDFDevice; // 0: PostScript, 1: PDF
orientation::type m_eOrientation;
::rtl::OUString m_aPrinterName;
const PPDParser* m_pParser;
@@ -64,6 +65,7 @@ struct JobData
m_nColorDepth( 24 ),
m_nPSLevel( 0 ),
m_nColorDevice( 0 ),
+ m_nPDFDevice( 0 ),
m_eOrientation( orientation::Portrait ),
m_pParser( NULL ) {}
@@ -72,6 +74,8 @@ struct JobData
JobData( const JobData& rData ) { *this = rData; }
void setCollate( bool bCollate );
+ bool setPaper( int nWidth, int nHeight ); // dimensions in pt
+ bool setPaperBin( int nPaperBin ); // dimensions in pt
// creates a new buffer using new
// it is up to the user to delete it again
diff --git a/vcl/inc/vcl/menu.hxx b/vcl/inc/vcl/menu.hxx
index 908f3e30319c..d57fdeb7cfd3 100644
--- a/vcl/inc/vcl/menu.hxx
+++ b/vcl/inc/vcl/menu.hxx
@@ -304,8 +304,8 @@ public:
void SetHelpCommand( USHORT nItemId, const XubString& rString );
const XubString& GetHelpCommand( USHORT nItemId ) const;
- void SetHelpId( USHORT nItemId, ULONG nHelpId );
- ULONG GetHelpId( USHORT nItemId ) const;
+ void SetHelpId( USHORT nItemId, const rtl::OString& rHelpId );
+ rtl::OString GetHelpId( USHORT nItemId ) const;
void SetActivateHdl( const Link& rLink ) { aActivateHdl = rLink; }
const Link& GetActivateHdl() const { return aActivateHdl; }
diff --git a/vcl/inc/vcl/metric.hxx b/vcl/inc/vcl/metric.hxx
index eae6b38c5f9d..6328890c1749 100644
--- a/vcl/inc/vcl/metric.hxx
+++ b/vcl/inc/vcl/metric.hxx
@@ -95,7 +95,7 @@ public:
class VCL_DLLPUBLIC FontCharMap
{
private:
- ImplFontCharMap* mpImpl;
+ const ImplFontCharMap* mpImpl;
public:
FontCharMap();
@@ -118,7 +118,7 @@ public:
private:
friend class OutputDevice;
- void Reset( ImplFontCharMap* pNewMap = NULL );
+ void Reset( const ImplFontCharMap* pNewMap = NULL );
// prevent assignment and copy construction
FontCharMap( const FontCharMap& );
diff --git a/vcl/inc/vcl/mnemonicengine.hxx b/vcl/inc/vcl/mnemonicengine.hxx
index d12b3db2417e..fcd303510203 100644
--- a/vcl/inc/vcl/mnemonicengine.hxx
+++ b/vcl/inc/vcl/mnemonicengine.hxx
@@ -59,7 +59,7 @@ namespace vcl
If this value is <NULL/>, searching stops.
*/
- virtual const void* FirstSearchEntry( String& _rEntryText ) = 0;
+ virtual const void* FirstSearchEntry( String& _rEntryText ) const = 0;
/** returns the next list entry for the mnemonic search
@@ -74,7 +74,7 @@ namespace vcl
to <member>FirstSearchEntry</member> (i.e. you cycled
around), then searching stops, too.
*/
- virtual const void* NextSearchEntry( const void* _pCurrentSearchEntry, String& _rEntryText ) = 0;
+ virtual const void* NextSearchEntry( const void* _pCurrentSearchEntry, String& _rEntryText ) const = 0;
/** "selects" a given entry.
@@ -117,7 +117,7 @@ namespace vcl
the entry to select. This is the return value of a previous call
to <member>FirstSearchEntry</member> or <member>NextSearchEntry</member>.
*/
- virtual void ExecuteSearchEntry( const void* _pEntry ) = 0;
+ virtual void ExecuteSearchEntry( const void* _pEntry ) const = 0;
};
//====================================================================
diff --git a/vcl/inc/vcl/outdev.hxx b/vcl/inc/vcl/outdev.hxx
index f787df3692ce..12c4202af144 100644
--- a/vcl/inc/vcl/outdev.hxx
+++ b/vcl/inc/vcl/outdev.hxx
@@ -185,6 +185,9 @@ struct KerningPair
#define TEXT_DRAW_MULTILINE ((USHORT)0x1000)
#define TEXT_DRAW_WORDBREAK ((USHORT)0x2000)
#define TEXT_DRAW_NEWSELLIPSIS ((USHORT)0x4000)
+// in the long run we should make text style flags longer
+// but at the moment we can get away with this 2 bit field for ellipsis style
+#define TEXT_DRAW_CENTERELLIPSIS (TEXT_DRAW_ENDELLIPSIS | TEXT_DRAW_PATHELLIPSIS)
#define TEXT_DRAW_WORDBREAK_HYPHENATION (((USHORT)0x8000) | TEXT_DRAW_WORDBREAK)
@@ -1114,7 +1117,7 @@ public:
/** Added return value to see if EPS could be painted directly.
Theoreticaly, handing over a matrix would be needed to handle
- painting rotated EPS files (e.g. contained mín Metafiles). This
+ painting rotated EPS files (e.g. contained in Metafiles). This
would then need to be supported for Mac and PS printers, but
that's too much for now, wrote #i107046# for this */
bool DrawEPS( const Point& rPt, const Size& rSz,
diff --git a/vcl/inc/vcl/pdfwriter.hxx b/vcl/inc/vcl/pdfwriter.hxx
index 419814e5ce97..52e4b5014120 100644
--- a/vcl/inc/vcl/pdfwriter.hxx
+++ b/vcl/inc/vcl/pdfwriter.hxx
@@ -38,7 +38,8 @@
#include <vcl/font.hxx>
#include <vcl/graphictools.hxx>
-#include <com/sun/star/io/XOutputStream.hpp>
+#include "com/sun/star/io/XOutputStream.hpp"
+#include "com/sun/star/beans/XMaterialHolder.hpp"
#include <list>
#include <vector>
@@ -47,6 +48,7 @@
class Font;
class Point;
class OutputDevice;
+class GDIMetaFile;
class MapMode;
class Polygon;
class LineInfo;
@@ -61,15 +63,7 @@ class Wallpaper;
namespace vcl
{
-struct PDFDocInfo
-{
- String Title; // document title
- String Author; // document author
- String Subject; // subject
- String Keywords; // keywords
- String Creator; // application that created the original document
- String Producer; // OpenOffice
-};
+class PDFExtOutDevData;
struct PDFNote
{
@@ -468,7 +462,7 @@ public:
FitVisible,
ActionZoom
};
-// These emuns are treated as integer while reading/writing to configuration
+// These enums are treated as integer while reading/writing to configuration
enum PDFPageLayout
{
DefaultLayout,
@@ -489,20 +483,35 @@ public:
/*
The following structure describes the permissions used in PDF security
*/
- struct PDFSecPermissions
+ struct PDFEncryptionProperties
{
-//for both 40 and 128 bit security, see 3.5.2 PDF v 1.4 table 3.15, v 1.5 and v 1.6 table 3.20.
- bool CanPrintTheDocument;
+
+ bool Security128bit; // true to select 128 bit encryption, false for 40 bit
+ //for both 40 and 128 bit security, see 3.5.2 PDF v 1.4 table 3.15, v 1.5 and v 1.6 table 3.20.
+ bool CanPrintTheDocument;
bool CanModifyTheContent;
bool CanCopyOrExtract;
bool CanAddOrModify;
-//for revision 3 (bit 128 security) only
+ //for revision 3 (bit 128 security) only
bool CanFillInteractive;
bool CanExtractForAccessibility;
bool CanAssemble;
bool CanPrintFull;
-//permission default set for 128 bit, accessibility only
- PDFSecPermissions() :
+
+ // encryption will only happen if EncryptionKey is not empty
+ // EncryptionKey is actually a construct out of OValue, UValue and DocumentIdentifier
+ // if these do not match, behavior is undefined, most likely an invalid PDF will be produced
+ // OValue, UValue, EncryptionKey and DocumentIdentifier can be computed from
+ // PDFDocInfo, Owner password and User password used the InitEncryption method which
+ // implements the algorithms described in the PDF reference chapter 3.5: Encryption
+ std::vector<sal_uInt8> OValue;
+ std::vector<sal_uInt8> UValue;
+ std::vector<sal_uInt8> EncryptionKey;
+ std::vector<sal_uInt8> DocumentIdentifier;
+
+ //permission default set for 128 bit, accessibility only
+ PDFEncryptionProperties() :
+ Security128bit ( true ),
CanPrintTheDocument ( false ),
CanModifyTheContent ( false ),
CanCopyOrExtract ( false ),
@@ -512,6 +521,20 @@ The following structure describes the permissions used in PDF security
CanAssemble ( false ),
CanPrintFull ( false )
{}
+
+
+ bool Encrypt() const
+ { return ! OValue.empty() && ! UValue.empty() && ! DocumentIdentifier.empty(); }
+ };
+
+ struct PDFDocInfo
+ {
+ String Title; // document title
+ String Author; // document author
+ String Subject; // subject
+ String Keywords; // keywords
+ String Creator; // application that created the original document
+ String Producer; // OpenOffice
};
struct PDFWriterContext
@@ -570,14 +593,12 @@ The following structure describes the permissions used in PDF security
sal_Int32 InitialPage;
sal_Int32 OpenBookmarkLevels; // -1 means all levels
- struct PDFSecPermissions AccessPermissions;
-
- bool Encrypt; // main encryption flag, must be true to encript
- bool Security128bit; // true to select 128 bit encryption, false for 40 bit
- rtl::OUString OwnerPassword; // owner password for PDF, in clear text
- rtl::OUString UserPassword; // user password for PDF, in clear text
+ PDFWriter::PDFEncryptionProperties Encryption;
+ PDFWriter::PDFDocInfo DocumentInfo;
com::sun::star::lang::Locale DocumentLocale; // defines the document default language
+ sal_uInt32 DPIx, DPIy; // how to handle MapMode( MAP_PIXEL )
+ // 0 here specifies a default handling
PDFWriterContext() :
RelFsys( false ), //i56629, i49415?, i64585?
@@ -604,13 +625,13 @@ The following structure describes the permissions used in PDF security
FirstPageLeft( false ),
InitialPage( 1 ),
OpenBookmarkLevels( -1 ),
- AccessPermissions( ),
- Encrypt( false ),
- Security128bit( true )
+ Encryption(),
+ DPIx( 0 ),
+ DPIy( 0 )
{}
};
- PDFWriter( const PDFWriterContext& rContext );
+ PDFWriter( const PDFWriterContext& rContext, const com::sun::star::uno::Reference< com::sun::star::beans::XMaterialHolder >& );
~PDFWriter();
/** Returns an OutputDevice for formatting
@@ -635,17 +656,24 @@ The following structure describes the permissions used in PDF security
returns the page id of the new page
*/
sal_Int32 NewPage( sal_Int32 nPageWidth = 0, sal_Int32 nPageHeight = 0, Orientation eOrientation = Inherit );
+ /** Play a metafile like an outputdevice would do
+ */
+ struct PlayMetafileContext
+ {
+ int m_nMaxImageResolution;
+ bool m_bOnlyLosslessCompression;
+ int m_nJPEGQuality;
+ bool m_bTransparenciesWereRemoved;
+
+ PlayMetafileContext()
+ : m_nMaxImageResolution( 0 )
+ , m_bOnlyLosslessCompression( false )
+ , m_nJPEGQuality( 90 )
+ , m_bTransparenciesWereRemoved( false )
+ {}
- /*
- * set document info; due to the use of document information in building the PDF document ID, must be called before
- * emitting anything.
- */
- void SetDocInfo( const PDFDocInfo& rInfo );
-
- /*
- * get currently set document info
- */
- const PDFDocInfo& GetDocInfo() const;
+ };
+ void PlayMetafile( const GDIMetaFile&, const PlayMetafileContext&, vcl::PDFExtOutDevData* pDevDat = NULL );
/* sets the document locale originally passed with the context to a new value
* only affects the output if used before calling <code>Emit/code>.
@@ -664,6 +692,12 @@ The following structure describes the permissions used in PDF security
PDFVersion GetVersion() const;
+ static com::sun::star::uno::Reference< com::sun::star::beans::XMaterialHolder >
+ InitEncryption( const rtl::OUString& i_rOwnerPassword,
+ const rtl::OUString& i_rUserPassword,
+ bool b128Bit
+ );
+
/* functions for graphics state */
/* flag values: see vcl/outdev.hxx */
void Push( USHORT nFlags = 0xffff );
diff --git a/vcl/inc/vcl/print.hxx b/vcl/inc/vcl/print.hxx
index 0cd56e32d83d..810fbd353f8c 100644
--- a/vcl/inc/vcl/print.hxx
+++ b/vcl/inc/vcl/print.hxx
@@ -400,7 +400,7 @@ protected:
PrinterController( const boost::shared_ptr<Printer>& );
public:
enum NupOrderType
- { LRTB, TBLR };
+ { LRTB, TBLR, TBRL, RLTB };
struct MultiPageSetup
{
// all metrics in 100th mm
@@ -478,6 +478,7 @@ public:
*/
void enableUIOption( const rtl::OUString& rPropName, bool bEnable );
bool isUIOptionEnabled( const rtl::OUString& rPropName ) const;
+ bool isUIChoiceEnabled( const rtl::OUString& rPropName, sal_Int32 nChoice ) const;
/* returns the property name rPropName depends on or an empty string
if no dependency exists.
*/
@@ -513,21 +514,24 @@ public:
bool isDirectPrint() const;
// implementation details, not usable outside vcl
- SAL_DLLPRIVATE int getFilteredPageCount();
+ // don't use outside vcl. Some of these ar exported for
+ // the benefit of vcl's plugins.
+ // Still: DO NOT USE OUTSIDE VCL
+ int getFilteredPageCount();
SAL_DLLPRIVATE PageSize getPageFile( int i_inUnfilteredPage, GDIMetaFile& rMtf, bool i_bMayUseCache = false );
- SAL_DLLPRIVATE PageSize getFilteredPageFile( int i_nFilteredPage, GDIMetaFile& o_rMtf, bool i_bMayUseCache = false );
+ PageSize getFilteredPageFile( int i_nFilteredPage, GDIMetaFile& o_rMtf, bool i_bMayUseCache = false );
SAL_DLLPRIVATE void printFilteredPage( int i_nPage );
SAL_DLLPRIVATE void setPrinter( const boost::shared_ptr<Printer>& );
SAL_DLLPRIVATE void setOptionChangeHdl( const Link& );
- SAL_DLLPRIVATE void createProgressDialog();
- SAL_DLLPRIVATE bool isProgressCanceled() const;
+ void createProgressDialog();
+ bool isProgressCanceled() const;
SAL_DLLPRIVATE void setMultipage( const MultiPageSetup& );
SAL_DLLPRIVATE const MultiPageSetup& getMultipage() const;
- SAL_DLLPRIVATE void setLastPage( sal_Bool i_bLastPage );
+ void setLastPage( sal_Bool i_bLastPage );
SAL_DLLPRIVATE void setReversePrint( sal_Bool i_bReverse );
SAL_DLLPRIVATE bool getReversePrint() const;
SAL_DLLPRIVATE void pushPropertiesToPrinter();
- SAL_DLLPRIVATE void setJobState( com::sun::star::view::PrintableState );
+ void setJobState( com::sun::star::view::PrintableState );
SAL_DLLPRIVATE bool setupPrinter( Window* i_pDlgParent );
SAL_DLLPRIVATE int getPageCountProtected() const;
@@ -650,6 +654,7 @@ class VCL_DLLPUBLIC PrinterOptionsHelper
const com::sun::star::uno::Sequence< rtl::OUString >& i_rChoices,
sal_Int32 i_nValue,
const rtl::OUString& i_rType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Radio" ) ),
+ const com::sun::star::uno::Sequence< sal_Bool >& i_rDisabledChoices = com::sun::star::uno::Sequence< sal_Bool >(),
const UIControlOptions& i_rControlOptions = UIControlOptions()
);
diff --git a/vcl/inc/vcl/printerinfomanager.hxx b/vcl/inc/vcl/printerinfomanager.hxx
index f2e0aad538c8..5e94ed919a4e 100644
--- a/vcl/inc/vcl/printerinfomanager.hxx
+++ b/vcl/inc/vcl/printerinfomanager.hxx
@@ -157,6 +157,8 @@ public:
// there can only be one
static PrinterInfoManager& get();
+ // only called by SalData destructor, frees the global instance
+ static void release();
// get PrinterInfoManager type
Type getType() const { return m_eType; }
@@ -217,8 +219,10 @@ public:
// this may either be a regular file or the result of popen()
virtual FILE* startSpool( const rtl::OUString& rPrinterName, bool bQuickCommand );
// close the FILE* returned by startSpool and does the actual spooling
+ // set bBanner to "false" will attempt to suppress banner printing
+ // set bBanner to "true" will rely on the system default
// returns a numerical job id
- virtual int endSpool( const rtl::OUString& rPrinterName, const rtl::OUString& rJobTitle, FILE* pFile, const JobData& rDocumentJobData );
+ virtual int endSpool( const rtl::OUString& rPrinterName, const rtl::OUString& rJobTitle, FILE* pFile, const JobData& rDocumentJobData, bool bBanner );
// for spadmin: whether adding or removing a printer is possible
virtual bool addOrRemovePossible() const;
diff --git a/vcl/inc/vcl/prndlg.hxx b/vcl/inc/vcl/prndlg.hxx
index fdaf06c9854e..1d16a2241485 100644
--- a/vcl/inc/vcl/prndlg.hxx
+++ b/vcl/inc/vcl/prndlg.hxx
@@ -59,6 +59,8 @@ namespace vcl
VirtualDevice maPageVDev;
rtl::OUString maReplacementString;
rtl::OUString maToolTipString;
+ FixedLine maHorzDim;
+ FixedLine maVertDim;
bool useHCColorReplacement() const;
public:
@@ -126,7 +128,6 @@ namespace vcl
// border around each page
CheckBox maBorderCB;
- vcl::RowOrColumn maLayout;
boost::shared_ptr< vcl::RowOrColumn > mxBrochureDep;
boost::shared_ptr< vcl::LabeledElement >mxPagesBtnLabel;
@@ -142,7 +143,7 @@ namespace vcl
void showAdvancedControls( bool );
- virtual void Resize();
+ // virtual void Resize();
};
class JobTabPage : public TabPage
@@ -174,7 +175,6 @@ namespace vcl
long mnCollateUIMode;
- vcl::RowOrColumn maLayout;
boost::shared_ptr<vcl::RowOrColumn> mxPrintRange;
boost::shared_ptr<vcl::WindowArranger> mxDetails;
@@ -184,7 +184,7 @@ namespace vcl
void readFromSettings();
void storeToSettings();
- virtual void Resize();
+ // virtual void Resize();
void setupLayout();
};
@@ -197,7 +197,6 @@ namespace vcl
CheckBox maCollateSingleJobsBox;
CheckBox maReverseOrderBox;
- vcl::RowOrColumn maLayout;
boost::shared_ptr<vcl::RowOrColumn> mxOptGroup;
OutputOptPage( Window*, const ResId& );
@@ -206,7 +205,7 @@ namespace vcl
void readFromSettings();
void storeToSettings();
- virtual void Resize();
+ // virtual void Resize();
void setupLayout();
};
@@ -251,7 +250,6 @@ namespace vcl
rtl::OUString maPrintText;
rtl::OUString maDefPrtText;
- vcl::RowOrColumn maLayout;
boost::shared_ptr<vcl::RowOrColumn> mxPreviewCtrls;
Size maDetailsCollapsedSize;
diff --git a/vcl/inc/vcl/prntypes.hxx b/vcl/inc/vcl/prntypes.hxx
index 6b2af991f2dd..244154360f3b 100644
--- a/vcl/inc/vcl/prntypes.hxx
+++ b/vcl/inc/vcl/prntypes.hxx
@@ -91,5 +91,6 @@ enum Orientation { ORIENTATION_PORTRAIT, ORIENTATION_LANDSCAPE };
#define PRINTER_CAPABILITIES_PDF ((USHORT)9)
#define PRINTER_CAPABILITIES_EXTERNALDIALOG ((USHORT)10)
#define PRINTER_CAPABILITIES_SETDUPLEX ((USHORT)11)
+#define PRINTER_CAPABILITIES_USEPULLMODEL ((USHORT)12)
#endif // _SV_PRNTYPES_HXX
diff --git a/vcl/inc/vcl/quickselectionengine.hxx b/vcl/inc/vcl/quickselectionengine.hxx
new file mode 100644
index 000000000000..f70736428010
--- /dev/null
+++ b/vcl/inc/vcl/quickselectionengine.hxx
@@ -0,0 +1,95 @@
+/*************************************************************************
+* 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.
+************************************************************************/
+
+#ifndef VCL_QUICKSELECTIONENGINE_HXX
+#define VCL_QUICKSELECTIONENGINE_HXX
+
+#include "dllapi.h"
+
+#include <tools/string.hxx>
+
+#include <memory>
+
+class KeyEvent;
+
+//........................................................................
+namespace vcl
+{
+//........................................................................
+
+ typedef const void* StringEntryIdentifier;
+
+ //====================================================================
+ //= ISearchableStringList
+ //====================================================================
+ // TODO: consolidate this with ::vcl::IMnemonicEntryList
+ class SAL_NO_VTABLE VCL_DLLPUBLIC ISearchableStringList
+ {
+ public:
+ /** returns the current entry in the list of searchable strings.
+
+ Search operations will start with this entry.
+ */
+ virtual StringEntryIdentifier CurrentEntry( String& _out_entryText ) const = 0;
+
+ /** returns the next entry in the list.
+
+ The implementation is expected to wrap around. That is, if the given entry denotes the last
+ entry in the list, then NextEntry should return the first entry.
+ */
+ virtual StringEntryIdentifier NextEntry( StringEntryIdentifier _currentEntry, String& _out_entryText ) const = 0;
+
+ /** selects a given entry
+ */
+ virtual void SelectEntry( StringEntryIdentifier _entry ) = 0;
+ };
+
+ //====================================================================
+ //= QuickSelectionEngine
+ //====================================================================
+ struct QuickSelectionEngine_Data;
+ class VCL_DLLPUBLIC QuickSelectionEngine
+ {
+ public:
+ QuickSelectionEngine( ISearchableStringList& _entryList );
+ ~QuickSelectionEngine();
+
+ bool HandleKeyEvent( const KeyEvent& _rKEvt );
+ void Reset();
+
+ private:
+ ::std::auto_ptr< QuickSelectionEngine_Data > m_pData;
+
+ private:
+ QuickSelectionEngine(); // never implemented
+ QuickSelectionEngine( const QuickSelectionEngine& ); // never implemented
+ QuickSelectionEngine& operator=( const QuickSelectionEngine& ); // never implemented
+ };
+
+//........................................................................
+} // namespace vcl
+//........................................................................
+
+#endif // VCL_QUICKSELECTIONENGINE_HXX
diff --git a/vcl/inc/vcl/saldatabasic.hxx b/vcl/inc/vcl/saldatabasic.hxx
index 1df2a701fd1a..a40cd045611c 100644
--- a/vcl/inc/vcl/saldatabasic.hxx
+++ b/vcl/inc/vcl/saldatabasic.hxx
@@ -32,11 +32,17 @@
#include <vcl/salinst.hxx>
#include <osl/module.h>
+namespace psp
+{
+ class PrinterInfoManager;
+}
+
class VCL_DLLPUBLIC SalData
{
public:
- SalInstance* m_pInstance; // pointer to instance
- oslModule m_pPlugin; // plugin library handle
+ SalInstance* m_pInstance; // pointer to instance
+ oslModule m_pPlugin; // plugin library handle
+ psp::PrinterInfoManager* m_pPIManager;
SalData();
virtual ~SalData();
diff --git a/vcl/inc/vcl/salgdi.hxx b/vcl/inc/vcl/salgdi.hxx
index f75817071304..d8276406746e 100644
--- a/vcl/inc/vcl/salgdi.hxx
+++ b/vcl/inc/vcl/salgdi.hxx
@@ -233,13 +233,13 @@ public:
// release the fonts
void ReleaseFonts() { SetFont( NULL, 0 ); }
// get the current font's metrics
- virtual void GetFontMetric( ImplFontMetricData* ) = 0;
+ virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel = 0 ) = 0;
// get kernign pairs of the current font
// return only PairCount if (pKernPairs == NULL)
virtual ULONG GetKernPairs( ULONG nMaxPairCount, ImplKernPairData* ) = 0;
// get the repertoire of the current font
- virtual ImplFontCharMap* GetImplFontCharMap() const = 0;
+ virtual const ImplFontCharMap* GetImplFontCharMap() const = 0;
// graphics must fill supplied font list
virtual void GetDevFontList( ImplDevFontList* ) = 0;
// graphics should call ImplAddDevFontSubstitute on supplied
diff --git a/vcl/inc/vcl/salinst.hxx b/vcl/inc/vcl/salinst.hxx
index 9b92bf95e3fe..71b820803473 100644
--- a/vcl/inc/vcl/salinst.hxx
+++ b/vcl/inc/vcl/salinst.hxx
@@ -60,6 +60,7 @@ struct SalItemParams;
class SalSession;
struct SystemGraphicsData;
struct SystemWindowData;
+class Menu;
namespace vos { class IMutex; }
@@ -133,6 +134,8 @@ public:
virtual vos::IMutex* GetYieldMutex() = 0;
virtual ULONG ReleaseYieldMutex() = 0;
virtual void AcquireYieldMutex( ULONG nCount ) = 0;
+ // return true, if yield mutex is owned by this thread, else false
+ virtual bool CheckYieldMutex() = 0;
// wait next event and dispatch
// must returned by UserEvent (SalFrame::PostEvent)
@@ -141,10 +144,10 @@ public:
virtual bool AnyInput( USHORT nType ) = 0;
// Menues
- virtual SalMenu* CreateMenu( BOOL bMenuBar ) = 0;
- virtual void DestroyMenu( SalMenu* pMenu) = 0;
- virtual SalMenuItem* CreateMenuItem( const SalItemParams* pItemData ) = 0;
- virtual void DestroyMenuItem( SalMenuItem* pItem ) = 0;
+ virtual SalMenu* CreateMenu( BOOL bMenuBar, Menu* pMenu );
+ virtual void DestroyMenu( SalMenu* pMenu);
+ virtual SalMenuItem* CreateMenuItem( const SalItemParams* pItemData );
+ virtual void DestroyMenuItem( SalMenuItem* pItem );
// may return NULL to disable session management
virtual SalSession* CreateSalSession() = 0;
diff --git a/vcl/inc/vcl/smartid.hxx b/vcl/inc/vcl/smartid.hxx
deleted file mode 100755
index 2cc5f347b2cb..000000000000
--- a/vcl/inc/vcl/smartid.hxx
+++ /dev/null
@@ -1,87 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _SMARTID_HXX_
-#define _SMARTID_HXX_
-
-#include <tools/string.hxx>
-#include <vcl/dllapi.h>
-
-/// SMART_SET_SMART only sets the Ids that are defined in the SmartId
-/// the other types set whatever is given. This can also be used to reset an Id
-enum SmartIdUpdateMode { SMART_SET_SMART, SMART_SET_NUM, SMART_SET_STR, SMART_SET_ALL };
-
-struct ImplSmartIdData;
-
-/*
-
-SmartId is a substitute for Numeric HelpIds. They can handle Numeric and String HelpIds and offer commonly needed operators.
-
-Matching Ids:
-if part of an Id is not set (HasNumeric HasString is False) then this part will never match to anything. Not even unset values
-
-*/
-class VCL_DLLPUBLIC SmartId
-{
-private:
- ImplSmartIdData* mpData;
- SAL_DLLPRIVATE ImplSmartIdData* GetSmartIdData();
-
-public:
- explicit SmartId( const String& rId );
- explicit SmartId( ULONG nId );
- SmartId( const String& rId, ULONG nId );
-
- SmartId();
-
- SmartId( const SmartId& rId );
- SmartId& operator = ( const SmartId& rId );
-
- ~SmartId();
-
- void UpdateId( const SmartId& rId, SmartIdUpdateMode aMode = SMART_SET_SMART );
-
- BOOL HasNumeric() const;
- BOOL HasString() const;
- BOOL HasAny() const;
- ULONG GetNum() const;
- String GetStr() const;
-
- String GetText() const; /// return String for UI usage
-
- BOOL Matches( const String &rId )const;
- BOOL Matches( const ULONG nId ) const;
-/// In case both Ids have both values set only the StringId is used for Matching
- BOOL Matches( const SmartId &rId ) const;
-
- BOOL Equals( const SmartId &rId ) const;
-
- BOOL operator == ( const SmartId& rRight ) const;
- BOOL operator < ( const SmartId& rRight ) const;
-};
-
-#endif
diff --git a/vcl/inc/vcl/splitwin.hxx b/vcl/inc/vcl/splitwin.hxx
index 4aa1ca16785c..f028c6969b16 100644
--- a/vcl/inc/vcl/splitwin.hxx
+++ b/vcl/inc/vcl/splitwin.hxx
@@ -201,6 +201,18 @@ public:
BOOL bPropGreat = FALSE );
void SetItemSize( USHORT nId, long nNewSize );
long GetItemSize( USHORT nId ) const;
+ /** Set a range that limits the (variable part of the) size with an
+ upper and a lower bound (both are valid values themselves.)
+ @param nId
+ Id of the item for which the size limits are set.
+ @param aRange
+ Values of -1 define missing bounds, thus setting a range (-1,-1)
+ (the default) removes the size limitiation.
+ */
+ void SetItemSizeRange (USHORT nId, const Range aRange);
+ /** Return the current size limits for the specified item.
+ */
+ Range GetItemSizeRange (USHORT nId) const;
long GetItemSize( USHORT nId, SplitWindowItemBits nBits ) const;
void SetItemBits( USHORT nId, SplitWindowItemBits nNewBits );
SplitWindowItemBits GetItemBits( USHORT nId ) const;
diff --git a/vcl/inc/vcl/status.hxx b/vcl/inc/vcl/status.hxx
index 810ecf230960..907d08272cbb 100644
--- a/vcl/inc/vcl/status.hxx
+++ b/vcl/inc/vcl/status.hxx
@@ -183,8 +183,8 @@ public:
using Window::GetQuickHelpText;
const XubString& GetQuickHelpText( USHORT nItemId ) const;
- void SetHelpId( USHORT nItemId, ULONG nHelpId );
- ULONG GetHelpId( USHORT nItemId ) const;
+ void SetHelpId( USHORT nItemId, const rtl::OString& rHelpId );
+ rtl::OString GetHelpId( USHORT nItemId ) const;
void SetBottomBorder( BOOL bBottomBorder = TRUE );
BOOL IsBottomBorder() const { return mbBottomBorder; }
@@ -205,9 +205,9 @@ public:
const XubString& GetHelpText() const
{ return Window::GetHelpText(); }
- void SetHelpId( ULONG nId )
- { Window::SetHelpId( nId ); }
- ULONG GetHelpId() const
+ void SetHelpId( const rtl::OString& rId )
+ { Window::SetHelpId( rId ); }
+ const rtl::OString& GetHelpId() const
{ return Window::GetHelpId(); }
Size CalcWindowSizePixel() const;
diff --git a/vcl/inc/vcl/svdata.hxx b/vcl/inc/vcl/svdata.hxx
index 9787b1f6e58c..67aa6806be49 100644
--- a/vcl/inc/vcl/svdata.hxx
+++ b/vcl/inc/vcl/svdata.hxx
@@ -28,20 +28,19 @@
#ifndef _SV_SVDATA_HXX
#define _SV_SVDATA_HXX
-#ifndef _VOS_THREAD_HXX
-#include <vos/thread.hxx>
-#endif
-#include <tools/string.hxx>
-#include <tools/gen.hxx>
-#include <tools/shl.hxx>
-#include <tools/link.hxx>
-#include <vcl/vclevent.hxx>
-#include <vcl/sv.h>
-#include <tools/color.hxx>
-#include <tools/debug.hxx>
-#include <vcl/dllapi.h>
-#include <com/sun/star/uno/Reference.hxx>
-#include <unotools/options.hxx>
+#include "vos/thread.hxx"
+#include "tools/string.hxx"
+#include "tools/gen.hxx"
+#include "tools/shl.hxx"
+#include "tools/link.hxx"
+#include "tools/fldunit.hxx"
+#include "vcl/vclevent.hxx"
+#include "vcl/sv.h"
+#include "tools/color.hxx"
+#include "tools/debug.hxx"
+#include "vcl/dllapi.h"
+#include "com/sun/star/uno/Reference.hxx"
+#include "unotools/options.hxx"
namespace com {
namespace sun {
@@ -168,6 +167,8 @@ struct ImplSVAppData
BOOL mbDialogCancel; // TRUE: Alle Dialog::Execute()-Aufrufe werden mit return FALSE sofort beendet
BOOL mbNoYield; // Application::Yield will not wait for events if the queue is empty
// essentially that makes it the same as Application::Reschedule
+ long mnDefaultLayoutBorder; // default value in pixel for layout distances used
+ // in window arrangers
/** Controls whether showing any IME status window is toggled on or off.
@@ -208,7 +209,6 @@ struct ImplSVGDIData
BOOL mbFontSubChanged; // TRUE: FontSubstitution wurde zwischen Begin/End geaendert
utl::DefaultFontConfiguration* mpDefaultFontConfiguration;
utl::FontSubstConfiguration* mpFontSubstConfiguration;
- bool mbPrinterPullModel; // true: use pull model instead of normal push model when printing
bool mbNativeFontConfig; // true: do not override UI font
bool mbNoXORClipping; // true: do not use XOR to achieve clipping effects
};
@@ -248,6 +248,8 @@ struct ImplSVWinData
// - ImplSVCtrlData -
// ------------------
+typedef std::vector< std::pair< String, FieldUnit > > FieldUnitStringList;
+
struct ImplSVCtrlData
{
ImageList* mpCheckImgList; // ImageList for CheckBoxes
@@ -271,6 +273,8 @@ struct ImplSVCtrlData
ULONG mnLastRadioFColor; // Letzte FaceColor fuer RadioImage
ULONG mnLastRadioWColor; // Letzte WindowColor fuer RadioImage
ULONG mnLastRadioLColor; // Letzte LightColor fuer RadioImage
+ FieldUnitStringList* mpFieldUnitStrings; // list with field units
+ FieldUnitStringList* mpCleanUnitStrings; // same list but with some "fluff" like spaces removed
};
@@ -318,10 +322,8 @@ struct ImplSVNWFData
// window background before drawing the native
// checkbox
bool mbScrollbarJumpPage; // true for "jump to here" behavior
+ int mnStatusBarLowerRightOffset; // amount in pixel to avoid in the lower righthand corner
bool mbCanDrawWidgetAnySize; // set to true currently on gtk
- // signals that widgets can be drawn in any size and
- // brdwin.cxx ImplSmallBorderWindowView::DrawWindow
- // should not do GetNativeControlRegion
};
@@ -395,6 +397,10 @@ inline ImplSVData* ImplGetAppSVData() { return ImplGetSVData(); }
bool ImplInitAccessBridge( BOOL bAllowCancel, BOOL &rCancelled );
+FieldUnitStringList* ImplGetFieldUnits();
+FieldUnitStringList* ImplGetCleanedFieldUnits();
+
+
// -----------------------------------------------------------------------
// -----------------
diff --git a/vcl/inc/vcl/svids.hrc b/vcl/inc/vcl/svids.hrc
index 059ed1524b7c..e915644aa8ec 100644
--- a/vcl/inc/vcl/svids.hrc
+++ b/vcl/inc/vcl/svids.hrc
@@ -122,8 +122,10 @@
#define SV_PRINT_PRT_NUP_ORIENTATION_PORTRAIT 1
#define SV_PRINT_PRT_NUP_ORIENTATION_LANDSCAPE 2
-#define SV_PRINT_PRT_NUP_ORDER_LRTD 0
-#define SV_PRINT_PRT_NUP_ORDER_TDLR 1
+#define SV_PRINT_PRT_NUP_ORDER_LRTB 0
+#define SV_PRINT_PRT_NUP_ORDER_TBLR 1
+#define SV_PRINT_PRT_NUP_ORDER_TBRL 2
+#define SV_PRINT_PRT_NUP_ORDER_RLTB 3
#define SV_PRINT_TAB_JOB 2
#define SV_PRINT_PRINTERS_FL 1
@@ -212,7 +214,8 @@
#define SV_ACCESSERROR_JAVA_NOT_CONFIGURED 10507
#define SV_ACCESSERROR_JAVA_DISABLED 10508
#define SV_ACCESSERROR_TURNAROUND_MSG 10509
-#define SV_ACCESSERROR_LAST SV_ACCESSERROR_TURNAROUND_MSG
+#define SV_ACCESSERROR_NO_FONTS 10510
+#define SV_ACCESSERROR_LAST SV_ACCESSERROR_NO_FONTS
#define SV_SHORTCUT_HELP 10600
#define SV_SHORTCUT_CONTEXTHELP 10601
diff --git a/vcl/inc/vcl/syschild.hxx b/vcl/inc/vcl/syschild.hxx
index da4ffcd51a22..e914adbdffed 100644
--- a/vcl/inc/vcl/syschild.hxx
+++ b/vcl/inc/vcl/syschild.hxx
@@ -44,6 +44,7 @@ class VCL_DLLPUBLIC SystemChildWindow : public Window
private:
using Window::ImplInit;
SAL_DLLPRIVATE void ImplInitSysChild( Window* pParent, WinBits nStyle, SystemWindowData *pData, BOOL bShow = FALSE );
+ SAL_DLLPRIVATE void ImplTestJavaException( void* pEnv );
// Copy assignment is forbidden and not implemented.
SAL_DLLPRIVATE SystemChildWindow (const SystemChildWindow &);
@@ -62,6 +63,11 @@ public:
// however, this might not always be required
void EnableEraseBackground( BOOL bEnable = TRUE );
BOOL IsEraseBackgroundEnabled();
+
+ // return the platform specific handle/id of this window;
+ // in case the flag bUseJava is set, a java compatible overlay window
+ // is created on which other java windows can be created (plugin interface)
+ sal_IntPtr GetParentWindowHandle( sal_Bool bUseJava = sal_False );
};
#endif // _SV_SYSCHILD_HXX
diff --git a/vcl/inc/vcl/tabctrl.hxx b/vcl/inc/vcl/tabctrl.hxx
index 4c63b12f15fe..ad702ac4dc54 100644
--- a/vcl/inc/vcl/tabctrl.hxx
+++ b/vcl/inc/vcl/tabctrl.hxx
@@ -70,7 +70,6 @@ private:
BOOL mbRestoreUnqId;
BOOL mbSingleLine;
BOOL mbScroll;
- BOOL mbRestoreSmartId;
BOOL mbSmallInvalidate;
BOOL mbExtraSpace;
Link maActivateHdl;
@@ -177,8 +176,8 @@ public:
void SetHelpText( USHORT nPageId, const XubString& rText );
const XubString& GetHelpText( USHORT nPageId ) const;
- void SetHelpId( USHORT nPageId, ULONG nHelpId );
- ULONG GetHelpId( USHORT nPageId ) const;
+ void SetHelpId( USHORT nPageId, const rtl::OString& rHelpId );
+ rtl::OString GetHelpId( USHORT nPageId ) const;
void SetPageImage( USHORT nPageId, const Image& rImage );
const Image* GetPageImage( USHORT nPageId ) const;
@@ -188,9 +187,9 @@ public:
const XubString& GetHelpText() const
{ return Control::GetHelpText(); }
- void SetHelpId( ULONG nId )
- { Control::SetHelpId( nId ); }
- ULONG GetHelpId() const
+ void SetHelpId( const rtl::OString& rId )
+ { Control::SetHelpId( rId ); }
+ const rtl::OString& GetHelpId() const
{ return Control::GetHelpId(); }
void SetActivatePageHdl( const Link& rLink ) { maActivateHdl = rLink; }
diff --git a/vcl/inc/vcl/toolbox.h b/vcl/inc/vcl/toolbox.h
index 33e4e8d2e013..7cdeb0b17a5a 100644
--- a/vcl/inc/vcl/toolbox.h
+++ b/vcl/inc/vcl/toolbox.h
@@ -68,7 +68,7 @@ struct ImplToolItem
XubString maQuickHelpText;
XubString maHelpText;
String maCommandStr;
- ULONG mnHelpId;
+ rtl::OString maHelpId;
Rectangle maRect;
Rectangle maCalcRect;
// the overall horizontal item size, including one or more of [image size + textlength + dropdown arrow]
diff --git a/vcl/inc/vcl/toolbox.hxx b/vcl/inc/vcl/toolbox.hxx
index 5cc102842dc3..aa7ddd886bbb 100644
--- a/vcl/inc/vcl/toolbox.hxx
+++ b/vcl/inc/vcl/toolbox.hxx
@@ -511,8 +511,8 @@ public:
void SetHelpText( USHORT nItemId, const XubString& rText );
const XubString& GetHelpText( USHORT nItemId ) const;
- void SetHelpId( USHORT nItemId, ULONG nHelpId );
- ULONG GetHelpId( USHORT nItemId ) const;
+ void SetHelpId( USHORT nItemId, const rtl::OString& rHelpId );
+ rtl::OString GetHelpId( USHORT nItemId ) const;
// window size according to current alignment, floating state and number of lines
Size CalcWindowSizePixel() const;
@@ -569,9 +569,9 @@ public:
const XubString& GetHelpText() const
{ return DockingWindow::GetHelpText(); }
- void SetHelpId( ULONG nId )
- { DockingWindow::SetHelpId( nId ); }
- ULONG GetHelpId() const
+ void SetHelpId( const rtl::OString& rId )
+ { DockingWindow::SetHelpId( rId ); }
+ const rtl::OString& GetHelpId() const
{ return DockingWindow::GetHelpId(); }
void SetClickHdl( const Link& rLink ) { maClickHdl = rLink; }
diff --git a/vcl/inc/vcl/window.h b/vcl/inc/vcl/window.h
index c12dcd618d92..73b6f1078ca9 100644
--- a/vcl/inc/vcl/window.h
+++ b/vcl/inc/vcl/window.h
@@ -56,7 +56,7 @@ class VirtualDevice;
class Cursor;
class ImplDevFontList;
class ImplFontCache;
-class SmartId;
+class SalControlHandle;
class VCLXWindow;
class SalFrame;
class SalObject;
@@ -99,7 +99,10 @@ namespace dnd {
class XDropTarget;
} } } } }
-namespace vcl { struct ControlLayoutData; }
+namespace vcl {
+ struct ControlLayoutData;
+ struct ExtWindowImpl;
+}
@@ -120,8 +123,6 @@ struct ImplWinData
USHORT mnIsTopWindow;
BOOL mbMouseOver; // tracks mouse over for native widget paint effect
BOOL mbEnableNativeWidget; // toggle native widget rendering
- SmartId* mpSmartHelpId;
- SmartId* mpSmartUniqueId;
::std::list< Window* >
maTopWindowChildren;
};
@@ -239,6 +240,7 @@ public:
ImplDelData* mpFirstDel;
void* mpUserData;
+ vcl::ExtWindowImpl* mpExtImpl;
Cursor* mpCursor;
Pointer maPointer;
Fraction maZoom;
@@ -254,8 +256,8 @@ public:
long mnY;
long mnAbsScreenX;
Point maPos;
- ULONG mnHelpId;
- ULONG mnUniqId;
+ rtl::OString maHelpId;
+ rtl::OString maUniqId;
XubString maHelpText;
XubString maQuickHelpText;
InputContext maInputContext;
diff --git a/vcl/inc/vcl/window.hxx b/vcl/inc/vcl/window.hxx
index a7628da0b408..fa136f6d514d 100644..100755
--- a/vcl/inc/vcl/window.hxx
+++ b/vcl/inc/vcl/window.hxx
@@ -50,7 +50,7 @@
#include <rtl/ustring.hxx>
#include <cppuhelper/weakref.hxx>
#include <com/sun/star/uno/Reference.hxx>
-#include <vcl/smartid.hxx>
+#include <boost/shared_ptr.hpp>
class VirtualDevice;
struct ImplDelData;
@@ -95,6 +95,13 @@ namespace accessibility {
namespace com {
namespace sun {
namespace star {
+namespace beans {
+ struct PropertyValue;
+}}}}
+
+namespace com {
+namespace sun {
+namespace star {
namespace rendering {
class XCanvas;
class XSpriteCanvas;
@@ -122,7 +129,11 @@ namespace dnd {
class XDropTarget;
} } } } }
-namespace vcl { struct ControlLayoutData; }
+namespace vcl {
+ struct ControlLayoutData;
+ class WindowArranger;
+ struct ExtWindowImpl;
+}
namespace svt { class PopupWindowControllerImpl; }
@@ -476,6 +487,10 @@ public:
SAL_DLLPRIVATE BOOL ImplUpdatePos();
SAL_DLLPRIVATE void ImplUpdateSysObjPos();
SAL_DLLPRIVATE WindowImpl* ImplGetWindowImpl() const { return mpWindowImpl; }
+ SAL_DLLPRIVATE void ImplFreeExtWindowImpl();
+ // creates ExtWindowImpl on demand, but may return NULL (e.g. if mbInDtor)
+ SAL_DLLPRIVATE vcl::ExtWindowImpl* ImplGetExtWindowImpl() const;
+ SAL_DLLPRIVATE void ImplDeleteOwnedChildren();
/** check whether a font is suitable for UI
The font to be tested will be checked whether it could display a
@@ -541,6 +556,7 @@ public:
SAL_DLLPRIVATE BOOL ImplRegisterAccessibleNativeFrame();
SAL_DLLPRIVATE void ImplRevokeAccessibleNativeFrame();
SAL_DLLPRIVATE void ImplCallResize();
+ SAL_DLLPRIVATE void ImplExtResize();
SAL_DLLPRIVATE void ImplCallMove();
SAL_DLLPRIVATE Rectangle ImplOutputToUnmirroredAbsoluteScreenPixel( const Rectangle& rRect ) const;
SAL_DLLPRIVATE void ImplMirrorFramePos( Point &pt ) const;
@@ -599,6 +615,7 @@ public:
virtual void KeyUp( const KeyEvent& rKEvt );
virtual void PrePaint();
virtual void Paint( const Rectangle& rRect );
+ virtual void PostPaint();
virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
virtual void Move();
virtual void Resize();
@@ -953,16 +970,12 @@ public:
void SetQuickHelpText( const XubString& rHelpText );
const XubString& GetQuickHelpText() const;
- void SetHelpId( ULONG nHelpId ); /// deprecated
- ULONG GetHelpId() const; /// deprecated
- void SetSmartHelpId( const SmartId& aId, SmartIdUpdateMode aMode = SMART_SET_SMART );
- SmartId GetSmartHelpId() const;
+ void SetHelpId( const rtl::OString& );
+ const rtl::OString& GetHelpId() const;
- void SetUniqueId( ULONG nUniqueId ); /// deprecated
- ULONG GetUniqueId() const; /// deprecated
- void SetSmartUniqueId( const SmartId& aId, SmartIdUpdateMode aMode = SMART_SET_SMART );
- SmartId GetSmartUniqueId() const;
- SmartId GetSmartUniqueOrHelpId() const;
+ void SetUniqueId( const rtl::OString& );
+ const rtl::OString& GetUniqueId() const;
+ const rtl::OString& GetUniqueOrHelpId() const;
Window* FindWindow( const Point& rPos ) const;
@@ -1106,6 +1119,56 @@ public:
virtual XubString GetSurroundingText() const;
virtual Selection GetSurroundingTextSelection() const;
+
+ // ExtImpl
+
+ // layouting
+ boost::shared_ptr< vcl::WindowArranger > getLayout();
+
+ /* add a child Window
+ addWindow will do the following things
+ - insert the passed window into the child list (equivalent to i_pWin->SetParent( this ))
+ - mark the window as "owned", meaning that the added Window will be destroyed by
+ the parent's desctructor.
+ This means: do not pass in member windows or stack objects here. Do not cause
+ the destructor of the added window to be called in any way.
+
+ to avoid ownership pass i_bTakeOwnership as "false"
+ */
+ void addWindow( Window* i_pWin, bool i_bTakeOwnership = true );
+
+ /* remove a child Window
+ the remove window functions will
+ - reparent the searched window (equivalent to i_pWin->SetParent( i_pNewParent ))
+ - return a pointer to the removed window or NULL if i_pWin was not found
+ caution: ownership passes to the new parent or the caller, if the new parent was NULL
+ */
+ Window* removeWindow( Window* i_pWin, Window* i_pNewParent = NULL );
+
+ /* return the identifier of this window
+ */
+ const rtl::OUString& getIdentifier() const;
+ /* set an identifier
+ identifiers have only loosely defined rules per se
+ in context of Window they must be unique over the window
+ hierarchy you'd like to find them again using the findWindow method
+ */
+ void setIdentifier( const rtl::OUString& );
+
+ /* returns the first found descendant that matches
+ the passed identifier or NULL
+ */
+ Window* findWindow( const rtl::OUString& ) const;
+
+ /* get/set properties
+ this will contain window properties (like visible, enabled)
+ as well as properties of derived classes (e.g. text of Edit fields)
+ */
+ virtual com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > getProperties() const;
+ /*
+ */
+ virtual void setProperties( const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& );
+
};
diff --git a/svl/inc/pickerhelper.hxx b/vcl/inc/vcl/wpropset.hxx
index 307031b578d1..409b629496e6 100644
--- a/svl/inc/pickerhelper.hxx
+++ b/vcl/inc/vcl/wpropset.hxx
@@ -25,45 +25,42 @@
*
************************************************************************/
-#ifndef _PICKERHELPER_HXX
-#define _PICKERHELPER_HXX
+#ifndef VCL_WPROPSET_HXX
+#define VCL_WPROPSET_HXX
-#include "svl/svldllapi.h"
-#include "sal/types.h"
-#include "com/sun/star/uno/Reference.hxx"
+#include "vcl/dllapi.h"
-namespace com
+#include "tools/link.hxx"
+#include "vcl/arrange.hxx"
+
+#include "com/sun/star/beans/XPropertySet.hpp"
+
+class VclWindowEvent;
+
+namespace vcl
{
- namespace sun
+ class WindowPropertySetData;
+ class WindowPropertySetListener;
+
+ class VCL_DLLPUBLIC WindowPropertySet
{
- namespace star
- {
- namespace ui
- {
- namespace dialogs
- {
- class XFilePicker;
- class XFolderPicker;
- }
- }
- }
- }
-}
+ WindowPropertySetData* mpImpl;
+ void addWindowToSet( Window* );
+ void addLayoutToSet( const boost::shared_ptr<WindowArranger>& );
+ void setupProperties();
-namespace svt
-{
+ DECL_LINK( ChildEventListener, VclWindowEvent* );
- SVL_DLLPUBLIC void SetDialogHelpId(
- ::com::sun::star::uno::Reference < ::com::sun::star::ui::dialogs::XFilePicker > _mxFileDlg,
- sal_Int32 _nHelpId );
+ void propertyChange( const com::sun::star::beans::PropertyChangeEvent& );
+ friend class vcl::WindowPropertySetListener;
- SVL_DLLPUBLIC void SetDialogHelpId(
- ::com::sun::star::uno::Reference < ::com::sun::star::ui::dialogs::XFolderPicker > _mxFileDlg,
- sal_Int32 _nHelpId );
+ public:
+ WindowPropertySet( Window* i_pTopWindow, bool i_bTakeOwnership );
+ ~WindowPropertySet();
+ com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > getPropertySet() const;
+ };
}
-//-----------------------------------------------------------------------------
-
#endif
diff --git a/vcl/os2/inc/salgdi.h b/vcl/os2/inc/salgdi.h
index cf05ff15d7e2..94b2b98b4183 100644
--- a/vcl/os2/inc/salgdi.h
+++ b/vcl/os2/inc/salgdi.h
@@ -74,7 +74,7 @@ public:
bool AliasSymbolsHigh() const { return mbAliasSymbolsHigh; }
bool AliasSymbolsLow() const { return mbAliasSymbolsLow; }
- ImplFontCharMap* GetImplFontCharMap() const;
+ const ImplFontCharMap* GetImplFontCharMap() const;
private:
sal_IntPtr mnId;
@@ -82,7 +82,7 @@ private:
mutable bool mbHasKoreanRange;
mutable bool mbHasCJKSupport;
- mutable ImplFontCharMap* mpUnicodeMap;
+ mutable const ImplFontCharMap* mpUnicodeMap;
// TODO: get rid of the members below needed to work with the Win9x non-unicode API
BYTE* mpFontCharSets; // all Charsets for the current font (used on W98 for kerning)
diff --git a/vcl/os2/inc/salinst.h b/vcl/os2/inc/salinst.h
index 0948f605c286..7826a62e1f9b 100644
--- a/vcl/os2/inc/salinst.h
+++ b/vcl/os2/inc/salinst.h
@@ -85,12 +85,9 @@ public:
virtual vos::IMutex* GetYieldMutex();
virtual ULONG ReleaseYieldMutex();
virtual void AcquireYieldMutex( ULONG nCount );
+ virtual bool CheckYieldMutex();
virtual void Yield( bool, bool );
virtual bool AnyInput( USHORT nType );
- virtual SalMenu* CreateMenu( BOOL bMenuBar );
- virtual void DestroyMenu( SalMenu* );
- virtual SalMenuItem* CreateMenuItem( const SalItemParams* pItemData );
- virtual void DestroyMenuItem( SalMenuItem* );
virtual SalSession* CreateSalSession();
virtual void* GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes );
virtual void AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType);
diff --git a/vcl/os2/source/app/salinst.cxx b/vcl/os2/source/app/salinst.cxx
index b08a9769ccf4..df564f36ee0a 100644
--- a/vcl/os2/source/app/salinst.cxx
+++ b/vcl/os2/source/app/salinst.cxx
@@ -298,10 +298,9 @@ void ImplSalAcquireYieldMutex( ULONG nCount )
// -----------------------------------------------------------------------
-#ifdef DBG_UTIL
-
-void ImplDbgTestSolarMutex()
+bool Os2SalInstance::CheckYieldMutex()
{
+ bool bRet = true;
SalData* pSalData = GetSalData();
ULONG nCurThreadId = GetCurrentThreadId();
if ( pSalData->mnAppThreadId != nCurThreadId )
@@ -311,7 +310,7 @@ void ImplDbgTestSolarMutex()
SalYieldMutex* pYieldMutex = pSalData->mpFirstInstance->mpSalYieldMutex;
if ( pYieldMutex->mnThreadId != nCurThreadId )
{
- DBG_ERROR( "SolarMutex not locked, and not thread save code in VCL is called from outside of the main thread" );
+ bRet = false;
}
}
}
@@ -322,14 +321,13 @@ void ImplDbgTestSolarMutex()
SalYieldMutex* pYieldMutex = pSalData->mpFirstInstance->mpSalYieldMutex;
if ( pYieldMutex->mnThreadId != nCurThreadId )
{
- DBG_ERROR( "SolarMutex not locked in the main thread" );
+ bRet = false;
}
}
}
+ return bRet;
}
-#endif
-
// =======================================================================
void InitSalData()
diff --git a/vcl/os2/source/gdi/salgdi3.cxx b/vcl/os2/source/gdi/salgdi3.cxx
index e25e68ee5a4c..0e4cb1d58b0f 100644
--- a/vcl/os2/source/gdi/salgdi3.cxx
+++ b/vcl/os2/source/gdi/salgdi3.cxx
@@ -434,9 +434,8 @@ bool ImplOs2FontData::IsGSUBstituted( sal_Ucs cChar ) const
// -----------------------------------------------------------------------
-ImplFontCharMap* ImplOs2FontData::GetImplFontCharMap() const
+const ImplFontCharMap* ImplOs2FontData::GetImplFontCharMap() const
{
- mpUnicodeMap->AddReference();
return mpUnicodeMap;
}
@@ -592,6 +591,7 @@ void ImplOs2FontData::ReadCmapTable( HPS hPS ) const
aResult.mpPairCodes, aResult.mpStartGlyphs );
else
mpUnicodeMap = ImplFontCharMap::GetDefaultMap();
+ mpUnicodeMap->AddReference();
}
// =======================================================================
@@ -999,10 +999,10 @@ ULONG Os2SalGraphics::GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs )
// -----------------------------------------------------------------------
-static ImplFontCharMap* pOs2DefaultImplFontCharMap = NULL;
+static const ImplFontCharMap* pOs2DefaultImplFontCharMap = NULL;
static const sal_uInt32 pOs2DefaultRangeCodes[] = {0x0020,0x00FF};
-ImplFontCharMap* Os2SalGraphics::GetImplFontCharMap() const
+const ImplFontCharMap* Os2SalGraphics::GetImplFontCharMap() const
{
if( !mpOs2FontData[0] )
return ImplFontCharMap::GetDefaultMap();
@@ -1705,7 +1705,7 @@ void Os2SalGraphics::GetGlyphWidths( const ImplFontData* pFont,
rUnicodeEnc.clear();
}
const ImplOs2FontData* pWinFont = static_cast<const ImplOs2FontData*>(pFont);
- ImplFontCharMap* pMap = pWinFont->GetImplFontCharMap();
+ const ImplFontCharMap* pMap = pWinFont->GetImplFontCharMap();
DBG_ASSERT( pMap && pMap->GetCharCount(), "no map" );
int nCharCount = pMap->GetCharCount();
diff --git a/vcl/os2/source/window/makefile.mk b/vcl/os2/source/window/makefile.mk
index f4a6ad0cb870..560d35880b21 100644
--- a/vcl/os2/source/window/makefile.mk
+++ b/vcl/os2/source/window/makefile.mk
@@ -40,7 +40,7 @@ CXXFILES__YD= salframe.cxx \
salobj.cxx
SLOFILES= $(SLO)$/salframe.obj \
- $(SLO)$/salobj.obj $(SLO)$/salmenu.obj
+ $(SLO)$/salobj.obj
# --- Targets ------------------------------------------------------
diff --git a/vcl/os2/source/window/salmenu.cxx b/vcl/os2/source/window/salmenu.cxx
deleted file mode 100644
index 339ab5dbfadb..000000000000
--- a/vcl/os2/source/window/salmenu.cxx
+++ /dev/null
@@ -1,132 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#define INCL_DOS
-#define INCL_PM
-#define INCL_WIN
-#include <svpm.h>
-#include <saldata.hxx>
-#include <salinst.h>
-#include <salmenu.h>
-
-
-// =======================================================================
-
-// Os2SalInst factory methods
-
-SalMenu* Os2SalInstance::CreateMenu( BOOL bMenuBar )
-{
- return NULL; // no support for native menues
-}
-
-void Os2SalInstance::DestroyMenu( SalMenu* pSalMenu )
-{
- delete pSalMenu;
-}
-
-
-SalMenuItem* Os2SalInstance::CreateMenuItem( const SalItemParams* pItemData )
-{
- return NULL; // no support for native menues
-}
-
-void Os2SalInstance::DestroyMenuItem( SalMenuItem* pSalMenuItem )
-{
- delete pSalMenuItem;
-}
-
-
-// =======================================================================
-
-
-/*
- * Os2SalMenu
- */
-
-
-Os2SalMenu::~Os2SalMenu()
-{
-}
-
-BOOL Os2SalMenu::VisibleMenuBar()
-{
- return FALSE;
-}
-
-void Os2SalMenu::SetFrame( const SalFrame *pFrame )
-{
-}
-
-void Os2SalMenu::InsertItem( SalMenuItem* pSalMenuItem, unsigned nPos )
-{
-}
-
-void Os2SalMenu::RemoveItem( unsigned nPos )
-{
-}
-
-void Os2SalMenu::SetSubMenu( SalMenuItem* pSalMenuItem, SalMenu* pSubMenu, unsigned nPos )
-{
-}
-
-void Os2SalMenu::CheckItem( unsigned nPos, BOOL bCheck )
-{
-}
-
-void Os2SalMenu::EnableItem( unsigned nPos, BOOL bEnable )
-{
-}
-
-void Os2SalMenu::SetItemImage( unsigned nPos, SalMenuItem* pSalMenuItem, const Image& rImage )
-{
-}
-
-void Os2SalMenu::SetItemText( unsigned nPos, SalMenuItem* pSalMenuItem, const XubString& rText )
-{
-}
-
-void Os2SalMenu::SetAccelerator( unsigned nPos, SalMenuItem* pSalMenuItem, const KeyCode& rKeyCode, const XubString& rKeyName )
-{
-}
-
-void Os2SalMenu::GetSystemMenuData( SystemMenuData* pData )
-{
-}
-
-// =======================================================================
-
-/*
- * SalMenuItem
- */
-
-
-Os2SalMenuItem::~Os2SalMenuItem()
-{
-}
-
-// -------------------------------------------------------------------
-
diff --git a/vcl/prj/build.lst b/vcl/prj/build.lst
index e6f636522acb..0a6f6a95f605 100644
--- a/vcl/prj/build.lst
+++ b/vcl/prj/build.lst
@@ -48,3 +48,10 @@ vc vcl\mac\source\src nmake - m vc__srcm vc_inc NULL
vc vcl\util nmake - all vc_util vc__plug.u vc__desk.u vc__aquy.u vc__appa.u vc__dtra.u vc__appm.m vc__appu.u vc__dtru.u vc__appw.w vc__appp.p vc__gdia.u vc__gdim.m vc__gdiu.u vc__gdiw.w vc__gdip.p vc__srcm.m vc__srcw.w vc__srcp.p vc__wina.u vc__winm.m vc__winu.u vc__winw.w vc__winp.p vc__gtka.u vc__gtky.u vc__gtkw.u vc__gtkg.u vc__kde.u vc__kde4.u vc__hl.u vc__ftmu.u vc__prgu.u vc__prnu.u vc_app vc_ctrl vc_gdi vc_hlp vc_src vc_win vc_glyphs vc_fts vc_components NULL
vc vcl\util\linksvp nmake - u vc_lsvp vc_util NULL
vc vcl\workben nmake - all vc_wrkb vc_util vc_salmain NULL
+
+# memCheck works only within unix
+# memCheck is not right yet
+# vc vcl\qa\complex\memCheck nmake - u vc_qa_complex vc_util NULL
+# GPF
+# vc vcl\qa\complex\persistent_window_states nmake - all vc_qa_complex vc_util NULL
+
diff --git a/vcl/prj/d.lst b/vcl/prj/d.lst
index 38c025b5a5af..6d452e8ee43f 100644
--- a/vcl/prj/d.lst
+++ b/vcl/prj/d.lst
@@ -17,6 +17,7 @@ mkdir: %_DEST%\inc%_EXT%\vcl
..\inc\vcl\alpha.hxx %_DEST%\inc%_EXT%\vcl\alpha.hxx
..\inc\vcl\animate.hxx %_DEST%\inc%_EXT%\vcl\animate.hxx
..\inc\vcl\apptypes.hxx %_DEST%\inc%_EXT%\vcl\apptypes.hxx
+..\inc\vcl\arrange.hxx %_DEST%\inc%_EXT%\vcl\arrange.hxx
..\inc\vcl\bitmap.hxx %_DEST%\inc%_EXT%\vcl\bitmap.hxx
..\inc\vcl\bitmapex.hxx %_DEST%\inc%_EXT%\vcl\bitmapex.hxx
..\inc\vcl\bmpacc.hxx %_DEST%\inc%_EXT%\vcl\bmpacc.hxx
@@ -77,6 +78,7 @@ mkdir: %_DEST%\inc%_EXT%\vcl
..\inc\vcl\metric.hxx %_DEST%\inc%_EXT%\vcl\metric.hxx
..\inc\vcl\mnemonic.hxx %_DEST%\inc%_EXT%\vcl\mnemonic.hxx
..\inc\vcl\mnemonicengine.hxx %_DEST%\inc%_EXT%\vcl\mnemonicengine.hxx
+..\inc\vcl\quickselectionengine.hxx %_DEST%\inc%_EXT%\vcl\quickselectionengine.hxx
..\inc\vcl\morebtn.hxx %_DEST%\inc%_EXT%\vcl\morebtn.hxx
..\inc\vcl\msgbox.hxx %_DEST%\inc%_EXT%\vcl\msgbox.hxx
..\inc\vcl\octree.hxx %_DEST%\inc%_EXT%\vcl\octree.hxx
@@ -143,7 +145,6 @@ mkdir: %_DEST%\inc%_EXT%\vcl
..\inc\vcl\pdfextoutdevdata.hxx %_DEST%\inc%_EXT%\vcl\pdfextoutdevdata.hxx
..\inc\vcl\pngread.hxx %_DEST%\inc%_EXT%\vcl\pngread.hxx
..\inc\vcl\pngwrite.hxx %_DEST%\inc%_EXT%\vcl\pngwrite.hxx
-..\inc\vcl\smartid.hxx %_DEST%\inc%_EXT%\vcl\smartid.hxx
..\inc\vcl\configsettings.hxx %_DEST%\inc%_EXT%\vcl\configsettings.hxx
..\inc\vcl\ImageListProvider.hxx %_DEST%\inc%_EXT%\vcl\ImageListProvider.hxx
..\inc\vcl\fontmanager.hxx %_DEST%\inc%_EXT%\vcl\fontmanager.hxx
@@ -153,3 +154,7 @@ mkdir: %_DEST%\inc%_EXT%\vcl
..\inc\vcl\helper.hxx %_DEST%\inc%_EXT%\vcl\helper.hxx
..\inc\vcl\strhelper.hxx %_DEST%\inc%_EXT%\vcl\strhelper.hxx
..\inc\vcl\lazydelete.hxx %_DEST%\inc%_EXT%\vcl\lazydelete.hxx
+..\inc\vcl\arrange.hxx %_DEST%\inc%_EXT%\vcl\arrange.hxx
+..\inc\vcl\wpropset.hxx %_DEST%\inc%_EXT%\vcl\wpropset.hxx
+..\%__SRC%\misc\vcl.component %_DEST%\xml%_EXT%\vcl.component
+
diff --git a/vcl/qa/complex/memCheck/CheckMemoryUsage.java b/vcl/qa/complex/memCheck/CheckMemoryUsage.java
index 9f8272240403..a089a1c99f54 100644
--- a/vcl/qa/complex/memCheck/CheckMemoryUsage.java
+++ b/vcl/qa/complex/memCheck/CheckMemoryUsage.java
@@ -32,19 +32,27 @@ import com.sun.star.lang.XComponent;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.util.XCloseable;
-import complexlib.ComplexTestCase;
+// import complexlib.ComplexTestCase;
import helper.ProcessHandler;
import java.io.File;
-import java.io.FilePermission;
+// import java.io.FilePermission;
import java.io.FileWriter;
import java.io.FilenameFilter;
import java.io.PrintWriter;
import java.util.Enumeration;
import java.util.StringTokenizer;
import java.util.Vector;
+import lib.*;
import util.DesktopTools;
-import util.WriterTools;
-import util.utils;
+// import util.WriterTools;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.openoffice.test.OfficeConnection;
+import static org.junit.Assert.*;
/**
* Documents are opened and exported with StarOffice. The memory usage of
@@ -66,95 +74,141 @@ import util.utils;
* All parameters are used for iteration over the test document path.
* </ul>
*/
-public class CheckMemoryUsage extends ComplexTestCase {
+class TempDir
+{
+
+ private String m_sTempDir;
+
+ public TempDir(String _sTempDir)
+ {
+ m_sTempDir = _sTempDir;
+ }
+
+ public String getOfficeTempDir()
+ {
+ return m_sTempDir;
+ }
+
+ public String getTempDir()
+ {
+ final String sTempDir = FileHelper.getJavaCompatibleFilename(m_sTempDir);
+ return sTempDir;
+ }
+}
+
+public class CheckMemoryUsage /* extends ComplexTestCase */
+
+{
+
private final String sWriterDoc = "sxw,writer_pdf_Export";
private final String sCalcDoc = "sxc,calc_pdf_Export";
private final String sImpressDoc = "sxi,impress_pdf_Export";
- private String sProcessId = "ps -ef | grep $USER | grep soffice | grep -v grep";
- private String sMemoryMonitor = "pmap <processID> | grep total";
- private String sChmod = "chmod 777 ";
- private String sProcessIdCommand = null;
- private String sOfficeMemoryCommand = null;
- private String sTempDir = null;
- private String sFS = null;
- private String sMemoryMap1 = null;
- private String sMemoryMap2 = null;
- private String bash = "#!/bin/bash";
- private String sDocumentPath = "";
+ // private String sProcessIdCommand = null;
+ TempDir m_aTempDir;
+ // private String sFS = null;
+ // private String sMemoryMap1 = null;
+ // private String sMemoryMap2 = null;
+ // private String sDocumentPath = "";
private String[][] sDocTypeExportFilter;
private String[][] sDocuments;
private int iAllowMemoryIncrease = 10;
private int iExportDocCount = 25;
+ /**
+ * The test parameters
+ */
+ private static TestParameters param = null;
/**
* Get all test methods
* @return The test methods.
- */
- public String[] getTestMethodNames() {
- return new String[] {"loadAndSaveDocuments"};
- }
-
+ // */
+// public String[] getTestMethodNames() {
+// return new String[] {"loadAndSaveDocuments"};
+// }
/**
* Collect all documnets to load and all filters used for export.
*/
- public void before() {
+ @Before
+ public void before()
+ {
+
+ final XMultiServiceFactory xMsf = getMSF();
+
+ // some Tests need the qadevOOo TestParameters, it is like a Hashmap for Properties.
+ param = new TestParameters();
+ param.put("ServiceFactory", xMsf); // some qadevOOo functions need the ServiceFactory
+
// test does definitely not run on Windows.
- if (param.get("OperatingSystem").equals("wntmsci")) {
- log.println("Test can only reasonably be executed with a tool that "
- + "displays the memory usage of StarOffice.");
- failed("Test does not run on Windows, only on Solaris or Linux.");
+ if (param.get("OperatingSystem").equals("wntmsci"))
+ {
+ System.out.println("Test can only reasonably be executed with a tool that "
+ + "displays the memory usage of StarOffice.");
+ System.out.println("Test does not run on Windows, only on Solaris or Linux.");
+ // in an automatic environment it is better to say, there is no error here.
+ // it is a limitation, but no error.
+ System.exit(0);
}
+
// how many times is every document exported.
int count = param.getInt("ExportDocCount");
if (count != 0)
+ {
iExportDocCount = count;
+ }
// get the temp dir for creating the command scripts.
- sTempDir = System.getProperty("java.io.tmpdir");
- sProcessIdCommand = sTempDir + "getPS";
- sOfficeMemoryCommand = sTempDir + "getPmap";
+ // sTempDir = System.getProperty("java.io.tmpdir");
+ m_aTempDir = new TempDir(util.utils.getOfficeTemp/*Dir*/(xMsf));
// get the file extension, export filter connection
Enumeration keys = param.keys();
- Vector v = new Vector();
- while(keys.hasMoreElements()) {
- String key = (String)keys.nextElement();
- if (key.startsWith("FileExportFilter")) {
- v.add(param.get(key));
+ Vector<String> v = new Vector<String>();
+ while (keys.hasMoreElements())
+ {
+ String key = (String) keys.nextElement();
+ if (key.startsWith("FileExportFilter"))
+ {
+ v.add((String) param.get(key));
}
}
// if no param given, set defaults.
- if (v.size() == 0){
+ if (v.size() == 0)
+ {
v.add(sWriterDoc);
v.add(sCalcDoc);
v.add(sImpressDoc);
}
// store a file extension
sDocTypeExportFilter = new String[v.size()][2];
- for (int i=0; i<v.size(); i++) {
+ for (int i = 0; i < v.size(); i++)
+ {
// 2do: error routine for wrong given params
- StringTokenizer t = new StringTokenizer((String)v.get(i), ",");
- sDocTypeExportFilter[i][0] = t.nextToken();
- sDocTypeExportFilter[i][1] = t.nextToken();
+ final String sVContent = v.get(i);
+ StringTokenizer t = new StringTokenizer(sVContent, ",");
+ final String sExt = t.nextToken();
+ final String sName = t.nextToken();
+ sDocTypeExportFilter[i][0] = sExt;
+ sDocTypeExportFilter[i][1] = sName;
}
// get files to load and export
- sDocumentPath = (String)param.get("TestDocumentPath");
- File f = new File(sDocumentPath);
- sDocumentPath = f.getAbsolutePath();
- String sFS = System.getProperty("file.separator");
+// sDocumentPath = (String) param.get("TestDocumentPath");
+ String sDocumentPath = TestDocument.getUrl();
+ File f = new File(FileHelper.getJavaCompatibleFilename(sDocumentPath));
+ // sDocumentPath = f.getAbsolutePath();
+ // String sFS = System.getProperty("file.separator");
sDocuments = new String[sDocTypeExportFilter.length][];
- for (int j=0; j<sDocTypeExportFilter.length; j++) {
+ for (int j = 0; j < sDocTypeExportFilter.length; j++)
+ {
FileFilter filter = new FileFilter(sDocTypeExportFilter[j][0]);
String[] doc = f.list(filter);
sDocuments[j] = new String[doc.length];
- for (int i=0; i<doc.length; i++) {
- if (sDocumentPath.endsWith(sFS))
- sDocuments[j][i] = sDocumentPath + doc[i];
- else
- sDocuments[j][i] = sDocumentPath + sFS + doc[i];
- sDocuments[j][i] = utils.getFullURL(sDocuments[j][i]);
+ for (int i = 0; i < doc.length; i++)
+ {
+ // final String sDocument = FileHelper.appendPath(sDocumentPath, doc[i]);
+ // sDocuments[j][i] = utils.getFullURL(sDocuments[j][i]);
+ sDocuments[j][i] = TestDocument.getUrl(doc[i]);
}
}
}
@@ -162,141 +216,323 @@ public class CheckMemoryUsage extends ComplexTestCase {
/**
* delete all created files on disk
*/
- public void after() {
+ @After
+ public void after()
+ {
// delete the constructed files.
- for (int i=0; i<iExportDocCount; i++) {
- File f = new File(sTempDir + "DocExport" + i + ".pdf");
- f.delete();
- }
- File f = new File(sProcessIdCommand);
- f.delete();
- f = new File(sOfficeMemoryCommand);
- f.delete();
+// we don't need to delete anything, all is stored in $USER_TREE
+// for (int i = 0; i < iExportDocCount; i++)
+// {
+// final String sDocumentName = "DocExport" + i + ".pdf";
+// final String sFilename = FileHelper.appendPath(m_sTempDir, sDocumentName);
+// File f = new File(FileHelper.getJavaCompatibleFilename(sFilename));
+// f.delete();
+// }
+ // File f = new File(sProcessIdCommand);
+ // f.delete();
+ // f = new File(sOfficeMemoryCommand);
+ // f.delete();
}
/**
- * Thet etst function: load documents and save them using the given filters
+ * The test function: load documents and save them using the given filters
* for each given document type.
*/
- public void loadAndSaveDocuments() {
- int storageBefore = getOfficeMemoryUsage();
+ @Test
+ public void loadAndSaveDocuments()
+ {
+ int nOk = 0;
+ int nRunThrough = 0;
- XMultiServiceFactory xMSF = (XMultiServiceFactory)param.getMSF();
+ // At first:
+ // we load the document, there will be some post work in office like late initialisations
+ // we store exact one time the document
+ // so the memory footprint should be right
// iterate over all document types
- for (int k=0; k<sDocTypeExportFilter.length; k++) {
+ for (int k = 0; k < sDocTypeExportFilter.length; k++)
+ {
// iterate over all documents of this type
- for (int i=0; i<sDocuments[k].length; i++) {
- System.out.println("Document: "+ sDocuments[k][i]);
- XComponent xComponent = DesktopTools.loadDoc(xMSF, sDocuments[k][i], null);
- XStorable xStorable = (XStorable)UnoRuntime.queryInterface(XStorable.class, xComponent);
- if (xStorable != null) {
- // export each document iExportDocCount times
- for (int j=0; j<iExportDocCount; j++) {
- String url = utils.getFullURL(sTempDir + "DocExport" + j + ".pdf");
- try {
- PropertyValue[] props = new PropertyValue[1];
- props[0] = new PropertyValue();
- props[0].Name = "FilterName";
- // use export filter for this doc type
- props[0].Value = sDocTypeExportFilter[k][1];
- xStorable.storeToURL(url, props);
- }
- catch(com.sun.star.io.IOException e) {
- failed("Could not store to '" + url + "'", true);
- }
- }
- // close the doc
- XCloseable xCloseable = (XCloseable)UnoRuntime.queryInterface(XCloseable.class, xStorable);
- try {
- xCloseable.close(true);
- }
- catch(com.sun.star.util.CloseVetoException e) {
- e.printStackTrace((java.io.PrintWriter)log);
- failed("Cannot close document: test is futile, Office will surely use more space.");
- }
- }
- else {
- log.println("Cannot query for XStorable interface on document '" + sDocuments[i] + "'");
- log.println(" -> Skipping storage.");
- }
+ for (int i = 0; i < sDocuments[k].length; i++)
+ {
+
+ final String sDocument = sDocuments[k][i];
+ final String sExtension = sDocTypeExportFilter[k][1];
+
+// OfficeMemchecker aChecker = new OfficeMemchecker();
+// aChecker.setDocumentName(FileHelper.getBasename(sDocument));
+// aChecker.setExtension(sExtension);
+// aChecker.start();
+
+ loadAndSaveNTimesDocument(sDocument, 1, sExtension);
+
+// nOk += checkMemory(aChecker);
+// nRunThrough ++;
}
+ System.out.println();
+ System.out.println();
}
- // short wait for the office to 'calm down' and free some memory
- shortWait(5000);
- // wait util memory is not freed anymore.
- int storageAfter = getOfficeMemoryUsage();
- int mem = 0;
- int count = 0;
- while (storageAfter != mem && count < 10) {
- count++;
- mem = storageAfter;
- storageAfter = getOfficeMemoryUsage();
- shortWait(1000);
- }
- assure("The Office consumes now " + (storageAfter - storageBefore)
- + "K more memory than at the start of the test; allowed were "
- + iAllowMemoryIncrease * iExportDocCount + "K.",
- storageAfter - storageBefore < iAllowMemoryIncrease * iExportDocCount);
+ shortWait(10000);
+
+ // Now the real test, load document and store 25 times
+
+ // iterate over all document types
+ for (int k = 0; k < sDocTypeExportFilter.length; k++)
+ {
+ // iterate over all documents of this type
+ for (int i = 0; i < sDocuments[k].length; i++)
+ {
+
+ final String sDocument = sDocuments[k][i];
+ final String sExtension = sDocTypeExportFilter[k][1];
+
+ OfficeMemchecker aChecker = new OfficeMemchecker();
+ aChecker.setDocumentName(FileHelper.getBasename(sDocument));
+ aChecker.setExtension(sExtension);
+ aChecker.start();
+
+ loadAndSaveNTimesDocument(sDocument, iExportDocCount, sExtension);
+
+ aChecker.stop();
+ final int nConsumMore = aChecker.getConsumMore();
+
+ nOk += checkMemory(nConsumMore);
+ nRunThrough++;
+ }
+ System.out.println();
+ System.out.println();
+ }
+ System.out.println("Find the output of used 'pmap' here: " + m_aTempDir.getTempDir() + " if test failed.");
+ assertTrue("Office consumes too many memory.", nOk == nRunThrough);
}
/**
- * Get the process ID from the Office
- * @return the Id as String
+ * Checks how much memory should consum
+ * @param storageBefore
+ * @return 1 if consum is ok, else 0
*/
- private String getOfficeProcessID() {
- writeExecutableFile(sProcessIdCommand, sProcessId);
- ProcessHandler processID = new ProcessHandler(sProcessIdCommand);
- processID.executeSynchronously();
- String text = processID.getOutputText();
- if (text == null || text.equals("") || text.indexOf(' ') == -1)
- failed("Could not determine Office process ID. Check " + sProcessIdCommand);
- StringTokenizer aToken = new StringTokenizer(text);
- // this is not nice, but ps gives the same output on every machine
- aToken.nextToken();
- String id = aToken.nextToken();
- return id;
+ private int checkMemory(int nConsumMore)
+ {
+ int nAllowed = iAllowMemoryIncrease * iExportDocCount;
+ System.out.println("The Office consumes now " + nConsumMore
+ + "K more memory than at the start of the test; allowed were "
+ + nAllowed + "K.");
+ if (nConsumMore > nAllowed)
+ {
+ System.out.println("ERROR: This is not allowed.");
+ return 0;
+ }
+ System.out.println("OK.");
+ return 1;
}
/**
- * Get the memory usage of the Office in KByte.
- * @return The memory used by the Office.
+ * load and save exact one document
*/
- private int getOfficeMemoryUsage() {
- String command = sMemoryMonitor.replaceAll("<processID>", getOfficeProcessID());
- writeExecutableFile(sOfficeMemoryCommand, command);
- ProcessHandler processID = new ProcessHandler(sOfficeMemoryCommand);
- processID.executeSynchronously();
- String text = processID.getOutputText();
- if (text == null || text.equals("") || text.indexOf(' ') == -1) {
- failed("Could not determine Office memory usage. Check " + sOfficeMemoryCommand);
+ private void loadAndSaveNTimesDocument(String _sDocument, int _nCount, String _sStoreExtension)
+ {
+ System.out.println("Document: " + _sDocument);
+ XComponent xComponent = DesktopTools.loadDoc(getMSF(), _sDocument, null);
+ XStorable xStorable = UnoRuntime.queryInterface(XStorable.class, xComponent);
+ if (xStorable != null)
+ {
+ // export each document iExportDocCount times
+ for (int j = 0; j < _nCount; j++)
+ {
+ final String sDocumentName = FileHelper.getBasename(_sDocument) + "_" + j + ".pdf";
+ final String sFilename = FileHelper.appendPath(m_aTempDir.getOfficeTempDir(), sDocumentName);
+ // String url = utils.getFullURL(sFilename);
+ String url = sFilename; // graphical.FileHelper.getFileURLFromSystemPath(sFilename);
+ try
+ {
+ PropertyValue[] props = new PropertyValue[1];
+ props[0] = new PropertyValue();
+ props[0].Name = "FilterName";
+ // use export filter for this doc type
+ props[0].Value = _sStoreExtension;
+ xStorable.storeToURL(url, props);
+ }
+ catch (com.sun.star.io.IOException e)
+ {
+ fail("Could not store to '" + url + "'");
+ }
+ }
+ // close the doc
+ XCloseable xCloseable = UnoRuntime.queryInterface(XCloseable.class, xStorable);
+ try
+ {
+ xCloseable.close(true);
+ }
+ catch (com.sun.star.util.CloseVetoException e)
+ {
+ e.printStackTrace();
+ fail("Cannot close document: test is futile, Office will surely use more space.");
+ }
+ }
+ else
+ {
+ System.out.println("Cannot query for XStorable interface on document '" + _sDocument + "'");
+ System.out.println(" -> Skipping storage.");
}
- StringTokenizer aToken = new StringTokenizer(text);
- // this works, because the output of pmap is quite standardized.
- aToken.nextToken();
- String mem = aToken.nextToken();
- mem = mem.substring(0, mem.indexOf('K'));
- Integer memory = new Integer(mem);
- return memory.intValue();
+
}
- /**
- * Write a script file and set its rights to rwxrwxrwx.
- * @param fileName The name of the created file
- * @param line The commandline that has to be written inside of the file.
- */
- private void writeExecutableFile(String fileName, String line) {
- try {
- PrintWriter fWriter = new PrintWriter(new FileWriter(fileName));
- fWriter.println(bash);
- fWriter.println(line);
- fWriter.close();
- // change rights to rwxrwxrwx
- ProcessHandler processID = new ProcessHandler(sChmod + fileName);
+// -----------------------------------------------------------------------------
+ private class OfficeMemchecker
+ {
+
+ /**
+ * After called start() it contains the memory need at startup
+ */
+ private int m_nMemoryStart;
+ /**
+ * After called stop() it contains the memory usage
+ */
+ private int m_nMemoryUsage;
+ private String m_sDocumentName;
+ private String m_sExtension;
+
+ public OfficeMemchecker()
+ {
+ m_nMemoryStart = 0;
+ }
+
+ public void setDocumentName(String _sDocName)
+ {
+ m_sDocumentName = _sDocName;
+ }
+
+ public void setExtension(String _sExt)
+ {
+ m_sExtension = _sExt;
+ }
+
+ public void start()
+ {
+ m_nMemoryStart = getOfficeMemoryUsage(createModeName("start", 0));
+ }
+
+ private String createModeName(String _sSub, int _nCount)
+ {
+ StringBuffer aBuf = new StringBuffer();
+ aBuf.append(_sSub);
+ aBuf.append('_').append(m_sDocumentName).append('_').append(m_sExtension);
+ aBuf.append('_').append(_nCount);
+ return aBuf.toString();
+ }
+
+ public void stop()
+ {
+ // short wait for the office to 'calm down' and free some memory
+ shortWait(20000);
+ // wait util memory is not freed anymore.
+ int storageAfter = getOfficeMemoryUsage(createModeName("stop", 0));
+ int mem = 0;
+ int count = 0;
+ while (storageAfter != mem && count < 10)
+ {
+ count++;
+ mem = storageAfter;
+ storageAfter = getOfficeMemoryUsage(createModeName("stop", count));
+ shortWait(1000);
+ }
+ m_nMemoryUsage = (storageAfter - m_nMemoryStart);
+ }
+
+ public int getConsumMore()
+ {
+ return m_nMemoryUsage;
+ }
+
+ /**
+ * Get the process ID from the Office
+ * @return the Id as String
+ */
+ private String getOfficeProcessID()
+ {
+ String sProcessIdCommand = FileHelper.appendPath(m_aTempDir.getTempDir(), "getPS");
+ final String sofficeArg = org.openoffice.test.Argument.get("soffice");
+ final String sPSGrep = "ps -ef | grep $USER | grep <soffice>.bin | grep -v grep";
+ final String sProcessId = sPSGrep.replaceAll("<soffice>", FileHelper.getJavaCompatibleFilename(sofficeArg));
+
+ createExecutableFile(sProcessIdCommand, sProcessId);
+ ProcessHandler processID = new ProcessHandler(sProcessIdCommand);
+ processID.noOutput();
+ processID.executeSynchronously();
+ String text = processID.getOutputText();
+ if (text == null || text.equals("") || text.indexOf(' ') == -1)
+ {
+ fail("Could not determine Office process ID. Check " + sProcessIdCommand);
+ }
+ StringTokenizer aToken = new StringTokenizer(text);
+ // this is not nice, but ps gives the same output on every machine
+ aToken.nextToken();
+ String id = aToken.nextToken();
+ return id;
+ }
+
+ /**
+ * Get the memory usage of the Office in KByte.
+ * @return The memory used by the Office.
+ */
+ private int getOfficeMemoryUsage(String _sMode)
+ {
+ final String sMemoryMonitor = "pmap <processID> |tee <pmapoutputfile> | grep total";
+ String sOfficeMemoryCommand = null;
+ sOfficeMemoryCommand = FileHelper.appendPath(m_aTempDir.getTempDir(), "getPmap");
+ // sOfficeMemoryCommand = FileHelper.getJavaCompatibleFilename(sOfficeMemoryCommand);
+ String command = sMemoryMonitor.replaceAll("<processID>", getOfficeProcessID());
+ String sPmapOutputFile = FileHelper.appendPath(m_aTempDir.getTempDir(), "pmap_" + _sMode + ".txt");
+ command = command.replaceAll("<pmapoutputfile>", sPmapOutputFile);
+ createExecutableFile(sOfficeMemoryCommand, command);
+
+ ProcessHandler processID = new ProcessHandler(sOfficeMemoryCommand);
+ processID.noOutput();
processID.executeSynchronously();
+ int nError = processID.getExitCode();
+ assertTrue("Execute of " + sOfficeMemoryCommand + " failed", nError == 0);
+ String text = processID.getOutputText();
+ if (text == null || text.equals("") || text.indexOf(' ') == -1)
+ {
+ fail("Could not determine Office memory usage. Check " + sOfficeMemoryCommand);
+ }
+ StringTokenizer aToken = new StringTokenizer(text);
+ // this works, because the output of pmap is quite standardized.
+ aToken.nextToken();
+ String mem = aToken.nextToken();
+ mem = mem.substring(0, mem.indexOf('K'));
+ Integer memory = new Integer(mem);
+ return memory.intValue();
}
- catch(java.io.IOException e) {
+
+ /**
+ * Write a script file and set its rights to rwxrwxrwx.
+ * @param fileName The name of the created file
+ * @param line The commandline that has to be written inside of the file.
+ */
+ private void createExecutableFile(String fileName, String line)
+ {
+ final String sChmod = "chmod a+x ";
+ final String bash = "#!/bin/bash";
+
+ try
+ {
+ String sFilename = FileHelper.getJavaCompatibleFilename(fileName);
+ PrintWriter fWriter = new PrintWriter(new FileWriter(sFilename));
+ fWriter.println(bash);
+ fWriter.println(line);
+ fWriter.close();
+ // change rights to rwxrwxrwx
+ ProcessHandler processID = new ProcessHandler(sChmod + sFilename);
+ processID.noOutput();
+ processID.executeSynchronously();
+ int nError = processID.getExitCode();
+ assertTrue("chmod failed. ", nError == 0);
+ }
+ catch (java.io.IOException e)
+ {
+ }
}
}
@@ -304,11 +540,15 @@ public class CheckMemoryUsage extends ComplexTestCase {
* Let this thread sleep for some time
* @param milliSeconds time to wait in milliseconds.
*/
- private void shortWait(int milliSeconds) {
- try {
+ public static void shortWait(int milliSeconds)
+ {
+ System.out.println("Wait for: " + milliSeconds + "ms");
+ try
+ {
Thread.sleep(milliSeconds);
}
- catch(java.lang.InterruptedException e) { // ignore
+ catch (java.lang.InterruptedException e)
+ { // ignore
}
}
@@ -316,15 +556,20 @@ public class CheckMemoryUsage extends ComplexTestCase {
* Own file filter, will just return ok for all files that end with a given
* suffix
*/
- private class FileFilter implements FilenameFilter {
+ private class FileFilter implements FilenameFilter
+ {
+
private String suffix = null;
+
/**
* C'tor.
* @param suffix The suffix each filename should end with.
*/
- public FileFilter(String suffix) {
+ public FileFilter(String suffix)
+ {
this.suffix = suffix;
}
+
/**
* Returns true, if the name of the file has the suffix given to the
* c'tor.
@@ -332,9 +577,32 @@ public class CheckMemoryUsage extends ComplexTestCase {
* @param file Not used.
* @return True, if name ends with suffix.
*/
- public boolean accept(File file, String name) {
+ public boolean accept(File file, String name)
+ {
return name.endsWith(suffix);
}
- };
+ }
+
+ private XMultiServiceFactory getMSF()
+ {
+ final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager());
+ return xMSF1;
+ }
+ // setup and close connections
+ @BeforeClass
+ public static void setUpConnection() throws Exception
+ {
+ System.out.println("setUpConnection()");
+ connection.setUp();
+ }
+
+ @AfterClass
+ public static void tearDownConnection()
+ throws InterruptedException, com.sun.star.uno.Exception
+ {
+ System.out.println("tearDownConnection()");
+ connection.tearDown();
+ }
+ private static final OfficeConnection connection = new OfficeConnection();
}
diff --git a/vcl/qa/complex/memCheck/FileHelper.java b/vcl/qa/complex/memCheck/FileHelper.java
new file mode 100644
index 000000000000..21ce46185b4a
--- /dev/null
+++ b/vcl/qa/complex/memCheck/FileHelper.java
@@ -0,0 +1,90 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package complex.memCheck;
+
+import java.io.File;
+
+/**
+ *
+ * @author ll93751
+ */
+public class FileHelper
+{
+ public static String appendPath(String _sPath, String _sRelativePathToAdd)
+ {
+ String sNewPath = _sPath;
+ String fs = System.getProperty("file.separator");
+ if (_sPath.startsWith("file:"))
+ {
+ fs = "/"; // we use a file URL so only '/' is allowed.
+ }
+ if (! (sNewPath.endsWith("/") || sNewPath.endsWith("\\") ) )
+ {
+ sNewPath += fs;
+ }
+ sNewPath += _sRelativePathToAdd;
+ return sNewPath;
+ }
+ public static String getJavaCompatibleFilename(String _sFilename)
+ {
+ // It is a little bit stupid that office urls not compatible to java file urls
+ // System.out.println("java.io.File can't access Office file urls.");
+ if(_sFilename.startsWith("path:"))
+ {
+ final String sPath = _sFilename.substring(5);
+ return sPath;
+ }
+
+ String sSystemPath = graphical.FileHelper.getSystemPathFromFileURL(_sFilename);
+ if (sSystemPath == null)
+ {
+ sSystemPath = _sFilename;
+ }
+ return sSystemPath;
+ }
+
+public static String getBasename(String _sFilename)
+ {
+ if (_sFilename == null)
+ {
+ return "";
+ }
+ // String fs = System.getProperty("file.separator");
+
+ int nIdx = _sFilename.lastIndexOf("\\");
+ if (nIdx == -1)
+ {
+ nIdx = _sFilename.lastIndexOf("/");
+ }
+ if (nIdx > 0)
+ {
+ return _sFilename.substring(nIdx + 1);
+ }
+ return _sFilename;
+ }
+}
diff --git a/vcl/qa/complex/memCheck/TestDocument.java b/vcl/qa/complex/memCheck/TestDocument.java
new file mode 100644
index 000000000000..8ca9f7b71192
--- /dev/null
+++ b/vcl/qa/complex/memCheck/TestDocument.java
@@ -0,0 +1,45 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+package complex.memCheck;
+
+import java.io.File;
+import org.openoffice.test.OfficeFileUrl;
+
+final class TestDocument
+{
+ final static String sPathname = "testdocuments";
+ public static String getUrl(String name)
+ {
+ return OfficeFileUrl.getAbsolute(new File(sPathname, name));
+ }
+ public static String getUrl()
+ {
+ return OfficeFileUrl.getAbsolute(new File(sPathname));
+ }
+ private TestDocument() {}
+}
diff --git a/vcl/qa/complex/memCheck/makefile.mk b/vcl/qa/complex/memCheck/makefile.mk
index d1d4b5c08c98..4a809e71e50e 100755
--- a/vcl/qa/complex/memCheck/makefile.mk
+++ b/vcl/qa/complex/memCheck/makefile.mk
@@ -25,65 +25,107 @@
#
#*************************************************************************
-PRJ = ..$/..$/..
-TARGET = MemoryCheck
-PRJNAME = $(TARGET)
-PACKAGE = complex$/memCheck
-
-# --- Settings -----------------------------------------------------
-.INCLUDE: settings.mk
-
-
-#----- compile .java files -----------------------------------------
-
-JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar
-JAVAFILES = CheckMemoryUsage.java
-
-#----- make a jar from compiled files ------------------------------
-
-MAXLINELENGTH = 100000
-
-JARCLASSDIRS = $(PACKAGE)
-JARTARGET = $(TARGET).jar
-JARCOMPRESS = TRUE
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
+.ELSE
-# --- Parameters for the test --------------------------------------
+PRJ = ../../..
+PRJNAME = vcl
+TARGET = qa_complex_memCheck
-# start an office if the parameter is set for the makefile
-.IF "$(OFFICE)" == ""
-CT_APPEXECCOMMAND =
-.ELSE
-CT_APPEXECCOMMAND = -AppExecutionCommand \
- "$(OFFICE)$/soffice -accept=socket,host=localhost,port=8100;urp;"
-.ENDIF
+.IF "$(OOO_JUNIT_JAR)" != ""
+PACKAGE = complex/memCheck
-# test base is java complex
-CT_TESTBASE = -TestBase java_complex
+# here store only Files which contain a @Test
+JAVATESTFILES = \
+ CheckMemoryUsage.java
-# replace $/ with . in package name
-CT_PACKAGE = -o $(PACKAGE:s\$/\.\)
+# put here all other files
+JAVAFILES = $(JAVATESTFILES) \
+ FileHelper.java \
+ TestDocument.java
-# start the runner application
-CT_APP = org.openoffice.Runner
-# --- Targets ------------------------------------------------------
+JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar
+EXTRAJARFILES = $(OOO_JUNIT_JAR)
-.IF "$(depend)" == ""
-$(CLASSDIR)$/$(PACKAGE)$/CheckMemoryUsage.props : ALLTAR
-.ELSE
-$(CLASSDIR)$/$(PACKAGE)$/CheckMemoryUsage.props : ALLTAR
-.ENDIF
+# Sample how to debug
+# JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y
-.INCLUDE : target.mk
+.END
+.INCLUDE: settings.mk
+.INCLUDE: target.mk
+.INCLUDE: installationtest.mk
+ALLTAR : javatest
-$(CLASSDIR)$/$(PACKAGE)$/CheckMemoryUsage.props : CheckMemoryUsage.props
- cp $(@:f) $@
- jar uf $(CLASSDIR)$/$(JARTARGET) -C $(CLASSDIR) $(PACKAGE)$/$(@:f)
+.END
-RUN: run
-run:
- java -cp $(CLASSPATH) $(CT_APP) $(CT_TESTBASE) $(CT_APPEXECCOMMAND) $(CT_PACKAGE).CheckMemoryUsage
+#
+#
+#
+# PRJ = ..$/..$/..
+# TARGET = MemoryCheck
+# PRJNAME = $(TARGET)
+# PACKAGE = complex$/memCheck
+#
+# # --- Settings -----------------------------------------------------
+# .INCLUDE: settings.mk
+#
+#
+# #----- compile .java files -----------------------------------------
+#
+# JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar
+# JAVAFILES = CheckMemoryUsage.java
+#
+# #----- make a jar from compiled files ------------------------------
+#
+# MAXLINELENGTH = 100000
+#
+# JARCLASSDIRS = $(PACKAGE)
+# JARTARGET = $(TARGET).jar
+# JARCOMPRESS = TRUE
+#
+# # --- Parameters for the test --------------------------------------
+#
+# # start an office if the parameter is set for the makefile
+# .IF "$(OFFICE)" == ""
+# CT_APPEXECCOMMAND =
+# .ELSE
+# CT_APPEXECCOMMAND = -AppExecutionCommand \
+# "$(OFFICE)$/soffice -accept=socket,host=localhost,port=8100;urp;"
+# .ENDIF
+#
+# # test base is java complex
+# CT_TESTBASE = -TestBase java_complex
+#
+# # replace $/ with . in package name
+# CT_PACKAGE = -o $(PACKAGE:s\$/\.\)
+#
+# # start the runner application
+# CT_APP = org.openoffice.Runner
+#
+# # --- Targets ------------------------------------------------------
+#
+# .IF "$(depend)" == ""
+# $(CLASSDIR)$/$(PACKAGE)$/CheckMemoryUsage.props : ALLTAR
+# .ELSE
+# $(CLASSDIR)$/$(PACKAGE)$/CheckMemoryUsage.props : ALLTAR
+# .ENDIF
+#
+# .INCLUDE : target.mk
+#
+#
+#
+# $(CLASSDIR)$/$(PACKAGE)$/CheckMemoryUsage.props : CheckMemoryUsage.props
+# cp $(@:f) $@
+# jar uf $(CLASSDIR)$/$(JARTARGET) -C $(CLASSDIR) $(PACKAGE)$/$(@:f)
+#
+#
+# RUN: run
+#
+# run:
+# java -cp $(CLASSPATH) $(CT_APP) $(CT_TESTBASE) $(CT_APPEXECCOMMAND) $(CT_PACKAGE).CheckMemoryUsage
diff --git a/vcl/qa/testdocuments/CalcDoc.sxc b/vcl/qa/complex/memCheck/testdocuments/CalcDoc.sxc
index 4b2b572085dc..4b2b572085dc 100755
--- a/vcl/qa/testdocuments/CalcDoc.sxc
+++ b/vcl/qa/complex/memCheck/testdocuments/CalcDoc.sxc
Binary files differ
diff --git a/vcl/qa/testdocuments/ImpressDoc.sxi b/vcl/qa/complex/memCheck/testdocuments/ImpressDoc.sxi
index efcdf9b6a25e..efcdf9b6a25e 100755
--- a/vcl/qa/testdocuments/ImpressDoc.sxi
+++ b/vcl/qa/complex/memCheck/testdocuments/ImpressDoc.sxi
Binary files differ
diff --git a/vcl/qa/testdocuments/WriterDoc.sxw b/vcl/qa/complex/memCheck/testdocuments/WriterDoc.sxw
index 1b2c2cb2dab6..1b2c2cb2dab6 100755
--- a/vcl/qa/testdocuments/WriterDoc.sxw
+++ b/vcl/qa/complex/memCheck/testdocuments/WriterDoc.sxw
Binary files differ
diff --git a/vcl/qa/complex/persistent_window_states/DocumentHandle.java b/vcl/qa/complex/persistent_window_states/DocumentHandle.java
index 0b32eaaeff51..ea28c41f65f7 100644
--- a/vcl/qa/complex/persistent_window_states/DocumentHandle.java
+++ b/vcl/qa/complex/persistent_window_states/DocumentHandle.java
@@ -34,13 +34,9 @@ import com.sun.star.lang.XComponent;
import com.sun.star.awt.XWindow;
import com.sun.star.beans.PropertyValue;
import com.sun.star.beans.PropertyState;
-import com.sun.star.frame.XController;
-import com.sun.star.frame.FrameSearchFlag;
-import com.sun.star.text.XTextDocument;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.frame.XFrame;
import com.sun.star.frame.FrameSearchFlag;
-import com.sun.star.frame.XFramesSupplier;
import helper.WindowListener;
/**
@@ -59,7 +55,7 @@ public class DocumentHandle {
/**
* Constructor
- * @param xComponentLoader A loader to load a document
+ * @param xCompLoader A loader to load a document
*/
public DocumentHandle(XComponentLoader xCompLoader) {
this.xCompLoader = xCompLoader;
@@ -71,6 +67,7 @@ public class DocumentHandle {
* @param docName The name of a document as file URL
* @param hidden If true, the document is loaded hidden.
* @return The size of the opened/created document.
+ * @throws Exception
*/
public Rectangle loadDocument(String docName, boolean hidden)
throws Exception{
@@ -91,13 +88,13 @@ public class DocumentHandle {
}
// get the current active window
- XFrame xCurFrame = (XFrame)UnoRuntime.queryInterface(XFrame.class, xCompLoader);
+ XFrame xCurFrame = UnoRuntime.queryInterface(XFrame.class, xCompLoader);
// create a new frame
XFrame xFrame = xCurFrame.findFrame("_blank", FrameSearchFlag.CREATE);
// load document in this frame
- XComponentLoader xFrameLoader = (XComponentLoader)UnoRuntime.queryInterface(XComponentLoader.class, xFrame);
+ XComponentLoader xFrameLoader = UnoRuntime.queryInterface(XComponentLoader.class, xFrame);
xComp = xFrameLoader.loadComponentFromURL(
docName, "_self", 0, szArgs);
// wait for the document to load.
diff --git a/vcl/qa/complex/persistent_window_states/PersistentWindowTest.java b/vcl/qa/complex/persistent_window_states/PersistentWindowTest.java
index edceeeafd883..898324504b4e 100644
--- a/vcl/qa/complex/persistent_window_states/PersistentWindowTest.java
+++ b/vcl/qa/complex/persistent_window_states/PersistentWindowTest.java
@@ -26,31 +26,27 @@
************************************************************************/
package complex.persistent_window_states;
-
-import com.sun.star.lang.XServiceInfo;
-import com.sun.star.lang.XInitialization;
-import com.sun.star.uno.Type;
import com.sun.star.uno.Any;
-import com.sun.star.lang.XTypeProvider;
-import com.sun.star.lang.XSingleServiceFactory;
import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.lang.XComponent;
-import com.sun.star.frame.XDesktop;
import com.sun.star.frame.XFramesSupplier;
import com.sun.star.frame.XFrames;
-import com.sun.star.registry.XRegistryKey;
-import com.sun.star.comp.loader.FactoryHelper;
import com.sun.star.container.XIndexAccess;
-import com.sun.star.beans.XPropertySet;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.AnyConverter;
import com.sun.star.frame.XComponentLoader;
import com.sun.star.awt.Rectangle;
import com.sun.star.util.XCloseable;
import helper.ConfigurationRead;
-import complexlib.ComplexTestCase;
-import helper.OfficeProvider;
-import complex.persistent_window_states.DocumentHandle;
+
+
+
+// import org.junit.After;
+import org.junit.AfterClass;
+// import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.openoffice.test.OfficeConnection;
+import static org.junit.Assert.*;
/**
* Parameters:
@@ -58,10 +54,11 @@ import complex.persistent_window_states.DocumentHandle;
* <li>NoOffice=yes - StarOffice is not started initially.</li>
* </ul>
*/
-public class PersistentWindowTest extends ComplexTestCase {
+public class PersistentWindowTest
+{
- private XMultiServiceFactory xMSF;
- private OfficeProvider oProvider;
+ // private XMultiServiceFactory xMSF;
+// private OfficeProvider oProvider;
private int iOfficeCloseTime = 0;
/**
@@ -69,9 +66,18 @@ public class PersistentWindowTest extends ComplexTestCase {
* Right now, it's only 'checkPersistentWindowState'.
* @return All test methods.
*/
- public String[] getTestMethodNames() {
- return new String[]{"checkPersistentWindowState"};
- }
+// public String[] getTestMethodNames()
+// {
+// return new String[]
+// {
+// "checkPersistentWindowState"
+// };
+// }
+
+ /**
+ * The test parameters
+ */
+ // private static TestParameters param = null;
/**
* Test if all available document types change the
@@ -94,42 +100,32 @@ public class PersistentWindowTest extends ComplexTestCase {
* - close office
* - Test finished
*/
- public void checkPersistentWindowState()
+ @Test public void checkPersistentWindowState()
{
- try {
-
- log.println("Connect the first time.");
- log.println("AppExecCommand: " + (String)param.get("AppExecutionCommand"));
- log.println("ConnString: " + (String)param.get("ConnectionString"));
- oProvider = new OfficeProvider();
- iOfficeCloseTime = param.getInt("OfficeCloseTime");
- if ( iOfficeCloseTime == 0 ) {
- iOfficeCloseTime = 1000;
- }
+ // final XMultiServiceFactory xMsf = getMSF();
- if (!connect()) return;
+ // some Tests need the qadevOOo TestParameters, it is like a Hashmap for Properties.
+// param = new TestParameters();
+// param.put("ServiceFactory", xMsf); // some qadevOOo functions need the ServiceFactory
- // create the configuration provider
- Object o = null;
- try {
- o = xMSF.createInstance(
- "com.sun.star.configuration.ConfigurationProvider");
- }
- catch(com.sun.star.uno.Exception e) {
- failed("Cannot create \"com.sun.star.configuration."+
- "ConfigurationProvider\"");
- return;
- }
+ try
+ {
- // fetch the multi service factory for setup
- XMultiServiceFactory xCP = (XMultiServiceFactory)
- UnoRuntime.queryInterface(XMultiServiceFactory.class, o);
+ // At first we are already connected
+ // if (!connect())
+ // {
+ // return;
+ // }
- // create the configuration reader
- ConfigurationRead cfgRead = new ConfigurationRead(xCP);
+ // fetch the multi service factory for setup
+ // XMultiServiceFactory xCP = getMSF();
+
+ // create the configuration reader
+ // ConfigurationRead cfgRead = new ConfigurationRead(xCP);
- // just test the wrong ones, not all.
- String [] els = new String[]{
+ // just test the wrong ones, not all.
+ String[] els = new String[]
+ {
"Office/Factories/com.sun.star.drawing.DrawingDocument",
"Office/Factories/com.sun.star.formula.FormulaProperties",
//"Office/Factories/com.sun.star.presentation.PresentationDocument",
@@ -138,92 +134,98 @@ public class PersistentWindowTest extends ComplexTestCase {
"Office/Factories/com.sun.star.text.TextDocument",
"Office/Factories/com.sun.star.text.WebDocument",
};
- // uncomment the following line for all doc types
-// String [] els = cfgRead.getSubNodeNames("Office/Factories");
-
- log.println("Found "+ els.length + " document types to test.\n");
- if (!disconnect()) return;
-
- // for all types
- for(int i=0; i<els.length; i++) {
- log.println("\tStart test for document type " + i + ": " + els[i]);
- // exclude chart documents: cannot be created this way.
- if ( els[i].indexOf("ChartDocument") != -1) {
- log.println("Skipping chart document: cannot be create like this.");
- continue;
- }
+ // uncomment the following line for all doc types
+ // String [] els = cfgRead.getSubNodeNames("Office/Factories");
+
+ System.out.println("Found " + els.length + " document types to test.\n");
+ disconnect();
+
+ // for all types
+ for (int i = 0; i < els.length; i++)
+ {
+ System.out.println("\tStart test for document type " + i + ": " + els[i]);
+ // exclude chart documents: cannot be created this way.
+ if (els[i].indexOf("ChartDocument") != -1)
+ {
+ System.out.println("Skipping chart document: cannot be create like this.");
+ continue;
+ }
- // start an office
- if (!connect()) return;
+ // start an office
+ connect();
- // get configuration
- String[] settings = getConfigurationAndLoader(xMSF, els[i]);
- if (settings == null) {
- log.println("Skipping document type " + els[i]);
- disconnect();
- continue;
- }
- String cfg = settings[1];
+ // get configuration
+ String[] settings = getConfigurationAndLoader(getMSF(), els[i]);
+ if (settings == null)
+ {
+ System.out.println("Skipping document type " + els[i]);
+ disconnect();
+ continue;
+ }
+ String cfg = settings[1];
- // load a document
- DocumentHandle handle = loadDocument(xMSF, settings[0]);
+ // load a document
+ DocumentHandle handle = loadDocument(getMSF(), settings[0]);
- // first size
- Rectangle rect1 = handle.getDocumentPosSize();
+ // first size
+ Rectangle rect1 = handle.getDocumentPosSize();
- // resize
- handle.resizeDocument();
- // after resize
- Rectangle rect2 = handle.getDocumentPosSize();
+ // resize
+ handle.resizeDocument();
+ // after resize
+ Rectangle rect2 = handle.getDocumentPosSize();
- // disposeManager and start a new office
- if (!disconnect()) return;
+ // disposeManager and start a new office
+ disconnect();
- if (!connect()) return;
+ connect();
- // get configuration
- settings = getConfigurationAndLoader(xMSF, els[i]);
+ // get configuration
+ settings = getConfigurationAndLoader(getMSF(), els[i]);
- String newCfg = settings[1];
+ String newCfg = settings[1];
- // load a document
- handle = loadDocument(xMSF, settings[0]);
+ // load a document
+ handle = loadDocument(getMSF(), settings[0]);
- Rectangle newRect = handle.getDocumentPosSize();
+ Rectangle newRect = handle.getDocumentPosSize();
- // print the settings and window sizes
- log.println("----------------------------");
- log.println("Initial Config String : " + cfg);
- log.println("Config String after restart: " + newCfg);
+ // print the settings and window sizes
+ System.out.println("----------------------------");
+ System.out.println("Initial Config String : " + cfg);
+ System.out.println("Config String after restart: " + newCfg);
- log.println("----------------------------");
- log.println("Initial window (X,Y,Width,Height): "
- +rect1.X+";"+rect1.Y+";"+ rect1.Width+";"+rect1.Height);
- log.println("Window after resize (X,Y,Width,Height): "
- +rect2.X+";"+rect2.Y+";"+ rect2.Width+";"+rect2.Height);
- log.println("Window after restart (X,Y,Width,Height): "
- +newRect.X+";"+newRect.Y+";"+newRect.Width+";"
- +newRect.Height);
+ System.out.println("----------------------------");
+ System.out.println("Initial window (X,Y,Width,Height): "
+ + rect1.X + ";" + rect1.Y + ";" + rect1.Width + ";" + rect1.Height);
+ System.out.println("Window after resize (X,Y,Width,Height): "
+ + rect2.X + ";" + rect2.Y + ";" + rect2.Width + ";" + rect2.Height);
+ System.out.println("Window after restart (X,Y,Width,Height): "
+ + newRect.X + ";" + newRect.Y + ";" + newRect.Width + ";"
+ + newRect.Height);
- // compare to see if resize worked
- log.println("----------------------------");
- assure("Resize values for "+ els[i] +
- " are equal.", !compareRectangles(rect1, rect2), true);
- // compare settings and sizes
- assure("Config settings for "+ els[i] +
- " were not changed.", !cfg.equals(newCfg), true);
- assure("Resized and restarted window for "+ els[i] +
- " are not equal.", compareRectangles(rect2, newRect), true);
- log.println("----------------------------");
+ // compare to see if resize worked
+ System.out.println("----------------------------");
+ if (els[i].indexOf("SpreadsheetDocument") == -1 &&
+ els[i].indexOf("DrawingDocument") == -1)
+ {
+ // leave out Spreadsheet- and DrawingDocumnt
+ assertTrue("Resize values for " + els[i] + " are equal.", !compareRectangles(rect1, rect2));
+ }
+ // compare settings and sizes
+ assertTrue("Config settings for " + els[i] + " were not changed.", !cfg.equals(newCfg));
+ assertTrue("Resized and restarted window for " + els[i] + " are not equal.", compareRectangles(rect2, newRect));
+ System.out.println("----------------------------");
- // disposeManager
- if (!disconnect()) return;
+ // disposeManager
+ disconnect();
- log.println("\tFinish test for document type " + i + ": " + els[i]);
+ System.out.println("\tFinish test for document type " + i + ": " + els[i]);
+ }
}
- }
- catch(Exception e) {
+ catch (Exception e)
+ {
e.printStackTrace();
}
}
@@ -235,16 +237,17 @@ public class PersistentWindowTest extends ComplexTestCase {
* @return Settings and Loader
*/
private static String[] getConfigurationAndLoader(XMultiServiceFactory xMSF,
- String cfgString) {
+ String cfgString)
+ {
String[] conf = new String[2];
- try {
+ try
+ {
Object o = xMSF.createInstance(
- "com.sun.star.configuration.ConfigurationProvider");
+ "com.sun.star.configuration.ConfigurationProvider");
// fetch the multi service factory for setup
- XMultiServiceFactory xCP = (XMultiServiceFactory)
- UnoRuntime.queryInterface(XMultiServiceFactory.class, o);
+ XMultiServiceFactory xCP = UnoRuntime.queryInterface(XMultiServiceFactory.class, o);
// create the configuration reader
ConfigurationRead cfgRead = new ConfigurationRead(xCP);
@@ -253,22 +256,28 @@ public class PersistentWindowTest extends ComplexTestCase {
String loader = getStringFromObject(
cfgRead.getByHierarchicalName(cfgString + "/ooSetupFactoryEmptyDocumentURL"));
- if (loader == null) return null;
- log.println("\tLoader: " + loader);
+ if (loader == null)
+ {
+ return null;
+ }
+ System.out.println("\tLoader: " + loader);
// read attributes
String hierchName = cfgString + "/ooSetupFactoryWindowAttributes";
String setupSettings = getStringFromObject(cfgRead.getByHierarchicalName(hierchName));
// remove slots: just plain document types have to start
- if ( loader.indexOf("?slot") != -1 ) {
+ if (loader.indexOf("?slot") != -1)
+ {
loader = loader.substring(0, loader.indexOf("?slot"));
- System.out.println("Loader: "+loader);
+ System.out.println("Loader: " + loader);
}
conf[0] = loader;
conf[1] = setupSettings;
}
- catch(com.sun.star.uno.Exception e) {}
+ catch (com.sun.star.uno.Exception e)
+ {
+ }
return conf;
}
@@ -279,97 +288,105 @@ public class PersistentWindowTest extends ComplexTestCase {
* @return A handle to the document
*/
private DocumentHandle loadDocument(XMultiServiceFactory xMSF,
- String docLoader) {
+ String docLoader)
+ {
DocumentHandle docHandle = null;
- try {
+ try
+ {
// create component loaader
- XComponentLoader xCompLoader = (XComponentLoader)
- UnoRuntime.queryInterface(
- XComponentLoader.class, xMSF.createInstance(
- "com.sun.star.frame.Desktop"));
- XFramesSupplier xFrameSupp = (XFramesSupplier)UnoRuntime.queryInterface(XFramesSupplier.class, xCompLoader);
+ XComponentLoader xCompLoader = UnoRuntime.queryInterface(XComponentLoader.class, xMSF.createInstance("com.sun.star.frame.Desktop"));
+ XFramesSupplier xFrameSupp = UnoRuntime.queryInterface(XFramesSupplier.class, xCompLoader);
// close all existing frames
XFrames xFrames = xFrameSupp.getFrames();
- XIndexAccess xAcc = (XIndexAccess)UnoRuntime.queryInterface(XIndexAccess.class, xFrames);
- for ( int i=0; i<xAcc.getCount(); i++ ) {
- XCloseable xClose = (XCloseable)UnoRuntime.queryInterface(XCloseable.class, xAcc.getByIndex(i));
- try {
- if ( xClose != null ) {
+ XIndexAccess xAcc = UnoRuntime.queryInterface(XIndexAccess.class, xFrames);
+ for (int i = 0; i < xAcc.getCount(); i++)
+ {
+ XCloseable xClose = UnoRuntime.queryInterface(XCloseable.class, xAcc.getByIndex(i));
+ try
+ {
+ if (xClose != null)
+ {
xClose.close(false);
}
- else {
- failed("Could not query frame for XCloseable!");
+ else
+ {
+ fail("Could not query frame for XCloseable!");
}
}
- catch( com.sun.star.uno.Exception e ) {
- e.printStackTrace((java.io.PrintWriter)log);
- failed("Could not query frame for XCloseable!");
+ catch (com.sun.star.uno.Exception e)
+ {
+ e.printStackTrace();
+ fail("Could not query frame for XCloseable!");
}
}
docHandle = new DocumentHandle(xCompLoader);
docHandle.loadDocument(docLoader, false);
}
- catch(com.sun.star.uno.Exception e) {
+ catch (com.sun.star.uno.Exception e)
+ {
e.printStackTrace();
}
- catch(java.lang.Exception e) {
+ catch (java.lang.Exception e)
+ {
e.printStackTrace();
}
return docHandle;
}
- private boolean connect() {
- try {
- xMSF = (XMultiServiceFactory)oProvider.getManager(param);
- try {
- Thread.sleep(10000);
- }
- catch(java.lang.InterruptedException e) {}
+ private boolean connect()
+ {
+ try
+ {
+ connection.setUp();
+ }
+ catch (java.lang.InterruptedException e)
+ {
+ fail("can't connect.");
}
- catch (java.lang.Exception e) {
- log.println(e.getClass().getName());
- log.println("Message: " + e.getMessage());
- failed("Cannot connect the Office.");
- return false;
+ catch (Exception e)
+ {
+ fail("can't connect.");
}
return true;
}
- private boolean disconnect() {
- try {
- XDesktop desk = null;
- desk = (XDesktop) UnoRuntime.queryInterface(
- XDesktop.class, xMSF.createInstance(
- "com.sun.star.frame.Desktop"));
- xMSF = null;
- desk.terminate();
- log.println("Waiting " + iOfficeCloseTime + " milliseconds for the Office to close down");
- try {
- Thread.sleep(iOfficeCloseTime);
- }
- catch(java.lang.InterruptedException e) {}
+ private boolean disconnect()
+ {
+ try
+ {
+ connection.tearDown();
}
- catch (java.lang.Exception e) {
- e.printStackTrace();
- failed("Cannot dispose the Office.");
- return false;
+ catch (java.lang.InterruptedException e)
+ {
+ fail("can't disconnect.");
+ }
+ catch (Exception e)
+ {
+ fail("can't disconnect.");
}
return true;
}
- private static String getStringFromObject(Object oName) {
+ private static String getStringFromObject(Object oName)
+ {
if (oName instanceof String)
- return (String)oName;
+ {
+ return (String) oName;
+ }
String value = null;
- if (oName instanceof Any) {
- try {
+ if (oName instanceof Any)
+ {
+ try
+ {
value = AnyConverter.toString(oName);
- if (value == null) {
- log.println("Got a void css.uno.Any as loading string.");
+ if (value == null)
+ {
+ System.out.println("Got a void css.uno.Any as loading string.");
}
}
- catch(Exception e) {
- log.println("This document type cannot be opened directly.");
+ catch (Exception e)
+ {
+ System.out.println("This document type cannot be opened directly.");
}
}
return value;
@@ -382,12 +399,37 @@ public class PersistentWindowTest extends ComplexTestCase {
* @param rect2 Second Rectangle.
* @return True, if the rectangles are equal.
*/
- private boolean compareRectangles(Rectangle rect1, Rectangle rect2) {
+ private boolean compareRectangles(Rectangle rect1, Rectangle rect2)
+ {
boolean result = true;
- result &= (rect1.X==rect2.X);
- result &= (rect1.Y==rect2.Y);
- result &= (rect1.Width==rect2.Width);
- result &= (rect1.Height==rect2.Height);
+ result &= (rect1.X == rect2.X);
+ result &= (rect1.Y == rect2.Y);
+ result &= (rect1.Width == rect2.Width);
+ result &= (rect1.Height == rect2.Height);
return result;
}
+
+
+
+ private XMultiServiceFactory getMSF()
+ {
+ final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager());
+ return xMSF1;
+ }
+
+ // setup and close connections
+ @BeforeClass public static void setUpConnection() throws Exception {
+ System.out.println("setUpConnection()");
+ connection.setUp();
+ }
+
+ @AfterClass public static void tearDownConnection()
+ throws InterruptedException, com.sun.star.uno.Exception
+ {
+ System.out.println("tearDownConnection()");
+ connection.tearDown();
+ }
+
+ private static final OfficeConnection connection = new OfficeConnection();
+
}
diff --git a/vcl/qa/complex/persistent_window_states/makefile.mk b/vcl/qa/complex/persistent_window_states/makefile.mk
index 4c61d8969b8d..e4d9f6b514a0 100644
--- a/vcl/qa/complex/persistent_window_states/makefile.mk
+++ b/vcl/qa/complex/persistent_window_states/makefile.mk
@@ -24,58 +24,44 @@
# for a copy of the LGPLv3 License.
#
#*************************************************************************
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
+.ELSE
-PRJ = ..$/..$/..
-TARGET = PersistentWindowTest
-PRJNAME = $(TARGET)
-PACKAGE = complex$/persistent_window_states
-
-# --- Settings -----------------------------------------------------
-.INCLUDE: settings.mk
+PRJ = ../../..
+PRJNAME = vcl
+TARGET = qa_complex_persistent_window_states
-#----- compile .java files -----------------------------------------
+.IF "$(OOO_JUNIT_JAR)" != ""
+PACKAGE = complex/persistent_window_states
-JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar
-JAVAFILES = PersistentWindowTest.java DocumentHandle.java
+# here store only Files which contain a @Test
+JAVATESTFILES = \
+ PersistentWindowTest.java
-#----- make a jar from compiled files ------------------------------
+# put here all other files
+JAVAFILES = $(JAVATESTFILES) \
+DocumentHandle.java
-MAXLINELENGTH = 100000
-JARCLASSDIRS = $(PACKAGE)
-JARTARGET = $(TARGET).jar
-JARCOMPRESS = TRUE
+JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar
+EXTRAJARFILES = $(OOO_JUNIT_JAR)
-# --- Parameters for the test --------------------------------------
+# Sample how to debug
+# JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y
-# test base is java complex
-CT_TESTBASE = -TestBase java_complex
+.END
-# test looks something like the.full.package.TestName
-CT_TEST = -o $(PACKAGE:s\$/\.\).$(TARGET)
+.INCLUDE: settings.mk
+.INCLUDE: target.mk
+.INCLUDE: installationtest.mk
-# start the runner application
-CT_APP = org.openoffice.Runner
+ALLTAR : javatest
-# --- Targets ------------------------------------------------------
+.END
-$(CLASSDIR)$/$(PACKAGE)$/$(TARGET).props : ALLTAR
-.INCLUDE : target.mk
-$(CLASSDIR)$/$(PACKAGE)$/$(TARGET).props : $(TARGET).props
- cp $(TARGET).props $@
- jar uf $(CLASSDIR)$/$(JARTARGET) -C $(CLASSDIR) $(PACKAGE)$/$(TARGET).props
-RUN: run
-# start an office if the parameter is set for the makefile
-.IF "$(OFFICE)" == ""
-run:
- @echo "Execute this test with 'dmake run OFFICE=/system/path/to/office/program'."
- @echo "The office will be started by the test with a socket connection on port 8100"
-.ELSE
-run: $(CLASSDIR)$/$(PACKAGE)$/$(TARGET).props
- java -cp $(CLASSPATH) $(CT_APP) -AppExecutionCommand "$(OFFICE)$/soffice -accept=socket,host=localhost,port=8100;urp;" $(CT_TESTBASE) $(CT_TEST)
-.ENDIF
diff --git a/vcl/source/app/dbggui.cxx b/vcl/source/app/dbggui.cxx
index dd9a5b4a15ee..b48db1d6ee97 100644
--- a/vcl/source/app/dbggui.cxx
+++ b/vcl/source/app/dbggui.cxx
@@ -37,32 +37,33 @@
#include <cmath>
#include <limits.h>
-#include <vcl/svdata.hxx>
-#include <svsys.h>
+#include "vcl/svdata.hxx"
+#include "svsys.h"
#ifdef WNT
#undef min
#endif
-#include <tools/debug.hxx>
-#include <vcl/svdata.hxx>
-#include <vcl/svapp.hxx>
-#include <vcl/event.hxx>
-#include <vcl/lstbox.hxx>
-#include <vcl/button.hxx>
-#include <vcl/edit.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/group.hxx>
-#include <vcl/field.hxx>
-#include <vcl/msgbox.hxx>
-#include <vcl/wrkwin.hxx>
-#include <vcl/sound.hxx>
-#include <vcl/threadex.hxx>
-#include <vcl/dbggui.hxx>
-#include <com/sun/star/i18n/XCharacterClassification.hpp>
-
-#include <vcl/unohelp.hxx>
-#include <vcl/unohelp2.hxx>
-#include <vos/mutex.hxx>
+#include "tools/debug.hxx"
+#include "vcl/svdata.hxx"
+#include "vcl/svapp.hxx"
+#include "vcl/event.hxx"
+#include "vcl/lstbox.hxx"
+#include "vcl/button.hxx"
+#include "vcl/edit.hxx"
+#include "vcl/fixed.hxx"
+#include "vcl/group.hxx"
+#include "vcl/field.hxx"
+#include "vcl/msgbox.hxx"
+#include "vcl/wrkwin.hxx"
+#include "vcl/sound.hxx"
+#include "vcl/threadex.hxx"
+#include "vcl/dbggui.hxx"
+#include "com/sun/star/i18n/XCharacterClassification.hpp"
+
+#include "vcl/unohelp.hxx"
+#include "vcl/unohelp2.hxx"
+#include "vos/mutex.hxx"
+#include "vcl/salinst.hxx"
#include <map>
#include <algorithm>
@@ -1963,9 +1964,11 @@ void DbgPrintWindow( const char* pLine )
// =======================================================================
-#ifdef WNT
-void ImplDbgTestSolarMutex();
-#endif
+void ImplDbgTestSolarMutex()
+{
+ bool bCheck = ImplGetSVData()->mpDefInst->CheckYieldMutex();
+ OSL_ENSURE( bCheck, "SolarMutex not locked" );
+}
// =======================================================================
@@ -1973,9 +1976,7 @@ void DbgGUIInit()
{
DbgSetPrintMsgBox( DbgPrintMsgBox );
DbgSetPrintWindow( DbgPrintWindow );
-#ifdef WNT
DbgSetTestSolarMutex( ImplDbgTestSolarMutex );
-#endif
}
// -----------------------------------------------------------------------
@@ -1984,9 +1985,7 @@ void DbgGUIDeInit()
{
DbgSetPrintMsgBox( NULL );
DbgSetPrintWindow( NULL );
-#ifdef WNT
DbgSetTestSolarMutex( NULL );
-#endif
DbgWindow* pDbgWindow = ImplGetSVData()->maWinData.mpDbgWin;
if ( pDbgWindow )
diff --git a/vcl/source/app/help.cxx b/vcl/source/app/help.cxx
index 1f9efa7b6e65..2c7ad2fa9c3e 100644
--- a/vcl/source/app/help.cxx
+++ b/vcl/source/app/help.cxx
@@ -62,12 +62,7 @@ Help::~Help()
// -----------------------------------------------------------------------
-BOOL Help::Start( ULONG, const Window* )
-{
- return FALSE;
-}
-
-void Help::OpenHelpAgent( ULONG )
+void Help::OpenHelpAgent( const rtl::OString& )
{
}
@@ -78,11 +73,9 @@ BOOL Help::Start( const XubString&, const Window* )
return FALSE;
}
-// -----------------------------------------------------------------------
-
-XubString Help::GetHelpText( ULONG, const Window* )
+BOOL Help::SearchKeyword( const XubString& )
{
- return ImplGetSVEmptyStr();
+ return FALSE;
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 9a2404d36740..2a04389d8f44 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -74,6 +74,29 @@ void SalInstance::FillFontPathList( std::list< rtl::OString >& )
// do nothing
}
+SalMenu* SalInstance::CreateMenu( BOOL, Menu* )
+{
+ // default: no native menus
+ return NULL;
+}
+
+void SalInstance::DestroyMenu( SalMenu* pMenu )
+{
+ (void)pMenu;
+ OSL_ENSURE( pMenu == 0, "DestroyMenu called with non-native menus" );
+}
+
+SalMenuItem* SalInstance::CreateMenuItem( const SalItemParams* )
+{
+ return NULL;
+}
+
+void SalInstance::DestroyMenuItem( SalMenuItem* pItem )
+{
+ (void)pItem;
+ OSL_ENSURE( pItem == 0, "DestroyMenu called with non-native menus" );
+}
+
SalTimer::~SalTimer()
{
}
diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx
index 980e0f1c5b58..b91afbbae9fe 100755..100644
--- a/vcl/source/app/settings.cxx
+++ b/vcl/source/app/settings.cxx
@@ -424,7 +424,10 @@ ImplStyleData::ImplStyleData()
mnPushButtonStyle = 0;
mnTabControlStyle = 0;
mnLogoDisplayTime = LOGO_DISPLAYTIME_STARTTIME;
- mnDragFullOptions = 0;
+ mnDragFullOptions = DRAGFULL_OPTION_WINDOWMOVE | DRAGFULL_OPTION_WINDOWSIZE |
+ DRAGFULL_OPTION_OBJECTMOVE | DRAGFULL_OPTION_OBJECTSIZE |
+ DRAGFULL_OPTION_DOCKING | DRAGFULL_OPTION_SPLIT |
+ DRAGFULL_OPTION_SCROLL;
mnAnimationOptions = 0;
mnSelectionOptions = 0;
mnDisplayOptions = 0;
@@ -1041,6 +1044,8 @@ BOOL StyleSettings::operator ==( const StyleSettings& rSet ) const
(mpData->mnUseSystemUIFonts == rSet.mpData->mnUseSystemUIFonts) &&
(mpData->mnUseFlatBorders == rSet.mpData->mnUseFlatBorders) &&
(mpData->mnUseFlatMenues == rSet.mpData->mnUseFlatMenues) &&
+ (mpData->mnSymbolsStyle == rSet.mpData->mnSymbolsStyle) &&
+ (mpData->mnPreferredSymbolsStyle == rSet.mpData->mnPreferredSymbolsStyle) &&
(mpData->maFaceColor == rSet.mpData->maFaceColor) &&
(mpData->maCheckedColor == rSet.mpData->maCheckedColor) &&
(mpData->maLightColor == rSet.mpData->maLightColor) &&
diff --git a/vcl/source/app/svdata.cxx b/vcl/source/app/svdata.cxx
index f1065c07ca24..935d2c1894ea 100644
--- a/vcl/source/app/svdata.cxx
+++ b/vcl/source/app/svdata.cxx
@@ -27,47 +27,49 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
+
#include <string.h>
-#ifndef _SV_SVSYS_HXX
-#include <svsys.h>
-#endif
-#include <vcl/salinst.hxx>
-#include <vcl/salframe.hxx>
-
-#ifndef _VOS_MUTEX_HXX
-#include <vos/mutex.hxx>
-#endif
-
-#include <osl/process.h>
-#include <osl/file.hxx>
-#include <uno/current_context.hxx>
-#include <cppuhelper/implbase1.hxx>
-#include <tools/debug.hxx>
-#include <unotools/fontcfg.hxx>
-#include <vcl/configsettings.hxx>
-#include <vcl/svdata.hxx>
-#include <vcl/window.h>
-#include <vcl/svapp.hxx>
-#include <vcl/wrkwin.hxx>
-#include <vcl/msgbox.hxx>
-#include <vcl/unohelp.hxx>
-#include <vcl/button.hxx> // for Button::GetStandardText
-#include <vcl/dockwin.hxx> // for DockingManager
-#include <vcl/salimestatus.hxx>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/awt/XExtendedToolkit.hpp>
-#include <com/sun/star/java/JavaNotConfiguredException.hpp>
-#include <com/sun/star/java/JavaVMCreationFailureException.hpp>
-#include <com/sun/star/java/MissingJavaRuntimeException.hpp>
-#include <com/sun/star/java/JavaDisabledException.hpp>
-
-#include <com/sun/star/lang/XComponent.hpp>
+#include "rtl/instance.hxx"
+#include "osl/process.h"
+#include "osl/file.hxx"
+
+#include "svsys.h"
+
+#include "tools/debug.hxx"
+#include "tools/resary.hxx"
+
+#include "vcl/salinst.hxx"
+#include "vcl/salframe.hxx"
+#include "vcl/configsettings.hxx"
+#include "vcl/svdata.hxx"
+#include "vcl/window.h"
+#include "vcl/svapp.hxx"
+#include "vcl/wrkwin.hxx"
+#include "vcl/msgbox.hxx"
+#include "vcl/unohelp.hxx"
+#include "vcl/button.hxx" // for Button::GetStandardText
+#include "vcl/dockwin.hxx" // for DockingManager
+#include "vcl/salimestatus.hxx"
+#include "vcl/salsys.hxx"
+#include "vcl/svids.hrc"
+
+#include "unotools/fontcfg.hxx"
+
+#include "vos/mutex.hxx"
+
+#include "cppuhelper/implbase1.hxx"
+#include "uno/current_context.hxx"
+
+#include "com/sun/star/lang/XMultiServiceFactory.hpp"
+#include "com/sun/star/lang/XComponent.hpp"
+#include "com/sun/star/awt/XExtendedToolkit.hpp"
+#include "com/sun/star/java/JavaNotConfiguredException.hpp"
+#include "com/sun/star/java/JavaVMCreationFailureException.hpp"
+#include "com/sun/star/java/MissingJavaRuntimeException.hpp"
+#include "com/sun/star/java/JavaDisabledException.hpp"
#include <stdio.h>
-#include <vcl/salsys.hxx>
-#include <vcl/svids.hrc>
-#include <rtl/instance.hxx>
using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
@@ -127,6 +129,9 @@ void ImplInitSVData()
break;
}
}
+
+ // mark default layout border as unitialized
+ pImplSVData->maAppData.mnDefaultLayoutBorder = -1;
}
// -----------------------------------------------------------------------
@@ -162,6 +167,11 @@ void ImplDeInitSVData()
delete pSVData->maAppData.mpMSFTempFileName;
pSVData->maAppData.mpMSFTempFileName = NULL;
}
+
+ if( pSVData->maCtrlData.mpFieldUnitStrings )
+ delete pSVData->maCtrlData.mpFieldUnitStrings, pSVData->maCtrlData.mpFieldUnitStrings = NULL;
+ if( pSVData->maCtrlData.mpCleanUnitStrings )
+ delete pSVData->maCtrlData.mpCleanUnitStrings, pSVData->maCtrlData.mpCleanUnitStrings = NULL;
}
// -----------------------------------------------------------------------
@@ -239,6 +249,52 @@ ResId VclResId( sal_Int32 nId )
return ResId( nId, *pMgr );
}
+FieldUnitStringList* ImplGetFieldUnits()
+{
+ ImplSVData* pSVData = ImplGetSVData();
+ if( ! pSVData->maCtrlData.mpFieldUnitStrings )
+ {
+ ResMgr* pResMgr = ImplGetResMgr();
+ if( pResMgr )
+ {
+ ResStringArray aUnits( ResId (SV_FUNIT_STRINGS, *pResMgr) );
+ sal_uInt32 nUnits = aUnits.Count();
+ pSVData->maCtrlData.mpFieldUnitStrings = new FieldUnitStringList();
+ pSVData->maCtrlData.mpFieldUnitStrings->reserve( nUnits );
+ for( sal_uInt32 i = 0; i < nUnits; i++ )
+ {
+ std::pair< String, FieldUnit > aElement( aUnits.GetString(i), static_cast<FieldUnit>(aUnits.GetValue(i)) );
+ pSVData->maCtrlData.mpFieldUnitStrings->push_back( aElement );
+ }
+ }
+ }
+ return pSVData->maCtrlData.mpFieldUnitStrings;
+}
+
+FieldUnitStringList* ImplGetCleanedFieldUnits()
+{
+ ImplSVData* pSVData = ImplGetSVData();
+ if( ! pSVData->maCtrlData.mpCleanUnitStrings )
+ {
+ FieldUnitStringList* pUnits = ImplGetFieldUnits();
+ if( pUnits )
+ {
+ size_t nUnits = pUnits->size();
+ pSVData->maCtrlData.mpCleanUnitStrings = new FieldUnitStringList();
+ pSVData->maCtrlData.mpCleanUnitStrings->reserve( nUnits );
+ for( size_t i = 0; i < nUnits; i++ )
+ {
+ String aUnit( (*pUnits)[i].first );
+ aUnit.EraseAllChars( sal_Unicode( ' ' ) );
+ aUnit.ToLowerAscii();
+ std::pair< String, FieldUnit > aElement( aUnit, (*pUnits)[i].second );
+ pSVData->maCtrlData.mpCleanUnitStrings->push_back( aElement );
+ }
+ }
+ }
+ return pSVData->maCtrlData.mpCleanUnitStrings;
+}
+
DockingManager* ImplGetDockingManager()
{
ImplSVData* pSVData = ImplGetSVData();
diff --git a/vcl/source/components/factory.cxx b/vcl/source/components/factory.cxx
index 6bed493cacde..7cfdecbfdb00 100644
--- a/vcl/source/components/factory.cxx
+++ b/vcl/source/components/factory.cxx
@@ -62,6 +62,10 @@ extern Sequence< OUString > SAL_CALL FontIdentificator_getSupportedServiceNames(
extern OUString SAL_CALL FontIdentificator_getImplementationName();
extern Reference< XInterface > SAL_CALL FontIdentificator_createInstance( const Reference< XMultiServiceFactory > & );
+extern Sequence< OUString > SAL_CALL StringMirror_getSupportedServiceNames();
+extern OUString SAL_CALL StringMirror_getImplementationName();
+extern Reference< XInterface > SAL_CALL StringMirror_createInstance( const Reference< XMultiServiceFactory > & );
+
extern Sequence< OUString > SAL_CALL Clipboard_getSupportedServiceNames();
extern OUString SAL_CALL Clipboard_getImplementationName();
extern Reference< XSingleServiceFactory > SAL_CALL Clipboard_createFactory( const Reference< XMultiServiceFactory > & );
@@ -84,62 +88,6 @@ extern "C" {
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
- VCL_DLLPUBLIC sal_Bool SAL_CALL component_writeInfo( void* /*pServiceManager*/, void* pXUnoKey )
- {
- if( pXUnoKey )
- {
- try
- {
- Reference< ::com::sun::star::registry::XRegistryKey > xKey( reinterpret_cast< ::com::sun::star::registry::XRegistryKey* >( pXUnoKey ) );
-
- OUStringBuffer aImplName(64);
- aImplName.appendAscii( "/" );
- aImplName.append( vcl_session_getImplementationName() );
- aImplName.appendAscii( "/UNO/SERVICES/" );
- aImplName.append( vcl_session_getSupportedServiceNames()[0] );
- xKey->createKey( aImplName.makeStringAndClear() );
-
- aImplName.appendAscii( "/" );
- aImplName.append( vcl::DisplayAccess_getImplementationName() );
- aImplName.appendAscii( "/UNO/SERVICES/" );
- aImplName.append( vcl::DisplayAccess_getSupportedServiceNames()[0] );
- xKey->createKey( aImplName.makeStringAndClear() );
-
- aImplName.appendAscii( "/" );
- aImplName.append( vcl::FontIdentificator_getImplementationName() );
- aImplName.appendAscii( "/UNO/SERVICES/" );
- aImplName.append( vcl::FontIdentificator_getSupportedServiceNames()[0] );
- xKey->createKey( aImplName.makeStringAndClear() );
-
- #if defined UNX
- aImplName.appendAscii( "/" );
- aImplName.append( vcl::Clipboard_getImplementationName() );
- aImplName.appendAscii( "/UNO/SERVICES/" );
- aImplName.append( vcl::Clipboard_getSupportedServiceNames()[0] );
- xKey->createKey( aImplName.makeStringAndClear() );
-
- aImplName.appendAscii( "/" );
- aImplName.append( vcl::DragSource_getImplementationName() );
- aImplName.appendAscii( "/UNO/SERVICES/" );
- aImplName.append( vcl::DragSource_getSupportedServiceNames()[0] );
- xKey->createKey( aImplName.makeStringAndClear() );
-
- aImplName.appendAscii( "/" );
- aImplName.append( vcl::DropTarget_getImplementationName() );
- aImplName.appendAscii( "/UNO/SERVICES/" );
- aImplName.append( vcl::DropTarget_getSupportedServiceNames()[0] );
- xKey->createKey( aImplName.makeStringAndClear() );
- #endif
-
- return sal_True;
- }
- catch( ::com::sun::star::registry::InvalidRegistryException& )
- {
- }
- }
- return sal_False;
- }
-
VCL_DLLPUBLIC void* SAL_CALL component_getFactory(
const sal_Char* pImplementationName,
void* pXUnoSMgr,
@@ -172,6 +120,12 @@ extern "C" {
xMgr, vcl::FontIdentificator_getImplementationName(), vcl::FontIdentificator_createInstance,
vcl::FontIdentificator_getSupportedServiceNames() );
}
+ else if( vcl::StringMirror_getImplementationName().equalsAscii( pImplementationName ) )
+ {
+ xFactory = ::cppu::createSingleFactory(
+ xMgr, vcl::StringMirror_getImplementationName(), vcl::StringMirror_createInstance,
+ vcl::StringMirror_getSupportedServiceNames() );
+ }
else if( vcl::Clipboard_getImplementationName().equalsAscii( pImplementationName ) )
{
xFactory = vcl::Clipboard_createFactory( xMgr );
diff --git a/vcl/source/components/makefile.mk b/vcl/source/components/makefile.mk
index e30975dbc099..982687104c01 100644
--- a/vcl/source/components/makefile.mk
+++ b/vcl/source/components/makefile.mk
@@ -39,9 +39,10 @@ ENABLE_EXCEPTIONS=TRUE
# --- Files --------------------------------------------------------
-SLOFILES= $(SLO)$/display.obj \
- $(SLO)$/dtranscomp.obj \
- $(SLO)$/fontident.obj \
+SLOFILES= $(SLO)$/display.obj \
+ $(SLO)$/dtranscomp.obj \
+ $(SLO)$/fontident.obj \
+ $(SLO)$/stringmirror.obj \
$(SLO)$/factory.obj
# --- Targets ------------------------------------------------------
diff --git a/vcl/source/components/stringmirror.cxx b/vcl/source/components/stringmirror.cxx
new file mode 100644
index 000000000000..78806914a7c4
--- /dev/null
+++ b/vcl/source/components/stringmirror.cxx
@@ -0,0 +1,123 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_vcl.hxx"
+
+#include "com/sun/star/lang/XServiceInfo.hpp"
+#include "com/sun/star/util/XStringMapping.hpp"
+
+#include "cppuhelper/implbase2.hxx"
+#include "rtl/ustrbuf.hxx"
+#include "vcl/svapp.hxx"
+
+using ::rtl::OUString;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::util;
+
+// -----------------------------------------------------------------------
+
+namespace vcl
+{
+
+class StringMirror : public ::cppu::WeakAggImplHelper2< XStringMapping, XServiceInfo >
+{
+public:
+ StringMirror()
+ {}
+
+ virtual ~StringMirror()
+ {}
+
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName( ) throw (RuntimeException);
+ virtual ::sal_Bool SAL_CALL supportsService( const OUString& ) throw (RuntimeException);
+ virtual Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw (RuntimeException);
+
+ // XStringMapping
+ virtual sal_Bool SAL_CALL mapStrings( Sequence< OUString >& io_rStrings ) throw (RuntimeException)
+ {
+ sal_Int32 nItems = io_rStrings.getLength();
+ for( sal_Int32 n = 0; n < nItems; n++ )
+ {
+ rtl::OUString& rStr( io_rStrings.getArray()[n] );
+
+ sal_Int32 nLen = rStr.getLength();
+ rtl::OUStringBuffer aMirror( nLen );
+ for(sal_Int32 i = nLen - 1; i >= 0; i--)
+ {
+ sal_Unicode cChar = rStr[ i ];
+ aMirror.append(sal_Unicode(GetMirroredChar(cChar)));
+ }
+ rStr = aMirror.makeStringAndClear();
+ }
+ return sal_True;
+ }
+};
+
+Sequence< OUString > StringMirror_getSupportedServiceNames()
+{
+ static OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.StringMirror" ) );
+ static Sequence< OUString > aServiceNames( &aServiceName, 1 );
+ return aServiceNames;
+}
+
+OUString StringMirror_getImplementationName()
+{
+ return OUString( RTL_CONSTASCII_USTRINGPARAM( "vcl::StringMirror" ) );
+}
+
+Reference< XInterface > SAL_CALL StringMirror_createInstance( const Reference< XMultiServiceFactory >& )
+{
+ return static_cast< ::cppu::OWeakObject * >( new StringMirror );
+}
+
+
+// XServiceInfo
+OUString SAL_CALL StringMirror::getImplementationName() throw (RuntimeException)
+{
+ return StringMirror_getImplementationName();
+}
+
+sal_Bool SAL_CALL StringMirror::supportsService( const OUString& i_rServiceName ) throw (RuntimeException)
+{
+ Sequence< OUString > aSN( StringMirror_getSupportedServiceNames() );
+ for( sal_Int32 nService = 0; nService < aSN.getLength(); nService++ )
+ {
+ if( aSN[nService] == i_rServiceName )
+ return sal_True;
+ }
+ return sal_False;
+}
+
+Sequence< OUString > SAL_CALL StringMirror::getSupportedServiceNames() throw (RuntimeException)
+{
+ return StringMirror_getSupportedServiceNames();
+}
+
+} // namespace vcl
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index d4f29e224e7b..db7649a90258 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -896,7 +896,8 @@ void PushButton::ImplInitSettings( BOOL bFont,
// #i38498#: do not check for GetParent()->IsChildTransparentModeEnabled()
// otherwise the formcontrol button will be overdrawn due to PARENTCLIPMODE_NOCLIP
// for radio and checkbox this is ok as they shoud appear transparent in documents
- if ( IsNativeControlSupported( CTRL_PUSHBUTTON, PART_ENTIRE_CONTROL ) )
+ if ( IsNativeControlSupported( CTRL_PUSHBUTTON, PART_ENTIRE_CONTROL ) ||
+ (GetStyle() & WB_FLATBUTTON) != 0 )
{
EnableChildTransparentMode( TRUE );
SetParentClipMode( PARENTCLIPMODE_NOCLIP );
@@ -1155,7 +1156,9 @@ static void ImplDrawBtnDropDownArrow( OutputDevice* pDev,
void PushButton::ImplDrawPushButtonContent( OutputDevice* pDev, ULONG nDrawFlags,
const Rectangle& rRect,
- bool bLayout )
+ bool bLayout,
+ bool bMenuBtnSep
+ )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
Rectangle aInRect = rRect;
@@ -1203,19 +1206,22 @@ void PushButton::ImplDrawPushButtonContent( OutputDevice* pDev, ULONG nDrawFlags
aSize.Width() -= ( 5 + nSymbolSize );
ImplDrawAlignedImage( pDev, aPos, aSize, bLayout, nImageSep,
- nDrawFlags, nTextStyle, NULL, (GetStyle() & WB_FLATBUTTON) != 0 );
+ nDrawFlags, nTextStyle, NULL, true );
}
else
ImplCalcSymbolRect( aInRect );
if( ! bLayout )
{
- DecorationView aDecoView( pDev );
long nDistance = (aInRect.GetHeight() > 10) ? 2 : 1;
- long nX = aInRect.Left() - 2*nDistance;;
- Point aStartPt( nX, aInRect.Top()+nDistance );
- Point aEndPt( nX, aInRect.Bottom()-nDistance );
- aDecoView.DrawSeparator( aStartPt, aEndPt );
+ DecorationView aDecoView( pDev );
+ if( bMenuBtnSep )
+ {
+ long nX = aInRect.Left() - 2*nDistance;;
+ Point aStartPt( nX, aInRect.Top()+nDistance );
+ Point aEndPt( nX, aInRect.Bottom()-nDistance );
+ aDecoView.DrawSeparator( aStartPt, aEndPt );
+ }
aDecoView.DrawSymbol( aInRect, SYMBOL_SPIN_DOWN, aColor, nStyle );
aInRect.Left() -= 2*nDistance;
ImplSetSymbolRect( aInRect );
@@ -1227,7 +1233,7 @@ void PushButton::ImplDrawPushButtonContent( OutputDevice* pDev, ULONG nDrawFlags
// FIXME: (GetStyle() & WB_FLATBUTTON) != 0 is preliminary
// in the next major this should be replaced by "true"
ImplDrawAlignedImage( pDev, aPos, aSize, bLayout, nImageSep, nDrawFlags,
- nTextStyle, IsSymbol() ? &aSymbolRect : NULL, (GetStyle() & WB_FLATBUTTON) != 0 );
+ nTextStyle, IsSymbol() ? &aSymbolRect : NULL, true );
if ( IsSymbol() && ! bLayout )
{
@@ -1356,6 +1362,12 @@ void PushButton::ImplDrawPushButton( bool bLayout )
return;
bool bRollOver = (IsMouseOver() && aInRect.IsInside( GetPointerPosPixel() ));
+ bool bDrawMenuSep = true;
+ if( (GetStyle() & WB_FLATBUTTON) )
+ {
+ if( ! bRollOver && ! HasFocus() )
+ bDrawMenuSep = false;
+ }
if ( (bNativeOK=IsNativeControlSupported(CTRL_PUSHBUTTON, PART_ENTIRE_CONTROL)) == TRUE )
{
PushButtonValue aControlValue;
@@ -1406,7 +1418,7 @@ void PushButton::ImplDrawPushButton( bool bLayout )
// draw content using the same aInRect as non-native VCL would do
ImplDrawPushButtonContent( this,
(nState&CTRL_STATE_ROLLOVER) ? WINDOW_DRAW_ROLLOVER : 0,
- aInRect, bLayout );
+ aInRect, bLayout, bDrawMenuSep );
if ( HasFocus() )
ShowFocus( ImplGetFocusRect() );
@@ -1432,7 +1444,7 @@ void PushButton::ImplDrawPushButton( bool bLayout )
}
// draw content
- ImplDrawPushButtonContent( this, 0, aInRect, bLayout );
+ ImplDrawPushButtonContent( this, 0, aInRect, bLayout, bDrawMenuSep );
if( ! bLayout && HasFocus() )
{
@@ -1753,7 +1765,7 @@ void PushButton::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
nButtonStyle |= BUTTON_DRAW_CHECKED;
aRect = aDecoView.DrawButton( aRect, nButtonStyle );
- ImplDrawPushButtonContent( pDev, nFlags, aRect, false );
+ ImplDrawPushButtonContent( pDev, nFlags, aRect, false, true );
pDev->Pop();
}
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index c0e7b352642c..5091a4722845 100644..100755
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -122,6 +122,7 @@ struct DDInfo
BOOL bStarterOfDD;
BOOL bDroppedInMe;
BOOL bVisCursor;
+ BOOL bIsStringSupported;
DDInfo()
{
@@ -130,6 +131,7 @@ struct DDInfo
bStarterOfDD = FALSE;
bDroppedInMe = FALSE;
bVisCursor = FALSE;
+ bIsStringSupported = FALSE;
}
};
@@ -1799,6 +1801,9 @@ BOOL Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
}
break;
+ /* #i101255# disable autocomplete tab forward/backward
+ users expect tab/shif-tab to move the focus to other controls
+ not suddenly to cycle the autocompletion
case KEY_TAB:
{
if ( !mbReadOnly && maAutocompleteHdl.IsSet() &&
@@ -1820,6 +1825,7 @@ BOOL Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
}
}
break;
+ */
default:
{
@@ -2861,6 +2867,14 @@ Size Edit::CalcMinimumSize() const
return aSize;
}
+Size Edit::GetMinimumEditSize()
+{
+ Window* pDefWin = ImplGetDefaultWindow();
+ Edit aEdit( pDefWin, WB_BORDER );
+ Size aSize( aEdit.CalcMinimumSize() );
+ return aSize;
+}
+
// -----------------------------------------------------------------------
Size Edit::GetOptimalSize(WindowSizeType eType) const
@@ -3054,17 +3068,26 @@ void Edit::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEvent&
rDTDE.Context->dropComplete( bChanges );
}
-void Edit::dragEnter( const ::com::sun::star::datatransfer::dnd::DropTargetDragEnterEvent& ) throw (::com::sun::star::uno::RuntimeException)
+void Edit::dragEnter( const ::com::sun::star::datatransfer::dnd::DropTargetDragEnterEvent& rDTDE ) throw (::com::sun::star::uno::RuntimeException)
{
if ( !mpDDInfo )
{
mpDDInfo = new DDInfo;
}
-// sal_Bool bTextContent = mbReadOnly ? sal_False : sal_True; // quiery from rDTDEE.SupportedDataFlavors()
-// if ( bTextContent )
-// rDTDEE.Context->acceptDrop(datatransfer::dnd::DNDConstants::ACTION_COPY_OR_MOVE);
-// else
-// rDTDEE.Context->rejectDrop();
+ // search for string data type
+ const Sequence< com::sun::star::datatransfer::DataFlavor >& rFlavors( rDTDE.SupportedDataFlavors );
+ sal_Int32 nEle = rFlavors.getLength();
+ mpDDInfo->bIsStringSupported = FALSE;
+ for( sal_Int32 i = 0; i < nEle; i++ )
+ {
+ sal_Int32 nIndex = 0;
+ rtl::OUString aMimetype = rFlavors[i].MimeType.getToken( 0, ';', nIndex );
+ if( aMimetype.equalsAscii( "text/plain" ) )
+ {
+ mpDDInfo->bIsStringSupported = TRUE;
+ break;
+ }
+ }
}
void Edit::dragExit( const ::com::sun::star::datatransfer::dnd::DropTargetEvent& ) throw (::com::sun::star::uno::RuntimeException)
@@ -3096,7 +3119,7 @@ void Edit::dragOver( const ::com::sun::star::datatransfer::dnd::DropTargetDragEv
aSel.Justify();
// Don't accept drop in selection or read-only field...
- if ( IsReadOnly() || aSel.IsInside( mpDDInfo->nDropPos ) )
+ if ( IsReadOnly() || aSel.IsInside( mpDDInfo->nDropPos ) || ! mpDDInfo->bIsStringSupported )
{
ImplHideDDCursor();
rDTDE.Context->rejectDrag();
diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx
index 090aa2a84163..4c4e3c870429 100644
--- a/vcl/source/control/field.cxx
+++ b/vcl/source/control/field.cxx
@@ -52,8 +52,6 @@
using namespace ::com::sun::star;
-static ResStringArray *strAllUnits = NULL;
-
// -----------------------------------------------------------------------
#define FORMAT_NUMERIC 1
@@ -224,6 +222,42 @@ static BOOL ImplNumericGetValue( const XubString& rStr, double& rValue,
return TRUE;
}
+static void ImplUpdateSeparatorString( String& io_rText,
+ const String& rOldDecSep, const String& rNewDecSep,
+ const String& rOldThSep, const String& rNewThSep )
+{
+ rtl::OUStringBuffer aBuf( io_rText.Len() );
+ xub_StrLen nIndexDec = 0, nIndexTh = 0, nIndex = 0;
+
+ const sal_Unicode* pBuffer = io_rText.GetBuffer();
+ while( nIndex != STRING_NOTFOUND )
+ {
+ nIndexDec = io_rText.Search( rOldDecSep, nIndex );
+ nIndexTh = io_rText.Search( rOldThSep, nIndex );
+ if( (nIndexTh != STRING_NOTFOUND && nIndexDec != STRING_NOTFOUND && nIndexTh < nIndexDec )
+ || (nIndexTh != STRING_NOTFOUND && nIndexDec == STRING_NOTFOUND)
+ )
+ {
+ aBuf.append( pBuffer + nIndex, nIndexTh - nIndex );
+ aBuf.append( rNewThSep );
+ nIndex = nIndexTh + rOldThSep.Len();
+ }
+ else if( nIndexDec != STRING_NOTFOUND )
+ {
+ aBuf.append( pBuffer + nIndex, nIndexDec - nIndex );
+ aBuf.append( rNewDecSep );
+ nIndex = nIndexDec + rOldDecSep.Len();
+ }
+ else
+ {
+ aBuf.append( pBuffer + nIndex );
+ nIndex = STRING_NOTFOUND;
+ }
+ }
+
+ io_rText = aBuf.makeStringAndClear();
+}
+
static void ImplUpdateSeparators( const String& rOldDecSep, const String& rNewDecSep,
const String& rOldThSep, const String& rNewThSep,
Edit* pEdit )
@@ -236,10 +270,7 @@ static void ImplUpdateSeparators( const String& rOldDecSep, const String& rNewDe
BOOL bUpdateMode = pEdit->IsUpdateMode();
pEdit->SetUpdateMode( FALSE );
String aText = pEdit->GetText();
- if( bChangeDec )
- aText.SearchAndReplaceAll( rNewDecSep, rOldDecSep );
- if( bChangeTh )
- aText.SearchAndReplaceAll( rNewThSep, rOldThSep );
+ ImplUpdateSeparatorString( aText, rOldDecSep, rNewDecSep, rOldThSep, rNewThSep );
pEdit->SetText( aText );
ComboBox* pCombo = dynamic_cast<ComboBox*>(pEdit);
@@ -250,12 +281,11 @@ static void ImplUpdateSeparators( const String& rOldDecSep, const String& rNewDe
for ( USHORT i=0; i < nEntryCount; i++ )
{
aText = pCombo->GetEntry( i );
- if( bChangeDec )
- aText.SearchAndReplaceAll( rNewDecSep, rOldDecSep );
- if( bChangeTh )
- aText.SearchAndReplaceAll( rNewThSep, rOldThSep );
+ void* pEntryData = pCombo->GetEntryData( i );
+ ImplUpdateSeparatorString( aText, rOldDecSep, rNewDecSep, rOldThSep, rNewThSep );
pCombo->RemoveEntry( i );
pCombo->InsertEntry( aText, i );
+ pCombo->SetEntryData( i, pEntryData );
}
}
if( bUpdateMode )
@@ -1099,34 +1129,37 @@ static XubString ImplMetricGetUnitText( const XubString& rStr )
// #104355# support localized mesaurements
-static String ImplMetricToString( FieldUnit rUnit )
+static const String& ImplMetricToString( FieldUnit rUnit )
{
- if( !strAllUnits )
+ FieldUnitStringList* pList = ImplGetFieldUnits();
+ if( pList )
{
- ResMgr* pResMgr = ImplGetResMgr();
- strAllUnits = new ResStringArray( ResId (SV_FUNIT_STRINGS, *pResMgr) );
+ // return unit's default string (ie, the first one )
+ for( FieldUnitStringList::const_iterator it = pList->begin(); it != pList->end(); ++it )
+ {
+ if ( it->second == rUnit )
+ return it->first;
+ }
}
- // return unit's default string (ie, the first one )
- for( USHORT i=0; i < strAllUnits->Count(); i++ )
- if( (FieldUnit) strAllUnits->GetValue( i ) == rUnit )
- return strAllUnits->GetString( i );
- return String();
+ return String::EmptyString();
}
static FieldUnit ImplStringToMetric( const String &rMetricString )
{
- if( !strAllUnits )
+ FieldUnitStringList* pList = ImplGetCleanedFieldUnits();
+ if( pList )
{
- ResMgr* pResMgr = ImplGetResMgr();
- strAllUnits = new ResStringArray( ResId (SV_FUNIT_STRINGS, *pResMgr) );
+ // return FieldUnit
+ String aStr( rMetricString );
+ aStr.ToLowerAscii();
+ aStr.EraseAllChars( sal_Unicode( ' ' ) );
+ for( FieldUnitStringList::const_iterator it = pList->begin(); it != pList->end(); ++it )
+ {
+ if ( it->first.Equals( aStr ) )
+ return it->second;
+ }
}
- // return FieldUnit
- String aStr( rMetricString );
- aStr.ToLowerAscii();
- for( USHORT i=0; i < strAllUnits->Count(); i++ )
- if ( strAllUnits->GetString( i ).Equals( aStr ) )
- return (FieldUnit) strAllUnits->GetValue( i );
return FUNIT_NONE;
}
diff --git a/vcl/source/control/fixed.cxx b/vcl/source/control/fixed.cxx
index 37406293d7cf..f73cf008a5e5 100644
--- a/vcl/source/control/fixed.cxx
+++ b/vcl/source/control/fixed.cxx
@@ -27,13 +27,13 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#include <vcl/decoview.hxx>
-#include <vcl/event.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/controldata.hxx>
-#include <vcl/window.h>
+#include "vcl/decoview.hxx"
+#include "vcl/event.hxx"
+#include "vcl/fixed.hxx"
+#include "vcl/controldata.hxx"
+#include "vcl/window.h"
-#include <tools/rc.h>
+#include "tools/rc.h"
// =======================================================================
@@ -501,7 +501,7 @@ void FixedLine::ImplDraw( bool bLayout )
String* pDisplayText = bLayout ? &mpControlData->mpLayoutData->m_aDisplayText : NULL;
DecorationView aDecoView( this );
- if ( !aText.Len() || (nWinStyle & WB_VERT) )
+ if ( !aText.Len() )
{
if( !pVector )
{
@@ -520,11 +520,34 @@ void FixedLine::ImplDraw( bool bLayout )
}
}
}
+ else if( (nWinStyle & WB_VERT) )
+ {
+ long nWidth = GetTextWidth( aText );
+ Push( PUSH_FONT );
+ Font aFont( GetFont() );
+ aFont.SetOrientation( 900 );
+ SetFont( aFont );
+ Point aStartPt( aOutSize.Width()/2, aOutSize.Height()-1 );
+ if( (nWinStyle & WB_VCENTER) )
+ aStartPt.Y() -= (aOutSize.Height() - nWidth)/2;
+ Point aTextPt( aStartPt );
+ aTextPt.X() -= GetTextHeight()/2;
+ DrawText( aTextPt, aText, 0, STRING_LEN, pVector, pDisplayText );
+ Pop();
+ if( aOutSize.Height() - aStartPt.Y() > FIXEDLINE_TEXT_BORDER )
+ aDecoView.DrawSeparator( Point( aStartPt.X(), aOutSize.Height()-1 ),
+ Point( aStartPt.X(), aStartPt.Y() + FIXEDLINE_TEXT_BORDER ) );
+ if( aStartPt.Y() - nWidth - FIXEDLINE_TEXT_BORDER > 0 )
+ aDecoView.DrawSeparator( Point( aStartPt.X(), aStartPt.Y() - nWidth - FIXEDLINE_TEXT_BORDER ),
+ Point( aStartPt.X(), 0 ) );
+ }
else
{
USHORT nStyle = TEXT_DRAW_MNEMONIC | TEXT_DRAW_LEFT | TEXT_DRAW_VCENTER | TEXT_DRAW_ENDELLIPSIS;
Rectangle aRect( 0, 0, aOutSize.Width(), aOutSize.Height() );
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+ if( (nWinStyle & WB_CENTER) )
+ nStyle |= TEXT_DRAW_CENTER;
if ( !IsEnabled() )
nStyle |= TEXT_DRAW_DISABLE;
@@ -539,6 +562,8 @@ void FixedLine::ImplDraw( bool bLayout )
{
long nTop = aRect.Top() + ((aRect.GetHeight()-1)/2);
aDecoView.DrawSeparator( Point( aRect.Right()+FIXEDLINE_TEXT_BORDER, nTop ), Point( aOutSize.Width()-1, nTop ), false );
+ if( aRect.Left() > FIXEDLINE_TEXT_BORDER )
+ aDecoView.DrawSeparator( Point( 0, nTop ), Point( aRect.Left()-FIXEDLINE_TEXT_BORDER, nTop ), false );
}
}
}
diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx
index 02c8d2b5fcb3..bd0179ffe454 100644
--- a/vcl/source/control/ilstbox.cxx
+++ b/vcl/source/control/ilstbox.cxx
@@ -529,7 +529,8 @@ USHORT ImplEntryList::FindFirstSelectable( USHORT nPos, bool bForward /* = true
// =======================================================================
ImplListBoxWindow::ImplListBoxWindow( Window* pParent, WinBits nWinStyle ) :
- Control( pParent, 0 )
+ Control( pParent, 0 ),
+ maQuickSelectionEngine( *this )
{
mpEntryList = new ImplEntryList( this );
@@ -568,9 +569,6 @@ ImplListBoxWindow::ImplListBoxWindow( Window* pParent, WinBits nWinStyle ) :
SetTextFillColor();
SetBackground( Wallpaper( GetSettings().GetStyleSettings().GetFieldColor() ) );
- maSearchTimeout.SetTimeout( 2500 );
- maSearchTimeout.SetTimeoutHdl( LINK( this, ImplListBoxWindow, SearchStringTimeout ) );
-
ImplInitSettings( TRUE, TRUE, TRUE );
ImplCalcMetrics();
}
@@ -579,7 +577,6 @@ ImplListBoxWindow::ImplListBoxWindow( Window* pParent, WinBits nWinStyle ) :
ImplListBoxWindow::~ImplListBoxWindow()
{
- maSearchTimeout.Stop();
delete mpEntryList;
}
@@ -624,14 +621,6 @@ void ImplListBoxWindow::ImplCalcMetrics()
// -----------------------------------------------------------------------
-IMPL_LINK( ImplListBoxWindow, SearchStringTimeout, Timer*, EMPTYARG )
-{
- maSearchStr.Erase();
- return 1;
-}
-
-// -----------------------------------------------------------------------
-
void ImplListBoxWindow::Clear()
{
mpEntryList->Clear();
@@ -648,6 +637,7 @@ void ImplListBoxWindow::Clear()
ImplClearLayoutData();
mnCurrentPos = LISTBOX_ENTRY_NOTFOUND;
+ maQuickSelectionEngine.Reset();
Invalidate();
}
@@ -918,7 +908,7 @@ USHORT ImplListBoxWindow::GetLastVisibleEntry() const
void ImplListBoxWindow::MouseButtonDown( const MouseEvent& rMEvt )
{
mbMouseMoveSelect = FALSE; // Nur bis zum ersten MouseButtonDown
- maSearchStr.Erase();
+ maQuickSelectionEngine.Reset();
if ( !IsReadOnly() )
{
@@ -1465,7 +1455,7 @@ BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
bDone = TRUE;
}
- maSearchStr.Erase();
+ maQuickSelectionEngine.Reset();
}
break;
@@ -1492,7 +1482,7 @@ BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
bDone = TRUE;
}
- maSearchStr.Erase();
+ maQuickSelectionEngine.Reset();
}
break;
@@ -1523,7 +1513,7 @@ BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
}
bDone = TRUE;
}
- maSearchStr.Erase();
+ maQuickSelectionEngine.Reset();
}
break;
@@ -1557,7 +1547,7 @@ BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
}
bDone = TRUE;
}
- maSearchStr.Erase();
+ maQuickSelectionEngine.Reset();
}
break;
@@ -1578,7 +1568,7 @@ BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
bDone = TRUE;
}
}
- maSearchStr.Erase();
+ maQuickSelectionEngine.Reset();
}
break;
@@ -1604,7 +1594,7 @@ BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
}
bDone = TRUE;
}
- maSearchStr.Erase();
+ maQuickSelectionEngine.Reset();
}
break;
@@ -1615,7 +1605,7 @@ BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
ScrollHorz( -HORZ_SCROLL );
bDone = TRUE;
}
- maSearchStr.Erase();
+ maQuickSelectionEngine.Reset();
}
break;
@@ -1626,7 +1616,7 @@ BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
ScrollHorz( HORZ_SCROLL );
bDone = TRUE;
}
- maSearchStr.Erase();
+ maQuickSelectionEngine.Reset();
}
break;
@@ -1638,7 +1628,7 @@ BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
ImplCallSelect();
bDone = FALSE; // RETURN nicht abfangen.
}
- maSearchStr.Erase();
+ maQuickSelectionEngine.Reset();
}
break;
@@ -1653,7 +1643,7 @@ BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
}
bDone = TRUE;
}
- maSearchStr.Erase();
+ maQuickSelectionEngine.Reset();
}
break;
@@ -1673,7 +1663,7 @@ BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
SetUpdateMode( bUpdates );
Invalidate();
- maSearchStr.Erase();
+ maQuickSelectionEngine.Reset();
bDone = TRUE;
break;
@@ -1682,43 +1672,12 @@ BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
// fall through intentional
default:
{
- xub_Unicode c = rKEvt.GetCharCode();
-
- if ( !IsReadOnly() && (c >= 32) && (c != 127) && !rKEvt.GetKeyCode().IsMod2() )
+ if ( !IsReadOnly() )
{
- maSearchStr += c;
- XubString aTmpSearch( maSearchStr );
-
- nSelect = mpEntryList->FindMatchingEntry( aTmpSearch, mnCurrentPos );
- if ( (nSelect == LISTBOX_ENTRY_NOTFOUND) && (aTmpSearch.Len() > 1) )
- {
- // Wenn alles die gleichen Buchstaben, dann anderer Such-Modus
- BOOL bAllEqual = TRUE;
- for ( USHORT n = aTmpSearch.Len(); n && bAllEqual; )
- bAllEqual = aTmpSearch.GetChar( --n ) == c;
- if ( bAllEqual )
- {
- aTmpSearch = c;
- nSelect = mpEntryList->FindMatchingEntry( aTmpSearch, mnCurrentPos+1 );
- }
- }
- if ( nSelect == LISTBOX_ENTRY_NOTFOUND )
- nSelect = mpEntryList->FindMatchingEntry( aTmpSearch, 0 );
-
- if ( nSelect != LISTBOX_ENTRY_NOTFOUND )
- {
- ShowProminentEntry( nSelect );
-
- if ( mpEntryList->IsEntryPosSelected( nSelect ) )
- nSelect = LISTBOX_ENTRY_NOTFOUND;
-
- maSearchTimeout.Start();
- }
- else
- maSearchStr.Erase();
- bDone = TRUE;
+ bDone = maQuickSelectionEngine.HandleKeyEvent( rKEvt );
}
- }
+ }
+ break;
}
if ( ( nSelect != LISTBOX_ENTRY_NOTFOUND )
@@ -1744,6 +1703,72 @@ BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
}
// -----------------------------------------------------------------------
+namespace
+{
+ static ::vcl::StringEntryIdentifier lcl_getEntry( const ImplEntryList& _rList, USHORT _nPos, String& _out_entryText )
+ {
+ OSL_PRECOND( ( _nPos != LISTBOX_ENTRY_NOTFOUND ), "lcl_getEntry: invalid position!" );
+ USHORT nEntryCount( _rList.GetEntryCount() );
+ if ( _nPos >= nEntryCount )
+ _nPos = 0;
+ _out_entryText = _rList.GetEntryText( _nPos );
+
+ // ::vcl::StringEntryIdentifier does not allow for 0 values, but our position is 0-based
+ // => normalize
+ return reinterpret_cast< ::vcl::StringEntryIdentifier >( _nPos + 1 );
+ }
+
+ static USHORT lcl_getEntryPos( ::vcl::StringEntryIdentifier _entry )
+ {
+ // our pos is 0-based, but StringEntryIdentifier does not allow for a NULL
+ return static_cast< USHORT >( reinterpret_cast< sal_Int64 >( _entry ) ) - 1;
+ }
+}
+
+// -----------------------------------------------------------------------
+::vcl::StringEntryIdentifier ImplListBoxWindow::CurrentEntry( String& _out_entryText ) const
+{
+ return lcl_getEntry( *GetEntryList(), ( mnCurrentPos == LISTBOX_ENTRY_NOTFOUND ) ? 0 : mnCurrentPos + 1, _out_entryText );
+}
+
+// -----------------------------------------------------------------------
+::vcl::StringEntryIdentifier ImplListBoxWindow::NextEntry( ::vcl::StringEntryIdentifier _currentEntry, String& _out_entryText ) const
+{
+ USHORT nNextPos = lcl_getEntryPos( _currentEntry ) + 1;
+ return lcl_getEntry( *GetEntryList(), nNextPos, _out_entryText );
+}
+
+// -----------------------------------------------------------------------
+void ImplListBoxWindow::SelectEntry( ::vcl::StringEntryIdentifier _entry )
+{
+ USHORT nSelect = lcl_getEntryPos( _entry );
+ if ( mpEntryList->IsEntryPosSelected( nSelect ) )
+ {
+ // ignore that. This method is a callback from the QuickSelectionEngine, which means the user attempted
+ // to select the given entry by typing its starting letters. No need to act.
+ return;
+ }
+
+ // normalize
+ OSL_ENSURE( nSelect < mpEntryList->GetEntryCount(), "ImplListBoxWindow::SelectEntry: how that?" );
+ if( nSelect >= mpEntryList->GetEntryCount() )
+ nSelect = mpEntryList->GetEntryCount()-1;
+
+ // make visible
+ ShowProminentEntry( nSelect );
+
+ // actually select
+ mnCurrentPos = nSelect;
+ if ( SelectEntries( nSelect, LET_KEYMOVE, FALSE, FALSE ) )
+ {
+ mbTravelSelect = TRUE;
+ mnSelectModifier = 0;
+ ImplCallSelect();
+ mbTravelSelect = FALSE;
+ }
+}
+
+// -----------------------------------------------------------------------
void ImplListBoxWindow::ImplPaint( USHORT nPos, BOOL bErase, bool bLayout )
{
@@ -2356,7 +2381,11 @@ IMPL_LINK( ImplListBox, MRUChanged, void*, EMPTYARG )
IMPL_LINK( ImplListBox, LBWindowScrolled, void*, EMPTYARG )
{
+ long nSet = GetTopEntry();
+ if( nSet > mpVScrollBar->GetRangeMax() )
+ mpVScrollBar->SetRangeMax( GetEntryList()->GetEntryCount() );
mpVScrollBar->SetThumbPos( GetTopEntry() );
+
mpHScrollBar->SetThumbPos( GetLeftIndent() );
maScrollHdl.Call( this );
@@ -2395,7 +2424,11 @@ void ImplListBox::ImplCheckScrollBars()
mbVScroll = TRUE;
// Ueberpruefung des rausgescrollten Bereichs
- SetTopEntry( GetTopEntry() ); // MaxTop wird geprueft...
+ if( GetEntryList()->GetSelectEntryCount() == 1 &&
+ GetEntryList()->GetSelectEntryPos( 0 ) != LISTBOX_ENTRY_NOTFOUND )
+ ShowProminentEntry( GetEntryList()->GetSelectEntryPos( 0 ) );
+ else
+ SetTopEntry( GetTopEntry() ); // MaxTop wird geprueft...
}
else
{
@@ -2428,7 +2461,11 @@ void ImplListBox::ImplCheckScrollBars()
mbVScroll = TRUE;
// Ueberpruefung des rausgescrollten Bereichs
- SetTopEntry( GetTopEntry() ); // MaxTop wird geprueft...
+ if( GetEntryList()->GetSelectEntryCount() == 1 &&
+ GetEntryList()->GetSelectEntryPos( 0 ) != LISTBOX_ENTRY_NOTFOUND )
+ ShowProminentEntry( GetEntryList()->GetSelectEntryPos( 0 ) );
+ else
+ SetTopEntry( GetTopEntry() ); // MaxTop wird geprueft...
}
}
diff --git a/vcl/source/control/makefile.mk b/vcl/source/control/makefile.mk
index a2553333246d..b1644e58ccd9 100644
--- a/vcl/source/control/makefile.mk
+++ b/vcl/source/control/makefile.mk
@@ -62,7 +62,8 @@ SLOFILES= $(SLO)$/button.obj \
$(SLO)$/slider.obj \
$(SLO)$/spinfld.obj \
$(SLO)$/spinbtn.obj \
- $(SLO)$/tabctrl.obj
+ $(SLO)$/tabctrl.obj \
+ $(SLO)$/quickselectionengine.obj
EXCEPTIONSFILES= \
$(SLO)$/button.obj \
diff --git a/vcl/source/control/quickselectionengine.cxx b/vcl/source/control/quickselectionengine.cxx
new file mode 100644
index 000000000000..2d32393bf79a
--- /dev/null
+++ b/vcl/source/control/quickselectionengine.cxx
@@ -0,0 +1,183 @@
+/*************************************************************************
+* 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_vcl.hxx"
+
+#include "vcl/quickselectionengine.hxx"
+#include "vcl/event.hxx"
+#include "vcl/timer.hxx"
+#include "vcl/i18nhelp.hxx"
+#include "vcl/svapp.hxx"
+
+#include <boost/optional.hpp>
+
+//........................................................................
+namespace vcl
+{
+//........................................................................
+
+ //====================================================================
+ //= QuickSelectionEngine_Data
+ //====================================================================
+ struct QuickSelectionEngine_Data
+ {
+ ISearchableStringList& rEntryList;
+ String sCurrentSearchString;
+ ::boost::optional< sal_Unicode > aSingleSearchChar;
+ Timer aSearchTimeout;
+
+ QuickSelectionEngine_Data( ISearchableStringList& _entryList )
+ :rEntryList( _entryList )
+ ,sCurrentSearchString()
+ ,aSingleSearchChar()
+ ,aSearchTimeout()
+ {
+ aSearchTimeout.SetTimeout( 2500 );
+ aSearchTimeout.SetTimeoutHdl( LINK( this, QuickSelectionEngine_Data, SearchStringTimeout ) );
+ }
+
+ ~QuickSelectionEngine_Data()
+ {
+ aSearchTimeout.Stop();
+ }
+
+ DECL_LINK( SearchStringTimeout, Timer* );
+ };
+
+ //--------------------------------------------------------------------
+ namespace
+ {
+ static void lcl_reset( QuickSelectionEngine_Data& _data )
+ {
+ _data.sCurrentSearchString.Erase();
+ _data.aSingleSearchChar.reset();
+ _data.aSearchTimeout.Stop();
+ }
+ }
+
+ //--------------------------------------------------------------------
+ IMPL_LINK( QuickSelectionEngine_Data, SearchStringTimeout, Timer*, /*EMPTYARG*/ )
+ {
+ lcl_reset( *this );
+ return 1;
+ }
+
+ //--------------------------------------------------------------------
+ static StringEntryIdentifier findMatchingEntry( const String& _searchString, QuickSelectionEngine_Data& _engineData )
+ {
+ const vcl::I18nHelper& rI18nHelper = Application::GetSettings().GetLocaleI18nHelper();
+ // TODO: do we really need the Window's settings here? The original code used it ...
+
+ String sEntryText;
+ // get the "current + 1" entry
+ StringEntryIdentifier pSearchEntry = _engineData.rEntryList.CurrentEntry( sEntryText );
+ if ( pSearchEntry )
+ pSearchEntry = _engineData.rEntryList.NextEntry( pSearchEntry, sEntryText );
+ // loop 'til we find another matching entry
+ StringEntryIdentifier pStartedWith = pSearchEntry;
+ while ( pSearchEntry )
+ {
+ if ( rI18nHelper.MatchString( _searchString, sEntryText ) != 0 )
+ break;
+
+ pSearchEntry = _engineData.rEntryList.NextEntry( pSearchEntry, sEntryText );
+ if ( pSearchEntry == pStartedWith )
+ pSearchEntry = NULL;
+ }
+
+ return pSearchEntry;
+ }
+
+ //====================================================================
+ //= QuickSelectionEngine
+ //====================================================================
+ //--------------------------------------------------------------------
+ QuickSelectionEngine::QuickSelectionEngine( ISearchableStringList& _entryList )
+ :m_pData( new QuickSelectionEngine_Data( _entryList ) )
+ {
+ }
+
+ //--------------------------------------------------------------------
+ QuickSelectionEngine::~QuickSelectionEngine()
+ {
+ }
+
+ //--------------------------------------------------------------------
+ bool QuickSelectionEngine::HandleKeyEvent( const KeyEvent& _keyEvent )
+ {
+ xub_Unicode c = _keyEvent.GetCharCode();
+
+ if ( ( c >= 32 ) && ( c != 127 ) && !_keyEvent.GetKeyCode().IsMod2() )
+ {
+ m_pData->sCurrentSearchString += c;
+ OSL_TRACE( "QuickSelectionEngine::HandleKeyEvent: searching for %s", ByteString( m_pData->sCurrentSearchString, RTL_TEXTENCODING_UTF8 ).GetBuffer() );
+
+ if ( m_pData->sCurrentSearchString.Len() == 1 )
+ { // first character in the search -> remmeber
+ m_pData->aSingleSearchChar.reset( c );
+ }
+ else if ( m_pData->sCurrentSearchString.Len() > 1 )
+ {
+ if ( !!m_pData->aSingleSearchChar && ( *m_pData->aSingleSearchChar != c ) )
+ // we already have a "single char", but the current one is different -> reset
+ m_pData->aSingleSearchChar.reset();
+ }
+
+ XubString aSearchTemp( m_pData->sCurrentSearchString );
+
+ StringEntryIdentifier pMatchingEntry = findMatchingEntry( aSearchTemp, *m_pData );
+ OSL_TRACE( "QuickSelectionEngine::HandleKeyEvent: found %p", pMatchingEntry );
+ if ( !pMatchingEntry && ( aSearchTemp.Len() > 1 ) && !!m_pData->aSingleSearchChar )
+ {
+ // if there's only one letter in the search string, use a different search mode
+ aSearchTemp = *m_pData->aSingleSearchChar;
+ pMatchingEntry = findMatchingEntry( aSearchTemp, *m_pData );
+ }
+
+ if ( pMatchingEntry )
+ {
+ m_pData->rEntryList.SelectEntry( pMatchingEntry );
+ m_pData->aSearchTimeout.Start();
+ }
+ else
+ {
+ lcl_reset( *m_pData );
+ }
+
+ return true;
+ }
+ return false;
+ }
+
+ //--------------------------------------------------------------------
+ void QuickSelectionEngine::Reset()
+ {
+ lcl_reset( *m_pData );
+ }
+
+//........................................................................
+} // namespace vcl
+//........................................................................
diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx
index c892b32534ec..e9696aa8c492 100644
--- a/vcl/source/control/tabctrl.cxx
+++ b/vcl/source/control/tabctrl.cxx
@@ -42,7 +42,6 @@
#include "vcl/controldata.hxx"
#include "vcl/sound.hxx"
#include "vcl/lstbox.hxx"
-#include "vcl/smartid.hxx"
#include "vcl/window.h"
@@ -59,7 +58,7 @@ struct ImplTabItem
String maText;
String maFormatText;
String maHelpText;
- ULONG mnHelpId;
+ rtl::OString maHelpId;
Rectangle maRect;
USHORT mnLine;
bool mbFullVisible;
@@ -67,7 +66,7 @@ struct ImplTabItem
Image maTabImage;
ImplTabItem()
- : mnId( 0 ), mnTabPageResId( 0 ), mpTabPage( NULL ), mnHelpId( 0 ),
+ : mnId( 0 ), mnTabPageResId( 0 ), mpTabPage( NULL ),
mnLine( 0 ), mbFullVisible( FALSE ), mbEnabled( true )
{}
};
@@ -151,7 +150,6 @@ void TabControl::ImplInit( Window* pParent, WinBits nStyle )
mbRestoreUnqId = FALSE;
mbSingleLine = FALSE;
mbScroll = FALSE;
- mbRestoreSmartId = FALSE;
mbSmallInvalidate = FALSE;
mbExtraSpace = FALSE;
mpTabCtrlData = new ImplTabCtrlData;
@@ -705,11 +703,9 @@ void TabControl::ImplChangeTabPage( USHORT nId, USHORT nOldId )
if ( pOldPage )
{
if ( mbRestoreHelpId )
- pCtrlParent->SetHelpId( 0 );
+ pCtrlParent->SetHelpId( rtl::OString() );
if ( mbRestoreUnqId )
- pCtrlParent->SetUniqueId( 0 );
- if( mbRestoreSmartId )
- pCtrlParent->SetSmartHelpId( SmartId() );
+ pCtrlParent->SetUniqueId( rtl::OString() );
pOldPage->DeactivatePage();
}
@@ -719,21 +715,16 @@ void TabControl::ImplChangeTabPage( USHORT nId, USHORT nOldId )
// activate page here so the conbtrols can be switched
// also set the help id of the parent window to that of the tab page
- if ( !GetHelpId() )
+ if ( !GetHelpId().getLength() )
{
mbRestoreHelpId = TRUE;
pCtrlParent->SetHelpId( pPage->GetHelpId() );
}
- if ( !pCtrlParent->GetUniqueId() )
+ if ( !pCtrlParent->GetUniqueId().getLength() )
{
mbRestoreUnqId = TRUE;
pCtrlParent->SetUniqueId( pPage->GetUniqueId() );
}
- if( ! GetSmartHelpId().HasAny() )
- {
- mbRestoreSmartId = TRUE;
- pCtrlParent->SetSmartHelpId( pPage->GetSmartHelpId() );
- }
pPage->ActivatePage();
@@ -1486,13 +1477,13 @@ void TabControl::RequestHelp( const HelpEvent& rHEvt )
}
else if ( rHEvt.GetMode() & HELPMODE_EXTENDED )
{
- ULONG nHelpId = GetHelpId( nItemId );
- if ( nHelpId )
+ rtl::OUString aHelpId( rtl::OStringToOUString( GetHelpId( nItemId ), RTL_TEXTENCODING_UTF8 ) );
+ if ( aHelpId.getLength() )
{
// Wenn eine Hilfe existiert, dann ausloesen
Help* pHelp = Application::GetHelp();
if ( pHelp )
- pHelp->Start( nHelpId, this );
+ pHelp->Start( aHelpId, this );
return;
}
}
@@ -1574,7 +1565,7 @@ void TabControl::Command( const CommandEvent& rCEvt )
aMenu.InsertItem( it->mnId, it->maText, MIB_CHECKABLE | MIB_RADIOCHECK );
if ( it->mnId == mnCurPageId )
aMenu.CheckItem( it->mnId );
- aMenu.SetHelpId( it->mnId, it->mnHelpId );
+ aMenu.SetHelpId( it->mnId, it->maHelpId );
}
USHORT nId = aMenu.Execute( this, aMenuPos );
@@ -1826,7 +1817,6 @@ void TabControl::InsertPage( USHORT nPageId, const XubString& rText,
pItem->mnId = nPageId;
pItem->mpTabPage = NULL;
pItem->mnTabPageResId = 0;
- pItem->mnHelpId = 0;
pItem->maText = rText;
pItem->mbFullVisible = FALSE;
@@ -2154,11 +2144,11 @@ const XubString& TabControl::GetHelpText( USHORT nPageId ) const
if ( pItem )
{
- if ( !pItem->maHelpText.Len() && pItem->mnHelpId )
+ if ( !pItem->maHelpText.Len() && pItem->maHelpId.getLength() )
{
Help* pHelp = Application::GetHelp();
if ( pHelp )
- pItem->maHelpText = pHelp->GetHelpText( pItem->mnHelpId, this );
+ pItem->maHelpText = pHelp->GetHelpText( rtl::OStringToOUString( pItem->maHelpId, RTL_TEXTENCODING_UTF8 ), this );
}
return pItem->maHelpText;
@@ -2169,24 +2159,25 @@ const XubString& TabControl::GetHelpText( USHORT nPageId ) const
// -----------------------------------------------------------------------
-void TabControl::SetHelpId( USHORT nPageId, ULONG nHelpId )
+void TabControl::SetHelpId( USHORT nPageId, const rtl::OString& rHelpId )
{
ImplTabItem* pItem = ImplGetItem( nPageId );
if ( pItem )
- pItem->mnHelpId = nHelpId;
+ pItem->maHelpId = rHelpId;
}
// -----------------------------------------------------------------------
-ULONG TabControl::GetHelpId( USHORT nPageId ) const
+rtl::OString TabControl::GetHelpId( USHORT nPageId ) const
{
+ rtl::OString aRet;
ImplTabItem* pItem = ImplGetItem( nPageId );
if ( pItem )
- return pItem->mnHelpId;
- else
- return 0;
+ aRet = pItem->maHelpId;
+
+ return aRet;
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/gdi/bitmap3.cxx b/vcl/source/gdi/bitmap3.cxx
index 9e2a21b43e37..ec476157fbeb 100644
--- a/vcl/source/gdi/bitmap3.cxx
+++ b/vcl/source/gdi/bitmap3.cxx
@@ -961,8 +961,8 @@ BOOL Bitmap::ImplScaleFast( const double& rScaleX, const double& rScaleY )
const long nScanlineSize = pWriteAcc->GetScanlineSize();
const long nNewWidth1 = nNewWidth - 1L;
const long nNewHeight1 = nNewHeight - 1L;
- const long nWidth1 = pReadAcc->Width() - 1L;
- const long nHeight1 = pReadAcc->Height() - 1L;
+ const long nWidth = pReadAcc->Width();
+ const long nHeight = pReadAcc->Height();
long* pLutX = new long[ nNewWidth ];
long* pLutY = new long[ nNewHeight ];
long nX, nY, nMapY, nActY = 0L;
@@ -970,10 +970,10 @@ BOOL Bitmap::ImplScaleFast( const double& rScaleX, const double& rScaleY )
if( nNewWidth1 && nNewHeight1 )
{
for( nX = 0L; nX < nNewWidth; nX++ )
- pLutX[ nX ] = nX * nWidth1 / nNewWidth1;
+ pLutX[ nX ] = nX * nWidth / nNewWidth;
for( nY = 0L; nY < nNewHeight; nY++ )
- pLutY[ nY ] = nY * nHeight1 / nNewHeight1;
+ pLutY[ nY ] = nY * nHeight / nNewHeight;
while( nActY < nNewHeight )
{
diff --git a/vcl/source/gdi/impimage.cxx b/vcl/source/gdi/impimage.cxx
index 476ac3ca44a9..3105850c4fbf 100644
--- a/vcl/source/gdi/impimage.cxx
+++ b/vcl/source/gdi/impimage.cxx
@@ -553,14 +553,14 @@ void ImplImageBmp::Draw( USHORT nPos, OutputDevice* pOutDev,
// -----------------------------------------------------------------------
void ImplImageBmp::ImplUpdateDisplayBmp( OutputDevice*
-#if defined WIN || defined WNT
+#if defined WNT
pOutDev
#endif
)
{
if( !mpDisplayBmp && !maBmpEx.IsEmpty() )
{
-#if defined WIN || defined WNT
+#if defined WNT
if( maBmpEx.IsAlpha() )
mpDisplayBmp = new BitmapEx( maBmpEx );
else
diff --git a/vcl/source/gdi/impprn.cxx b/vcl/source/gdi/impprn.cxx
deleted file mode 100644
index 5224286cdad1..000000000000
--- a/vcl/source/gdi/impprn.cxx
+++ /dev/null
@@ -1,584 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_vcl.hxx"
-
-#define _SPOOLPRINTER_EXT
-#include "tools/queue.hxx"
-#include "vcl/svapp.hxx"
-#include "vcl/metaact.hxx"
-#include "vcl/gdimtf.hxx"
-#include "vcl/timer.hxx"
-#include "vcl/impprn.hxx"
-#include "vcl/jobset.h"
-
-#include "vcl/svdata.hxx"
-#include "vcl/salprn.hxx"
-
-// -----------
-// - Defines -
-// -----------
-
-#define OPTIMAL_BMP_RESOLUTION 300
-#define NORMAL_BMP_RESOLUTION 200
-
-// =======================================================================
-
-struct QueuePage
-{
- GDIMetaFile* mpMtf;
- JobSetup* mpSetup;
- USHORT mnPage;
- BOOL mbEndJob;
-
- QueuePage() { mpMtf = NULL; mpSetup = NULL; }
- ~QueuePage() { delete mpMtf; if ( mpSetup ) delete mpSetup; }
-};
-
-// =======================================================================
-
-ImplQPrinter::ImplQPrinter( Printer* pParent ) :
- Printer( pParent->GetName() ),
- mpParent( pParent ),
- mbAborted( false ),
- mbUserCopy( false ),
- mbDestroyAllowed( true ),
- mbDestroyed( false ),
- mnMaxBmpDPIX( mnDPIX ),
- mnMaxBmpDPIY( mnDPIY ),
- mnCurCopyCount( 0 )
-{
- SetSelfAsQueuePrinter( TRUE );
- SetPrinterProps( pParent );
- SetPageQueueSize( 0 );
- mnCopyCount = pParent->mnCopyCount;
- mbCollateCopy = pParent->mbCollateCopy;
-}
-
-// -----------------------------------------------------------------------
-
-ImplQPrinter::~ImplQPrinter()
-{
- for( std::vector< QueuePage* >::iterator it = maQueue.begin();
- it != maQueue.end(); ++it )
- delete (*it);
-}
-
-// -----------------------------------------------------------------------------
-
-void ImplQPrinter::Destroy()
-{
- if( mbDestroyAllowed )
- delete this;
- else
- mbDestroyed = TRUE;
-}
-
-// -----------------------------------------------------------------------
-
-void ImplQPrinter::ImplPrintMtf( GDIMetaFile& rPrtMtf, long nMaxBmpDPIX, long nMaxBmpDPIY )
-{
- for( MetaAction* pAct = rPrtMtf.FirstAction(); pAct && !mbAborted; pAct = rPrtMtf.NextAction() )
- {
- const ULONG nType = pAct->GetType();
- sal_Bool bExecuted = sal_False;
-
- if( nType == META_COMMENT_ACTION )
- {
- // search for special comments ( ..._BEGIN/..._END )
- MetaCommentAction* pComment = (MetaCommentAction*) pAct;
-
- if( pComment->GetComment().CompareIgnoreCaseToAscii( "XGRAD_SEQ_BEGIN" ) == COMPARE_EQUAL )
- {
- pAct = rPrtMtf.NextAction();
-
- // if next action is a GradientEx action, execute this and
- // skip actions until a XGRAD_SEQ_END comment is found
- if( pAct && ( pAct->GetType() == META_GRADIENTEX_ACTION ) )
- {
- MetaGradientExAction* pGradientExAction = (MetaGradientExAction*) pAct;
- DrawGradientEx( this, pGradientExAction->GetPolyPolygon(), pGradientExAction->GetGradient() );
-
- // seek to end of this comment
- do
- {
- pAct = rPrtMtf.NextAction();
- }
- while( pAct &&
- ( ( pAct->GetType() != META_COMMENT_ACTION ) ||
- ( ( (MetaCommentAction*) pAct )->GetComment().CompareIgnoreCaseToAscii( "XGRAD_SEQ_END" ) != COMPARE_EQUAL ) ) );
-
- bExecuted = sal_True;
- }
- }
- else if( pComment->GetComment().CompareIgnoreCaseToAscii( "PRNSPOOL_TRANSPARENTBITMAP_BEGIN" ) == COMPARE_EQUAL )
- {
- pAct = rPrtMtf.NextAction();
-
- if( pAct && ( pAct->GetType() == META_BMPSCALE_ACTION ) )
- {
- // execute action here to avoid DPI processing of bitmap;
- pAct->Execute( this );
-
-#ifdef VERBOSE_DEBUG
- Push();
- SetLineColor(COL_RED);
- SetFillColor();
- DrawRect( Rectangle(
- static_cast<MetaBmpScaleAction*>(pAct)->GetPoint(),
- static_cast<MetaBmpScaleAction*>(pAct)->GetSize()) );
- Pop();
-#endif
-
- // seek to end of this comment
- do
- {
- pAct = rPrtMtf.NextAction();
- }
- while( pAct &&
- ( ( pAct->GetType() != META_COMMENT_ACTION ) ||
- ( ( (MetaCommentAction*) pAct )->GetComment().CompareIgnoreCaseToAscii( "PRNSPOOL_TRANSPARENTBITMAP_END" ) != COMPARE_EQUAL ) ) );
-
- bExecuted = sal_True;
- }
- }
- }
- else if( nType == META_GRADIENT_ACTION )
- {
- MetaGradientAction* pGradientAction = (MetaGradientAction*) pAct;
- DrawGradientEx( this, pGradientAction->GetRect(), pGradientAction->GetGradient() );
- bExecuted = sal_True;
- }
- else if( nType == META_BMPSCALE_ACTION )
- {
- MetaBmpScaleAction* pBmpScaleAction = (MetaBmpScaleAction*) pAct;
- const Bitmap& rBmp = pBmpScaleAction->GetBitmap();
-
- DrawBitmap( pBmpScaleAction->GetPoint(), pBmpScaleAction->GetSize(),
- GetDownsampledBitmap( pBmpScaleAction->GetSize(),
- Point(), rBmp.GetSizePixel(),
- rBmp, nMaxBmpDPIX, nMaxBmpDPIY ) );
-
- bExecuted = sal_True;
- }
- else if( nType == META_BMPSCALEPART_ACTION )
- {
- MetaBmpScalePartAction* pBmpScalePartAction = (MetaBmpScalePartAction*) pAct;
- const Bitmap& rBmp = pBmpScalePartAction->GetBitmap();
-
- DrawBitmap( pBmpScalePartAction->GetDestPoint(), pBmpScalePartAction->GetDestSize(),
- GetDownsampledBitmap( pBmpScalePartAction->GetDestSize(),
- pBmpScalePartAction->GetSrcPoint(), pBmpScalePartAction->GetSrcSize(),
- rBmp, nMaxBmpDPIX, nMaxBmpDPIY ) );
-
- bExecuted = sal_True;
- }
- else if( nType == META_BMPEXSCALE_ACTION )
- {
- MetaBmpExScaleAction* pBmpExScaleAction = (MetaBmpExScaleAction*) pAct;
- const BitmapEx& rBmpEx = pBmpExScaleAction->GetBitmapEx();
-
- DrawBitmapEx( pBmpExScaleAction->GetPoint(), pBmpExScaleAction->GetSize(),
- GetDownsampledBitmapEx( pBmpExScaleAction->GetSize(),
- Point(), rBmpEx.GetSizePixel(),
- rBmpEx, nMaxBmpDPIX, nMaxBmpDPIY ) );
-
- bExecuted = sal_True;
- }
- else if( nType == META_BMPEXSCALEPART_ACTION )
- {
- MetaBmpExScalePartAction* pBmpExScalePartAction = (MetaBmpExScalePartAction*) pAct;
- const BitmapEx& rBmpEx = pBmpExScalePartAction->GetBitmapEx();
-
- DrawBitmapEx( pBmpExScalePartAction->GetDestPoint(), pBmpExScalePartAction->GetDestSize(),
- GetDownsampledBitmapEx( pBmpExScalePartAction->GetDestSize(),
- pBmpExScalePartAction->GetSrcPoint(), pBmpExScalePartAction->GetSrcSize(),
- rBmpEx, nMaxBmpDPIX, nMaxBmpDPIY ) );
-
- bExecuted = sal_True;
- }
- else if( nType == META_TRANSPARENT_ACTION )
- {
- MetaTransparentAction* pTransAct = static_cast<MetaTransparentAction*>(pAct);
- USHORT nTransparency( pTransAct->GetTransparence() );
-
- // #i10613# Respect transparency for draw color
- if( nTransparency )
- {
- Push( PUSH_LINECOLOR|PUSH_FILLCOLOR );
-
- // assume white background for alpha blending
- Color aLineColor( GetLineColor() );
- aLineColor.SetRed( static_cast<UINT8>( (255L*nTransparency + (100L - nTransparency)*aLineColor.GetRed()) / 100L ) );
- aLineColor.SetGreen( static_cast<UINT8>( (255L*nTransparency + (100L - nTransparency)*aLineColor.GetGreen()) / 100L ) );
- aLineColor.SetBlue( static_cast<UINT8>( (255L*nTransparency + (100L - nTransparency)*aLineColor.GetBlue()) / 100L ) );
- SetLineColor( aLineColor );
-
- Color aFillColor( GetFillColor() );
- aFillColor.SetRed( static_cast<UINT8>( (255L*nTransparency + (100L - nTransparency)*aFillColor.GetRed()) / 100L ) );
- aFillColor.SetGreen( static_cast<UINT8>( (255L*nTransparency + (100L - nTransparency)*aFillColor.GetGreen()) / 100L ) );
- aFillColor.SetBlue( static_cast<UINT8>( (255L*nTransparency + (100L - nTransparency)*aFillColor.GetBlue()) / 100L ) );
- SetFillColor( aFillColor );
- }
-
- DrawPolyPolygon( pTransAct->GetPolyPolygon() );
-
- if( nTransparency )
- Pop();
-
- bExecuted = sal_True;
- }
- else if( nType == META_FLOATTRANSPARENT_ACTION )
- {
- MetaFloatTransparentAction* pFloatAction = (MetaFloatTransparentAction*) pAct;
- GDIMetaFile& rMtf = (GDIMetaFile&) pFloatAction->GetGDIMetaFile();
- MapMode aDrawMap( rMtf.GetPrefMapMode() );
- Point aDestPoint( LogicToPixel( pFloatAction->GetPoint() ) );
- Size aDestSize( LogicToPixel( pFloatAction->GetSize() ) );
-
- if( aDestSize.Width() && aDestSize.Height() )
- {
- Size aTmpPrefSize( LogicToPixel( rMtf.GetPrefSize(), aDrawMap ) );
-
- if( !aTmpPrefSize.Width() )
- aTmpPrefSize.Width() = aDestSize.Width();
-
- if( !aTmpPrefSize.Height() )
- aTmpPrefSize.Height() = aDestSize.Height();
-
- Fraction aScaleX( aDestSize.Width(), aTmpPrefSize.Width() );
- Fraction aScaleY( aDestSize.Height(), aTmpPrefSize.Height() );
-
- aDrawMap.SetScaleX( aScaleX *= aDrawMap.GetScaleX() );
- aDrawMap.SetScaleY( aScaleY *= aDrawMap.GetScaleY() );
- aDrawMap.SetOrigin( PixelToLogic( aDestPoint, aDrawMap ) );
-
- Push();
- SetMapMode( aDrawMap );
- ImplPrintMtf( rMtf, nMaxBmpDPIX, nMaxBmpDPIY );
- Pop();
- }
-
- bExecuted = sal_True;
- }
-
- if( !bExecuted && pAct )
- pAct->Execute( this );
-
- if( ! ImplGetSVData()->maGDIData.mbPrinterPullModel )
- Application::Reschedule();
- }
-}
-
-// -----------------------------------------------------------------------
-
-void ImplQPrinter::PrePrintPage( QueuePage* pPage )
-{
- mnRestoreDrawMode = GetDrawMode();
- mnMaxBmpDPIX = mnDPIX;
- mnMaxBmpDPIY = mnDPIY;
-
- const PrinterOptions& rPrinterOptions = GetPrinterOptions();
-
- if( rPrinterOptions.IsReduceBitmaps() )
- {
- // calculate maximum resolution for bitmap graphics
- if( PRINTER_BITMAP_OPTIMAL == rPrinterOptions.GetReducedBitmapMode() )
- {
- mnMaxBmpDPIX = Min( (long) OPTIMAL_BMP_RESOLUTION, mnMaxBmpDPIX );
- mnMaxBmpDPIY = Min( (long) OPTIMAL_BMP_RESOLUTION, mnMaxBmpDPIY );
- }
- else if( PRINTER_BITMAP_NORMAL == rPrinterOptions.GetReducedBitmapMode() )
- {
- mnMaxBmpDPIX = Min( (long) NORMAL_BMP_RESOLUTION, mnMaxBmpDPIX );
- mnMaxBmpDPIY = Min( (long) NORMAL_BMP_RESOLUTION, mnMaxBmpDPIY );
- }
- else
- {
- mnMaxBmpDPIX = Min( (long) rPrinterOptions.GetReducedBitmapResolution(), mnMaxBmpDPIX );
- mnMaxBmpDPIY = Min( (long) rPrinterOptions.GetReducedBitmapResolution(), mnMaxBmpDPIY );
- }
- }
-
- // convert to greysacles
- if( rPrinterOptions.IsConvertToGreyscales() )
- {
- SetDrawMode( GetDrawMode() | ( DRAWMODE_GRAYLINE | DRAWMODE_GRAYFILL | DRAWMODE_GRAYTEXT |
- DRAWMODE_GRAYBITMAP | DRAWMODE_GRAYGRADIENT ) );
- }
-
- // disable transparency output
- if( rPrinterOptions.IsReduceTransparency() && ( PRINTER_TRANSPARENCY_NONE == rPrinterOptions.GetReducedTransparencyMode() ) )
- {
- SetDrawMode( GetDrawMode() | DRAWMODE_NOTRANSPARENCY );
- }
-
- maCurPageMetaFile = GDIMetaFile();
- RemoveTransparenciesFromMetaFile( *pPage->mpMtf, maCurPageMetaFile, mnMaxBmpDPIX, mnMaxBmpDPIY,
- rPrinterOptions.IsReduceTransparency(),
- rPrinterOptions.GetReducedTransparencyMode() == PRINTER_TRANSPARENCY_AUTO,
- rPrinterOptions.IsReduceBitmaps() && rPrinterOptions.IsReducedBitmapIncludesTransparency()
- );
-}
-
-void ImplQPrinter::PostPrintPage()
-{
- SetDrawMode( mnRestoreDrawMode );
-}
-
-// -----------------------------------------------------------------------
-
-void ImplQPrinter::PrintPage( unsigned int nPage )
-{
- if( nPage >= maQueue.size() )
- return;
- mnCurCopyCount = (mbUserCopy && !mbCollateCopy) ? mnCopyCount : 1;
- QueuePage* pActPage = maQueue[nPage];
- PrePrintPage( pActPage );
- if ( pActPage->mpSetup )
- SetJobSetup( *pActPage->mpSetup );
-
- StartPage();
- ImplPrintMtf( maCurPageMetaFile, mnMaxBmpDPIX, mnMaxBmpDPIY );
- EndPage();
-
- mnCurCopyCount--;
- if( mnCurCopyCount == 0 )
- PostPrintPage();
-}
-
-// -----------------------------------------------------------------------
-
-ImplJobSetup* ImplQPrinter::GetPageSetup( unsigned int nPage ) const
-{
- return nPage >= maQueue.size() ? NULL :
- ( maQueue[nPage]->mpSetup ? maQueue[nPage]->mpSetup->ImplGetData() : NULL );
-}
-
-// -----------------------------------------------------------------------
-ULONG ImplQPrinter::GetPrintPageCount() const
-{
- ULONG nPageCount = maQueue.size() * ((mbUserCopy && !mbCollateCopy) ? mnCopyCount : 1);
- return nPageCount;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( ImplQPrinter, ImplPrintHdl, Timer*, EMPTYARG )
-{
- // Ist Drucken abgebrochen wurden?
- if( !IsPrinting() || ( mpParent->IsJobActive() && ( maQueue.size() < (ULONG)mpParent->GetPageQueueSize() ) ) )
- return 0;
-
- // Druck-Job zuende?
- QueuePage* pActPage = maQueue.front();
- maQueue.erase( maQueue.begin() );
-
-
- vcl::DeletionListener aDel( this );
- if ( pActPage->mbEndJob )
- {
- maTimer.Stop();
- delete pActPage;
- if( ! EndJob() )
- mpParent->Error();
- if( ! aDel.isDeleted() )
- mpParent->ImplEndPrint();
- }
- else
- {
- mbDestroyAllowed = FALSE;
-
- PrePrintPage( pActPage );
-
- USHORT nCopyCount = 1;
- if( mbUserCopy && !mbCollateCopy )
- nCopyCount = mnCopyCount;
-
- for ( USHORT i = 0; i < nCopyCount; i++ )
- {
- if ( pActPage->mpSetup )
- {
- SetJobSetup( *pActPage->mpSetup );
- if ( mbAborted )
- break;
- }
-
- StartPage();
-
- if ( mbAborted )
- break;
-
- ImplPrintMtf( maCurPageMetaFile, mnMaxBmpDPIX, mnMaxBmpDPIY );
-
- if( !mbAborted )
- EndPage();
- else
- break;
- }
-
- PostPrintPage();
-
- delete pActPage;
- mbDestroyAllowed = TRUE;
-
- if( mbDestroyed )
- Destroy();
- }
-
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-void ImplQPrinter::StartQueuePrint()
-{
- if( ! ImplGetSVData()->maGDIData.mbPrinterPullModel )
- {
- maTimer.SetTimeout( 50 );
- maTimer.SetTimeoutHdl( LINK( this, ImplQPrinter, ImplPrintHdl ) );
- maTimer.Start();
- }
-}
-
-// -----------------------------------------------------------------------
-
-void ImplQPrinter::EndQueuePrint()
-{
- if( ImplGetSVData()->maGDIData.mbPrinterPullModel )
- {
- DBG_ASSERT( mpPrinter, "no SalPrinter in ImplQPrinter" );
- if( mpPrinter )
- {
- #if 0
- mpPrinter->StartJob( mbPrintFile ? &maPrintFile : NULL,
- Application::GetDisplayName(),
- maJobSetup.ImplGetConstData(),
- this );
- #endif
- EndJob();
- mpParent->ImplEndPrint();
- }
- }
- else
- {
- QueuePage* pQueuePage = new QueuePage;
- pQueuePage->mbEndJob = TRUE;
- maQueue.push_back( pQueuePage );
- }
-}
-
-// -----------------------------------------------------------------------
-
-bool ImplQPrinter::GetPaperRanges( std::vector< ULONG >& o_rRanges, bool i_bIncludeOrientationChanges ) const
-{
- bool bRet = false;
-
- if( ImplGetSVData()->maGDIData.mbPrinterPullModel )
- {
- bRet = true;
- o_rRanges.clear();
-
- if( ! maQueue.empty() )
- {
- ULONG nCurPage = 0;
-
- // get first job data
- const ImplJobSetup* pLastFormat = NULL;
- if( maQueue.front()->mpSetup )
- pLastFormat = maQueue.front()->mpSetup->ImplGetConstData();
-
- // begin first range
- o_rRanges.push_back( 0 );
- for( std::vector< QueuePage* >::const_iterator it = maQueue.begin();
- it != maQueue.end(); ++it, ++nCurPage )
- {
- const ImplJobSetup* pNewSetup = (*it)->mpSetup ? (*it)->mpSetup->ImplGetConstData() : NULL;
- if( pNewSetup && pNewSetup != pLastFormat )
- {
- bool bChange = false;
- if( pLastFormat == NULL )
- {
- bChange = true;
- }
- else if( ! i_bIncludeOrientationChanges &&
- pNewSetup->meOrientation != pLastFormat->meOrientation )
- {
- bChange = true;
- }
- else if( pNewSetup->mePaperFormat != pLastFormat->mePaperFormat ||
- ( pNewSetup->mePaperFormat == PAPER_USER &&
- ( pNewSetup->mnPaperWidth != pLastFormat->mnPaperWidth ||
- pNewSetup->mnPaperHeight != pLastFormat->mnPaperHeight ) ) )
- {
- bChange = true;
- }
- else if( pNewSetup->mnPaperBin != pLastFormat->mnPaperBin )
- {
- bChange = true;
- }
- if( bChange )
- {
- o_rRanges.push_back( nCurPage );
- pLastFormat = pNewSetup;
- }
- }
- }
-
- o_rRanges.push_back( nCurPage );
- }
- }
-
- return bRet;
-}
-
-// -----------------------------------------------------------------------
-
-void ImplQPrinter::AbortQueuePrint()
-{
- maTimer.Stop();
- mbAborted = TRUE;
- AbortJob();
-}
-
-// -----------------------------------------------------------------------
-
-void ImplQPrinter::AddQueuePage( GDIMetaFile* pPage, USHORT nPage, BOOL bNewJobSetup )
-{
- QueuePage* pQueuePage = new QueuePage;
- pQueuePage->mpMtf = pPage;
- pQueuePage->mnPage = nPage;
- pQueuePage->mbEndJob = FALSE;
- // ensure that the first page has a valid setup, this is needed
- // in GetPaperRanges (used in pullmodel)
- // caution: this depends on mnCurPage in Printer being
- // 0: not printing 1: after StartJob, 2 after first EndPage, 3+ at following EndPage calls
- if ( bNewJobSetup || (nPage == 2 && ImplGetSVData()->maGDIData.mbPrinterPullModel) )
- pQueuePage->mpSetup = new JobSetup( mpParent->GetJobSetup() );
- maQueue.push_back( pQueuePage );
-}
diff --git a/vcl/source/gdi/makefile.mk b/vcl/source/gdi/makefile.mk
index 77df20976c73..ac2e586a41cb 100755
--- a/vcl/source/gdi/makefile.mk
+++ b/vcl/source/gdi/makefile.mk
@@ -63,6 +63,7 @@ EXCEPTIONSFILES= $(SLO)$/salmisc.obj \
$(SLO)$/impgraph.obj \
$(SLO)$/metric.obj \
$(SLO)$/pdfwriter_impl.obj \
+ $(SLO)$/pdfwriter_impl2.obj \
$(SLO)$/pdffontcache.obj\
$(SLO)$/bmpconv.obj \
$(SLO)$/pdfextoutdevdata.obj \
diff --git a/vcl/source/gdi/metric.cxx b/vcl/source/gdi/metric.cxx
index 325146b6be8a..6d225ad7e0dc 100644
--- a/vcl/source/gdi/metric.cxx
+++ b/vcl/source/gdi/metric.cxx
@@ -34,6 +34,8 @@
#include <vector>
#include <set>
+#include <cstdio>
+
// =======================================================================
ImplFontMetric::ImplFontMetric()
@@ -51,6 +53,7 @@ ImplFontMetric::ImplFontMetric()
inline void ImplFontMetric::AddReference()
{
+ // TODO: disable refcounting on the default maps?
++mnRefCount;
}
@@ -58,6 +61,7 @@ inline void ImplFontMetric::AddReference()
inline void ImplFontMetric::DeReference()
{
+ // TODO: disable refcounting on the default maps?
if( --mnRefCount <= 0 )
delete this;
}
@@ -252,7 +256,7 @@ ImplFontCharMap::ImplFontCharMap( const CmapResult& rCR )
, mpGlyphIds( rCR.mpGlyphIds )
, mnRangeCount( rCR.mnRangeCount )
, mnCharCount( 0 )
-, mnRefCount( 1 )
+, mnRefCount( 0 )
{
const sal_uInt32* pRangePtr = mpRangeCodes;
for( int i = mnRangeCount; --i >= 0; pRangePtr += 2 )
@@ -263,7 +267,8 @@ ImplFontCharMap::ImplFontCharMap( const CmapResult& rCR )
}
}
-static ImplFontCharMap* pDefaultImplFontCharMap = NULL;
+static ImplFontCharMap* pDefaultUnicodeImplFontCharMap = NULL;
+static ImplFontCharMap* pDefaultSymbolImplFontCharMap = NULL;
static const sal_uInt32 aDefaultUnicodeRanges[] = {0x0020,0xD800, 0xE000,0xFFF0};
static const sal_uInt32 aDefaultSymbolRanges[] = {0x0020,0x0100, 0xF020,0xF100};
@@ -284,44 +289,60 @@ ImplFontCharMap::~ImplFontCharMap()
delete[] mpRangeCodes;
delete[] mpStartGlyphs;
delete[] mpGlyphIds;
-}
+ }
// -----------------------------------------------------------------------
-ImplFontCharMap* ImplFontCharMap::GetDefaultMap( bool bSymbols)
+namespace
{
- if( pDefaultImplFontCharMap )
- pDefaultImplFontCharMap->AddReference();
- else
+ ImplFontCharMap *GetDefaultUnicodeMap()
{
- const sal_uInt32* pRangeCodes = aDefaultUnicodeRanges;
- int nCodesCount = sizeof(aDefaultUnicodeRanges) / sizeof(*pRangeCodes);
- if( bSymbols )
+ if( !pDefaultUnicodeImplFontCharMap )
{
- pRangeCodes = aDefaultSymbolRanges;
- nCodesCount = sizeof(aDefaultSymbolRanges) / sizeof(*pRangeCodes);
+ const sal_uInt32* pRangeCodes = aDefaultUnicodeRanges;
+ int nCodesCount = sizeof(aDefaultUnicodeRanges) / sizeof(*pRangeCodes);
+ CmapResult aDefaultCR( false, pRangeCodes, nCodesCount/2 );
+ pDefaultUnicodeImplFontCharMap = new ImplFontCharMap( aDefaultCR );
+ pDefaultUnicodeImplFontCharMap->AddReference();
}
- CmapResult aDefaultCR( bSymbols, pRangeCodes, nCodesCount/2 );
- pDefaultImplFontCharMap = new ImplFontCharMap( aDefaultCR );
+ return pDefaultUnicodeImplFontCharMap;
}
- return pDefaultImplFontCharMap;
+ ImplFontCharMap *GetDefaultSymbolMap()
+ {
+ if( !pDefaultSymbolImplFontCharMap )
+ {
+ const sal_uInt32* pRangeCodes = aDefaultSymbolRanges;
+ int nCodesCount = sizeof(aDefaultSymbolRanges) / sizeof(*pRangeCodes);
+ CmapResult aDefaultCR( true, pRangeCodes, nCodesCount/2 );
+ pDefaultSymbolImplFontCharMap = new ImplFontCharMap( aDefaultCR );
+ pDefaultSymbolImplFontCharMap->AddReference();
+ }
+
+ return pDefaultSymbolImplFontCharMap;
+ }
+}
+
+ImplFontCharMap* ImplFontCharMap::GetDefaultMap( bool bSymbols)
+{
+ return bSymbols ? GetDefaultSymbolMap() : GetDefaultUnicodeMap();
}
// -----------------------------------------------------------------------
-void ImplFontCharMap::AddReference()
+void ImplFontCharMap::AddReference( void ) const
{
+ // TODO: disable refcounting on the default maps?
++mnRefCount;
}
// -----------------------------------------------------------------------
-void ImplFontCharMap::DeReference()
+void ImplFontCharMap::DeReference( void ) const
{
if( --mnRefCount <= 0 )
- if( this != pDefaultImplFontCharMap )
+ if( (this != pDefaultUnicodeImplFontCharMap) && (this != pDefaultSymbolImplFontCharMap) )
delete this;
}
@@ -815,7 +836,9 @@ bool ParseCMAP( const unsigned char* pCmap, int nLength, CmapResult& rResult )
FontCharMap::FontCharMap()
: mpImpl( ImplFontCharMap::GetDefaultMap() )
-{}
+{
+ mpImpl->AddReference();
+}
// -----------------------------------------------------------------------
@@ -841,19 +864,14 @@ int FontCharMap::CountCharsInRange( sal_uInt32 cMin, sal_uInt32 cMax ) const
// -----------------------------------------------------------------------
-void FontCharMap::Reset( ImplFontCharMap* pNewMap )
+void FontCharMap::Reset( const ImplFontCharMap* pNewMap )
{
+ mpImpl->DeReference();
if( pNewMap == NULL )
- {
- mpImpl->DeReference();
mpImpl = ImplFontCharMap::GetDefaultMap();
- }
else if( pNewMap != mpImpl )
- {
- mpImpl->DeReference();
mpImpl = pNewMap;
- mpImpl->AddReference();
- }
+ mpImpl->AddReference();
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index bf1cc2728bf1..f4ea98484c33 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -27,62 +27,57 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#include <cstring>
-#include <i18npool/mslangid.hxx>
-#ifndef _SV_SVSYS_HXX
-#include <svsys.h>
-#endif
-#include <vcl/salgdi.hxx>
-#include <vcl/sallayout.hxx>
-#include <rtl/tencinfo.h>
-#include <tools/debug.hxx>
-#include <vcl/svdata.hxx>
-#include <vcl/metric.hxx>
-#include <vcl/impfont.hxx>
-#include <vcl/metaact.hxx>
-#include <vcl/gdimtf.hxx>
-#include <vcl/outdata.hxx>
-#include <vcl/outfont.hxx>
-#include <basegfx/polygon/b2dpolygon.hxx>
-#include <basegfx/polygon/b2dpolypolygon.hxx>
-#include <basegfx/matrix/b2dhommatrix.hxx>
-#include <tools/poly.hxx>
-#include <vcl/outdev.h>
-#include <vcl/virdev.hxx>
-#include <vcl/print.hxx>
-#include <vcl/event.hxx>
-#include <vcl/window.h>
-#include <vcl/window.hxx>
-#include <vcl/svapp.hxx>
-#include <vcl/bmpacc.hxx>
-#include <unotools/fontcvt.hxx>
-#include <vcl/outdev.hxx>
-#include <vcl/edit.hxx>
-#include <unotools/fontcfg.hxx>
-#include <vcl/sysdata.hxx>
-#include <vcl/textlayout.hxx>
-#ifndef _OSL_FILE_H
-#include <osl/file.h>
-#endif
+#include "i18npool/mslangid.hxx"
+
+#include "svsys.h"
+#include "vcl/salgdi.hxx"
+#include "vcl/sallayout.hxx"
+#include "rtl/tencinfo.h"
+#include "tools/debug.hxx"
+#include "vcl/svdata.hxx"
+#include "vcl/metric.hxx"
+#include "vcl/impfont.hxx"
+#include "vcl/metaact.hxx"
+#include "vcl/gdimtf.hxx"
+#include "vcl/outdata.hxx"
+#include "vcl/outfont.hxx"
+#include "basegfx/polygon/b2dpolygon.hxx"
+#include "basegfx/polygon/b2dpolypolygon.hxx"
+#include "basegfx/matrix/b2dhommatrix.hxx"
+#include "tools/poly.hxx"
+#include "vcl/outdev.h"
+#include "vcl/virdev.hxx"
+#include "vcl/print.hxx"
+#include "vcl/event.hxx"
+#include "vcl/window.h"
+#include "vcl/window.hxx"
+#include "vcl/svapp.hxx"
+#include "vcl/bmpacc.hxx"
+#include "unotools/fontcvt.hxx"
+#include "vcl/outdev.hxx"
+#include "vcl/edit.hxx"
+#include "unotools/fontcfg.hxx"
+#include "vcl/sysdata.hxx"
+#include "vcl/textlayout.hxx"
+#include "vcl/svids.hrc"
+#include "osl/file.h"
#ifdef ENABLE_GRAPHITE
-#include <vcl/graphite_features.hxx>
+#include "vcl/graphite_features.hxx"
#endif
#ifdef USE_BUILTIN_RASTERIZER
-#include <vcl/glyphcache.hxx>
+#include "vcl/glyphcache.hxx"
#endif
-#include <vcl/unohelp.hxx>
-#include <pdfwriter_impl.hxx>
-#include <vcl/controllayout.hxx>
-#include <rtl/logfile.hxx>
+#include "vcl/unohelp.hxx"
+#include "pdfwriter_impl.hxx"
+#include "vcl/controllayout.hxx"
+#include "rtl/logfile.hxx"
-#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUES_HDL_
-#include <com/sun/star/beans/PropertyValues.hdl>
-#endif
-#include <com/sun/star/i18n/XBreakIterator.hpp>
-#include <com/sun/star/i18n/WordType.hpp>
-#include <com/sun/star/linguistic2/XLinguServiceManager.hpp>
+#include "com/sun/star/beans/PropertyValues.hpp"
+#include "com/sun/star/i18n/XBreakIterator.hpp"
+#include "com/sun/star/i18n/WordType.hpp"
+#include "com/sun/star/linguistic2/XLinguServiceManager.hpp"
#if defined UNX
#define GLYPH_FONT_HEIGHT 128
@@ -92,7 +87,7 @@
#define GLYPH_FONT_HEIGHT 256
#endif
-#include <sal/alloca.h>
+#include "sal/alloca.h"
#include <cmath>
#include <cstring>
@@ -1327,11 +1322,11 @@ void ImplDevFontList::InitGenericGlyphFallback( void ) const
"msmincho", "fzmingti", "fzheiti", "ipamincho", "sazanamimincho", "kochimincho", "",
"sunbatang", "sundotum", "baekmukdotum", "gulim", "batang", "dotum", "",
"hgmincholightj", "msunglightsc", "msunglighttc", "hymyeongjolightk", "",
- "tahoma", "dejavusans", "timesnewroman", "lucidatypewriter", "lucidasans", "nimbussansl", "",
+ "tahoma", "dejavusans", "timesnewroman", "liberationsans", "",
"shree", "mangal", "",
"raavi", "shruti", "tunga", "",
"latha", "gautami", "kartika", "vrinda", "",
- "shayyalmt", "naskmt", "",
+ "shayyalmt", "naskmt", "scheherazade", "",
"david", "nachlieli", "lucidagrande", "",
"norasi", "angsanaupc", "",
"khmerossystem", "",
@@ -1381,6 +1376,7 @@ void ImplDevFontList::InitGenericGlyphFallback( void ) const
}
}
+#ifdef SAL_FONTENUM_STABLE_ON_PLATFORM // #i113472#
// sort the list of fonts for glyph fallback by quality (highest first)
// #i33947# keep the EUDC font at the front of the list
// an insertion sort is good enough for this short list
@@ -1396,6 +1392,7 @@ void ImplDevFontList::InitGenericGlyphFallback( void ) const
break;
pFallbackList[ j+1 ] = pTestFont;
}
+#endif
#if defined(HDU_DEBUG)
for( int i = 0; i < nMaxLevel; ++i )
@@ -1529,7 +1526,7 @@ void ImplDevFontList::Add( ImplFontData* pNewData )
// add font alias if available
// a font alias should never win against an original font with similar quality
- if( aMapNames.Len() >= nMapNameIndex )
+ if( aMapNames.Len() <= nMapNameIndex )
break;
if( bKeepNewData ) // try to recycle obsoleted object
pNewData = pNewData->CreateAlias();
@@ -1645,10 +1642,25 @@ ImplDevFontListData* ImplDevFontList::ImplFindBySubstFontAttr( const utl::FontNa
pFoundData = ImplFindBySearchName( aSearchName );
if( pFoundData )
- break;
+ return pFoundData;
}
- return pFoundData;
+ // use known attributes from the configuration to find a matching substitute
+ const ULONG nSearchType = rFontAttr.Type;
+ if( nSearchType != 0 )
+ {
+ const FontWeight eSearchWeight = rFontAttr.Weight;
+ const FontWidth eSearchWidth = rFontAttr.Width;
+ const FontItalic eSearchSlant = ITALIC_DONTKNOW;
+ const FontFamily eSearchFamily = FAMILY_DONTKNOW;
+ const String aSearchName;
+ pFoundData = ImplFindByAttributes( nSearchType,
+ eSearchWeight, eSearchWidth, eSearchFamily, eSearchSlant, aSearchName );
+ if( pFoundData )
+ return pFoundData;
+ }
+
+ return NULL;
}
// -----------------------------------------------------------------------
@@ -2910,6 +2922,18 @@ void OutputDevice::ImplInitFontList() const
mpGraphics->GetDevFontList( mpFontList );
}
}
+ if( meOutDevType == OUTDEV_WINDOW && ! mpFontList->Count() )
+ {
+ String aError( RTL_CONSTASCII_USTRINGPARAM( "Application error: no fonts and no vcl resource found on your system" ) );
+ ResMgr* pMgr = ImplGetResMgr();
+ if( pMgr )
+ {
+ String aResStr( ResId( SV_ACCESSERROR_NO_FONTS, *pMgr ) );
+ if( aResStr.Len() )
+ aError = aResStr;
+ }
+ Application::Abort( aError );
+ }
}
// =======================================================================
@@ -3131,17 +3155,17 @@ long OutputDevice::ImplGetTextWidth( const SalLayout& rSalLayout ) const
// -----------------------------------------------------------------------
void OutputDevice::ImplDrawTextRect( long nBaseX, long nBaseY,
- long nX, long nY, long nWidth, long nHeight )
+ long nDistX, long nDistY, long nWidth, long nHeight )
{
+ long nX = nDistX;
+ long nY = nDistY;
+
short nOrientation = mpFontEntry->mnOrientation;
if ( nOrientation )
{
// Rotate rect without rounding problems for 90 degree rotations
if ( !(nOrientation % 900) )
{
- nX -= nBaseX;
- nY -= nBaseY;
-
if ( nOrientation == 900 )
{
long nTemp = nX;
@@ -3169,12 +3193,11 @@ void OutputDevice::ImplDrawTextRect( long nBaseX, long nBaseY,
nHeight = nTemp;
nX -= nWidth;
}
-
- nX += nBaseX;
- nY += nBaseY;
}
else
{
+ nX += nBaseX;
+ nY += nBaseY;
// inflate because polygons are drawn smaller
Rectangle aRect( Point( nX, nY ), Size( nWidth+1, nHeight+1 ) );
Polygon aPoly( aRect );
@@ -3184,6 +3207,8 @@ void OutputDevice::ImplDrawTextRect( long nBaseX, long nBaseY,
}
}
+ nX += nBaseX;
+ nY += nBaseY;
mpGraphics->DrawRect( nX, nY, nWidth, nHeight, this );
}
@@ -3204,7 +3229,7 @@ void OutputDevice::ImplDrawTextBackground( const SalLayout& rSalLayout )
mpGraphics->SetFillColor( ImplColorToSal( GetTextFillColor() ) );
mbInitFillColor = TRUE;
- ImplDrawTextRect( nX, nY, nX, nY-mpFontEntry->maMetric.mnAscent-mnEmphasisAscent,
+ ImplDrawTextRect( nX, nY, 0, -(mpFontEntry->maMetric.mnAscent + mnEmphasisAscent),
nWidth,
mpFontEntry->mnLineHeight+mnEmphasisAscent+mnEmphasisDescent );
}
@@ -3489,7 +3514,7 @@ static void ImplDrawWavePixel( long nOriginX, long nOriginY,
// -----------------------------------------------------------------------
void OutputDevice::ImplDrawWaveLine( long nBaseX, long nBaseY,
- long nStartX, long nStartY,
+ long nDistX, long nDistY,
long nWidth, long nHeight,
long nLineWidth, short nOrientation,
const Color& rColor )
@@ -3497,6 +3522,9 @@ void OutputDevice::ImplDrawWaveLine( long nBaseX, long nBaseY,
if ( !nHeight )
return;
+ long nStartX = nBaseX + nDistX;
+ long nStartY = nBaseY + nDistY;
+
// Bei Hoehe von 1 Pixel reicht es, eine Linie auszugeben
if ( (nLineWidth == 1) && (nHeight == 1) )
{
@@ -3511,7 +3539,6 @@ void OutputDevice::ImplDrawWaveLine( long nBaseX, long nBaseY,
ImplRotatePos( nBaseX, nBaseY, nEndX, nEndY, nOrientation );
}
mpGraphics->DrawLine( nStartX, nStartY, nEndX, nEndY, this );
-
}
else
{
@@ -3611,7 +3638,7 @@ void OutputDevice::ImplDrawWaveLine( long nBaseX, long nBaseY,
// -----------------------------------------------------------------------
void OutputDevice::ImplDrawWaveTextLine( long nBaseX, long nBaseY,
- long nX, long nY, long nWidth,
+ long nDistX, long nDistY, long nWidth,
FontUnderline eTextLine,
Color aColor,
BOOL bIsAbove )
@@ -3637,7 +3664,7 @@ void OutputDevice::ImplDrawWaveTextLine( long nBaseX, long nBaseY,
nLineWidth = 1;
if ( eTextLine == UNDERLINE_BOLDWAVE )
nLineWidth *= 2;
- nLinePos += nY - (nLineHeight / 2);
+ nLinePos += nDistY - (nLineHeight / 2);
long nLineWidthHeight = ((nLineWidth*mnDPIX)+(mnDPIY/2))/mnDPIY;
if ( eTextLine == UNDERLINE_DOUBLEWAVE )
{
@@ -3658,16 +3685,16 @@ void OutputDevice::ImplDrawWaveTextLine( long nBaseX, long nBaseY,
nLineDY2 = 1;
nLinePos -= nLineWidthHeight-nLineDY2;
- ImplDrawWaveLine( nBaseX, nBaseY, nX, nLinePos, nWidth, nLineHeight,
+ ImplDrawWaveLine( nBaseX, nBaseY, nDistX, nLinePos, nWidth, nLineHeight,
nLineWidth, mpFontEntry->mnOrientation, aColor );
nLinePos += nLineWidthHeight+nLineDY;
- ImplDrawWaveLine( nBaseX, nBaseY, nX, nLinePos, nWidth, nLineHeight,
+ ImplDrawWaveLine( nBaseX, nBaseY, nDistX, nLinePos, nWidth, nLineHeight,
nLineWidth, mpFontEntry->mnOrientation, aColor );
}
else
{
nLinePos -= nLineWidthHeight/2;
- ImplDrawWaveLine( nBaseX, nBaseY, nX, nLinePos, nWidth, nLineHeight,
+ ImplDrawWaveLine( nBaseX, nBaseY, nDistX, nLinePos, nWidth, nLineHeight,
nLineWidth, mpFontEntry->mnOrientation, aColor );
}
}
@@ -3675,7 +3702,7 @@ void OutputDevice::ImplDrawWaveTextLine( long nBaseX, long nBaseY,
// -----------------------------------------------------------------------
void OutputDevice::ImplDrawStraightTextLine( long nBaseX, long nBaseY,
- long nX, long nY, long nWidth,
+ long nDistX, long nDistY, long nWidth,
FontUnderline eTextLine,
Color aColor,
BOOL bIsAbove )
@@ -3685,6 +3712,8 @@ void OutputDevice::ImplDrawStraightTextLine( long nBaseX, long nBaseY,
long nLinePos = 0;
long nLinePos2 = 0;
+ const long nY = nDistY;
+
if ( eTextLine > UNDERLINE_LAST )
eTextLine = UNDERLINE_SINGLE;
@@ -3752,7 +3781,7 @@ void OutputDevice::ImplDrawStraightTextLine( long nBaseX, long nBaseY,
mpGraphics->SetFillColor( ImplColorToSal( aColor ) );
mbInitFillColor = TRUE;
- long nLeft = nX;
+ long nLeft = nDistX;
switch ( eTextLine )
{
@@ -3905,7 +3934,7 @@ void OutputDevice::ImplDrawStraightTextLine( long nBaseX, long nBaseY,
// -----------------------------------------------------------------------
void OutputDevice::ImplDrawStrikeoutLine( long nBaseX, long nBaseY,
- long nX, long nY, long nWidth,
+ long nDistX, long nDistY, long nWidth,
FontStrikeout eStrikeout,
Color aColor )
{
@@ -3914,6 +3943,8 @@ void OutputDevice::ImplDrawStrikeoutLine( long nBaseX, long nBaseY,
long nLinePos = 0;
long nLinePos2 = 0;
+ long nY = nDistY;
+
if ( eStrikeout > STRIKEOUT_LAST )
eStrikeout = STRIKEOUT_SINGLE;
@@ -3946,7 +3977,7 @@ void OutputDevice::ImplDrawStrikeoutLine( long nBaseX, long nBaseY,
mpGraphics->SetFillColor( ImplColorToSal( aColor ) );
mbInitFillColor = TRUE;
- long nLeft = nX;
+ const long& nLeft = nDistX;
switch ( eStrikeout )
{
@@ -3967,7 +3998,7 @@ void OutputDevice::ImplDrawStrikeoutLine( long nBaseX, long nBaseY,
// -----------------------------------------------------------------------
void OutputDevice::ImplDrawStrikeoutChar( long nBaseX, long nBaseY,
- long nX, long nY, long nWidth,
+ long nDistX, long nDistY, long nWidth,
FontStrikeout eStrikeout,
Color aColor )
{
@@ -4001,12 +4032,12 @@ void OutputDevice::ImplDrawStrikeoutChar( long nBaseX, long nBaseY,
// calculate acceptable strikeout length
// allow the strikeout to be one pixel larger than the text it strikes out
- long nMaxWidth = nStrikeoutWidth / 2;
+ long nMaxWidth = nStrikeoutWidth * 3 / 4;
if ( nMaxWidth < 2 )
nMaxWidth = 2;
nMaxWidth += nWidth + 1;
- int nStrikeStrLen = (nMaxWidth + nStrikeoutWidth - 1) / nStrikeoutWidth;
+ int nStrikeStrLen = (nMaxWidth - 1) / nStrikeoutWidth;
// if the text width is smaller than the strikeout text, then do not
// strike out at all. This case requires user interaction, e.g. adding
// a space to the text
@@ -4021,7 +4052,9 @@ void OutputDevice::ImplDrawStrikeoutChar( long nBaseX, long nBaseY,
const String aStrikeoutText( aChars, xub_StrLen(nStrikeStrLen) );
if( mpFontEntry->mnOrientation )
- ImplRotatePos( nBaseX, nBaseY, nX, nY, mpFontEntry->mnOrientation );
+ ImplRotatePos( 0, 0, nDistX, nDistY, mpFontEntry->mnOrientation );
+ nBaseX += nDistX;
+ nBaseY += nDistY;
// strikeout text has to be left aligned
ULONG nOrigTLM = mnTextLayoutMode;
@@ -4037,7 +4070,7 @@ void OutputDevice::ImplDrawStrikeoutChar( long nBaseX, long nBaseY,
SetTextColor( aColor );
ImplInitTextColor();
- pLayout->DrawBase() = Point( nX+mnTextOffX, nY+mnTextOffY );
+ pLayout->DrawBase() = Point( nBaseX+mnTextOffX, nBaseY+mnTextOffY );
pLayout->DrawText( *mpGraphics );
pLayout->Release();
@@ -4047,8 +4080,8 @@ void OutputDevice::ImplDrawStrikeoutChar( long nBaseX, long nBaseY,
// -----------------------------------------------------------------------
-void OutputDevice::ImplDrawTextLine( long nBaseX,
- long nX, long nY, long nWidth,
+void OutputDevice::ImplDrawTextLine( long nX, long nY,
+ long nDistX, long nWidth,
FontStrikeout eStrikeout,
FontUnderline eUnderline,
FontUnderline eOverline,
@@ -4064,10 +4097,14 @@ void OutputDevice::ImplDrawTextLine( long nBaseX,
BOOL bUnderlineDone = FALSE;
BOOL bOverlineDone = FALSE;
- // TODO: fix rotated text
if ( IsRTLEnabled() )
+ {
// --- RTL --- mirror at basex
- nX = nBaseX - nWidth - (nX - nBaseX - 1);
+ long nXAdd = nWidth - nDistX;
+ if( mpFontEntry->mnOrientation )
+ nXAdd = FRound( nXAdd * cos( mpFontEntry->mnOrientation * F_PI1800 ) );
+ nX += nXAdd - 1;
+ }
if ( !IsTextLineColor() )
aUnderlineColor = GetTextColor();
@@ -4080,7 +4117,7 @@ void OutputDevice::ImplDrawTextLine( long nBaseX,
(eUnderline == UNDERLINE_DOUBLEWAVE) ||
(eUnderline == UNDERLINE_BOLDWAVE) )
{
- ImplDrawWaveTextLine( nBaseX, nY, nX, nY, nWidth, eUnderline, aUnderlineColor, bUnderlineAbove );
+ ImplDrawWaveTextLine( nX, nY, nDistX, 0, nWidth, eUnderline, aUnderlineColor, bUnderlineAbove );
bUnderlineDone = TRUE;
}
if ( (eOverline == UNDERLINE_SMALLWAVE) ||
@@ -4088,25 +4125,25 @@ void OutputDevice::ImplDrawTextLine( long nBaseX,
(eOverline == UNDERLINE_DOUBLEWAVE) ||
(eOverline == UNDERLINE_BOLDWAVE) )
{
- ImplDrawWaveTextLine( nBaseX, nY, nX, nY, nWidth, eOverline, aOverlineColor, TRUE );
+ ImplDrawWaveTextLine( nX, nY, nDistX, 0, nWidth, eOverline, aOverlineColor, TRUE );
bOverlineDone = TRUE;
}
if ( (eStrikeout == STRIKEOUT_SLASH) ||
(eStrikeout == STRIKEOUT_X) )
{
- ImplDrawStrikeoutChar( nBaseX, nY, nX, nY, nWidth, eStrikeout, aStrikeoutColor );
+ ImplDrawStrikeoutChar( nX, nY, nDistX, 0, nWidth, eStrikeout, aStrikeoutColor );
bStrikeoutDone = TRUE;
}
if ( !bUnderlineDone )
- ImplDrawStraightTextLine( nBaseX, nY, nX, nY, nWidth, eUnderline, aUnderlineColor, bUnderlineAbove );
+ ImplDrawStraightTextLine( nX, nY, nDistX, 0, nWidth, eUnderline, aUnderlineColor, bUnderlineAbove );
if ( !bOverlineDone )
- ImplDrawStraightTextLine( nBaseX, nY, nX, nY, nWidth, eOverline, aOverlineColor, TRUE );
+ ImplDrawStraightTextLine( nX, nY, nDistX, 0, nWidth, eOverline, aOverlineColor, TRUE );
if ( !bStrikeoutDone )
- ImplDrawStrikeoutLine( nBaseX, nY, nX, nY, nWidth, eStrikeout, aStrikeoutColor );
+ ImplDrawStrikeoutLine( nX, nY, nDistX, 0, nWidth, eStrikeout, aStrikeoutColor );
}
// -----------------------------------------------------------------------
@@ -4116,34 +4153,49 @@ void OutputDevice::ImplDrawTextLines( SalLayout& rSalLayout,
{
if( bWordLine )
{
- Point aPos, aStartPt;
- sal_Int32 nWidth = 0, nAdvance=0;
+ // draw everything relative to the layout base point
+ const Point aStartPt = rSalLayout.DrawBase();
+ // calculate distance of each word from the base point
+ Point aPos;
+ sal_Int32 nDist = 0, nWidth = 0, nAdvance=0;
for( int nStart = 0;;)
{
+ // iterate through the layouted glyphs
sal_GlyphId nGlyphIndex;
if( !rSalLayout.GetNextGlyphs( 1, &nGlyphIndex, aPos, nStart, &nAdvance ) )
break;
+ // calculate the boundaries of each word
if( !rSalLayout.IsSpacingGlyph( nGlyphIndex ) )
{
if( !nWidth )
{
- aStartPt = aPos;//rSalLayout.DrawBase() - (aPos - rSalLayout.DrawOffset());
+ // get the distance to the base point (as projected to baseline)
+ nDist = aPos.X() - aStartPt.X();
+ if( mpFontEntry->mnOrientation )
+ {
+ const long nDY = aPos.Y() - aStartPt.Y();
+ const double fRad = mpFontEntry->mnOrientation * F_PI1800;
+ nDist = FRound( nDist*cos(fRad) - nDY*sin(fRad) );
+ }
}
+ // update the length of the textline
nWidth += nAdvance;
}
else if( nWidth > 0 )
{
- ImplDrawTextLine( rSalLayout.DrawBase().X(), aStartPt.X(), aStartPt.Y(), nWidth,
+ // draw the textline for each word
+ ImplDrawTextLine( aStartPt.X(), aStartPt.Y(), nDist, nWidth,
eStrikeout, eUnderline, eOverline, bUnderlineAbove );
nWidth = 0;
}
}
+ // draw textline for the last word
if( nWidth > 0 )
{
- ImplDrawTextLine( rSalLayout.DrawBase().X(), aStartPt.X(), aStartPt.Y(), nWidth,
+ ImplDrawTextLine( aStartPt.X(), aStartPt.Y(), nDist, nWidth,
eStrikeout, eUnderline, eOverline, bUnderlineAbove );
}
}
@@ -4151,7 +4203,7 @@ void OutputDevice::ImplDrawTextLines( SalLayout& rSalLayout,
{
Point aStartPt = rSalLayout.GetDrawPosition();
int nWidth = rSalLayout.GetTextWidth() / rSalLayout.GetUnitsPerPixel();
- ImplDrawTextLine( rSalLayout.DrawBase().X(), aStartPt.X(), aStartPt.Y(), nWidth,
+ ImplDrawTextLine( aStartPt.X(), aStartPt.Y(), 0, nWidth,
eStrikeout, eUnderline, eOverline, bUnderlineAbove );
}
}
@@ -4170,7 +4222,7 @@ void OutputDevice::ImplDrawMnemonicLine( long nX, long nY, long nWidth )
nX = nBaseX - nWidth - (nX - nBaseX - 1);
}
- ImplDrawTextLine( nBaseX, nX, nY, nWidth, STRIKEOUT_NONE, UNDERLINE_SINGLE, UNDERLINE_NONE, FALSE );
+ ImplDrawTextLine( nX, nY, 0, nWidth, STRIKEOUT_NONE, UNDERLINE_SINGLE, UNDERLINE_NONE, FALSE );
}
// -----------------------------------------------------------------------
@@ -5418,7 +5470,7 @@ void OutputDevice::DrawTextLine( const Point& rPos, long nWidth,
Point aPos = ImplLogicToDevicePixel( rPos );
nWidth = ImplLogicWidthToDevicePixel( nWidth );
aPos += Point( mnTextOffX, mnTextOffY );
- ImplDrawTextLine( aPos.X(), aPos.X(), aPos.Y(), nWidth, eStrikeout, eUnderline, eOverline, bUnderlineAbove );
+ ImplDrawTextLine( aPos.X(), aPos.X(), 0, nWidth, eStrikeout, eUnderline, eOverline, bUnderlineAbove );
if( mpAlphaVDev )
mpAlphaVDev->DrawTextLine( rPos, nWidth, eStrikeout, eUnderline, eOverline, bUnderlineAbove );
@@ -5495,7 +5547,7 @@ void OutputDevice::DrawWaveLine( const Point& rStartPos, const Point& rEndPos,
if( nWaveHeight > pFontEntry->maMetric.mnWUnderlineSize )
nWaveHeight = pFontEntry->maMetric.mnWUnderlineSize;
- ImplDrawWaveLine( nStartX, nStartY, nStartX, nStartY,
+ ImplDrawWaveLine( nStartX, nStartY, 0, 0,
nEndX-nStartX, nWaveHeight, 1,
nOrientation, GetLineColor() );
if( mpAlphaVDev )
@@ -6058,6 +6110,11 @@ SalLayout* OutputDevice::ImplGlyphFallbackLayout( SalLayout* pSalLayout, ImplLay
rtl::OUString aMissingCodes = aMissingCodeBuf.makeStringAndClear();
ImplFontSelectData aFontSelData = mpFontEntry->maFontSelData;
+
+ ImplFontMetricData aOrigMetric( aFontSelData );
+ // TODO: use cached metric in fontentry
+ mpGraphics->GetFontMetric( &aOrigMetric );
+
// when device specific font substitution may have been performed for
// the originally selected font then make sure that a fallback to that
// font is performed first
@@ -6102,7 +6159,27 @@ SalLayout* OutputDevice::ImplGlyphFallbackLayout( SalLayout* pSalLayout, ImplLay
}
#endif
+ // TODO: try to get the metric data from the GFB's mpFontEntry
+ ImplFontMetricData aSubstituteMetric( aFontSelData );
pFallbackFont->mnSetFontFlags = mpGraphics->SetFont( &aFontSelData, nFallbackLevel );
+ mpGraphics->GetFontMetric( &aSubstituteMetric, nFallbackLevel );
+
+ const long nOriginalHeight = aOrigMetric.mnAscent + aOrigMetric.mnDescent;
+ const long nSubstituteHeight = aSubstituteMetric.mnAscent + aSubstituteMetric.mnDescent;
+ // Too tall, shrink it a bit. Need a better calculation to include extra
+ // factors and any extra wriggle room we might have available?
+ // TODO: should we scale by max-ascent/max-descent instead of design height?
+ if( nSubstituteHeight > nOriginalHeight )
+ {
+ const float fScale = nOriginalHeight / (float)nSubstituteHeight;
+ const float fOrigHeight = aFontSelData.mfExactHeight;
+ const int nOrigHeight = aFontSelData.mnHeight;
+ aFontSelData.mfExactHeight *= fScale;
+ aFontSelData.mnHeight = static_cast<int>(aFontSelData.mfExactHeight);
+ pFallbackFont->mnSetFontFlags = mpGraphics->SetFont( &aFontSelData, nFallbackLevel );
+ aFontSelData.mnHeight = nOrigHeight;
+ aFontSelData.mfExactHeight = fOrigHeight;
+ }
// create and add glyph fallback layout to multilayout
rLayoutArgs.ResetPos();
@@ -6764,7 +6841,20 @@ String OutputDevice::ImplGetEllipsisString( const OutputDevice& rTargetDevice, c
if ( nIndex != STRING_LEN )
{
- if ( nStyle & TEXT_DRAW_ENDELLIPSIS )
+ if( (nStyle & TEXT_DRAW_CENTERELLIPSIS) == TEXT_DRAW_CENTERELLIPSIS )
+ {
+ String aTmpStr( aStr );
+ xub_StrLen nEraseChars = 4;
+ while( nEraseChars < aStr.Len() && _rLayout.GetTextWidth( aTmpStr, 0, aTmpStr.Len() ) > nMaxWidth )
+ {
+ aTmpStr = aStr;
+ xub_StrLen i = (aTmpStr.Len() - nEraseChars)/2;
+ aTmpStr.Erase( i, nEraseChars++ );
+ aTmpStr.InsertAscii( "...", i );
+ }
+ aStr = aTmpStr;
+ }
+ else if ( nStyle & TEXT_DRAW_ENDELLIPSIS )
{
aStr.Erase( nIndex );
if ( nIndex > 1 )
@@ -7947,7 +8037,7 @@ BOOL OutputDevice::GetFontCharMap( FontCharMap& rFontCharMap ) const
if( !mpFontEntry )
return FALSE;
- // a little font charmap cache helps considerably
+#ifdef ENABLE_IFC_CACHE // a little font charmap cache helps considerably
static const int NMAXITEMS = 16;
static int nUsedItems = 0, nCurItem = 0;
@@ -7965,10 +8055,12 @@ BOOL OutputDevice::GetFontCharMap( FontCharMap& rFontCharMap ) const
rFontCharMap.Reset( aCache[i].maCharMap.mpImpl );
}
else // need to cache
+#endif // ENABLE_IFC_CACHE
{
- ImplFontCharMap* pNewMap = mpGraphics->GetImplFontCharMap();
+ const ImplFontCharMap* pNewMap = mpGraphics->GetImplFontCharMap();
rFontCharMap.Reset( pNewMap );
+#ifdef ENABLE_IFC_CACHE
// manage cache round-robin and insert data
CharMapCacheItem& rItem = aCache[ nCurItem ];
rItem.mpFontData = pFontData;
@@ -7979,6 +8071,7 @@ BOOL OutputDevice::GetFontCharMap( FontCharMap& rFontCharMap ) const
if( ++nUsedItems >= NMAXITEMS )
nUsedItems = NMAXITEMS;
+#endif // ENABLE_IFC_CACHE
}
if( rFontCharMap.IsDefaultMap() )
diff --git a/vcl/source/gdi/pdfwriter.cxx b/vcl/source/gdi/pdfwriter.cxx
index 5dcce25a0315..23ce1dfa6169 100644
--- a/vcl/source/gdi/pdfwriter.cxx
+++ b/vcl/source/gdi/pdfwriter.cxx
@@ -38,9 +38,9 @@ PDFWriter::AnyWidget::~AnyWidget()
{
}
-PDFWriter::PDFWriter( const PDFWriter::PDFWriterContext& rContext )
+PDFWriter::PDFWriter( const PDFWriter::PDFWriterContext& rContext, const com::sun::star::uno::Reference< com::sun::star::beans::XMaterialHolder >& xEnc )
:
- pImplementation( new PDFWriterImpl( rContext ) )
+ pImplementation( new PDFWriterImpl( rContext, xEnc, *this ) )
{
}
@@ -69,16 +69,6 @@ PDFWriter::PDFVersion PDFWriter::GetVersion() const
return ((PDFWriterImpl*)pImplementation)->getVersion();
}
-void PDFWriter::SetDocInfo( const PDFDocInfo& rInfo )
-{
- ((PDFWriterImpl*)pImplementation)->setDocInfo( rInfo );
-}
-
-const PDFDocInfo& PDFWriter::GetDocInfo() const
-{
- return ((PDFWriterImpl*)pImplementation)->getDocInfo();
-}
-
void PDFWriter::SetDocumentLocale( const com::sun::star::lang::Locale& rLoc )
{
((PDFWriterImpl*)pImplementation)->setDocumentLocale( rLoc );
@@ -569,3 +559,18 @@ std::set< PDFWriter::ErrorCode > PDFWriter::GetErrors()
{
return ((PDFWriterImpl*)pImplementation)->getErrors();
}
+
+com::sun::star::uno::Reference< com::sun::star::beans::XMaterialHolder >
+PDFWriter::InitEncryption( const rtl::OUString& i_rOwnerPassword,
+ const rtl::OUString& i_rUserPassword,
+ bool b128Bit
+ )
+{
+ return PDFWriterImpl::initEncryption( i_rOwnerPassword, i_rUserPassword, b128Bit );
+}
+
+void PDFWriter::PlayMetafile( const GDIMetaFile& i_rMTF, const vcl::PDFWriter::PlayMetafileContext& i_rPlayContext, PDFExtOutDevData* i_pData )
+{
+ ((PDFWriterImpl*)pImplementation)->playMetafile( i_rMTF, i_pData, i_rPlayContext, NULL);
+}
+
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index aa9f642f9fee..325ccef1c3a6 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -67,6 +67,7 @@
#include "cppuhelper/implbase1.hxx"
#include <icc/sRGB-IEC61966-2.1.hxx>
#include <vcl/lineinfo.hxx>
+#include "vcl/strhelper.hxx"
using namespace vcl;
using namespace rtl;
@@ -112,12 +113,10 @@ void doTestCode()
aContext.Version = PDFWriter::PDF_1_4;
aContext.Tagged = true;
aContext.InitialPage = 2;
+ aContext.DocumentInfo.Title = OUString( RTL_CONSTASCII_USTRINGPARAM( "PDF export test document" ) );
+ aContext.DocumentInfo.Producer = OUString( RTL_CONSTASCII_USTRINGPARAM( "VCL" ) );
PDFWriter aWriter( aContext );
- PDFDocInfo aDocInfo;
- aDocInfo.Title = OUString( RTL_CONSTASCII_USTRINGPARAM( "PDF export test document" ) );
- aDocInfo.Producer = OUString( RTL_CONSTASCII_USTRINGPARAM( "VCL" ) );
- aWriter.SetDocInfo( aDocInfo );
aWriter.NewPage( 595, 842 );
aWriter.BeginStructureElement( PDFWriter::Document );
// set duration of 3 sec for first page
@@ -495,6 +494,12 @@ static inline double pixelToPoint( sal_Int32 px ) { return double(px)/fDivisor;
static inline double pixelToPoint( double px ) { return px/fDivisor; }
static inline sal_Int32 pointToPixel( double pt ) { return sal_Int32(pt*fDivisor); }
+const sal_uInt8 PDFWriterImpl::s_nPadString[32] =
+{
+ 0x28, 0xBF, 0x4E, 0x5E, 0x4E, 0x75, 0x8A, 0x41, 0x64, 0x00, 0x4E, 0x56, 0xFF, 0xFA, 0x01, 0x08,
+ 0x2E, 0x2E, 0x00, 0xB6, 0xD0, 0x68, 0x3E, 0x80, 0x2F, 0x0C, 0xA9, 0xFE, 0x64, 0x53, 0x69, 0x7A
+};
+
static void appendHex( sal_Int8 nInt, OStringBuffer& rBuffer )
{
static const sal_Char pHexDigits[] = { '0', '1', '2', '3', '4', '5', '6', '7',
@@ -1692,7 +1697,9 @@ void PDFWriterImpl::PDFPage::appendWaveLine( sal_Int32 nWidth, sal_Int32 nY, sal
* class PDFWriterImpl
*/
-PDFWriterImpl::PDFWriterImpl( const PDFWriter::PDFWriterContext& rContext )
+ PDFWriterImpl::PDFWriterImpl( const PDFWriter::PDFWriterContext& rContext,
+ const com::sun::star::uno::Reference< com::sun::star::beans::XMaterialHolder >& xEnc,
+ PDFWriter& i_rOuterFace)
:
m_pReferenceDevice( NULL ),
m_aMapMode( MAP_POINT, Point(), Fraction( 1L, pointToPixel(1) ), Fraction( 1L, pointToPixel(1) ) ),
@@ -1713,12 +1720,10 @@ PDFWriterImpl::PDFWriterImpl( const PDFWriter::PDFWriterContext& rContext )
m_aCipher( (rtlCipher)NULL ),
m_aDigest( NULL ),
m_bEncryptThisStream( false ),
- m_aDocID( 32 ),
- m_aCreationDateString( 64 ),
- m_aCreationMetaDateString( 64 ),
m_pEncryptionBuffer( NULL ),
m_nEncryptionBufferSize( 0 ),
- m_bIsPDF_A1( false )
+ m_bIsPDF_A1( false ),
+ m_rOuterFace( i_rOuterFace )
{
#ifdef DO_TEST_PDF
static bool bOnce = true;
@@ -1757,14 +1762,37 @@ PDFWriterImpl::PDFWriterImpl( const PDFWriter::PDFWriterContext& rContext )
m_bOpen = true;
-/* prepare the cypher engine, can be done in CTOR, free in DTOR */
+ // setup DocInfo
+ setupDocInfo();
+ /* prepare the cypher engine, can be done in CTOR, free in DTOR */
m_aCipher = rtl_cipher_createARCFOUR( rtl_Cipher_ModeStream );
m_aDigest = rtl_digest_createMD5();
-/* the size of the Codec default maximum */
+ /* the size of the Codec default maximum */
checkEncryptionBufferSize( 0x4000 );
+ if( xEnc.is() )
+ prepareEncryption( xEnc );
+
+ if( m_aContext.Encryption.Encrypt() )
+ {
+ // sanity check
+ if( m_aContext.Encryption.OValue.size() != ENCRYPTED_PWD_SIZE ||
+ m_aContext.Encryption.UValue.size() != ENCRYPTED_PWD_SIZE ||
+ m_aContext.Encryption.EncryptionKey.size() != MAXIMUM_RC4_KEY_LENGTH
+ )
+ {
+ // the field lengths are invalid ? This was not setup by initEncryption.
+ // do not encrypt after all
+ m_aContext.Encryption.OValue.clear();
+ m_aContext.Encryption.UValue.clear();
+ OSL_ENSURE( 0, "encryption data failed sanity check, encryption disabled" );
+ }
+ else // setup key lengths
+ m_nAccessPermissions = computeAccessPermissions( m_aContext.Encryption, m_nKeyLength, m_nRC4KeyLength );
+ }
+
// write header
OStringBuffer aBuffer( 20 );
aBuffer.append( "%PDF-" );
@@ -1810,139 +1838,138 @@ PDFWriterImpl::~PDFWriterImpl()
rtl_freeMemory( m_pEncryptionBuffer );
}
-void PDFWriterImpl::setDocInfo( const PDFDocInfo& rInfo )
+void PDFWriterImpl::setupDocInfo()
{
- m_aDocInfo.Title = rInfo.Title;
- m_aDocInfo.Author = rInfo.Author;
- m_aDocInfo.Subject = rInfo.Subject;
- m_aDocInfo.Keywords = rInfo.Keywords;
- m_aDocInfo.Creator = rInfo.Creator;
- m_aDocInfo.Producer = rInfo.Producer;
+ std::vector< sal_uInt8 > aId;
+ computeDocumentIdentifier( aId, m_aContext.DocumentInfo, m_aCreationDateString, m_aCreationMetaDateString );
+ if( m_aContext.Encryption.DocumentIdentifier.empty() )
+ m_aContext.Encryption.DocumentIdentifier = aId;
+}
-//build the document id
+void PDFWriterImpl::computeDocumentIdentifier( std::vector< sal_uInt8 >& o_rIdentifier,
+ const vcl::PDFWriter::PDFDocInfo& i_rDocInfo,
+ rtl::OString& o_rCString1,
+ rtl::OString& o_rCString2
+ )
+{
+ o_rIdentifier.clear();
+
+ //build the document id
rtl::OString aInfoValuesOut;
OStringBuffer aID( 1024 );
- if( m_aDocInfo.Title.Len() )
- appendUnicodeTextString( m_aDocInfo.Title, aID );
- if( m_aDocInfo.Author.Len() )
- appendUnicodeTextString( m_aDocInfo.Author, aID );
- if( m_aDocInfo.Subject.Len() )
- appendUnicodeTextString( m_aDocInfo.Subject, aID );
- if( m_aDocInfo.Keywords.Len() )
- appendUnicodeTextString( m_aDocInfo.Keywords, aID );
- if( m_aDocInfo.Creator.Len() )
- appendUnicodeTextString( m_aDocInfo.Creator, aID );
- if( m_aDocInfo.Producer.Len() )
- appendUnicodeTextString( m_aDocInfo.Producer, aID );
+ if( i_rDocInfo.Title.Len() )
+ appendUnicodeTextString( i_rDocInfo.Title, aID );
+ if( i_rDocInfo.Author.Len() )
+ appendUnicodeTextString( i_rDocInfo.Author, aID );
+ if( i_rDocInfo.Subject.Len() )
+ appendUnicodeTextString( i_rDocInfo.Subject, aID );
+ if( i_rDocInfo.Keywords.Len() )
+ appendUnicodeTextString( i_rDocInfo.Keywords, aID );
+ if( i_rDocInfo.Creator.Len() )
+ appendUnicodeTextString( i_rDocInfo.Creator, aID );
+ if( i_rDocInfo.Producer.Len() )
+ appendUnicodeTextString( i_rDocInfo.Producer, aID );
TimeValue aTVal, aGMT;
oslDateTime aDT;
osl_getSystemTime( &aGMT );
osl_getLocalTimeFromSystemTime( &aGMT, &aTVal );
osl_getDateTimeFromTimeValue( &aTVal, &aDT );
- m_aCreationDateString.append( "D:" );
- m_aCreationDateString.append( (sal_Char)('0' + ((aDT.Year/1000)%10)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((aDT.Year/100)%10)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((aDT.Year/10)%10)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((aDT.Year)%10)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((aDT.Month/10)%10)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((aDT.Month)%10)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((aDT.Day/10)%10)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((aDT.Day)%10)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((aDT.Hours/10)%10)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((aDT.Hours)%10)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((aDT.Minutes/10)%10)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((aDT.Minutes)%10)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((aDT.Seconds/10)%10)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((aDT.Seconds)%10)) );
-//--> i59651, we fill the Metadata date string as well, if PDF/A is requested
- if( m_bIsPDF_A1 )
- {
-// according to ISO 19005-1:2005 6.7.3 the date is corrected for
-// local time zone offset UTC only, whereas Acrobat 8 seems
-// to use the localtime notation only
-// according to a raccomandation in XMP Specification (Jan 2004, page 75)
-// the Acrobat way seems the right approach
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Year/1000)%10)) );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Year/100)%10)) );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Year/10)%10)) );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Year)%10)) );
- m_aCreationMetaDateString.append( "-" );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Month/10)%10)) );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Month)%10)) );
- m_aCreationMetaDateString.append( "-" );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Day/10)%10)) );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Day)%10)) );
- m_aCreationMetaDateString.append( "T" );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Hours/10)%10)) );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Hours)%10)) );
- m_aCreationMetaDateString.append( ":" );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Minutes/10)%10)) );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Minutes)%10)) );
- m_aCreationMetaDateString.append( ":" );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Seconds/10)%10)) );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Seconds)%10)) );
- }
+ rtl::OStringBuffer aCreationDateString(64), aCreationMetaDateString(64);
+ aCreationDateString.append( "D:" );
+ aCreationDateString.append( (sal_Char)('0' + ((aDT.Year/1000)%10)) );
+ aCreationDateString.append( (sal_Char)('0' + ((aDT.Year/100)%10)) );
+ aCreationDateString.append( (sal_Char)('0' + ((aDT.Year/10)%10)) );
+ aCreationDateString.append( (sal_Char)('0' + ((aDT.Year)%10)) );
+ aCreationDateString.append( (sal_Char)('0' + ((aDT.Month/10)%10)) );
+ aCreationDateString.append( (sal_Char)('0' + ((aDT.Month)%10)) );
+ aCreationDateString.append( (sal_Char)('0' + ((aDT.Day/10)%10)) );
+ aCreationDateString.append( (sal_Char)('0' + ((aDT.Day)%10)) );
+ aCreationDateString.append( (sal_Char)('0' + ((aDT.Hours/10)%10)) );
+ aCreationDateString.append( (sal_Char)('0' + ((aDT.Hours)%10)) );
+ aCreationDateString.append( (sal_Char)('0' + ((aDT.Minutes/10)%10)) );
+ aCreationDateString.append( (sal_Char)('0' + ((aDT.Minutes)%10)) );
+ aCreationDateString.append( (sal_Char)('0' + ((aDT.Seconds/10)%10)) );
+ aCreationDateString.append( (sal_Char)('0' + ((aDT.Seconds)%10)) );
+
+ //--> i59651, we fill the Metadata date string as well, if PDF/A is requested
+ // according to ISO 19005-1:2005 6.7.3 the date is corrected for
+ // local time zone offset UTC only, whereas Acrobat 8 seems
+ // to use the localtime notation only
+ // according to a raccomandation in XMP Specification (Jan 2004, page 75)
+ // the Acrobat way seems the right approach
+ aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Year/1000)%10)) );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Year/100)%10)) );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Year/10)%10)) );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Year)%10)) );
+ aCreationMetaDateString.append( "-" );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Month/10)%10)) );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Month)%10)) );
+ aCreationMetaDateString.append( "-" );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Day/10)%10)) );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Day)%10)) );
+ aCreationMetaDateString.append( "T" );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Hours/10)%10)) );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Hours)%10)) );
+ aCreationMetaDateString.append( ":" );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Minutes/10)%10)) );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Minutes)%10)) );
+ aCreationMetaDateString.append( ":" );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Seconds/10)%10)) );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Seconds)%10)) );
+
sal_uInt32 nDelta = 0;
if( aGMT.Seconds > aTVal.Seconds )
{
- m_aCreationDateString.append( "-" );
+ aCreationDateString.append( "-" );
nDelta = aGMT.Seconds-aTVal.Seconds;
- if( m_bIsPDF_A1 )
- m_aCreationMetaDateString.append( "-" );
+ aCreationMetaDateString.append( "-" );
}
else if( aGMT.Seconds < aTVal.Seconds )
{
- m_aCreationDateString.append( "+" );
+ aCreationDateString.append( "+" );
nDelta = aTVal.Seconds-aGMT.Seconds;
- if( m_bIsPDF_A1 )
- m_aCreationMetaDateString.append( "+" );
+ aCreationMetaDateString.append( "+" );
}
else
{
- m_aCreationDateString.append( "Z" );
- if( m_bIsPDF_A1 )
- m_aCreationMetaDateString.append( "Z" );
+ aCreationDateString.append( "Z" );
+ aCreationMetaDateString.append( "Z" );
}
if( nDelta )
{
- m_aCreationDateString.append( (sal_Char)('0' + ((nDelta/36000)%10)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((nDelta/3600)%10)) );
- m_aCreationDateString.append( "'" );
- m_aCreationDateString.append( (sal_Char)('0' + ((nDelta/600)%6)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((nDelta/60)%10)) );
- if( m_bIsPDF_A1 )
- {
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((nDelta/36000)%10)) );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((nDelta/3600)%10)) );
- m_aCreationMetaDateString.append( ":" );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((nDelta/600)%6)) );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((nDelta/60)%10)) );
- }
+ aCreationDateString.append( (sal_Char)('0' + ((nDelta/36000)%10)) );
+ aCreationDateString.append( (sal_Char)('0' + ((nDelta/3600)%10)) );
+ aCreationDateString.append( "'" );
+ aCreationDateString.append( (sal_Char)('0' + ((nDelta/600)%6)) );
+ aCreationDateString.append( (sal_Char)('0' + ((nDelta/60)%10)) );
+
+ aCreationMetaDateString.append( (sal_Char)('0' + ((nDelta/36000)%10)) );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((nDelta/3600)%10)) );
+ aCreationMetaDateString.append( ":" );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((nDelta/600)%6)) );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((nDelta/60)%10)) );
}
- m_aCreationDateString.append( "'" );
- aID.append( m_aCreationDateString.getStr(), m_aCreationDateString.getLength() );
+ aCreationDateString.append( "'" );
+ aID.append( aCreationDateString.getStr(), aCreationDateString.getLength() );
aInfoValuesOut = aID.makeStringAndClear();
+ o_rCString1 = aCreationDateString.makeStringAndClear();
+ o_rCString2 = aCreationMetaDateString.makeStringAndClear();
- DBG_ASSERT( m_aDigest != NULL, "PDFWrite_Impl::setDocInfo: cannot obtain a digest object !" );
-
- m_aDocID.setLength( 0 );
- if( m_aDigest )
+ rtlDigest aDigest = rtl_digest_createMD5();
+ OSL_ENSURE( aDigest != NULL, "PDFWriterImpl::computeDocumentIdentifier: cannot obtain a digest object !" );
+ if( aDigest )
{
- osl_getSystemTime( &aGMT );
- rtlDigestError nError = rtl_digest_updateMD5( m_aDigest, &aGMT, sizeof( aGMT ) );
- if( nError == rtl_Digest_E_None )
- nError = rtl_digest_updateMD5( m_aDigest, m_aContext.URL.getStr(), m_aContext.URL.getLength()*sizeof(sal_Unicode) );
+ rtlDigestError nError = rtl_digest_updateMD5( aDigest, &aGMT, sizeof( aGMT ) );
if( nError == rtl_Digest_E_None )
- nError = rtl_digest_updateMD5( m_aDigest, aInfoValuesOut.getStr(), aInfoValuesOut.getLength() );
+ nError = rtl_digest_updateMD5( aDigest, aInfoValuesOut.getStr(), aInfoValuesOut.getLength() );
if( nError == rtl_Digest_E_None )
{
-//the binary form of the doc id is needed for encryption stuff
- rtl_digest_getMD5( m_aDigest, m_nDocID, 16 );
- for( unsigned int i = 0; i < 16; i++ )
- appendHex( m_nDocID[i], m_aDocID );
+ o_rIdentifier = std::vector< sal_uInt8 >( 16, 0 );
+ //the binary form of the doc id is needed for encryption stuff
+ rtl_digest_getMD5( aDigest, &o_rIdentifier[0], 16 );
}
}
}
@@ -1955,7 +1982,7 @@ append the string as unicode hex, encrypted if needed
inline void PDFWriterImpl::appendUnicodeTextStringEncrypt( const rtl::OUString& rInString, const sal_Int32 nInObjectNumber, OStringBuffer& rOutBuffer )
{
rOutBuffer.append( "<" );
- if( m_aContext.Encrypt )
+ if( m_aContext.Encryption.Encrypt() )
{
const sal_Unicode* pStr = rInString.getStr();
sal_Int32 nLen = rInString.getLength();
@@ -1992,7 +2019,7 @@ inline void PDFWriterImpl::appendLiteralStringEncrypt( rtl::OStringBuffer& rInSt
rOutBuffer.append( "(" );
sal_Int32 nChars = rInString.getLength();
//check for encryption, if ok, encrypt the string, then convert with appndLiteralString
- if( m_aContext.Encrypt && checkEncryptionBufferSize( nChars ) )
+ if( m_aContext.Encryption.Encrypt() && checkEncryptionBufferSize( nChars ) )
{
//encrypt the string in a buffer, then append it
enableStringEncryption( nInObjectNumber );
@@ -2137,7 +2164,10 @@ OutputDevice* PDFWriterImpl::getReferenceDevice()
m_pReferenceDevice = pVDev;
- pVDev->SetReferenceDevice( VirtualDevice::REFDEV_MODE_PDF1 );
+ if( m_aContext.DPIx == 0 || m_aContext.DPIy == 0 )
+ pVDev->SetReferenceDevice( VirtualDevice::REFDEV_MODE_PDF1 );
+ else
+ pVDev->SetReferenceDevice( m_aContext.DPIx, m_aContext.DPIy );
pVDev->SetOutputSizePixel( Size( 640, 480 ) );
pVDev->SetMapMode( MAP_MM );
@@ -2379,9 +2409,6 @@ SalLayout* PDFWriterImpl::GetTextLayout( ImplLayoutArgs& rArgs, ImplFontSelectDa
sal_Int32 PDFWriterImpl::newPage( sal_Int32 nPageWidth, sal_Int32 nPageHeight, PDFWriter::Orientation eOrientation )
{
- if( m_aContext.Encrypt && m_aPages.empty() )
- initEncryption();
-
endPage();
m_nCurrentPage = m_aPages.size();
m_aPages.push_back( PDFPage(this, nPageWidth, nPageHeight, eOrientation ) );
@@ -5876,7 +5903,7 @@ bool PDFWriterImpl::emitCatalog()
}
// viewer preferences, if we had some, then emit
if( m_aContext.HideViewerToolbar ||
- ( m_aContext.Version > PDFWriter::PDF_1_3 && m_aDocInfo.Title.Len() && m_aContext.DisplayPDFDocumentTitle ) ||
+ ( m_aContext.Version > PDFWriter::PDF_1_3 && m_aContext.DocumentInfo.Title.Len() && m_aContext.DisplayPDFDocumentTitle ) ||
m_aContext.HideViewerMenubar ||
m_aContext.HideViewerWindowControls || m_aContext.FitWindow ||
m_aContext.CenterWindow || (m_aContext.FirstPageLeft && m_aContext.PageLayout == PDFWriter::ContinuousFacing ) ||
@@ -5893,7 +5920,7 @@ bool PDFWriterImpl::emitCatalog()
aLine.append( "/FitWindow true\n" );
if( m_aContext.CenterWindow )
aLine.append( "/CenterWindow true\n" );
- if( m_aContext.Version > PDFWriter::PDF_1_3 && m_aDocInfo.Title.Len() && m_aContext.DisplayPDFDocumentTitle )
+ if( m_aContext.Version > PDFWriter::PDF_1_3 && m_aContext.DocumentInfo.Title.Len() && m_aContext.DisplayPDFDocumentTitle )
aLine.append( "/DisplayDocTitle true\n" );
if( m_aContext.FirstPageLeft && m_aContext.PageLayout == PDFWriter::ContinuousFacing )
aLine.append( "/Direction/R2L\n" );
@@ -5997,40 +6024,40 @@ sal_Int32 PDFWriterImpl::emitInfoDict( )
aLine.append( nObject );
aLine.append( " 0 obj\n"
"<<" );
- if( m_aDocInfo.Title.Len() )
+ if( m_aContext.DocumentInfo.Title.Len() )
{
aLine.append( "/Title" );
- appendUnicodeTextStringEncrypt( m_aDocInfo.Title, nObject, aLine );
+ appendUnicodeTextStringEncrypt( m_aContext.DocumentInfo.Title, nObject, aLine );
aLine.append( "\n" );
}
- if( m_aDocInfo.Author.Len() )
+ if( m_aContext.DocumentInfo.Author.Len() )
{
aLine.append( "/Author" );
- appendUnicodeTextStringEncrypt( m_aDocInfo.Author, nObject, aLine );
+ appendUnicodeTextStringEncrypt( m_aContext.DocumentInfo.Author, nObject, aLine );
aLine.append( "\n" );
}
- if( m_aDocInfo.Subject.Len() )
+ if( m_aContext.DocumentInfo.Subject.Len() )
{
aLine.append( "/Subject" );
- appendUnicodeTextStringEncrypt( m_aDocInfo.Subject, nObject, aLine );
+ appendUnicodeTextStringEncrypt( m_aContext.DocumentInfo.Subject, nObject, aLine );
aLine.append( "\n" );
}
- if( m_aDocInfo.Keywords.Len() )
+ if( m_aContext.DocumentInfo.Keywords.Len() )
{
aLine.append( "/Keywords" );
- appendUnicodeTextStringEncrypt( m_aDocInfo.Keywords, nObject, aLine );
+ appendUnicodeTextStringEncrypt( m_aContext.DocumentInfo.Keywords, nObject, aLine );
aLine.append( "\n" );
}
- if( m_aDocInfo.Creator.Len() )
+ if( m_aContext.DocumentInfo.Creator.Len() )
{
aLine.append( "/Creator" );
- appendUnicodeTextStringEncrypt( m_aDocInfo.Creator, nObject, aLine );
+ appendUnicodeTextStringEncrypt( m_aContext.DocumentInfo.Creator, nObject, aLine );
aLine.append( "\n" );
}
- if( m_aDocInfo.Producer.Len() )
+ if( m_aContext.DocumentInfo.Producer.Len() )
{
aLine.append( "/Producer" );
- appendUnicodeTextStringEncrypt( m_aDocInfo.Producer, nObject, aLine );
+ appendUnicodeTextStringEncrypt( m_aContext.DocumentInfo.Producer, nObject, aLine );
aLine.append( "\n" );
}
@@ -6276,45 +6303,45 @@ sal_Int32 PDFWriterImpl::emitDocumentMetadata()
aMetadataStream.append( " <pdfaid:conformance>A</pdfaid:conformance>\n" );
aMetadataStream.append( " </rdf:Description>\n" );
//... Dublin Core properties go here
- if( m_aDocInfo.Title.Len() ||
- m_aDocInfo.Author.Len() ||
- m_aDocInfo.Subject.Len() )
+ if( m_aContext.DocumentInfo.Title.Len() ||
+ m_aContext.DocumentInfo.Author.Len() ||
+ m_aContext.DocumentInfo.Subject.Len() )
{
aMetadataStream.append( " <rdf:Description rdf:about=\"\"\n" );
aMetadataStream.append( " xmlns:dc=\"http://purl.org/dc/elements/1.1/\">\n" );
- if( m_aDocInfo.Title.Len() )
+ if( m_aContext.DocumentInfo.Title.Len() )
{
// this is according to PDF/A-1, technical corrigendum 1 (2007-04-01)
aMetadataStream.append( " <dc:title>\n" );
aMetadataStream.append( " <rdf:Alt>\n" );
aMetadataStream.append( " <rdf:li xml:lang=\"x-default\">" );
rtl::OUString aTitle;
- escapeStringXML( m_aDocInfo.Title, aTitle );
+ escapeStringXML( m_aContext.DocumentInfo.Title, aTitle );
aMetadataStream.append( OUStringToOString( aTitle, RTL_TEXTENCODING_UTF8 ) );
aMetadataStream.append( "</rdf:li>\n" );
aMetadataStream.append( " </rdf:Alt>\n" );
aMetadataStream.append( " </dc:title>\n" );
}
- if( m_aDocInfo.Author.Len() )
+ if( m_aContext.DocumentInfo.Author.Len() )
{
aMetadataStream.append( " <dc:creator>\n" );
aMetadataStream.append( " <rdf:Seq>\n" );
aMetadataStream.append( " <rdf:li>" );
rtl::OUString aAuthor;
- escapeStringXML( m_aDocInfo.Author, aAuthor );
+ escapeStringXML( m_aContext.DocumentInfo.Author, aAuthor );
aMetadataStream.append( OUStringToOString( aAuthor , RTL_TEXTENCODING_UTF8 ) );
aMetadataStream.append( "</rdf:li>\n" );
aMetadataStream.append( " </rdf:Seq>\n" );
aMetadataStream.append( " </dc:creator>\n" );
}
- if( m_aDocInfo.Subject.Len() )
+ if( m_aContext.DocumentInfo.Subject.Len() )
{
// this is according to PDF/A-1, technical corrigendum 1 (2007-04-01)
aMetadataStream.append( " <dc:description>\n" );
aMetadataStream.append( " <rdf:Alt>\n" );
aMetadataStream.append( " <rdf:li xml:lang=\"x-default\">" );
rtl::OUString aSubject;
- escapeStringXML( m_aDocInfo.Subject, aSubject );
+ escapeStringXML( m_aContext.DocumentInfo.Subject, aSubject );
aMetadataStream.append( OUStringToOString( aSubject , RTL_TEXTENCODING_UTF8 ) );
aMetadataStream.append( "</rdf:li>\n" );
aMetadataStream.append( " </rdf:Alt>\n" );
@@ -6324,24 +6351,24 @@ sal_Int32 PDFWriterImpl::emitDocumentMetadata()
}
//... PDF properties go here
- if( m_aDocInfo.Producer.Len() ||
- m_aDocInfo.Keywords.Len() )
+ if( m_aContext.DocumentInfo.Producer.Len() ||
+ m_aContext.DocumentInfo.Keywords.Len() )
{
aMetadataStream.append( " <rdf:Description rdf:about=\"\"\n" );
aMetadataStream.append( " xmlns:pdf=\"http://ns.adobe.com/pdf/1.3/\">\n" );
- if( m_aDocInfo.Producer.Len() )
+ if( m_aContext.DocumentInfo.Producer.Len() )
{
aMetadataStream.append( " <pdf:Producer>" );
rtl::OUString aProducer;
- escapeStringXML( m_aDocInfo.Producer, aProducer );
+ escapeStringXML( m_aContext.DocumentInfo.Producer, aProducer );
aMetadataStream.append( OUStringToOString( aProducer , RTL_TEXTENCODING_UTF8 ) );
aMetadataStream.append( "</pdf:Producer>\n" );
}
- if( m_aDocInfo.Keywords.Len() )
+ if( m_aContext.DocumentInfo.Keywords.Len() )
{
aMetadataStream.append( " <pdf:Keywords>" );
rtl::OUString aKeywords;
- escapeStringXML( m_aDocInfo.Keywords, aKeywords );
+ escapeStringXML( m_aContext.DocumentInfo.Keywords, aKeywords );
aMetadataStream.append( OUStringToOString( aKeywords , RTL_TEXTENCODING_UTF8 ) );
aMetadataStream.append( "</pdf:Keywords>\n" );
}
@@ -6350,11 +6377,11 @@ sal_Int32 PDFWriterImpl::emitDocumentMetadata()
aMetadataStream.append( " <rdf:Description rdf:about=\"\"\n" );
aMetadataStream.append( " xmlns:xmp=\"http://ns.adobe.com/xap/1.0/\">\n" );
- if( m_aDocInfo.Creator.Len() )
+ if( m_aContext.DocumentInfo.Creator.Len() )
{
aMetadataStream.append( " <xmp:CreatorTool>" );
rtl::OUString aCreator;
- escapeStringXML( m_aDocInfo.Creator, aCreator );
+ escapeStringXML( m_aContext.DocumentInfo.Creator, aCreator );
aMetadataStream.append( OUStringToOString( aCreator , RTL_TEXTENCODING_UTF8 ) );
aMetadataStream.append( "</xmp:CreatorTool>\n" );
}
@@ -6410,7 +6437,7 @@ bool PDFWriterImpl::emitTrailer()
sal_Int32 nSecObject = 0;
- if( m_aContext.Encrypt == true )
+ if( m_aContext.Encryption.Encrypt() )
{
//emit the security information
//must be emitted as indirect dictionary object, since
@@ -6424,16 +6451,16 @@ bool PDFWriterImpl::emitTrailer()
aLineS.append( " 0 obj\n"
"<</Filter/Standard/V " );
// check the version
- if( m_aContext.Security128bit == true )
+ if( m_aContext.Encryption.Security128bit )
aLineS.append( "2/Length 128/R 3" );
else
aLineS.append( "1/R 2" );
// emit the owner password, must not be encrypted
aLineS.append( "/O(" );
- appendLiteralString( (const sal_Char*)m_nEncryptedOwnerPassword, 32, aLineS );
+ appendLiteralString( (const sal_Char*)&m_aContext.Encryption.OValue[0], sal_Int32(m_aContext.Encryption.OValue.size()), aLineS );
aLineS.append( ")/U(" );
- appendLiteralString( (const sal_Char*)m_nEncryptedUserPassword, 32, aLineS );
+ appendLiteralString( (const sal_Char*)&m_aContext.Encryption.UValue[0], sal_Int32(m_aContext.Encryption.UValue.size()), aLineS );
aLineS.append( ")/P " );// the permission set
aLineS.append( m_nAccessPermissions );
aLineS.append( ">>\nendobj\n\n" );
@@ -6499,13 +6526,21 @@ bool PDFWriterImpl::emitTrailer()
aLine.append( nDocInfoObject );
aLine.append( " 0 R\n" );
}
- if( m_aDocID.getLength() )
+ if( ! m_aContext.Encryption.DocumentIdentifier.empty() )
{
aLine.append( "/ID [ <" );
- aLine.append( m_aDocID.getStr(), m_aDocID.getLength() );
+ for( std::vector< sal_uInt8 >::const_iterator it = m_aContext.Encryption.DocumentIdentifier.begin();
+ it != m_aContext.Encryption.DocumentIdentifier.end(); ++it )
+ {
+ appendHex( sal_Int8(*it), aLine );
+ }
aLine.append( ">\n"
"<" );
- aLine.append( m_aDocID.getStr(), m_aDocID.getLength() );
+ for( std::vector< sal_uInt8 >::const_iterator it = m_aContext.Encryption.DocumentIdentifier.begin();
+ it != m_aContext.Encryption.DocumentIdentifier.end(); ++it )
+ {
+ appendHex( sal_Int8(*it), aLine );
+ }
aLine.append( "> ]\n" );
}
if( aDocChecksum.getLength() )
@@ -9663,7 +9698,7 @@ bool PDFWriterImpl::writeBitmapObject( BitmapEmit& rObject, bool bMask )
aLine.append( "[ /Indexed/DeviceRGB " );
aLine.append( (sal_Int32)(pAccess->GetPaletteEntryCount()-1) );
aLine.append( "\n<" );
- if( m_aContext.Encrypt )
+ if( m_aContext.Encryption.Encrypt() )
{
enableStringEncryption( rObject.m_nObject );
//check encryption buffer size
@@ -10850,7 +10885,7 @@ sal_Int32 PDFWriterImpl::setOutlineItemText( sal_Int32 nItem, const OUString& rT
if( nItem < 1 || nItem >= (sal_Int32)m_aOutline.size() )
return -1;
- m_aOutline[ nItem ].m_aTitle = rText;
+ m_aOutline[ nItem ].m_aTitle = psp::WhitespaceToSpace( rText );
return 0;
}
@@ -12049,268 +12084,5 @@ void PDFWriterImpl::addStream( const String& rMimeType, PDFOutputStream* pStream
}
}
-/*************************************************************
-begin i12626 methods
-
-Implements Algorithm 3.2, step 1 only
-*/
-void PDFWriterImpl::padPassword( rtl::OUString aPassword, sal_uInt8 *paPasswordTarget )
-{
-// get ansi-1252 version of the password string CHECKIT ! i12626
- rtl::OString aString = rtl::OUStringToOString( aPassword, RTL_TEXTENCODING_MS_1252 );
-
-//copy the string to the target
- sal_Int32 nToCopy = ( aString.getLength() < 32 ) ? aString.getLength() : 32;
- sal_Int32 nCurrentChar;
-
- for( nCurrentChar = 0; nCurrentChar < nToCopy; nCurrentChar++ )
- paPasswordTarget[nCurrentChar] = (sal_uInt8)( aString.getStr()[nCurrentChar] );
-
-//pad it
- if( nCurrentChar < 32 )
- {//fill with standard byte string
- sal_Int32 i,y;
- for( i = nCurrentChar, y = 0 ; i < 32; i++, y++ )
- paPasswordTarget[i] = m_nPadString[y];
- }
-}
-
-/**********************************
-Algorithm 3.2 Compute the encryption key used
-step 1 should already be done before calling, the paThePaddedPassword parameter should contain
-the padded password and must be 32 byte long, the encryption key is returned into the paEncryptionKey parameter,
-it will be 16 byte long for 128 bit security; for 40 bit security only the first 5 bytes are used
-
-TODO: in pdf ver 1.5 and 1.6 the step 6 is different, should be implemented. See spec.
-
-*/
-void PDFWriterImpl::computeEncryptionKey(sal_uInt8 *paThePaddedPassword, sal_uInt8 *paEncryptionKey )
-{
-//step 2
- if( m_aDigest )
- {
- rtlDigestError nError = rtl_digest_updateMD5( m_aDigest, paThePaddedPassword, ENCRYPTED_PWD_SIZE );
-//step 3
- if( nError == rtl_Digest_E_None )
- nError = rtl_digest_updateMD5( m_aDigest, m_nEncryptedOwnerPassword , sizeof( m_nEncryptedOwnerPassword ) );
-//Step 4
- sal_uInt8 nPerm[4];
-
- nPerm[0] = (sal_uInt8)m_nAccessPermissions;
- nPerm[1] = (sal_uInt8)( m_nAccessPermissions >> 8 );
- nPerm[2] = (sal_uInt8)( m_nAccessPermissions >> 16 );
- nPerm[3] = (sal_uInt8)( m_nAccessPermissions >> 24 );
-
- if( nError == rtl_Digest_E_None )
- nError = rtl_digest_updateMD5( m_aDigest, nPerm , sizeof( nPerm ) );
-
-//step 5, get the document ID, binary form
- if( nError == rtl_Digest_E_None )
- nError = rtl_digest_updateMD5( m_aDigest, m_nDocID , sizeof( m_nDocID ) );
-//get the digest
- sal_uInt8 nMD5Sum[ RTL_DIGEST_LENGTH_MD5 ];
- if( nError == rtl_Digest_E_None )
- {
- rtl_digest_getMD5( m_aDigest, nMD5Sum, sizeof( nMD5Sum ) );
-
-//step 6, only if 128 bit
- if( m_aContext.Security128bit )
- {
- for( sal_Int32 i = 0; i < 50; i++ )
- {
- nError = rtl_digest_updateMD5( m_aDigest, &nMD5Sum, sizeof( nMD5Sum ) );
- if( nError != rtl_Digest_E_None )
- break;
- rtl_digest_getMD5( m_aDigest, nMD5Sum, sizeof( nMD5Sum ) );
- }
- }
- }
-//Step 7
- for( sal_Int32 i = 0; i < MD5_DIGEST_SIZE; i++ )
- paEncryptionKey[i] = nMD5Sum[i];
- }
-}
-
-/**********************************
-Algorithm 3.3 Compute the encryption dictionary /O value, save into the class data member
-the step numbers down here correspond to the ones in PDF v.1.4 specfication
-*/
-void PDFWriterImpl::computeODictionaryValue()
-{
-//step 1 already done, data is in m_nPaddedOwnerPassword
-//step 2
- if( m_aDigest )
- {
- rtlDigestError nError = rtl_digest_updateMD5( m_aDigest, &m_nPaddedOwnerPassword, sizeof( m_nPaddedOwnerPassword ) );
- if( nError == rtl_Digest_E_None )
- {
- sal_uInt8 nMD5Sum[ RTL_DIGEST_LENGTH_MD5 ];
-
- rtl_digest_getMD5( m_aDigest, nMD5Sum, sizeof(nMD5Sum) );
-//step 3, only if 128 bit
- if( m_aContext.Security128bit )
- {
- sal_Int32 i;
- for( i = 0; i < 50; i++ )
- {
- nError = rtl_digest_updateMD5( m_aDigest, nMD5Sum, sizeof( nMD5Sum ) );
- if( nError != rtl_Digest_E_None )
- break;
- rtl_digest_getMD5( m_aDigest, nMD5Sum, sizeof( nMD5Sum ) );
- }
- }
-//Step 4, the key is in nMD5Sum
-//step 5 already done, data is in m_nPaddedUserPassword
-//step 6
- rtl_cipher_initARCFOUR( m_aCipher, rtl_Cipher_DirectionEncode,
- nMD5Sum, m_nKeyLength , NULL, 0 );
-// encrypt the user password using the key set above
- rtl_cipher_encodeARCFOUR( m_aCipher, m_nPaddedUserPassword, sizeof( m_nPaddedUserPassword ), // the data to be encrypted
- m_nEncryptedOwnerPassword, sizeof( m_nEncryptedOwnerPassword ) ); //encrypted data, stored in class data member
-//Step 7, only if 128 bit
- if( m_aContext.Security128bit )
- {
- sal_uInt32 i, y;
- sal_uInt8 nLocalKey[ SECUR_128BIT_KEY ]; // 16 = 128 bit key
-
- for( i = 1; i <= 19; i++ ) // do it 19 times, start with 1
- {
- for( y = 0; y < sizeof( nLocalKey ); y++ )
- nLocalKey[y] = (sal_uInt8)( nMD5Sum[y] ^ i );
-
- rtl_cipher_initARCFOUR( m_aCipher, rtl_Cipher_DirectionEncode,
- nLocalKey, SECUR_128BIT_KEY, NULL, 0 ); //destination data area, on init can be NULL
- rtl_cipher_encodeARCFOUR( m_aCipher, m_nEncryptedOwnerPassword, sizeof( m_nEncryptedOwnerPassword ), // the data to be encrypted
- m_nEncryptedOwnerPassword, sizeof( m_nEncryptedOwnerPassword ) ); // encrypted data, can be the same as the input, encrypt "in place"
-//step 8, store in class data member
- }
- }
- }
- }
-}
-
-/**********************************
-Algorithms 3.4 and 3.5 Compute the encryption dictionary /U value, save into the class data member, revision 2 (40 bit) or 3 (128 bit)
-*/
-void PDFWriterImpl::computeUDictionaryValue()
-{
-//step 1, common to both 3.4 and 3.5
- computeEncryptionKey( m_nPaddedUserPassword , m_nEncryptionKey );
-
- if( m_aContext.Security128bit == false )
- {
-//3.4
-//step 2 and 3
- rtl_cipher_initARCFOUR( m_aCipher, rtl_Cipher_DirectionEncode,
- m_nEncryptionKey, 5 , // key and key length
- NULL, 0 ); //destination data area
-// encrypt the user password using the key set above, save for later use
- rtl_cipher_encodeARCFOUR( m_aCipher, m_nPadString, sizeof( m_nPadString ), // the data to be encrypted
- m_nEncryptedUserPassword, sizeof( m_nEncryptedUserPassword ) ); //encrypted data, stored in class data member
- }
- else
- {
-//or 3.5, for 128 bit security
-//step6, initilize the last 16 bytes of the encrypted user password to 0
- for(sal_uInt32 i = MD5_DIGEST_SIZE; i < sizeof( m_nEncryptedUserPassword ); i++)
- m_nEncryptedUserPassword[i] = 0;
-//step 2
- if( m_aDigest )
- {
- rtlDigestError nError = rtl_digest_updateMD5( m_aDigest, m_nPadString, sizeof( m_nPadString ) );
-//step 3
- if( nError == rtl_Digest_E_None )
- nError = rtl_digest_updateMD5( m_aDigest, m_nDocID , sizeof(m_nDocID) );
-
- sal_uInt8 nMD5Sum[ RTL_DIGEST_LENGTH_MD5 ];
- rtl_digest_getMD5( m_aDigest, nMD5Sum, sizeof(nMD5Sum) );
-//Step 4
- rtl_cipher_initARCFOUR( m_aCipher, rtl_Cipher_DirectionEncode,
- m_nEncryptionKey, SECUR_128BIT_KEY, NULL, 0 ); //destination data area
- rtl_cipher_encodeARCFOUR( m_aCipher, nMD5Sum, sizeof( nMD5Sum ), // the data to be encrypted
- m_nEncryptedUserPassword, sizeof( nMD5Sum ) ); //encrypted data, stored in class data member
-//step 5
- sal_uInt32 i, y;
- sal_uInt8 nLocalKey[SECUR_128BIT_KEY];
-
- for( i = 1; i <= 19; i++ ) // do it 19 times, start with 1
- {
- for( y = 0; y < sizeof( nLocalKey ) ; y++ )
- nLocalKey[y] = (sal_uInt8)( m_nEncryptionKey[y] ^ i );
-
- rtl_cipher_initARCFOUR( m_aCipher, rtl_Cipher_DirectionEncode,
- nLocalKey, SECUR_128BIT_KEY, // key and key length
- NULL, 0 ); //destination data area, on init can be NULL
- rtl_cipher_encodeARCFOUR( m_aCipher, m_nEncryptedUserPassword, SECUR_128BIT_KEY, // the data to be encrypted
- m_nEncryptedUserPassword, SECUR_128BIT_KEY ); // encrypted data, can be the same as the input, encrypt "in place"
- }
- }
- }
-}
-
-/* init the encryption engine
-1. init the document id, used both for building the document id and for building the encryption key(s)
-2. build the encryption key following algorithms described in the PDF specification
- */
-void PDFWriterImpl::initEncryption()
-{
- m_aOwnerPassword = m_aContext.OwnerPassword;
- m_aUserPassword = m_aContext.UserPassword;
-/* password stuff computing, before sending out anything */
- DBG_ASSERT( m_aCipher != NULL, "PDFWriterImpl::initEncryption: a cipher (ARCFOUR) object is not available !" );
- DBG_ASSERT( m_aDigest != NULL, "PDFWriterImpl::initEncryption: a digest (MD5) object is not available !" );
-
- if( m_aCipher && m_aDigest )
- {
-//if there is no owner password, force it to the user password
- if( m_aOwnerPassword.getLength() == 0 )
- m_aOwnerPassword = m_aUserPassword;
-
- initPadString();
-/*
-1) pad passwords
-*/
- padPassword( m_aOwnerPassword, m_nPaddedOwnerPassword );
- padPassword( m_aUserPassword, m_nPaddedUserPassword );
-/*
-2) compute the access permissions, in numerical form
-
-the default value depends on the revision 2 (40 bit) or 3 (128 bit security):
-- for 40 bit security the unused bit must be set to 1, since they are not used
-- for 128 bit security the same bit must be preset to 0 and set later if needed
-according to the table 3.15, pdf v 1.4 */
- m_nAccessPermissions = ( m_aContext.Security128bit ) ? 0xfffff0c0 : 0xffffffc0 ;
-
-/* check permissions for 40 bit security case */
- m_nAccessPermissions |= ( m_aContext.AccessPermissions.CanPrintTheDocument ) ? 1 << 2 : 0;
- m_nAccessPermissions |= ( m_aContext.AccessPermissions.CanModifyTheContent ) ? 1 << 3 : 0;
- m_nAccessPermissions |= ( m_aContext.AccessPermissions.CanCopyOrExtract ) ? 1 << 4 : 0;
- m_nAccessPermissions |= ( m_aContext.AccessPermissions.CanAddOrModify ) ? 1 << 5 : 0;
- m_nKeyLength = SECUR_40BIT_KEY;
- m_nRC4KeyLength = SECUR_40BIT_KEY+5; // for this value see PDF spec v 1.4, algorithm 3.1 step 4, where n is 5
-
- if( m_aContext.Security128bit )
- {
- m_nKeyLength = SECUR_128BIT_KEY;
- m_nRC4KeyLength = 16; // for this value see PDF spec v 1.4, algorithm 3.1 step 4, where n is 16, thus maximum
- // permitted value is 16
- m_nAccessPermissions |= ( m_aContext.AccessPermissions.CanFillInteractive ) ? 1 << 8 : 0;
- m_nAccessPermissions |= ( m_aContext.AccessPermissions.CanExtractForAccessibility ) ? 1 << 9 : 0;
- m_nAccessPermissions |= ( m_aContext.AccessPermissions.CanAssemble ) ? 1 << 10 : 0;
- m_nAccessPermissions |= ( m_aContext.AccessPermissions.CanPrintFull ) ? 1 << 11 : 0;
- }
- computeODictionaryValue();
- computeUDictionaryValue();
-
-//clear out exceding key values, prepares for generation number default to 0 as well
-// see checkAndEnableStreamEncryption in pdfwriter_impl.hxx
- sal_Int32 i, y;
- for( i = m_nKeyLength, y = 0; y < 5 ; y++ )
- m_nEncryptionKey[i++] = 0;
- }
- else //either no cipher or no digest or both, something is wrong with memory or something else
- m_aContext.Encrypt = false; //then turn the encryption off
-}
-/* end i12626 methods */
diff --git a/vcl/source/gdi/pdfwriter_impl.hxx b/vcl/source/gdi/pdfwriter_impl.hxx
index 2eacdc215dd8..5702bee23ea5 100644
--- a/vcl/source/gdi/pdfwriter_impl.hxx
+++ b/vcl/source/gdi/pdfwriter_impl.hxx
@@ -58,6 +58,7 @@ class ImplFontSelectData;
class ImplFontMetricData;
class FontSubsetInfo;
class ZCodec;
+class EncHashTransporter;
// the maximum password length
#define ENCRYPTED_PWD_SIZE 32
@@ -595,7 +596,6 @@ private:
MapMode m_aMapMode; // PDFWriterImpl scaled units
std::vector< PDFPage > m_aPages;
- PDFDocInfo m_aDocInfo;
/* maps object numbers to file offsets (needed for xref) */
std::vector< sal_uInt64 > m_aObjects;
/* contains Bitmaps until they are written to the
@@ -796,116 +796,37 @@ i12626
/* used to cipher the stream data and for password management */
rtlCipher m_aCipher;
rtlDigest m_aDigest;
-/* pad string used for password in Standard security handler */
- sal_uInt8 m_nPadString[ENCRYPTED_PWD_SIZE];
-/* the owner password, in clear text */
- rtl::OUString m_aOwnerPassword;
-/* the padded owner password */
- sal_uInt8 m_nPaddedOwnerPassword[ENCRYPTED_PWD_SIZE];
-/* the encryption dictionary owner password, according to algorithm 3.3 */
- sal_uInt8 m_nEncryptedOwnerPassword[ENCRYPTED_PWD_SIZE];
-/* the user password, in clear text */
- rtl::OUString m_aUserPassword;
-/* the padded user password */
- sal_uInt8 m_nPaddedUserPassword[ENCRYPTED_PWD_SIZE];
-/* the encryption dictionary user password, according to algorithm 3.4 or 3.5 depending on the
- security handler revision */
- sal_uInt8 m_nEncryptedUserPassword[ENCRYPTED_PWD_SIZE];
-
-/* the encryption key, formed with the user password according to algorithm 3.2, maximum length is 16 bytes + 3 + 2
- for 128 bit security */
- sal_uInt8 m_nEncryptionKey[MAXIMUM_RC4_KEY_LENGTH];
+ /* pad string used for password in Standard security handler */
+ static const sal_uInt8 s_nPadString[ENCRYPTED_PWD_SIZE];
+
+ /* the encryption key, formed with the user password according to algorithm 3.2, maximum length is 16 bytes + 3 + 2
+ for 128 bit security */
sal_Int32 m_nKeyLength; // key length, 16 or 5
sal_Int32 m_nRC4KeyLength; // key length, 16 or 10, to be input to the algorith 3.1
-/* set to true if the following stream must be encrypted, used inside writeBuffer() */
+ /* set to true if the following stream must be encrypted, used inside writeBuffer() */
sal_Bool m_bEncryptThisStream;
-/* the numerical value of the access permissions, according to PDF spec, must be signed */
+ /* the numerical value of the access permissions, according to PDF spec, must be signed */
sal_Int32 m_nAccessPermissions;
-/* the document ID, the raw MD5 hash */
- sal_uInt8 m_nDocID[MD5_DIGEST_SIZE];
-/* string buffer to hold document ID, this is the output string */
- rtl::OStringBuffer m_aDocID;
-/* string to hold the PDF creation date */
- rtl::OStringBuffer m_aCreationDateString;
-/* string to hold the PDF creation date, for PDF/A metadata */
- rtl::OStringBuffer m_aCreationMetaDateString;
-/* the buffer where the data are encrypted, dynamically allocated */
+ /* string to hold the PDF creation date */
+ rtl::OString m_aCreationDateString;
+ /* string to hold the PDF creation date, for PDF/A metadata */
+ rtl::OString m_aCreationMetaDateString;
+ /* the buffer where the data are encrypted, dynamically allocated */
sal_uInt8 *m_pEncryptionBuffer;
-/* size of the buffer */
+ /* size of the buffer */
sal_Int32 m_nEncryptionBufferSize;
-/* check and reallocate the buffer for encryption */
- sal_Bool checkEncryptionBufferSize( register sal_Int32 newSize )
- {
- if( m_nEncryptionBufferSize < newSize )
- {
-/* reallocate the buffer, the used function allocate as rtl_allocateMemory
- if the pointer parameter is NULL */
- m_pEncryptionBuffer = (sal_uInt8*)rtl_reallocateMemory( m_pEncryptionBuffer, newSize );
- if( m_pEncryptionBuffer )
- m_nEncryptionBufferSize = newSize;
- else
- m_nEncryptionBufferSize = 0;
- }
- return ( m_nEncryptionBufferSize != 0 );
- }
-/* init the internal pad string */
- void initPadString()
- {
- static const sal_uInt8 nPadString[32] =
- {
- 0x28, 0xBF, 0x4E, 0x5E, 0x4E, 0x75, 0x8A, 0x41, 0x64, 0x00, 0x4E, 0x56, 0xFF, 0xFA, 0x01, 0x08,
- 0x2E, 0x2E, 0x00, 0xB6, 0xD0, 0x68, 0x3E, 0x80, 0x2F, 0x0C, 0xA9, 0xFE, 0x64, 0x53, 0x69, 0x7A
- };
-
- for(sal_uInt32 i = 0; i < sizeof( nPadString ); i++ )
- m_nPadString[i] = nPadString[i];
-
- };
-/* initialize the encryption engine */
- void initEncryption();
-
-/* this function implements part of the PDF spec algorithm 3.1 in encryption, the rest (the actual encryption) is in PDFWriterImpl::writeBuffer */
- void checkAndEnableStreamEncryption( register sal_Int32 nObject )
- {
- if( m_aContext.Encrypt )
- {
- m_bEncryptThisStream = true;
- register sal_Int32 i = m_nKeyLength;
- m_nEncryptionKey[i++] = (sal_uInt8)nObject;
- m_nEncryptionKey[i++] = (sal_uInt8)( nObject >> 8 );
- m_nEncryptionKey[i++] = (sal_uInt8)( nObject >> 16 );
-//the other location of m_nEncryptionKey are already set to 0, our fixed generation number
-// do the MD5 hash
- sal_uInt8 nMD5Sum[ RTL_DIGEST_LENGTH_MD5 ];
- // the i+2 to take into account the generation number, always zero
- rtl_digest_MD5( &m_nEncryptionKey, i+2, nMD5Sum, sizeof(nMD5Sum) );
-// initialize the RC4 with the key
-// key legth: see algoritm 3.1, step 4: (N+5) max 16
- rtl_cipher_initARCFOUR( m_aCipher, rtl_Cipher_DirectionEncode, nMD5Sum, m_nRC4KeyLength, NULL, 0 );
- }
- };
+ /* check and reallocate the buffer for encryption */
+ sal_Bool checkEncryptionBufferSize( register sal_Int32 newSize );
+ /* this function implements part of the PDF spec algorithm 3.1 in encryption, the rest (the actual encryption) is in PDFWriterImpl::writeBuffer */
+ void checkAndEnableStreamEncryption( register sal_Int32 nObject );
void disableStreamEncryption() { m_bEncryptThisStream = false; };
-/* */
- void enableStringEncryption( register sal_Int32 nObject )
- {
- register sal_Int32 i = m_nKeyLength;
- m_nEncryptionKey[i++] = (sal_uInt8)nObject;
- m_nEncryptionKey[i++] = (sal_uInt8)( nObject >> 8 );
- m_nEncryptionKey[i++] = (sal_uInt8)( nObject >> 16 );
-//the other location of m_nEncryptionKey are already set to 0, our fixed generation number
-// do the MD5 hash
- sal_uInt8 nMD5Sum[ RTL_DIGEST_LENGTH_MD5 ];
- // the i+2 to take into account the generation number, always zero
- rtl_digest_MD5( &m_nEncryptionKey, i+2, nMD5Sum, sizeof(nMD5Sum) );
-// initialize the RC4 with the key
-// key legth: see algoritm 3.1, step 4: (N+5) max 16
- rtl_cipher_initARCFOUR( m_aCipher, rtl_Cipher_DirectionEncode, nMD5Sum, m_nRC4KeyLength, NULL, 0 );
- };
+ /* */
+ void enableStringEncryption( register sal_Int32 nObject );
// test if the encryption is active, if yes than encrypt the unicode string and add to the OStringBuffer parameter
void appendUnicodeTextStringEncrypt( const rtl::OUString& rInString, const sal_Int32 nInObjectNumber, rtl::OStringBuffer& rOutBuffer );
@@ -1095,24 +1016,56 @@ i12626
/* true if PDF/A-1a or PDF/A-1b is output */
sal_Bool m_bIsPDF_A1;
-
-/*
-i12626
-methods for PDF security
-
- pad a password according algorithm 3.2, step 1 */
- void padPassword( const rtl::OUString aPassword, sal_uInt8 *paPasswordTarget );
-/* algorithm 3.2: compute an encryption key */
- void computeEncryptionKey( sal_uInt8 *paThePaddedPassword, sal_uInt8 *paEncryptionKey );
-/* algorithm 3.3: computing the encryption dictionary'ss owner password value ( /O ) */
- void computeODictionaryValue();
-/* algorithm 3.4 or 3.5: computing the encryption dictionary's user password value ( /U ) revision 2 or 3 of the standard security handler */
- void computeUDictionaryValue();
+ PDFWriter& m_rOuterFace;
+
+ /*
+ i12626
+ methods for PDF security
+
+ pad a password according algorithm 3.2, step 1 */
+ static void padPassword( const rtl::OUString& i_rPassword, sal_uInt8* o_pPaddedPW );
+ /* algorithm 3.2: compute an encryption key */
+ static bool computeEncryptionKey( EncHashTransporter*,
+ vcl::PDFWriter::PDFEncryptionProperties& io_rProperties,
+ sal_Int32 i_nAccessPermissions
+ );
+ /* algorithm 3.3: computing the encryption dictionary'ss owner password value ( /O ) */
+ static bool computeODictionaryValue( const sal_uInt8* i_pPaddedOwnerPassword, const sal_uInt8* i_pPaddedUserPassword,
+ std::vector< sal_uInt8 >& io_rOValue,
+ sal_Int32 i_nKeyLength
+ );
+ /* algorithm 3.4 or 3.5: computing the encryption dictionary's user password value ( /U ) revision 2 or 3 of the standard security handler */
+ static bool computeUDictionaryValue( EncHashTransporter* i_pTransporter,
+ vcl::PDFWriter::PDFEncryptionProperties& io_rProperties,
+ sal_Int32 i_nKeyLength,
+ sal_Int32 i_nAccessPermissions
+ );
+
+ static void computeDocumentIdentifier( std::vector< sal_uInt8 >& o_rIdentifier,
+ const vcl::PDFWriter::PDFDocInfo& i_rDocInfo,
+ rtl::OString& o_rCString1,
+ rtl::OString& o_rCString2
+ );
+ static sal_Int32 computeAccessPermissions( const vcl::PDFWriter::PDFEncryptionProperties& i_rProperties,
+ sal_Int32& o_rKeyLength, sal_Int32& o_rRC4KeyLength );
+ void setupDocInfo();
+ bool prepareEncryption( const com::sun::star::uno::Reference< com::sun::star::beans::XMaterialHolder >& );
+
+ // helper for playMetafile
+ void implWriteGradient( const PolyPolygon& rPolyPoly, const Gradient& rGradient,
+ VirtualDevice* pDummyVDev, const vcl::PDFWriter::PlayMetafileContext& );
+ void implWriteBitmapEx( const Point& rPoint, const Size& rSize, const BitmapEx& rBitmapEx,
+ VirtualDevice* pDummyVDev, const vcl::PDFWriter::PlayMetafileContext& );
public:
- PDFWriterImpl( const PDFWriter::PDFWriterContext& rContext );
+ PDFWriterImpl( const PDFWriter::PDFWriterContext& rContext, const com::sun::star::uno::Reference< com::sun::star::beans::XMaterialHolder >&, PDFWriter& );
~PDFWriterImpl();
+ static com::sun::star::uno::Reference< com::sun::star::beans::XMaterialHolder >
+ initEncryption( const rtl::OUString& i_rOwnerPassword,
+ const rtl::OUString& i_rUserPassword,
+ bool b128Bit );
+
/* for OutputDevice so the reference device can have a list
* that contains only suitable fonts (subsettable or builtin)
* produces a new font list
@@ -1134,6 +1087,7 @@ public:
bool emit();
std::set< PDFWriter::ErrorCode > getErrors();
void insertError( PDFWriter::ErrorCode eErr ) { m_aErrors.insert( eErr ); }
+ void playMetafile( const GDIMetaFile&, vcl::PDFExtOutDevData*, const vcl::PDFWriter::PlayMetafileContext&, VirtualDevice* pDummyDev = NULL );
Size getCurPageSize() const
{
@@ -1144,8 +1098,6 @@ public:
}
PDFWriter::PDFVersion getVersion() const { return m_aContext.Version; }
- void setDocInfo( const PDFDocInfo& rInfo );
- const PDFDocInfo& getDocInfo() const { return m_aDocInfo; }
void setDocumentLocale( const com::sun::star::lang::Locale& rLoc )
{ m_aContext.DocumentLocale = rLoc; }
diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx
new file mode 100644
index 000000000000..ee1fe1cc6bc5
--- /dev/null
+++ b/vcl/source/gdi/pdfwriter_impl2.cxx
@@ -0,0 +1,1540 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "precompiled_vcl.hxx"
+
+#include "pdfwriter_impl.hxx"
+
+#include "vcl/pdfextoutdevdata.hxx"
+#include "vcl/virdev.hxx"
+#include "vcl/gdimtf.hxx"
+#include "vcl/metaact.hxx"
+#include "vcl/graph.hxx"
+#include "vcl/svdata.hxx"
+#include "unotools/streamwrap.hxx"
+#include "unotools/processfactory.hxx"
+#include "comphelper/processfactory.hxx"
+
+#include "com/sun/star/beans/PropertyValue.hpp"
+#include "com/sun/star/io/XSeekable.hpp"
+#include "com/sun/star/graphic/XGraphicProvider.hpp"
+
+#include "cppuhelper/implbase1.hxx"
+
+#include <rtl/digest.h>
+
+using namespace vcl;
+using namespace rtl;
+using namespace com::sun::star;
+using namespace com::sun::star::uno;
+using namespace com::sun::star::beans;
+
+// -----------------------------------------------------------------------------
+
+void PDFWriterImpl::implWriteGradient( const PolyPolygon& i_rPolyPoly, const Gradient& i_rGradient,
+ VirtualDevice* i_pDummyVDev, const vcl::PDFWriter::PlayMetafileContext& i_rContext )
+{
+ GDIMetaFile aTmpMtf;
+
+ i_pDummyVDev->AddGradientActions( i_rPolyPoly.GetBoundRect(), i_rGradient, aTmpMtf );
+
+ m_rOuterFace.Push();
+ m_rOuterFace.IntersectClipRegion( i_rPolyPoly.getB2DPolyPolygon() );
+ playMetafile( aTmpMtf, NULL, i_rContext, i_pDummyVDev );
+ m_rOuterFace.Pop();
+}
+
+// -----------------------------------------------------------------------------
+
+void PDFWriterImpl::implWriteBitmapEx( const Point& i_rPoint, const Size& i_rSize, const BitmapEx& i_rBitmapEx,
+ VirtualDevice* i_pDummyVDev, const vcl::PDFWriter::PlayMetafileContext& i_rContext )
+{
+ if ( !i_rBitmapEx.IsEmpty() && i_rSize.Width() && i_rSize.Height() )
+ {
+ BitmapEx aBitmapEx( i_rBitmapEx );
+ Point aPoint( i_rPoint );
+ Size aSize( i_rSize );
+
+ // #i19065# Negative sizes have mirror semantics on
+ // OutputDevice. BitmapEx and co. have no idea about that, so
+ // perform that _before_ doing anything with aBitmapEx.
+ ULONG nMirrorFlags(BMP_MIRROR_NONE);
+ if( aSize.Width() < 0 )
+ {
+ aSize.Width() *= -1;
+ aPoint.X() -= aSize.Width();
+ nMirrorFlags |= BMP_MIRROR_HORZ;
+ }
+ if( aSize.Height() < 0 )
+ {
+ aSize.Height() *= -1;
+ aPoint.Y() -= aSize.Height();
+ nMirrorFlags |= BMP_MIRROR_VERT;
+ }
+
+ if( nMirrorFlags != BMP_MIRROR_NONE )
+ {
+ aBitmapEx.Mirror( nMirrorFlags );
+ }
+ if( i_rContext.m_nMaxImageResolution > 50 )
+ {
+ // do downsampling if neccessary
+ const Size aDstSizeTwip( i_pDummyVDev->PixelToLogic( i_pDummyVDev->LogicToPixel( aSize ), MAP_TWIP ) );
+ const Size aBmpSize( aBitmapEx.GetSizePixel() );
+ const double fBmpPixelX = aBmpSize.Width();
+ const double fBmpPixelY = aBmpSize.Height();
+ const double fMaxPixelX = aDstSizeTwip.Width() * i_rContext.m_nMaxImageResolution / 1440.0;
+ const double fMaxPixelY = aDstSizeTwip.Height() * i_rContext.m_nMaxImageResolution / 1440.0;
+
+ // check, if the bitmap DPI exceeds the maximum DPI (allow 4 pixel rounding tolerance)
+ if( ( ( fBmpPixelX > ( fMaxPixelX + 4 ) ) ||
+ ( fBmpPixelY > ( fMaxPixelY + 4 ) ) ) &&
+ ( fBmpPixelY > 0.0 ) && ( fMaxPixelY > 0.0 ) )
+ {
+ // do scaling
+ Size aNewBmpSize;
+ const double fBmpWH = fBmpPixelX / fBmpPixelY;
+ const double fMaxWH = fMaxPixelX / fMaxPixelY;
+
+ if( fBmpWH < fMaxWH )
+ {
+ aNewBmpSize.Width() = FRound( fMaxPixelY * fBmpWH );
+ aNewBmpSize.Height() = FRound( fMaxPixelY );
+ }
+ else if( fBmpWH > 0.0 )
+ {
+ aNewBmpSize.Width() = FRound( fMaxPixelX );
+ aNewBmpSize.Height() = FRound( fMaxPixelX / fBmpWH);
+ }
+ if( aNewBmpSize.Width() && aNewBmpSize.Height() )
+ aBitmapEx.Scale( aNewBmpSize );
+ else
+ aBitmapEx.SetEmpty();
+ }
+ }
+
+ const Size aSizePixel( aBitmapEx.GetSizePixel() );
+ if ( aSizePixel.Width() && aSizePixel.Height() )
+ {
+ sal_Bool bUseJPGCompression = !i_rContext.m_bOnlyLosslessCompression;
+ if ( ( aSizePixel.Width() < 32 ) || ( aSizePixel.Height() < 32 ) )
+ bUseJPGCompression = sal_False;
+
+ SvMemoryStream aStrm;
+ Bitmap aMask;
+
+ bool bTrueColorJPG = true;
+ if ( bUseJPGCompression )
+ {
+ sal_uInt32 nZippedFileSize; // sj: we will calculate the filesize of a zipped bitmap
+ { // to determine if jpeg compression is usefull
+ SvMemoryStream aTemp;
+ aTemp.SetCompressMode( aTemp.GetCompressMode() | COMPRESSMODE_ZBITMAP );
+ aTemp.SetVersion( SOFFICE_FILEFORMAT_40 ); // sj: up from version 40 our bitmap stream operator
+ aTemp << aBitmapEx; // is capable of zlib stream compression
+ aTemp.Seek( STREAM_SEEK_TO_END );
+ nZippedFileSize = aTemp.Tell();
+ }
+ if ( aBitmapEx.IsTransparent() )
+ {
+ if ( aBitmapEx.IsAlpha() )
+ aMask = aBitmapEx.GetAlpha().GetBitmap();
+ else
+ aMask = aBitmapEx.GetMask();
+ }
+ Graphic aGraphic( aBitmapEx.GetBitmap() );
+ sal_Int32 nColorMode = 0;
+
+ Sequence< PropertyValue > aFilterData( 2 );
+ aFilterData[ 0 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "Quality" ) );
+ aFilterData[ 0 ].Value <<= sal_Int32(i_rContext.m_nJPEGQuality);
+ aFilterData[ 1 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "ColorMode" ) );
+ aFilterData[ 1 ].Value <<= nColorMode;
+
+ try
+ {
+ uno::Reference < io::XStream > xStream = new utl::OStreamWrapper( aStrm );
+ Reference< io::XSeekable > xSeekable( xStream, UNO_QUERY_THROW );
+ Reference< graphic::XGraphicProvider > xGraphicProvider( ImplGetSVData()->maAppData.mxMSF->createInstance(
+ OUString::createFromAscii( "com.sun.star.graphic.GraphicProvider" ) ), UNO_QUERY );
+ if ( xGraphicProvider.is() )
+ {
+ Reference< graphic::XGraphic > xGraphic( aGraphic.GetXGraphic() );
+ Reference < io::XOutputStream > xOut( xStream->getOutputStream() );
+ rtl::OUString aMimeType( ::rtl::OUString::createFromAscii( "image/jpeg" ) );
+ uno::Sequence< beans::PropertyValue > aOutMediaProperties( 3 );
+ aOutMediaProperties[0].Name = ::rtl::OUString::createFromAscii( "OutputStream" );
+ aOutMediaProperties[0].Value <<= xOut;
+ aOutMediaProperties[1].Name = ::rtl::OUString::createFromAscii( "MimeType" );
+ aOutMediaProperties[1].Value <<= aMimeType;
+ aOutMediaProperties[2].Name = ::rtl::OUString::createFromAscii( "FilterData" );
+ aOutMediaProperties[2].Value <<= aFilterData;
+ xGraphicProvider->storeGraphic( xGraphic, aOutMediaProperties );
+ xOut->flush();
+ if ( xSeekable->getLength() > nZippedFileSize )
+ {
+ bUseJPGCompression = sal_False;
+ }
+ else
+ {
+ aStrm.Seek( STREAM_SEEK_TO_END );
+
+ xSeekable->seek( 0 );
+ Sequence< PropertyValue > aArgs( 1 );
+ aArgs[ 0 ].Name = ::rtl::OUString::createFromAscii( "InputStream" );
+ aArgs[ 0 ].Value <<= xStream;
+ Reference< XPropertySet > xPropSet( xGraphicProvider->queryGraphicDescriptor( aArgs ) );
+ if ( xPropSet.is() )
+ {
+ sal_Int16 nBitsPerPixel = 24;
+ if ( xPropSet->getPropertyValue( ::rtl::OUString::createFromAscii( "BitsPerPixel" ) ) >>= nBitsPerPixel )
+ {
+ bTrueColorJPG = nBitsPerPixel != 8;
+ }
+ }
+ }
+ }
+ else
+ bUseJPGCompression = sal_False;
+ }
+ catch( uno::Exception& )
+ {
+ bUseJPGCompression = sal_False;
+ }
+ }
+ if ( bUseJPGCompression )
+ m_rOuterFace.DrawJPGBitmap( aStrm, bTrueColorJPG, aSizePixel, Rectangle( aPoint, aSize ), aMask );
+ else if ( aBitmapEx.IsTransparent() )
+ m_rOuterFace.DrawBitmapEx( aPoint, aSize, aBitmapEx );
+ else
+ m_rOuterFace.DrawBitmap( aPoint, aSize, aBitmapEx.GetBitmap() );
+ }
+ }
+}
+
+
+// -----------------------------------------------------------------------------
+
+void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevData* i_pOutDevData, const vcl::PDFWriter::PlayMetafileContext& i_rContext, VirtualDevice* pDummyVDev )
+{
+ bool bAssertionFired( false );
+
+ VirtualDevice* pPrivateDevice = NULL;
+ if( ! pDummyVDev )
+ {
+ pPrivateDevice = pDummyVDev = new VirtualDevice();
+ pDummyVDev->EnableOutput( sal_False );
+ pDummyVDev->SetMapMode( i_rMtf.GetPrefMapMode() );
+ }
+ GDIMetaFile aMtf( i_rMtf );
+
+ for( sal_uInt32 i = 0, nCount = aMtf.GetActionCount(); i < nCount; )
+ {
+ if ( !i_pOutDevData || !i_pOutDevData->PlaySyncPageAct( m_rOuterFace, i ) )
+ {
+ const MetaAction* pAction = aMtf.GetAction( i );
+ const USHORT nType = pAction->GetType();
+
+ switch( nType )
+ {
+ case( META_PIXEL_ACTION ):
+ {
+ const MetaPixelAction* pA = (const MetaPixelAction*) pAction;
+ m_rOuterFace.DrawPixel( pA->GetPoint(), pA->GetColor() );
+ }
+ break;
+
+ case( META_POINT_ACTION ):
+ {
+ const MetaPointAction* pA = (const MetaPointAction*) pAction;
+ m_rOuterFace.DrawPixel( pA->GetPoint() );
+ }
+ break;
+
+ case( META_LINE_ACTION ):
+ {
+ const MetaLineAction* pA = (const MetaLineAction*) pAction;
+ if ( pA->GetLineInfo().IsDefault() )
+ m_rOuterFace.DrawLine( pA->GetStartPoint(), pA->GetEndPoint() );
+ else
+ m_rOuterFace.DrawLine( pA->GetStartPoint(), pA->GetEndPoint(), pA->GetLineInfo() );
+ }
+ break;
+
+ case( META_RECT_ACTION ):
+ {
+ const MetaRectAction* pA = (const MetaRectAction*) pAction;
+ m_rOuterFace.DrawRect( pA->GetRect() );
+ }
+ break;
+
+ case( META_ROUNDRECT_ACTION ):
+ {
+ const MetaRoundRectAction* pA = (const MetaRoundRectAction*) pAction;
+ m_rOuterFace.DrawRect( pA->GetRect(), pA->GetHorzRound(), pA->GetVertRound() );
+ }
+ break;
+
+ case( META_ELLIPSE_ACTION ):
+ {
+ const MetaEllipseAction* pA = (const MetaEllipseAction*) pAction;
+ m_rOuterFace.DrawEllipse( pA->GetRect() );
+ }
+ break;
+
+ case( META_ARC_ACTION ):
+ {
+ const MetaArcAction* pA = (const MetaArcAction*) pAction;
+ m_rOuterFace.DrawArc( pA->GetRect(), pA->GetStartPoint(), pA->GetEndPoint() );
+ }
+ break;
+
+ case( META_PIE_ACTION ):
+ {
+ const MetaArcAction* pA = (const MetaArcAction*) pAction;
+ m_rOuterFace.DrawPie( pA->GetRect(), pA->GetStartPoint(), pA->GetEndPoint() );
+ }
+ break;
+
+ case( META_CHORD_ACTION ):
+ {
+ const MetaChordAction* pA = (const MetaChordAction*) pAction;
+ m_rOuterFace.DrawChord( pA->GetRect(), pA->GetStartPoint(), pA->GetEndPoint() );
+ }
+ break;
+
+ case( META_POLYGON_ACTION ):
+ {
+ const MetaPolygonAction* pA = (const MetaPolygonAction*) pAction;
+ m_rOuterFace.DrawPolygon( pA->GetPolygon() );
+ }
+ break;
+
+ case( META_POLYLINE_ACTION ):
+ {
+ const MetaPolyLineAction* pA = (const MetaPolyLineAction*) pAction;
+ if ( pA->GetLineInfo().IsDefault() )
+ m_rOuterFace.DrawPolyLine( pA->GetPolygon() );
+ else
+ m_rOuterFace.DrawPolyLine( pA->GetPolygon(), pA->GetLineInfo() );
+ }
+ break;
+
+ case( META_POLYPOLYGON_ACTION ):
+ {
+ const MetaPolyPolygonAction* pA = (const MetaPolyPolygonAction*) pAction;
+ m_rOuterFace.DrawPolyPolygon( pA->GetPolyPolygon() );
+ }
+ break;
+
+ case( META_GRADIENT_ACTION ):
+ {
+ const MetaGradientAction* pA = (const MetaGradientAction*) pAction;
+ const PolyPolygon aPolyPoly( pA->GetRect() );
+
+ implWriteGradient( aPolyPoly, pA->GetGradient(), pDummyVDev, i_rContext );
+ }
+ break;
+
+ case( META_GRADIENTEX_ACTION ):
+ {
+ const MetaGradientExAction* pA = (const MetaGradientExAction*) pAction;
+ implWriteGradient( pA->GetPolyPolygon(), pA->GetGradient(), pDummyVDev, i_rContext );
+ }
+ break;
+
+ case META_HATCH_ACTION:
+ {
+ const MetaHatchAction* pA = (const MetaHatchAction*) pAction;
+ m_rOuterFace.DrawHatch( pA->GetPolyPolygon(), pA->GetHatch() );
+ }
+ break;
+
+ case( META_TRANSPARENT_ACTION ):
+ {
+ const MetaTransparentAction* pA = (const MetaTransparentAction*) pAction;
+ m_rOuterFace.DrawTransparent( pA->GetPolyPolygon(), pA->GetTransparence() );
+ }
+ break;
+
+ case( META_FLOATTRANSPARENT_ACTION ):
+ {
+ const MetaFloatTransparentAction* pA = (const MetaFloatTransparentAction*) pAction;
+
+ GDIMetaFile aTmpMtf( pA->GetGDIMetaFile() );
+ const Point& rPos = pA->GetPoint();
+ const Size& rSize= pA->GetSize();
+ const Gradient& rTransparenceGradient = pA->GetGradient();
+
+ // special case constant alpha value
+ if( rTransparenceGradient.GetStartColor() == rTransparenceGradient.GetEndColor() )
+ {
+ const Color aTransCol( rTransparenceGradient.GetStartColor() );
+ const USHORT nTransPercent = aTransCol.GetLuminance() * 100 / 255;
+ m_rOuterFace.BeginTransparencyGroup();
+ playMetafile( aTmpMtf, NULL, i_rContext, pDummyVDev );
+ m_rOuterFace.EndTransparencyGroup( Rectangle( rPos, rSize ), nTransPercent );
+ }
+ else
+ {
+ const Size aDstSizeTwip( pDummyVDev->PixelToLogic( pDummyVDev->LogicToPixel( rSize ), MAP_TWIP ) );
+ sal_Int32 nMaxBmpDPI = i_rContext.m_bOnlyLosslessCompression ? 300 : 72;
+ if( i_rContext.m_nMaxImageResolution > 50 )
+ {
+ if ( nMaxBmpDPI > i_rContext.m_nMaxImageResolution )
+ nMaxBmpDPI = i_rContext.m_nMaxImageResolution;
+ }
+ const sal_Int32 nPixelX = (sal_Int32)((double)aDstSizeTwip.Width() * (double)nMaxBmpDPI / 1440.0);
+ const sal_Int32 nPixelY = (sal_Int32)((double)aDstSizeTwip.Height() * (double)nMaxBmpDPI / 1440.0);
+ if ( nPixelX && nPixelY )
+ {
+ Size aDstSizePixel( nPixelX, nPixelY );
+ VirtualDevice* pVDev = new VirtualDevice;
+ if( pVDev->SetOutputSizePixel( aDstSizePixel ) )
+ {
+ Bitmap aPaint, aMask;
+ AlphaMask aAlpha;
+ Point aPoint;
+
+ MapMode aMapMode( pDummyVDev->GetMapMode() );
+ aMapMode.SetOrigin( aPoint );
+ pVDev->SetMapMode( aMapMode );
+ Size aDstSize( pVDev->PixelToLogic( aDstSizePixel ) );
+
+ Point aMtfOrigin( aTmpMtf.GetPrefMapMode().GetOrigin() );
+ if ( aMtfOrigin.X() || aMtfOrigin.Y() )
+ aTmpMtf.Move( -aMtfOrigin.X(), -aMtfOrigin.Y() );
+ double fScaleX = (double)aDstSize.Width() / (double)aTmpMtf.GetPrefSize().Width();
+ double fScaleY = (double)aDstSize.Height() / (double)aTmpMtf.GetPrefSize().Height();
+ if( fScaleX != 1.0 || fScaleY != 1.0 )
+ aTmpMtf.Scale( fScaleX, fScaleY );
+ aTmpMtf.SetPrefMapMode( aMapMode );
+
+ // create paint bitmap
+ aTmpMtf.WindStart();
+ aTmpMtf.Play( pVDev, aPoint, aDstSize );
+ aTmpMtf.WindStart();
+
+ pVDev->EnableMapMode( FALSE );
+ aPaint = pVDev->GetBitmap( aPoint, aDstSizePixel );
+ pVDev->EnableMapMode( TRUE );
+
+ // create mask bitmap
+ pVDev->SetLineColor( COL_BLACK );
+ pVDev->SetFillColor( COL_BLACK );
+ pVDev->DrawRect( Rectangle( aPoint, aDstSize ) );
+ pVDev->SetDrawMode( DRAWMODE_WHITELINE | DRAWMODE_WHITEFILL | DRAWMODE_WHITETEXT |
+ DRAWMODE_WHITEBITMAP | DRAWMODE_WHITEGRADIENT );
+ aTmpMtf.WindStart();
+ aTmpMtf.Play( pVDev, aPoint, aDstSize );
+ aTmpMtf.WindStart();
+ pVDev->EnableMapMode( FALSE );
+ aMask = pVDev->GetBitmap( aPoint, aDstSizePixel );
+ pVDev->EnableMapMode( TRUE );
+
+ // create alpha mask from gradient
+ pVDev->SetDrawMode( DRAWMODE_GRAYGRADIENT );
+ pVDev->DrawGradient( Rectangle( aPoint, aDstSize ), rTransparenceGradient );
+ pVDev->SetDrawMode( DRAWMODE_DEFAULT );
+ pVDev->EnableMapMode( FALSE );
+ pVDev->DrawMask( aPoint, aDstSizePixel, aMask, Color( COL_WHITE ) );
+ aAlpha = pVDev->GetBitmap( aPoint, aDstSizePixel );
+ implWriteBitmapEx( rPos, rSize, BitmapEx( aPaint, aAlpha ), pDummyVDev, i_rContext );
+ }
+ delete pVDev;
+ }
+ }
+ }
+ break;
+
+ case( META_EPS_ACTION ):
+ {
+ const MetaEPSAction* pA = (const MetaEPSAction*) pAction;
+ const GDIMetaFile aSubstitute( pA->GetSubstitute() );
+
+ m_rOuterFace.Push();
+ pDummyVDev->Push();
+
+ MapMode aMapMode( aSubstitute.GetPrefMapMode() );
+ Size aOutSize( pDummyVDev->LogicToLogic( pA->GetSize(), pDummyVDev->GetMapMode(), aMapMode ) );
+ aMapMode.SetScaleX( Fraction( aOutSize.Width(), aSubstitute.GetPrefSize().Width() ) );
+ aMapMode.SetScaleY( Fraction( aOutSize.Height(), aSubstitute.GetPrefSize().Height() ) );
+ aMapMode.SetOrigin( pDummyVDev->LogicToLogic( pA->GetPoint(), pDummyVDev->GetMapMode(), aMapMode ) );
+
+ m_rOuterFace.SetMapMode( aMapMode );
+ pDummyVDev->SetMapMode( aMapMode );
+ playMetafile( aSubstitute, NULL, i_rContext, pDummyVDev );
+ pDummyVDev->Pop();
+ m_rOuterFace.Pop();
+ }
+ break;
+
+ case( META_COMMENT_ACTION ):
+ if( ! i_rContext.m_bTransparenciesWereRemoved )
+ {
+ const MetaCommentAction* pA = (const MetaCommentAction*) pAction;
+ String aSkipComment;
+
+ if( pA->GetComment().CompareIgnoreCaseToAscii( "XGRAD_SEQ_BEGIN" ) == COMPARE_EQUAL )
+ {
+ const MetaGradientExAction* pGradAction = NULL;
+ sal_Bool bDone = sal_False;
+
+ while( !bDone && ( ++i < nCount ) )
+ {
+ pAction = aMtf.GetAction( i );
+
+ if( pAction->GetType() == META_GRADIENTEX_ACTION )
+ pGradAction = (const MetaGradientExAction*) pAction;
+ else if( ( pAction->GetType() == META_COMMENT_ACTION ) &&
+ ( ( (const MetaCommentAction*) pAction )->GetComment().CompareIgnoreCaseToAscii( "XGRAD_SEQ_END" ) == COMPARE_EQUAL ) )
+ {
+ bDone = sal_True;
+ }
+ }
+
+ if( pGradAction )
+ implWriteGradient( pGradAction->GetPolyPolygon(), pGradAction->GetGradient(), pDummyVDev, i_rContext );
+ }
+ else
+ {
+ const BYTE* pData = pA->GetData();
+ if ( pData )
+ {
+ SvMemoryStream aMemStm( (void*)pData, pA->GetDataSize(), STREAM_READ );
+ sal_Bool bSkipSequence = sal_False;
+ ByteString sSeqEnd;
+
+ if( pA->GetComment().Equals( "XPATHSTROKE_SEQ_BEGIN" ) )
+ {
+ sSeqEnd = ByteString( "XPATHSTROKE_SEQ_END" );
+ SvtGraphicStroke aStroke;
+ aMemStm >> aStroke;
+
+ Polygon aPath;
+ aStroke.getPath( aPath );
+
+ PolyPolygon aStartArrow;
+ PolyPolygon aEndArrow;
+ double fTransparency( aStroke.getTransparency() );
+ double fStrokeWidth( aStroke.getStrokeWidth() );
+ SvtGraphicStroke::DashArray aDashArray;
+
+ aStroke.getStartArrow( aStartArrow );
+ aStroke.getEndArrow( aEndArrow );
+ aStroke.getDashArray( aDashArray );
+
+ bSkipSequence = sal_True;
+ if ( aStartArrow.Count() || aEndArrow.Count() )
+ bSkipSequence = sal_False;
+ if ( aDashArray.size() && ( fStrokeWidth != 0.0 ) && ( fTransparency == 0.0 ) )
+ bSkipSequence = sal_False;
+ if ( bSkipSequence )
+ {
+ PDFWriter::ExtLineInfo aInfo;
+ aInfo.m_fLineWidth = fStrokeWidth;
+ aInfo.m_fTransparency = fTransparency;
+ aInfo.m_fMiterLimit = aStroke.getMiterLimit();
+ switch( aStroke.getCapType() )
+ {
+ default:
+ case SvtGraphicStroke::capButt: aInfo.m_eCap = PDFWriter::capButt;break;
+ case SvtGraphicStroke::capRound: aInfo.m_eCap = PDFWriter::capRound;break;
+ case SvtGraphicStroke::capSquare: aInfo.m_eCap = PDFWriter::capSquare;break;
+ }
+ switch( aStroke.getJoinType() )
+ {
+ default:
+ case SvtGraphicStroke::joinMiter: aInfo.m_eJoin = PDFWriter::joinMiter;break;
+ case SvtGraphicStroke::joinRound: aInfo.m_eJoin = PDFWriter::joinRound;break;
+ case SvtGraphicStroke::joinBevel: aInfo.m_eJoin = PDFWriter::joinBevel;break;
+ case SvtGraphicStroke::joinNone:
+ aInfo.m_eJoin = PDFWriter::joinMiter;
+ aInfo.m_fMiterLimit = 0.0;
+ break;
+ }
+ aInfo.m_aDashArray = aDashArray;
+
+ if(SvtGraphicStroke::joinNone == aStroke.getJoinType()
+ && fStrokeWidth > 0.0)
+ {
+ // emulate no edge rounding by handling single edges
+ const sal_uInt16 nPoints(aPath.GetSize());
+ const bool bCurve(aPath.HasFlags());
+
+ for(sal_uInt16 a(0); a + 1 < nPoints; a++)
+ {
+ if(bCurve
+ && POLY_NORMAL != aPath.GetFlags(a + 1)
+ && a + 2 < nPoints
+ && POLY_NORMAL != aPath.GetFlags(a + 2)
+ && a + 3 < nPoints)
+ {
+ const Polygon aSnippet(4,
+ aPath.GetConstPointAry() + a,
+ aPath.GetConstFlagAry() + a);
+ m_rOuterFace.DrawPolyLine( aSnippet, aInfo );
+ a += 2;
+ }
+ else
+ {
+ const Polygon aSnippet(2,
+ aPath.GetConstPointAry() + a);
+ m_rOuterFace.DrawPolyLine( aSnippet, aInfo );
+ }
+ }
+ }
+ else
+ {
+ m_rOuterFace.DrawPolyLine( aPath, aInfo );
+ }
+ }
+ }
+ else if ( pA->GetComment().Equals( "XPATHFILL_SEQ_BEGIN" ) )
+ {
+ sSeqEnd = ByteString( "XPATHFILL_SEQ_END" );
+ SvtGraphicFill aFill;
+ aMemStm >> aFill;
+
+ if ( ( aFill.getFillType() == SvtGraphicFill::fillSolid ) && ( aFill.getFillRule() == SvtGraphicFill::fillEvenOdd ) )
+ {
+ double fTransparency = aFill.getTransparency();
+ if ( fTransparency == 0.0 )
+ {
+ PolyPolygon aPath;
+ aFill.getPath( aPath );
+
+ bSkipSequence = sal_True;
+ m_rOuterFace.DrawPolyPolygon( aPath );
+ }
+ else if ( fTransparency == 1.0 )
+ bSkipSequence = sal_True;
+ }
+/* #i81548# removing optimization for fill textures, because most of the texture settings are not
+ exported properly. In OpenOffice 3.1 the drawing layer will support graphic primitives, then it
+ will not be a problem to optimize the filltexture export. But for wysiwyg is more important than
+ filesize.
+ else if( aFill.getFillType() == SvtGraphicFill::fillTexture && aFill.isTiling() )
+ {
+ sal_Int32 nPattern = mnCachePatternId;
+ Graphic aPatternGraphic;
+ aFill.getGraphic( aPatternGraphic );
+ bool bUseCache = false;
+ SvtGraphicFill::Transform aPatTransform;
+ aFill.getTransform( aPatTransform );
+
+ if( mnCachePatternId >= 0 )
+ {
+ SvtGraphicFill::Transform aCacheTransform;
+ maCacheFill.getTransform( aCacheTransform );
+ if( aCacheTransform.matrix[0] == aPatTransform.matrix[0] &&
+ aCacheTransform.matrix[1] == aPatTransform.matrix[1] &&
+ aCacheTransform.matrix[2] == aPatTransform.matrix[2] &&
+ aCacheTransform.matrix[3] == aPatTransform.matrix[3] &&
+ aCacheTransform.matrix[4] == aPatTransform.matrix[4] &&
+ aCacheTransform.matrix[5] == aPatTransform.matrix[5]
+ )
+ {
+ Graphic aCacheGraphic;
+ maCacheFill.getGraphic( aCacheGraphic );
+ if( aCacheGraphic == aPatternGraphic )
+ bUseCache = true;
+ }
+ }
+
+ if( ! bUseCache )
+ {
+
+ // paint graphic to metafile
+ GDIMetaFile aPattern;
+ pDummyVDev->SetConnectMetaFile( &aPattern );
+ pDummyVDev->Push();
+ pDummyVDev->SetMapMode( aPatternGraphic.GetPrefMapMode() );
+
+ aPatternGraphic.Draw( &rDummyVDev, Point( 0, 0 ) );
+ pDummyVDev->Pop();
+ pDummyVDev->SetConnectMetaFile( NULL );
+ aPattern.WindStart();
+
+ MapMode aPatternMapMode( aPatternGraphic.GetPrefMapMode() );
+ // prepare pattern from metafile
+ Size aPrefSize( aPatternGraphic.GetPrefSize() );
+ // FIXME: this magic -1 shouldn't be necessary
+ aPrefSize.Width() -= 1;
+ aPrefSize.Height() -= 1;
+ aPrefSize = m_rOuterFace.GetReferenceDevice()->
+ LogicToLogic( aPrefSize,
+ &aPatternMapMode,
+ &m_rOuterFace.GetReferenceDevice()->GetMapMode() );
+ // build bounding rectangle of pattern
+ Rectangle aBound( Point( 0, 0 ), aPrefSize );
+ m_rOuterFace.BeginPattern( aBound );
+ m_rOuterFace.Push();
+ pDummyVDev->Push();
+ m_rOuterFace.SetMapMode( aPatternMapMode );
+ pDummyVDev->SetMapMode( aPatternMapMode );
+ ImplWriteActions( m_rOuterFace, NULL, aPattern, rDummyVDev );
+ pDummyVDev->Pop();
+ m_rOuterFace.Pop();
+
+ nPattern = m_rOuterFace.EndPattern( aPatTransform );
+
+ // try some caching and reuse pattern
+ mnCachePatternId = nPattern;
+ maCacheFill = aFill;
+ }
+
+ // draw polypolygon with pattern fill
+ PolyPolygon aPath;
+ aFill.getPath( aPath );
+ m_rOuterFace.DrawPolyPolygon( aPath, nPattern, aFill.getFillRule() == SvtGraphicFill::fillEvenOdd );
+
+ bSkipSequence = sal_True;
+ }
+*/
+ }
+ if ( bSkipSequence )
+ {
+ while( ++i < nCount )
+ {
+ pAction = aMtf.GetAction( i );
+ if ( pAction->GetType() == META_COMMENT_ACTION )
+ {
+ ByteString sComment( ((MetaCommentAction*)pAction)->GetComment() );
+ if ( sComment.Equals( sSeqEnd ) )
+ break;
+ }
+ // #i44496#
+ // the replacement action for stroke is a filled rectangle
+ // the set fillcolor of the replacement is part of the graphics
+ // state and must not be skipped
+ else if( pAction->GetType() == META_FILLCOLOR_ACTION )
+ {
+ const MetaFillColorAction* pMA = (const MetaFillColorAction*) pAction;
+ if( pMA->IsSetting() )
+ m_rOuterFace.SetFillColor( pMA->GetColor() );
+ else
+ m_rOuterFace.SetFillColor();
+ }
+ }
+ }
+ }
+ }
+ }
+ break;
+
+ case( META_BMP_ACTION ):
+ {
+ const MetaBmpAction* pA = (const MetaBmpAction*) pAction;
+ BitmapEx aBitmapEx( pA->GetBitmap() );
+ Size aSize( OutputDevice::LogicToLogic( aBitmapEx.GetPrefSize(),
+ aBitmapEx.GetPrefMapMode(), pDummyVDev->GetMapMode() ) );
+ if( ! ( aSize.Width() && aSize.Height() ) )
+ aSize = pDummyVDev->PixelToLogic( aBitmapEx.GetSizePixel() );
+ implWriteBitmapEx( pA->GetPoint(), aSize, aBitmapEx, pDummyVDev, i_rContext );
+ }
+ break;
+
+ case( META_BMPSCALE_ACTION ):
+ {
+ const MetaBmpScaleAction* pA = (const MetaBmpScaleAction*) pAction;
+ implWriteBitmapEx( pA->GetPoint(), pA->GetSize(), BitmapEx( pA->GetBitmap() ), pDummyVDev, i_rContext );
+ }
+ break;
+
+ case( META_BMPSCALEPART_ACTION ):
+ {
+ const MetaBmpScalePartAction* pA = (const MetaBmpScalePartAction*) pAction;
+ BitmapEx aBitmapEx( pA->GetBitmap() );
+ aBitmapEx.Crop( Rectangle( pA->GetSrcPoint(), pA->GetSrcSize() ) );
+ implWriteBitmapEx( pA->GetDestPoint(), pA->GetDestSize(), aBitmapEx, pDummyVDev, i_rContext );
+ }
+ break;
+
+ case( META_BMPEX_ACTION ):
+ {
+ const MetaBmpExAction* pA = (const MetaBmpExAction*) pAction;
+ BitmapEx aBitmapEx( pA->GetBitmapEx() );
+ Size aSize( OutputDevice::LogicToLogic( aBitmapEx.GetPrefSize(),
+ aBitmapEx.GetPrefMapMode(), pDummyVDev->GetMapMode() ) );
+ implWriteBitmapEx( pA->GetPoint(), aSize, aBitmapEx, pDummyVDev, i_rContext );
+ }
+ break;
+
+ case( META_BMPEXSCALE_ACTION ):
+ {
+ const MetaBmpExScaleAction* pA = (const MetaBmpExScaleAction*) pAction;
+ implWriteBitmapEx( pA->GetPoint(), pA->GetSize(), pA->GetBitmapEx(), pDummyVDev, i_rContext );
+ }
+ break;
+
+ case( META_BMPEXSCALEPART_ACTION ):
+ {
+ const MetaBmpExScalePartAction* pA = (const MetaBmpExScalePartAction*) pAction;
+ BitmapEx aBitmapEx( pA->GetBitmapEx() );
+ aBitmapEx.Crop( Rectangle( pA->GetSrcPoint(), pA->GetSrcSize() ) );
+ implWriteBitmapEx( pA->GetDestPoint(), pA->GetDestSize(), aBitmapEx, pDummyVDev, i_rContext );
+ }
+ break;
+
+ case( META_MASK_ACTION ):
+ case( META_MASKSCALE_ACTION ):
+ case( META_MASKSCALEPART_ACTION ):
+ {
+ DBG_ERROR( "MetaMask...Action not supported yet" );
+ }
+ break;
+
+ case( META_TEXT_ACTION ):
+ {
+ const MetaTextAction* pA = (const MetaTextAction*) pAction;
+ m_rOuterFace.DrawText( pA->GetPoint(), String( pA->GetText(), pA->GetIndex(), pA->GetLen() ) );
+ }
+ break;
+
+ case( META_TEXTRECT_ACTION ):
+ {
+ const MetaTextRectAction* pA = (const MetaTextRectAction*) pAction;
+ m_rOuterFace.DrawText( pA->GetRect(), String( pA->GetText() ), pA->GetStyle() );
+ }
+ break;
+
+ case( META_TEXTARRAY_ACTION ):
+ {
+ const MetaTextArrayAction* pA = (const MetaTextArrayAction*) pAction;
+ m_rOuterFace.DrawTextArray( pA->GetPoint(), pA->GetText(), pA->GetDXArray(), pA->GetIndex(), pA->GetLen() );
+ }
+ break;
+
+ case( META_STRETCHTEXT_ACTION ):
+ {
+ const MetaStretchTextAction* pA = (const MetaStretchTextAction*) pAction;
+ m_rOuterFace.DrawStretchText( pA->GetPoint(), pA->GetWidth(), pA->GetText(), pA->GetIndex(), pA->GetLen() );
+ }
+ break;
+
+
+ case( META_TEXTLINE_ACTION ):
+ {
+ const MetaTextLineAction* pA = (const MetaTextLineAction*) pAction;
+ m_rOuterFace.DrawTextLine( pA->GetStartPoint(), pA->GetWidth(), pA->GetStrikeout(), pA->GetUnderline(), pA->GetOverline() );
+
+ }
+ break;
+
+ case( META_CLIPREGION_ACTION ):
+ {
+ const MetaClipRegionAction* pA = (const MetaClipRegionAction*) pAction;
+
+ if( pA->IsClipping() )
+ {
+ if( pA->GetRegion().IsEmpty() )
+ m_rOuterFace.SetClipRegion( basegfx::B2DPolyPolygon() );
+ else
+ {
+ Region aReg( pA->GetRegion() );
+ m_rOuterFace.SetClipRegion( aReg.ConvertToB2DPolyPolygon() );
+ }
+ }
+ else
+ m_rOuterFace.SetClipRegion();
+ }
+ break;
+
+ case( META_ISECTRECTCLIPREGION_ACTION ):
+ {
+ const MetaISectRectClipRegionAction* pA = (const MetaISectRectClipRegionAction*) pAction;
+ m_rOuterFace.IntersectClipRegion( pA->GetRect() );
+ }
+ break;
+
+ case( META_ISECTREGIONCLIPREGION_ACTION ):
+ {
+ const MetaISectRegionClipRegionAction* pA = (const MetaISectRegionClipRegionAction*) pAction;
+ Region aReg( pA->GetRegion() );
+ m_rOuterFace.IntersectClipRegion( aReg.ConvertToB2DPolyPolygon() );
+ }
+ break;
+
+ case( META_MOVECLIPREGION_ACTION ):
+ {
+ const MetaMoveClipRegionAction* pA = (const MetaMoveClipRegionAction*) pAction;
+ m_rOuterFace.MoveClipRegion( pA->GetHorzMove(), pA->GetVertMove() );
+ }
+ break;
+
+ case( META_MAPMODE_ACTION ):
+ {
+ const_cast< MetaAction* >( pAction )->Execute( pDummyVDev );
+ m_rOuterFace.SetMapMode( pDummyVDev->GetMapMode() );
+ }
+ break;
+
+ case( META_LINECOLOR_ACTION ):
+ {
+ const MetaLineColorAction* pA = (const MetaLineColorAction*) pAction;
+
+ if( pA->IsSetting() )
+ m_rOuterFace.SetLineColor( pA->GetColor() );
+ else
+ m_rOuterFace.SetLineColor();
+ }
+ break;
+
+ case( META_FILLCOLOR_ACTION ):
+ {
+ const MetaFillColorAction* pA = (const MetaFillColorAction*) pAction;
+
+ if( pA->IsSetting() )
+ m_rOuterFace.SetFillColor( pA->GetColor() );
+ else
+ m_rOuterFace.SetFillColor();
+ }
+ break;
+
+ case( META_TEXTLINECOLOR_ACTION ):
+ {
+ const MetaTextLineColorAction* pA = (const MetaTextLineColorAction*) pAction;
+
+ if( pA->IsSetting() )
+ m_rOuterFace.SetTextLineColor( pA->GetColor() );
+ else
+ m_rOuterFace.SetTextLineColor();
+ }
+ break;
+
+ case( META_OVERLINECOLOR_ACTION ):
+ {
+ const MetaOverlineColorAction* pA = (const MetaOverlineColorAction*) pAction;
+
+ if( pA->IsSetting() )
+ m_rOuterFace.SetOverlineColor( pA->GetColor() );
+ else
+ m_rOuterFace.SetOverlineColor();
+ }
+ break;
+
+ case( META_TEXTFILLCOLOR_ACTION ):
+ {
+ const MetaTextFillColorAction* pA = (const MetaTextFillColorAction*) pAction;
+
+ if( pA->IsSetting() )
+ m_rOuterFace.SetTextFillColor( pA->GetColor() );
+ else
+ m_rOuterFace.SetTextFillColor();
+ }
+ break;
+
+ case( META_TEXTCOLOR_ACTION ):
+ {
+ const MetaTextColorAction* pA = (const MetaTextColorAction*) pAction;
+ m_rOuterFace.SetTextColor( pA->GetColor() );
+ }
+ break;
+
+ case( META_TEXTALIGN_ACTION ):
+ {
+ const MetaTextAlignAction* pA = (const MetaTextAlignAction*) pAction;
+ m_rOuterFace.SetTextAlign( pA->GetTextAlign() );
+ }
+ break;
+
+ case( META_FONT_ACTION ):
+ {
+ const MetaFontAction* pA = (const MetaFontAction*) pAction;
+ m_rOuterFace.SetFont( pA->GetFont() );
+ }
+ break;
+
+ case( META_PUSH_ACTION ):
+ {
+ const MetaPushAction* pA = (const MetaPushAction*) pAction;
+
+ pDummyVDev->Push( pA->GetFlags() );
+ m_rOuterFace.Push( pA->GetFlags() );
+ }
+ break;
+
+ case( META_POP_ACTION ):
+ {
+ pDummyVDev->Pop();
+ m_rOuterFace.Pop();
+ }
+ break;
+
+ case( META_LAYOUTMODE_ACTION ):
+ {
+ const MetaLayoutModeAction* pA = (const MetaLayoutModeAction*) pAction;
+ m_rOuterFace.SetLayoutMode( pA->GetLayoutMode() );
+ }
+ break;
+
+ case META_TEXTLANGUAGE_ACTION:
+ {
+ const MetaTextLanguageAction* pA = (const MetaTextLanguageAction*) pAction;
+ m_rOuterFace.SetDigitLanguage( pA->GetTextLanguage() );
+ }
+ break;
+
+ case( META_WALLPAPER_ACTION ):
+ {
+ const MetaWallpaperAction* pA = (const MetaWallpaperAction*) pAction;
+ m_rOuterFace.DrawWallpaper( pA->GetRect(), pA->GetWallpaper() );
+ }
+ break;
+
+ case( META_RASTEROP_ACTION ):
+ {
+ // !!! >>> we don't want to support this actions
+ }
+ break;
+
+ case( META_REFPOINT_ACTION ):
+ {
+ // !!! >>> we don't want to support this actions
+ }
+ break;
+
+ default:
+ // #i24604# Made assertion fire only once per
+ // metafile. The asserted actions here are all
+ // deprecated
+ if( !bAssertionFired )
+ {
+ bAssertionFired = true;
+ DBG_ERROR( "PDFExport::ImplWriteActions: deprecated and unsupported MetaAction encountered" );
+ }
+ break;
+ }
+ i++;
+ }
+ }
+
+ delete pPrivateDevice;
+}
+
+// Encryption methods
+
+/* a crutch to transport an rtlDigest safely though UNO API
+ this is needed for the PDF export dialog, which otherwise would have to pass
+ clear text passwords down till they can be used in PDFWriter. Unfortunately
+ the MD5 sum of the password (which is needed to create the PDF encryption key)
+ is not sufficient, since an rtl MD5 digest cannot be created in an arbitrary state
+ which would be needed in PDFWriterImpl::computeEncryptionKey.
+*/
+class EncHashTransporter : public cppu::WeakImplHelper1 < com::sun::star::beans::XMaterialHolder >
+{
+ rtlDigest maUDigest;
+ sal_IntPtr maID;
+ std::vector< sal_uInt8 > maOValue;
+
+ static std::map< sal_IntPtr, EncHashTransporter* > sTransporters;
+public:
+ EncHashTransporter()
+ : maUDigest( rtl_digest_createMD5() )
+ {
+ maID = reinterpret_cast< sal_IntPtr >(this);
+ while( sTransporters.find( maID ) != sTransporters.end() ) // paranoia mode
+ maID++;
+ sTransporters[ maID ] = this;
+ }
+
+ virtual ~EncHashTransporter()
+ {
+ sTransporters.erase( maID );
+ if( maUDigest )
+ rtl_digest_destroyMD5( maUDigest );
+ OSL_TRACE( "EncHashTransporter freed\n" );
+ }
+
+ rtlDigest getUDigest() const { return maUDigest; };
+ std::vector< sal_uInt8 >& getOValue() { return maOValue; }
+ void invalidate()
+ {
+ if( maUDigest )
+ {
+ rtl_digest_destroyMD5( maUDigest );
+ maUDigest = NULL;
+ }
+ }
+
+ // XMaterialHolder
+ virtual uno::Any SAL_CALL getMaterial() throw()
+ {
+ return uno::makeAny( sal_Int64(maID) );
+ }
+
+ static EncHashTransporter* getEncHashTransporter( const uno::Reference< beans::XMaterialHolder >& );
+
+};
+
+std::map< sal_IntPtr, EncHashTransporter* > EncHashTransporter::sTransporters;
+
+EncHashTransporter* EncHashTransporter::getEncHashTransporter( const uno::Reference< beans::XMaterialHolder >& xRef )
+{
+ EncHashTransporter* pResult = NULL;
+ if( xRef.is() )
+ {
+ uno::Any aMat( xRef->getMaterial() );
+ sal_Int64 nMat = 0;
+ if( aMat >>= nMat )
+ {
+ std::map< sal_IntPtr, EncHashTransporter* >::iterator it = sTransporters.find( static_cast<sal_IntPtr>(nMat) );
+ if( it != sTransporters.end() )
+ pResult = it->second;
+ }
+ }
+ return pResult;
+}
+
+sal_Bool PDFWriterImpl::checkEncryptionBufferSize( register sal_Int32 newSize )
+{
+ if( m_nEncryptionBufferSize < newSize )
+ {
+ /* reallocate the buffer, the used function allocate as rtl_allocateMemory
+ if the pointer parameter is NULL */
+ m_pEncryptionBuffer = (sal_uInt8*)rtl_reallocateMemory( m_pEncryptionBuffer, newSize );
+ if( m_pEncryptionBuffer )
+ m_nEncryptionBufferSize = newSize;
+ else
+ m_nEncryptionBufferSize = 0;
+ }
+ return ( m_nEncryptionBufferSize != 0 );
+}
+
+void PDFWriterImpl::checkAndEnableStreamEncryption( register sal_Int32 nObject )
+{
+ if( m_aContext.Encryption.Encrypt() )
+ {
+ m_bEncryptThisStream = true;
+ sal_Int32 i = m_nKeyLength;
+ m_aContext.Encryption.EncryptionKey[i++] = (sal_uInt8)nObject;
+ m_aContext.Encryption.EncryptionKey[i++] = (sal_uInt8)( nObject >> 8 );
+ m_aContext.Encryption.EncryptionKey[i++] = (sal_uInt8)( nObject >> 16 );
+ //the other location of m_nEncryptionKey are already set to 0, our fixed generation number
+ // do the MD5 hash
+ sal_uInt8 nMD5Sum[ RTL_DIGEST_LENGTH_MD5 ];
+ // the i+2 to take into account the generation number, always zero
+ rtl_digest_MD5( &m_aContext.Encryption.EncryptionKey[0], i+2, nMD5Sum, sizeof(nMD5Sum) );
+ // initialize the RC4 with the key
+ // key legth: see algoritm 3.1, step 4: (N+5) max 16
+ rtl_cipher_initARCFOUR( m_aCipher, rtl_Cipher_DirectionEncode, nMD5Sum, m_nRC4KeyLength, NULL, 0 );
+ }
+}
+
+void PDFWriterImpl::enableStringEncryption( register sal_Int32 nObject )
+{
+ if( m_aContext.Encryption.Encrypt() )
+ {
+ sal_Int32 i = m_nKeyLength;
+ m_aContext.Encryption.EncryptionKey[i++] = (sal_uInt8)nObject;
+ m_aContext.Encryption.EncryptionKey[i++] = (sal_uInt8)( nObject >> 8 );
+ m_aContext.Encryption.EncryptionKey[i++] = (sal_uInt8)( nObject >> 16 );
+ //the other location of m_nEncryptionKey are already set to 0, our fixed generation number
+ // do the MD5 hash
+ sal_uInt8 nMD5Sum[ RTL_DIGEST_LENGTH_MD5 ];
+ // the i+2 to take into account the generation number, always zero
+ rtl_digest_MD5( &m_aContext.Encryption.EncryptionKey[0], i+2, nMD5Sum, sizeof(nMD5Sum) );
+ // initialize the RC4 with the key
+ // key legth: see algoritm 3.1, step 4: (N+5) max 16
+ rtl_cipher_initARCFOUR( m_aCipher, rtl_Cipher_DirectionEncode, nMD5Sum, m_nRC4KeyLength, NULL, 0 );
+ }
+}
+
+/* init the encryption engine
+1. init the document id, used both for building the document id and for building the encryption key(s)
+2. build the encryption key following algorithms described in the PDF specification
+ */
+uno::Reference< beans::XMaterialHolder > PDFWriterImpl::initEncryption( const rtl::OUString& i_rOwnerPassword,
+ const rtl::OUString& i_rUserPassword,
+ bool b128Bit
+ )
+{
+ uno::Reference< beans::XMaterialHolder > xResult;
+ if( i_rOwnerPassword.getLength() || i_rUserPassword.getLength() )
+ {
+ EncHashTransporter* pTransporter = new EncHashTransporter;
+ xResult = pTransporter;
+
+ // get padded passwords
+ sal_uInt8 aPadUPW[ENCRYPTED_PWD_SIZE], aPadOPW[ENCRYPTED_PWD_SIZE];
+ padPassword( i_rOwnerPassword.getLength() ? i_rOwnerPassword : i_rUserPassword, aPadOPW );
+ padPassword( i_rUserPassword, aPadUPW );
+ sal_Int32 nKeyLength = SECUR_40BIT_KEY;
+ if( b128Bit )
+ nKeyLength = SECUR_128BIT_KEY;
+
+ if( computeODictionaryValue( aPadOPW, aPadUPW, pTransporter->getOValue(), nKeyLength ) )
+ {
+ rtlDigest aDig = pTransporter->getUDigest();
+ if( rtl_digest_updateMD5( aDig, aPadUPW, ENCRYPTED_PWD_SIZE ) != rtl_Digest_E_None )
+ xResult.clear();
+ }
+ else
+ xResult.clear();
+
+ // trash temporary padded cleartext PWDs
+ rtl_zeroMemory( aPadOPW, sizeof(aPadOPW) );
+ rtl_zeroMemory( aPadUPW, sizeof(aPadUPW) );
+
+ }
+ return xResult;
+}
+
+bool PDFWriterImpl::prepareEncryption( const uno::Reference< beans::XMaterialHolder >& xEnc )
+{
+ bool bSuccess = false;
+ EncHashTransporter* pTransporter = EncHashTransporter::getEncHashTransporter( xEnc );
+ if( pTransporter )
+ {
+ sal_Int32 nKeyLength = 0, nRC4KeyLength = 0;
+ sal_Int32 nAccessPermissions = computeAccessPermissions( m_aContext.Encryption, nKeyLength, nRC4KeyLength );
+ m_aContext.Encryption.OValue = pTransporter->getOValue();
+ bSuccess = computeUDictionaryValue( pTransporter, m_aContext.Encryption, nKeyLength, nAccessPermissions );
+ }
+ if( ! bSuccess )
+ {
+ m_aContext.Encryption.OValue.clear();
+ m_aContext.Encryption.UValue.clear();
+ m_aContext.Encryption.EncryptionKey.clear();
+ }
+ return bSuccess;
+}
+
+sal_Int32 PDFWriterImpl::computeAccessPermissions( const vcl::PDFWriter::PDFEncryptionProperties& i_rProperties,
+ sal_Int32& o_rKeyLength, sal_Int32& o_rRC4KeyLength )
+{
+ /*
+ 2) compute the access permissions, in numerical form
+
+ the default value depends on the revision 2 (40 bit) or 3 (128 bit security):
+ - for 40 bit security the unused bit must be set to 1, since they are not used
+ - for 128 bit security the same bit must be preset to 0 and set later if needed
+ according to the table 3.15, pdf v 1.4 */
+ sal_Int32 nAccessPermissions = ( i_rProperties.Security128bit ) ? 0xfffff0c0 : 0xffffffc0 ;
+
+ /* check permissions for 40 bit security case */
+ nAccessPermissions |= ( i_rProperties.CanPrintTheDocument ) ? 1 << 2 : 0;
+ nAccessPermissions |= ( i_rProperties.CanModifyTheContent ) ? 1 << 3 : 0;
+ nAccessPermissions |= ( i_rProperties.CanCopyOrExtract ) ? 1 << 4 : 0;
+ nAccessPermissions |= ( i_rProperties.CanAddOrModify ) ? 1 << 5 : 0;
+ o_rKeyLength = SECUR_40BIT_KEY;
+ o_rRC4KeyLength = SECUR_40BIT_KEY+5; // for this value see PDF spec v 1.4, algorithm 3.1 step 4, where n is 5
+
+ if( i_rProperties.Security128bit )
+ {
+ o_rKeyLength = SECUR_128BIT_KEY;
+ o_rRC4KeyLength = 16; // for this value see PDF spec v 1.4, algorithm 3.1 step 4, where n is 16, thus maximum
+ // permitted value is 16
+ nAccessPermissions |= ( i_rProperties.CanFillInteractive ) ? 1 << 8 : 0;
+ nAccessPermissions |= ( i_rProperties.CanExtractForAccessibility ) ? 1 << 9 : 0;
+ nAccessPermissions |= ( i_rProperties.CanAssemble ) ? 1 << 10 : 0;
+ nAccessPermissions |= ( i_rProperties.CanPrintFull ) ? 1 << 11 : 0;
+ }
+ return nAccessPermissions;
+}
+
+/*************************************************************
+begin i12626 methods
+
+Implements Algorithm 3.2, step 1 only
+*/
+void PDFWriterImpl::padPassword( const rtl::OUString& i_rPassword, sal_uInt8* o_pPaddedPW )
+{
+ // get ansi-1252 version of the password string CHECKIT ! i12626
+ rtl::OString aString( rtl::OUStringToOString( i_rPassword, RTL_TEXTENCODING_MS_1252 ) );
+
+ //copy the string to the target
+ sal_Int32 nToCopy = ( aString.getLength() < ENCRYPTED_PWD_SIZE ) ? aString.getLength() : ENCRYPTED_PWD_SIZE;
+ sal_Int32 nCurrentChar;
+
+ for( nCurrentChar = 0; nCurrentChar < nToCopy; nCurrentChar++ )
+ o_pPaddedPW[nCurrentChar] = (sal_uInt8)( aString.getStr()[nCurrentChar] );
+
+ //pad it with standard byte string
+ sal_Int32 i,y;
+ for( i = nCurrentChar, y = 0 ; i < ENCRYPTED_PWD_SIZE; i++, y++ )
+ o_pPaddedPW[i] = s_nPadString[y];
+
+ // trash memory of temporary clear text password
+ rtl_zeroMemory( (sal_Char*)aString.getStr(), aString.getLength() );
+}
+
+/**********************************
+Algorithm 3.2 Compute the encryption key used
+
+step 1 should already be done before calling, the paThePaddedPassword parameter should contain
+the padded password and must be 32 byte long, the encryption key is returned into the paEncryptionKey parameter,
+it will be 16 byte long for 128 bit security; for 40 bit security only the first 5 bytes are used
+
+TODO: in pdf ver 1.5 and 1.6 the step 6 is different, should be implemented. See spec.
+
+*/
+bool PDFWriterImpl::computeEncryptionKey( EncHashTransporter* i_pTransporter, vcl::PDFWriter::PDFEncryptionProperties& io_rProperties, sal_Int32 i_nAccessPermissions )
+{
+ bool bSuccess = true;
+ sal_uInt8 nMD5Sum[ RTL_DIGEST_LENGTH_MD5 ];
+
+ // transporter contains an MD5 digest with the padded user password already
+ rtlDigest aDigest = i_pTransporter->getUDigest();
+ rtlDigestError nError = rtl_Digest_E_None;
+ if( aDigest )
+ {
+ //step 3
+ if( ! io_rProperties.OValue.empty() )
+ nError = rtl_digest_updateMD5( aDigest, &io_rProperties.OValue[0] , sal_Int32(io_rProperties.OValue.size()) );
+ else
+ bSuccess = false;
+ //Step 4
+ sal_uInt8 nPerm[4];
+
+ nPerm[0] = (sal_uInt8)i_nAccessPermissions;
+ nPerm[1] = (sal_uInt8)( i_nAccessPermissions >> 8 );
+ nPerm[2] = (sal_uInt8)( i_nAccessPermissions >> 16 );
+ nPerm[3] = (sal_uInt8)( i_nAccessPermissions >> 24 );
+
+ if( nError == rtl_Digest_E_None )
+ nError = rtl_digest_updateMD5( aDigest, nPerm , sizeof( nPerm ) );
+
+ //step 5, get the document ID, binary form
+ if( nError == rtl_Digest_E_None )
+ nError = rtl_digest_updateMD5( aDigest, &io_rProperties.DocumentIdentifier[0], sal_Int32(io_rProperties.DocumentIdentifier.size()) );
+ //get the digest
+ if( nError == rtl_Digest_E_None )
+ {
+ rtl_digest_getMD5( aDigest, nMD5Sum, sizeof( nMD5Sum ) );
+
+ //step 6, only if 128 bit
+ if( io_rProperties.Security128bit )
+ {
+ for( sal_Int32 i = 0; i < 50; i++ )
+ {
+ nError = rtl_digest_updateMD5( aDigest, &nMD5Sum, sizeof( nMD5Sum ) );
+ if( nError != rtl_Digest_E_None )
+ {
+ bSuccess = false;
+ break;
+ }
+ rtl_digest_getMD5( aDigest, nMD5Sum, sizeof( nMD5Sum ) );
+ }
+ }
+ }
+ }
+ else
+ bSuccess = false;
+
+ i_pTransporter->invalidate();
+
+ //Step 7
+ if( bSuccess )
+ {
+ io_rProperties.EncryptionKey.resize( MAXIMUM_RC4_KEY_LENGTH );
+ for( sal_Int32 i = 0; i < MD5_DIGEST_SIZE; i++ )
+ io_rProperties.EncryptionKey[i] = nMD5Sum[i];
+ }
+ else
+ io_rProperties.EncryptionKey.clear();
+
+ return bSuccess;
+}
+
+/**********************************
+Algorithm 3.3 Compute the encryption dictionary /O value, save into the class data member
+the step numbers down here correspond to the ones in PDF v.1.4 specfication
+*/
+bool PDFWriterImpl::computeODictionaryValue( const sal_uInt8* i_pPaddedOwnerPassword,
+ const sal_uInt8* i_pPaddedUserPassword,
+ std::vector< sal_uInt8 >& io_rOValue,
+ sal_Int32 i_nKeyLength
+ )
+{
+ bool bSuccess = true;
+
+ io_rOValue.resize( ENCRYPTED_PWD_SIZE );
+
+ rtlDigest aDigest = rtl_digest_createMD5();
+ rtlCipher aCipher = rtl_cipher_createARCFOUR( rtl_Cipher_ModeStream );
+ if( aDigest && aCipher)
+ {
+ //step 1 already done, data is in i_pPaddedOwnerPassword
+ //step 2
+
+ rtlDigestError nError = rtl_digest_updateMD5( aDigest, i_pPaddedOwnerPassword, ENCRYPTED_PWD_SIZE );
+ if( nError == rtl_Digest_E_None )
+ {
+ sal_uInt8 nMD5Sum[ RTL_DIGEST_LENGTH_MD5 ];
+
+ rtl_digest_getMD5( aDigest, nMD5Sum, sizeof(nMD5Sum) );
+//step 3, only if 128 bit
+ if( i_nKeyLength == SECUR_128BIT_KEY )
+ {
+ sal_Int32 i;
+ for( i = 0; i < 50; i++ )
+ {
+ nError = rtl_digest_updateMD5( aDigest, nMD5Sum, sizeof( nMD5Sum ) );
+ if( nError != rtl_Digest_E_None )
+ {
+ bSuccess = false;
+ break;
+ }
+ rtl_digest_getMD5( aDigest, nMD5Sum, sizeof( nMD5Sum ) );
+ }
+ }
+ //Step 4, the key is in nMD5Sum
+ //step 5 already done, data is in i_pPaddedUserPassword
+ //step 6
+ rtl_cipher_initARCFOUR( aCipher, rtl_Cipher_DirectionEncode,
+ nMD5Sum, i_nKeyLength , NULL, 0 );
+ // encrypt the user password using the key set above
+ rtl_cipher_encodeARCFOUR( aCipher, i_pPaddedUserPassword, ENCRYPTED_PWD_SIZE, // the data to be encrypted
+ &io_rOValue[0], sal_Int32(io_rOValue.size()) ); //encrypted data
+ //Step 7, only if 128 bit
+ if( i_nKeyLength == SECUR_128BIT_KEY )
+ {
+ sal_uInt32 i, y;
+ sal_uInt8 nLocalKey[ SECUR_128BIT_KEY ]; // 16 = 128 bit key
+
+ for( i = 1; i <= 19; i++ ) // do it 19 times, start with 1
+ {
+ for( y = 0; y < sizeof( nLocalKey ); y++ )
+ nLocalKey[y] = (sal_uInt8)( nMD5Sum[y] ^ i );
+
+ rtl_cipher_initARCFOUR( aCipher, rtl_Cipher_DirectionEncode,
+ nLocalKey, SECUR_128BIT_KEY, NULL, 0 ); //destination data area, on init can be NULL
+ rtl_cipher_encodeARCFOUR( aCipher, &io_rOValue[0], sal_Int32(io_rOValue.size()), // the data to be encrypted
+ &io_rOValue[0], sal_Int32(io_rOValue.size()) ); // encrypted data, can be the same as the input, encrypt "in place"
+ //step 8, store in class data member
+ }
+ }
+ }
+ else
+ bSuccess = false;
+ }
+ else
+ bSuccess = false;
+
+ if( aDigest )
+ rtl_digest_destroyMD5( aDigest );
+ if( aCipher )
+ rtl_cipher_destroyARCFOUR( aCipher );
+
+ if( ! bSuccess )
+ io_rOValue.clear();
+ return bSuccess;
+}
+
+/**********************************
+Algorithms 3.4 and 3.5 Compute the encryption dictionary /U value, save into the class data member, revision 2 (40 bit) or 3 (128 bit)
+*/
+bool PDFWriterImpl::computeUDictionaryValue( EncHashTransporter* i_pTransporter,
+ vcl::PDFWriter::PDFEncryptionProperties& io_rProperties,
+ sal_Int32 i_nKeyLength,
+ sal_Int32 i_nAccessPermissions
+ )
+{
+ bool bSuccess = true;
+
+ io_rProperties.UValue.resize( ENCRYPTED_PWD_SIZE );
+
+ rtlDigest aDigest = rtl_digest_createMD5();
+ rtlCipher aCipher = rtl_cipher_createARCFOUR( rtl_Cipher_ModeStream );
+ if( aDigest && aCipher )
+ {
+ //step 1, common to both 3.4 and 3.5
+ if( computeEncryptionKey( i_pTransporter, io_rProperties, i_nAccessPermissions ) )
+ {
+ // prepare encryption key for object
+ for( sal_Int32 i = i_nKeyLength, y = 0; y < 5 ; y++ )
+ io_rProperties.EncryptionKey[i++] = 0;
+
+ if( io_rProperties.Security128bit == false )
+ {
+ //3.4
+ //step 2 and 3
+ rtl_cipher_initARCFOUR( aCipher, rtl_Cipher_DirectionEncode,
+ &io_rProperties.EncryptionKey[0], 5 , // key and key length
+ NULL, 0 ); //destination data area
+ // encrypt the user password using the key set above, save for later use
+ rtl_cipher_encodeARCFOUR( aCipher, s_nPadString, sizeof( s_nPadString ), // the data to be encrypted
+ &io_rProperties.UValue[0], sal_Int32(io_rProperties.UValue.size()) ); //encrypted data, stored in class data member
+ }
+ else
+ {
+ //or 3.5, for 128 bit security
+ //step6, initilize the last 16 bytes of the encrypted user password to 0
+ for(sal_uInt32 i = MD5_DIGEST_SIZE; i < sal_uInt32(io_rProperties.UValue.size()); i++)
+ io_rProperties.UValue[i] = 0;
+ //step 2
+ rtlDigestError nError = rtl_digest_updateMD5( aDigest, s_nPadString, sizeof( s_nPadString ) );
+ //step 3
+ if( nError == rtl_Digest_E_None )
+ nError = rtl_digest_updateMD5( aDigest, &io_rProperties.DocumentIdentifier[0], sal_Int32(io_rProperties.DocumentIdentifier.size()) );
+ else
+ bSuccess = false;
+
+ sal_uInt8 nMD5Sum[ RTL_DIGEST_LENGTH_MD5 ];
+ rtl_digest_getMD5( aDigest, nMD5Sum, sizeof(nMD5Sum) );
+ //Step 4
+ rtl_cipher_initARCFOUR( aCipher, rtl_Cipher_DirectionEncode,
+ &io_rProperties.EncryptionKey[0], SECUR_128BIT_KEY, NULL, 0 ); //destination data area
+ rtl_cipher_encodeARCFOUR( aCipher, nMD5Sum, sizeof( nMD5Sum ), // the data to be encrypted
+ &io_rProperties.UValue[0], sizeof( nMD5Sum ) ); //encrypted data, stored in class data member
+ //step 5
+ sal_uInt32 i, y;
+ sal_uInt8 nLocalKey[SECUR_128BIT_KEY];
+
+ for( i = 1; i <= 19; i++ ) // do it 19 times, start with 1
+ {
+ for( y = 0; y < sizeof( nLocalKey ) ; y++ )
+ nLocalKey[y] = (sal_uInt8)( io_rProperties.EncryptionKey[y] ^ i );
+
+ rtl_cipher_initARCFOUR( aCipher, rtl_Cipher_DirectionEncode,
+ nLocalKey, SECUR_128BIT_KEY, // key and key length
+ NULL, 0 ); //destination data area, on init can be NULL
+ rtl_cipher_encodeARCFOUR( aCipher, &io_rProperties.UValue[0], SECUR_128BIT_KEY, // the data to be encrypted
+ &io_rProperties.UValue[0], SECUR_128BIT_KEY ); // encrypted data, can be the same as the input, encrypt "in place"
+ }
+ }
+ }
+ else
+ bSuccess = false;
+ }
+ else
+ bSuccess = false;
+
+ if( aDigest )
+ rtl_digest_destroyMD5( aDigest );
+ if( aCipher )
+ rtl_cipher_destroyARCFOUR( aCipher );
+
+ if( ! bSuccess )
+ io_rProperties.UValue.clear();
+ return bSuccess;
+}
+
+/* end i12626 methods */
+
diff --git a/vcl/source/gdi/print2.cxx b/vcl/source/gdi/print2.cxx
index d560b0b6e7cc..5c2a742a10ba 100644
--- a/vcl/source/gdi/print2.cxx
+++ b/vcl/source/gdi/print2.cxx
@@ -404,9 +404,21 @@ static Rectangle ImplCalcActionBounds( const MetaAction& rAct, const OutputDevic
break;
case META_LINE_ACTION:
- aActionBounds = Rectangle( static_cast<const MetaLineAction&>(rAct).GetStartPoint(),
- static_cast<const MetaLineAction&>(rAct).GetEndPoint() );
+ {
+ const MetaLineAction& rMetaLineAction = static_cast<const MetaLineAction&>(rAct);
+ aActionBounds = Rectangle( rMetaLineAction.GetStartPoint(), rMetaLineAction.GetEndPoint() );
+ aActionBounds.Justify();
+ const long nLineWidth(rMetaLineAction.GetLineInfo().GetWidth());
+ if(nLineWidth)
+ {
+ const long nHalfLineWidth((nLineWidth + 1) / 2);
+ aActionBounds.Left() -= nHalfLineWidth;
+ aActionBounds.Top() -= nHalfLineWidth;
+ aActionBounds.Right() += nHalfLineWidth;
+ aActionBounds.Bottom() += nHalfLineWidth;
+ }
break;
+ }
case META_RECT_ACTION:
aActionBounds = static_cast<const MetaRectAction&>(rAct).GetRect();
@@ -446,8 +458,20 @@ static Rectangle ImplCalcActionBounds( const MetaAction& rAct, const OutputDevic
break;
case META_POLYLINE_ACTION:
- aActionBounds = static_cast<const MetaPolyLineAction&>(rAct).GetPolygon().GetBoundRect();
+ {
+ const MetaPolyLineAction& rMetaPolyLineAction = static_cast<const MetaPolyLineAction&>(rAct);
+ aActionBounds = rMetaPolyLineAction.GetPolygon().GetBoundRect();
+ const long nLineWidth(rMetaPolyLineAction.GetLineInfo().GetWidth());
+ if(nLineWidth)
+ {
+ const long nHalfLineWidth((nLineWidth + 1) / 2);
+ aActionBounds.Left() -= nHalfLineWidth;
+ aActionBounds.Top() -= nHalfLineWidth;
+ aActionBounds.Right() += nHalfLineWidth;
+ aActionBounds.Bottom() += nHalfLineWidth;
+ }
break;
+ }
case META_POLYGON_ACTION:
aActionBounds = static_cast<const MetaPolygonAction&>(rAct).GetPolygon().GetBoundRect();
diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx
index 51f33ed17f6c..98eac5e982d3 100755
--- a/vcl/source/gdi/print3.cxx
+++ b/vcl/source/gdi/print3.cxx
@@ -150,6 +150,7 @@ public:
typedef std::hash_map< rtl::OUString, size_t, rtl::OUStringHash > PropertyToIndexMap;
typedef std::hash_map< rtl::OUString, ControlDependency, rtl::OUStringHash > ControlDependencyMap;
+ typedef std::hash_map< rtl::OUString, Sequence< sal_Bool >, rtl::OUStringHash > ChoiceDisableMap;
boost::shared_ptr<Printer> mpPrinter;
Sequence< PropertyValue > maUIOptions;
@@ -158,6 +159,7 @@ public:
PropertyToIndexMap maPropertyToIndex;
Link maOptionChangeHdl;
ControlDependencyMap maControlDependencies;
+ ChoiceDisableMap maChoiceDisableMap;
sal_Bool mbFirstPage;
sal_Bool mbLastPage;
sal_Bool mbReversePageOrder;
@@ -186,17 +188,17 @@ public:
{}
~ImplPrinterControllerData() { delete mpProgress; }
- Size getRealPaperSize( const Size& i_rPageSize ) const
+ Size getRealPaperSize( const Size& i_rPageSize, bool bNoNUP ) const
{
if( maFixedPageSize.Width() > 0 && maFixedPageSize.Height() > 0 )
return maFixedPageSize;
- if( maMultiPage.nRows * maMultiPage.nColumns > 1 )
+ if( maMultiPage.nRows * maMultiPage.nColumns > 1 && ! bNoNUP )
return maMultiPage.aPaperSize;
return i_rPageSize;
}
bool isFixedPageSize() const
{ return maFixedPageSize.Width() != 0 && maFixedPageSize.Height() != 0; }
- PrinterController::PageSize modifyJobSetup( const Sequence< PropertyValue >& i_rProps );
+ PrinterController::PageSize modifyJobSetup( const Sequence< PropertyValue >& i_rProps, bool bNoNUP );
};
PrinterController::PrinterController()
@@ -556,7 +558,7 @@ bool Printer::StartJob( const rtl::OUString& i_rJobName, boost::shared_ptr<vcl::
mnCurPage = 1;
mnCurPrintPage = 1;
mbPrinting = TRUE;
- if( ImplGetSVData()->maGDIData.mbPrinterPullModel )
+ if( GetCapabilities( PRINTER_CAPABILITIES_USEPULLMODEL ) )
{
mbJobActive = TRUE;
// sallayer does all necessary page printing
@@ -765,7 +767,7 @@ bool PrinterController::setupPrinter( Window* i_pParent )
return bRet;
}
-PrinterController::PageSize vcl::ImplPrinterControllerData::modifyJobSetup( const Sequence< PropertyValue >& i_rProps )
+PrinterController::PageSize vcl::ImplPrinterControllerData::modifyJobSetup( const Sequence< PropertyValue >& i_rProps, bool bNoNUP )
{
PrinterController::PageSize aPageSize;
aPageSize.aSize = mpPrinter->GetPaperSize();
@@ -800,7 +802,7 @@ PrinterController::PageSize vcl::ImplPrinterControllerData::modifyJobSetup( cons
if( aSetSize.Width && aSetSize.Height )
{
Size aSetPaperSize( aSetSize.Width, aSetSize.Height );
- Size aRealPaperSize( getRealPaperSize( aSetPaperSize ) );
+ Size aRealPaperSize( getRealPaperSize( aSetPaperSize, bNoNUP ) );
if( aRealPaperSize != aCurSize )
aIsSize = aSetSize;
}
@@ -810,7 +812,7 @@ PrinterController::PageSize vcl::ImplPrinterControllerData::modifyJobSetup( cons
aPageSize.aSize.Width() = aIsSize.Width;
aPageSize.aSize.Height() = aIsSize.Height;
- Size aRealPaperSize( getRealPaperSize( aPageSize.aSize ) );
+ Size aRealPaperSize( getRealPaperSize( aPageSize.aSize, bNoNUP ) );
if( aRealPaperSize != aCurSize )
mpPrinter->SetPaperSizeUser( aRealPaperSize, ! isFixedPageSize() );
}
@@ -876,7 +878,7 @@ PrinterController::PageSize PrinterController::getPageFile( int i_nUnfilteredPag
mpImplData->mpPrinter->SetMapMode( aMapMode );
// modify job setup if necessary
- PrinterController::PageSize aPageSize = mpImplData->modifyJobSetup( aPageParm );
+ PrinterController::PageSize aPageSize = mpImplData->modifyJobSetup( aPageParm, true );
o_rMtf.SetPrefSize( aPageSize.aSize );
o_rMtf.SetPrefMapMode( aMapMode );
@@ -958,7 +960,7 @@ PrinterController::PageSize PrinterController::getFilteredPageFile( int i_nFilte
rMPS.nTopMargin == 0 && rMPS.nBottomMargin == 0 )
{
PrinterController::PageSize aPageSize = getPageFile( i_nFilteredPage, o_rMtf, i_bMayUseCache );
- Size aPaperSize = mpImplData->getRealPaperSize( aPageSize.aSize );
+ Size aPaperSize = mpImplData->getRealPaperSize( aPageSize.aSize, true );
mpImplData->mpPrinter->SetMapMode( MapMode( MAP_100TH_MM ) );
mpImplData->mpPrinter->SetPaperSizeUser( aPaperSize, ! mpImplData->isFixedPageSize() );
if( aPaperSize != aPageSize.aSize )
@@ -980,7 +982,7 @@ PrinterController::PageSize PrinterController::getFilteredPageFile( int i_nFilte
sal_Bool bIsLastPage = mpImplData->mbLastPage;
mpImplData->mbLastPage = sal_False;
- Size aPaperSize( mpImplData->getRealPaperSize( mpImplData->maMultiPage.aPaperSize ) );
+ Size aPaperSize( mpImplData->getRealPaperSize( mpImplData->maMultiPage.aPaperSize, false ) );
// multi page area: page size minus margins + one time spacing right and down
// the added spacing is so each subpage can be calculated including its spacing
@@ -1029,6 +1031,14 @@ PrinterController::PageSize PrinterController::getFilteredPageFile( int i_nFilte
nCellX = (nSubPage / rMPS.nRows);
nCellY = (nSubPage % rMPS.nRows);
break;
+ case PrinterController::RLTB:
+ nCellX = rMPS.nColumns - 1 - (nSubPage % rMPS.nColumns);
+ nCellY = (nSubPage / rMPS.nColumns);
+ break;
+ case PrinterController::TBRL:
+ nCellX = rMPS.nColumns - 1 - (nSubPage / rMPS.nRows);
+ nCellY = (nSubPage % rMPS.nRows);
+ break;
}
// scale the metafile down to a sub page size
double fScaleX = double(aSubPageSize.Width())/double(aPageSize.aSize.Width());
@@ -1338,6 +1348,7 @@ void PrinterController::setUIOptions( const Sequence< beans::PropertyValue >& i_
bool bHaveProperty = false;
rtl::OUString aPropName;
vcl::ImplPrinterControllerData::ControlDependency aDep;
+ Sequence< sal_Bool > aChoicesDisabled;
for( int n = 0; n < aOptProp.getLength(); n++ )
{
const beans::PropertyValue& rEntry( aOptProp[ n ] );
@@ -1365,6 +1376,10 @@ void PrinterController::setUIOptions( const Sequence< beans::PropertyValue >& i_
{
rEntry.Value >>= aDep.mnDependsOnEntry;
}
+ else if( rEntry.Name.equalsAscii( "ChoicesDisabled" ) )
+ {
+ rEntry.Value >>= aChoicesDisabled;
+ }
}
if( bHaveProperty )
{
@@ -1377,6 +1392,8 @@ void PrinterController::setUIOptions( const Sequence< beans::PropertyValue >& i_
}
if( aDep.maDependsOnName.getLength() > 0 )
mpImplData->maControlDependencies[ aPropName ] = aDep;
+ if( aChoicesDisabled.getLength() > 0 )
+ mpImplData->maChoiceDisableMap[ aPropName ] = aChoicesDisabled;
}
}
}
@@ -1452,6 +1469,20 @@ bool PrinterController::isUIOptionEnabled( const rtl::OUString& i_rProperty ) co
return bEnabled;
}
+bool PrinterController::isUIChoiceEnabled( const rtl::OUString& i_rProperty, sal_Int32 i_nValue ) const
+{
+ bool bEnabled = true;
+ ImplPrinterControllerData::ChoiceDisableMap::const_iterator it =
+ mpImplData->maChoiceDisableMap.find( i_rProperty );
+ if(it != mpImplData->maChoiceDisableMap.end() )
+ {
+ const Sequence< sal_Bool >& rDisabled( it->second );
+ if( i_nValue >= 0 && i_nValue < rDisabled.getLength() )
+ bEnabled = ! rDisabled[i_nValue];
+ }
+ return bEnabled;
+}
+
rtl::OUString PrinterController::getDependency( const rtl::OUString& i_rProperty ) const
{
rtl::OUString aDependency;
@@ -1833,14 +1864,20 @@ Any PrinterOptionsHelper::getChoiceControlOpt( const rtl::OUString& i_rTitle,
const Sequence< rtl::OUString >& i_rChoices,
sal_Int32 i_nValue,
const rtl::OUString& i_rType,
+ const Sequence< sal_Bool >& i_rDisabledChoices,
const PrinterOptionsHelper::UIControlOptions& i_rControlOptions
)
{
UIControlOptions aOpt( i_rControlOptions );
sal_Int32 nUsed = aOpt.maAddProps.getLength();
- aOpt.maAddProps.realloc( nUsed + 1 );
+ aOpt.maAddProps.realloc( nUsed + 1 + (i_rDisabledChoices.getLength() ? 1 : 0) );
aOpt.maAddProps[nUsed].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Choices" ) );
aOpt.maAddProps[nUsed].Value = makeAny( i_rChoices );
+ if( i_rDisabledChoices.getLength() )
+ {
+ aOpt.maAddProps[nUsed+1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ChoicesDisabled" ) );
+ aOpt.maAddProps[nUsed+1].Value = makeAny( i_rDisabledChoices );
+ }
PropertyValue aVal;
aVal.Name = i_rProperty;
diff --git a/vcl/source/glyphs/gcach_ftyp.cxx b/vcl/source/glyphs/gcach_ftyp.cxx
index ebdd59f517af..601e46411cd8 100644
--- a/vcl/source/glyphs/gcach_ftyp.cxx
+++ b/vcl/source/glyphs/gcach_ftyp.cxx
@@ -301,6 +301,7 @@ FtFontInfo::FtFontInfo( const ImplDevFontAttributes& rDevFontAttributes,
mnSynthetic( nSynthetic ),
mnFontId( nFontId ),
maDevFontAttributes( rDevFontAttributes ),
+ mpFontCharMap( NULL ),
mpChar2Glyph( NULL ),
mpGlyph2Char( NULL ),
mpExtraKernInfo( pExtraKernInfo )
@@ -318,6 +319,8 @@ FtFontInfo::FtFontInfo( const ImplDevFontAttributes& rDevFontAttributes,
FtFontInfo::~FtFontInfo()
{
+ if( mpFontCharMap )
+ mpFontCharMap->DeReference();
delete mpExtraKernInfo;
delete mpChar2Glyph;
delete mpGlyph2Char;
@@ -520,10 +523,25 @@ void* FreetypeServerFont::GetFtFace() const
FreetypeManager::~FreetypeManager()
{
-// This crashes on Solaris 10
-// TODO: check which versions have this problem
-//
-// FT_Error rcFT = FT_Done_FreeType( aLibFT );
+ // an application about to exit can omit garbage collecting the heap
+ // since it makes things slower and introduces risks if the heap was not perfect
+ // for debugging, for memory grinding or leak checking the env allows to force GC
+ const char* pEnv = getenv( "SAL_FORCE_GC_ON_EXIT" );
+ if( pEnv && (*pEnv != '0') )
+ {
+ // cleanup container of fontinfos
+ for( FontList::const_iterator it = maFontList.begin(); it != maFontList.end(); ++it )
+ {
+ FtFontInfo* pInfo = (*it).second;
+ delete pInfo;
+ }
+ maFontList.clear();
+
+#if 0 // FT_Done_FreeType crashes on Solaris 10
+ // TODO: check which versions have this problem
+ FT_Error rcFT = FT_Done_FreeType( aLibFT );
+#endif
+ }
}
// -----------------------------------------------------------------------
@@ -895,6 +913,9 @@ void FreetypeServerFont::SetFontOptions( const ImplFontOptions& rFontOptions)
}
}
#endif
+
+ if( mnPrioEmbedded <= 0 )
+ mnLoadFlags |= FT_LOAD_NO_BITMAP;
}
// -----------------------------------------------------------------------
@@ -1730,16 +1751,39 @@ bool FreetypeServerFont::GetGlyphBitmap8( int nGlyphIndex, RawBitmap& rRawBitmap
// determine unicode ranges in font
// -----------------------------------------------------------------------
-// TODO: replace with GetFontCharMap()
-bool FreetypeServerFont::GetFontCodeRanges( CmapResult& rResult ) const
+const ImplFontCharMap* FreetypeServerFont::GetImplFontCharMap( void ) const
+{
+ const ImplFontCharMap* pIFCMap = mpFontInfo->GetImplFontCharMap();
+ return pIFCMap;
+}
+
+const ImplFontCharMap* FtFontInfo::GetImplFontCharMap( void )
+{
+ // check if the charmap is already cached
+ if( mpFontCharMap )
+ return mpFontCharMap;
+
+ // get the charmap and cache it
+ CmapResult aCmapResult;
+ bool bOK = GetFontCodeRanges( aCmapResult );
+ if( bOK )
+ mpFontCharMap = new ImplFontCharMap( aCmapResult );
+ else
+ mpFontCharMap = ImplFontCharMap::GetDefaultMap();
+ mpFontCharMap->AddReference();
+ return mpFontCharMap;
+}
+
+// TODO: merge into method GetFontCharMap()
+bool FtFontInfo::GetFontCodeRanges( CmapResult& rResult ) const
{
- rResult.mbSymbolic = mpFontInfo->IsSymbolFont();
+ rResult.mbSymbolic = IsSymbolFont();
// TODO: is the full CmapResult needed on platforms calling this?
if( FT_IS_SFNT( maFaceFT ) )
{
ULONG nLength = 0;
- const unsigned char* pCmap = mpFontInfo->GetTable( "cmap", &nLength );
+ const unsigned char* pCmap = GetTable( "cmap", &nLength );
if( pCmap && (nLength > 0) )
if( ParseCMAP( pCmap, nLength, rResult ) )
return true;
diff --git a/vcl/source/glyphs/gcach_ftyp.hxx b/vcl/source/glyphs/gcach_ftyp.hxx
index 5ebe70bcbdf9..d760ce1d1fed 100644
--- a/vcl/source/glyphs/gcach_ftyp.hxx
+++ b/vcl/source/glyphs/gcach_ftyp.hxx
@@ -94,6 +94,9 @@ public:
int GetGlyphIndex( sal_UCS4 cChar ) const;
void CacheGlyphIndex( sal_UCS4 cChar, int nGI ) const;
+ bool GetFontCodeRanges( CmapResult& ) const;
+ const ImplFontCharMap* GetImplFontCharMap( void );
+
bool HasExtraKerning() const;
int GetExtraKernPairs( ImplKernPairData** ) const;
int GetExtraGlyphKernValue( int nLeftGlyph, int nRightGlyph ) const;
@@ -108,6 +111,8 @@ private:
sal_IntPtr mnFontId;
ImplDevFontAttributes maDevFontAttributes;
+ const ImplFontCharMap* mpFontCharMap;
+
// cache unicode->glyphid mapping because looking it up is expensive
// TODO: change to hash_multimap when a use case requires a m:n mapping
typedef ::std::hash_map<int,int> Int2IntMap;
@@ -181,6 +186,7 @@ public:
virtual bool NeedsArtificialItalic() const { return mbArtItalic; }
virtual void FetchFontMetric( ImplFontMetricData&, long& rFactor ) const;
+ virtual const ImplFontCharMap* GetImplFontCharMap( void ) const;
virtual int GetGlyphIndex( sal_UCS4 ) const;
int GetRawGlyphIndex( sal_UCS4 ) const;
@@ -203,7 +209,6 @@ protected:
int ApplyGlyphTransform( int nGlyphFlags, FT_GlyphRec_*, bool ) const;
virtual void InitGlyphData( int nGlyphIndex, GlyphData& ) const;
- virtual bool GetFontCodeRanges( CmapResult& ) const;
bool ApplyGSUB( const ImplFontSelectData& );
virtual ServerFontLayoutEngine* GetLayoutEngine();
diff --git a/vcl/source/glyphs/glyphcache.cxx b/vcl/source/glyphs/glyphcache.cxx
index 1953ecf553c4..7181db56dd4d 100644
--- a/vcl/source/glyphs/glyphcache.cxx
+++ b/vcl/source/glyphs/glyphcache.cxx
@@ -78,12 +78,18 @@ GlyphCache::~GlyphCache()
void GlyphCache::InvalidateAllGlyphs()
{
-#if 0 // TODO: implement uncaching of all glyph shapes and metrics
- for( FontList::iterator it = maFontList.begin(); it != maFontList.end(); ++it )
- delete const_cast<ServerFont*>( it->second );
- maFontList.clear();
- mpCurrentGCFont = NULL;
-#endif
+ // an application about to exit can omit garbage collecting the heap
+ // since it makes things slower and introduces risks if the heap was not perfect
+ // for debugging, for memory grinding or leak checking the env allows to force GC
+ const char* pEnv = getenv( "SAL_FORCE_GC_ON_EXIT" );
+ if( pEnv && (*pEnv != '0') )
+ {
+ // uncache of all glyph shapes and metrics
+ for( FontList::iterator it = maFontList.begin(); it != maFontList.end(); ++it )
+ delete const_cast<ServerFont*>( it->second );
+ maFontList.clear();
+ mpCurrentGCFont = NULL;
+ }
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/glyphs/graphite_cache.cxx b/vcl/source/glyphs/graphite_cache.cxx
index 389accd631f0..7682cdb6c8ba 100644
--- a/vcl/source/glyphs/graphite_cache.cxx
+++ b/vcl/source/glyphs/graphite_cache.cxx
@@ -36,10 +36,10 @@
#include <tools/debug.hxx>
#include <vcl/sallayout.hxx>
-#include <tools/preextstl.h>
+#include <preextstl.h>
#include <graphite/GrClient.h>
#include <graphite/Segment.h>
-#include <tools/postextstl.h>
+#include <postextstl.h>
#include <rtl/ustring.hxx>
#include <vcl/graphite_layout.hxx>
diff --git a/vcl/source/glyphs/graphite_layout.cxx b/vcl/source/glyphs/graphite_layout.cxx
index 0f7d2f5f3005..8a011606ab41 100644
--- a/vcl/source/glyphs/graphite_layout.cxx
+++ b/vcl/source/glyphs/graphite_layout.cxx
@@ -67,13 +67,13 @@
#include <unicode/uscript.h>
// Graphite Libraries (must be after vcl headers on windows)
-#include <tools/preextstl.h>
+#include <preextstl.h>
#include <graphite/GrClient.h>
#include <graphite/Font.h>
#include <graphite/ITextSource.h>
#include <graphite/Segment.h>
#include <graphite/SegmentPainter.h>
-#include <tools/postextstl.h>
+#include <postextstl.h>
#include <vcl/graphite_layout.hxx>
#include <vcl/graphite_features.hxx>
@@ -1048,13 +1048,13 @@ void GraphiteLayout::expandOrCondense(ImplLayoutArgs &rArgs)
{
if (mvGlyphs[i].IsClusterStart())
{
- nOffset = fExtraPerCluster * nCluster;
+ nOffset = FRound( fExtraPerCluster * nCluster );
size_t nCharIndex = mvGlyph2Char[i];
mvCharDxs[nCharIndex] += nOffset;
// adjust char dxs for rest of characters in cluster
while (++nCharIndex < mvGlyph2Char.size())
{
- int nChar2Base = (mvChar2BaseGlyph[nCharIndex] == -1)? -1 : mvChar2BaseGlyph[nCharIndex] & GLYPH_INDEX_MASK;
+ int nChar2Base = (mvChar2BaseGlyph[nCharIndex] == -1)? -1 : (int)(mvChar2BaseGlyph[nCharIndex] & GLYPH_INDEX_MASK);
if (nChar2Base == -1 || nChar2Base == static_cast<int>(i))
mvCharDxs[nCharIndex] += nOffset;
}
@@ -1077,14 +1077,15 @@ void GraphiteLayout::expandOrCondense(ImplLayoutArgs &rArgs)
Glyphs::iterator iGlyph = mvGlyphs.begin();
while (iGlyph != iLastGlyph)
{
- iGlyph->maLinearPos.X() = static_cast<float>(iGlyph->maLinearPos.X()) * fXFactor;
+ iGlyph->maLinearPos.X() = FRound( fXFactor * iGlyph->maLinearPos.X() );
++iGlyph;
}
for (size_t i = 0; i < mvCharDxs.size(); i++)
{
- mvCharDxs[i] = fXFactor * static_cast<float>(mvCharDxs[i]);
+ mvCharDxs[i] = FRound( fXFactor * mvCharDxs[i] );
}
}
+ mnWidth = rArgs.mnLayoutWidth;
}
void GraphiteLayout::ApplyDXArray(ImplLayoutArgs &args, std::vector<int> & rDeltaWidth)
@@ -1107,7 +1108,7 @@ void GraphiteLayout::ApplyDXArray(ImplLayoutArgs &args, std::vector<int> & rDelt
int nPrevClusterLastChar = -1;
for (size_t i = 0; i < nChars; i++)
{
- int nChar2Base = (mvChar2BaseGlyph[i] == -1)? -1 : mvChar2BaseGlyph[i] & GLYPH_INDEX_MASK;
+ int nChar2Base = (mvChar2BaseGlyph[i] == -1)? -1 : (int)(mvChar2BaseGlyph[i] & GLYPH_INDEX_MASK);
if ((nChar2Base > -1) && (nChar2Base != nPrevClusterGlyph))
{
assert((nChar2Base > -1) && (nChar2Base < (signed)mvGlyphs.size()));
@@ -1121,11 +1122,11 @@ void GraphiteLayout::ApplyDXArray(ImplLayoutArgs &args, std::vector<int> & rDelt
int nLastGlyph = nChar2Base;
for (; j < nChars; j++)
{
- int nChar2BaseJ = (mvChar2BaseGlyph[j] == -1)? -1 : mvChar2BaseGlyph[j] & GLYPH_INDEX_MASK;
+ int nChar2BaseJ = (mvChar2BaseGlyph[j] == -1)? -1 : (int)(mvChar2BaseGlyph[j] & GLYPH_INDEX_MASK);
assert((nChar2BaseJ >= -1) && (nChar2BaseJ < (signed)mvGlyphs.size()));
if (nChar2BaseJ != -1 && mvGlyphs[nChar2BaseJ].IsClusterStart())
{
- nLastGlyph = nChar2BaseJ + ((bRtl)? 1 : -1);
+ nLastGlyph = nChar2BaseJ + ((bRtl)? +1 : -1);
nLastChar = j - 1;
break;
}
diff --git a/vcl/source/glyphs/graphite_textsrc.hxx b/vcl/source/glyphs/graphite_textsrc.hxx
index 3912977cc9be..388f8a631b49 100644
--- a/vcl/source/glyphs/graphite_textsrc.hxx
+++ b/vcl/source/glyphs/graphite_textsrc.hxx
@@ -59,11 +59,11 @@
#include "vcl/dllapi.h"
// Libraries
-#include <tools/preextstl.h>
+#include <preextstl.h>
#include <graphite/GrClient.h>
#include <graphite/Font.h>
#include <graphite/ITextSource.h>
-#include <tools/postextstl.h>
+#include <postextstl.h>
// Module type definitions and forward declarations.
//
diff --git a/vcl/source/helper/makefile.mk b/vcl/source/helper/makefile.mk
index e708bdec9eaa..1a417417dbe4 100644
--- a/vcl/source/helper/makefile.mk
+++ b/vcl/source/helper/makefile.mk
@@ -46,7 +46,6 @@ SLOFILES=\
$(SLO)$/canvastools.obj \
$(SLO)$/xconnection.obj \
$(SLO)$/threadex.obj \
- $(SLO)$/smartid.obj \
$(SLO)$/lazydelete.obj
# --- Targets ------------------------------------------------------
diff --git a/vcl/source/helper/smartid.cxx b/vcl/source/helper/smartid.cxx
deleted file mode 100755
index c367aeb2bce5..000000000000
--- a/vcl/source/helper/smartid.cxx
+++ /dev/null
@@ -1,264 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_vcl.hxx"
-#include <vcl/smartid.hxx>
-
-struct ImplSmartIdData
-{
- String aUId;
- ULONG nUId;
- BOOL bHasStringId;
- BOOL bHasNumericId;
-};
-
-
-ImplSmartIdData* SmartId::GetSmartIdData()
-{
- if ( !mpData )
- {
- mpData = new ImplSmartIdData;
-// mpData->aUId = "";
- mpData->nUId = 0;
- mpData->bHasStringId = FALSE;
- mpData->bHasNumericId = FALSE;
- }
- return mpData;
-}
-
-
-SmartId::SmartId( const String& rId )
-: mpData( NULL )
-{
- GetSmartIdData()->aUId = rId;
- GetSmartIdData()->bHasStringId = TRUE;
-}
-
-SmartId::SmartId( ULONG nId )
-: mpData( NULL )
-{
- GetSmartIdData()->nUId = nId;
- GetSmartIdData()->bHasNumericId = TRUE;
-}
-
-SmartId::SmartId( const String& rId, ULONG nId )
-: mpData( NULL )
-{
- GetSmartIdData()->aUId = rId;
- GetSmartIdData()->bHasStringId = TRUE;
- GetSmartIdData()->nUId = nId;
- GetSmartIdData()->bHasNumericId = TRUE;
-}
-
-SmartId::SmartId()
-: mpData( NULL )
-{}
-
-SmartId::SmartId( const SmartId& rId )
-: mpData( NULL )
-{
- if ( rId.mpData )
- {
- GetSmartIdData();
- mpData->aUId = rId.mpData->aUId;
- mpData->bHasStringId = rId.mpData->bHasStringId;
- mpData->nUId = rId.mpData->nUId;
- mpData->bHasNumericId = rId.mpData->bHasNumericId;
- }
-}
-
-SmartId& SmartId::operator = ( const SmartId& rId )
-{
- if ( rId.mpData )
- GetSmartIdData();
- else
- {
- delete mpData;
- mpData = NULL;
- }
- if ( mpData && rId.mpData )
- {
- mpData->aUId = rId.mpData->aUId;
- mpData->bHasStringId = rId.mpData->bHasStringId;
- mpData->nUId = rId.mpData->nUId;
- mpData->bHasNumericId = rId.mpData->bHasNumericId;
- }
- return *this;
-}
-
-SmartId::~SmartId()
-{
- if ( mpData )
- delete mpData;
-#ifdef DBG_UTIL
- if ( mpData )
- mpData = (ImplSmartIdData*)0xDeadBeef;
-#endif
-}
-
-void SmartId::UpdateId( const SmartId& rId, SmartIdUpdateMode aMode )
-{
- // Check if ImplData is needed
- if ( aMode != SMART_SET_SMART || ( rId.HasString() || rId.HasNumeric() ) )
- GetSmartIdData();
-
- if ( aMode == SMART_SET_STR || aMode == SMART_SET_ALL || ( aMode == SMART_SET_SMART && rId.HasString() ) )
- {
- GetSmartIdData()->aUId = rId.GetStr();
- GetSmartIdData()->bHasStringId = rId.HasString();
- }
- if ( aMode == SMART_SET_NUM || aMode == SMART_SET_ALL || ( aMode == SMART_SET_SMART && rId.HasNumeric() ) )
- {
- GetSmartIdData()->nUId = rId.GetNum();
- GetSmartIdData()->bHasNumericId = rId.HasNumeric();
- }
-
- // remove ImplData when no IDs are set. This is Important because Implementation of Equals() Matches and HasAny relies on it
- if ( mpData && !mpData->bHasStringId && !mpData->bHasNumericId )
- {
- delete mpData;
- mpData = NULL;
- }
-}
-
-BOOL SmartId::HasNumeric() const
-{
- if ( !mpData )
- return FALSE;
- else
- return mpData->bHasNumericId;
-}
-
-BOOL SmartId::HasString() const
-{
- if ( !mpData )
- return FALSE;
- else
- return mpData->bHasStringId;
-}
-
-BOOL SmartId::HasAny() const
-{
- return mpData != NULL;
-}
-
-ULONG SmartId::GetNum() const
-{
- if ( !mpData )
- return 0;
- else
- return mpData->nUId;
-}
-
-String SmartId::GetStr() const
-{
- if ( !mpData )
- return String();
- else
- return mpData->aUId;
-}
-
-
-String SmartId::GetText() const // return String for UI usage
-{
- String aRes;
- if ( HasNumeric() )
- aRes = String::CreateFromInt64( GetNum() );
- if ( HasString() )
- {
- if ( HasNumeric() )
- aRes.AppendAscii( "/" );
- aRes.Append( GetStr() );
- }
- return aRes;
-}
-
-BOOL SmartId::Matches( const String &rId )const
-{
- if ( HasString() )
- return GetStr().EqualsIgnoreCaseAscii( rId );
- else
- return FALSE;
-}
-
-BOOL SmartId::Matches( const ULONG nId ) const
-{
- if ( HasNumeric() )
- return GetNum() == nId;
- else
- return FALSE;
-}
-
-/******************************************************************************
-If Both Ids have nither Strings nor Numbers they don't match
-If both Ids have Strings the result of Matching these is returned.
-Numbers are then Ignored.
-Else Matching Numbers is attempted.
-******************************************************************************/
-BOOL SmartId::Matches( const SmartId &rId ) const
-{
- if ( !mpData || !rId.mpData )
- return FALSE;
- else if ( HasString() && rId.HasString() )
- return Matches( rId.GetStr() );
- else
- return rId.HasNumeric() && Matches( rId.GetNum() );
-}
-
-BOOL SmartId::Equals( const SmartId &rId ) const
-{
- if ( mpData && rId.mpData )
- return mpData->aUId.EqualsIgnoreCaseAscii( rId.mpData->aUId )
- && mpData->bHasStringId == rId.mpData->bHasStringId
- && mpData->nUId == rId.mpData->nUId
- && mpData->bHasNumericId == rId.mpData->bHasNumericId;
- else if ( !mpData && !rId.mpData )
- return TRUE;
- else
- return FALSE;
-}
-
-BOOL SmartId::operator == ( const SmartId& rRight ) const
-{
- return Equals( rRight );
-}
-
-BOOL SmartId::operator < ( const SmartId& rRight ) const
-{
- if ( HasString() && rRight.HasString() && GetStr() != rRight.GetStr() )
- return GetStr() < rRight.GetStr();
- else if ( HasNumeric() && rRight.HasNumeric() && GetNum() != rRight.GetNum() )
- return GetNum() < rRight.GetNum();
- else
- { // Sort Strings to Front
- if ( HasString() )
- return rRight.HasString() && rRight.HasNumeric();
- else
- return rRight.HasString() || (!HasNumeric() && rRight.HasNumeric());
- }
-}
diff --git a/vcl/source/helper/strhelper.cxx b/vcl/source/helper/strhelper.cxx
index db622073cea9..67f50b69a182 100644
--- a/vcl/source/helper/strhelper.cxx
+++ b/vcl/source/helper/strhelper.cxx
@@ -365,8 +365,8 @@ String WhitespaceToSpace( const String& rLine, BOOL bProtect )
else
{
*pLeap = *pRun;
- *pLeap++;
- *pRun++;
+ ++pLeap;
+ ++pRun;
}
}
}
@@ -422,8 +422,8 @@ ByteString WhitespaceToSpace( const ByteString& rLine, BOOL bProtect )
else
{
*pLeap = *pRun;
- *pLeap++;
- *pRun++;
+ ++pLeap;
+ ++pRun;
}
}
}
diff --git a/vcl/source/src/print.src b/vcl/source/src/print.src
index 58f0a477c848..436ab40bdc5f 100644
--- a/vcl/source/src/print.src
+++ b/vcl/source/src/print.src
@@ -29,6 +29,7 @@
ModalDialog SV_DLG_PRINT
{
+ HelpID = "vcl:ModalDialog:SV_DLG_PRINT";
Text [en-US] = "Print";
Closeable = TRUE;
Sizeable = TRUE;
@@ -64,6 +65,7 @@ ModalDialog SV_DLG_PRINT
};
NumericField SV_PRINT_PAGE_EDIT
{
+ HelpID = "vcl:NumericField:SV_DLG_PRINT:SV_PRINT_PAGE_EDIT";
Pos = MAP_APPFONT( 5, 140 );
Size = MAP_APPFONT( 30, 12 );
SVLook = TRUE;
@@ -80,18 +82,21 @@ ModalDialog SV_DLG_PRINT
};
PushButton SV_PRINT_PAGE_FORWARD
{
+ HelpID = "vcl:PushButton:SV_DLG_PRINT:SV_PRINT_PAGE_FORWARD";
Pos = MAP_APPFONT( 95, 140 );
Size = MAP_APPFONT( 15, 12 );
HelpText [en-US] = "Scroll one page forward.";
};
PushButton SV_PRINT_PAGE_BACKWARD
{
+ HelpID = "vcl:PushButton:SV_DLG_PRINT:SV_PRINT_PAGE_BACKWARD";
Pos = MAP_APPFONT( 80, 140 );
Size = MAP_APPFONT( 15, 12 );
HelpText [en-US] = "Scroll one page backward.";
};
TabControl SV_PRINT_TABCTRL
{
+ HelpID = "vcl:TabControl:SV_DLG_PRINT:SV_PRINT_TABCTRL";
Pos = MAP_APPFONT( 140, 5 );
Size = MAP_APPFONT( 205, 175 );
};
@@ -123,6 +128,7 @@ ModalDialog SV_DLG_PRINT
TabPage SV_PRINT_TAB_NUP
{
+ HelpID = "vcl:TabPage:SV_PRINT_TAB_NUP";
Text [en-US] = "Page Layout";
Hide = TRUE;
@@ -134,6 +140,7 @@ ModalDialog SV_DLG_PRINT
};
RadioButton SV_PRINT_PRT_NUP_DEFAULT_BTN
{
+ HelpID = "vcl:RadioButton:SV_PRINT_TAB_NUP:SV_PRINT_PRT_NUP_DEFAULT_BTN";
Pos = MAP_APPFONT( 0, 0 );
Size = MAP_APPFONT( 10, 10 );
Text [en-US] = "~Default";
@@ -141,12 +148,14 @@ ModalDialog SV_DLG_PRINT
};
RadioButton SV_PRINT_PRT_NUP_BROCHURE_BTN
{
+ HelpID = "vcl:RadioButton:SV_PRINT_TAB_NUP:SV_PRINT_PRT_NUP_BROCHURE_BTN";
Pos = MAP_APPFONT( 0, 0 );
Size = MAP_APPFONT( 10, 10 );
Text = "";
};
RadioButton SV_PRINT_PRT_NUP_PAGES_BTN
{
+ HelpID = "vcl:RadioButton:SV_PRINT_TAB_NUP:SV_PRINT_PRT_NUP_PAGES_BTN";
Pos = MAP_APPFONT( 0, 0 );
Size = MAP_APPFONT( 10, 10 );
Text [en-US] = "Pa~ges per sheet";
@@ -154,6 +163,7 @@ ModalDialog SV_DLG_PRINT
};
ListBox SV_PRINT_PRT_NUP_PAGES_BOX
{
+ HelpID = "vcl:ListBox:SV_PRINT_TAB_NUP:SV_PRINT_PRT_NUP_PAGES_BOX";
Pos = MAP_APPFONT( 0, 0 );
Size = MAP_APPFONT( 10, 80 );
Border = TRUE;
@@ -180,6 +190,7 @@ ModalDialog SV_DLG_PRINT
};
NumericField SV_PRINT_PRT_NUP_COLS_EDT
{
+ HelpID = "vcl:NumericField:SV_PRINT_TAB_NUP:SV_PRINT_PRT_NUP_COLS_EDT";
Pos = MAP_APPFONT( 55, 20 );
Size = MAP_APPFONT( 40, 12 );
Border = TRUE;
@@ -198,6 +209,7 @@ ModalDialog SV_DLG_PRINT
};
NumericField SV_PRINT_PRT_NUP_ROWS_EDT
{
+ HelpID = "vcl:NumericField:SV_PRINT_TAB_NUP:SV_PRINT_PRT_NUP_ROWS_EDT";
Pos = MAP_APPFONT( 55, 35 );
Size = MAP_APPFONT( 40, 12 );
Border = TRUE;
@@ -215,6 +227,7 @@ ModalDialog SV_DLG_PRINT
};
MetricField SV_PRINT_PRT_NUP_MARGINS_PAGES_EDT
{
+ HelpID = "vcl:MetricField:SV_PRINT_TAB_NUP:SV_PRINT_PRT_NUP_MARGINS_PAGES_EDT";
Pos = MAP_APPFONT( 55, 95 );
Size = MAP_APPFONT( 40, 12 );
Spin = TRUE;
@@ -237,6 +250,7 @@ ModalDialog SV_DLG_PRINT
};
MetricField SV_PRINT_PRT_NUP_MARGINS_SHEET_EDT
{
+ HelpID = "vcl:MetricField:SV_PRINT_TAB_NUP:SV_PRINT_PRT_NUP_MARGINS_SHEET_EDT";
Pos = MAP_APPFONT( 155, 95 );
Size = MAP_APPFONT( 40, 12 );
Spin = TRUE;
@@ -259,6 +273,7 @@ ModalDialog SV_DLG_PRINT
};
ListBox SV_PRINT_PRT_NUP_ORIENTATION_BOX
{
+ HelpID = "vcl:ListBox:SV_PRINT_TAB_NUP:SV_PRINT_PRT_NUP_ORIENTATION_BOX";
Pos = MAP_APPFONT( 0, 0 );
Size = MAP_APPFONT( 10, 40 );
Border = TRUE;
@@ -280,20 +295,24 @@ ModalDialog SV_DLG_PRINT
};
ListBox SV_PRINT_PRT_NUP_ORDER_BOX
{
+ HelpID = "vcl:ListBox:SV_PRINT_TAB_NUP:SV_PRINT_PRT_NUP_ORDER_BOX";
Pos = MAP_APPFONT( 0, 0 );
- Size = MAP_APPFONT( 10, 20 );
+ Size = MAP_APPFONT( 10, 50 );
DropDown = TRUE;
Border = TRUE;
CurPos = 0;
StringList [en-US] =
{
- < "left to right, then down"; SV_PRINT_PRT_NUP_ORDER_LRTD; >;
- < "top to bottom, then right"; SV_PRINT_PRT_NUP_ORDER_TDLR; >;
+ < "left to right, then down"; SV_PRINT_PRT_NUP_ORDER_LRTB; >;
+ < "top to bottom, then right"; SV_PRINT_PRT_NUP_ORDER_TBLR; >;
+ < "top to bottom, then left"; SV_PRINT_PRT_NUP_ORDER_TBRL; >;
+ < "right to left, then down"; SV_PRINT_PRT_NUP_ORDER_RLTB; >;
};
HelpText [en-US] = "Select order in which pages are to be printed.";
};
CheckBox SV_PRINT_PRT_NUP_BORDER_CB
{
+ HelpID = "vcl:CheckBox:SV_PRINT_TAB_NUP:SV_PRINT_PRT_NUP_BORDER_CB";
Pos = MAP_APPFONT( 10, 65 );
Size = MAP_APPFONT( 150, 12 );
Text [en-US] = "Draw a border around each page";
@@ -303,6 +322,7 @@ ModalDialog SV_DLG_PRINT
TabPage SV_PRINT_TAB_JOB
{
+ HelpID = "vcl:TabPage:SV_PRINT_TAB_JOB";
Text [en-US] = "General";
Hide = TRUE;
@@ -314,6 +334,7 @@ ModalDialog SV_DLG_PRINT
};
ListBox SV_PRINT_PRINTERS
{
+ HelpID = "vcl:ListBox:SV_PRINT_TAB_JOB:SV_PRINT_PRINTERS";
Pos = MAP_APPFONT( 5, 5 );
Size = MAP_APPFONT( 100, 80 );
Border = TRUE;
@@ -322,6 +343,7 @@ ModalDialog SV_DLG_PRINT
};
CheckBox SV_PRINT_DETAILS_BTN
{
+ HelpID = "vcl:CheckBox:SV_PRINT_TAB_JOB:SV_PRINT_DETAILS_BTN";
Pos = MAP_APPFONT( 5, 5 );
Size = MAP_APPFONT( 5, 5 );
Text [en-US] = "Details";
@@ -347,6 +369,7 @@ ModalDialog SV_DLG_PRINT
};
PushButton SV_PRINT_PRT_SETUP
{
+ HelpID = "vcl:PushButton:SV_PRINT_TAB_JOB:SV_PRINT_PRT_SETUP";
Pos = MAP_APPFONT( 115, 5 );
Size = MAP_APPFONT( 50, 15 );
Text [en-US] = "Properties...";
@@ -366,6 +389,7 @@ ModalDialog SV_DLG_PRINT
};
NumericField SV_PRINT_COPYCOUNT_FIELD
{
+ HelpID = "vcl:NumericField:SV_PRINT_TAB_JOB:SV_PRINT_COPYCOUNT_FIELD";
Pos = MAP_APPFONT( 10, 56 );
Size = MAP_APPFONT( 40, 12 );
Border = TRUE;
@@ -382,6 +406,7 @@ ModalDialog SV_DLG_PRINT
};
CheckBox SV_PRINT_COLLATE
{
+ HelpID = "vcl:CheckBox:SV_PRINT_TAB_JOB:SV_PRINT_COLLATE";
Pos = MAP_APPFONT( 95, 45 );
Size = MAP_APPFONT( 70, 10 );
Text [en-US] = "Collate";
@@ -411,6 +436,7 @@ ModalDialog SV_DLG_PRINT
TabPage SV_PRINT_TAB_OPT
{
+ HelpID = "vcl:TabPage:SV_PRINT_TAB_OPT";
Text [en-US] = "Options";
Hide = TRUE;
@@ -422,6 +448,7 @@ ModalDialog SV_DLG_PRINT
};
CheckBox SV_PRINT_OPT_TOFILE
{
+ HelpID = "vcl:CheckBox:SV_PRINT_TAB_OPT:SV_PRINT_OPT_TOFILE";
Pos = MAP_APPFONT( 10, 20 );
Size = MAP_APPFONT( 200, 12 );
Text [en-US] = "Print to ~file";
@@ -429,6 +456,7 @@ ModalDialog SV_DLG_PRINT
};
CheckBox SV_PRINT_OPT_SINGLEJOBS
{
+ HelpID = "vcl:CheckBox:SV_PRINT_TAB_OPT:SV_PRINT_OPT_SINGLEJOBS";
Pos = MAP_APPFONT( 10, 35 );
Size = MAP_APPFONT( 200, 12 );
Text [en-US] = "~Create single print jobs for collated output";
@@ -436,6 +464,7 @@ ModalDialog SV_DLG_PRINT
};
CheckBox SV_PRINT_OPT_REVERSE
{
+ HelpID = "vcl:CheckBox:SV_PRINT_TAB_OPT:SV_PRINT_OPT_REVERSE";
Pos = MAP_APPFONT( 10, 50 );
Size = MAP_APPFONT( 200, 12 );
Text [en-US] = "Print in ~reverse page order";
@@ -446,6 +475,7 @@ ModalDialog SV_DLG_PRINT
ModelessDialog SV_DLG_PRINT_PROGRESS
{
+ HelpID = "vcl:ModelessDialog:SV_DLG_PRINT_PROGRESS";
Text [en-US] = "Printing";
Closeable = FALSE;
Sizeable = FALSE;
@@ -488,5 +518,6 @@ StringArray SV_PRINT_NATIVE_STRINGS
< "Page number"; >;
< "Number of pages"; >;
< "More"; >;
+ < "Print selection only"; >;
};
};
diff --git a/vcl/source/src/stdtext.src b/vcl/source/src/stdtext.src
index 2c6574220a5f..1b95f7bb1d72 100644
--- a/vcl/source/src/stdtext.src
+++ b/vcl/source/src/stdtext.src
@@ -101,6 +101,11 @@ String SV_ACCESSERROR_TURNAROUND_MSG
Text [ en-US ] = "The Java Access Bridge could not be started.";
};
+String SV_ACCESSERROR_NO_FONTS
+{
+ Text [ en-US ] = "No fonts could be found on the system.";
+};
+
String SV_STDTEXT_ABOUT
{
Text [ en-US ] = "About %PRODUCTNAME";
diff --git a/vcl/source/window/arrange.cxx b/vcl/source/window/arrange.cxx
index dad48235f8fb..f016ef2c053b 100644
--- a/vcl/source/window/arrange.cxx
+++ b/vcl/source/window/arrange.cxx
@@ -29,15 +29,37 @@
#include "vcl/arrange.hxx"
#include "vcl/edit.hxx"
+#include "vcl/svdata.hxx"
+#include "vcl/svapp.hxx"
+
+#include "com/sun/star/beans/PropertyValue.hpp"
+#include "com/sun/star/awt/Rectangle.hpp"
#include "osl/diagnose.h"
using namespace vcl;
+using namespace com::sun::star;
// ----------------------------------------
// vcl::WindowArranger
//-----------------------------------------
+long WindowArranger::getDefaultBorder()
+{
+ ImplSVData* pSVData = ImplGetSVData();
+ long nResult = pSVData->maAppData.mnDefaultLayoutBorder;
+ if( nResult < 0 )
+ {
+ OutputDevice* pDefDev = Application::GetDefaultDevice();
+ if( pDefDev )
+ {
+ Size aBorder( pDefDev->LogicToPixel( Size( 3, 3 ), MapMode( MAP_APPFONT ) ) );
+ nResult = pSVData->maAppData.mnDefaultLayoutBorder = aBorder.Height();
+ }
+ }
+ return nResult > 0 ? nResult : 0;
+}
+
WindowArranger::~WindowArranger()
{}
@@ -156,16 +178,26 @@ Size WindowArranger::Element::getOptimalSize( WindowSizeType i_eType ) const
Size aResult;
if( ! m_bHidden )
{
+ bool bVisible = false;
if( m_pElement && m_pElement->IsVisible() )
+ {
aResult = m_pElement->GetOptimalSize( i_eType );
- else if( m_pChild )
+ bVisible = true;
+ }
+ else if( m_pChild && m_pChild->isVisible() )
+ {
aResult = m_pChild->getOptimalSize( i_eType );
- if( aResult.Width() < m_aMinSize.Width() )
- aResult.Width() = m_aMinSize.Width();
- if( aResult.Height() < m_aMinSize.Height() )
- aResult.Height() = m_aMinSize.Height();
- aResult.Width() += m_nLeftBorder + m_nRightBorder;
- aResult.Height() += m_nTopBorder + m_nBottomBorder;
+ bVisible = true;
+ }
+ if( bVisible )
+ {
+ if( aResult.Width() < m_aMinSize.Width() )
+ aResult.Width() = m_aMinSize.Width();
+ if( aResult.Height() < m_aMinSize.Height() )
+ aResult.Height() = m_aMinSize.Height();
+ aResult.Width() += getBorderValue( m_nLeftBorder ) + getBorderValue( m_nRightBorder );
+ aResult.Height() += getBorderValue( m_nTopBorder ) + getBorderValue( m_nBottomBorder );
+ }
}
return aResult;
@@ -175,16 +207,74 @@ void WindowArranger::Element::setPosSize( const Point& i_rPos, const Size& i_rSi
{
Point aPoint( i_rPos );
Size aSize( i_rSize );
- aPoint.X() += m_nLeftBorder;
- aPoint.Y() += m_nTopBorder;
- aSize.Width() -= m_nLeftBorder + m_nRightBorder;
- aSize.Height() -= m_nTopBorder + m_nBottomBorder;
+ aPoint.X() += getBorderValue( m_nLeftBorder );
+ aPoint.Y() += getBorderValue( m_nTopBorder );
+ aSize.Width() -= getBorderValue( m_nLeftBorder ) + getBorderValue( m_nRightBorder );
+ aSize.Height() -= getBorderValue( m_nTopBorder ) + getBorderValue( m_nBottomBorder );
if( m_pElement )
m_pElement->SetPosSizePixel( aPoint, aSize );
else if( m_pChild )
m_pChild->setManagedArea( Rectangle( aPoint, aSize ) );
}
+uno::Sequence< beans::PropertyValue > WindowArranger::getProperties() const
+{
+ uno::Sequence< beans::PropertyValue > aRet( 3 );
+ aRet[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OuterBorder" ) );
+ aRet[0].Value = uno::makeAny( sal_Int32( getBorderValue( m_nOuterBorder ) ) );
+ aRet[1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ManagedArea" ) );
+ awt::Rectangle aArea( m_aManagedArea.getX(), m_aManagedArea.getY(), m_aManagedArea.getWidth(), m_aManagedArea.getHeight() );
+ aRet[1].Value = uno::makeAny( aArea );
+ aRet[2].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Visible" ) );
+ aRet[2].Value = uno::makeAny( sal_Bool( isVisible() ) );
+ return aRet;
+}
+
+void WindowArranger::setProperties( const uno::Sequence< beans::PropertyValue >& i_rProps )
+{
+ const beans::PropertyValue* pProps = i_rProps.getConstArray();
+ bool bResize = false;
+ for( sal_Int32 i = 0; i < i_rProps.getLength(); i++ )
+ {
+ if( pProps[i].Name.equalsAscii( "OuterBorder" ) )
+ {
+ sal_Int32 nVal = 0;
+ if( pProps[i].Value >>= nVal )
+ {
+ if( getBorderValue( m_nOuterBorder ) != nVal )
+ {
+ m_nOuterBorder = nVal;
+ bResize = true;
+ }
+ }
+ }
+ else if( pProps[i].Name.equalsAscii( "ManagedArea" ) )
+ {
+ awt::Rectangle aArea( 0, 0, 0, 0 );
+ if( pProps[i].Value >>= aArea )
+ {
+ m_aManagedArea.setX( aArea.X );
+ m_aManagedArea.setY( aArea.Y );
+ m_aManagedArea.setWidth( aArea.Width );
+ m_aManagedArea.setHeight( aArea.Height );
+ bResize = true;
+ }
+ }
+ else if( pProps[i].Name.equalsAscii( "Visible" ) )
+ {
+ sal_Bool bVal = sal_False;
+ if( pProps[i].Value >>= bVal )
+ {
+ show( bVal, false );
+ bResize = true;
+ }
+ }
+ }
+ if( bResize )
+ resize();
+}
+
+
// ----------------------------------------
// vcl::RowOrColumn
//-----------------------------------------
@@ -201,6 +291,7 @@ RowOrColumn::~RowOrColumn()
Size RowOrColumn::getOptimalSize( WindowSizeType i_eType ) const
{
Size aRet( 0, 0 );
+ long nDistance = getBorderValue( m_nBorderWidth );
for( std::vector< WindowArranger::Element >::const_iterator it = m_aElements.begin();
it != m_aElements.end(); ++it )
{
@@ -211,7 +302,7 @@ Size RowOrColumn::getOptimalSize( WindowSizeType i_eType ) const
if( m_bColumn )
{
// add the distance between elements
- aRet.Height() += m_nBorderWidth;
+ aRet.Height() += nDistance;
// check if the width needs adjustment
if( aRet.Width() < aElementSize.Width() )
aRet.Width() = aElementSize.Width();
@@ -220,7 +311,7 @@ Size RowOrColumn::getOptimalSize( WindowSizeType i_eType ) const
else
{
// add the distance between elements
- aRet.Width() += m_nBorderWidth;
+ aRet.Width() += nDistance;
// check if the height needs adjustment
if( aRet.Height() < aElementSize.Height() )
aRet.Height() = aElementSize.Height();
@@ -233,13 +324,14 @@ Size RowOrColumn::getOptimalSize( WindowSizeType i_eType ) const
{
// subtract the border for the first element
if( m_bColumn )
- aRet.Height() -= m_nBorderWidth;
+ aRet.Height() -= nDistance;
else
- aRet.Width() -= m_nBorderWidth;
+ aRet.Width() -= nDistance;
// add the outer border
- aRet.Width() += 2*m_nOuterBorder;
- aRet.Height() += 2*m_nOuterBorder;
+ long nOuterBorder = getBorderValue( m_nOuterBorder );
+ aRet.Width() += 2*nOuterBorder;
+ aRet.Height() += 2*nOuterBorder;
}
return aRet;
@@ -344,7 +436,9 @@ void RowOrColumn::resize()
size_t nElements = m_aElements.size();
// get all element sizes for sizing
std::vector<Size> aElementSizes( nElements );
- long nUsedWidth = 2*m_nOuterBorder - (nElements ? m_nBorderWidth : 0);
+ long nDistance = getBorderValue( m_nBorderWidth );
+ long nOuterBorder = getBorderValue( m_nOuterBorder );
+ long nUsedWidth = 2*nOuterBorder - (nElements ? nDistance : 0);
for( size_t i = 0; i < nElements; i++ )
{
if( m_aElements[i].isVisible() )
@@ -352,13 +446,13 @@ void RowOrColumn::resize()
aElementSizes[i] = m_aElements[i].getOptimalSize( eType );
if( m_bColumn )
{
- aElementSizes[i].Width() = m_aManagedArea.GetWidth() - 2* m_nOuterBorder;
- nUsedWidth += aElementSizes[i].Height() + m_nBorderWidth;
+ aElementSizes[i].Width() = m_aManagedArea.GetWidth() - 2 * nOuterBorder;
+ nUsedWidth += aElementSizes[i].Height() + nDistance;
}
else
{
- aElementSizes[i].Height() = m_aManagedArea.GetHeight() - 2* m_nOuterBorder;
- nUsedWidth += aElementSizes[i].Width() + m_nBorderWidth;
+ aElementSizes[i].Height() = m_aManagedArea.GetHeight() - 2 * nOuterBorder;
+ nUsedWidth += aElementSizes[i].Width() + nDistance;
}
}
}
@@ -375,8 +469,8 @@ void RowOrColumn::resize()
// get starting position
Point aElementPos( m_aManagedArea.TopLeft() );
// outer border
- aElementPos.X() += m_nOuterBorder;
- aElementPos.Y() += m_nOuterBorder;
+ aElementPos.X() += nOuterBorder;
+ aElementPos.Y() += nOuterBorder;
// position managed windows
for( size_t i = 0; i < nElements; i++ )
@@ -386,27 +480,27 @@ void RowOrColumn::resize()
{
m_aElements[i].setPosSize( aElementPos, aElementSizes[i] );
if( m_bColumn )
- aElementPos.Y() += m_nBorderWidth + aElementSizes[i].Height();
+ aElementPos.Y() += nDistance + aElementSizes[i].Height();
else
- aElementPos.X() += m_nBorderWidth + aElementSizes[i].Width();
+ aElementPos.X() += nDistance + aElementSizes[i].Width();
}
}
}
-size_t RowOrColumn::addWindow( Window* i_pWindow, sal_Int32 i_nExpandPrio, size_t i_nIndex )
+size_t RowOrColumn::addWindow( Window* i_pWindow, sal_Int32 i_nExpandPrio, const Size& i_rMinSize, size_t i_nIndex )
{
size_t nIndex = i_nIndex;
if( i_nIndex >= m_aElements.size() )
{
nIndex = m_aElements.size();
- m_aElements.push_back( WindowArranger::Element( i_pWindow, boost::shared_ptr<WindowArranger>(), i_nExpandPrio ) );
+ m_aElements.push_back( WindowArranger::Element( i_pWindow, boost::shared_ptr<WindowArranger>(), i_nExpandPrio, i_rMinSize ) );
}
else
{
std::vector< WindowArranger::Element >::iterator it = m_aElements.begin();
while( i_nIndex-- )
++it;
- m_aElements.insert( it, WindowArranger::Element( i_pWindow, boost::shared_ptr<WindowArranger>(), i_nExpandPrio ) );
+ m_aElements.insert( it, WindowArranger::Element( i_pWindow, boost::shared_ptr<WindowArranger>(), i_nExpandPrio, i_rMinSize ) );
}
return nIndex;
}
@@ -479,14 +573,14 @@ Size LabeledElement::getOptimalSize( WindowSizeType i_eType ) const
if( m_nLabelColumnWidth != 0 )
aRet.Width() = m_nLabelColumnWidth;
else
- aRet.Width() += m_nDistance;
+ aRet.Width() += getBorderValue( m_nDistance );
}
Size aElementSize( m_aElement.getOptimalSize( i_eType ) );
aRet.Width() += aElementSize.Width();
if( aElementSize.Height() > aRet.Height() )
aRet.Height() = aElementSize.Height();
if( aRet.Height() != 0 )
- aRet.Height() += 2*m_nOuterBorder;
+ aRet.Height() += 2 * getBorderValue( m_nOuterBorder );
return aRet;
}
@@ -495,23 +589,25 @@ void LabeledElement::resize()
{
Size aLabelSize( m_aLabel.getOptimalSize( WINDOWSIZE_MINIMUM ) );
Size aElementSize( m_aElement.getOptimalSize( WINDOWSIZE_PREFERRED ) );
- if( m_nDistance + aLabelSize.Width() + aElementSize.Width() > m_aManagedArea.GetWidth() )
+ long nDistance = getBorderValue( m_nDistance );
+ long nOuterBorder = getBorderValue( m_nOuterBorder );
+ if( nDistance + aLabelSize.Width() + aElementSize.Width() > m_aManagedArea.GetWidth() )
aElementSize = m_aElement.getOptimalSize( WINDOWSIZE_MINIMUM );
// align label and element vertically in LabeledElement
- long nYOff = (m_aManagedArea.GetHeight() - 2*m_nOuterBorder - aLabelSize.Height()) / 2;
+ long nYOff = (m_aManagedArea.GetHeight() - 2*nOuterBorder - aLabelSize.Height()) / 2;
Point aPos( m_aManagedArea.Left(),
- m_aManagedArea.Top() + m_nOuterBorder + nYOff );
+ m_aManagedArea.Top() + nOuterBorder + nYOff );
Size aSize( aLabelSize );
if( m_nLabelColumnWidth != 0 )
aSize.Width() = m_nLabelColumnWidth;
m_aLabel.setPosSize( aPos, aSize );
- aPos.X() += aSize.Width() + m_nDistance;
- nYOff = (m_aManagedArea.GetHeight() - 2*m_nOuterBorder - aElementSize.Height()) / 2;
- aPos.Y() = m_aManagedArea.Top() + m_nOuterBorder + nYOff;
+ aPos.X() += aSize.Width() + nDistance;
+ nYOff = (m_aManagedArea.GetHeight() - 2*nOuterBorder - aElementSize.Height()) / 2;
+ aPos.Y() = m_aManagedArea.Top() + nOuterBorder + nYOff;
aSize.Width() = aElementSize.Width();
- aSize.Height() = m_aManagedArea.GetHeight() - 2*m_nOuterBorder;
+ aSize.Height() = m_aManagedArea.GetHeight() - 2*nOuterBorder;
// label style
// 0: position left and right
@@ -578,18 +674,22 @@ long LabelColumn::getLabelWidth() const
if( pLW )
{
Size aLabSize( pLW->GetOptimalSize( WINDOWSIZE_MINIMUM ) );
+ long nLB = 0;
+ pLabel->getBorders(0, &nLB);
+ aLabSize.Width() += getBorderValue( nLB );
if( aLabSize.Width() > nWidth )
nWidth = aLabSize.Width();
}
}
}
}
- return nWidth + getBorderWidth();
+ return nWidth + getBorderValue( getBorderWidth() );
}
Size LabelColumn::getOptimalSize( WindowSizeType i_eType ) const
{
long nWidth = getLabelWidth();
+ long nOuterBorder = getBorderValue( m_nOuterBorder );
Size aColumnSize;
// every child is a LabeledElement
@@ -622,19 +722,19 @@ Size LabelColumn::getOptimalSize( WindowSizeType i_eType ) const
}
if( aElementSize.Width() )
{
- aElementSize.Width() += 2*m_nOuterBorder;
+ aElementSize.Width() += 2*nOuterBorder;
if( aElementSize.Width() > aColumnSize.Width() )
aColumnSize.Width() = aElementSize.Width();
}
if( aElementSize.Height() )
{
- aColumnSize.Height() += getBorderWidth() + aElementSize.Height();
+ aColumnSize.Height() += getBorderValue( getBorderWidth() ) + aElementSize.Height();
}
}
if( nEle > 0 && aColumnSize.Height() )
{
- aColumnSize.Height() -= getBorderWidth(); // for the first element
- aColumnSize.Height() += 2*m_nOuterBorder;
+ aColumnSize.Height() -= getBorderValue( getBorderWidth() ); // for the first element
+ aColumnSize.Height() += 2*nOuterBorder;
}
return aColumnSize;
}
@@ -667,12 +767,13 @@ size_t LabelColumn::addRow( Window* i_pLabel, boost::shared_ptr<WindowArranger>
return nIndex;
}
-size_t LabelColumn::addRow( Window* i_pLabel, Window* i_pElement, long i_nIndent )
+size_t LabelColumn::addRow( Window* i_pLabel, Window* i_pElement, long i_nIndent, const Size& i_rElementMinSize )
{
boost::shared_ptr< LabeledElement > xLabel( new LabeledElement( this, 1 ) );
xLabel->setLabel( i_pLabel );
xLabel->setBorders( 0, i_nIndent, 0, 0, 0 );
xLabel->setElement( i_pElement );
+ xLabel->setMinimumSize( 1, i_rElementMinSize );
size_t nIndex = addChild( xLabel );
resize();
return nIndex;
@@ -690,19 +791,23 @@ Indenter::~Indenter()
Size Indenter::getOptimalSize( WindowSizeType i_eType ) const
{
Size aSize( m_aElement.getOptimalSize( i_eType ) );
- aSize.Width() += 2*m_nOuterBorder + m_nIndent;
- aSize.Height() += 2*m_nOuterBorder;
+ long nOuterBorder = getBorderValue( m_nOuterBorder );
+ long nIndent = getBorderValue( m_nIndent );
+ aSize.Width() += 2*nOuterBorder + nIndent;
+ aSize.Height() += 2*nOuterBorder;
return aSize;
}
void Indenter::resize()
{
+ long nOuterBorder = getBorderValue( m_nOuterBorder );
+ long nIndent = getBorderValue( m_nIndent );
Point aPt( m_aManagedArea.TopLeft() );
- aPt.X() += m_nOuterBorder + m_nIndent;
- aPt.Y() += m_nOuterBorder;
+ aPt.X() += nOuterBorder + nIndent;
+ aPt.Y() += nOuterBorder;
Size aSz( m_aManagedArea.GetSize() );
- aSz.Width() -= 2*m_nOuterBorder + m_nIndent;
- aSz.Height() -= 2*m_nOuterBorder;
+ aSz.Width() -= 2*nOuterBorder + nIndent;
+ aSz.Height() -= 2*nOuterBorder;
m_aElement.setPosSize( aPt, aSz );
}
@@ -728,9 +833,13 @@ MatrixArranger::~MatrixArranger()
{
}
-Size MatrixArranger::getOptimalSize( WindowSizeType i_eType, std::vector<long>& o_rColumnWidths, std::vector<long>& o_rRowHeights ) const
+Size MatrixArranger::getOptimalSize( WindowSizeType i_eType,
+ std::vector<long>& o_rColumnWidths, std::vector<long>& o_rRowHeights,
+ std::vector<sal_Int32>& o_rColumnPrio, std::vector<sal_Int32>& o_rRowPrio
+ ) const
{
- Size aMatrixSize( 2*m_nOuterBorder, 2*m_nOuterBorder );
+ long nOuterBorder = getBorderValue( m_nOuterBorder );
+ Size aMatrixSize( 2*nOuterBorder, 2*nOuterBorder );
// first find out the current number of rows and columns
sal_uInt32 nRows = 0, nColumns = 0;
@@ -746,6 +855,8 @@ Size MatrixArranger::getOptimalSize( WindowSizeType i_eType, std::vector<long>&
// now allocate row and column depth vectors
o_rColumnWidths = std::vector< long >( nColumns, 0 );
o_rRowHeights = std::vector< long >( nRows, 0 );
+ o_rColumnPrio = std::vector< sal_Int32 >( nColumns, 0 );
+ o_rRowPrio = std::vector< sal_Int32 >( nRows, 0 );
// get sizes an allocate them into rows/columns
for( std::vector< MatrixElement >::const_iterator it = m_aElements.begin();
@@ -756,18 +867,24 @@ Size MatrixArranger::getOptimalSize( WindowSizeType i_eType, std::vector<long>&
o_rColumnWidths[ it->m_nX ] = aSize.Width();
if( aSize.Height() > o_rRowHeights[ it->m_nY ] )
o_rRowHeights[ it->m_nY ] = aSize.Height();
+ if( it->m_nExpandPriority > o_rColumnPrio[ it->m_nX ] )
+ o_rColumnPrio[ it->m_nX ] = it->m_nExpandPriority;
+ if( it->m_nExpandPriority > o_rRowPrio[ it->m_nY ] )
+ o_rRowPrio[ it->m_nY ] = it->m_nExpandPriority;
}
// add up sizes
+ long nDistanceX = getBorderValue( m_nBorderX );
+ long nDistanceY = getBorderValue( m_nBorderY );
for( sal_uInt32 i = 0; i < nColumns; i++ )
- aMatrixSize.Width() += o_rColumnWidths[i] + m_nBorderX;
+ aMatrixSize.Width() += o_rColumnWidths[i] + nDistanceX;
if( nColumns > 0 )
- aMatrixSize.Width() -= m_nBorderX;
+ aMatrixSize.Width() -= nDistanceX;
for( sal_uInt32 i = 0; i < nRows; i++ )
- aMatrixSize.Height() += o_rRowHeights[i] + m_nBorderY;
+ aMatrixSize.Height() += o_rRowHeights[i] + nDistanceY;
if( nRows > 0 )
- aMatrixSize.Height() -= m_nBorderY;
+ aMatrixSize.Height() -= nDistanceY;
return aMatrixSize;
}
@@ -775,9 +892,48 @@ Size MatrixArranger::getOptimalSize( WindowSizeType i_eType, std::vector<long>&
Size MatrixArranger::getOptimalSize( WindowSizeType i_eType ) const
{
std::vector<long> aColumnWidths, aRowHeights;
- return getOptimalSize( i_eType, aColumnWidths, aRowHeights );
+ std::vector<sal_Int32> aColumnPrio, aRowPrio;
+ return getOptimalSize( i_eType, aColumnWidths, aRowHeights, aColumnPrio, aRowPrio );
}
+void MatrixArranger::distributeExtraSize( std::vector<long>& io_rSizes, const std::vector<sal_Int32>& i_rPrios, long i_nExtraWidth )
+{
+ if( ! io_rSizes.empty() && io_rSizes.size() == i_rPrios.size() ) // sanity check
+ {
+ // find all elements with the highest expand priority
+ size_t nElements = io_rSizes.size();
+ std::vector< size_t > aIndices;
+ sal_Int32 nHighPrio = 0;
+ for( size_t i = 0; i < nElements; i++ )
+ {
+ sal_Int32 nCurPrio = i_rPrios[ i ];
+ if( nCurPrio > nHighPrio )
+ {
+ aIndices.clear();
+ nHighPrio = nCurPrio;
+ }
+ if( nCurPrio == nHighPrio )
+ aIndices.push_back( i );
+ }
+
+ // distribute extra space evenly among collected elements
+ nElements = aIndices.size();
+ if( nElements > 0 )
+ {
+ long nDelta = i_nExtraWidth / nElements;
+ for( size_t i = 0; i < nElements; i++ )
+ {
+ io_rSizes[ aIndices[i] ] += nDelta;
+ i_nExtraWidth -= nDelta;
+ }
+ // add the last pixels to the last row element
+ if( i_nExtraWidth > 0 && nElements > 0 )
+ io_rSizes[aIndices.back()] += i_nExtraWidth;
+ }
+ }
+}
+
+
void MatrixArranger::resize()
{
// assure that we have at least one row and column
@@ -786,30 +942,44 @@ void MatrixArranger::resize()
// check if we can get optimal size, else fallback to minimal size
std::vector<long> aColumnWidths, aRowHeights;
- Size aOptSize( getOptimalSize( WINDOWSIZE_PREFERRED, aColumnWidths, aRowHeights ) );
+ std::vector<sal_Int32> aColumnPrio, aRowPrio;
+ Size aOptSize( getOptimalSize( WINDOWSIZE_PREFERRED, aColumnWidths, aRowHeights, aColumnPrio, aRowPrio ) );
if( aOptSize.Height() > m_aManagedArea.GetHeight() ||
aOptSize.Width() > m_aManagedArea.GetWidth() )
{
std::vector<long> aMinColumnWidths, aMinRowHeights;
- getOptimalSize( WINDOWSIZE_MINIMUM, aMinColumnWidths, aMinRowHeights );
+ getOptimalSize( WINDOWSIZE_MINIMUM, aMinColumnWidths, aMinRowHeights, aColumnPrio, aRowPrio );
if( aOptSize.Height() > m_aManagedArea.GetHeight() )
aRowHeights = aMinRowHeights;
if( aOptSize.Width() > m_aManagedArea.GetWidth() )
aColumnWidths = aMinColumnWidths;
}
- // FIXME: distribute extra space available
+ // distribute extra space available
+ long nExtraSize = m_aManagedArea.GetWidth();
+ for( size_t i = 0; i < aColumnWidths.size(); ++i )
+ nExtraSize -= aColumnWidths[i] + m_nBorderX;
+ if( nExtraSize > 0 )
+ distributeExtraSize( aColumnWidths, aColumnPrio, nExtraSize );
+ nExtraSize = m_aManagedArea.GetHeight();
+ for( size_t i = 0; i < aRowHeights.size(); ++i )
+ nExtraSize -= aRowHeights[i] + m_nBorderY;
+ if( nExtraSize > 0 )
+ distributeExtraSize( aRowHeights, aRowPrio, nExtraSize );
// prepare offsets
+ long nDistanceX = getBorderValue( m_nBorderX );
+ long nDistanceY = getBorderValue( m_nBorderY );
+ long nOuterBorder = getBorderValue( m_nOuterBorder );
std::vector<long> aColumnX( aColumnWidths.size() );
- aColumnX[0] = m_aManagedArea.Left() + m_nOuterBorder;
+ aColumnX[0] = m_aManagedArea.Left() + nOuterBorder;
for( size_t i = 1; i < aColumnX.size(); i++ )
- aColumnX[i] = aColumnX[i-1] + aColumnWidths[i-1] + m_nBorderX;
+ aColumnX[i] = aColumnX[i-1] + aColumnWidths[i-1] + nDistanceX;
std::vector<long> aRowY( aRowHeights.size() );
- aRowY[0] = m_aManagedArea.Top() + m_nOuterBorder;
+ aRowY[0] = m_aManagedArea.Top() + nOuterBorder;
for( size_t i = 1; i < aRowY.size(); i++ )
- aRowY[i] = aRowY[i-1] + aRowHeights[i-1] + m_nBorderY;
+ aRowY[i] = aRowY[i-1] + aRowHeights[i-1] + nDistanceY;
// now iterate over the elements and assign their positions
for( std::vector< MatrixElement >::iterator it = m_aElements.begin();
@@ -821,7 +991,7 @@ void MatrixArranger::resize()
}
}
-size_t MatrixArranger::addWindow( Window* i_pWindow, sal_uInt32 i_nX, sal_uInt32 i_nY, sal_Int32 i_nExpandPrio )
+size_t MatrixArranger::addWindow( Window* i_pWindow, sal_uInt32 i_nX, sal_uInt32 i_nY, sal_Int32 i_nExpandPrio, const Size& i_rMinSize )
{
sal_uInt64 nMapValue = getMap( i_nX, i_nY );
std::map< sal_uInt64, size_t >::const_iterator it = m_aMatrixMap.find( nMapValue );
@@ -829,7 +999,7 @@ size_t MatrixArranger::addWindow( Window* i_pWindow, sal_uInt32 i_nX, sal_uInt32
if( it == m_aMatrixMap.end() )
{
m_aMatrixMap[ nMapValue ] = nIndex = m_aElements.size();
- m_aElements.push_back( MatrixElement( i_pWindow, i_nX, i_nY, boost::shared_ptr<WindowArranger>(), i_nExpandPrio ) );
+ m_aElements.push_back( MatrixElement( i_pWindow, i_nX, i_nY, boost::shared_ptr<WindowArranger>(), i_nExpandPrio, i_rMinSize ) );
}
else
{
@@ -837,6 +1007,7 @@ size_t MatrixArranger::addWindow( Window* i_pWindow, sal_uInt32 i_nX, sal_uInt32
rEle.m_pElement = i_pWindow;
rEle.m_pChild.reset();
rEle.m_nExpandPriority = i_nExpandPrio;
+ rEle.m_aMinSize = i_rMinSize;
rEle.m_nX = i_nX;
rEle.m_nY = i_nY;
nIndex = it->second;
diff --git a/vcl/source/window/btndlg.cxx b/vcl/source/window/btndlg.cxx
index e835fe749ed1..9a0452027737 100644
--- a/vcl/source/window/btndlg.cxx
+++ b/vcl/source/window/btndlg.cxx
@@ -530,22 +530,19 @@ XubString ButtonDialog::GetButtonHelpText( USHORT nId ) const
// -----------------------------------------------------------------------
-void ButtonDialog::SetButtonHelpId( USHORT nId, ULONG nHelpId )
+void ButtonDialog::SetButtonHelpId( USHORT nId, const rtl::OString& rHelpId )
{
ImplBtnDlgItem* pItem = ImplGetItem( nId );
if ( pItem )
- pItem->mpPushButton->SetHelpId( nHelpId );
+ pItem->mpPushButton->SetHelpId( rHelpId );
}
// -----------------------------------------------------------------------
-ULONG ButtonDialog::GetButtonHelpId( USHORT nId ) const
+rtl::OString ButtonDialog::GetButtonHelpId( USHORT nId ) const
{
ImplBtnDlgItem* pItem = ImplGetItem( nId );
- if ( pItem )
- return pItem->mpPushButton->GetHelpId();
- else
- return 0;
+ return pItem ? rtl::OString( pItem->mpPushButton->GetHelpId() ) : rtl::OString();
}
diff --git a/vcl/source/window/javachild.cxx b/vcl/source/window/javachild.cxx
index 2cd18b897ff5..aa198c85c138 100644
--- a/vcl/source/window/javachild.cxx
+++ b/vcl/source/window/javachild.cxx
@@ -2,10 +2,13 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2000, 2010 Oracle and/or its affiliates.
+ * Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
*
+ * $RCSfile: javachild.cxx,v $
+ * $Revision: 1.12 $
+ *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -28,32 +31,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-
-#ifdef SOLAR_JAVA
-#include <jni.h>
-#endif
-#include <comphelper/processfactory.hxx>
-
-#include <vcl/unohelp.hxx>
-#include <rtl/process.h>
-#include <rtl/ref.hxx>
-#include <jvmaccess/virtualmachine.hxx>
-#include <com/sun/star/java/XJavaVM.hpp>
-#include <com/sun/star/java/XJavaThreadRegister_11.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-
-#ifndef _SV_SVSYS_HXX
-#include <svsys.h>
-#endif
-#include <vcl/salinst.hxx>
-#include <vcl/salframe.hxx>
-#include <vcl/window.hxx>
-#include <vcl/salobj.hxx>
#include <vcl/javachild.hxx>
-#include <vcl/svdata.hxx>
-#include <vcl/sysdata.hxx>
-
-using namespace ::com::sun::star;
// -------------------
// - JavaChildWindow -
@@ -79,129 +57,7 @@ JavaChildWindow::~JavaChildWindow()
// -----------------------------------------------------------------------
-void JavaChildWindow::implTestJavaException( void* pEnv )
-{
-#ifdef SOLAR_JAVA
- JNIEnv* pJavaEnv = reinterpret_cast< JNIEnv* >( pEnv );
- jthrowable jtThrowable = pJavaEnv->ExceptionOccurred();
-
- if( jtThrowable )
- { // is it a java exception ?
-#if OSL_DEBUG_LEVEL > 1
- pJavaEnv->ExceptionDescribe();
-#endif // OSL_DEBUG_LEVEL > 1
- pJavaEnv->ExceptionClear();
-
- jclass jcThrowable = pJavaEnv->FindClass("java/lang/Throwable");
- jmethodID jmThrowable_getMessage = pJavaEnv->GetMethodID(jcThrowable, "getMessage", "()Ljava/lang/String;");
- jstring jsMessage = (jstring) pJavaEnv->CallObjectMethod(jtThrowable, jmThrowable_getMessage);
- ::rtl::OUString ouMessage;
-
- if(jsMessage)
- {
- const jchar * jcMessage = pJavaEnv->GetStringChars(jsMessage, NULL);
- ouMessage = ::rtl::OUString(jcMessage);
- pJavaEnv->ReleaseStringChars(jsMessage, jcMessage);
- }
-
- throw uno::RuntimeException(ouMessage, uno::Reference<uno::XInterface>());
- }
-#endif // SOLAR_JAVA
-}
-
-// -----------------------------------------------------------------------
-
sal_IntPtr JavaChildWindow::getParentWindowHandleForJava()
{
- sal_IntPtr nRet = 0;
-
-#if defined WNT
- nRet = reinterpret_cast< sal_IntPtr >( GetSystemData()->hWnd );
-#elif defined QUARTZ
- // FIXME: this is wrong
- nRet = reinterpret_cast< sal_IntPtr >( GetSystemData()->pView );
-#elif defined UNX
-#ifdef SOLAR_JAVA
- uno::Reference< lang::XMultiServiceFactory > xFactory( vcl::unohelper::GetMultiServiceFactory() );
-
- if( xFactory.is() && ( GetSystemData()->aWindow > 0 ) )
- {
- try
- {
- ::rtl::Reference< ::jvmaccess::VirtualMachine > xVM;
- uno::Reference< java::XJavaVM > xJavaVM( xFactory->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.java.JavaVirtualMachine") ) ), uno::UNO_QUERY );
- uno::Sequence< sal_Int8 > aProcessID( 17 );
-
- rtl_getGlobalProcessId( (sal_uInt8*) aProcessID.getArray() );
- aProcessID[ 16 ] = 0;
- OSL_ENSURE(sizeof (sal_Int64) >= sizeof (jvmaccess::VirtualMachine *), "Pointer cannot be represented as sal_Int64");
- sal_Int64 nPointer = reinterpret_cast< sal_Int64 >( static_cast< jvmaccess::VirtualMachine * >(0));
- xJavaVM->getJavaVM(aProcessID) >>= nPointer;
- xVM = reinterpret_cast< jvmaccess::VirtualMachine * >(nPointer);
-
- if( xVM.is() )
- {
- try
- {
- ::jvmaccess::VirtualMachine::AttachGuard aVMAttachGuard( xVM );
- JNIEnv* pEnv = aVMAttachGuard.getEnvironment();
-
- jclass jcToolkit = pEnv->FindClass("java/awt/Toolkit");
- implTestJavaException(pEnv);
-
- jmethodID jmToolkit_getDefaultToolkit = pEnv->GetStaticMethodID( jcToolkit, "getDefaultToolkit", "()Ljava/awt/Toolkit;" );
- implTestJavaException(pEnv);
-
- pEnv->CallStaticObjectMethod(jcToolkit, jmToolkit_getDefaultToolkit);
- implTestJavaException(pEnv);
-
- jclass jcMotifAppletViewer = pEnv->FindClass("sun/plugin/navig/motif/MotifAppletViewer");
- if( pEnv->ExceptionOccurred() )
- {
- pEnv->ExceptionClear();
-
- jcMotifAppletViewer = pEnv->FindClass( "sun/plugin/viewer/MNetscapePluginContext");
- implTestJavaException(pEnv);
- }
-
- jclass jcClassLoader = pEnv->FindClass("java/lang/ClassLoader");
- implTestJavaException(pEnv);
-
- jmethodID jmClassLoader_loadLibrary = pEnv->GetStaticMethodID( jcClassLoader, "loadLibrary", "(Ljava/lang/Class;Ljava/lang/String;Z)V");
- implTestJavaException(pEnv);
-
- jstring jsplugin = pEnv->NewStringUTF("javaplugin_jni");
- implTestJavaException(pEnv);
-
- pEnv->CallStaticVoidMethod(jcClassLoader, jmClassLoader_loadLibrary, jcMotifAppletViewer, jsplugin, JNI_FALSE);
- implTestJavaException(pEnv);
-
- jmethodID jmMotifAppletViewer_getWidget = pEnv->GetStaticMethodID( jcMotifAppletViewer, "getWidget", "(IIIII)I" );
- implTestJavaException(pEnv);
-
- const Size aSize( GetOutputSizePixel() );
- jint ji_widget = pEnv->CallStaticIntMethod( jcMotifAppletViewer, jmMotifAppletViewer_getWidget,
- GetSystemData()->aWindow, 0, 0, aSize.Width(), aSize.Height() );
- implTestJavaException(pEnv);
-
- nRet = static_cast< sal_IntPtr >( ji_widget );
- }
- catch( uno::RuntimeException& )
- {
- }
-
- if( !nRet )
- nRet = static_cast< sal_IntPtr >( GetSystemData()->aWindow );
- }
- }
- catch( ... )
- {
- }
- }
-#endif // SOLAR_JAVA
-#else // WNT || QUARTZ || UNX
- // TBD
-#endif
-
- return nRet;
+ return SystemChildWindow::GetParentWindowHandle( sal_True );
}
diff --git a/vcl/source/window/makefile.mk b/vcl/source/window/makefile.mk
index 82ce26f8e78e..1c63376dfda5 100644
--- a/vcl/source/window/makefile.mk
+++ b/vcl/source/window/makefile.mk
@@ -85,6 +85,8 @@ SLOFILES= \
$(SLO)$/winproc.obj \
$(SLO)$/window2.obj \
$(SLO)$/window3.obj \
+ $(SLO)$/window4.obj \
+ $(SLO)$/wpropset.obj \
$(SLO)$/wrkwin.obj
# --- Targets ------------------------------------------------------
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 81676eba3be4..52ad54957dd0 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -157,7 +157,7 @@ struct MenuItemData
XubString aTipHelpText; // TipHelp-String (eg, expanded filenames)
XubString aCommandStr; // CommandString
XubString aHelpCommandStr; // Help command string (to reference external help)
- ULONG nHelpId; // Help-Id
+ rtl::OString aHelpId; // Help-Id
ULONG nUserValue; // User value
Image aImage; // Image
KeyCode aAccelKey; // Accelerator-Key
@@ -252,7 +252,6 @@ MenuItemData* MenuItemList::Insert( USHORT nId, MenuItemType eType,
pData->nBits = nBits;
pData->pSubMenu = NULL;
pData->pAutoSubMenu = NULL;
- pData->nHelpId = 0;
pData->nUserValue = 0;
pData->bChecked = FALSE;
pData->bEnabled = TRUE;
@@ -284,7 +283,6 @@ void MenuItemList::InsertSeparator( USHORT nPos )
pData->nBits = 0;
pData->pSubMenu = NULL;
pData->pAutoSubMenu = NULL;
- pData->nHelpId = 0;
pData->nUserValue = 0;
pData->bChecked = FALSE;
pData->bEnabled = TRUE;
@@ -844,14 +842,14 @@ static BOOL ImplHandleHelpEvent( Window* pMenuWindow, Menu* pMenu, USHORT nHighl
// Ist eine ID vorhanden, dann Hilfe mit der ID aufrufen, sonst
// den Hilfe-Index
String aCommand = pMenu->GetItemCommand( nId );
- ULONG nHelpId = pMenu->GetHelpId( nId );
+ rtl::OString aHelpId( pMenu->GetHelpId( nId ) );
+ if( ! aHelpId.getLength() )
+ aHelpId = OOO_HELP_INDEX;
if ( aCommand.Len() )
pHelp->Start( aCommand, NULL );
- else if ( nHelpId )
- pHelp->Start( nHelpId, NULL );
else
- pHelp->Start( OOO_HELP_INDEX, NULL );
+ pHelp->Start( rtl::OStringToOUString( aHelpId, RTL_TEXTENCODING_UTF8 ), NULL );
}
bDone = TRUE;
}
@@ -980,7 +978,7 @@ void Menu::ImplInit()
mpLayoutData = NULL;
mpFirstDel = NULL; // Dtor notification list
// Native-support: returns NULL if not supported
- mpSalMenu = ImplGetSVData()->mpDefInst->CreateMenu( bIsMenuBar );
+ mpSalMenu = ImplGetSVData()->mpDefInst->CreateMenu( bIsMenuBar, this );
}
Menu* Menu::ImplGetStartedFrom() const
@@ -1330,15 +1328,14 @@ void Menu::InsertItem( const ResId& rResId, USHORT nPos )
SetHelpText( nItemId, aHelpText );
}
- ULONG nHelpId = 0;
if ( nObjMask & RSC_MENUITEM_HELPID )
{
- nHelpId = ReadLongRes();
+ rtl::OString aHelpId( ReadByteStringRes() );
if ( !bSep )
- SetHelpId( nItemId, nHelpId );
+ SetHelpId( nItemId, aHelpId );
}
- if( !bSep /* && SvHelpSettings::HelpText( aHelpText, nHelpId ) */ )
+ if( !bSep )
SetHelpText( nItemId, aHelpText );
if ( nObjMask & RSC_MENUITEM_KEYCODE )
@@ -1463,7 +1460,7 @@ void ImplCopyItem( Menu* pThis, const Menu& rMenu, USHORT nPos, USHORT nNewPos,
pThis->CheckItem( nId, TRUE );
if ( !rMenu.IsItemEnabled( nId ) )
pThis->EnableItem( nId, FALSE );
- pThis->SetHelpId( nId, pData->nHelpId );
+ pThis->SetHelpId( nId, pData->aHelpId );
pThis->SetHelpText( nId, pData->aHelpText );
pThis->SetAccelKey( nId, pData->aAccelKey );
pThis->SetItemCommand( nId, pData->aCommandStr );
@@ -2039,7 +2036,7 @@ const XubString& Menu::ImplGetHelpText( USHORT nItemId ) const
if ( pData )
{
if ( !pData->aHelpText.Len() &&
- (( pData->nHelpId ) || ( pData->aCommandStr.Len() )))
+ (( pData->aHelpId.getLength() ) || ( pData->aCommandStr.Len() )))
{
Help* pHelp = Application::GetHelp();
if ( pHelp )
@@ -2047,8 +2044,8 @@ const XubString& Menu::ImplGetHelpText( USHORT nItemId ) const
if ( pData->aCommandStr.Len() )
pData->aHelpText = pHelp->GetHelpText( pData->aCommandStr, NULL );
- if( !pData->aHelpText.Len() && pData->nHelpId )
- pData->aHelpText = pHelp->GetHelpText( pData->nHelpId, NULL );
+ if( !pData->aHelpText.Len() && pData->aHelpId.getLength() )
+ pData->aHelpText = pHelp->GetHelpText( rtl::OStringToOUString( pData->aHelpId, RTL_TEXTENCODING_UTF8 ), NULL );
}
}
@@ -2081,22 +2078,29 @@ const XubString& Menu::GetTipHelpText( USHORT nItemId ) const
return ImplGetSVEmptyStr();
}
-void Menu::SetHelpId( USHORT nItemId, ULONG nHelpId )
+void Menu::SetHelpId( USHORT nItemId, const rtl::OString& rHelpId )
{
MenuItemData* pData = pItemList->GetData( nItemId );
if ( pData )
- pData->nHelpId = nHelpId;
+ pData->aHelpId = rHelpId;
}
-ULONG Menu::GetHelpId( USHORT nItemId ) const
+rtl::OString Menu::GetHelpId( USHORT nItemId ) const
{
+ rtl::OString aRet;
+
MenuItemData* pData = pItemList->GetData( nItemId );
if ( pData )
- return pData->nHelpId;
- else
- return 0;
+ {
+ if ( pData->aHelpId.getLength() )
+ aRet = pData->aHelpId;
+ else
+ aRet = ::rtl::OUStringToOString( pData->aCommandStr, RTL_TEXTENCODING_UTF8 );
+ }
+
+ return aRet;
}
Menu& Menu::operator=( const Menu& rMenu )
@@ -2480,6 +2484,16 @@ Size Menu::ImplCalcSize( Window* pWin )
if ( !bIsMenuBar )
{
+ // popup menus should not be wider than half the screen
+ // except on rather small screens
+ // TODO: move GetScreenNumber from SystemWindow to Window ?
+ // currently we rely on internal privileges
+ unsigned int nScreenNumber = pWin->ImplGetWindowImpl()->mpFrame->maGeometry.nScreenNumber;
+ Rectangle aDispRect( Application::GetScreenPosSizePixel( nScreenNumber ) );
+ long nScreenWidth = aDispRect.GetWidth() >= 800 ? aDispRect.GetWidth() : 800;
+ if( nMaxWidth > nScreenWidth/2 )
+ nMaxWidth = nScreenWidth/2;
+
USHORT gfxExtra = (USHORT) Max( nExtra, 7L ); // #107710# increase space between checkmarks/images/text
nCheckPos = (USHORT)nExtra;
if (nMenuFlags & MENU_FLAG_SHOWCHECKIMAGES)
@@ -2573,6 +2587,26 @@ static void ImplPaintCheckBackground( Window* i_pWindow, const Rectangle& i_rRec
}
}
+static String getShortenedString( const String& i_rLong, Window* i_pWin, long i_nMaxWidth )
+{
+ xub_StrLen nPos = STRING_NOTFOUND;
+ String aNonMnem( OutputDevice::GetNonMnemonicString( i_rLong, nPos ) );
+ aNonMnem = i_pWin->GetEllipsisString( aNonMnem, i_nMaxWidth, TEXT_DRAW_CENTERELLIPSIS );
+ // re-insert mnemonic
+ if( nPos != STRING_NOTFOUND )
+ {
+ if( nPos < aNonMnem.Len() && i_rLong.GetChar(nPos+1) == aNonMnem.GetChar(nPos) )
+ {
+ rtl::OUStringBuffer aBuf( i_rLong.Len() );
+ aBuf.append( aNonMnem.GetBuffer(), nPos );
+ aBuf.append( sal_Unicode('~') );
+ aBuf.append( aNonMnem.GetBuffer()+nPos );
+ aNonMnem = aBuf.makeStringAndClear();
+ }
+ }
+ return aNonMnem;
+}
+
void Menu::ImplPaint( Window* pWin, USHORT nBorder, long nStartY, MenuItemData* pThisItemOnly, BOOL bHighlighted, bool bLayout ) const
{
// Fuer Symbole: nFontHeight x nFontHeight
@@ -2763,7 +2797,19 @@ void Menu::ImplPaint( Window* pWin, USHORT nBorder, long nStartY, MenuItemData*
pWin->GetSettings().GetStyleSettings().GetMenuColor();
pWin->SetBackground( Wallpaper( aBg ) );
}
- pWin->DrawCtrlText( aTmpPos, pData->aText, 0, pData->aText.Len(), nStyle, pVector, pDisplayText );
+ // how much space is there for the text ?
+ long nMaxItemTextWidth = aOutSz.Width() - aTmpPos.X() - nExtra - nOuterSpace;
+ if( !bIsMenuBar && pData->aAccelKey.GetCode() && !ImplAccelDisabled() )
+ {
+ XubString aAccText = pData->aAccelKey.GetName();
+ nMaxItemTextWidth -= pWin->GetTextWidth( aAccText ) + 3*nExtra;
+ }
+ if( !bIsMenuBar && pData->pSubMenu )
+ {
+ nMaxItemTextWidth -= nFontHeight - nExtra;
+ }
+ String aItemText( getShortenedString( pData->aText, pWin, nMaxItemTextWidth ) );
+ pWin->DrawCtrlText( aTmpPos, aItemText, 0, aItemText.Len(), nStyle, pVector, pDisplayText );
if( bSetTmpBackground )
pWin->SetBackground();
}
@@ -3722,7 +3768,7 @@ USHORT PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, ULONG nPopupM
if ( GetItemCount() )
{
SalMenu* pMenu = ImplGetSalMenu();
- if( pMenu && pMenu->ShowNativePopupMenu( pWin, aRect, nPopupModeFlags | FLOATWIN_POPUPMODE_GRABFOCUS ) )
+ if( pMenu && bRealExecute && pMenu->ShowNativePopupMenu( pWin, aRect, nPopupModeFlags | FLOATWIN_POPUPMODE_GRABFOCUS ) )
{
pWin->StopExecute(0);
pWin->doShutdown();
diff --git a/vcl/source/window/msgbox.cxx b/vcl/source/window/msgbox.cxx
index 7f7a65cd7fb9..d00d569883d5 100644
--- a/vcl/source/window/msgbox.cxx
+++ b/vcl/source/window/msgbox.cxx
@@ -196,10 +196,9 @@ MessBox::MessBox( Window* pParent, const ResId& rResId ) :
USHORT nLoButtons = ReadShortRes();
USHORT nHiDefButton = ReadShortRes();
USHORT nLoDefButton = ReadShortRes();
- USHORT nHiHelpId = ReadShortRes();
- USHORT nLoHelpId = ReadShortRes();
+ rtl::OString aHelpId( ReadByteStringRes() );
/* USHORT bSysModal = */ ReadShortRes();
- SetHelpId( ((ULONG)nHiHelpId << 16) + nLoHelpId );
+ SetHelpId( aHelpId );
WinBits nBits = (((ULONG)nHiButtons << 16) + nLoButtons) |
(((ULONG)nHiDefButton << 16) + nLoDefButton);
ImplInit( pParent, nBits | WB_MOVEABLE | WB_HORZ | WB_CENTER );
@@ -233,7 +232,7 @@ MessBox::~MessBox()
void MessBox::ImplPosControls()
{
- if ( GetHelpId() )
+ if ( GetHelpId().getLength() )
{
if ( !mbHelpBtn )
{
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index d0fae33acf3b..73420e6ef8b5 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -46,7 +46,7 @@
#include "unotools/localedatawrapper.hxx"
-#include "rtl/ustrbuf.hxx"
+#include "rtl/strbuf.hxx"
#include "com/sun/star/lang/XMultiServiceFactory.hpp"
#include "com/sun/star/container/XNameAccess.hpp"
@@ -61,14 +61,16 @@ using namespace com::sun::star::container;
using namespace com::sun::star::beans;
#define HELPID_PREFIX ".HelpId:vcl:PrintDialog"
-#define SMHID2( a, b ) SetSmartHelpId( SmartId( String( RTL_CONSTASCII_USTRINGPARAM( HELPID_PREFIX ":" a ":" b ) ), HID_PRINTDLG ) )
-#define SMHID1( a ) SetSmartHelpId( SmartId( String( RTL_CONSTASCII_USTRINGPARAM( HELPID_PREFIX ":" a ) ), HID_PRINTDLG ) )
+#define SMHID2( a, b ) SetHelpId( rtl::OString( HELPID_PREFIX ":" a ":" b ) )
+#define SMHID1( a ) SetHelpId( rtl::OString( HELPID_PREFIX ":" a ) )
PrintDialog::PrintPreviewWindow::PrintPreviewWindow( Window* i_pParent, const ResId& i_rId )
: Window( i_pParent, i_rId )
, maOrigSize( 10, 10 )
, maPageVDev( *this )
, maToolTipString( String( VclResId( SV_PRINT_PRINTPREVIEW_TXT ) ) )
+ , maHorzDim( this, WB_HORZ | WB_CENTER )
+ , maVertDim( this, WB_VERT | WB_VCENTER )
{
SetPaintTransparent( TRUE );
SetBackground();
@@ -76,6 +78,11 @@ PrintDialog::PrintPreviewWindow::PrintPreviewWindow( Window* i_pParent, const Re
maPageVDev.SetBackground( GetSettings().GetStyleSettings().GetWindowColor() );
else
maPageVDev.SetBackground( Color( COL_WHITE ) );
+ maHorzDim.Show();
+ maVertDim.Show();
+
+ maHorzDim.SetText( String( RTL_CONSTASCII_USTRINGPARAM( "2.0in" ) ) );
+ maVertDim.SetText( String( RTL_CONSTASCII_USTRINGPARAM( "2.0in" ) ) );
}
PrintDialog::PrintPreviewWindow::~PrintPreviewWindow()
@@ -162,9 +169,10 @@ void PrintDialog::PrintPreviewWindow::DataChanged( const DataChangedEvent& i_rDC
void PrintDialog::PrintPreviewWindow::Resize()
{
Size aNewSize( GetSizePixel() );
+ long nTextHeight = maHorzDim.GetTextHeight();
// leave small space for decoration
- aNewSize.Width() -= 2;
- aNewSize.Height() -= 2;
+ aNewSize.Width() -= nTextHeight + 2;
+ aNewSize.Height() -= nTextHeight + 2;
Size aScaledSize;
double fScale = 1.0;
@@ -206,16 +214,28 @@ void PrintDialog::PrintPreviewWindow::Resize()
}
maPageVDev.SetOutputSizePixel( aScaledSize, FALSE );
+
+ // position dimension lines
+ Point aRef( nTextHeight + (aNewSize.Width() - maPreviewSize.Width())/2,
+ nTextHeight + (aNewSize.Height() - maPreviewSize.Height())/2 );
+ maHorzDim.SetPosSizePixel( Point( aRef.X(), aRef.Y() - nTextHeight ),
+ Size( maPreviewSize.Width(), nTextHeight ) );
+ maVertDim.SetPosSizePixel( Point( aRef.X() - nTextHeight, aRef.Y() ),
+ Size( nTextHeight, maPreviewSize.Height() ) );
+
}
void PrintDialog::PrintPreviewWindow::Paint( const Rectangle& )
{
+ long nTextHeight = maHorzDim.GetTextHeight();
Size aSize( GetSizePixel() );
+ aSize.Width() -= nTextHeight;
+ aSize.Height() -= nTextHeight;
if( maReplacementString.getLength() != 0 )
{
// replacement is active
Push();
- Rectangle aTextRect( Point( 0, 0 ), aSize );
+ Rectangle aTextRect( Point( nTextHeight, nTextHeight ), aSize );
DecorationView aVw( this );
aVw.DrawFrame( aTextRect, FRAME_DRAW_GROUP );
aTextRect.Left() += 2;
@@ -233,8 +253,8 @@ void PrintDialog::PrintPreviewWindow::Paint( const Rectangle& )
{
GDIMetaFile aMtf( maMtf );
- Point aOffset( (aSize.Width() - maPreviewSize.Width()) / 2,
- (aSize.Height() - maPreviewSize.Height()) / 2 );
+ Point aOffset( (aSize.Width() - maPreviewSize.Width()) / 2 + nTextHeight,
+ (aSize.Height() - maPreviewSize.Height()) / 2 + nTextHeight );
Size aVDevSize( maPageVDev.GetOutputSizePixel() );
const Size aLogicSize( maPageVDev.PixelToLogic( aVDevSize, MapMode( MAP_100TH_MM ) ) );
@@ -294,13 +314,6 @@ void PrintDialog::PrintPreviewWindow::setPreview( const GDIMetaFile& i_rNewPrevi
{
rtl::OUStringBuffer aBuf( 256 );
aBuf.append( maToolTipString );
- #if OSL_DEBUG_LEVEL > 0
- aBuf.appendAscii( "\n---\nPageSize: " );
- aBuf.append( sal_Int32( i_rOrigSize.Width()/100) );
- aBuf.appendAscii( "mm x " );
- aBuf.append( sal_Int32( i_rOrigSize.Height()/100) );
- aBuf.appendAscii( "mm" );
- #endif
SetQuickHelpText( aBuf.makeStringAndClear() );
maMtf = i_rNewPreview;
if( useHCColorReplacement() )
@@ -312,6 +325,27 @@ void PrintDialog::PrintPreviewWindow::setPreview( const GDIMetaFile& i_rNewPrevi
maReplacementString = i_rReplacement;
maPageVDev.SetReferenceDevice( i_nDPIX, i_nDPIY );
maPageVDev.EnableOutput( TRUE );
+
+ // use correct measurements
+ const LocaleDataWrapper& rLocWrap( GetSettings().GetLocaleDataWrapper() );
+ MapUnit eUnit = MAP_MM;
+ int nDigits = 0;
+ if( rLocWrap.getMeasurementSystemEnum() == MEASURE_US )
+ {
+ eUnit = MAP_100TH_INCH;
+ nDigits = 2;
+ }
+ Size aLogicPaperSize( LogicToLogic( i_rOrigSize, MapMode( MAP_100TH_MM ), MapMode( eUnit ) ) );
+ String aNumText( rLocWrap.getNum( aLogicPaperSize.Width(), nDigits ) );
+ aBuf.append( aNumText );
+ aBuf.appendAscii( eUnit == MAP_MM ? "mm" : "in" );
+ maHorzDim.SetText( aBuf.makeStringAndClear() );
+
+ aNumText = rLocWrap.getNum( aLogicPaperSize.Height(), nDigits );
+ aBuf.append( aNumText );
+ aBuf.appendAscii( eUnit == MAP_MM ? "mm" : "in" );
+ maVertDim.SetText( aBuf.makeStringAndClear() );
+
Resize();
Invalidate();
}
@@ -364,12 +398,18 @@ void PrintDialog::ShowNupOrderWindow::Paint( const Rectangle& i_rRect )
int nX = 0, nY = 0;
switch( mnOrderMode )
{
- case SV_PRINT_PRT_NUP_ORDER_LRTD:
+ case SV_PRINT_PRT_NUP_ORDER_LRTB:
nX = (i % mnColumns); nY = (i / mnColumns);
break;
- case SV_PRINT_PRT_NUP_ORDER_TDLR:
+ case SV_PRINT_PRT_NUP_ORDER_TBLR:
nX = (i / mnRows); nY = (i % mnRows);
break;
+ case SV_PRINT_PRT_NUP_ORDER_RLTB:
+ nX = mnColumns - 1 - (i % mnColumns); nY = (i / mnColumns);
+ break;
+ case SV_PRINT_PRT_NUP_ORDER_TBRL:
+ nX = mnColumns - 1 - (i / mnRows); nY = (i % mnRows);
+ break;
}
Size aTextSize( GetTextWidth( aPageText ), nTextHeight );
int nDeltaX = (aSubSize.Width() - aTextSize.Width()) / 2;
@@ -493,22 +533,21 @@ void PrintDialog::NUpTabPage::showAdvancedControls( bool i_bShow )
maSheetMarginTxt2.Show( i_bShow );
maNupOrientationTxt.Show( i_bShow );
maNupOrientationBox.Show( i_bShow );
- maLayout.resize();
+ getLayout()->resize();
}
void PrintDialog::NUpTabPage::setupLayout()
{
+ boost::shared_ptr<vcl::RowOrColumn> xLayout =
+ boost::dynamic_pointer_cast<vcl::RowOrColumn>( getLayout() );
Size aBorder( LogicToPixel( Size( 6, 6 ), MapMode( MAP_APPFONT ) ) );
/* According to OOo style guide, the horizontal indentation of child
elements to their parent element should always be 6 map units. */
long nIndent = aBorder.Width();
- maLayout.setParentWindow( this );
- maLayout.setOuterBorder( aBorder.Width() );
-
- maLayout.addWindow( &maNupLine );
- boost::shared_ptr< vcl::RowOrColumn > xRow( new vcl::RowOrColumn( &maLayout, false ) );
- maLayout.addChild( xRow );
+ xLayout->addWindow( &maNupLine );
+ boost::shared_ptr< vcl::RowOrColumn > xRow( new vcl::RowOrColumn( xLayout.get(), false ) );
+ xLayout->addChild( xRow );
boost::shared_ptr< vcl::Indenter > xIndent( new vcl::Indenter( xRow.get() ) );
xRow->addChild( xIndent );
@@ -544,7 +583,7 @@ void PrintDialog::NUpTabPage::setupLayout()
xMainCol->addRow( &maNupOrderTxt, &maNupOrderBox, nIndent );
xMainCol->setBorders( xMainCol->addWindow( &maBorderCB ), nIndent, 0, 0, 0 );
- xSpacer.reset( new vcl::Spacer( xMainCol.get(), 0, Size( 10, aBorder.Width() ) ) );
+ xSpacer.reset( new vcl::Spacer( xMainCol.get(), 0, Size( 10, WindowArranger::getDefaultBorder() ) ) );
xMainCol->addChild( xSpacer );
xRow.reset( new vcl::RowOrColumn( xMainCol.get(), false ) );
@@ -556,11 +595,6 @@ void PrintDialog::NUpTabPage::setupLayout()
showAdvancedControls( false );
}
-void PrintDialog::NUpTabPage::Resize()
-{
- maLayout.setManagedArea( Rectangle( Point( 0, 0 ), GetOutputSizePixel() ) );
-}
-
void PrintDialog::NUpTabPage::initFromMultiPageSetup( const vcl::PrinterController::MultiPageSetup& i_rMPS )
{
maSheetMarginEdt.SetValue( maSheetMarginEdt.Normalize( i_rMPS.nLeftMargin ), FUNIT_100TH_MM );
@@ -601,7 +635,6 @@ PrintDialog::JobTabPage::JobTabPage( Window* i_pParent, const ResId& rResId )
, maNoCollateImg( VclResId( SV_PRINT_NOCOLLATE_IMG ) )
, maNoCollateHCImg( VclResId( SV_PRINT_NOCOLLATE_HC_IMG ) )
, mnCollateUIMode( 0 )
- , maLayout( NULL, true )
{
FreeResource();
@@ -641,39 +674,37 @@ void PrintDialog::JobTabPage::setupLayout()
// sets the results of GetOptimalSize in a normal ListBox
maPrinters.SetDropDownLineCount( 4 );
- Size aBorder( LogicToPixel( Size( 5, 5 ), MapMode( MAP_APPFONT ) ) );
-
- maLayout.setParentWindow( this );
- maLayout.setOuterBorder( aBorder.Width() );
+ boost::shared_ptr<vcl::RowOrColumn> xLayout =
+ boost::dynamic_pointer_cast<vcl::RowOrColumn>( getLayout() );
// add printer fixed line
- maLayout.addWindow( &maPrinterFL );
+ xLayout->addWindow( &maPrinterFL );
// add print LB
- maLayout.addWindow( &maPrinters, 3 );
+ xLayout->addWindow( &maPrinters, 3 );
// create a row for details button/text and properties button
- boost::shared_ptr< vcl::RowOrColumn > xDetRow( new vcl::RowOrColumn( &maLayout, false ) );
- maLayout.addChild( xDetRow );
+ boost::shared_ptr< vcl::RowOrColumn > xDetRow( new vcl::RowOrColumn( xLayout.get(), false ) );
+ xLayout->addChild( xDetRow );
xDetRow->addWindow( &maDetailsBtn );
xDetRow->addChild( new vcl::Spacer( xDetRow.get(), 2 ) );
xDetRow->addWindow( &maSetupButton );
// create an indent for details
- boost::shared_ptr< vcl::Indenter > xIndent( new vcl::Indenter( &maLayout ) );
- maLayout.addChild( xIndent );
+ boost::shared_ptr< vcl::Indenter > xIndent( new vcl::Indenter( xLayout.get() ) );
+ xLayout->addChild( xIndent );
// remember details controls
mxDetails = xIndent;
// create a column for the details
- boost::shared_ptr< vcl::LabelColumn > xLabelCol( new vcl::LabelColumn( xIndent.get(), aBorder.Height() ) );
+ boost::shared_ptr< vcl::LabelColumn > xLabelCol( new vcl::LabelColumn( xIndent.get() ) );
xIndent->setChild( xLabelCol );
xLabelCol->addRow( &maStatusLabel, &maStatusTxt );
xLabelCol->addRow( &maLocationLabel, &maLocationTxt );
xLabelCol->addRow( &maCommentLabel, &maCommentTxt );
// add print range and copies columns
- maLayout.addWindow( &maCopies );
- boost::shared_ptr< vcl::RowOrColumn > xRangeRow( new vcl::RowOrColumn( &maLayout, false, aBorder.Width() ) );
- maLayout.addChild( xRangeRow );
+ xLayout->addWindow( &maCopies );
+ boost::shared_ptr< vcl::RowOrColumn > xRangeRow( new vcl::RowOrColumn( xLayout.get(), false ) );
+ xLayout->addChild( xRangeRow );
// create print range and add to range row
mxPrintRange.reset( new vcl::RowOrColumn( xRangeRow.get() ) );
@@ -740,11 +771,6 @@ void PrintDialog::JobTabPage::storeToSettings()
rtl::OUString::createFromAscii( maCollateBox.IsChecked() ? "true" : "false" ) );
}
-void PrintDialog::JobTabPage::Resize()
-{
- maLayout.setManagedArea( Rectangle( Point( 0, 0 ), GetSizePixel() ) );
-}
-
PrintDialog::OutputOptPage::OutputOptPage( Window* i_pParent, const ResId& i_rResId )
: TabPage( i_pParent, i_rResId )
, maOptionsLine( this, VclResId( SV_PRINT_OPT_PRINT_FL ) )
@@ -768,15 +794,13 @@ PrintDialog::OutputOptPage::~OutputOptPage()
void PrintDialog::OutputOptPage::setupLayout()
{
- Size aBorder( LogicToPixel( Size( 5, 5 ), MapMode( MAP_APPFONT ) ) );
+ boost::shared_ptr<vcl::RowOrColumn> xLayout =
+ boost::dynamic_pointer_cast<vcl::RowOrColumn>( getLayout() );
- maLayout.setParentWindow( this );
- maLayout.setOuterBorder( aBorder.Width() );
-
- maLayout.addWindow( &maOptionsLine );
- boost::shared_ptr<vcl::Indenter> xIndent( new vcl::Indenter( &maLayout, aBorder.Width() ) );
- maLayout.addChild( xIndent );
- boost::shared_ptr<vcl::RowOrColumn> xCol( new vcl::RowOrColumn( xIndent.get(), aBorder.Height() ) );
+ xLayout->addWindow( &maOptionsLine );
+ boost::shared_ptr<vcl::Indenter> xIndent( new vcl::Indenter( xLayout.get(), -1 ) );
+ xLayout->addChild( xIndent );
+ boost::shared_ptr<vcl::RowOrColumn> xCol( new vcl::RowOrColumn( xIndent.get() ) );
xIndent->setChild( xCol );
mxOptGroup = xCol;
xCol->addWindow( &maToFileBox );
@@ -804,12 +828,6 @@ void PrintDialog::OutputOptPage::storeToSettings()
rtl::OUString::createFromAscii( maToFileBox.IsChecked() ? "true" : "false" ) );
}
-void PrintDialog::OutputOptPage::Resize()
-{
- maLayout.setManagedArea( Rectangle( Point( 0, 0 ), GetSizePixel() ) );
-}
-
-
PrintDialog::PrintDialog( Window* i_pParent, const boost::shared_ptr<PrinterController>& i_rController )
: ModalDialog( i_pParent, VclResId( SV_DLG_PRINT ) )
, maOKButton( this, VclResId( SV_PRINT_OK ) )
@@ -1017,13 +1035,14 @@ PrintDialog::~PrintDialog()
void PrintDialog::setupLayout()
{
- Size aBorder( LogicToPixel( Size( 5, 5 ), MapMode( MAP_APPFONT ) ) );
+ boost::shared_ptr<vcl::RowOrColumn> xLayout =
+ boost::dynamic_pointer_cast<vcl::RowOrColumn>( getLayout() );
+ xLayout->setOuterBorder( 0 );
- maLayout.setParentWindow( this );
- boost::shared_ptr< vcl::RowOrColumn > xPreviewAndTab( new vcl::RowOrColumn( &maLayout, false ) );
- size_t nIndex = maLayout.addChild( xPreviewAndTab, 5 );
- maLayout.setBorders( nIndex, aBorder.Width(), aBorder.Width(), aBorder.Width(), 0 );
+ boost::shared_ptr< vcl::RowOrColumn > xPreviewAndTab( new vcl::RowOrColumn( xLayout.get(), false ) );
+ size_t nIndex = xLayout->addChild( xPreviewAndTab, 5 );
+ xLayout->setBorders( nIndex, -1, -1, -1, 0 );
// setup column for preview and sub controls
boost::shared_ptr< vcl::RowOrColumn > xPreview( new vcl::RowOrColumn( xPreviewAndTab.get() ) );
@@ -1047,12 +1066,12 @@ void PrintDialog::setupLayout()
xPreviewAndTab->addWindow( &maTabCtrl );
// add the button line
- maLayout.addWindow( &maButtonLine );
+ xLayout->addWindow( &maButtonLine );
// add the row for the buttons
- boost::shared_ptr< vcl::RowOrColumn > xButtons( new vcl::RowOrColumn( &maLayout, false ) );
- nIndex = maLayout.addChild( xButtons );
- maLayout.setBorders( nIndex, aBorder.Width(), 0, aBorder.Width(), aBorder.Width() );
+ boost::shared_ptr< vcl::RowOrColumn > xButtons( new vcl::RowOrColumn( xLayout.get(), false ) );
+ nIndex = xLayout->addChild( xButtons );
+ xLayout->setBorders( nIndex, -1, 0, -1, -1 );
Size aMinSize( maCancelButton.GetSizePixel() );
// insert help button
@@ -1127,24 +1146,24 @@ bool PrintDialog::isSingleJobs()
static void setSmartId( Window* i_pWindow, const char* i_pType, sal_Int32 i_nId = -1, const rtl::OUString& i_rPropName = rtl::OUString() )
{
- rtl::OUStringBuffer aBuf( 256 );
- aBuf.appendAscii( HELPID_PREFIX );
+ rtl::OStringBuffer aBuf( 256 );
+ aBuf.append( HELPID_PREFIX );
if( i_rPropName.getLength() )
{
- aBuf.append( sal_Unicode( ':' ) );
- aBuf.append( i_rPropName );
+ aBuf.append( ':' );
+ aBuf.append( rtl::OUStringToOString( i_rPropName, RTL_TEXTENCODING_UTF8 ) );
}
if( i_pType )
{
- aBuf.append( sal_Unicode( ':' ) );
- aBuf.appendAscii( i_pType );
+ aBuf.append( ':' );
+ aBuf.append( i_pType );
}
if( i_nId >= 0 )
{
- aBuf.append( sal_Unicode( ':' ) );
+ aBuf.append( ':' );
aBuf.append( i_nId );
}
- i_pWindow->SetSmartHelpId( SmartId( aBuf.makeStringAndClear(), HID_PRINTDLG ) );
+ i_pWindow->SetHelpId( aBuf.makeStringAndClear() );
}
static void setHelpText( Window* /*i_pWindow*/, const Sequence< rtl::OUString >& /*i_rHelpTexts*/, sal_Int32 /*i_nIndex*/ )
@@ -1170,17 +1189,15 @@ void updateMaxSize( const Size& i_rCheckSize, Size& o_rMaxSize )
void PrintDialog::setupOptionalUI()
{
- Size aBorder( LogicToPixel( Size( 5, 5 ), MapMode( MAP_APPFONT ) ) );
-
- std::vector<vcl::RowOrColumn*> aDynamicColumns;
- vcl::RowOrColumn* pCurColumn = 0;
+ std::vector< boost::shared_ptr<vcl::RowOrColumn> > aDynamicColumns;
+ boost::shared_ptr< vcl::RowOrColumn > pCurColumn;
Window* pCurParent = 0, *pDynamicPageParent = 0;
USHORT nOptPageId = 9, nCurSubGroup = 0;
bool bOnStaticPage = false;
bool bSubgroupOnStaticPage = false;
- std::multimap< rtl::OUString, vcl::RowOrColumn* > aPropertyToDependencyRowMap;
+ std::multimap< rtl::OUString, boost::shared_ptr<vcl::RowOrColumn> > aPropertyToDependencyRowMap;
const Sequence< PropertyValue >& rOptions( maPController->getUIOptions() );
for( int i = 0; i < rOptions.getLength(); i++ )
@@ -1194,6 +1211,7 @@ void PrintDialog::setupOptionalUI()
rtl::OUString aText;
rtl::OUString aPropertyName;
Sequence< rtl::OUString > aChoices;
+ Sequence< sal_Bool > aChoicesDisabled;
Sequence< rtl::OUString > aHelpTexts;
sal_Int64 nMinValue = 0, nMaxValue = 0;
sal_Int32 nCurHelpText = 0;
@@ -1217,6 +1235,10 @@ void PrintDialog::setupOptionalUI()
{
rEntry.Value >>= aChoices;
}
+ else if( rEntry.Name.equalsAscii( "ChoicesDisabled" ) )
+ {
+ rEntry.Value >>= aChoicesDisabled;
+ }
else if( rEntry.Name.equalsAscii( "Property" ) )
{
PropertyValue aVal;
@@ -1286,37 +1308,40 @@ void PrintDialog::setupOptionalUI()
{
// restore to dynamic
pCurParent = pDynamicPageParent;
- pCurColumn = aDynamicColumns.empty() ? NULL : aDynamicColumns.back();
+ if( ! aDynamicColumns.empty() )
+ pCurColumn = aDynamicColumns.back();
+ else
+ pCurColumn.reset();
bOnStaticPage = false;
bSubgroupOnStaticPage = false;
if( aGroupingHint.equalsAscii( "PrintRange" ) )
{
- pCurColumn = maJobPage.mxPrintRange.get();
+ pCurColumn = maJobPage.mxPrintRange;
pCurParent = &maJobPage; // set job page as current parent
bOnStaticPage = true;
}
else if( aGroupingHint.equalsAscii( "OptionsPage" ) )
{
- pCurColumn = &maOptionsPage.maLayout;
+ pCurColumn = boost::dynamic_pointer_cast<vcl::RowOrColumn>(maOptionsPage.getLayout());
pCurParent = &maOptionsPage; // set options page as current parent
bOnStaticPage = true;
}
else if( aGroupingHint.equalsAscii( "OptionsPageOptGroup" ) )
{
- pCurColumn = maOptionsPage.mxOptGroup.get();
+ pCurColumn = maOptionsPage.mxOptGroup;
pCurParent = &maOptionsPage; // set options page as current parent
bOnStaticPage = true;
}
else if( aGroupingHint.equalsAscii( "LayoutPage" ) )
{
- pCurColumn = &maNUpPage.maLayout;
+ pCurColumn = boost::dynamic_pointer_cast<vcl::RowOrColumn>(maNUpPage.getLayout());
pCurParent = &maNUpPage; // set layout page as current parent
bOnStaticPage = true;
}
else if( aGroupingHint.getLength() )
{
- pCurColumn = &maJobPage.maLayout;
+ pCurColumn = boost::dynamic_pointer_cast<vcl::RowOrColumn>(maJobPage.getLayout());
pCurParent = &maJobPage; // set job page as current parent
bOnStaticPage = true;
}
@@ -1341,10 +1366,9 @@ void PrintDialog::setupOptionalUI()
// reset subgroup counter
nCurSubGroup = 0;
- aDynamicColumns.push_back( new vcl::RowOrColumn( NULL, true, aBorder.Width() ) );
+ aDynamicColumns.push_back( boost::dynamic_pointer_cast<vcl::RowOrColumn>(pNewGroup->getLayout()) );
pCurColumn = aDynamicColumns.back();
pCurColumn->setParentWindow( pNewGroup );
- pCurColumn->setOuterBorder( aBorder.Width() );
bSubgroupOnStaticPage = false;
bOnStaticPage = false;
}
@@ -1374,10 +1398,10 @@ void PrintDialog::setupOptionalUI()
}
// add an indent to the current column
- vcl::Indenter* pIndent = new vcl::Indenter( pCurColumn, aBorder.Width() );
+ vcl::Indenter* pIndent = new vcl::Indenter( pCurColumn.get(), -1 );
pCurColumn->addChild( pIndent );
// and create a column inside the indent
- pCurColumn = new vcl::RowOrColumn( pIndent );
+ pCurColumn.reset( new vcl::RowOrColumn( pIndent ) );
pIndent->setChild( pCurColumn );
}
// EVIL
@@ -1401,17 +1425,17 @@ void PrintDialog::setupOptionalUI()
maPropertyToWindowMap[ aPropertyName ].push_back( &maNUpPage.maBrochureBtn );
maControlToPropertyMap[&maNUpPage.maBrochureBtn] = aPropertyName;
- aPropertyToDependencyRowMap.insert( std::pair< rtl::OUString, vcl::RowOrColumn* >( aPropertyName, maNUpPage.mxBrochureDep.get() ) );
+ aPropertyToDependencyRowMap.insert( std::pair< rtl::OUString, boost::shared_ptr<vcl::RowOrColumn> >( aPropertyName, maNUpPage.mxBrochureDep ) );
}
else
{
- vcl::RowOrColumn* pSaveCurColumn = pCurColumn;
+ boost::shared_ptr<vcl::RowOrColumn> pSaveCurColumn( pCurColumn );
if( bUseDependencyRow )
{
// find the correct dependency row (if any)
- std::pair< std::multimap< rtl::OUString, vcl::RowOrColumn* >::iterator,
- std::multimap< rtl::OUString, vcl::RowOrColumn* >::iterator > aDepRange;
+ std::pair< std::multimap< rtl::OUString, boost::shared_ptr<vcl::RowOrColumn> >::iterator,
+ std::multimap< rtl::OUString, boost::shared_ptr<vcl::RowOrColumn> >::iterator > aDepRange;
aDepRange = aPropertyToDependencyRowMap.equal_range( aDependsOnName );
if( aDepRange.first != aDepRange.second )
{
@@ -1450,16 +1474,16 @@ void PrintDialog::setupOptionalUI()
// set help text
setHelpText( pNewBox, aHelpTexts, 0 );
- vcl::RowOrColumn* pDependencyRow = new vcl::RowOrColumn( pCurColumn, false );
+ boost::shared_ptr<vcl::RowOrColumn> pDependencyRow( new vcl::RowOrColumn( pCurColumn.get(), false ) );
pCurColumn->addChild( pDependencyRow );
- aPropertyToDependencyRowMap.insert( std::pair< rtl::OUString, vcl::RowOrColumn* >( aPropertyName, pDependencyRow ) );
+ aPropertyToDependencyRowMap.insert( std::pair< rtl::OUString, boost::shared_ptr<vcl::RowOrColumn> >( aPropertyName, pDependencyRow ) );
// add checkbox to current column
pDependencyRow->addWindow( pNewBox );
}
else if( aCtrlType.equalsAscii( "Radio" ) && pCurParent )
{
- vcl::RowOrColumn* pRadioColumn = pCurColumn;
+ boost::shared_ptr<vcl::RowOrColumn> pRadioColumn( pCurColumn );
if( aText.getLength() )
{
// add a FixedText:
@@ -1475,10 +1499,10 @@ void PrintDialog::setupOptionalUI()
// add fixed text to current column
pCurColumn->addWindow( pHeading );
// add an indent to the current column
- vcl::Indenter* pIndent = new vcl::Indenter( pCurColumn, 15 );
+ vcl::Indenter* pIndent = new vcl::Indenter( pCurColumn.get(), 15 );
pCurColumn->addChild( pIndent );
// and create a column inside the indent
- pRadioColumn = new vcl::RowOrColumn( pIndent );
+ pRadioColumn.reset( new vcl::RowOrColumn( pIndent ) );
pIndent->setChild( pRadioColumn );
}
// iterate options
@@ -1488,17 +1512,19 @@ void PrintDialog::setupOptionalUI()
pVal->Value >>= nSelectVal;
for( sal_Int32 m = 0; m < aChoices.getLength(); m++ )
{
- boost::shared_ptr<vcl::LabeledElement> pLabel( new vcl::LabeledElement( pRadioColumn, 1 ) );
+ boost::shared_ptr<vcl::LabeledElement> pLabel( new vcl::LabeledElement( pRadioColumn.get(), 1 ) );
pRadioColumn->addChild( pLabel );
boost::shared_ptr<vcl::RowOrColumn> pDependencyRow( new vcl::RowOrColumn( pLabel.get(), false ) );
pLabel->setElement( pDependencyRow );
- aPropertyToDependencyRowMap.insert( std::pair< rtl::OUString, vcl::RowOrColumn* >( aPropertyName, pDependencyRow.get() ) );
+ aPropertyToDependencyRowMap.insert( std::pair< rtl::OUString, boost::shared_ptr<vcl::RowOrColumn> >( aPropertyName, pDependencyRow ) );
RadioButton* pBtn = new RadioButton( pCurParent, m == 0 ? WB_GROUP : 0 );
maControls.push_front( pBtn );
pBtn->SetText( aChoices[m] );
pBtn->Check( m == nSelectVal );
pBtn->SetToggleHdl( LINK( this, PrintDialog, UIOption_RadioHdl ) );
+ if( aChoicesDisabled.getLength() > m && aChoicesDisabled[m] == sal_True )
+ pBtn->Enable( FALSE );
pBtn->Show();
maPropertyToWindowMap[ aPropertyName ].push_back( pBtn );
maControlToPropertyMap[pBtn] = aPropertyName;
@@ -1518,9 +1544,9 @@ void PrintDialog::setupOptionalUI()
) && pCurParent )
{
// create a row in the current column
- vcl::RowOrColumn* pFieldColumn = new vcl::RowOrColumn( pCurColumn, false );
+ boost::shared_ptr<vcl::RowOrColumn> pFieldColumn( new vcl::RowOrColumn( pCurColumn.get(), false ) );
pCurColumn->addChild( pFieldColumn );
- aPropertyToDependencyRowMap.insert( std::pair< rtl::OUString, vcl::RowOrColumn* >( aPropertyName, pFieldColumn ) );
+ aPropertyToDependencyRowMap.insert( std::pair< rtl::OUString, boost::shared_ptr<vcl::RowOrColumn> >( aPropertyName, pFieldColumn ) );
vcl::LabeledElement* pLabel = NULL;
if( aText.getLength() )
@@ -1535,7 +1561,7 @@ void PrintDialog::setupOptionalUI()
setSmartId( pHeading, "FixedText", -1, aPropertyName );
// add to row
- pLabel = new vcl::LabeledElement( pFieldColumn, 2 );
+ pLabel = new vcl::LabeledElement( pFieldColumn.get(), 2 );
pFieldColumn->addChild( pLabel );
pLabel->setLabel( pHeading );
}
@@ -1670,11 +1696,11 @@ void PrintDialog::setupOptionalUI()
// FIXME: the GetNativeControlRegion call on Windows has some issues
// (which skew the results of GetOptimalSize())
// however fixing this thoroughly needs to take interaction with paint into
- // acoount, making the right fix less simple. Fix this the right way
+ // account, making the right fix less simple. Fix this the right way
// at some point. For now simply add some space at the lowest element
- size_t nIndex = maJobPage.maLayout.countElements();
+ size_t nIndex = maJobPage.getLayout()->countElements();
if( nIndex > 0 ) // sanity check
- maJobPage.maLayout.setBorders( nIndex-1, 0, 0, 0, aBorder.Width() );
+ maJobPage.getLayout()->setBorders( nIndex-1, 0, 0, 0, -1 );
#endif
// create auto mnemomnics now so they can be calculated in layout
@@ -1684,13 +1710,13 @@ void PrintDialog::setupOptionalUI()
ImplWindowAutoMnemonic( this );
// calculate job page
- Size aMaxSize = maJobPage.maLayout.getOptimalSize( WINDOWSIZE_PREFERRED );
+ Size aMaxSize = maJobPage.getLayout()->getOptimalSize( WINDOWSIZE_PREFERRED );
// and layout page
- updateMaxSize( maNUpPage.maLayout.getOptimalSize( WINDOWSIZE_PREFERRED ), aMaxSize );
+ updateMaxSize( maNUpPage.getLayout()->getOptimalSize( WINDOWSIZE_PREFERRED ), aMaxSize );
// and options page
- updateMaxSize( maOptionsPage.maLayout.getOptimalSize( WINDOWSIZE_PREFERRED ), aMaxSize );
+ updateMaxSize( maOptionsPage.getLayout()->getOptimalSize( WINDOWSIZE_PREFERRED ), aMaxSize );
- for( std::vector< vcl::RowOrColumn* >::iterator it = aDynamicColumns.begin();
+ for( std::vector< boost::shared_ptr<vcl::RowOrColumn> >::iterator it = aDynamicColumns.begin();
it != aDynamicColumns.end(); ++it )
{
Size aPageSize( (*it)->getOptimalSize( WINDOWSIZE_PREFERRED ) );
@@ -1718,19 +1744,7 @@ void PrintDialog::setupOptionalUI()
maTabCtrl.SetMinimumSizePixel( maTabCtrl.GetSizePixel() );
}
- // and finally arrange controls
- for( std::vector< vcl::RowOrColumn* >::iterator it = aDynamicColumns.begin();
- it != aDynamicColumns.end(); ++it )
- {
- (*it)->setManagedArea( Rectangle( Point(), aTabSize ) );
- delete *it;
- *it = NULL;
- }
- maJobPage.Resize();
- maNUpPage.Resize();
- maOptionsPage.Resize();
-
- Size aSz = maLayout.getOptimalSize( WINDOWSIZE_PREFERRED );
+ Size aSz = getLayout()->getOptimalSize( WINDOWSIZE_PREFERRED );
SetOutputSizePixel( aSz );
}
@@ -1765,7 +1779,7 @@ void PrintDialog::checkControlDependencies()
maJobPage.maCollateImage.SetSizePixel( aImgSize );
maJobPage.maCollateImage.SetImage( bHC ? aHCImg : aImg );
maJobPage.maCollateImage.SetModeImage( aHCImg, BMP_COLOR_HIGHCONTRAST );
- maJobPage.maLayout.resize();
+ maJobPage.getLayout()->resize();
// enable setup button only for printers that can be setup
bool bHaveSetup = maPController->getPrinter()->HasSupport( SUPPORT_SETUPDIALOG );
@@ -1780,7 +1794,7 @@ void PrintDialog::checkControlDependencies()
aPrinterSize.Width() = aSetupPos.X() - aPrinterPos.X() - LogicToPixel( Size( 5, 5 ), MapMode( MAP_APPFONT ) ).Width();
maJobPage.maPrinters.SetSizePixel( aPrinterSize );
maJobPage.maSetupButton.Show();
- maLayout.resize();
+ getLayout()->resize();
}
}
else
@@ -1794,7 +1808,7 @@ void PrintDialog::checkControlDependencies()
aPrinterSize.Width() = aSetupPos.X() + aSetupSize.Width() - aPrinterPos.X();
maJobPage.maPrinters.SetSizePixel( aPrinterSize );
maJobPage.maSetupButton.Hide();
- maLayout.resize();
+ getLayout()->resize();
}
}
}
@@ -1823,6 +1837,16 @@ void PrintDialog::checkOptionalControlDependencies()
}
}
+ if( bShouldbeEnabled && dynamic_cast<RadioButton*>(it->first) )
+ {
+ std::map< Window*, sal_Int32 >::const_iterator r_it = maControlToNumValMap.find( it->first );
+ if( r_it != maControlToNumValMap.end() )
+ {
+ bShouldbeEnabled = maPController->isUIChoiceEnabled( it->second, r_it->second );
+ }
+ }
+
+
bool bIsEnabled = it->first->IsEnabled();
// Enable does not do a change check first, so can be less cheap than expected
if( bShouldbeEnabled != bIsEnabled )
@@ -2025,7 +2049,7 @@ void PrintDialog::updateNupFromPages()
if( bCustom )
{
// see if we have to enlarge the dialog to make the tab page fit
- Size aCurSize( maNUpPage.maLayout.getOptimalSize( WINDOWSIZE_PREFERRED ) );
+ Size aCurSize( maNUpPage.getLayout()->getOptimalSize( WINDOWSIZE_PREFERRED ) );
Size aTabSize( maTabCtrl.GetTabPageSizePixel() );
if( aTabSize.Height() < aCurSize.Height() )
{
@@ -2061,10 +2085,14 @@ void PrintDialog::updateNup()
int nOrderMode = int(sal_IntPtr(maNUpPage.maNupOrderBox.GetEntryData(
maNUpPage.maNupOrderBox.GetSelectEntryPos() )));
- if( nOrderMode == SV_PRINT_PRT_NUP_ORDER_LRTD )
+ if( nOrderMode == SV_PRINT_PRT_NUP_ORDER_LRTB )
aMPS.nOrder = PrinterController::LRTB;
- else if( nOrderMode == SV_PRINT_PRT_NUP_ORDER_TDLR )
+ else if( nOrderMode == SV_PRINT_PRT_NUP_ORDER_TBLR )
aMPS.nOrder = PrinterController::TBLR;
+ else if( nOrderMode == SV_PRINT_PRT_NUP_ORDER_RLTB )
+ aMPS.nOrder = PrinterController::RLTB;
+ else if( nOrderMode == SV_PRINT_PRT_NUP_ORDER_TBRL )
+ aMPS.nOrder = PrinterController::TBRL;
int nOrientationMode = int(sal_IntPtr(maNUpPage.maNupOrientationBox.GetEntryData(
maNUpPage.maNupOrientationBox.GetSelectEntryPos() )));
@@ -2130,7 +2158,7 @@ IMPL_LINK( PrintDialog, ClickHdl, Button*, pButton )
if( pHelp )
{
// FIXME: find out proper help URL and use here
- pHelp->Start( HID_PRINTDLG, GetParent() );
+ pHelp->Start( rtl::OStringToOUString( GetHelpId(), RTL_TEXTENCODING_UTF8 ), GetParent() );
}
}
else if( pButton == &maForwardBtn )
@@ -2144,7 +2172,7 @@ IMPL_LINK( PrintDialog, ClickHdl, Button*, pButton )
else if( pButton == &maOptionsPage.maToFileBox )
{
maOKButton.SetText( maOptionsPage.maToFileBox.IsChecked() ? maPrintToFileText : maPrintText );
- maLayout.resize();
+ getLayout()->resize();
}
else if( pButton == &maNUpPage.maBrochureBtn )
{
@@ -2180,7 +2208,7 @@ IMPL_LINK( PrintDialog, ClickHdl, Button*, pButton )
{
maDetailsCollapsedSize = GetOutputSizePixel();
// enlarge dialog if necessary
- Size aMinSize( maJobPage.maLayout.getOptimalSize( WINDOWSIZE_MINIMUM ) );
+ Size aMinSize( maJobPage.getLayout()->getOptimalSize( WINDOWSIZE_MINIMUM ) );
Size aCurSize( maJobPage.GetSizePixel() );
if( aCurSize.Height() < aMinSize.Height() )
{
@@ -2454,7 +2482,7 @@ void PrintDialog::Command( const CommandEvent& rEvt )
void PrintDialog::Resize()
{
- maLayout.setManagedArea( Rectangle( Point( 0, 0 ), GetSizePixel() ) );
+ // maLayout.setManagedArea( Rectangle( Point( 0, 0 ), GetSizePixel() ) );
// and do the preview; however the metafile does not need to be gotten anew
preparePreview( false );
@@ -2558,6 +2586,7 @@ void PrintProgressDialog::tick()
void PrintProgressDialog::reset()
{
+ mbCanceled = false;
setProgress( 0 );
}
diff --git a/vcl/source/window/splitwin.cxx b/vcl/source/window/splitwin.cxx
index 689c56cbe619..62fbe2e507f3 100644
--- a/vcl/source/window/splitwin.cxx
+++ b/vcl/source/window/splitwin.cxx
@@ -49,7 +49,8 @@
// =======================================================================
-// Achtung: Darf keine Objekte enthalten, da mit memmove/memcpy gearbeitet wird
+// Attention: Must not contain non-PODs because array is enlarged/copied
+// with the use of memmove/memcpy.
struct ImplSplitItem
{
long mnSize;
@@ -71,6 +72,10 @@ struct ImplSplitItem
SplitWindowItemBits mnBits;
BOOL mbFixed;
BOOL mbSubSize;
+ /// Minimal width or height of the item. -1 means no restriction.
+ long mnMinSize;
+ /// Maximal width or height of the item. -1 means no restriction.
+ long mnMaxSize;
};
struct ImplSplitSet
@@ -85,6 +90,28 @@ struct ImplSplitSet
BOOL mbCalcPix;
};
+
+
+/** Check whether the given size is inside the valid range defined by
+ [rItem.mnMinSize,rItem.mnMaxSize]. When it is not inside it then return
+ the upper or lower bound, respectively. Otherwise return the given size
+ unmodified.
+ Note that either mnMinSize and/or mnMaxSize can be -1 in which case the
+ size has not lower or upper bound.
+*/
+namespace {
+ long ValidateSize (const long nSize, const ImplSplitItem rItem)
+ {
+ if (rItem.mnMinSize>=0 && nSize<rItem.mnMinSize)
+ return rItem.mnMinSize;
+ else if (rItem.mnMaxSize>0 && nSize>rItem.mnMaxSize)
+ return rItem.mnMaxSize;
+ else
+ return nSize;
+ }
+}
+
+
#define SPLITWIN_SPLITSIZE 3
#define SPLITWIN_SPLITSIZEEX 4
#define SPLITWIN_SPLITSIZEEXLN 6
@@ -2850,7 +2877,7 @@ void SplitWindow::InsertItem( USHORT nId, Window* pWindow, long nSize,
DBG_ASSERT( !ImplFindItem( mpMainSet, nId, nDbgDummy ), "SplitWindow::InsertItem() - Id already exists" );
#endif
- // Size muss min. 1 sein
+ // Size has to be at least 1.
if ( nSize < 1 )
nSize = 1;
@@ -2858,7 +2885,7 @@ void SplitWindow::InsertItem( USHORT nId, Window* pWindow, long nSize,
ImplSplitSet* pNewSet;
ImplSplitItem* pItem;
- // Platz fuer neues Item schaffen
+ // Make room for the new item.
if ( nPos > pSet->mnItems )
nPos = pSet->mnItems;
ImplSplitItem* pNewItems = new ImplSplitItem[pSet->mnItems+1];
@@ -2871,19 +2898,21 @@ void SplitWindow::InsertItem( USHORT nId, Window* pWindow, long nSize,
pSet->mnItems++;
pSet->mbCalcPix = TRUE;
- // Item anlegen und erweitern
+ // Create and initialize item.
pItem = &(pSet->mpItems[nPos]);
memset( pItem, 0, sizeof( ImplSplitItem ) );
pItem->mnSize = nSize;
pItem->mnId = nId;
pItem->mnBits = nBits;
+ pItem->mnMinSize=-1;
+ pItem->mnMaxSize=-1;
if ( pWindow )
{
pItem->mpWindow = pWindow;
pItem->mpOrgParent = pWindow->GetParent();
- // Window mit SplitWindow verbinden
+ // Attach window to SplitWindow.
pWindow->Hide();
pWindow->SetParent( this );
}
@@ -3251,6 +3280,10 @@ void SplitWindow::SplitItem( USHORT nId, long nNewSize,
nItems = pSet->mnItems;
pItems = pSet->mpItems;
+ // When there is an explicit minimum or maximum size then move nNewSize
+ // into that range (when it is not yet already in it.)
+ nNewSize = ValidateSize(nNewSize, pItems[nPos]);
+
if ( mbCalc )
{
pItems[nPos].mnSize = nNewSize;
@@ -3552,6 +3585,36 @@ long SplitWindow::GetItemSize( USHORT nId, SplitWindowItemBits nBits ) const
return 0;
}
+
+
+
+void SplitWindow::SetItemSizeRange (USHORT nId, const Range aRange)
+{
+ USHORT nPos;
+ ImplSplitSet* pSet = ImplFindItem(mpBaseSet, nId, nPos);
+
+ if (pSet != NULL)
+ {
+ pSet->mpItems[nPos].mnMinSize = aRange.Min();
+ pSet->mpItems[nPos].mnMaxSize = aRange.Max();
+ }
+}
+
+
+
+
+Range SplitWindow::GetItemSizeRange (USHORT nId) const
+{
+ USHORT nPos;
+ ImplSplitSet* pSet = ImplFindItem(mpBaseSet, nId, nPos);
+
+ if (pSet != NULL)
+ return Range (pSet->mpItems[nPos].mnMinSize, pSet->mpItems[nPos].mnMaxSize);
+ else
+ return Range(-1,-1);
+}
+
+
// -----------------------------------------------------------------------
void SplitWindow::SetItemBits( USHORT nId, SplitWindowItemBits nNewBits )
diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx
index 385dd241c770..36f27b1ceee7 100644
--- a/vcl/source/window/status.cxx
+++ b/vcl/source/window/status.cxx
@@ -89,7 +89,7 @@ struct ImplStatusItem
XubString maText;
XubString maHelpText;
XubString maQuickHelpText;
- ULONG mnHelpId;
+ rtl::OString maHelpId;
void* mpUserData;
BOOL mbVisible;
XubString maAccessibleName;
@@ -320,6 +320,8 @@ void StatusBar::ImplFormat()
nExtraWidth2 = 0;
}
nX = STATUSBAR_OFFSET_X;
+ if( ImplHasMirroredGraphics() && IsRTLEnabled() )
+ nX += ImplGetSVData()->maNWFData.mnStatusBarLowerRightOffset;
}
pItem = mpItemList->First();
@@ -833,7 +835,7 @@ void StatusBar::Resize()
{
// Breite und Hoehe abfragen und merken
Size aSize = GetOutputSizePixel();
- mnDX = aSize.Width();
+ mnDX = aSize.Width() - ImplGetSVData()->maNWFData.mnStatusBarLowerRightOffset;
mnDY = aSize.Height();
mnCalcHeight = mnDY;
// subtract border
@@ -904,9 +906,9 @@ void StatusBar::RequestHelp( const HelpEvent& rHEvt )
else if ( rHEvt.GetMode() & HELPMODE_EXTENDED )
{
String aCommand = GetItemCommand( nItemId );
- ULONG nHelpId = GetHelpId( nItemId );
+ rtl::OString aHelpId( GetHelpId( nItemId ) );
- if ( aCommand.Len() || nHelpId )
+ if ( aCommand.Len() || aHelpId.getLength() )
{
// Wenn eine Hilfe existiert, dann ausloesen
Help* pHelp = Application::GetHelp();
@@ -914,8 +916,8 @@ void StatusBar::RequestHelp( const HelpEvent& rHEvt )
{
if ( aCommand.Len() )
pHelp->Start( aCommand, this );
- else if ( nHelpId )
- pHelp->Start( nHelpId, this );
+ else if ( aHelpId.getLength() )
+ pHelp->Start( rtl::OStringToOUString( aHelpId, RTL_TEXTENCODING_UTF8 ), this );
}
return;
}
@@ -1031,7 +1033,6 @@ void StatusBar::InsertItem( USHORT nItemId, ULONG nWidth,
pItem->mnBits = nBits;
pItem->mnWidth = (long)nWidth+nFudge+STATUSBAR_OFFSET;
pItem->mnOffset = nOffset;
- pItem->mnHelpId = 0;
pItem->mpUserData = 0;
pItem->mbVisible = TRUE;
@@ -1473,15 +1474,15 @@ const XubString& StatusBar::GetHelpText( USHORT nItemId ) const
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
{
ImplStatusItem* pItem = mpItemList->GetObject( nPos );
- if ( !pItem->maHelpText.Len() && ( pItem->mnHelpId || pItem->maCommand.Len() ))
+ if ( !pItem->maHelpText.Len() && ( pItem->maHelpId.getLength() || pItem->maCommand.Len() ))
{
Help* pHelp = Application::GetHelp();
if ( pHelp )
{
if ( pItem->maCommand.Len() )
pItem->maHelpText = pHelp->GetHelpText( pItem->maCommand, this );
- if ( !pItem->maHelpText.Len() && pItem->mnHelpId )
- pItem->maHelpText = pHelp->GetHelpText( pItem->mnHelpId, this );
+ if ( !pItem->maHelpText.Len() && pItem->maHelpId.getLength() )
+ pItem->maHelpText = pHelp->GetHelpText( rtl::OStringToOUString( pItem->maHelpId, RTL_TEXTENCODING_UTF8 ), this );
}
}
@@ -1518,24 +1519,31 @@ const XubString& StatusBar::GetQuickHelpText( USHORT nItemId ) const
// -----------------------------------------------------------------------
-void StatusBar::SetHelpId( USHORT nItemId, ULONG nHelpId )
+void StatusBar::SetHelpId( USHORT nItemId, const rtl::OString& rHelpId )
{
USHORT nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
- mpItemList->GetObject( nPos )->mnHelpId = nHelpId;
+ mpItemList->GetObject( nPos )->maHelpId = rHelpId;
}
// -----------------------------------------------------------------------
-ULONG StatusBar::GetHelpId( USHORT nItemId ) const
+rtl::OString StatusBar::GetHelpId( USHORT nItemId ) const
{
USHORT nPos = GetItemPos( nItemId );
+ rtl::OString aRet;
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
- return mpItemList->GetObject( nPos )->mnHelpId;
- else
- return 0;
+ {
+ ImplStatusItem* pItem = mpItemList->GetObject( nPos );
+ if ( pItem->maHelpId.getLength() )
+ aRet = pItem->maHelpId;
+ else
+ aRet = ::rtl::OUStringToOString( pItem->maCommand, RTL_TEXTENCODING_UTF8 );
+ }
+
+ return aRet;
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/window/syschild.cxx b/vcl/source/window/syschild.cxx
index ef71f83df1ee..4e897eef4a8b 100644
--- a/vcl/source/window/syschild.cxx
+++ b/vcl/source/window/syschild.cxx
@@ -28,25 +28,34 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#ifndef _SV_SVSYS_HXX
#include <svsys.h>
-#endif
+#include <rtl/process.h>
+#include <rtl/ref.hxx>
+#include <tools/rc.h>
+#include <vcl/window.h>
#include <vcl/salinst.hxx>
#include <vcl/salframe.hxx>
#include <vcl/window.hxx>
#include <vcl/salobj.hxx>
-
-#ifndef _SV_RC_H
-#include <tools/rc.h>
-#endif
#include <vcl/svdata.hxx>
-#ifndef _SV_WIDNOW_H
-#include <vcl/window.h>
-#endif
+#include <vcl/sysdata.hxx>
#include <vcl/svapp.hxx>
#include <vcl/syschild.hxx>
+#include <vcl/unohelp.hxx>
+#ifdef SOLAR_JAVA
+#include <jni.h>
+#endif
+
+#include <comphelper/processfactory.hxx>
+#include <jvmaccess/virtualmachine.hxx>
+#include <com/sun/star/java/XJavaVM.hpp>
+#include <com/sun/star/java/XJavaThreadRegister_11.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+
+#include <vcl/syschild.hxx>
+using namespace ::com::sun::star;
// =======================================================================
@@ -183,6 +192,8 @@ void SystemChildWindow::EnableEraseBackground( BOOL bEnable )
mpWindowImpl->mpSysObj->EnableEraseBackground( bEnable );
}
+// -----------------------------------------------------------------------
+
BOOL SystemChildWindow::IsEraseBackgroundEnabled()
{
if ( mpWindowImpl->mpSysObj )
@@ -190,3 +201,138 @@ BOOL SystemChildWindow::IsEraseBackgroundEnabled()
else
return FALSE;
}
+
+// -----------------------------------------------------------------------
+
+void SystemChildWindow::ImplTestJavaException( void* pEnv )
+{
+#ifdef SOLAR_JAVA
+ JNIEnv* pJavaEnv = reinterpret_cast< JNIEnv* >( pEnv );
+ jthrowable jtThrowable = pJavaEnv->ExceptionOccurred();
+
+ if( jtThrowable )
+ { // is it a java exception ?
+#if OSL_DEBUG_LEVEL > 1
+ pJavaEnv->ExceptionDescribe();
+#endif // OSL_DEBUG_LEVEL > 1
+ pJavaEnv->ExceptionClear();
+
+ jclass jcThrowable = pJavaEnv->FindClass("java/lang/Throwable");
+ jmethodID jmThrowable_getMessage = pJavaEnv->GetMethodID(jcThrowable, "getMessage", "()Ljava/lang/String;");
+ jstring jsMessage = (jstring) pJavaEnv->CallObjectMethod(jtThrowable, jmThrowable_getMessage);
+ ::rtl::OUString ouMessage;
+
+ if(jsMessage)
+ {
+ const jchar * jcMessage = pJavaEnv->GetStringChars(jsMessage, NULL);
+ ouMessage = ::rtl::OUString(jcMessage);
+ pJavaEnv->ReleaseStringChars(jsMessage, jcMessage);
+ }
+
+ throw uno::RuntimeException(ouMessage, uno::Reference<uno::XInterface>());
+ }
+#endif // SOLAR_JAVA
+}
+
+// -----------------------------------------------------------------------
+
+sal_IntPtr SystemChildWindow::GetParentWindowHandle( sal_Bool bUseJava )
+{
+ sal_IntPtr nRet = 0;
+
+#if defined WNT
+ nRet = reinterpret_cast< sal_IntPtr >( GetSystemData()->hWnd );
+#elif defined QUARTZ
+ // FIXME: this is wrong
+ nRet = reinterpret_cast< sal_IntPtr >( GetSystemData()->pView );
+#elif defined UNX
+ if( !bUseJava )
+ {
+ nRet = (sal_IntPtr) GetSystemData()->aWindow;
+ }
+#ifdef SOLAR_JAVA
+ else
+ {
+ uno::Reference< lang::XMultiServiceFactory > xFactory( vcl::unohelper::GetMultiServiceFactory() );
+
+ if( xFactory.is() && ( GetSystemData()->aWindow > 0 ) )
+ {
+ try
+ {
+ ::rtl::Reference< ::jvmaccess::VirtualMachine > xVM;
+ uno::Reference< java::XJavaVM > xJavaVM( xFactory->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.java.JavaVirtualMachine") ) ), uno::UNO_QUERY );
+ uno::Sequence< sal_Int8 > aProcessID( 17 );
+
+ rtl_getGlobalProcessId( (sal_uInt8*) aProcessID.getArray() );
+ aProcessID[ 16 ] = 0;
+ OSL_ENSURE(sizeof (sal_Int64) >= sizeof (jvmaccess::VirtualMachine *), "Pointer cannot be represented as sal_Int64");
+ sal_Int64 nPointer = reinterpret_cast< sal_Int64 >( static_cast< jvmaccess::VirtualMachine * >(0));
+ xJavaVM->getJavaVM(aProcessID) >>= nPointer;
+ xVM = reinterpret_cast< jvmaccess::VirtualMachine * >(nPointer);
+
+ if( xVM.is() )
+ {
+ try
+ {
+ ::jvmaccess::VirtualMachine::AttachGuard aVMAttachGuard( xVM );
+ JNIEnv* pEnv = aVMAttachGuard.getEnvironment();
+
+ jclass jcToolkit = pEnv->FindClass("java/awt/Toolkit");
+ ImplTestJavaException(pEnv);
+
+ jmethodID jmToolkit_getDefaultToolkit = pEnv->GetStaticMethodID( jcToolkit, "getDefaultToolkit", "()Ljava/awt/Toolkit;" );
+ ImplTestJavaException(pEnv);
+
+ pEnv->CallStaticObjectMethod(jcToolkit, jmToolkit_getDefaultToolkit);
+ ImplTestJavaException(pEnv);
+
+ jclass jcMotifAppletViewer = pEnv->FindClass("sun/plugin/navig/motif/MotifAppletViewer");
+ if( pEnv->ExceptionOccurred() )
+ {
+ pEnv->ExceptionClear();
+
+ jcMotifAppletViewer = pEnv->FindClass( "sun/plugin/viewer/MNetscapePluginContext");
+ ImplTestJavaException(pEnv);
+ }
+
+ jclass jcClassLoader = pEnv->FindClass("java/lang/ClassLoader");
+ ImplTestJavaException(pEnv);
+
+ jmethodID jmClassLoader_loadLibrary = pEnv->GetStaticMethodID( jcClassLoader, "loadLibrary", "(Ljava/lang/Class;Ljava/lang/String;Z)V");
+ ImplTestJavaException(pEnv);
+
+ jstring jsplugin = pEnv->NewStringUTF("javaplugin_jni");
+ ImplTestJavaException(pEnv);
+
+ pEnv->CallStaticVoidMethod(jcClassLoader, jmClassLoader_loadLibrary, jcMotifAppletViewer, jsplugin, JNI_FALSE);
+ ImplTestJavaException(pEnv);
+
+ jmethodID jmMotifAppletViewer_getWidget = pEnv->GetStaticMethodID( jcMotifAppletViewer, "getWidget", "(IIIII)I" );
+ ImplTestJavaException(pEnv);
+
+ const Size aSize( GetOutputSizePixel() );
+ jint ji_widget = pEnv->CallStaticIntMethod( jcMotifAppletViewer, jmMotifAppletViewer_getWidget,
+ GetSystemData()->aWindow, 0, 0, aSize.Width(), aSize.Height() );
+ ImplTestJavaException(pEnv);
+
+ nRet = static_cast< sal_IntPtr >( ji_widget );
+ }
+ catch( uno::RuntimeException& )
+ {
+ }
+
+ if( !nRet )
+ nRet = static_cast< sal_IntPtr >( GetSystemData()->aWindow );
+ }
+ }
+ catch( ... )
+ {
+ }
+ }
+ }
+#endif // SOLAR_JAVA
+#else // WNT || QUARTZ || UNX
+#endif
+
+ return nRet;
+}
diff --git a/vcl/source/window/taskpanelist.cxx b/vcl/source/window/taskpanelist.cxx
index c09dc464b809..1adabe487492 100644
--- a/vcl/source/window/taskpanelist.cxx
+++ b/vcl/source/window/taskpanelist.cxx
@@ -206,7 +206,7 @@ BOOL TaskPaneList::HandleKeyEvent( KeyEvent aKeyEvent )
BOOL bFocusInList = FALSE;
KeyCode aKeyCode = aKeyEvent.GetKeyCode();
BOOL bForward = !aKeyCode.IsShift();
- if( aKeyCode.GetCode() == KEY_F6 ) // F6
+ if( aKeyCode.GetCode() == KEY_F6 && ! aKeyCode.IsMod2() ) // F6
{
bSplitterOnly = aKeyCode.IsMod1() && aKeyCode.IsShift();
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index cde91a8dcd97..b71cf1c13c8d 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -3451,6 +3451,8 @@ void ToolBox::ImplDrawItem( USHORT nPos, BOOL bHighlight, BOOL bPaint, BOOL bLay
MetricVector* pVector = bLayout ? &mpData->m_pLayoutData->m_aUnicodeBoundRects : NULL;
String* pDisplayText = bLayout ? &mpData->m_pLayoutData->m_aDisplayText : NULL;
+ bHighlight = bHighlight && pItem->mbEnabled;
+
// Falls Rechteck ausserhalb des sichbaren Bereichs liegt
if ( pItem->maRect.IsEmpty() )
return;
@@ -4818,15 +4820,15 @@ const XubString& ToolBox::ImplGetHelpText( USHORT nItemId ) const
if ( pItem )
{
- if ( !pItem->maHelpText.Len() && ( pItem->mnHelpId || pItem->maCommandStr.Len() ))
+ if ( !pItem->maHelpText.Len() && ( pItem->maHelpId.getLength() || pItem->maCommandStr.Len() ))
{
Help* pHelp = Application::GetHelp();
if ( pHelp )
{
if ( pItem->maCommandStr.Len() )
pItem->maHelpText = pHelp->GetHelpText( pItem->maCommandStr, this );
- if ( !pItem->maHelpText.Len() && pItem->mnHelpId )
- pItem->maHelpText = pHelp->GetHelpText( pItem->mnHelpId, this );
+ if ( !pItem->maHelpText.Len() && pItem->maHelpId.getLength() )
+ pItem->maHelpText = pHelp->GetHelpText( rtl::OStringToOUString( pItem->maHelpId, RTL_TEXTENCODING_UTF8 ), this );
}
}
@@ -4892,9 +4894,9 @@ void ToolBox::RequestHelp( const HelpEvent& rHEvt )
else if ( rHEvt.GetMode() & HELPMODE_EXTENDED )
{
String aCommand = GetItemCommand( nItemId );
- ULONG nHelpId = GetHelpId( nItemId );
+ rtl::OString aHelpId( GetHelpId( nItemId ) );
- if ( aCommand.Len() || nHelpId )
+ if ( aCommand.Len() || aHelpId.getLength() )
{
// Wenn eine Hilfe existiert, dann ausloesen
Help* pHelp = Application::GetHelp();
@@ -4902,8 +4904,8 @@ void ToolBox::RequestHelp( const HelpEvent& rHEvt )
{
if ( aCommand.Len() )
pHelp->Start( aCommand, this );
- else if ( nHelpId )
- pHelp->Start( nHelpId, this );
+ else if ( aHelpId.getLength() )
+ pHelp->Start( rtl::OStringToOUString( aHelpId, RTL_TEXTENCODING_UTF8 ), this );
}
return;
}
diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx
index 334cdd2d0a64..35a39676353a 100644
--- a/vcl/source/window/toolbox2.cxx
+++ b/vcl/source/window/toolbox2.cxx
@@ -99,7 +99,6 @@ ImplToolItem::ImplToolItem()
mnId = 0;
mpWindow = NULL;
mpUserData = NULL;
- mnHelpId = 0;
meType = TOOLBOXITEM_BUTTON;
mnBits = 0;
meState = STATE_NOCHECK;
@@ -124,7 +123,6 @@ ImplToolItem::ImplToolItem( USHORT nItemId, const Image& rImage,
mnId = nItemId;
mpWindow = NULL;
mpUserData = NULL;
- mnHelpId = 0;
meType = TOOLBOXITEM_BUTTON;
mnBits = nItemBits;
meState = STATE_NOCHECK;
@@ -149,7 +147,6 @@ ImplToolItem::ImplToolItem( USHORT nItemId, const XubString& rText,
mnId = nItemId;
mpWindow = NULL;
mpUserData = NULL;
- mnHelpId = 0;
meType = TOOLBOXITEM_BUTTON;
mnBits = nItemBits;
meState = STATE_NOCHECK;
@@ -175,7 +172,6 @@ ImplToolItem::ImplToolItem( USHORT nItemId, const Image& rImage,
mnId = nItemId;
mpWindow = NULL;
mpUserData = NULL;
- mnHelpId = 0;
meType = TOOLBOXITEM_BUTTON;
mnBits = nItemBits;
meState = STATE_NOCHECK;
@@ -204,7 +200,7 @@ ImplToolItem::ImplToolItem( const ImplToolItem& rItem ) :
maQuickHelpText ( rItem.maQuickHelpText ),
maHelpText ( rItem.maHelpText ),
maCommandStr ( rItem.maCommandStr ),
- mnHelpId ( rItem.mnHelpId ),
+ maHelpId ( rItem.maHelpId ),
maRect ( rItem.maRect ),
maCalcRect ( rItem.maCalcRect ),
maItemSize ( rItem.maItemSize ),
@@ -243,7 +239,7 @@ ImplToolItem& ImplToolItem::operator=( const ImplToolItem& rItem )
maQuickHelpText = rItem.maQuickHelpText;
maHelpText = rItem.maHelpText;
maCommandStr = rItem.maCommandStr;
- mnHelpId = rItem.mnHelpId;
+ maHelpId = rItem.maHelpId;
maRect = rItem.maRect;
maCalcRect = rItem.maCalcRect;
mnSepSize = rItem.mnSepSize;
@@ -595,7 +591,7 @@ void ToolBox::InsertItem( const ResId& rResId, USHORT nPos )
aItem.mnBits = (ToolBoxItemBits)ReadLongRes();
if( nObjMask & RSC_TOOLBOXITEM_HELPID )
- aItem.mnHelpId = ReadLongRes();
+ aItem.maHelpId = ReadByteStringRes();
if ( nObjMask & RSC_TOOLBOXITEM_TEXT )
{
@@ -1923,24 +1919,31 @@ const XubString& ToolBox::GetHelpText( USHORT nItemId ) const
// -----------------------------------------------------------------------
-void ToolBox::SetHelpId( USHORT nItemId, ULONG nHelpId )
+void ToolBox::SetHelpId( USHORT nItemId, const rtl::OString& rHelpId )
{
ImplToolItem* pItem = ImplGetItem( nItemId );
if ( pItem )
- pItem->mnHelpId = nHelpId;
+ pItem->maHelpId = rHelpId;
}
// -----------------------------------------------------------------------
-ULONG ToolBox::GetHelpId( USHORT nItemId ) const
+rtl::OString ToolBox::GetHelpId( USHORT nItemId ) const
{
+ rtl::OString aRet;
+
ImplToolItem* pItem = ImplGetItem( nItemId );
if ( pItem )
- return pItem->mnHelpId;
- else
- return 0;
+ {
+ if ( pItem->maHelpId.getLength() )
+ aRet = pItem->maHelpId;
+ else
+ aRet = ::rtl::OUStringToOString( pItem->maCommandStr, RTL_TEXTENCODING_UTF8 );
+ }
+
+ return aRet;
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 370669d6969b..fe2af486c53a 100644..100755
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -295,6 +295,8 @@ void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, BOOL bCallHdl )
aTmpSt.SetHighContrastMode( FALSE );
rSettings.SetStyleSettings( aTmpSt );
ImplGetFrame()->UpdateSettings( rSettings );
+ // reset default border width for layouters
+ ImplGetSVData()->maAppData.mnDefaultLayoutBorder = -1;
// Verify availability of the configured UI font, otherwise choose "Andale Sans UI"
String aUserInterfaceFont;
@@ -599,6 +601,7 @@ void Window::ImplInitWindowData( WindowType nType )
mpWindowImpl->mpDlgCtrlDownWindow = NULL; // window for dialog control
mpWindowImpl->mpFirstDel = NULL; // Dtor notification list
mpWindowImpl->mpUserData = NULL; // user data
+ mpWindowImpl->mpExtImpl = NULL; // extended implementation data
mpWindowImpl->mpCursor = NULL; // cursor
mpWindowImpl->mpControlFont = NULL; // font propertie
mpWindowImpl->mpVCLXWindow = NULL;
@@ -612,8 +615,6 @@ void Window::ImplInitWindowData( WindowType nType )
mpWindowImpl->mnX = 0; // X-Position to Parent
mpWindowImpl->mnY = 0; // Y-Position to Parent
mpWindowImpl->mnAbsScreenX = 0; // absolute X-position on screen, used for RTL window positioning
- mpWindowImpl->mnHelpId = 0; // help id
- mpWindowImpl->mnUniqId = 0; // unique id
mpWindowImpl->mpChildClipRegion = NULL; // Child-Clip-Region when ClipChildren
mpWindowImpl->mpPaintRegion = NULL; // Paint-ClipRegion
mpWindowImpl->mnStyle = 0; // style (init in ImplInitWindow)
@@ -1131,6 +1132,8 @@ void Window::ImplCallResize()
// #88419# Most classes don't call the base class in Resize() and Move(),
// => Call ImpleResize/Move instead of Resize/Move directly...
ImplCallEventListeners( VCLEVENT_WINDOW_RESIZE );
+
+ ImplExtResize();
}
// -----------------------------------------------------------------------
@@ -1179,20 +1182,14 @@ void Window::ImplCallMove()
// -----------------------------------------------------------------------
-static ULONG ImplAutoHelpID( ResMgr* pResMgr )
+static rtl::OString ImplAutoHelpID( ResMgr* pResMgr )
{
- if ( !Application::IsAutoHelpIdEnabled() )
- return 0;
+ rtl::OString aRet;
- ULONG nHID = 0;
-
- DBG_ASSERT( pResMgr, "No res mgr for auto help id" );
- if( ! pResMgr )
- return 0;
+ if( pResMgr && Application::IsAutoHelpIdEnabled() )
+ aRet = pResMgr->GetAutoHelpId();
- nHID = pResMgr->GetAutoHelpId();
-
- return nHID;
+ return aRet;
}
// -----------------------------------------------------------------------
@@ -1212,22 +1209,23 @@ WinBits Window::ImplInitRes( const ResId& rResId )
void Window::ImplLoadRes( const ResId& rResId )
{
- // newer move this line after IncrementRes
- char* pRes = (char*)GetClassRes();
- pRes += 12;
- sal_uInt32 nHelpId = (sal_uInt32)GetLongRes( (void*)pRes );
- if ( !nHelpId )
- nHelpId = ImplAutoHelpID( rResId.GetResMgr() );
- SetHelpId( nHelpId );
-
ULONG nObjMask = ReadLongRes();
+ // we need to calculate auto helpids before the resource gets closed
+ // if the resource only contains flags, it will be closed before we try to read a help id
+ // so we always create an auto help id that might be overwritten later
+ // HelpId
+ rtl::OString aHelpId = ImplAutoHelpID( rResId.GetResMgr() );
+
// ResourceStyle
ULONG nRSStyle = ReadLongRes();
// WinBits
ReadLongRes();
- // HelpId
- ReadLongRes();
+
+ if( nObjMask & WINDOW_HELPID )
+ aHelpId = ReadByteStringRes();
+
+ SetHelpId( aHelpId );
BOOL bPos = FALSE;
BOOL bSize = FALSE;
@@ -1294,7 +1292,7 @@ void Window::ImplLoadRes( const ResId& rResId )
if ( nObjMask & WINDOW_EXTRALONG )
SetData( (void*)ReadLongRes() );
if ( nObjMask & WINDOW_UNIQUEID )
- SetUniqueId( (ULONG)ReadLongRes() );
+ SetUniqueId( ReadByteStringRes() );
if ( nObjMask & WINDOW_BORDER_STYLE )
{
@@ -1322,8 +1320,6 @@ ImplWinData* Window::ImplGetWinData() const
mpWindowImpl->mpWinData->mnIsTopWindow = (USHORT) ~0; // not initialized yet, 0/1 will indicate TopWindow (see IsTopWindow())
mpWindowImpl->mpWinData->mbMouseOver = FALSE;
mpWindowImpl->mpWinData->mbEnableNativeWidget = (pNoNWF && *pNoNWF) ? FALSE : TRUE; // TRUE: try to draw this control with native theme API
- mpWindowImpl->mpWinData->mpSmartHelpId = NULL;
- mpWindowImpl->mpWinData->mpSmartUniqueId = NULL;
}
return mpWindowImpl->mpWinData;
@@ -4351,6 +4347,8 @@ namespace
Window::~Window()
{
+ ImplFreeExtWindowImpl();
+
vcl::LazyDeletor<Window>::Undelete( this );
DBG_DTOR( Window, ImplDbgCheckWindow );
@@ -4734,10 +4732,6 @@ Window::~Window()
delete mpWindowImpl->mpWinData->mpFocusRect;
if ( mpWindowImpl->mpWinData->mpTrackRect )
delete mpWindowImpl->mpWinData->mpTrackRect;
- if ( mpWindowImpl->mpWinData->mpSmartHelpId )
- delete mpWindowImpl->mpWinData->mpSmartHelpId;
- if ( mpWindowImpl->mpWinData->mpSmartUniqueId )
- delete mpWindowImpl->mpWinData->mpSmartUniqueId;
delete mpWindowImpl->mpWinData;
}
@@ -4882,6 +4876,12 @@ void Window::Paint( const Rectangle& rRect )
// -----------------------------------------------------------------------
+void Window::PostPaint()
+{
+}
+
+// -----------------------------------------------------------------------
+
void Window::Draw( OutputDevice*, const Point&, const Size&, ULONG )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -4986,29 +4986,18 @@ void Window::RequestHelp( const HelpEvent& rHEvt )
}
else
{
- SmartId aSmartId = GetSmartHelpId();
-
- ULONG nNumHelpId = 0;
- String aStrHelpId;
- if( aSmartId.HasString() )
- aStrHelpId = aSmartId.GetStr();
- if( aSmartId.HasNumeric() )
- nNumHelpId = aSmartId.GetNum();
-
- if ( !nNumHelpId && aStrHelpId.Len() == 0 && ImplGetParent() )
+ String aStrHelpId( rtl::OStringToOUString( GetHelpId(), RTL_TEXTENCODING_UTF8 ) );
+ if ( aStrHelpId.Len() == 0 && ImplGetParent() )
ImplGetParent()->RequestHelp( rHEvt );
else
{
- if ( !nNumHelpId && aStrHelpId.Len() == 0 )
- nNumHelpId = OOO_HELP_INDEX;
-
Help* pHelp = Application::GetHelp();
if ( pHelp )
{
if( aStrHelpId.Len() > 0 )
pHelp->Start( aStrHelpId, this );
else
- pHelp->Start( nNumHelpId, this );
+ pHelp->Start( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OOO_HELP_INDEX ) ), this );
}
}
}
@@ -8137,32 +8126,22 @@ const XubString& Window::GetHelpText() const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
- SmartId aSmartId = GetSmartHelpId();
-
- ULONG nNumHelpId = 0;
- String aStrHelpId;
- if( aSmartId.HasString() )
- aStrHelpId = aSmartId.GetStr();
- if( aSmartId.HasNumeric() )
- nNumHelpId = aSmartId.GetNum();
+ String aStrHelpId( rtl::OStringToOUString( GetHelpId(), RTL_TEXTENCODING_UTF8 ) );
bool bStrHelpId = (aStrHelpId.Len() > 0);
- if ( !mpWindowImpl->maHelpText.Len() && (nNumHelpId || bStrHelpId) )
+ if ( !mpWindowImpl->maHelpText.Len() && bStrHelpId )
{
if ( !IsDialog() && (mpWindowImpl->mnType != WINDOW_TABPAGE) && (mpWindowImpl->mnType != WINDOW_FLOATINGWINDOW) )
{
Help* pHelp = Application::GetHelp();
if ( pHelp )
{
- if( bStrHelpId )
- ((Window*)this)->mpWindowImpl->maHelpText = pHelp->GetHelpText( aStrHelpId, this );
- else
- ((Window*)this)->mpWindowImpl->maHelpText = pHelp->GetHelpText( nNumHelpId, this );
+ ((Window*)this)->mpWindowImpl->maHelpText = pHelp->GetHelpText( aStrHelpId, this );
mpWindowImpl->mbHelpTextDynamic = FALSE;
}
}
}
- else if( mpWindowImpl->mbHelpTextDynamic && (nNumHelpId || bStrHelpId) )
+ else if( mpWindowImpl->mbHelpTextDynamic && bStrHelpId )
{
static const char* pEnv = getenv( "HELP_DEBUG" );
if( pEnv && *pEnv )
@@ -8170,10 +8149,7 @@ const XubString& Window::GetHelpText() const
rtl::OUStringBuffer aTxt( 64+mpWindowImpl->maHelpText.Len() );
aTxt.append( mpWindowImpl->maHelpText );
aTxt.appendAscii( "\n------------------\n" );
- if( bStrHelpId )
- aTxt.append( rtl::OUString( aStrHelpId ) );
- else
- aTxt.append( sal_Int32( nNumHelpId ) );
+ aTxt.append( rtl::OUString( aStrHelpId ) );
mpWindowImpl->maHelpText = aTxt.makeStringAndClear();
}
mpWindowImpl->mbHelpTextDynamic = FALSE;
@@ -9408,7 +9384,7 @@ void Window::DrawSelectionBackground( const Rectangle& rRect,
if( bDark )
aSelectionFillCol = COL_BLACK;
else
- nPercent = bRoundEdges ? 90 : 80; // just checked (light)
+ nPercent = 80; // just checked (light)
}
else
{
@@ -9423,7 +9399,7 @@ void Window::DrawSelectionBackground( const Rectangle& rRect,
nPercent = 0;
}
else
- nPercent = bRoundEdges ? 50 : 20; // selected, pressed or checked ( very dark )
+ nPercent = bRoundEdges ? 40 : 20; // selected, pressed or checked ( very dark )
}
else if( bChecked || highlight == 1 )
{
@@ -9436,7 +9412,7 @@ void Window::DrawSelectionBackground( const Rectangle& rRect,
nPercent = 0;
}
else
- nPercent = bRoundEdges ? 70 : 35; // selected, pressed or checked ( very dark )
+ nPercent = bRoundEdges ? 60 : 35; // selected, pressed or checked ( very dark )
}
else
{
@@ -9452,7 +9428,7 @@ void Window::DrawSelectionBackground( const Rectangle& rRect,
nPercent = 0;
}
else
- nPercent = bRoundEdges ? 80 : 70; // selected ( dark )
+ nPercent = 70; // selected ( dark )
}
}
diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index 02b2713b01cc..e5b58a8b6f3c 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -1442,115 +1442,31 @@ Window* Window::ImplGetTopmostFrameWindow()
return pTopmostParent->mpWindowImpl->mpFrameWindow;
}
-// making these Methods out of line to be able to change them lateron without complete rebuild
-// TODO: Set the SmartId in here and remove mpWindowImpl->mnHelpId
-void Window::SetHelpId( ULONG nHelpId )
+void Window::SetHelpId( const rtl::OString& rHelpId )
{
- SetSmartHelpId(SmartId(nHelpId));
+ mpWindowImpl->maHelpId = rHelpId;
}
-ULONG Window::GetHelpId() const
+const rtl::OString& Window::GetHelpId() const
{
- return mpWindowImpl->mnHelpId;
+ return mpWindowImpl->maHelpId;
}
-void Window::SetSmartHelpId( const SmartId& aId, SmartIdUpdateMode aMode )
+void Window::SetUniqueId( const rtl::OString& rUniqueId )
{
- // create SmartId if required
- if ( (aMode == SMART_SET_STR) || (aMode == SMART_SET_ALL) || ( (aMode == SMART_SET_SMART) && aId.HasString() ) )
- {
- if ( !ImplGetWinData()->mpSmartHelpId )
- ImplGetWinData()->mpSmartHelpId = new SmartId();
- }
-
- // if we have a SmartId (eather from earlier call or just created) fill with new values
- if ( mpWindowImpl->mpWinData && mpWindowImpl->mpWinData->mpSmartHelpId )
- ImplGetWinData()->mpSmartHelpId->UpdateId( aId, aMode );
-
- if ( (aMode == SMART_SET_NUM) || (aMode == SMART_SET_ALL) || ( (aMode == SMART_SET_SMART) && aId.HasNumeric() ) )
- {
- mpWindowImpl->mnHelpId = aId.GetNum();
- }
-}
-
-SmartId Window::GetSmartHelpId() const
-{
- if ( mpWindowImpl->mpWinData && mpWindowImpl->mpWinData->mpSmartHelpId )
- {
- if ( mpWindowImpl->mnHelpId || mpWindowImpl->mpWinData->mpSmartHelpId->HasNumeric() )
- mpWindowImpl->mpWinData->mpSmartHelpId->UpdateId( SmartId( mpWindowImpl->mnHelpId ), SMART_SET_NUM );
- return *mpWindowImpl->mpWinData->mpSmartHelpId;
- }
- else
- {
- if ( mpWindowImpl->mnHelpId )
- return SmartId( mpWindowImpl->mnHelpId );
- else
- return SmartId();
- }
-}
-
-
-// making these Methods out of line to be able to change them lateron without complete rebuild
-// TODO: Set the SmartId in here and remove mpWindowImpl->mnUniqId
-void Window::SetUniqueId( ULONG nUniqueId ) { mpWindowImpl->mnUniqId = nUniqueId; }
-ULONG Window::GetUniqueId() const { return mpWindowImpl->mnUniqId; }
-
-
-void Window::SetSmartUniqueId( const SmartId& aId, SmartIdUpdateMode aMode )
-{
- // create SmartId if required
- if ( (aMode == SMART_SET_STR) || (aMode == SMART_SET_ALL) || ( (aMode == SMART_SET_SMART) && aId.HasString() ) )
- {
- if ( !ImplGetWinData()->mpSmartUniqueId )
- ImplGetWinData()->mpSmartUniqueId = new SmartId();
- }
-
- // if we have a SmartId (eather from earlier call or just created) fill with new values
- if ( mpWindowImpl->mpWinData && mpWindowImpl->mpWinData->mpSmartUniqueId )
- ImplGetWinData()->mpSmartUniqueId->UpdateId( aId, aMode );
-
- if ( (aMode == SMART_SET_NUM) || (aMode == SMART_SET_ALL) || ( (aMode == SMART_SET_SMART) && aId.HasNumeric() ) )
- mpWindowImpl->mnUniqId = aId.GetNum();
+ mpWindowImpl->maUniqId = rUniqueId;
}
-SmartId Window::GetSmartUniqueId() const
+const rtl::OString& Window::GetUniqueId() const
{
- if ( mpWindowImpl->mpWinData && mpWindowImpl->mpWinData->mpSmartUniqueId )
- {
- if ( mpWindowImpl->mnUniqId || mpWindowImpl->mpWinData->mpSmartUniqueId->HasNumeric() )
- mpWindowImpl->mpWinData->mpSmartUniqueId->UpdateId( SmartId( mpWindowImpl->mnUniqId ), SMART_SET_NUM );
- return *mpWindowImpl->mpWinData->mpSmartUniqueId;
- }
- else
- {
- if ( mpWindowImpl->mnUniqId )
- return SmartId( mpWindowImpl->mnUniqId );
- else
- return SmartId();
- }
+ return mpWindowImpl->maUniqId;
}
-SmartId Window::GetSmartUniqueOrHelpId() const
+const rtl::OString& Window::GetUniqueOrHelpId() const
{
- if ( ( mpWindowImpl->mpWinData && mpWindowImpl->mpWinData->mpSmartHelpId ) || mpWindowImpl->mnHelpId )
- {
- if ( ( mpWindowImpl->mpWinData && mpWindowImpl->mpWinData->mpSmartUniqueId ) || mpWindowImpl->mnUniqId )
- {
- SmartId aTemp = GetSmartHelpId();
- aTemp.UpdateId( GetSmartUniqueId() );
- return aTemp;
- }
- else
- return GetSmartHelpId();
- }
- else
- return GetSmartUniqueId();
+ return mpWindowImpl->maUniqId.getLength() ? mpWindowImpl->maUniqId : mpWindowImpl->maHelpId;
}
-
-
-
// --------- old inline methods ---------------
Window* Window::ImplGetWindow()
diff --git a/vcl/source/window/window4.cxx b/vcl/source/window/window4.cxx
new file mode 100644
index 000000000000..577a573c2015
--- /dev/null
+++ b/vcl/source/window/window4.cxx
@@ -0,0 +1,224 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "precompiled_vcl.hxx"
+
+#include "vcl/window.hxx"
+#include "vcl/window.h"
+#include "vcl/svdata.hxx"
+#include "vcl/arrange.hxx"
+
+#include "com/sun/star/beans/PropertyValue.hpp"
+
+#include <map>
+#include <vector>
+
+using namespace com::sun::star;
+
+namespace vcl
+{
+ struct ExtWindowImpl
+ {
+ ExtWindowImpl()
+ : mbOwnedByParent( false )
+ {}
+ ~ExtWindowImpl()
+ {}
+
+ boost::shared_ptr< WindowArranger > mxLayout;
+ bool mbOwnedByParent;
+ rtl::OUString maIdentifier;
+ };
+}
+
+void Window::ImplDeleteOwnedChildren()
+{
+ Window* pChild = mpWindowImpl->mpFirstChild;
+ while ( pChild )
+ {
+ Window* pDeleteCandidate = pChild;
+ pChild = pChild->mpWindowImpl->mpNext;
+ vcl::ExtWindowImpl* pDelImpl = pDeleteCandidate->ImplGetExtWindowImpl();
+ if( pDelImpl && pDelImpl->mbOwnedByParent )
+ delete pDeleteCandidate;
+ }
+}
+
+void Window::ImplFreeExtWindowImpl()
+{
+ ImplDeleteOwnedChildren();
+ if( mpWindowImpl )
+ {
+ delete mpWindowImpl->mpExtImpl;
+ mpWindowImpl->mpExtImpl = NULL;
+ }
+}
+
+vcl::ExtWindowImpl* Window::ImplGetExtWindowImpl() const
+{
+ vcl::ExtWindowImpl* pImpl = NULL;
+ if( mpWindowImpl )
+ {
+ if( ! mpWindowImpl->mpExtImpl && ! mpWindowImpl->mbInDtor )
+ mpWindowImpl->mpExtImpl = new vcl::ExtWindowImpl();
+ pImpl = mpWindowImpl->mpExtImpl;
+ }
+ return pImpl;
+}
+
+void Window::ImplExtResize()
+{
+ if( mpWindowImpl && mpWindowImpl->mpExtImpl )
+ {
+ if( mpWindowImpl->mpExtImpl->mxLayout.get() )
+ mpWindowImpl->mpExtImpl->mxLayout->setManagedArea( Rectangle( Point( 0, 0 ), GetSizePixel() ) );
+ }
+}
+
+boost::shared_ptr< vcl::WindowArranger > Window::getLayout()
+{
+ boost::shared_ptr< vcl::WindowArranger > xRet;
+ vcl::ExtWindowImpl* pImpl = ImplGetExtWindowImpl();
+ if( pImpl )
+ {
+ if( ! pImpl->mxLayout.get() )
+ {
+ pImpl->mxLayout.reset( new vcl::LabelColumn() );
+ pImpl->mxLayout->setParentWindow( this );
+ pImpl->mxLayout->setOuterBorder( -1 );
+ }
+ xRet = pImpl->mxLayout;
+ }
+
+ return xRet;
+}
+
+void Window::addWindow( Window* i_pWin, bool i_bTakeOwnership )
+{
+ vcl::ExtWindowImpl* pImpl = ImplGetExtWindowImpl();
+ if( pImpl && i_pWin )
+ {
+ vcl::ExtWindowImpl* pChildImpl = i_pWin->ImplGetExtWindowImpl();
+ if( pChildImpl )
+ {
+ i_pWin->SetParent( this );
+ pChildImpl->mbOwnedByParent = i_bTakeOwnership;
+ }
+ }
+}
+
+Window* Window::removeWindow( Window* i_pWin, Window* i_pNewParent )
+{
+ Window* pRet = NULL;
+ if( i_pWin )
+ {
+ vcl::ExtWindowImpl* pImpl = ImplGetExtWindowImpl();
+ if( pImpl )
+ {
+ vcl::ExtWindowImpl* pChildImpl = i_pWin->ImplGetExtWindowImpl();
+ if( pChildImpl )
+ {
+ if( ! i_pNewParent )
+ pChildImpl->mbOwnedByParent = false;
+ i_pWin->SetParent( i_pNewParent );
+ pRet = i_pWin;
+ }
+ }
+ }
+ return pRet;
+}
+
+Window* Window::findWindow( const rtl::OUString& i_rIdentifier ) const
+{
+ if( getIdentifier() == i_rIdentifier )
+ return const_cast<Window*>(this);
+
+ Window* pChild = mpWindowImpl->mpFirstChild;
+ while ( pChild )
+ {
+ Window* pResult = pChild->findWindow( i_rIdentifier );
+ if( pResult )
+ return pResult;
+ pChild = pChild->mpWindowImpl->mpNext;
+ }
+
+ return NULL;
+}
+
+const rtl::OUString& Window::getIdentifier() const
+{
+ static rtl::OUString aEmptyStr;
+
+ return (mpWindowImpl && mpWindowImpl->mpExtImpl) ? mpWindowImpl->mpExtImpl->maIdentifier : aEmptyStr;
+}
+
+void Window::setIdentifier( const rtl::OUString& i_rIdentifier )
+{
+ vcl::ExtWindowImpl* pImpl = ImplGetExtWindowImpl();
+ if( pImpl )
+ pImpl->maIdentifier = i_rIdentifier;
+}
+
+void Window::setProperties( const uno::Sequence< beans::PropertyValue >& i_rProps )
+{
+ const beans::PropertyValue* pVals = i_rProps.getConstArray();
+ for( sal_Int32 i = 0; i < i_rProps.getLength(); i++ )
+ {
+ if( pVals[i].Name.equalsAscii( "Enabled" ) )
+ {
+ sal_Bool bVal = sal_True;
+ if( pVals[i].Value >>= bVal )
+ Enable( bVal );
+ }
+ else if( pVals[i].Name.equalsAscii( "Visible" ) )
+ {
+ sal_Bool bVal = sal_True;
+ if( pVals[i].Value >>= bVal )
+ Show( bVal );
+ }
+ else if( pVals[i].Name.equalsAscii( "Text" ) )
+ {
+ rtl::OUString aText;
+ if( pVals[i].Value >>= aText )
+ SetText( aText );
+ }
+ }
+}
+
+uno::Sequence< beans::PropertyValue > Window::getProperties() const
+{
+ uno::Sequence< beans::PropertyValue > aProps( 3 );
+ aProps[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Enabled" ) );
+ aProps[0].Value = uno::makeAny( sal_Bool( IsEnabled() ) );
+ aProps[1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Visible" ) );
+ aProps[1].Value = uno::makeAny( sal_Bool( IsVisible() ) );
+ aProps[2].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Text" ) );
+ aProps[2].Value = uno::makeAny( rtl::OUString( GetText() ) );
+
+ return aProps;
+}
+
diff --git a/vcl/source/window/wpropset.cxx b/vcl/source/window/wpropset.cxx
new file mode 100644
index 000000000000..4aaa3f987b77
--- /dev/null
+++ b/vcl/source/window/wpropset.cxx
@@ -0,0 +1,346 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "precompiled_vcl.hxx"
+
+#include "vcl/wpropset.hxx"
+#include "vcl/window.hxx"
+#include "vcl/vclevent.hxx"
+#include "vcl/svdata.hxx"
+
+#include "com/sun/star/lang/XMultiServiceFactory.hpp"
+#include "com/sun/star/beans/PropertyValue.hpp"
+#include "com/sun/star/beans/PropertyAttribute.hpp"
+#include "com/sun/star/beans/XPropertySet.hpp"
+#include "com/sun/star/beans/XPropertyContainer.hpp"
+#include "com/sun/star/beans/XPropertyAccess.hpp"
+
+#include "cppuhelper/basemutex.hxx"
+#include "cppuhelper/compbase1.hxx"
+
+#include <map>
+
+using namespace vcl;
+using namespace com::sun::star;
+
+/*
+
+TODO:
+- release solarmutex during outside UNO calls
+- in ChildEventListener protect against reentry by using PostUserEvent
+
+*/
+
+class vcl::WindowPropertySetListener :
+ public cppu::BaseMutex,
+ public cppu::WeakComponentImplHelper1< com::sun::star::beans::XPropertyChangeListener >,
+ private boost::noncopyable
+{
+ WindowPropertySet* mpParent;
+ bool mbSuspended;
+public:
+ WindowPropertySetListener( WindowPropertySet* pParent )
+ : cppu::WeakComponentImplHelper1< com::sun::star::beans::XPropertyChangeListener >( m_aMutex )
+ , mpParent( pParent )
+ , mbSuspended( false )
+ {}
+
+ virtual ~WindowPropertySetListener()
+ {
+ }
+
+ using cppu::WeakComponentImplHelperBase::disposing;
+ virtual void SAL_CALL disposing( const lang::EventObject& ) throw()
+ {
+ }
+
+ virtual void SAL_CALL propertyChange( const beans::PropertyChangeEvent& i_rEvent ) throw()
+ {
+ if( ! mbSuspended )
+ mpParent->propertyChange( i_rEvent );
+ }
+
+ void suspend( bool i_bSuspended )
+ {
+ mbSuspended = i_bSuspended;
+ }
+};
+
+class vcl::WindowPropertySetData
+{
+public:
+
+ struct PropertyMapEntry
+ {
+ Window* mpWindow;
+ boost::shared_ptr<WindowArranger> mpLayout;
+ uno::Sequence< beans::PropertyValue > maSavedValues;
+
+ PropertyMapEntry( Window* i_pWindow = NULL,
+ const boost::shared_ptr<WindowArranger>& i_pLayout = boost::shared_ptr<WindowArranger>() )
+ : mpWindow( i_pWindow )
+ , mpLayout( i_pLayout )
+ {}
+
+ uno::Sequence< beans::PropertyValue > getProperties() const
+ {
+ if( mpWindow )
+ return mpWindow->getProperties();
+ else if( mpLayout.get() )
+ return mpLayout->getProperties();
+ return uno::Sequence< beans::PropertyValue >();
+ }
+
+ void setProperties( const uno::Sequence< beans::PropertyValue >& i_rProps ) const
+ {
+ if( mpWindow )
+ mpWindow->setProperties( i_rProps );
+ else if( mpLayout.get() )
+ mpLayout->setProperties( i_rProps );
+ }
+ };
+
+ Window* mpTopWindow;
+ bool mbOwner;
+ std::map< rtl::OUString, PropertyMapEntry > maProperties;
+ uno::Reference< beans::XPropertySet > mxPropSet;
+ uno::Reference< beans::XPropertyAccess > mxPropSetAccess;
+ uno::Reference< beans::XPropertyChangeListener > mxListener;
+ vcl::WindowPropertySetListener* mpListener;
+
+ WindowPropertySetData()
+ : mpTopWindow( NULL )
+ , mbOwner( false )
+ , mpListener( NULL )
+ {}
+
+ ~WindowPropertySetData()
+ {
+ // release layouters, possibly interface properties before destroying
+ // the involved parent to be on the safe side
+ maProperties.clear();
+ if( mbOwner )
+ delete mpTopWindow;
+ }
+};
+
+static rtl::OUString getIdentifiedPropertyName( const rtl::OUString& i_rIdentifier, const rtl::OUString& i_rName )
+{
+ rtl::OUStringBuffer aBuf( i_rIdentifier.getLength() + 1 + i_rName.getLength() );
+ aBuf.append( i_rIdentifier );
+ aBuf.append( sal_Unicode( '#' ) );
+ aBuf.append( i_rName );
+ return aBuf.makeStringAndClear();
+}
+
+static void spliceIdentifiedPropertyName( const rtl::OUString& i_rIdentifiedPropName,
+ rtl::OUString& o_rIdentifier,
+ rtl::OUString& o_rPropName )
+{
+ sal_Int32 nIndex = 0;
+ o_rIdentifier = i_rIdentifiedPropName.getToken( 0, sal_Unicode( '#' ), nIndex );
+ if( nIndex != -1 )
+ o_rPropName = i_rIdentifiedPropName.copy( nIndex );
+ else
+ o_rPropName = rtl::OUString();
+}
+
+WindowPropertySet::WindowPropertySet( Window* i_pTopWindow, bool i_bTakeOwnership )
+: mpImpl( new vcl::WindowPropertySetData )
+{
+ mpImpl->mpTopWindow = i_pTopWindow;
+ mpImpl->mbOwner = i_bTakeOwnership;
+
+ mpImpl->mpTopWindow->AddChildEventListener( LINK( this, WindowPropertySet, ChildEventListener ) );
+
+ mpImpl->mxPropSet = uno::Reference< beans::XPropertySet >(
+ ImplGetSVData()->maAppData.mxMSF->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.beans.PropertyBag" ) ) ),
+ uno::UNO_QUERY );
+ OSL_ENSURE( mpImpl->mxPropSet.is(), "could not create instance of com.sun.star.beans.PropertyBag" );
+ mpImpl->mxPropSetAccess = uno::Reference< beans::XPropertyAccess >( mpImpl->mxPropSet, uno::UNO_QUERY );
+ OSL_ENSURE( mpImpl->mxPropSet.is(), "could not query XPropertyAccess interface" );
+ if( ! mpImpl->mxPropSetAccess.is() )
+ mpImpl->mxPropSet.clear();
+
+ addWindowToSet( i_pTopWindow );
+
+ setupProperties();
+
+ if( mpImpl->mxPropSet.is() )
+ {
+ mpImpl->mxListener.set( mpImpl->mpListener = new WindowPropertySetListener( this ) );
+ }
+}
+
+WindowPropertySet::~WindowPropertySet()
+{
+ mpImpl->mpTopWindow->RemoveChildEventListener( LINK( this, WindowPropertySet, ChildEventListener ) );
+
+ delete mpImpl;
+ mpImpl = NULL;
+}
+
+uno::Reference< beans::XPropertySet > WindowPropertySet::getPropertySet() const
+{
+ return mpImpl->mxPropSet;
+}
+
+void WindowPropertySet::addLayoutToSet( const boost::shared_ptr< WindowArranger >& i_pLayout )
+{
+ if( i_pLayout.get() )
+ {
+ if( i_pLayout->getIdentifier().getLength() )
+ {
+ WindowPropertySetData::PropertyMapEntry& rEntry = mpImpl->maProperties[ i_pLayout->getIdentifier() ];
+ OSL_ENSURE( rEntry.mpWindow == 0 && rEntry.mpLayout.get() == 0, "inserted layout has duplicate name" );
+ rEntry.mpWindow = NULL;
+ rEntry.mpLayout = i_pLayout;
+ rEntry.maSavedValues = i_pLayout->getProperties();
+ }
+ // insert child layouts
+ size_t nChildren = i_pLayout->countElements();
+ for( size_t i = 0; i < nChildren; i++ )
+ addLayoutToSet( i_pLayout->getChild( i ) );
+ }
+}
+
+void WindowPropertySet::addWindowToSet( Window* i_pWindow )
+{
+ if( i_pWindow->getIdentifier().getLength() ) // no name, no properties
+ {
+ WindowPropertySetData::PropertyMapEntry& rEntry = mpImpl->maProperties[ i_pWindow->getIdentifier() ];
+ OSL_ENSURE( rEntry.mpWindow == 0 && rEntry.mpLayout.get() == 0, "inserted window has duplicate name" );
+ rEntry.mpWindow = i_pWindow;
+ rEntry.mpLayout.reset();
+ rEntry.maSavedValues = i_pWindow->getProperties();
+ }
+ addLayoutToSet( i_pWindow->getLayout() );
+
+ Window* pWin = i_pWindow->GetWindow( WINDOW_FIRSTCHILD );
+ while( pWin )
+ {
+ addWindowToSet( pWin );
+ pWin = pWin->GetWindow( WINDOW_NEXT );
+ }
+}
+
+void WindowPropertySet::setupProperties()
+{
+ uno::Reference< beans::XPropertyContainer > xCont( mpImpl->mxPropSet, uno::UNO_QUERY );
+ OSL_ENSURE( xCont.is(), "could not get XPropertyContainer interface" );
+ if( ! xCont.is() )
+ return;
+
+ for( std::map< rtl::OUString, WindowPropertySetData::PropertyMapEntry >::iterator it
+ = mpImpl->maProperties.begin(); it != mpImpl->maProperties.end(); ++it )
+ {
+ uno::Sequence< beans::PropertyValue > aOutsideValues( it->second.maSavedValues );
+ beans::PropertyValue* pVal = aOutsideValues.getArray();
+ for( sal_Int32 i = 0; i < aOutsideValues.getLength(); i++ )
+ {
+ pVal[i].Name = getIdentifiedPropertyName( it->first, pVal[i].Name );
+ xCont->addProperty( pVal[i].Name,
+ beans::PropertyAttribute::BOUND | beans:: PropertyAttribute::CONSTRAINED,
+ pVal[i].Value
+ );
+ }
+ }
+}
+
+void WindowPropertySet::propertyChange( const beans::PropertyChangeEvent& i_rEvent )
+{
+ rtl::OUString aIdentifier, aProperty;
+ spliceIdentifiedPropertyName( i_rEvent.PropertyName, aIdentifier, aProperty );
+ std::map< rtl::OUString, WindowPropertySetData::PropertyMapEntry >::iterator it =
+ mpImpl->maProperties.find( aIdentifier );
+ if( it != mpImpl->maProperties.end() )
+ {
+ uno::Sequence< beans::PropertyValue > aSet( 1 );
+ aSet[0].Name = aProperty;
+ aSet[0].Value = i_rEvent.NewValue;
+ it->second.setProperties( aSet );
+ }
+}
+
+IMPL_LINK( vcl::WindowPropertySet, ChildEventListener, VclWindowEvent*, pEvent )
+{
+ // find window in our properties
+ std::map< rtl::OUString, WindowPropertySetData::PropertyMapEntry >::iterator it
+ = mpImpl->maProperties.find( pEvent->GetWindow()->getIdentifier() );
+ if( it != mpImpl->maProperties.end() ) // this is valid, some unnamed child may have sent an event
+ {
+ ULONG nId = pEvent->GetId();
+ // check if anything interesting happened
+ if(
+ // general windowy things
+ nId == VCLEVENT_WINDOW_SHOW ||
+ nId == VCLEVENT_WINDOW_HIDE ||
+ nId == VCLEVENT_WINDOW_ENABLED ||
+ nId == VCLEVENT_WINDOW_DISABLED ||
+ // button thingies
+ nId == VCLEVENT_BUTTON_CLICK ||
+ nId == VCLEVENT_PUSHBUTTON_TOGGLE ||
+ nId == VCLEVENT_RADIOBUTTON_TOGGLE ||
+ nId == VCLEVENT_CHECKBOX_TOGGLE ||
+ // listbox
+ nId == VCLEVENT_LISTBOX_SELECT ||
+ // edit
+ nId == VCLEVENT_EDIT_MODIFY
+ )
+ {
+ WindowPropertySetData::PropertyMapEntry& rEntry = it->second;
+ // collect changes
+ uno::Sequence< beans::PropertyValue > aNewProps( rEntry.getProperties() );
+ uno::Sequence< beans::PropertyValue > aNewPropsOut( aNewProps );
+
+ // translate to identified properties
+ beans::PropertyValue* pValues = aNewPropsOut.getArray();
+ for( sal_Int32 i = 0; i < aNewPropsOut.getLength(); i++ )
+ pValues[i].Name = getIdentifiedPropertyName( it->first, pValues[i].Name );
+
+ // broadcast changes
+ bool bWasVeto = false;
+ mpImpl->mpListener->suspend( true );
+ try
+ {
+ mpImpl->mxPropSetAccess->setPropertyValues( aNewPropsOut );
+ }
+ catch( beans::PropertyVetoException& )
+ {
+ bWasVeto = true;
+ }
+ mpImpl->mpListener->suspend( false );
+
+ if( ! bWasVeto ) // changes accepted ?
+ rEntry.maSavedValues = rEntry.getProperties();
+ else // no, reset
+ rEntry.setProperties( rEntry.maSavedValues );
+ }
+ }
+
+ return 0;
+}
diff --git a/vcl/unx/gtk/a11y/atkutil.cxx b/vcl/unx/gtk/a11y/atkutil.cxx
index 51297109ca43..076e36291ae6 100644
--- a/vcl/unx/gtk/a11y/atkutil.cxx
+++ b/vcl/unx/gtk/a11y/atkutil.cxx
@@ -77,11 +77,10 @@ atk_wrapper_focus_idle_handler (gpointer data)
uno::Reference< accessibility::XAccessible > xAccessible = xNextFocusObject;
if( xAccessible.get() == reinterpret_cast < accessibility::XAccessible * > (data) )
{
+ AtkObject *atk_obj = xAccessible.is() ? atk_object_wrapper_ref( xAccessible ) : NULL;
// Gail does not notify focus changes to NULL, so do we ..
- if( xAccessible.is() )
+ if( atk_obj )
{
- AtkObject *atk_obj = atk_object_wrapper_ref( xAccessible );
-
#ifdef ENABLE_TRACING
fprintf(stderr, "notifying focus event for %p\n", atk_obj);
#endif
diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx
index 2679f4a29c02..f308822df147 100644
--- a/vcl/unx/gtk/app/gtkdata.cxx
+++ b/vcl/unx/gtk/app/gtkdata.cxx
@@ -217,11 +217,12 @@ void GtkSalDisplay::monitorsChanged( GdkScreen* pScreen )
{
gint nMonitors = gdk_screen_get_n_monitors(pScreen);
m_aXineramaScreens = std::vector<Rectangle>();
+ m_aXineramaScreenIndexMap = std::vector<int>(nMonitors);
for (gint i = 0; i < nMonitors; ++i)
{
GdkRectangle dest;
gdk_screen_get_monitor_geometry(pScreen, i, &dest);
- addXineramaScreenUnique( dest.x, dest.y, dest.width, dest.height );
+ m_aXineramaScreenIndexMap[i] = addXineramaScreenUnique( dest.x, dest.y, dest.width, dest.height );
}
m_bXinerama = m_aXineramaScreens.size() > 1;
if( ! m_aFrames.empty() )
@@ -235,6 +236,26 @@ void GtkSalDisplay::monitorsChanged( GdkScreen* pScreen )
}
}
+extern "C"
+{
+ typedef gint(* screen_get_primary_monitor)(GdkScreen *screen);
+}
+
+int GtkSalDisplay::GetDefaultMonitorNumber() const
+{
+ int n = 0;
+ GdkScreen* pScreen = gdk_display_get_screen( m_pGdkDisplay, m_nDefaultScreen );
+#if GTK_CHECK_VERSION(2,20,0)
+ n = m_aXineramaScreenIndexMap[gdk_screen_get_primary_monitor(pScreen)];
+#else
+ static screen_get_primary_monitor sym_gdk_screen_get_primary_monitor =
+ (screen_get_primary_monitor)osl_getAsciiFunctionSymbol( GetSalData()->m_pPlugin, "gdk_screen_get_primary_monitor" );
+ if (sym_gdk_screen_get_primary_monitor)
+ n = m_aXineramaScreenIndexMap[sym_gdk_screen_get_primary_monitor( pScreen )];
+#endif
+ return n;
+}
+
void GtkSalDisplay::initScreen( int nScreen ) const
{
if( nScreen < 0 || nScreen >= static_cast<int>(m_aScreens.size()) )
@@ -489,6 +510,7 @@ class GtkXLib : public SalXLib
GSource *m_pUserEvent;
oslMutex m_aDispatchMutex;
oslCondition m_aDispatchCondition;
+ XIOErrorHandler m_aOrigGTKXIOErrorHandler;
public:
static gboolean timeoutFn(gpointer data);
@@ -522,6 +544,7 @@ GtkXLib::GtkXLib()
m_pUserEvent = NULL;
m_aDispatchCondition = osl_createCondition();
m_aDispatchMutex = osl_createMutex();
+ m_aOrigGTKXIOErrorHandler = NULL;
}
GtkXLib::~GtkXLib()
@@ -535,6 +558,9 @@ GtkXLib::~GtkXLib()
osl_setCondition( m_aDispatchCondition );
osl_destroyCondition( m_aDispatchCondition );
osl_destroyMutex( m_aDispatchMutex );
+
+ PopXErrorLevel();
+ XSetIOErrorHandler (m_aOrigGTKXIOErrorHandler);
}
void GtkXLib::Init()
@@ -596,6 +622,10 @@ void GtkXLib::Init()
// init gtk/gdk
gtk_init_check( &nParams, &pCmdLineAry );
+ //gtk_init_check sets XError/XIOError handlers, we want our own one
+ m_aOrigGTKXIOErrorHandler = XSetIOErrorHandler ( (XIOErrorHandler)X11SalData::XIOErrorHdl );
+ PushXErrorLevel( !!getenv( "SAL_IGNOREXERRORS" ) );
+
for (i = 0; i < nParams; i++ )
g_free( pCmdLineAry[i] );
delete [] pCmdLineAry;
@@ -630,9 +660,10 @@ void GtkXLib::Init()
* the clipboard build another connection
* to the xserver using $DISPLAY
*/
- char *pPutEnvIsBroken = g_strdup_printf( "DISPLAY=%s",
- gdk_display_get_name( pGdkDisp ) );
- putenv( pPutEnvIsBroken );
+ rtl::OUString envVar(RTL_CONSTASCII_USTRINGPARAM("DISPLAY"));
+ const gchar *name = gdk_display_get_name( pGdkDisp );
+ rtl::OUString envValue(name, strlen(name), aEnc);
+ osl_setEnvironment(envVar.pData, envValue.pData);
Display *pDisp = gdk_x11_display_get_xdisplay( pGdkDisp );
diff --git a/vcl/unx/gtk/app/gtkinst.cxx b/vcl/unx/gtk/app/gtkinst.cxx
index 68617c8c16be..2cb92ecd8292 100644
--- a/vcl/unx/gtk/app/gtkinst.cxx
+++ b/vcl/unx/gtk/app/gtkinst.cxx
@@ -39,6 +39,8 @@
#include <rtl/strbuf.hxx>
+#include <rtl/uri.hxx>
+
#if OSL_DEBUG_LEVEL > 1
#include <stdio.h>
#endif
@@ -76,7 +78,7 @@ void GtkHookedYieldMutex::ThreadsLeave()
#if OSL_DEBUG_LEVEL > 1
if( mnThreadId &&
- mnThreadId != NAMESPACE_VOS(OThread)::getCurrentIdentifier())
+ mnThreadId != vos::OThread::getCurrentIdentifier())
fprintf( stderr, "\n\n--- A different thread owns the mutex ...---\n\n\n");
#endif
@@ -216,9 +218,25 @@ extern "C"
void GtkInstance::AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType)
{
+ rtl::OString sGtkURL;
+ rtl_TextEncoding aSystemEnc = osl_getThreadTextEncoding();
+ if ((aSystemEnc == RTL_TEXTENCODING_UTF8) || (rFileUrl.compareToAscii( "file://", 7 ) != 0))
+ sGtkURL = rtl::OUStringToOString(rFileUrl, RTL_TEXTENCODING_UTF8);
+ else
+ {
+ //Non-utf8 locales are a bad idea if trying to work with non-ascii filenames
+ //Decode %XX components
+ rtl::OUString sDecodedUri = Uri::decode(rFileUrl.copy(7), rtl_UriDecodeToIuri, RTL_TEXTENCODING_UTF8);
+ //Convert back to system locale encoding
+ rtl::OString sSystemUrl = rtl::OUStringToOString(sDecodedUri, aSystemEnc);
+ //Encode to an escaped ASCII-encoded URI
+ gchar *g_uri = g_filename_to_uri(sSystemUrl.getStr(), NULL, NULL);
+ sGtkURL = rtl::OString(g_uri);
+ g_free(g_uri);
+ }
#if GTK_CHECK_VERSION(2,10,0)
GtkRecentManager *manager = gtk_recent_manager_get_default ();
- gtk_recent_manager_add_item (manager, rtl::OUStringToOString(rFileUrl, RTL_TEXTENCODING_UTF8).getStr());
+ gtk_recent_manager_add_item (manager, sGtkURL);
(void)rMimeType;
#else
static getDefaultFnc sym_gtk_recent_manager_get_default =
@@ -227,10 +245,7 @@ void GtkInstance::AddToRecentDocumentList(const rtl::OUString& rFileUrl, const r
static addItemFnc sym_gtk_recent_manager_add_item =
(addItemFnc)osl_getAsciiFunctionSymbol( GetSalData()->m_pPlugin, "gtk_recent_manager_add_item");
if (sym_gtk_recent_manager_get_default && sym_gtk_recent_manager_add_item)
- {
- sym_gtk_recent_manager_add_item(sym_gtk_recent_manager_get_default(),
- rtl::OUStringToOString(rFileUrl, RTL_TEXTENCODING_UTF8).getStr());
- }
+ sym_gtk_recent_manager_add_item(sym_gtk_recent_manager_get_default(), sGtkURL);
else
X11SalInstance::AddToRecentDocumentList(rFileUrl, rMimeType);
#endif
diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
index 58ab3771213f..318f593ac6a3 100644
--- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
@@ -735,12 +735,6 @@ BOOL GtkSalGraphics::drawNativeControl( ControlType nType,
const ImplControlValue& aValue,
const OUString& rCaption )
{
- if( (nType==CTRL_CHECKBOX) && (nPart==PART_ENTIRE_CONTROL) &&
- aValue.getTristateVal() == BUTTONVALUE_MIXED )
- {
- return drawNativeMixedStateCheck( nType, nPart, rControlRegion, nState, aValue, rCaption );
- }
-
BOOL returnVal = FALSE;
// get a GC with current clipping region set
SelectFont();
@@ -898,55 +892,6 @@ BOOL GtkSalGraphics::drawNativeControl( ControlType nType,
return( returnVal );
}
-BOOL GtkSalGraphics::drawNativeMixedStateCheck( ControlType nType,
- ControlPart nPart,
- const Rectangle& rControlRegion,
- ControlState nState,
- const ImplControlValue& aValue,
- const OUString& rCaption )
-{
- // need to emulate something for mixed state
-
- // do this via pixmap since some themes don't care for regions
- bool bOldNeedPixmapPaint = bNeedPixmapPaint;
- bNeedPixmapPaint = true;
-
- Rectangle aCtrlRect = rControlRegion;
- BOOL returnVal = FALSE;
- SelectFont();
-
- // draw upper half in off state
- const_cast<ImplControlValue&>(aValue).setTristateVal( BUTTONVALUE_OFF );
- XLIB_Region aRegion = XCreateRegion();
- XRectangle aXRect = { aCtrlRect.Left(), aCtrlRect.Top(), aCtrlRect.GetWidth(), aCtrlRect.GetHeight() };
- const unsigned short nH = aXRect.height/2;
- aXRect.height -= nH;
- XUnionRectWithRegion( &aXRect, aRegion, aRegion );
- SetClipRegion( pFontGC_, aRegion );
- XDestroyRegion( aRegion );
-
- returnVal = drawNativeControl( nType, nPart, rControlRegion, nState, aValue, rCaption );
-
- if( returnVal )
- {
- // draw lower half in on state
- const_cast<ImplControlValue&>(aValue).setTristateVal( BUTTONVALUE_ON );
- aXRect.y += nH;
- aRegion = XCreateRegion();
- XUnionRectWithRegion( &aXRect, aRegion, aRegion );
- SetClipRegion( pFontGC_, aRegion );
- XDestroyRegion( aRegion );
- returnVal = drawNativeControl( nType, nPart, rControlRegion, nState, aValue, rCaption );
- }
-
- // clean up
- bNeedPixmapPaint = bOldNeedPixmapPaint;
- const_cast<ImplControlValue&>(aValue).setTristateVal( BUTTONVALUE_MIXED );
- SetClipRegion( pFontGC_ );
- return returnVal;
-}
-
-
/*
* DrawNativeControlText()
*
@@ -1382,7 +1327,8 @@ BOOL GtkSalGraphics::NWPaintGTKCheck( GdkDrawable* gdkDrawable,
{
GtkStateType stateType;
GtkShadowType shadowType;
- BOOL isChecked = (aValue.getTristateVal()==BUTTONVALUE_ON) ? TRUE : FALSE;
+ bool isChecked = (aValue.getTristateVal() == BUTTONVALUE_ON);
+ bool isInconsistent = (aValue.getTristateVal() == BUTTONVALUE_MIXED);
GdkRectangle clipRect;
gint x,y;
@@ -1397,7 +1343,7 @@ BOOL GtkSalGraphics::NWPaintGTKCheck( GdkDrawable* gdkDrawable,
y = rControlRectangle.Top() + (rControlRectangle.GetHeight()-indicator_size)/2;
// Set the shadow based on if checked or not so we get a checkmark.
- shadowType = isChecked ? GTK_SHADOW_IN : GTK_SHADOW_OUT;
+ shadowType = isChecked ? GTK_SHADOW_IN : isInconsistent ? GTK_SHADOW_ETCHED_IN : GTK_SHADOW_OUT;
NWSetWidgetState( gWidgetData[m_nScreen].gCheckWidget, nState, stateType );
GTK_TOGGLE_BUTTON(gWidgetData[m_nScreen].gCheckWidget)->active = isChecked;
@@ -2537,7 +2483,6 @@ BOOL GtkSalGraphics::NWPaintGTKToolbar(
gint g_x=0, g_y=0, g_w=10, g_h=10;
bool bPaintButton = true;
GtkWidget* pButtonWidget = gWidgetData[m_nScreen].gToolbarButtonWidget;
- const gchar* pButtonDetail = "button";
GdkRectangle clipRect;
NWEnsureGTKToolbar( m_nScreen );
@@ -2596,13 +2541,18 @@ BOOL GtkSalGraphics::NWPaintGTKToolbar(
{
pButtonWidget = gWidgetData[m_nScreen].gToolbarToggleWidget;
shadowType = GTK_SHADOW_IN;
+ stateType = GTK_STATE_ACTIVE;
// special case stateType value for depressed toggle buttons
// cf. gtk+/gtk/gtktogglebutton.c (gtk_toggle_button_update_state)
- if( ! (nState & (CTRL_STATE_PRESSED|CTRL_STATE_ROLLOVER)) )
- stateType = GTK_STATE_ACTIVE;
- pButtonDetail = "togglebutton";
+ if( (nState & (CTRL_STATE_ROLLOVER|CTRL_STATE_PRESSED)) )
+ {
+ stateType = GTK_STATE_PRELIGHT;
+ shadowType = GTK_SHADOW_OUT;
+ }
bPaintButton = true;
}
+ else
+ stateType = GTK_STATE_PRELIGHT; // only for bPaintButton = true, in which case always rollver is meant
NWSetWidgetState( pButtonWidget, nState, stateType );
gtk_widget_ensure_style( pButtonWidget );
@@ -2660,7 +2610,7 @@ BOOL GtkSalGraphics::NWPaintGTKToolbar(
stateType,
shadowType,
&clipRect,
- pButtonWidget, pButtonDetail, x, y, w, h );
+ pButtonWidget, "button", x, y, w, h );
}
}
}
diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx
index e8b55ebfa895..d04d5c0ce684 100644
--- a/vcl/unx/gtk/window/gtkframe.cxx
+++ b/vcl/unx/gtk/window/gtkframe.cxx
@@ -1353,11 +1353,7 @@ void GtkSalFrame::Show( BOOL bVisible, BOOL bNoActivate )
//
// i.e. having a time < that of the toplevel frame means that the toplevel frame gets unfocused.
// awesome.
- bool bHack =
- getDisplay()->getWMAdaptor()->getWindowManagerName().EqualsAscii("Metacity") ||
- getDisplay()->getWMAdaptor()->getWindowManagerName().EqualsAscii("compiz")
- ;
- if( nUserTime == 0 && bHack )
+ if( nUserTime == 0 )
{
/* #i99360# ugly workaround an X11 library bug */
nUserTime= getDisplay()->GetLastUserEventTime( true );
@@ -1365,7 +1361,7 @@ void GtkSalFrame::Show( BOOL bVisible, BOOL bNoActivate )
}
lcl_set_user_time( GTK_WIDGET(m_pWindow)->window, nUserTime );
- if( bHack && ! bNoActivate && (m_nStyle & SAL_FRAME_STYLE_TOOLWINDOW) )
+ if( ! bNoActivate && (m_nStyle & SAL_FRAME_STYLE_TOOLWINDOW) )
m_bSetFocusOnMap = true;
gtk_widget_show( m_pWindow );
@@ -1452,6 +1448,12 @@ void GtkSalFrame::setMinMaxSize()
aHints |= GDK_HINT_MAX_SIZE;
}
}
+ if( m_bFullscreen && m_aMaxSize.Width() && m_aMaxSize.Height() )
+ {
+ aGeo.max_width = m_aMaxSize.Width();
+ aGeo.max_height = m_aMaxSize.Height();
+ aHints |= GDK_HINT_MAX_SIZE;
+ }
if( aHints )
gtk_window_set_geometry_hints( GTK_WINDOW(m_pWindow),
NULL,
diff --git a/vcl/unx/headless/svpgdi.hxx b/vcl/unx/headless/svpgdi.hxx
index ca1af87f8862..93ec080d0136 100644
--- a/vcl/unx/headless/svpgdi.hxx
+++ b/vcl/unx/headless/svpgdi.hxx
@@ -86,9 +86,9 @@ public:
virtual void SetTextColor( SalColor nSalColor );
virtual USHORT SetFont( ImplFontSelectData*, int nFallbackLevel );
- virtual void GetFontMetric( ImplFontMetricData* );
+ virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel );
virtual ULONG GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs );
- virtual ImplFontCharMap* GetImplFontCharMap() const;
+ virtual const ImplFontCharMap* GetImplFontCharMap() const;
virtual void GetDevFontList( ImplDevFontList* );
virtual void GetDevFontSubstList( OutputDevice* );
virtual bool AddTempDevFont( ImplDevFontList*, const String& rFileURL, const String& rFontName );
diff --git a/vcl/unx/headless/svpinst.cxx b/vcl/unx/headless/svpinst.cxx
index 466b56868900..fc788b2a0530 100644
--- a/vcl/unx/headless/svpinst.cxx
+++ b/vcl/unx/headless/svpinst.cxx
@@ -302,7 +302,7 @@ vos::IMutex* SvpSalInstance::GetYieldMutex()
ULONG SvpSalInstance::ReleaseYieldMutex()
{
if ( m_aYieldMutex.GetThreadId() ==
- NAMESPACE_VOS(OThread)::getCurrentIdentifier() )
+ vos::OThread::getCurrentIdentifier() )
{
ULONG nCount = m_aYieldMutex.GetAcquireCount();
ULONG n = nCount;
@@ -327,6 +327,19 @@ void SvpSalInstance::AcquireYieldMutex( ULONG nCount )
}
}
+bool SvpSalInstance::CheckYieldMutex()
+{
+ bool bRet = true;
+
+ if ( m_aYieldMutex.GetThreadId() !=
+ vos::OThread::getCurrentIdentifier() )
+ {
+ bRet = false;
+ }
+
+ return bRet;
+}
+
void SvpSalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents )
{
// first, check for already queued events.
@@ -419,24 +432,6 @@ bool SvpSalInstance::AnyInput( USHORT nType )
return false;
}
-SalMenu* SvpSalInstance::CreateMenu( BOOL )
-{
- return NULL;
-}
-
-void SvpSalInstance::DestroyMenu( SalMenu* )
-{
-}
-
-SalMenuItem* SvpSalInstance::CreateMenuItem( const SalItemParams* )
-{
- return NULL;
-}
-
-void SvpSalInstance::DestroyMenuItem( SalMenuItem* )
-{
-}
-
SalSession* SvpSalInstance::CreateSalSession()
{
return NULL;
@@ -464,13 +459,13 @@ SvpSalYieldMutex::SvpSalYieldMutex()
void SvpSalYieldMutex::acquire()
{
OMutex::acquire();
- mnThreadId = NAMESPACE_VOS(OThread)::getCurrentIdentifier();
+ mnThreadId = vos::OThread::getCurrentIdentifier();
mnCount++;
}
void SvpSalYieldMutex::release()
{
- if ( mnThreadId == NAMESPACE_VOS(OThread)::getCurrentIdentifier() )
+ if ( mnThreadId == vos::OThread::getCurrentIdentifier() )
{
if ( mnCount == 1 )
mnThreadId = 0;
@@ -483,7 +478,7 @@ sal_Bool SvpSalYieldMutex::tryToAcquire()
{
if ( OMutex::tryToAcquire() )
{
- mnThreadId = NAMESPACE_VOS(OThread)::getCurrentIdentifier();
+ mnThreadId = vos::OThread::getCurrentIdentifier();
mnCount++;
return sal_True;
}
diff --git a/vcl/unx/headless/svpinst.hxx b/vcl/unx/headless/svpinst.hxx
index 284a2d11cd82..02d5e3fa9494 100644
--- a/vcl/unx/headless/svpinst.hxx
+++ b/vcl/unx/headless/svpinst.hxx
@@ -46,11 +46,11 @@
// SalYieldMutex
// -------------------------------------------------------------------------
-class SvpSalYieldMutex : public NAMESPACE_VOS(OMutex)
+class SvpSalYieldMutex : public vos::OMutex
{
protected:
ULONG mnCount;
- NAMESPACE_VOS(OThread)::TThreadIdentifier mnThreadId;
+ vos::OThread::TThreadIdentifier mnThreadId;
public:
SvpSalYieldMutex();
@@ -60,7 +60,7 @@ public:
virtual sal_Bool tryToAcquire();
ULONG GetAcquireCount() const { return mnCount; }
- NAMESPACE_VOS(OThread)::TThreadIdentifier GetThreadId() const { return mnThreadId; }
+ vos::OThread::TThreadIdentifier GetThreadId() const { return mnThreadId; }
};
// ---------------
@@ -176,6 +176,7 @@ public:
virtual vos::IMutex* GetYieldMutex();
virtual ULONG ReleaseYieldMutex();
virtual void AcquireYieldMutex( ULONG nCount );
+ virtual bool CheckYieldMutex();
// wait next event and dispatch
// must returned by UserEvent (SalFrame::PostEvent)
@@ -183,12 +184,6 @@ public:
virtual void Yield( bool bWait, bool bHandleAllCurrentEvents );
virtual bool AnyInput( USHORT nType );
- // Menues
- virtual SalMenu* CreateMenu( BOOL bMenuBar );
- virtual void DestroyMenu( SalMenu* pMenu);
- virtual SalMenuItem* CreateMenuItem( const SalItemParams* pItemData );
- virtual void DestroyMenuItem( SalMenuItem* pItem );
-
// may return NULL to disable session management
virtual SalSession* CreateSalSession();
diff --git a/vcl/unx/headless/svppspgraphics.cxx b/vcl/unx/headless/svppspgraphics.cxx
index 6da09b38023c..c7b1f4f41fca 100644
--- a/vcl/unx/headless/svppspgraphics.cxx
+++ b/vcl/unx/headless/svppspgraphics.cxx
@@ -683,16 +683,13 @@ void PspGraphics::DrawServerFontLayout( const ServerFontLayout& rLayout )
DrawPrinterLayout( rLayout, *m_pPrinterGfx, true );
}
-ImplFontCharMap* PspGraphics::GetImplFontCharMap() const
+const ImplFontCharMap* PspGraphics::GetImplFontCharMap() const
{
- // TODO: get ImplFontCharMap directly from fonts
if( !m_pServerFont[0] )
return NULL;
- CmapResult aCmapResult;
- if( !m_pServerFont[0]->GetFontCodeRanges( aCmapResult ) )
- return NULL;
- return new ImplFontCharMap( aCmapResult );
+ const ImplFontCharMap* pIFCMap = m_pServerFont[0]->GetImplFontCharMap();
+ return pIFCMap;
}
USHORT PspGraphics::SetFont( ImplFontSelectData *pEntry, int nFallbackLevel )
@@ -792,7 +789,7 @@ void PspGraphics::GetDevFontSubstList( OutputDevice* pOutDev )
}
}
-void PspGraphics::GetFontMetric( ImplFontMetricData *pMetric )
+void PspGraphics::GetFontMetric( ImplFontMetricData *pMetric, int )
{
const psp::PrintFontManager& rMgr = psp::PrintFontManager::get();
psp::PrintFontInfo aInfo;
diff --git a/vcl/unx/headless/svppspgraphics.hxx b/vcl/unx/headless/svppspgraphics.hxx
index 063dff34c3c2..138198239621 100644
--- a/vcl/unx/headless/svppspgraphics.hxx
+++ b/vcl/unx/headless/svppspgraphics.hxx
@@ -105,9 +105,9 @@ public:
virtual void SetTextColor( SalColor nSalColor );
virtual USHORT SetFont( ImplFontSelectData*, int nFallbackLevel );
- virtual void GetFontMetric( ImplFontMetricData* );
+ virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel );
virtual ULONG GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs );
- virtual ImplFontCharMap* GetImplFontCharMap() const;
+ virtual const ImplFontCharMap* GetImplFontCharMap() const;
virtual void GetDevFontList( ImplDevFontList* );
virtual void GetDevFontSubstList( OutputDevice* );
virtual bool AddTempDevFont( ImplDevFontList*, const String& rFileURL, const String& rFontName );
diff --git a/vcl/unx/headless/svptext.cxx b/vcl/unx/headless/svptext.cxx
index ecb8b11b7e04..dff1fd4d6ca7 100644
--- a/vcl/unx/headless/svptext.cxx
+++ b/vcl/unx/headless/svptext.cxx
@@ -240,12 +240,15 @@ USHORT SvpSalGraphics::SetFont( ImplFontSelectData* pIFSD, int nFallbackLevel )
// ---------------------------------------------------------------------------
-void SvpSalGraphics::GetFontMetric( ImplFontMetricData* pMetric )
+void SvpSalGraphics::GetFontMetric( ImplFontMetricData* pMetric, int nFallbackLevel )
{
- if( m_pServerFont[0] != NULL )
+ if( nFallbackLevel >= MAX_FALLBACK )
+ return;
+
+ if( m_pServerFont[nFallbackLevel] != NULL )
{
long rDummyFactor;
- m_pServerFont[0]->FetchFontMetric( *pMetric, rDummyFactor );
+ m_pServerFont[nFallbackLevel]->FetchFontMetric( *pMetric, rDummyFactor );
}
}
@@ -269,15 +272,13 @@ ULONG SvpSalGraphics::GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs )
// ---------------------------------------------------------------------------
-ImplFontCharMap* SvpSalGraphics::GetImplFontCharMap() const
+const ImplFontCharMap* SvpSalGraphics::GetImplFontCharMap() const
{
if( !m_pServerFont[0] )
return NULL;
- CmapResult aCmapResult;
- if( !m_pServerFont[0]->GetFontCodeRanges( aCmapResult ) )
- return NULL;
- return new ImplFontCharMap( aCmapResult );
+ const ImplFontCharMap* pIFCMap = m_pServerFont[0]->GetImplFontCharMap();
+ return pIFCMap;
}
// ---------------------------------------------------------------------------
diff --git a/vcl/unx/inc/plugins/gtk/gtkdata.hxx b/vcl/unx/inc/plugins/gtk/gtkdata.hxx
index d4dec957a6b3..b650cffbae8b 100644
--- a/vcl/unx/inc/plugins/gtk/gtkdata.hxx
+++ b/vcl/unx/inc/plugins/gtk/gtkdata.hxx
@@ -59,6 +59,8 @@ class GtkSalDisplay : public SalDisplay
GdkDisplay* m_pGdkDisplay;
GdkCursor *m_aCursors[ POINTER_COUNT ];
bool m_bStartupCompleted;
+ std::vector< int > m_aXineramaScreenIndexMap;
+
GdkCursor* getFromXPM( const char *pBitmap, const char *pMask,
int nWidth, int nHeight, int nXHot, int nYHot );
public:
@@ -73,6 +75,8 @@ public:
virtual long Dispatch( XEvent *pEvent );
virtual void initScreen( int nScreen ) const;
+ virtual int GetDefaultMonitorNumber() const;
+
static GdkFilterReturn filterGdkEvent( GdkXEvent* sys_event,
GdkEvent* event,
gpointer data );
diff --git a/vcl/unx/inc/plugins/gtk/gtkgdi.hxx b/vcl/unx/inc/plugins/gtk/gtkgdi.hxx
index 7544a566d8ae..38c79b3e11df 100644
--- a/vcl/unx/inc/plugins/gtk/gtkgdi.hxx
+++ b/vcl/unx/inc/plugins/gtk/gtkgdi.hxx
@@ -178,10 +178,6 @@ protected:
const clipList& rClipList,
ControlState nState, const ImplControlValue& aValue,
const OUString& rCaption );
-
- BOOL drawNativeMixedStateCheck( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
- ControlState nState, const ImplControlValue& aValue,
- const rtl::OUString& rCaption );
};
#endif // _VCL_GTKGDI_HXX
diff --git a/vcl/unx/inc/pspgraphics.h b/vcl/unx/inc/pspgraphics.h
index 4b1ac12116a3..d4f5a9f156e0 100644
--- a/vcl/unx/inc/pspgraphics.h
+++ b/vcl/unx/inc/pspgraphics.h
@@ -102,9 +102,9 @@ public:
virtual void SetTextColor( SalColor nSalColor );
virtual USHORT SetFont( ImplFontSelectData*, int nFallbackLevel );
- virtual void GetFontMetric( ImplFontMetricData* );
+ virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel );
virtual ULONG GetKernPairs( ULONG nMaxPairs, ImplKernPairData* );
- virtual ImplFontCharMap* GetImplFontCharMap() const;
+ virtual const ImplFontCharMap* GetImplFontCharMap() const;
virtual void GetDevFontList( ImplDevFontList* );
virtual void GetDevFontSubstList( OutputDevice* );
virtual bool AddTempDevFont( ImplDevFontList*, const String& rFileURL, const String& rFontName );
diff --git a/vcl/unx/inc/saldata.hxx b/vcl/unx/inc/saldata.hxx
index 7e38e0a89bf2..939437060750 100644
--- a/vcl/unx/inc/saldata.hxx
+++ b/vcl/unx/inc/saldata.hxx
@@ -63,6 +63,7 @@ protected:
SalDisplay *m_pSalDisplay;
pthread_t hMainThread_;
rtl::OUString maLocalHostName;
+ rtl::OUString maUnicodeAccumulator;
public:
X11SalData();
@@ -90,6 +91,7 @@ public:
const rtl::OUString& GetLocalHostName() const
{ return maLocalHostName; }
+ rtl::OUString& GetUnicodeAccumulator() { return maUnicodeAccumulator; }
static int XErrorHdl( Display*, XErrorEvent* );
static int XIOErrorHdl( Display* );
diff --git a/vcl/unx/inc/saldisp.hxx b/vcl/unx/inc/saldisp.hxx
index 3734cbec6ef7..99c9bea699d6 100644
--- a/vcl/unx/inc/saldisp.hxx
+++ b/vcl/unx/inc/saldisp.hxx
@@ -405,7 +405,7 @@ protected:
int processRandREvent( XEvent* );
void doDestruct();
- void addXineramaScreenUnique( long i_nX, long i_nY, long i_nWidth, long i_nHeight );
+ int addXineramaScreenUnique( long i_nX, long i_nY, long i_nWidth, long i_nHeight );
public:
static SalDisplay *GetSalDisplay( Display* display );
static BOOL BestVisual( Display *pDisp,
@@ -475,6 +475,7 @@ public:
XLIB_Window GetDrawable( int nScreen ) const { return getDataForScreen( nScreen ).m_aRefWindow; }
Display *GetDisplay() const { return pDisp_; }
int GetDefaultScreenNumber() const { return m_nDefaultScreen; }
+ virtual int GetDefaultMonitorNumber() const { return 0; }
const Size& GetScreenSize( int nScreen ) const { return getDataForScreen( nScreen ).m_aSize; }
srv_vendor_t GetServerVendor() const { return meServerVendor; }
void SetServerVendor() { meServerVendor = sal_GetServerVendor(pDisp_); }
diff --git a/vcl/unx/inc/salframe.h b/vcl/unx/inc/salframe.h
index ed173e61fe61..9786bac76f35 100644
--- a/vcl/unx/inc/salframe.h
+++ b/vcl/unx/inc/salframe.h
@@ -208,6 +208,10 @@ public:
bool isMapped() const { return bMapped_; }
bool hasFocus() const { return mbInputFocus; }
+ void beginUnicodeSequence();
+ bool appendUnicodeSequence( sal_Unicode );
+ bool endUnicodeSequence();
+
virtual SalGraphics* GetGraphics();
virtual void ReleaseGraphics( SalGraphics* pGraphics );
diff --git a/vcl/unx/inc/salgdi.h b/vcl/unx/inc/salgdi.h
index 42d9c5592317..b5fdce50eee9 100644
--- a/vcl/unx/inc/salgdi.h
+++ b/vcl/unx/inc/salgdi.h
@@ -253,9 +253,9 @@ public:
virtual void SetTextColor( SalColor nSalColor );
virtual USHORT SetFont( ImplFontSelectData*, int nFallbackLevel );
- virtual void GetFontMetric( ImplFontMetricData* );
+ virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel );
virtual ULONG GetKernPairs( ULONG nMaxPairs, ImplKernPairData* );
- virtual ImplFontCharMap* GetImplFontCharMap() const;
+ virtual const ImplFontCharMap* GetImplFontCharMap() const;
virtual void GetDevFontList( ImplDevFontList* );
virtual void GetDevFontSubstList( OutputDevice* );
virtual bool AddTempDevFont( ImplDevFontList*, const String& rFileURL, const String& rFontName );
diff --git a/vcl/unx/inc/salinst.h b/vcl/unx/inc/salinst.h
index d73d67f81425..133f0bf6037f 100644
--- a/vcl/unx/inc/salinst.h
+++ b/vcl/unx/inc/salinst.h
@@ -39,11 +39,11 @@
#include <vcl/dllapi.h>
#include <vcl/salinst.hxx>
-class VCL_DLLPUBLIC SalYieldMutex : public NAMESPACE_VOS(OMutex)
+class VCL_DLLPUBLIC SalYieldMutex : public vos::OMutex
{
protected:
ULONG mnCount;
- NAMESPACE_VOS(OThread)::TThreadIdentifier mnThreadId;
+ vos::OThread::TThreadIdentifier mnThreadId;
public:
SalYieldMutex();
@@ -53,7 +53,7 @@ public:
virtual sal_Bool tryToAcquire();
ULONG GetAcquireCount() const { return mnCount; }
- NAMESPACE_VOS(OThread)::TThreadIdentifier GetThreadId() const { return mnThreadId; }
+ vos::OThread::TThreadIdentifier GetThreadId() const { return mnThreadId; }
};
// -=-= SalInstanceData =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
@@ -102,13 +102,10 @@ public:
virtual vos::IMutex* GetYieldMutex();
virtual ULONG ReleaseYieldMutex();
virtual void AcquireYieldMutex( ULONG nCount );
+ virtual bool CheckYieldMutex();
virtual void Yield( bool bWait, bool bHandleAllCurrentEvents );
virtual bool AnyInput( USHORT nType );
- virtual SalMenu* CreateMenu( BOOL bMenuBar );
- virtual void DestroyMenu( SalMenu* pMenu);
- virtual SalMenuItem* CreateMenuItem( const SalItemParams* pItemData );
- virtual void DestroyMenuItem( SalMenuItem* pItem );
virtual void* GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes );
void FillFontPathList( std::list< rtl::OString >& o_rFontPaths );
diff --git a/vcl/unx/inc/salprn.h b/vcl/unx/inc/salprn.h
index fa68f1b38e73..6e6ca0a2f1cc 100644
--- a/vcl/unx/inc/salprn.h
+++ b/vcl/unx/inc/salprn.h
@@ -71,6 +71,7 @@ public:
bool m_bFax:1;
bool m_bPdf:1;
bool m_bSwallowFaxNo:1;
+ bool m_bIsPDFWriterJob:1;
PspGraphics* m_pGraphics;
psp::PrinterJob m_aPrintJob;
psp::JobData m_aJobData;
@@ -91,6 +92,11 @@ public:
bool bCollate,
bool bDirect,
ImplJobSetup* pSetupData );
+ virtual BOOL StartJob( const String*,
+ const String&,
+ const String&,
+ ImplJobSetup*,
+ vcl::PrinterController& i_rController );
virtual BOOL EndJob();
virtual BOOL AbortJob();
virtual SalGraphics* StartPage( ImplJobSetup* pSetupData, BOOL bNewJobData );
diff --git a/vcl/unx/inc/wmadaptor.hxx b/vcl/unx/inc/wmadaptor.hxx
index cbedede2cc99..e8620db29c6f 100644
--- a/vcl/unx/inc/wmadaptor.hxx
+++ b/vcl/unx/inc/wmadaptor.hxx
@@ -165,6 +165,8 @@ protected:
bool m_bLegacyPartialFullscreen;
int m_nWinGravity;
int m_nInitWinGravity;
+ bool m_bWMshouldSwitchWorkspace;
+ bool m_bWMshouldSwitchWorkspaceInit;
WMAdaptor( SalDisplay * )
;
@@ -177,6 +179,7 @@ protected:
*/
virtual bool isValid() const;
+ bool getWMshouldSwitchWorkspace() const;
public:
virtual ~WMAdaptor();
@@ -214,8 +217,9 @@ public:
/*
* attemp to switch the desktop to a certain workarea
+ * if bConsiderWM is true, then on some WMs the call will not result in any action
*/
- void switchToWorkArea( int nWorkArea ) const;
+ void switchToWorkArea( int nWorkArea, bool bConsiderWM = true ) const;
/*
* sets window title
diff --git a/vcl/unx/source/app/i18n_im.cxx b/vcl/unx/source/app/i18n_im.cxx
index 9f1ffee3d1c4..c797da34e76c 100644
--- a/vcl/unx/source/app/i18n_im.cxx
+++ b/vcl/unx/source/app/i18n_im.cxx
@@ -36,10 +36,6 @@
# endif
#endif
#include <poll.h>
-#ifdef SOLARIS
-// for SetSystemEnvironment()
-#include <sal/alloca.h>
-#endif
#include <tools/prex.h>
#include <X11/Xlocale.h>
@@ -53,6 +49,7 @@
#include <i18n_status.hxx>
#include <osl/thread.h>
+#include <osl/process.h>
using namespace vcl;
#include "i18n_cb.hxx"
@@ -179,21 +176,13 @@ SetSystemLocale( const char* p_inlocale )
#ifdef SOLARIS
static void
-SetSystemEnvironment( const char* p_locale )
+SetSystemEnvironment( const rtl::OUString& rLocale )
{
- const char *lc_all = "LC_ALL=%s";
- const char *lang = "LANG=%s";
-
- char *p_buffer;
+ rtl::OUString LC_ALL_Var(RTL_CONSTASCII_USTRINGPARAM("LC_ALL"));
+ osl_setEnvironment(LC_ALL_Var.pData, rLocale.pData);
- if (p_locale != NULL)
- {
- p_buffer = (char*)alloca(10 + strlen(p_locale));
- sprintf(p_buffer, lc_all, p_locale);
- putenv(strdup(p_buffer));
- sprintf(p_buffer, lang, p_locale);
- putenv(strdup(p_buffer));
- }
+ rtl::OUString LANG_Var(RTL_CONSTASCII_USTRINGPARAM("LANG"));
+ osl_setEnvironment(LANG_Var.pData, rLocale.pData);
}
#endif
@@ -249,13 +238,13 @@ SalI18N_InputMethod::SetLocale( const char* pLocale )
osl_setThreadTextEncoding (RTL_TEXTENCODING_ISO_8859_1);
locale = SetSystemLocale( "en_US" );
#ifdef SOLARIS
- SetSystemEnvironment( "en_US" );
+ SetSystemEnvironment( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("en_US")) );
#endif
if (! IsXWindowCompatibleLocale(locale))
{
locale = SetSystemLocale( "C" );
#ifdef SOLARIS
- SetSystemEnvironment( "C" );
+ SetSystemEnvironment( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("C")) );
#endif
if (! IsXWindowCompatibleLocale(locale))
mbUseable = False;
@@ -440,7 +429,8 @@ SalI18N_InputMethod::CreateMethod ( Display *pDisplay )
if ((maMethod == (XIM)NULL) && (getenv("XMODIFIERS") != NULL))
{
- putenv (strdup("XMODIFIERS"));
+ rtl::OUString envVar(RTL_CONSTASCII_USTRINGPARAM("XMODIFIERS"));
+ osl_clearEnvironment(envVar.pData);
XSetLocaleModifiers("");
maMethod = XOpenIM(pDisplay, NULL, NULL, NULL);
mbMultiLingual = False;
diff --git a/vcl/unx/source/app/saldata.cxx b/vcl/unx/source/app/saldata.cxx
index 50ef71df8619..beb7b60a551c 100644
--- a/vcl/unx/source/app/saldata.cxx
+++ b/vcl/unx/source/app/saldata.cxx
@@ -425,10 +425,8 @@ void SalXLib::Init()
* the clipboard build another connection
* to the xserver using $DISPLAY
*/
- const char envpre[] = "DISPLAY=";
- char *envstr = new char[sizeof(envpre)+aDisplay.getLength()];
- snprintf(envstr, sizeof(envpre)+aDisplay.getLength(), "DISPLAY=%s", aDisplay.getStr());
- putenv(envstr);
+ rtl::OUString envVar(RTL_CONSTASCII_USTRINGPARAM("DISPLAY"));
+ osl_setEnvironment(envVar.pData, aParam.pData);
}
break;
}
diff --git a/vcl/unx/source/app/saldisp.cxx b/vcl/unx/source/app/saldisp.cxx
index 13a0d1093c8e..354c4d433d42 100644
--- a/vcl/unx/source/app/saldisp.cxx
+++ b/vcl/unx/source/app/saldisp.cxx
@@ -2255,7 +2255,7 @@ void SalX11Display::Yield()
XEvent aEvent;
DBG_ASSERT( static_cast<SalYieldMutex*>(GetSalData()->m_pInstance->GetYieldMutex())->GetThreadId() ==
- NAMESPACE_VOS(OThread)::getCurrentIdentifier(),
+ vos::OThread::getCurrentIdentifier(),
"will crash soon since solar mutex not locked in SalDisplay::Yield" );
XNextEvent( pDisp_, &aEvent );
@@ -2592,7 +2592,7 @@ void SalDisplay::PrintInfo() const
sal::static_int_cast< unsigned int >(GetVisual(m_nDefaultScreen).GetVisualId()) );
}
-void SalDisplay::addXineramaScreenUnique( long i_nX, long i_nY, long i_nWidth, long i_nHeight )
+int SalDisplay::addXineramaScreenUnique( long i_nX, long i_nY, long i_nWidth, long i_nHeight )
{
// see if any frame buffers are at the same coordinates
// this can happen with weird configuration e.g. on
@@ -2608,10 +2608,11 @@ void SalDisplay::addXineramaScreenUnique( long i_nX, long i_nY, long i_nWidth, l
{
m_aXineramaScreens[n].SetSize( Size( i_nWidth, i_nHeight ) );
}
- return;
+ return (int)n;
}
}
m_aXineramaScreens.push_back( Rectangle( Point( i_nX, i_nY ), Size( i_nWidth, i_nHeight ) ) );
+ return (int)m_aXineramaScreens.size()-1;
}
void SalDisplay::InitXinerama()
diff --git a/vcl/unx/source/app/salinst.cxx b/vcl/unx/source/app/salinst.cxx
index 8a8db44cefcd..88af0b70ef7e 100644
--- a/vcl/unx/source/app/salinst.cxx
+++ b/vcl/unx/source/app/salinst.cxx
@@ -66,13 +66,13 @@ SalYieldMutex::SalYieldMutex()
void SalYieldMutex::acquire()
{
OMutex::acquire();
- mnThreadId = NAMESPACE_VOS(OThread)::getCurrentIdentifier();
+ mnThreadId = vos::OThread::getCurrentIdentifier();
mnCount++;
}
void SalYieldMutex::release()
{
- if ( mnThreadId == NAMESPACE_VOS(OThread)::getCurrentIdentifier() )
+ if ( mnThreadId == vos::OThread::getCurrentIdentifier() )
{
if ( mnCount == 1 )
mnThreadId = 0;
@@ -85,7 +85,7 @@ sal_Bool SalYieldMutex::tryToAcquire()
{
if ( OMutex::tryToAcquire() )
{
- mnThreadId = NAMESPACE_VOS(OThread)::getCurrentIdentifier();
+ mnThreadId = vos::OThread::getCurrentIdentifier();
mnCount++;
return True;
}
@@ -231,7 +231,7 @@ ULONG X11SalInstance::ReleaseYieldMutex()
{
SalYieldMutex* pYieldMutex = mpSalYieldMutex;
if ( pYieldMutex->GetThreadId() ==
- NAMESPACE_VOS(OThread)::getCurrentIdentifier() )
+ vos::OThread::getCurrentIdentifier() )
{
ULONG nCount = pYieldMutex->GetAcquireCount();
ULONG n = nCount;
@@ -259,6 +259,24 @@ void X11SalInstance::AcquireYieldMutex( ULONG nCount )
}
}
+// -----------------------------------------------------------------------
+
+bool X11SalInstance::CheckYieldMutex()
+{
+ bool bRet = true;
+
+ SalYieldMutex* pYieldMutex = mpSalYieldMutex;
+ if ( pYieldMutex->GetThreadId() !=
+ vos::OThread::getCurrentIdentifier() )
+ {
+ bRet = false;
+ }
+
+ return bRet;
+}
+
+// -----------------------------------------------------------------------
+
void X11SalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents )
{ GetX11SalData()->GetLib()->Yield( bWait, bHandleAllCurrentEvents ); }
diff --git a/vcl/unx/source/app/salsys.cxx b/vcl/unx/source/app/salsys.cxx
index 1ccb214df4ed..84c9dba32e40 100644
--- a/vcl/unx/source/app/salsys.cxx
+++ b/vcl/unx/source/app/salsys.cxx
@@ -71,7 +71,7 @@ bool X11SalSystem::IsMultiDisplay()
unsigned int X11SalSystem::GetDefaultDisplayNumber()
{
SalDisplay* pSalDisp = GetX11SalData()->GetDisplay();
- return pSalDisp->GetDefaultScreenNumber();
+ return pSalDisp->IsXinerama() ? pSalDisp->GetDefaultMonitorNumber() : pSalDisp->GetDefaultScreenNumber();
}
Rectangle X11SalSystem::GetDisplayScreenPosSizePixel( unsigned int nScreen )
diff --git a/vcl/unx/source/app/wmadaptor.cxx b/vcl/unx/source/app/wmadaptor.cxx
index aa2e4c84ef24..f816c5d1426e 100644
--- a/vcl/unx/source/app/wmadaptor.cxx
+++ b/vcl/unx/source/app/wmadaptor.cxx
@@ -31,21 +31,22 @@
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
-#include <sal/alloca.h>
-#include <wmadaptor.hxx>
-#include <saldisp.hxx>
-#include <saldata.hxx>
-#include <salframe.h>
-#include <vcl/salgdi.hxx>
-#include <osl/thread.h>
-#include <rtl/locale.h>
-#include <osl/process.h>
-
-#include <tools/prex.h>
+#include "sal/alloca.h"
+#include "wmadaptor.hxx"
+#include "saldisp.hxx"
+#include "saldata.hxx"
+#include "salframe.h"
+#include "vcl/salgdi.hxx"
+#include "osl/thread.h"
+#include "rtl/locale.h"
+#include "osl/process.h"
+#include "vcl/configsettings.hxx"
+
+#include "tools/prex.h"
#include <X11/X.h>
#include <X11/Xatom.h>
#include <X11/Xresource.h>
-#include <tools/postx.h>
+#include "tools/postx.h"
#if OSL_DEBUG_LEVEL > 1
#include <stdio.h>
@@ -238,7 +239,9 @@ WMAdaptor::WMAdaptor( SalDisplay* pDisplay ) :
m_bEnableAlwaysOnTopWorks( false ),
m_bLegacyPartialFullscreen( false ),
m_nWinGravity( StaticGravity ),
- m_nInitWinGravity( StaticGravity )
+ m_nInitWinGravity( StaticGravity ),
+ m_bWMshouldSwitchWorkspace( true ),
+ m_bWMshouldSwitchWorkspaceInit( false )
{
Atom aRealType = None;
int nFormat = 8;
@@ -965,6 +968,30 @@ bool WMAdaptor::getNetWmName()
return bNetWM;
}
+bool WMAdaptor::getWMshouldSwitchWorkspace() const
+{
+ if( ! m_bWMshouldSwitchWorkspaceInit )
+ {
+ WMAdaptor * pWMA = const_cast<WMAdaptor*>(this);
+
+ pWMA->m_bWMshouldSwitchWorkspace = true;
+ vcl::SettingsConfigItem* pItem = vcl::SettingsConfigItem::get();
+ rtl::OUString aSetting( pItem->getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "WM" ) ),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ShouldSwitchWorkspace" ) ) ) );
+ if( aSetting.getLength() == 0 )
+ {
+ if( m_aWMName.EqualsAscii( "awesome" ) )
+ {
+ pWMA->m_bWMshouldSwitchWorkspace = false;
+ }
+ }
+ else
+ pWMA->m_bWMshouldSwitchWorkspace = aSetting.toBoolean();
+ pWMA->m_bWMshouldSwitchWorkspaceInit = true;
+ }
+ return m_bWMshouldSwitchWorkspace;
+}
+
/*
* WMAdaptor::isValid()
*/
@@ -2338,8 +2365,11 @@ int WMAdaptor::getWindowWorkArea( XLIB_Window aWindow ) const
* WMAdaptor::getCurrentWorkArea
*/
// fixme: multi screen case
-void WMAdaptor::switchToWorkArea( int nWorkArea ) const
+void WMAdaptor::switchToWorkArea( int nWorkArea, bool bConsiderWM ) const
{
+ if( bConsiderWM && ! getWMshouldSwitchWorkspace() )
+ return;
+
if( m_aWMAtoms[ NET_CURRENT_DESKTOP ] )
{
XEvent aEvent;
diff --git a/vcl/unx/source/fontmanager/fontcache.cxx b/vcl/unx/source/fontmanager/fontcache.cxx
index db4a7d05e5fc..0c43373bfa8e 100644
--- a/vcl/unx/source/fontmanager/fontcache.cxx
+++ b/vcl/unx/source/fontmanager/fontcache.cxx
@@ -373,9 +373,9 @@ void FontCache::read()
xub_StrLen nLastIndex = nIndex+1;
for( nIndex = nLastIndex ; nIndex < nLen && pLine[nIndex] != ';'; nIndex++ )
;
- if( nIndex - nLastIndex > 1 )
+ if( nIndex - nLastIndex )
{
- OUString aAlias( pLine+nLastIndex, nIndex-nLastIndex-1, RTL_TEXTENCODING_UTF8 );
+ OUString aAlias( pLine+nLastIndex, nIndex-nLastIndex, RTL_TEXTENCODING_UTF8 );
pFont->m_aAliases.push_back( pAtoms->getAtom( ATOM_FAMILYNAME, aAlias, sal_True ) );
}
}
diff --git a/vcl/unx/source/fontmanager/fontconfig.cxx b/vcl/unx/source/fontmanager/fontconfig.cxx
index 5b18ec002aa9..434263db352e 100644
--- a/vcl/unx/source/fontmanager/fontconfig.cxx
+++ b/vcl/unx/source/fontmanager/fontconfig.cxx
@@ -121,16 +121,20 @@ class FontCfgWrapper
FcResult (*m_pFcPatternGetBool)(const FcPattern*,const char*,int,FcBool*);
void (*m_pFcDefaultSubstitute)(FcPattern *);
FcPattern* (*m_pFcFontSetMatch)(FcConfig*,FcFontSet**, int, FcPattern*,FcResult*);
+ FcPattern* (*m_pFcFontMatch)(FcConfig*,FcPattern*,FcResult*);
FcBool (*m_pFcConfigAppFontAddFile)(FcConfig*, const FcChar8*);
FcBool (*m_pFcConfigAppFontAddDir)(FcConfig*, const FcChar8*);
FcBool (*m_pFcConfigParseAndLoad)(FcConfig*,const FcChar8*,FcBool);
-
FcBool (*m_pFcConfigSubstitute)(FcConfig*,FcPattern*,FcMatchKind);
+
+ FcPattern* (*m_pFcPatternDuplicate)(const FcPattern*);
FcBool (*m_pFcPatternAddInteger)(FcPattern*,const char*,int);
FcBool (*m_pFcPatternAddDouble)(FcPattern*,const char*,double);
FcBool (*m_pFcPatternAddBool)(FcPattern*,const char*,FcBool);
FcBool (*m_pFcPatternAddCharSet)(FcPattern*,const char*,const FcCharSet*);
FcBool (*m_pFcPatternAddString)(FcPattern*,const char*,const FcChar8*);
+ FcBool (*m_pFcPatternDel)(FcPattern*,const char*);
+
FT_UInt (*m_pFcFreeTypeCharIndex)(FT_Face,FcChar32);
oslGenericFunction loadSymbol( const char* );
@@ -230,8 +234,13 @@ public:
{ m_pFcDefaultSubstitute( pPattern ); }
FcPattern* FcFontSetMatch( FcConfig* pConfig, FcFontSet **ppFontSet, int nset, FcPattern* pPattern, FcResult* pResult )
{ return m_pFcFontSetMatch ? m_pFcFontSetMatch( pConfig, ppFontSet, nset, pPattern, pResult ) : 0; }
+ FcPattern* FcFontMatch( FcConfig* pConfig, FcPattern* pPattern, FcResult* pResult )
+ { return m_pFcFontMatch( pConfig, pPattern, pResult ); }
FcBool FcConfigSubstitute( FcConfig* pConfig, FcPattern* pPattern, FcMatchKind eKind )
{ return m_pFcConfigSubstitute( pConfig, pPattern, eKind ); }
+
+ FcPattern* FcPatternDuplicate( const FcPattern* pPattern ) const
+ { return m_pFcPatternDuplicate( pPattern ); }
FcBool FcPatternAddInteger( FcPattern* pPattern, const char* pObject, int nValue )
{ return m_pFcPatternAddInteger( pPattern, pObject, nValue ); }
FcBool FcPatternAddDouble( FcPattern* pPattern, const char* pObject, double nValue )
@@ -242,6 +251,8 @@ public:
{ return m_pFcPatternAddBool( pPattern, pObject, nValue ); }
FcBool FcPatternAddCharSet(FcPattern* pPattern,const char* pObject,const FcCharSet*pCharSet)
{ return m_pFcPatternAddCharSet(pPattern,pObject,pCharSet); }
+ FcBool FcPatternDel(FcPattern* pPattern, const char* object)
+ { return m_pFcPatternDel( pPattern, object); }
FT_UInt FcFreeTypeCharIndex( FT_Face face, FcChar32 ucs4 )
{ return m_pFcFreeTypeCharIndex ? m_pFcFreeTypeCharIndex( face, ucs4 ) : 0; }
@@ -337,8 +348,13 @@ FontCfgWrapper::FontCfgWrapper()
loadSymbol( "FcDefaultSubstitute" );
m_pFcFontSetMatch = (FcPattern*(*)(FcConfig*,FcFontSet**,int,FcPattern*,FcResult*))
loadSymbol( "FcFontSetMatch" );
+ m_pFcFontMatch = (FcPattern*(*)(FcConfig*,FcPattern*,FcResult*))
+ loadSymbol( "FcFontMatch" );
m_pFcConfigSubstitute = (FcBool(*)(FcConfig*,FcPattern*,FcMatchKind))
loadSymbol( "FcConfigSubstitute" );
+
+ m_pFcPatternDuplicate = (FcPattern*(*)(const FcPattern*))
+ loadSymbol( "FcPatternDuplicate" );
m_pFcPatternAddInteger = (FcBool(*)(FcPattern*,const char*,int))
loadSymbol( "FcPatternAddInteger" );
m_pFcPatternAddDouble = (FcBool(*)(FcPattern*,const char*,double))
@@ -349,6 +365,9 @@ FontCfgWrapper::FontCfgWrapper()
loadSymbol( "FcPatternAddCharSet" );
m_pFcPatternAddString = (FcBool(*)(FcPattern*,const char*,const FcChar8*))
loadSymbol( "FcPatternAddString" );
+ m_pFcPatternDel = (FcBool(*)(FcPattern*,const char*))
+ loadSymbol( "FcPatternDel" );
+
m_pFcFreeTypeCharIndex = (FT_UInt(*)(FT_Face,FcChar32))
loadSymbol( "FcFreeTypeCharIndex" );
@@ -391,13 +410,16 @@ FontCfgWrapper::FontCfgWrapper()
m_pFcConfigAppFontAddFile &&
m_pFcConfigAppFontAddDir &&
m_pFcConfigParseAndLoad &&
+ m_pFcFontMatch &&
m_pFcDefaultSubstitute &&
m_pFcConfigSubstitute &&
+ m_pFcPatternDuplicate &&
m_pFcPatternAddInteger &&
m_pFcPatternAddDouble &&
m_pFcPatternAddCharSet &&
m_pFcPatternAddBool &&
- m_pFcPatternAddString
+ m_pFcPatternAddString &&
+ m_pFcPatternDel
) )
{
osl_unloadModule( (oslModule)m_pLib );
@@ -428,18 +450,44 @@ void FontCfgWrapper::addFontSet( FcSetName eSetName )
if( !pOrig )
return;
+ // filter the font sets to remove obsolete or duplicate faces
for( int i = 0; i < pOrig->nfont; ++i )
{
- FcBool outline = false;
- FcPattern *pOutlinePattern = pOrig->fonts[i];
- FcResult eOutRes =
- FcPatternGetBool( pOutlinePattern, FC_OUTLINE, 0, &outline );
- if( (eOutRes != FcResultMatch) || (outline != FcTrue) )
+ FcPattern* pOrigPattern = pOrig->fonts[i];
+ // #i115131# ignore non-outline fonts
+ FcBool bOutline = FcFalse;
+ FcResult eOutRes = FcPatternGetBool( pOrigPattern, FC_OUTLINE, 0, &bOutline );
+ if( (eOutRes != FcResultMatch) || (bOutline == FcFalse) )
continue;
- FcPatternReference(pOutlinePattern);
- FcFontSetAdd(m_pOutlineSet, pOutlinePattern);
+ // create a pattern to find eventually better alternatives
+ FcPattern* pBetterPattern = pOrigPattern;
+ if( m_nFcVersion > 20400 ) // #i115204# avoid trouble with old FC versions
+ {
+ FcPattern* pTestPattern = FcPatternDuplicate( pOrigPattern );
+ FcPatternAddBool( pTestPattern, FC_OUTLINE, FcTrue );
+ // TODO: ignore all attributes that are not interesting for finding dupes
+ // e.g. by using pattern->ImplFontAttr->pattern conversion
+ FcPatternDel( pTestPattern, FC_FONTVERSION );
+ FcPatternDel( pTestPattern, FC_CHARSET );
+ FcPatternDel( pTestPattern, FC_FILE );
+ // find the font face for the dupe-search pattern
+ FcResult eFcResult = FcResultMatch;
+ pBetterPattern = FcFontMatch( FcConfigGetCurrent(), pTestPattern, &eFcResult );
+ FcPatternDestroy( pTestPattern );
+ if( eFcResult != FcResultMatch )
+ continue;
+ // #i115131# double check results and eventually ignore them
+ eOutRes = FcPatternGetBool( pBetterPattern, FC_OUTLINE, 0, &bOutline );
+ if( (eOutRes != FcResultMatch) || (bOutline == FcFalse) )
+ continue;
+ }
+ // insert best found pattern for the dupe-search pattern
+ // TODO: skip inserting patterns that are already known in the target fontset
+ FcPatternReference( pBetterPattern );
+ FcFontSetAdd( m_pOutlineSet, pBetterPattern );
}
- // TODO: FcFontSetDestroy( pOrig );
+
+ // TODO?: FcFontSetDestroy( pOrig );
#else
(void)eSetName; // prevent compiler warning about unused parameter
#endif
@@ -708,7 +756,7 @@ int PrintFontManager::countFontconfigFonts( std::hash_map<rtl::OString, int, rtl
);
#endif
- OSL_ASSERT(eOutRes != FcResultMatch || outline);
+// OSL_ASSERT(eOutRes != FcResultMatch || outline);
// only outline fonts are usable to psprint anyway
if( eOutRes == FcResultMatch && ! outline )
@@ -738,7 +786,10 @@ int PrintFontManager::countFontconfigFonts( std::hash_map<rtl::OString, int, rtl
#endif
}
if( aFonts.empty() )
+ {
+ // TODO: remove fonts unusable to psprint from fontset
continue;
+ }
int nFamilyName = m_pAtoms->getAtom( ATOM_FAMILYNAME, OStringToOUString( OString( (sal_Char*)family ), RTL_TEXTENCODING_UTF8 ), sal_True );
PrintFont* pUpdate = aFonts.front();
@@ -1068,6 +1119,7 @@ bool PrintFontManager::getFontOptions(
ImplFontOptions& rOptions) const
{
#ifndef ENABLE_FONTCONFIG
+ (void)rInfo;(void)nSize;(void)subcallback;(void)rOptions;
return false;
#else // ENABLE_FONTCONFIG
FontCfgWrapper& rWrapper = FontCfgWrapper::get();
diff --git a/vcl/unx/source/gdi/pspgraphics.cxx b/vcl/unx/source/gdi/pspgraphics.cxx
index feffdc1adbb6..bab78b0cb2df 100644
--- a/vcl/unx/source/gdi/pspgraphics.cxx
+++ b/vcl/unx/source/gdi/pspgraphics.cxx
@@ -775,16 +775,13 @@ void PspGraphics::DrawServerFontLayout( const ServerFontLayout& rLayout )
DrawPrinterLayout( rLayout, *m_pPrinterGfx, true );
}
-ImplFontCharMap* PspGraphics::GetImplFontCharMap() const
+const ImplFontCharMap* PspGraphics::GetImplFontCharMap() const
{
- // TODO: get ImplFontCharMap directly from fonts
if( !m_pServerFont[0] )
return NULL;
- CmapResult aCmapResult;
- if( !m_pServerFont[0]->GetFontCodeRanges( aCmapResult ) )
- return NULL;
- return new ImplFontCharMap( aCmapResult );
+ const ImplFontCharMap* pIFCMap = m_pServerFont[0]->GetImplFontCharMap();
+ return pIFCMap;
}
USHORT PspGraphics::SetFont( ImplFontSelectData *pEntry, int nFallbackLevel )
@@ -890,7 +887,7 @@ void PspGraphics::GetDevFontSubstList( OutputDevice* pOutDev )
}
}
-void PspGraphics::GetFontMetric( ImplFontMetricData *pMetric )
+void PspGraphics::GetFontMetric( ImplFontMetricData *pMetric, int )
{
const psp::PrintFontManager& rMgr = psp::PrintFontManager::get();
psp::PrintFontInfo aInfo;
diff --git a/vcl/unx/source/gdi/salgdi.cxx b/vcl/unx/source/gdi/salgdi.cxx
index c0658c162489..9215f2e25b16 100644
--- a/vcl/unx/source/gdi/salgdi.cxx
+++ b/vcl/unx/source/gdi/salgdi.cxx
@@ -1240,14 +1240,17 @@ bool X11SalGraphics::drawPolyLine(const ::basegfx::B2DPolygon& rPolygon, double
basegfx::tools::createLineTrapezoidFromB2DPolygon( aB2DTrapVector, aPolygon, rLineWidth.getX() );
// draw tesselation result
- const int nTrapCount = aB2DTrapVector.size();
- if( !nTrapCount )
- return true;
- const bool bDrawOk = drawFilledTrapezoids( &aB2DTrapVector[0], nTrapCount, fTransparency );
+ if( ! aB2DTrapVector.empty() )
+ {
+ const int nTrapCount = aB2DTrapVector.size();
+ const bool bDrawOk = drawFilledTrapezoids( &aB2DTrapVector[0], nTrapCount, fTransparency );
- // restore the original brush GC
- nBrushColor_ = aKeepBrushColor;
- return bDrawOk;
+ // restore the original brush GC
+ nBrushColor_ = aKeepBrushColor;
+ return bDrawOk;
+ }
+ else
+ return true;
}
// get the area polygon for the line polygon
diff --git a/vcl/unx/source/gdi/salgdi3.cxx b/vcl/unx/source/gdi/salgdi3.cxx
index 6024b66f6010..62e575ebc5ef 100644
--- a/vcl/unx/source/gdi/salgdi3.cxx
+++ b/vcl/unx/source/gdi/salgdi3.cxx
@@ -1494,20 +1494,13 @@ void X11SalGraphics::DrawStringUCS2MB( ExtendedFontStruct& rFont,
//--------------------------------------------------------------------------
-ImplFontCharMap* X11SalGraphics::GetImplFontCharMap() const
+const ImplFontCharMap* X11SalGraphics::GetImplFontCharMap() const
{
- // TODO: get ImplFontCharMap directly from fonts
if( !mpServerFont[0] )
-#if 0 // RIP XLFD fonts
- if( mXFont[0] )
- // TODO?: nPairCount = mXFont[0]->GetFontCodeRanges( NULL );
-#endif
return NULL;
- CmapResult aCmapResult;
- if( !mpServerFont[0]->GetFontCodeRanges( aCmapResult ) )
- return NULL;
- return new ImplFontCharMap( aCmapResult );
+ const ImplFontCharMap* pIFCMap = mpServerFont[0]->GetImplFontCharMap();
+ return pIFCMap;
}
// ----------------------------------------------------------------------------
@@ -1763,16 +1756,19 @@ bool GetFCFontOptions( const ImplFontAttributes& rFontAttributes, int nSize,
// ----------------------------------------------------------------------------
void
-X11SalGraphics::GetFontMetric( ImplFontMetricData *pMetric )
+X11SalGraphics::GetFontMetric( ImplFontMetricData *pMetric, int nFallbackLevel )
{
- if( mpServerFont[0] != NULL )
+ if( nFallbackLevel >= MAX_FALLBACK )
+ return;
+
+ if( mpServerFont[nFallbackLevel] != NULL )
{
long rDummyFactor;
- mpServerFont[0]->FetchFontMetric( *pMetric, rDummyFactor );
+ mpServerFont[nFallbackLevel]->FetchFontMetric( *pMetric, rDummyFactor );
}
- else if( mXFont[0] != NULL )
+ else if( mXFont[nFallbackLevel] != NULL )
{
- mXFont[0]->ToImplFontMetricData( pMetric );
+ mXFont[nFallbackLevel]->ToImplFontMetricData( pMetric );
if ( bFontVertical_ )
pMetric->mnOrientation = 0;
}
diff --git a/vcl/unx/source/gdi/salprnpsp.cxx b/vcl/unx/source/gdi/salprnpsp.cxx
index 8617bc4e5bfa..ece724d717cb 100644
--- a/vcl/unx/source/gdi/salprnpsp.cxx
+++ b/vcl/unx/source/gdi/salprnpsp.cxx
@@ -54,6 +54,8 @@
#include "vcl/svapp.hxx"
#include "vcl/jobset.h"
#include "vcl/print.h"
+#include "vcl/print.hxx"
+#include "vcl/pdfwriter.hxx"
#include "vcl/salptype.hxx"
#include "vcl/printerinfomanager.hxx"
@@ -63,6 +65,7 @@
using namespace psp;
using namespace rtl;
+using namespace com::sun::star;
/*
* static helpers
@@ -892,9 +895,26 @@ ULONG PspSalInfoPrinter::GetCapabilities( const ImplJobSetup* pJobSetup, USHORT
case PRINTER_CAPABILITIES_FAX:
return PrinterInfoManager::get().checkFeatureToken( pJobSetup->maPrinterName, "fax" ) ? 1 : 0;
case PRINTER_CAPABILITIES_PDF:
- return PrinterInfoManager::get().checkFeatureToken( pJobSetup->maPrinterName, "pdf" ) ? 1 : 0;
+ if( PrinterInfoManager::get().checkFeatureToken( pJobSetup->maPrinterName, "pdf" ) )
+ return 1;
+ else
+ {
+ // see if the PPD contains a value to set Collate to True
+ JobData aData = PrinterInfoManager::get().getPrinterInfo( pJobSetup->maPrinterName );
+ if( pJobSetup->mpDriverData )
+ JobData::constructFromStreamBuffer( pJobSetup->mpDriverData, pJobSetup->mnDriverDataLen, aData );
+ return aData.m_nPDFDevice > 0 ? 1 : 0;
+ }
case PRINTER_CAPABILITIES_EXTERNALDIALOG:
return PrinterInfoManager::get().checkFeatureToken( pJobSetup->maPrinterName, "external_dialog" ) ? 1 : 0;
+ case PRINTER_CAPABILITIES_USEPULLMODEL:
+ {
+ // see if the PPD contains a value to set Collate to True
+ JobData aData = PrinterInfoManager::get().getPrinterInfo( pJobSetup->maPrinterName );
+ if( pJobSetup->mpDriverData )
+ JobData::constructFromStreamBuffer( pJobSetup->mpDriverData, pJobSetup->mnDriverDataLen, aData );
+ return aData.m_nPDFDevice > 0 ? 1 : 0;
+ }
default: break;
};
return 0;
@@ -910,6 +930,7 @@ ULONG PspSalInfoPrinter::GetCapabilities( const ImplJobSetup* pJobSetup, USHORT
: m_bFax( false ),
m_bPdf( false ),
m_bSwallowFaxNo( false ),
+ m_bIsPDFWriterJob( false ),
m_pGraphics( NULL ),
m_nCopies( 1 ),
m_bCollate( false ),
@@ -1021,22 +1042,28 @@ BOOL PspSalPrinter::StartJob(
BOOL PspSalPrinter::EndJob()
{
- BOOL bSuccess = m_aPrintJob.EndJob();
-
- if( bSuccess )
+ BOOL bSuccess = FALSE;
+ if( m_bIsPDFWriterJob )
+ bSuccess = TRUE;
+ else
{
- // check for fax
- if( m_bFax )
- {
+ bSuccess = m_aPrintJob.EndJob();
- const PrinterInfo& rInfo( PrinterInfoManager::get().getPrinterInfo( m_aJobData.m_aPrinterName ) );
- // sendAFax removes the file after use
- bSuccess = sendAFax( m_aFaxNr, m_aTmpFile, rInfo.m_aCommand );
- }
- else if( m_bPdf )
+ if( bSuccess )
{
- const PrinterInfo& rInfo( PrinterInfoManager::get().getPrinterInfo( m_aJobData.m_aPrinterName ) );
- bSuccess = createPdf( m_aFileName, m_aTmpFile, rInfo.m_aCommand );
+ // check for fax
+ if( m_bFax )
+ {
+
+ const PrinterInfo& rInfo( PrinterInfoManager::get().getPrinterInfo( m_aJobData.m_aPrinterName ) );
+ // sendAFax removes the file after use
+ bSuccess = sendAFax( m_aFaxNr, m_aTmpFile, rInfo.m_aCommand );
+ }
+ else if( m_bPdf )
+ {
+ const PrinterInfo& rInfo( PrinterInfoManager::get().getPrinterInfo( m_aJobData.m_aPrinterName ) );
+ bSuccess = createPdf( m_aFileName, m_aTmpFile, rInfo.m_aCommand );
+ }
}
}
vcl_sal::PrinterUpdate::jobEnded();
@@ -1089,6 +1116,271 @@ ULONG PspSalPrinter::GetErrorCode()
return 0;
}
+// -----------------------------------------------------------------------
+
+struct PDFNewJobParameters
+{
+ Size maPageSize;
+ USHORT mnPaperBin;
+
+ PDFNewJobParameters( const Size& i_rSize = Size(),
+ USHORT i_nPaperBin = 0xffff )
+ : maPageSize( i_rSize ), mnPaperBin( i_nPaperBin ) {}
+
+ bool operator!=(const PDFNewJobParameters& rComp ) const
+ {
+ Size aCompLSSize( rComp.maPageSize.Height(), rComp.maPageSize.Width() );
+ return
+ (maPageSize != rComp.maPageSize && maPageSize != aCompLSSize)
+ || mnPaperBin != rComp.mnPaperBin
+ ;
+ }
+
+ bool operator==(const PDFNewJobParameters& rComp) const
+ {
+ return ! this->operator!=(rComp);
+ }
+};
+
+struct PDFPrintFile
+{
+ rtl::OUString maTmpURL;
+ PDFNewJobParameters maParameters;
+
+ PDFPrintFile( const rtl::OUString& i_rURL, const PDFNewJobParameters& i_rNewParameters )
+ : maTmpURL( i_rURL )
+ , maParameters( i_rNewParameters ) {}
+};
+
+BOOL PspSalPrinter::StartJob( const String* i_pFileName, const String& i_rJobName, const String& i_rAppName,
+ ImplJobSetup* i_pSetupData, vcl::PrinterController& i_rController )
+{
+ OSL_TRACE( "StartJob with controller: pFilename = %s", i_pFileName ? rtl::OUStringToOString( *i_pFileName, RTL_TEXTENCODING_UTF8 ).getStr() : "<nil>" );
+ // mark for endjob
+ m_bIsPDFWriterJob = true;
+ // reset IsLastPage
+ i_rController.setLastPage( sal_False );
+
+ // update job data
+ if( i_pSetupData )
+ JobData::constructFromStreamBuffer( i_pSetupData->mpDriverData, i_pSetupData->mnDriverDataLen, m_aJobData );
+
+ OSL_ASSERT( m_aJobData.m_nPDFDevice > 0 );
+ m_aJobData.m_nPDFDevice = 1;
+
+ // possibly create one job for collated output
+ sal_Bool bSinglePrintJobs = sal_False;
+ beans::PropertyValue* pSingleValue = i_rController.getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintCollateAsSingleJobs" ) ) );
+ if( pSingleValue )
+ {
+ pSingleValue->Value >>= bSinglePrintJobs;
+ }
+
+ int nCopies = i_rController.getPrinter()->GetCopyCount();
+ bool bCollate = i_rController.getPrinter()->IsCollateCopy();
+
+ // notify start of real print job
+ i_rController.jobStarted();
+
+ // setup PDFWriter context
+ vcl::PDFWriter::PDFWriterContext aContext;
+ aContext.Version = vcl::PDFWriter::PDF_1_4;
+ aContext.Tagged = false;
+ aContext.EmbedStandardFonts = true;
+ aContext.DocumentLocale = Application::GetSettings().GetLocale();
+
+ // prepare doc info
+ aContext.DocumentInfo.Title = i_rJobName;
+ aContext.DocumentInfo.Creator = i_rAppName;
+ aContext.DocumentInfo.Producer = i_rAppName;
+
+ // define how we handle metafiles in PDFWriter
+ vcl::PDFWriter::PlayMetafileContext aMtfContext;
+ aMtfContext.m_bOnlyLosslessCompression = true;
+
+ boost::shared_ptr<vcl::PDFWriter> pWriter;
+ std::vector< PDFPrintFile > aPDFFiles;
+ boost::shared_ptr<Printer> pPrinter( i_rController.getPrinter() );
+ int nAllPages = i_rController.getFilteredPageCount();
+ i_rController.createProgressDialog();
+ bool bAborted = false;
+ PDFNewJobParameters aLastParm;
+
+ aContext.DPIx = pPrinter->ImplGetDPIX();
+ aContext.DPIy = pPrinter->ImplGetDPIY();
+ for( int nPage = 0; nPage < nAllPages && ! bAborted; nPage++ )
+ {
+ if( nPage == nAllPages-1 )
+ i_rController.setLastPage( sal_True );
+
+ // get the page's metafile
+ GDIMetaFile aPageFile;
+ vcl::PrinterController::PageSize aPageSize = i_rController.getFilteredPageFile( nPage, aPageFile );
+ if( i_rController.isProgressCanceled() )
+ {
+ bAborted = true;
+ if( nPage != nAllPages-1 )
+ {
+ i_rController.createProgressDialog();
+ i_rController.setLastPage( sal_True );
+ i_rController.getFilteredPageFile( nPage, aPageFile );
+ }
+ }
+ else
+ {
+ pPrinter->SetMapMode( MapMode( MAP_100TH_MM ) );
+ pPrinter->SetPaperSizeUser( aPageSize.aSize, true );
+ PDFNewJobParameters aNewParm( pPrinter->GetPaperSize(), pPrinter->GetPaperBin() );
+
+ // create PDF writer on demand
+ // either on first page
+ // or on paper format change - cups does not support multiple paper formats per job (yet?)
+ // so we need to start a new job to get a new paper format from the printer
+ // orientation switches (that is switch of height and width) is handled transparently by CUPS
+ if( ! pWriter ||
+ (aNewParm != aLastParm && ! i_pFileName ) )
+ {
+ if( pWriter )
+ {
+ pWriter->Emit();
+ }
+ // produce PDF file
+ OUString aPDFUrl;
+ if( i_pFileName )
+ aPDFUrl = *i_pFileName;
+ else
+ osl_createTempFile( NULL, NULL, &aPDFUrl.pData );
+ // normalize to file URL
+ if( aPDFUrl.compareToAscii( "file:", 5 ) != 0 )
+ {
+ // this is not a file URL, but it should
+ // form it into a osl friendly file URL
+ rtl::OUString aTmp;
+ osl_getFileURLFromSystemPath( aPDFUrl.pData, &aTmp.pData );
+ aPDFUrl = aTmp;
+ }
+ // save current file and paper format
+ aLastParm = aNewParm;
+ aPDFFiles.push_back( PDFPrintFile( aPDFUrl, aNewParm ) );
+ // update context
+ aContext.URL = aPDFUrl;
+
+ // create and initialize PDFWriter
+ #if defined __SUNPRO_CC
+ #pragma disable_warn
+ #endif
+ pWriter.reset( new vcl::PDFWriter( aContext, uno::Reference< beans::XMaterialHolder >() ) );
+ #if defined __SUNPRO_CC
+ #pragma enable_warn
+ #endif
+ }
+
+ pWriter->NewPage( TenMuToPt( aNewParm.maPageSize.Width() ),
+ TenMuToPt( aNewParm.maPageSize.Height() ),
+ vcl::PDFWriter::Portrait );
+
+ pWriter->PlayMetafile( aPageFile, aMtfContext, NULL );
+ }
+ }
+
+ // emit the last file
+ if( pWriter )
+ pWriter->Emit();
+
+ // handle collate, copy count and multiple jobs correctly
+ int nOuterJobs = 1;
+ if( bSinglePrintJobs )
+ {
+ nOuterJobs = nCopies;
+ m_aJobData.m_nCopies = 1;
+ }
+ else
+ {
+ if( bCollate )
+ {
+ if( aPDFFiles.size() == 1 && pPrinter->HasSupport( SUPPORT_COLLATECOPY ) )
+ {
+ m_aJobData.setCollate( true );
+ m_aJobData.m_nCopies = nCopies;
+ }
+ else
+ {
+ nOuterJobs = nCopies;
+ m_aJobData.m_nCopies = 1;
+ }
+ }
+ else
+ {
+ m_aJobData.setCollate( false );
+ m_aJobData.m_nCopies = nCopies;
+ }
+ }
+
+ // spool files
+ if( ! i_pFileName && ! bAborted )
+ {
+ bool bFirstJob = true;
+ for( int nCurJob = 0; nCurJob < nOuterJobs; nCurJob++ )
+ {
+ for( size_t i = 0; i < aPDFFiles.size(); i++ )
+ {
+ oslFileHandle pFile = NULL;
+ osl_openFile( aPDFFiles[i].maTmpURL.pData, &pFile, osl_File_OpenFlag_Read );
+ if( pFile )
+ {
+ osl_setFilePos( pFile, osl_Pos_Absolut, 0 );
+ std::vector< char > buffer( 0x10000, 0 );
+ // update job data with current page size
+ Size aPageSize( aPDFFiles[i].maParameters.maPageSize );
+ m_aJobData.setPaper( TenMuToPt( aPageSize.Width() ), TenMuToPt( aPageSize.Height() ) );
+ // update job data with current paperbin
+ m_aJobData.setPaperBin( aPDFFiles[i].maParameters.mnPaperBin );
+
+ // spool current file
+ FILE* fp = PrinterInfoManager::get().startSpool( pPrinter->GetName(), i_rController.isDirectPrint() );
+ if( fp )
+ {
+ sal_uInt64 nBytesRead = 0;
+ do
+ {
+ osl_readFile( pFile, &buffer[0], buffer.size(), &nBytesRead );
+ if( nBytesRead > 0 )
+ fwrite( &buffer[0], 1, nBytesRead, fp );
+ } while( nBytesRead == buffer.size() );
+ rtl::OUStringBuffer aBuf( i_rJobName.Len() + 8 );
+ aBuf.append( i_rJobName );
+ if( i > 0 || nCurJob > 0 )
+ {
+ aBuf.append( sal_Unicode(' ') );
+ aBuf.append( sal_Int32( i + nCurJob * aPDFFiles.size() ) );
+ }
+ PrinterInfoManager::get().endSpool( pPrinter->GetName(), aBuf.makeStringAndClear(), fp, m_aJobData, bFirstJob );
+ bFirstJob = false;
+ }
+ }
+ osl_closeFile( pFile );
+ }
+ }
+ }
+
+ // job has been spooled
+ i_rController.setJobState( bAborted ? view::PrintableState_JOB_ABORTED : view::PrintableState_JOB_SPOOLED );
+
+ // clean up the temporary PDF files
+ if( ! i_pFileName || bAborted )
+ {
+ for( size_t i = 0; i < aPDFFiles.size(); i++ )
+ {
+ osl_removeFile( aPDFFiles[i].maTmpURL.pData );
+ OSL_TRACE( "removed print PDF file %s\n", rtl::OUStringToOString( aPDFFiles[i].maTmpURL, RTL_TEXTENCODING_UTF8 ).getStr() );
+ }
+ }
+
+ return TRUE;
+}
+
+
+
/*
* vcl::PrinterUpdate
*/
diff --git a/vcl/unx/source/plugadapt/salplug.cxx b/vcl/unx/source/plugadapt/salplug.cxx
index a438760cffba..fd49ee34f543 100644
--- a/vcl/unx/source/plugadapt/salplug.cxx
+++ b/vcl/unx/source/plugadapt/salplug.cxx
@@ -36,6 +36,7 @@
#include "vcl/salinst.hxx"
#include "saldata.hxx"
+#include "vcl/printerinfomanager.hxx"
#include <cstdio>
#include <unistd.h>
@@ -291,10 +292,12 @@ const OUString& SalGetDesktopEnvironment()
SalData::SalData() :
m_pInstance(NULL),
- m_pPlugin(NULL)
+ m_pPlugin(NULL),
+ m_pPIManager(NULL)
{
}
SalData::~SalData()
{
+ psp::PrinterInfoManager::release();
}
diff --git a/vcl/unx/source/printer/cupsmgr.cxx b/vcl/unx/source/printer/cupsmgr.cxx
index e245b2548c79..caf3249b5f46 100644
--- a/vcl/unx/source/printer/cupsmgr.cxx
+++ b/vcl/unx/source/printer/cupsmgr.cxx
@@ -524,12 +524,18 @@ void CUPSManager::initialize()
// introduced in dests with 1.2
// this is needed to check for %%IncludeFeature support
// (#i65684#, #i65491#)
+ bool bUsePDF = false;
cups_dest_t* pDest = ((cups_dest_t*)m_pDests);
const char* pOpt = m_pCUPSWrapper->cupsGetOption( "printer-info",
pDest->num_options,
pDest->options );
if( pOpt )
+ {
m_bUseIncludeFeature = true;
+ bUsePDF = true;
+ if( m_aGlobalDefaults.m_nPSLevel == 0 && m_aGlobalDefaults.m_nPDFDevice == 0 )
+ m_aGlobalDefaults.m_nPDFDevice = 1;
+ }
// do not send include JobPatch; CUPS will insert that itself
// TODO: currently unknwon which versions of CUPS insert JobPatches
// so currently it is assumed CUPS = don't insert JobPatch files
@@ -593,6 +599,8 @@ void CUPSManager::initialize()
aPrinter.m_aInfo.m_pParser = c_it->second.getParser();
aPrinter.m_aInfo.m_aContext = c_it->second;
}
+ if( bUsePDF && aPrinter.m_aInfo.m_nPSLevel == 0 && aPrinter.m_aInfo.m_nPDFDevice == 0 )
+ aPrinter.m_aInfo.m_nPDFDevice = 1;
aPrinter.m_aInfo.m_aDriverName = aBuf.makeStringAndClear();
aPrinter.m_bModified = false;
@@ -826,8 +834,15 @@ void CUPSManager::setupJobContextData(
FILE* CUPSManager::startSpool( const OUString& rPrintername, bool bQuickCommand )
{
+ OSL_TRACE( "endSpool: %s, %s",
+ rtl::OUStringToOString( rPrintername, RTL_TEXTENCODING_UTF8 ).getStr(),
+ bQuickCommand ? "true" : "false" );
+
if( m_aCUPSDestMap.find( rPrintername ) == m_aCUPSDestMap.end() )
+ {
+ OSL_TRACE( "defer to PrinterInfoManager::startSpool" );
return PrinterInfoManager::startSpool( rPrintername, bQuickCommand );
+ }
#ifdef ENABLE_CUPS
OUString aTmpURL, aTmpFile;
@@ -850,7 +865,7 @@ struct less_ppd_key : public ::std::binary_function<double, double, bool>
{ return left->getOrderDependency() < right->getOrderDependency(); }
};
-void CUPSManager::getOptionsFromDocumentSetup( const JobData& rJob, int& rNumOptions, void** rOptions ) const
+void CUPSManager::getOptionsFromDocumentSetup( const JobData& rJob, bool bBanner, int& rNumOptions, void** rOptions ) const
{
rNumOptions = 0;
*rOptions = NULL;
@@ -880,10 +895,26 @@ void CUPSManager::getOptionsFromDocumentSetup( const JobData& rJob, int& rNumOpt
}
}
}
+
+ if( rJob.m_nPDFDevice > 0 && rJob.m_nCopies > 1 )
+ {
+ rtl::OString aVal( rtl::OString::valueOf( sal_Int32( rJob.m_nCopies ) ) );
+ rNumOptions = m_pCUPSWrapper->cupsAddOption( "copies", aVal.getStr(), rNumOptions, (cups_option_t**)rOptions );
+ }
+ if( ! bBanner )
+ {
+ rNumOptions = m_pCUPSWrapper->cupsAddOption( "job-sheets", "none", rNumOptions, (cups_option_t**)rOptions );
+ }
}
-int CUPSManager::endSpool( const OUString& rPrintername, const OUString& rJobTitle, FILE* pFile, const JobData& rDocumentJobData )
+int CUPSManager::endSpool( const OUString& rPrintername, const OUString& rJobTitle, FILE* pFile, const JobData& rDocumentJobData, bool bBanner )
{
+ OSL_TRACE( "endSpool: %s, %s, copy count = %d",
+ rtl::OUStringToOString( rPrintername, RTL_TEXTENCODING_UTF8 ).getStr(),
+ rtl::OUStringToOString( rJobTitle, RTL_TEXTENCODING_UTF8 ).getStr(),
+ rDocumentJobData.m_nCopies
+ );
+
int nJobID = 0;
osl::MutexGuard aGuard( m_aCUPSMutex );
@@ -891,7 +922,10 @@ int CUPSManager::endSpool( const OUString& rPrintername, const OUString& rJobTit
std::hash_map< OUString, int, OUStringHash >::iterator dest_it =
m_aCUPSDestMap.find( rPrintername );
if( dest_it == m_aCUPSDestMap.end() )
- return PrinterInfoManager::endSpool( rPrintername, rJobTitle, pFile, rDocumentJobData );
+ {
+ OSL_TRACE( "defer to PrinterInfoManager::endSpool" );
+ return PrinterInfoManager::endSpool( rPrintername, rJobTitle, pFile, rDocumentJobData, bBanner );
+ }
#ifdef ENABLE_CUPS
std::hash_map< FILE*, OString, FPtrHash >::const_iterator it = m_aSpoolFiles.find( pFile );
@@ -903,7 +937,7 @@ int CUPSManager::endSpool( const OUString& rPrintername, const OUString& rJobTit
// setup cups options
int nNumOptions = 0;
cups_option_t* pOptions = NULL;
- getOptionsFromDocumentSetup( rDocumentJobData, nNumOptions, (void**)&pOptions );
+ getOptionsFromDocumentSetup( rDocumentJobData, bBanner, nNumOptions, (void**)&pOptions );
cups_dest_t* pDest = ((cups_dest_t*)m_pDests) + dest_it->second;
nJobID = m_pCUPSWrapper->cupsPrintFile( pDest->name,
diff --git a/vcl/unx/source/printer/jobdata.cxx b/vcl/unx/source/printer/jobdata.cxx
index a1bca9441f77..d4211eae31df 100644
--- a/vcl/unx/source/printer/jobdata.cxx
+++ b/vcl/unx/source/printer/jobdata.cxx
@@ -51,6 +51,7 @@ JobData& JobData::operator=(const JobData& rRight)
m_pParser = rRight.m_pParser;
m_aContext = rRight.m_aContext;
m_nPSLevel = rRight.m_nPSLevel;
+ m_nPDFDevice = rRight.m_nPDFDevice;
m_nColorDevice = rRight.m_nColorDevice;
if( ! m_pParser && m_aPrinterName.getLength() )
@@ -83,6 +84,34 @@ void JobData::setCollate( bool bCollate )
}
}
+bool JobData::setPaper( int i_nWidth, int i_nHeight )
+{
+ bool bSuccess = false;
+ if( m_pParser )
+ {
+ rtl::OUString aPaper( m_pParser->matchPaper( i_nWidth, i_nHeight ) );
+
+ const PPDKey* pKey = m_pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "PageSize" ) ) );
+ const PPDValue* pValue = pKey ? pKey->getValueCaseInsensitive( aPaper ) : NULL;
+
+ bSuccess = pKey && pValue && m_aContext.setValue( pKey, pValue, false );
+ }
+ return bSuccess;
+}
+
+bool JobData::setPaperBin( int i_nPaperBin )
+{
+ bool bSuccess = false;
+ if( m_pParser )
+ {
+ const PPDKey* pKey = m_pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "InputSlot" ) ) );
+ const PPDValue* pValue = pKey ? pKey->getValue( i_nPaperBin ) : NULL;
+
+ bSuccess = pKey && pValue && m_aContext.setValue( pKey, pValue, false );
+ }
+ return bSuccess;
+}
+
bool JobData::getStreamBuffer( void*& pData, int& bytes )
{
// consistency checks
@@ -128,6 +157,10 @@ bool JobData::getStreamBuffer( void*& pData, int& bytes )
aLine += ByteString::CreateFromInt32( m_nPSLevel );
aStream.WriteLine( aLine );
+ aLine = "pdfdevice=";
+ aLine += ByteString::CreateFromInt32( m_nPDFDevice );
+ aStream.WriteLine( aLine );
+
aLine = "colordevice=";
aLine += ByteString::CreateFromInt32( m_nColorDevice );
aStream.WriteLine( aLine );
@@ -158,6 +191,7 @@ bool JobData::constructFromStreamBuffer( void* pData, int bytes, JobData& rJobDa
bool bColorDepth = false;
bool bColorDevice = false;
bool bPSLevel = false;
+ bool bPDFDevice = false;
while( ! aStream.IsEof() )
{
aStream.ReadLine( aLine );
@@ -202,6 +236,11 @@ bool JobData::constructFromStreamBuffer( void* pData, int bytes, JobData& rJobDa
bPSLevel = true;
rJobData.m_nPSLevel = aLine.Copy( 8 ).ToInt32();
}
+ else if( aLine.CompareTo( "pdfdevice=", 10 ) == COMPARE_EQUAL )
+ {
+ bPDFDevice = true;
+ rJobData.m_nPDFDevice = aLine.Copy( 10 ).ToInt32();
+ }
else if( aLine.Equals( "PPDContexData" ) )
{
if( bPrinter )
@@ -222,5 +261,5 @@ bool JobData::constructFromStreamBuffer( void* pData, int bytes, JobData& rJobDa
}
}
- return bVersion && bPrinter && bOrientation && bCopies && bContext && bMargin && bPSLevel && bColorDevice && bColorDepth;
+ return bVersion && bPrinter && bOrientation && bCopies && bContext && bMargin && bPSLevel && bPDFDevice && bColorDevice && bColorDepth;
}
diff --git a/vcl/unx/source/printer/ppdparser.cxx b/vcl/unx/source/printer/ppdparser.cxx
index b2549573d099..587e58be5bc7 100644
--- a/vcl/unx/source/printer/ppdparser.cxx
+++ b/vcl/unx/source/printer/ppdparser.cxx
@@ -405,51 +405,53 @@ void PPDParser::scanPPDDir( const String& rDir )
const int nSuffixes = sizeof(pSuffixes)/sizeof(pSuffixes[0]);
osl::Directory aDir( rDir );
- aDir.open();
- osl::DirectoryItem aItem;
-
- INetURLObject aPPDDir(rDir);
- while( aDir.getNextItem( aItem ) == osl::FileBase::E_None )
+ if ( aDir.open() == osl::FileBase::E_None )
{
- osl::FileStatus aStatus( FileStatusMask_FileName );
- if( aItem.getFileStatus( aStatus ) == osl::FileBase::E_None )
+ osl::DirectoryItem aItem;
+
+ INetURLObject aPPDDir(rDir);
+ while( aDir.getNextItem( aItem ) == osl::FileBase::E_None )
{
- rtl::OUStringBuffer aURLBuf( rDir.Len() + 64 );
- aURLBuf.append( rDir );
- aURLBuf.append( sal_Unicode( '/' ) );
- aURLBuf.append( aStatus.getFileName() );
+ osl::FileStatus aStatus( FileStatusMask_FileName );
+ if( aItem.getFileStatus( aStatus ) == osl::FileBase::E_None )
+ {
+ rtl::OUStringBuffer aURLBuf( rDir.Len() + 64 );
+ aURLBuf.append( rDir );
+ aURLBuf.append( sal_Unicode( '/' ) );
+ aURLBuf.append( aStatus.getFileName() );
- rtl::OUString aFileURL, aFileName;
- osl::FileStatus::Type eType = osl::FileStatus::Unknown;
+ rtl::OUString aFileURL, aFileName;
+ osl::FileStatus::Type eType = osl::FileStatus::Unknown;
- if( resolveLink( aURLBuf.makeStringAndClear(), aFileURL, aFileName, eType ) == osl::FileBase::E_None )
- {
- if( eType == osl::FileStatus::Regular )
+ if( resolveLink( aURLBuf.makeStringAndClear(), aFileURL, aFileName, eType ) == osl::FileBase::E_None )
{
- INetURLObject aPPDFile = aPPDDir;
- aPPDFile.Append( aFileName );
-
- // match extension
- for( int nSuffix = 0; nSuffix < nSuffixes; nSuffix++ )
+ if( eType == osl::FileStatus::Regular )
{
- if( aFileName.getLength() > pSuffixes[nSuffix].nSuffixLen )
+ INetURLObject aPPDFile = aPPDDir;
+ aPPDFile.Append( aFileName );
+
+ // match extension
+ for( int nSuffix = 0; nSuffix < nSuffixes; nSuffix++ )
{
- if( aFileName.endsWithIgnoreAsciiCaseAsciiL( pSuffixes[nSuffix].pSuffix, pSuffixes[nSuffix].nSuffixLen ) )
+ if( aFileName.getLength() > pSuffixes[nSuffix].nSuffixLen )
{
- (*pAllPPDFiles)[ aFileName.copy( 0, aFileName.getLength() - pSuffixes[nSuffix].nSuffixLen ) ] = aPPDFile.PathToFileName();
- break;
+ if( aFileName.endsWithIgnoreAsciiCaseAsciiL( pSuffixes[nSuffix].pSuffix, pSuffixes[nSuffix].nSuffixLen ) )
+ {
+ (*pAllPPDFiles)[ aFileName.copy( 0, aFileName.getLength() - pSuffixes[nSuffix].nSuffixLen ) ] = aPPDFile.PathToFileName();
+ break;
+ }
}
}
}
- }
- else if( eType == osl::FileStatus::Directory )
- {
- scanPPDDir( aFileURL );
+ else if( eType == osl::FileStatus::Directory )
+ {
+ scanPPDDir( aFileURL );
+ }
}
}
}
+ aDir.close();
}
- aDir.close();
}
void PPDParser::initPPDFiles()
diff --git a/vcl/unx/source/printer/printerinfomanager.cxx b/vcl/unx/source/printer/printerinfomanager.cxx
index e1d499c40ca5..af189b1b01b5 100644
--- a/vcl/unx/source/printer/printerinfomanager.cxx
+++ b/vcl/unx/source/printer/printerinfomanager.cxx
@@ -35,6 +35,7 @@
#include "cupsmgr.hxx"
#include "vcl/fontmanager.hxx"
#include "vcl/strhelper.hxx"
+#include "saldata.hxx"
#include "tools/urlobj.hxx"
#include "tools/stream.hxx"
@@ -92,22 +93,28 @@ namespace psp
PrinterInfoManager& PrinterInfoManager::get()
{
- static PrinterInfoManager* pManager = NULL;
+ SalData* pSalData = GetSalData();
- if( ! pManager )
+ if( ! pSalData->m_pPIManager )
{
- pManager = CUPSManager::tryLoadCUPS();
- if( ! pManager )
- pManager = new PrinterInfoManager();
+ pSalData->m_pPIManager = CUPSManager::tryLoadCUPS();
+ if( ! pSalData->m_pPIManager )
+ pSalData->m_pPIManager = new PrinterInfoManager();
- if( pManager )
- pManager->initialize();
+ pSalData->m_pPIManager->initialize();
#if OSL_DEBUG_LEVEL > 1
- fprintf( stderr, "PrinterInfoManager::get create Manager of type %d\n", pManager->getType() );
+ fprintf( stderr, "PrinterInfoManager::get create Manager of type %d\n", pSalData->m_pPIManager->getType() );
#endif
}
- return *pManager;
+ return *pSalData->m_pPIManager;
+}
+
+void PrinterInfoManager::release()
+{
+ SalData* pSalData = GetSalData();
+ delete pSalData->m_pPIManager;
+ pSalData->m_pPIManager = NULL;
}
// -----------------------------------------------------------------
@@ -130,6 +137,9 @@ PrinterInfoManager::PrinterInfoManager( Type eType ) :
PrinterInfoManager::~PrinterInfoManager()
{
delete m_pQueueInfo;
+ #if OSL_DEBUG_LEVEL > 1
+ fprintf( stderr, "PrinterInfoManager: destroyed Manager of type %d\n", getType() );
+ #endif
}
// -----------------------------------------------------------------
@@ -283,6 +293,10 @@ void PrinterInfoManager::initialize()
if( aValue.Len() )
m_aGlobalDefaults.m_nPSLevel = aValue.ToInt32();
+ aValue = aConfig.ReadKey( "PDFDevice" );
+ if( aValue.Len() )
+ m_aGlobalDefaults.m_nPDFDevice = aValue.ToInt32();
+
aValue = aConfig.ReadKey( "PerformFontSubstitution" );
if( aValue.Len() )
{
@@ -324,7 +338,7 @@ void PrinterInfoManager::initialize()
}
}
#if OSL_DEBUG_LEVEL > 1
- fprintf( stderr, "global settings: fontsubst = %s, %d substitutes\n", m_aGlobalDefaults.m_bPerformFontSubstitution ? "true" : "false", m_aGlobalDefaults.m_aFontSubstitutes.size() );
+ fprintf( stderr, "global settings: fontsubst = %s, %d substitutes\n", m_aGlobalDefaults.m_bPerformFontSubstitution ? "true" : "false", (int)m_aGlobalDefaults.m_aFontSubstitutes.size() );
#endif
}
}
@@ -494,6 +508,10 @@ void PrinterInfoManager::initialize()
if( aValue.Len() )
aPrinter.m_aInfo.m_nPSLevel = aValue.ToInt32();
+ aValue = aConfig.ReadKey( "PDFDevice" );
+ if( aValue.Len() )
+ aPrinter.m_aInfo.m_nPDFDevice = aValue.ToInt32();
+
aValue = aConfig.ReadKey( "PerformFontSubstitution" );
if( ! aValue.Equals( "0" ) && ! aValue.EqualsIgnoreCaseAscii( "false" ) )
aPrinter.m_aInfo.m_bPerformFontSubstitution = true;
@@ -624,7 +642,7 @@ const PrinterInfo& PrinterInfoManager::getPrinterInfo( const OUString& rPrinter
static PrinterInfo aEmptyInfo;
::std::hash_map< OUString, Printer, OUStringHash >::const_iterator it = m_aPrinters.find( rPrinter );
- DBG_ASSERT( it != m_aPrinters.end(), "Do not ask for info about nonexistant printers" );
+ DBG_ASSERT( it != m_aPrinters.end(), "Do not ask for info about nonexistent printers" );
return it != m_aPrinters.end() ? it->second.m_aInfo : aEmptyInfo;
}
@@ -758,6 +776,7 @@ bool PrinterInfoManager::writePrinterConfig()
pConfig->WriteKey( "Copies", ByteString::CreateFromInt32( it->second.m_aInfo.m_nCopies ) );
pConfig->WriteKey( "Orientation", it->second.m_aInfo.m_eOrientation == orientation::Landscape ? "Landscape" : "Portrait" );
pConfig->WriteKey( "PSLevel", ByteString::CreateFromInt32( it->second.m_aInfo.m_nPSLevel ) );
+ pConfig->WriteKey( "PDFDevice", ByteString::CreateFromInt32( it->second.m_aInfo.m_nPDFDevice ) );
pConfig->WriteKey( "ColorDevice", ByteString::CreateFromInt32( it->second.m_aInfo.m_nColorDevice ) );
pConfig->WriteKey( "ColorDepth", ByteString::CreateFromInt32( it->second.m_aInfo.m_nColorDepth ) );
aValue = ByteString::CreateFromInt32( it->second.m_aInfo.m_nLeftMarginAdjust );
@@ -845,9 +864,10 @@ bool PrinterInfoManager::addPrinter( const OUString& rPrinterName, const OUStrin
m_aPrinters[ rPrinterName ] = aPrinter;
bSuccess = true;
#if OSL_DEBUG_LEVEL > 1
- fprintf( stderr, "new printer %s, level = %d, colordevice = %d, depth = %d\n",
+ fprintf( stderr, "new printer %s, level = %d, pdfdevice = %d, colordevice = %d, depth = %d\n",
OUStringToOString( rPrinterName, osl_getThreadTextEncoding() ).getStr(),
m_aPrinters[rPrinterName].m_aInfo.m_nPSLevel,
+ m_aPrinters[rPrinterName].m_aInfo.m_nPDFDevice,
m_aPrinters[rPrinterName].m_aInfo.m_nColorDevice,
m_aPrinters[rPrinterName].m_aInfo.m_nColorDepth );
#endif
@@ -1095,7 +1115,7 @@ FILE* PrinterInfoManager::startSpool( const OUString& rPrintername, bool bQuickC
return popen (aShellCommand.getStr(), "w");
}
-int PrinterInfoManager::endSpool( const OUString& /*rPrintername*/, const OUString& /*rJobTitle*/, FILE* pFile, const JobData& /*rDocumentJobData*/ )
+int PrinterInfoManager::endSpool( const OUString& /*rPrintername*/, const OUString& /*rJobTitle*/, FILE* pFile, const JobData& /*rDocumentJobData*/, bool /*bBanner*/ )
{
return (0 == pclose( pFile ));
}
@@ -1166,7 +1186,11 @@ SystemQueueInfo::SystemQueueInfo() :
SystemQueueInfo::~SystemQueueInfo()
{
- terminate();
+ static const char* pNoSyncDetection = getenv( "SAL_DISABLE_SYNCHRONOUS_PRINTER_DETECTION" );
+ if( ! pNoSyncDetection || !*pNoSyncDetection )
+ join();
+ else
+ terminate();
}
bool SystemQueueInfo::hasChanged() const
diff --git a/vcl/unx/source/printergfx/printerjob.cxx b/vcl/unx/source/printergfx/printerjob.cxx
index 5e18849b8dfe..af2cf14b1a0c 100644
--- a/vcl/unx/source/printergfx/printerjob.cxx
+++ b/vcl/unx/source/printergfx/printerjob.cxx
@@ -341,7 +341,8 @@ PrinterJob::~PrinterJob ()
delete mpJobTrailer;
// XXX should really call osl::remove routines
- removeSpoolDir (maSpoolDirName);
+ if( maSpoolDirName.getLength() )
+ removeSpoolDir (maSpoolDirName);
// osl::Directory::remove (maSpoolDirName);
}
@@ -495,6 +496,10 @@ PrinterJob::StartJob (
sal_Bool
PrinterJob::EndJob ()
{
+ // no pages ? that really means no print job
+ if( maPageList.empty() )
+ return sal_False;
+
// write document setup (done here because it
// includes the accumulated fonts
if( mpJobHeader )
@@ -610,7 +615,7 @@ PrinterJob::EndJob ()
{
PrinterInfoManager& rPrinterInfoManager = PrinterInfoManager::get();
if (0 == rPrinterInfoManager.endSpool( m_aLastJobData.m_aPrinterName,
- maJobTitle, pDestFILE, m_aDocumentJobData ))
+ maJobTitle, pDestFILE, m_aDocumentJobData, true ))
{
bSuccess = sal_False;
}
diff --git a/vcl/unx/source/window/makefile.mk b/vcl/unx/source/window/makefile.mk
index 808b712903f3..c5cd95ba6b1c 100644
--- a/vcl/unx/source/window/makefile.mk
+++ b/vcl/unx/source/window/makefile.mk
@@ -48,7 +48,7 @@ dummy:
.ELSE # "$(GUIBASE)"!="unx"
SLOFILES= \
- $(SLO)/FWS.obj $(SLO)/salframe.obj $(SLO)/salobj.obj $(SLO)/salmenu.obj
+ $(SLO)/FWS.obj $(SLO)/salframe.obj $(SLO)/salobj.obj
.ENDIF # "$(GUIBASE)"!="unx"
diff --git a/vcl/unx/source/window/salframe.cxx b/vcl/unx/source/window/salframe.cxx
index b0248662a2a2..9934277302e1 100644
--- a/vcl/unx/source/window/salframe.cxx
+++ b/vcl/unx/source/window/salframe.cxx
@@ -3144,6 +3144,100 @@ GetAlternateKeyCode( const USHORT nKeyCode )
return aAlternate;
}
+void X11SalFrame::beginUnicodeSequence()
+{
+ rtl::OUString& rSeq( GetX11SalData()->GetUnicodeAccumulator() );
+ DeletionListener aDeleteWatch( this );
+
+ if( rSeq.getLength() )
+ endUnicodeSequence();
+
+ rSeq = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "u" ) );
+
+ if( ! aDeleteWatch.isDeleted() )
+ {
+ USHORT nTextAttr = SAL_EXTTEXTINPUT_ATTR_UNDERLINE;
+ SalExtTextInputEvent aEv;
+ aEv.mnTime = 0;
+ aEv.maText = rSeq;
+ aEv.mpTextAttr = &nTextAttr;
+ aEv.mnCursorPos = 0;
+ aEv.mnDeltaStart = 0;
+ aEv.mnCursorFlags = 0;
+ aEv.mbOnlyCursor = FALSE;
+
+ CallCallback(SALEVENT_EXTTEXTINPUT, (void*)&aEv);
+ }
+}
+
+bool X11SalFrame::appendUnicodeSequence( sal_Unicode c )
+{
+ bool bRet = false;
+ rtl::OUString& rSeq( GetX11SalData()->GetUnicodeAccumulator() );
+ if( rSeq.getLength() > 0 )
+ {
+ // range check
+ if( (c >= sal_Unicode('0') && c <= sal_Unicode('9')) ||
+ (c >= sal_Unicode('a') && c <= sal_Unicode('f')) ||
+ (c >= sal_Unicode('A') && c <= sal_Unicode('F')) )
+ {
+ rtl::OUStringBuffer aBuf( rSeq.getLength() + 1 );
+ aBuf.append( rSeq );
+ aBuf.append( c );
+ rSeq = aBuf.makeStringAndClear();
+ std::vector<USHORT> attribs( rSeq.getLength(), SAL_EXTTEXTINPUT_ATTR_UNDERLINE );
+
+ SalExtTextInputEvent aEv;
+ aEv.mnTime = 0;
+ aEv.maText = rSeq;
+ aEv.mpTextAttr = &attribs[0];
+ aEv.mnCursorPos = 0;
+ aEv.mnDeltaStart = 0;
+ aEv.mnCursorFlags = 0;
+ aEv.mbOnlyCursor = FALSE;
+
+ CallCallback(SALEVENT_EXTTEXTINPUT, (void*)&aEv);
+ bRet = true;
+ }
+ else
+ bRet = endUnicodeSequence();
+ }
+ else
+ endUnicodeSequence();
+ return bRet;
+}
+
+bool X11SalFrame::endUnicodeSequence()
+{
+ rtl::OUString& rSeq( GetX11SalData()->GetUnicodeAccumulator() );
+
+ DeletionListener aDeleteWatch( this );
+ if( rSeq.getLength() > 1 && rSeq.getLength() < 6 )
+ {
+ // cut the "u"
+ rtl::OUString aNumbers( rSeq.copy( 1 ) );
+ sal_Int32 nValue = aNumbers.toInt32( 16 );
+ if( nValue >= 32 )
+ {
+ USHORT nTextAttr = SAL_EXTTEXTINPUT_ATTR_UNDERLINE;
+ SalExtTextInputEvent aEv;
+ aEv.mnTime = 0;
+ aEv.maText = rtl::OUString( sal_Unicode(nValue) );
+ aEv.mpTextAttr = &nTextAttr;
+ aEv.mnCursorPos = 0;
+ aEv.mnDeltaStart = 0;
+ aEv.mnCursorFlags = 0;
+ aEv.mbOnlyCursor = FALSE;
+ CallCallback(SALEVENT_EXTTEXTINPUT, (void*)&aEv);
+ }
+ }
+ bool bWasInput = rSeq.getLength() > 0;
+ rSeq = rtl::OUString();
+ if( bWasInput && ! aDeleteWatch.isDeleted() )
+ CallCallback(SALEVENT_ENDEXTTEXTINPUT, NULL);
+ return bWasInput;
+}
+
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
long X11SalFrame::HandleKeyEvent( XKeyEvent *pEvent )
{
@@ -3189,6 +3283,9 @@ long X11SalFrame::HandleKeyEvent( XKeyEvent *pEvent )
if( pEvent->state & Mod1Mask )
nModCode |= KEY_MOD2;
+ if( nModCode != (KEY_SHIFT|KEY_MOD1) )
+ endUnicodeSequence();
+
if( nKeySym == XK_Shift_L || nKeySym == XK_Shift_R
|| nKeySym == XK_Control_L || nKeySym == XK_Control_R
|| nKeySym == XK_Alt_L || nKeySym == XK_Alt_R
@@ -3312,6 +3409,33 @@ long X11SalFrame::HandleKeyEvent( XKeyEvent *pEvent )
if( !nKeyCode && !nLen && !nKeyString)
return 0;
+ DeletionListener aDeleteWatch( this );
+
+ if( nModCode == (KEY_SHIFT | KEY_MOD1) && pEvent->type == XLIB_KeyPress )
+ {
+ USHORT nSeqKeyCode = pDisplay_->GetKeyCode( nUnmodifiedKeySym, &aDummy );
+ if( nSeqKeyCode == KEY_U )
+ {
+ beginUnicodeSequence();
+ return 1;
+ }
+ else if( nSeqKeyCode >= KEY_0 && nSeqKeyCode <= KEY_9 )
+ {
+ if( appendUnicodeSequence( sal_Unicode( '0' ) + sal_Unicode(nSeqKeyCode - KEY_0) ) )
+ return 1;
+ }
+ else if( nSeqKeyCode >= KEY_A && nSeqKeyCode <= KEY_F )
+ {
+ if( appendUnicodeSequence( sal_Unicode( 'a' ) + sal_Unicode(nSeqKeyCode - KEY_A) ) )
+ return 1;
+ }
+ else
+ endUnicodeSequence();
+ }
+
+ if( aDeleteWatch.isDeleted() )
+ return 0;
+
rtl_TextEncoding nEncoding;
if (mpInputContext != NULL && mpInputContext->IsMultiLingual() )
@@ -3370,8 +3494,6 @@ long X11SalFrame::HandleKeyEvent( XKeyEvent *pEvent )
nSize = 0;
}
- DeletionListener aDeleteWatch( this );
-
if ( mpInputContext != NULL
&& mpInputContext->UseContext()
&& KeyRelease != pEvent->type
diff --git a/vcl/unx/source/window/salmenu.cxx b/vcl/unx/source/window/salmenu.cxx
deleted file mode 100644
index 0739b6cd5352..000000000000
--- a/vcl/unx/source/window/salmenu.cxx
+++ /dev/null
@@ -1,132 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_vcl.hxx"
-
-
-#include <saldata.hxx>
-#include <salinst.h>
-#include <salmenu.h>
-
-
-// =======================================================================
-
-// X11SalInst factory methods
-
-SalMenu* X11SalInstance::CreateMenu( BOOL /*bMenuBar*/ )
-{
- return NULL; // no support for native menues
-}
-
-void X11SalInstance::DestroyMenu( SalMenu* pSalMenu )
-{
- delete pSalMenu;
-}
-
-
-SalMenuItem* X11SalInstance::CreateMenuItem( const SalItemParams* )
-{
- return NULL; // no support for native menues
-}
-
-void X11SalInstance::DestroyMenuItem( SalMenuItem* pSalMenuItem )
-{
- delete pSalMenuItem;
-}
-
-
-// =======================================================================
-
-
-/*
- * X11SalMenu
- */
-
-
-X11SalMenu::~X11SalMenu()
-{
-}
-
-BOOL X11SalMenu::VisibleMenuBar()
-{
- return FALSE;
-}
-
-void X11SalMenu::SetFrame( const SalFrame* )
-{
-}
-
-void X11SalMenu::InsertItem( SalMenuItem*, unsigned )
-{
-}
-
-void X11SalMenu::RemoveItem( unsigned )
-{
-}
-
-void X11SalMenu::SetSubMenu( SalMenuItem*, SalMenu*, unsigned )
-{
-}
-
-void X11SalMenu::CheckItem( unsigned, BOOL )
-{
-}
-
-void X11SalMenu::EnableItem( unsigned, BOOL )
-{
-}
-
-void X11SalMenu::SetItemImage( unsigned, SalMenuItem*, const Image& )
-{
-}
-
-void X11SalMenu::SetItemText( unsigned, SalMenuItem*, const XubString& )
-{
-}
-
-void X11SalMenu::SetAccelerator( unsigned, SalMenuItem*, const KeyCode&, const XubString& )
-{
-}
-
-void X11SalMenu::GetSystemMenuData( SystemMenuData* )
-{
-}
-
-// =======================================================================
-
-/*
- * SalMenuItem
- */
-
-
-X11SalMenuItem::~X11SalMenuItem()
-{
-}
-
-// -------------------------------------------------------------------
-
diff --git a/vcl/util/makefile.mk b/vcl/util/makefile.mk
index eb54531c375c..d21e9dcb3eed 100644
--- a/vcl/util/makefile.mk
+++ b/vcl/util/makefile.mk
@@ -312,7 +312,7 @@ SHL2STDLIBS=\
# prepare linking of Xinerama
.IF "$(USE_XINERAMA)" != "NO"
-.IF "$(OS)"=="MACOSX"
+.IF "$(OS)"=="MACOSX" || "$(OS)$(CPU)" == "LINUXX"
XINERAMALIBS=-lXinerama
.ELSE
.IF "$(OS)" != "SOLARIS" || "$(USE_XINERAMA_VERSION)" == "Xorg"
@@ -397,6 +397,9 @@ SHL4STDLIBS+= $(XRANDR_LIBS)
.IF "$(ENABLE_KDE)" != ""
.IF "$(KDE_ROOT)"!=""
EXTRALIBPATHS+=-L$(KDE_ROOT)$/lib
+.IF "$(OS)$(CPU)" == "LINUXX"
+EXTRALIBPATHS+=-L$(KDE_ROOT)$/lib64
+.ENDIF
.ENDIF
LIB5TARGET=$(SLB)$/ikde_plug_
LIB5FILES=$(SLB)$/kdeplug.lib
@@ -458,3 +461,16 @@ SHL6STDLIBS+= $(XRANDR_LIBS)
.INCLUDE : target.mk
+ALLTAR : $(MISC)/vcl.component
+
+.IF "$(OS)" == "MACOSX"
+my_platform = .macosx
+.ELIF "$(OS)" == "WNT"
+my_platform = .windows
+.END
+
+$(MISC)/vcl.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ vcl.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt vcl$(my_platform).component
diff --git a/vcl/util/makefile2.pmk b/vcl/util/makefile2.pmk
index df9ba1a214d7..ac2977ca8eab 100644
--- a/vcl/util/makefile2.pmk
+++ b/vcl/util/makefile2.pmk
@@ -36,6 +36,6 @@ CFLAGSCXX+=$(OBJCXXFLAGS)
#building with stlport, but graphite was not built with stlport
.IF "$(USE_SYSTEM_STL)"!="YES"
.IF "$(SYSTEM_GRAPHITE)"=="YES"
-CDEFS += -DADAPT_EXT_STL
+CFLAGSCXX+=-DADAPT_EXT_STL
.ENDIF
.ENDIF
diff --git a/vcl/util/vcl.component b/vcl/util/vcl.component
new file mode 100644
index 000000000000..da20fc916c32
--- /dev/null
+++ b/vcl/util/vcl.component
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.datatransfer.X11ClipboardSupport">
+ <service name="com.sun.star.datatransfer.clipboard.SystemClipboard"/>
+ </implementation>
+ <implementation name="com.sun.star.datatransfer.dnd.XdndDropTarget">
+ <service name="com.sun.star.datatransfer.dnd.X11DropTarget"/>
+ </implementation>
+ <implementation name="com.sun.star.datatransfer.dnd.XdndSupport">
+ <service name="com.sun.star.datatransfer.dnd.X11DragSource"/>
+ </implementation>
+ <implementation name="com.sun.star.frame.VCLSessionManagerClient">
+ <service name="com.sun.star.frame.SessionManagerClient"/>
+ </implementation>
+ <implementation name="vcl::DisplayAccess">
+ <service name="com.sun.star.awt.DisplayAccess"/>
+ </implementation>
+ <implementation name="vcl::FontIdentificator">
+ <service name="com.sun.star.awt.FontIdentificator"/>
+ </implementation>
+</component>
diff --git a/vcl/util/vcl.macosx.component b/vcl/util/vcl.macosx.component
new file mode 100644
index 000000000000..3aabcd8c7050
--- /dev/null
+++ b/vcl/util/vcl.macosx.component
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.datatransfer.dnd.OleDragSource_V1">
+ <service name="com.sun.star.datatransfer.dnd.OleDragSource"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.datatransfer.dnd.OleDropTarget_V1">
+ <service name="com.sun.star.datatransfer.dnd.OleDropTarget"/>
+ </implementation>
+ <implementation name="com.sun.star.datatransfer.clipboard.AquaClipboard">
+ <service name="com.sun.star.datatransfer.clipboard.SystemClipboard"/>
+ </implementation>
+ <implementation name="com.sun.star.frame.VCLSessionManagerClient">
+ <service name="com.sun.star.frame.SessionManagerClient"/>
+ </implementation>
+ <implementation name="vcl::DisplayAccess">
+ <service name="com.sun.star.awt.DisplayAccess"/>
+ </implementation>
+ <implementation name="vcl::FontIdentificator">
+ <service name="com.sun.star.awt.FontIdentificator"/>
+ </implementation>
+</component>
diff --git a/vcl/util/vcl.windows.component b/vcl/util/vcl.windows.component
new file mode 100644
index 000000000000..72f7ace9f251
--- /dev/null
+++ b/vcl/util/vcl.windows.component
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.frame.VCLSessionManagerClient">
+ <service name="com.sun.star.frame.SessionManagerClient"/>
+ </implementation>
+ <implementation name="vcl::DisplayAccess">
+ <service name="com.sun.star.awt.DisplayAccess"/>
+ </implementation>
+ <implementation name="vcl::FontIdentificator">
+ <service name="com.sun.star.awt.FontIdentificator"/>
+ </implementation>
+</component>
diff --git a/vcl/win/inc/salgdi.h b/vcl/win/inc/salgdi.h
index 442b8bee1f15..f592f53ae29c 100755
--- a/vcl/win/inc/salgdi.h
+++ b/vcl/win/inc/salgdi.h
@@ -57,10 +57,10 @@ class ImplFontAttrCache;
class ImplWinFontData : public ImplFontData
{
public:
- ImplWinFontData( const ImplDevFontAttributes&,
+ explicit ImplWinFontData( const ImplDevFontAttributes&,
int nFontHeight, WIN_BYTE eWinCharSet,
WIN_BYTE nPitchAndFamily );
- ~ImplWinFontData();
+ virtual ~ImplWinFontData();
virtual ImplFontData* Clone() const;
virtual ImplFontEntry* CreateFontInstance( ImplFontSelectData& ) const;
@@ -82,7 +82,7 @@ public:
bool SupportsGraphite() const { return mbHasGraphiteSupport; }
#endif
- ImplFontCharMap* GetImplFontCharMap() const;
+ const ImplFontCharMap* GetImplFontCharMap() const;
const Ucs2SIntMap* GetEncodingVector() const { return mpEncodingVector; }
void SetEncodingVector( const Ucs2SIntMap* pNewVec ) const
{
@@ -127,9 +127,9 @@ public:
#endif // GNG_VERT_HACK
};
-// -------------------
-// - SalGraphicsData -
-// -------------------
+// ------------------
+// - WinSalGraphics -
+// ------------------
class WinSalGraphics : public SalGraphics
{
@@ -179,7 +179,7 @@ public:
HFONT ImplDoSetFont( ImplFontSelectData* i_pFont, float& o_rFontScale, HFONT& o_rOldFont );
public:
- WinSalGraphics();
+ explicit WinSalGraphics();
virtual ~WinSalGraphics();
protected:
@@ -282,12 +282,12 @@ public:
// set the font
virtual USHORT SetFont( ImplFontSelectData*, int nFallbackLevel );
// get the current font's etrics
- virtual void GetFontMetric( ImplFontMetricData* );
+ virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel );
// get kernign pairs of the current font
// return only PairCount if (pKernPairs == NULL)
virtual ULONG GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs );
// get the repertoire of the current font
- virtual ImplFontCharMap* GetImplFontCharMap() const;
+ virtual const ImplFontCharMap* GetImplFontCharMap() const;
// graphics must fill supplied font list
virtual void GetDevFontList( ImplDevFontList* );
// graphics should call ImplAddDevFontSubstitute on supplied
@@ -359,11 +359,11 @@ public:
};
// Init/Deinit Graphics
-void ImplSalInitGraphics( WinSalGraphics* mpData );
-void ImplSalDeInitGraphics( WinSalGraphics* mpData );
+void ImplSalInitGraphics( WinSalGraphics* );
+void ImplSalDeInitGraphics( WinSalGraphics* );
void ImplUpdateSysColorEntries();
int ImplIsSysColorEntry( SalColor nSalColor );
-void ImplGetLogFontFromFontSelect( HDC hDC, const ImplFontSelectData*,
+void ImplGetLogFontFromFontSelect( HDC, const ImplFontSelectData*,
LOGFONTW&, bool bTestVerticalAvail );
// -----------
@@ -397,7 +397,10 @@ inline bool ImplWinFontData::HasChar( sal_uInt32 cChar ) const
cChar -= 0xF000;
else if( mbAliasSymbolsHigh && (cChar <= 0xFF) )
cChar += 0xF000;
+ else
+ return false;
return mpUnicodeMap->HasChar( cChar );
}
#endif // _SV_SALGDI_H
+
diff --git a/vcl/win/inc/salinst.h b/vcl/win/inc/salinst.h
index f3005e3ad30b..1ab59f8f7f9f 100644
--- a/vcl/win/inc/salinst.h
+++ b/vcl/win/inc/salinst.h
@@ -77,9 +77,11 @@ public:
virtual vos::IMutex* GetYieldMutex();
virtual ULONG ReleaseYieldMutex();
virtual void AcquireYieldMutex( ULONG nCount );
+ virtual bool CheckYieldMutex();
+
virtual void Yield( bool bWait, bool bHandleAllCurrentEvents );
virtual bool AnyInput( USHORT nType );
- virtual SalMenu* CreateMenu( BOOL bMenuBar );
+ virtual SalMenu* CreateMenu( BOOL bMenuBar, Menu* );
virtual void DestroyMenu( SalMenu* );
virtual SalMenuItem* CreateMenuItem( const SalItemParams* pItemData );
virtual void DestroyMenuItem( SalMenuItem* );
diff --git a/vcl/win/source/app/salinst.cxx b/vcl/win/source/app/salinst.cxx
index 9514bc9a2ace..a05d2d0b6502 100644
--- a/vcl/win/source/app/salinst.cxx
+++ b/vcl/win/source/app/salinst.cxx
@@ -323,10 +323,9 @@ void ImplSalAcquireYieldMutex( ULONG nCount )
// -----------------------------------------------------------------------
-#ifdef DBG_UTIL
-
-void ImplDbgTestSolarMutex()
+bool WinSalInstance::CheckYieldMutex()
{
+ bool bRet = true;
SalData* pSalData = GetSalData();
DWORD nCurThreadId = GetCurrentThreadId();
if ( pSalData->mnAppThreadId != nCurThreadId )
@@ -336,7 +335,7 @@ void ImplDbgTestSolarMutex()
SalYieldMutex* pYieldMutex = pSalData->mpFirstInstance->mpSalYieldMutex;
if ( pYieldMutex->mnThreadId != nCurThreadId )
{
- DBG_ERROR( "SolarMutex not locked, and not thread save code in VCL is called from outside of the main thread" );
+ bRet = false;
}
}
}
@@ -347,14 +346,13 @@ void ImplDbgTestSolarMutex()
SalYieldMutex* pYieldMutex = pSalData->mpFirstInstance->mpSalYieldMutex;
if ( pYieldMutex->mnThreadId != nCurThreadId )
{
- DBG_ERROR( "SolarMutex not locked in the main thread" );
+ bRet = false;
}
}
}
+ return bRet;
}
-#endif
-
// =======================================================================
void SalData::initKeyCodeMap()
diff --git a/vcl/win/source/gdi/salbmp.cxx b/vcl/win/source/gdi/salbmp.cxx
index 444df039dd69..141c812dcd31 100644
--- a/vcl/win/source/gdi/salbmp.cxx
+++ b/vcl/win/source/gdi/salbmp.cxx
@@ -509,8 +509,8 @@ void WinSalBitmap::ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly )
{
PBITMAPINFO pBI = (PBITMAPINFO) GlobalLock( mhDIB );
const USHORT nCount = pBuffer->maPalette.GetEntryCount();
-
- memcpy( pBI->bmiColors, pBuffer->maPalette.ImplGetColorBuffer(), nCount * sizeof( RGBQUAD ) );
+ const USHORT nDIBColorCount = ImplGetDIBColorCount( mhDIB );
+ memcpy( pBI->bmiColors, pBuffer->maPalette.ImplGetColorBuffer(), Min( nDIBColorCount, nCount ) * sizeof( RGBQUAD ) );
GlobalUnlock( mhDIB );
}
diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx
index d1b5a9cfdeae..c8e0210196e6 100644
--- a/vcl/win/source/gdi/salgdi3.cxx
+++ b/vcl/win/source/gdi/salgdi3.cxx
@@ -533,9 +533,10 @@ bool WinGlyphFallbackSubstititution::HasMissingChars( const ImplFontData* pFace,
// avoid fonts with unknown CMAP subtables for glyph fallback
if( !pCharMap || pCharMap->IsDefaultMap() )
return false;
+ pCharMap->AddReference();
int nMatchCount = 0;
- // static const int nMaxMatchCount = 1; // TODO: check more missing characters?
+ // static const int nMaxMatchCount = 1; // TODO: tolerate more missing characters?
const sal_Int32 nStrLen = rMissingChars.getLength();
for( sal_Int32 nStrIdx = 0; nStrIdx < nStrLen; ++nStrIdx )
{
@@ -543,6 +544,7 @@ bool WinGlyphFallbackSubstititution::HasMissingChars( const ImplFontData* pFace,
nMatchCount += pCharMap->HasChar( uChar );
break; // for now
}
+ pCharMap->DeReference();
const bool bHasMatches = (nMatchCount > 0);
return bHasMatches;
@@ -1206,11 +1208,10 @@ bool ImplWinFontData::IsGSUBstituted( sal_UCS4 cChar ) const
// -----------------------------------------------------------------------
-ImplFontCharMap* ImplWinFontData::GetImplFontCharMap() const
+const ImplFontCharMap* ImplWinFontData::GetImplFontCharMap() const
{
if( !mpUnicodeMap )
return NULL;
- mpUnicodeMap->AddReference();
return mpUnicodeMap;
}
@@ -1320,6 +1321,7 @@ void ImplWinFontData::ReadCmapTable( HDC hDC ) const
if( !mpUnicodeMap )
mpUnicodeMap = ImplFontCharMap::GetDefaultMap( bIsSymbolFont );
+ mpUnicodeMap->AddReference();
}
// =======================================================================
@@ -1760,8 +1762,11 @@ USHORT WinSalGraphics::SetFont( ImplFontSelectData* pFont, int nFallbackLevel )
// -----------------------------------------------------------------------
-void WinSalGraphics::GetFontMetric( ImplFontMetricData* pMetric )
+void WinSalGraphics::GetFontMetric( ImplFontMetricData* pMetric, int nFallbackLevel )
{
+ // temporarily change the HDC to the font in the fallback level
+ HFONT hOldFont = SelectFont( mhDC, mhFonts[nFallbackLevel] );
+
if ( aSalShlData.mbWNT )
{
wchar_t aFaceName[LF_FACESIZE+60];
@@ -1775,8 +1780,12 @@ void WinSalGraphics::GetFontMetric( ImplFontMetricData* pMetric )
pMetric->maName = ImplSalGetUniString( aFaceName );
}
+ // get the font metric
TEXTMETRICA aWinMetric;
- if( !GetTextMetricsA( mhDC, &aWinMetric ) )
+ const bool bOK = GetTextMetricsA( mhDC, &aWinMetric );
+ // restore the HDC to the font in the base level
+ SelectFont( mhDC, hOldFont );
+ if( !bOK )
return;
// device independent font attributes
@@ -1815,7 +1824,7 @@ void WinSalGraphics::GetFontMetric( ImplFontMetricData* pMetric )
// #107888# improved metric compatibility for Asian fonts...
// TODO: assess workaround below for CWS >= extleading
// TODO: evaluate use of aWinMetric.sTypo* members for CJK
- if( mpWinFontData[0] && mpWinFontData[0]->SupportsCJK() )
+ if( mpWinFontData[nFallbackLevel] && mpWinFontData[nFallbackLevel]->SupportsCJK() )
{
pMetric->mnIntLeading += pMetric->mnExtLeading;
@@ -1836,7 +1845,7 @@ void WinSalGraphics::GetFontMetric( ImplFontMetricData* pMetric )
// #109280# HACK korean only: increase descent for wavelines and impr
if( !aSalShlData.mbWNT )
- if( mpWinFontData[0]->SupportsKorean() )
+ if( mpWinFontData[nFallbackLevel]->SupportsKorean() )
pMetric->mnDescent += pMetric->mnExtLeading;
}
@@ -2053,7 +2062,7 @@ ULONG WinSalGraphics::GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs )
// -----------------------------------------------------------------------
-ImplFontCharMap* WinSalGraphics::GetImplFontCharMap() const
+const ImplFontCharMap* WinSalGraphics::GetImplFontCharMap() const
{
if( !mpWinFontData[0] )
return ImplFontCharMap::GetDefaultMap();
@@ -2875,8 +2884,6 @@ BOOL WinSalGraphics::CreateFontSubset( const rtl::OUString& rToFile,
ImplDoSetFont( &aIFSD, fScale, hOldFont );
ImplWinFontData* pWinFontData = (ImplWinFontData*)aIFSD.mpFontData;
- pWinFontData->UpdateFromHDC( mhDC );
-/*const*/ ImplFontCharMap* pImplFontCharMap = pWinFontData->GetImplFontCharMap();
#if OSL_DEBUG_LEVEL > 1
// get font metrics
@@ -2899,6 +2906,10 @@ BOOL WinSalGraphics::CreateFontSubset( const rtl::OUString& rToFile,
const RawFontData aRawCffData( mhDC, nCffTag );
if( aRawCffData.get() )
{
+ pWinFontData->UpdateFromHDC( mhDC );
+ const ImplFontCharMap* pCharMap = pWinFontData->GetImplFontCharMap();
+ pCharMap->AddReference();
+
long nRealGlyphIds[ 256 ];
for( int i = 0; i < nGlyphCount; ++i )
{
@@ -2906,13 +2917,15 @@ BOOL WinSalGraphics::CreateFontSubset( const rtl::OUString& rToFile,
// TODO: use GDI's GetGlyphIndices instead? Does it handle GSUB properly?
sal_uInt32 nGlyphIdx = pGlyphIDs[i] & GF_IDXMASK;
if( pGlyphIDs[i] & GF_ISCHAR ) // remaining pseudo-glyphs need to be translated
- nGlyphIdx = pImplFontCharMap->GetGlyphIndex( nGlyphIdx );
+ nGlyphIdx = pCharMap->GetGlyphIndex( nGlyphIdx );
if( (pGlyphIDs[i] & (GF_ROTMASK|GF_GSUB)) != 0) // TODO: vertical substitution
{/*####*/}
nRealGlyphIds[i] = nGlyphIdx;
}
+ pCharMap->DeReference(); // TODO: and and use a RAII object
+
// provide a font subset from the CFF-table
FILE* pOutFile = fopen( aToFile.GetBuffer(), "wb" );
rInfo.LoadFont( FontSubsetInfo::CFF_FONT, aRawCffData.get(), aRawCffData.size() );
@@ -3160,8 +3173,9 @@ void WinSalGraphics::GetGlyphWidths( const ImplFontData* pFont,
rUnicodeEnc.clear();
}
const ImplWinFontData* pWinFont = static_cast<const ImplWinFontData*>(pFont);
- ImplFontCharMap* pMap = pWinFont->GetImplFontCharMap();
+ const ImplFontCharMap* pMap = pWinFont->GetImplFontCharMap();
DBG_ASSERT( pMap && pMap->GetCharCount(), "no map" );
+ pMap->AddReference();
int nCharCount = pMap->GetCharCount();
sal_uInt32 nChar = pMap->GetFirstChar();
@@ -3177,6 +3191,8 @@ void WinSalGraphics::GetGlyphWidths( const ImplFontData* pFont,
}
nChar = pMap->GetNextChar( nChar );
}
+
+ pMap->DeReference(); // TODO: and and use a RAII object
}
}
else if( pFont->IsEmbeddable() )
diff --git a/vcl/win/source/gdi/winlayout.cxx b/vcl/win/source/gdi/winlayout.cxx
index bc80cbf94fb8..82fa9bb4b5e1 100755..100644
--- a/vcl/win/source/gdi/winlayout.cxx
+++ b/vcl/win/source/gdi/winlayout.cxx
@@ -2076,6 +2076,13 @@ void UniscribeLayout::MoveGlyph( int nStartx8, long nNewXPos )
// move the visual item by having an offset
pVI->mnXOffset += nDelta;
}
+ // move subsequent items - this often isn't necessary because subsequent
+ // moves will correct subsequent items. However, if there is a contiguous
+ // range not involving fallback which spans items, this will be needed
+ while (++pVI - mpVisualItems < mnItemCount)
+ {
+ pVI->mnXOffset += nDelta;
+ }
}
// -----------------------------------------------------------------------
@@ -2364,6 +2371,10 @@ void UniscribeLayout::GetCaretPositions( int nMaxIdx, long* pCaretXArray ) const
if( rVisualItem.IsEmpty() )
continue;
+ if (mnLayoutFlags & SAL_LAYOUT_FOR_FALLBACK)
+ {
+ nXPos = rVisualItem.mnXOffset;
+ }
// get glyph positions
// TODO: handle when rVisualItem's glyph range is only partially used
for( i = rVisualItem.mnMinGlyphPos; i < rVisualItem.mnEndGlyphPos; ++i )
@@ -2397,13 +2408,17 @@ void UniscribeLayout::GetCaretPositions( int nMaxIdx, long* pCaretXArray ) const
}
}
- // fixup unknown character positions to neighbor
- for( i = 0; i < nMaxIdx; ++i )
+ if (!(mnLayoutFlags & SAL_LAYOUT_FOR_FALLBACK))
{
- if( pCaretXArray[ i ] >= 0 )
- nXPos = pCaretXArray[ i ];
- else
- pCaretXArray[ i ] = nXPos;
+ nXPos = 0;
+ // fixup unknown character positions to neighbor
+ for( i = 0; i < nMaxIdx; ++i )
+ {
+ if( pCaretXArray[ i ] >= 0 )
+ nXPos = pCaretXArray[ i ];
+ else
+ pCaretXArray[ i ] = nXPos;
+ }
}
}
diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx
index 7314fd2b6164..f0ca1d68ef41 100644..100755
--- a/vcl/win/source/window/salframe.cxx
+++ b/vcl/win/source/window/salframe.cxx
@@ -161,7 +161,7 @@ BOOL WinSalFrame::mbInReparent = FALSE;
// =======================================================================
static void UpdateFrameGeometry( HWND hWnd, WinSalFrame* pFrame );
-static void SetMaximizedFrameGeometry( HWND hWnd, WinSalFrame* pFrame );
+static void SetMaximizedFrameGeometry( HWND hWnd, WinSalFrame* pFrame, RECT* pParentRect = NULL );
static void ImplSaveFrameState( WinSalFrame* pFrame )
{
@@ -182,6 +182,25 @@ static void ImplSaveFrameState( WinSalFrame* pFrame )
if ( bVisible )
pFrame->mnShowState = SW_SHOWMAXIMIZED;
pFrame->mbRestoreMaximize = TRUE;
+
+ WINDOWPLACEMENT aPlacement;
+ aPlacement.length = sizeof(aPlacement);
+ if( GetWindowPlacement( pFrame->mhWnd, &aPlacement ) )
+ {
+ RECT aRect = aPlacement.rcNormalPosition;
+ RECT aRect2 = aRect;
+ AdjustWindowRectEx( &aRect2, GetWindowStyle( pFrame->mhWnd ),
+ FALSE, GetWindowExStyle( pFrame->mhWnd ) );
+ long nTopDeco = abs( aRect.top - aRect2.top );
+ long nLeftDeco = abs( aRect.left - aRect2.left );
+ long nBottomDeco = abs( aRect.bottom - aRect2.bottom );
+ long nRightDeco = abs( aRect.right - aRect2.right );
+
+ pFrame->maState.mnX = aRect.left + nLeftDeco;
+ pFrame->maState.mnY = aRect.top + nTopDeco;
+ pFrame->maState.mnWidth = aRect.right - aRect.left - nLeftDeco - nRightDeco;
+ pFrame->maState.mnHeight = aRect.bottom - aRect.top - nTopDeco - nBottomDeco;
+ }
}
else
{
@@ -1934,17 +1953,25 @@ void WinSalFrame::SetWindowState( const SalFrameState* pState )
}
}
- // Wenn Fenster nicht minimiert/maximiert ist oder nicht optisch
- // umgesetzt werden muss, dann SetWindowPos() benutzen, da
- // SetWindowPlacement() die TaskBar mit einrechnet
+ // if a window is neither minimized nor maximized or need not be
+ // positioned visibly (that is in visible state), do not use
+ // SetWindowPlacement since it calculates including the TaskBar
if ( !IsIconic( mhWnd ) && !IsZoomed( mhWnd ) &&
(!bVisible || (aPlacement.showCmd == SW_RESTORE)) )
{
if( bUpdateHiddenFramePos )
{
+ RECT aStateRect;
+ aStateRect.left = nX;
+ aStateRect.top = nY;
+ aStateRect.right = nX+nWidth;
+ aStateRect.bottom = nY+nHeight;
// #96084 set a useful internal window size because
// the window will not be maximized (and the size updated) before show()
- SetMaximizedFrameGeometry( mhWnd, this );
+ SetMaximizedFrameGeometry( mhWnd, this, &aStateRect );
+ SetWindowPos( mhWnd, 0,
+ maGeometry.nX, maGeometry.nY, maGeometry.nWidth, maGeometry.nHeight,
+ SWP_NOZORDER | SWP_NOACTIVATE | nPosSize );
}
else
SetWindowPos( mhWnd, 0,
@@ -4197,23 +4224,27 @@ static void ImplHandlePaintMsg2( HWND hWnd, RECT* pRect )
// -----------------------------------------------------------------------
-static void SetMaximizedFrameGeometry( HWND hWnd, WinSalFrame* pFrame )
+static void SetMaximizedFrameGeometry( HWND hWnd, WinSalFrame* pFrame, RECT* pParentRect )
{
// calculate and set frame geometry of a maximized window - useful if the window is still hidden
// dualmonitor support:
// Get screensize of the monitor whith the mouse pointer
- POINT pt;
- GetCursorPos( &pt );
RECT aRectMouse;
- aRectMouse.left = pt.x;
- aRectMouse.top = pt.y;
- aRectMouse.right = pt.x+2;
- aRectMouse.bottom = pt.y+2;
+ if( ! pParentRect )
+ {
+ POINT pt;
+ GetCursorPos( &pt );
+ aRectMouse.left = pt.x;
+ aRectMouse.top = pt.y;
+ aRectMouse.right = pt.x+2;
+ aRectMouse.bottom = pt.y+2;
+ pParentRect = &aRectMouse;
+ }
RECT aRect;
- ImplSalGetWorkArea( hWnd, &aRect, &aRectMouse );
+ ImplSalGetWorkArea( hWnd, &aRect, pParentRect );
// a maximized window has no other borders than the caption
pFrame->maGeometry.nLeftDecoration = pFrame->maGeometry.nRightDecoration = pFrame->maGeometry.nBottomDecoration = 0;
diff --git a/vcl/win/source/window/salmenu.cxx b/vcl/win/source/window/salmenu.cxx
index 1eb75969ea38..47da911b012e 100644
--- a/vcl/win/source/window/salmenu.cxx
+++ b/vcl/win/source/window/salmenu.cxx
@@ -59,7 +59,7 @@ BOOL SalData::IsKnownMenuHandle( HMENU hMenu )
// WinSalInst factory methods
-SalMenu* WinSalInstance::CreateMenu( BOOL bMenuBar )
+SalMenu* WinSalInstance::CreateMenu( BOOL bMenuBar, Menu* )
{
WinSalMenu *pSalMenu = new WinSalMenu();
diff --git a/vcl/workben/makefile.mk b/vcl/workben/makefile.mk
index 67c0289cc24f..abd0c23a3607 100644
--- a/vcl/workben/makefile.mk
+++ b/vcl/workben/makefile.mk
@@ -34,6 +34,8 @@ TARGETTYPE=GUI
ENABLE_EXCEPTIONS=TRUE
+my_components = i18npool i18nsearch
+
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
@@ -136,16 +138,18 @@ APP5STDLIBS+=-lsocket
.ENDIF
.INCLUDE : target.mk
-.IF "$(L10N_framework)"==""
-ALLTAR : $(BIN)$/applicat.rdb
+ALLTAR : $(BIN)/applicat.rdb $(BIN)/types.rdb
+$(BIN)/applicat.rdb .ERRREMOVE : $(SOLARENV)/bin/packcomponents.xslt \
+ $(MISC)/applicat.input $(my_components:^"$(SOLARXMLDIR)/":+".component")
+ $(XSLTPROC) --nonet --stringparam prefix $(SOLARXMLDIR)/ -o $@ \
+ $(SOLARENV)/bin/packcomponents.xslt $(MISC)/applicat.input
-$(BIN)$/applicat.rdb : makefile.mk $(UNOUCRRDB)
- rm -f $@
- $(GNUCOPY) $(UNOUCRRDB) $@
- cd $(BIN) && \
- $(REGCOMP) -register -r applicat.rdb \
- -c i18nsearch.uno$(DLLPOST) \
- -c i18npool.uno$(DLLPOST)
-.ENDIF
+$(MISC)/applicat.input :
+ echo \
+ '<list>$(my_components:^"<filename>":+".component</filename>")</list>' \
+ > $@
+
+$(BIN)/types.rdb : $(SOLARBINDIR)/types.rdb
+ $(COPY) $< $@
diff --git a/vcl/workben/svdem.cxx b/vcl/workben/svdem.cxx
index 5822f4024a59..297660d4b8df 100644
--- a/vcl/workben/svdem.cxx
+++ b/vcl/workben/svdem.cxx
@@ -55,7 +55,7 @@ SAL_IMPLEMENT_MAIN()
tools::extendApplicationEnvironment();
Reference< XMultiServiceFactory > xMS;
- xMS = cppu::createRegistryServiceFactory( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "applicat.rdb" ) ), sal_True );
+ xMS = cppu::createRegistryServiceFactory( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "types.rdb" ) ), rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "applicat.rdb" ) ), sal_True );
InitVCL( xMS );
::Main();
diff --git a/vcl/workben/svptest.cxx b/vcl/workben/svptest.cxx
index cc7c0f2b0cce..8f901d1c200b 100644
--- a/vcl/workben/svptest.cxx
+++ b/vcl/workben/svptest.cxx
@@ -61,7 +61,7 @@ SAL_IMPLEMENT_MAIN()
tools::extendApplicationEnvironment();
Reference< XMultiServiceFactory > xMS;
- xMS = cppu::createRegistryServiceFactory( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "applicat.rdb" ) ), sal_True );
+ xMS = cppu::createRegistryServiceFactory( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "types.rdb" ) ), rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "applicat.rdb" ) ), sal_True );
InitVCL( xMS );
::Main();
diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx
index 41ca76144e5c..dafd546b3d68 100644
--- a/vcl/workben/vcldemo.cxx
+++ b/vcl/workben/vcldemo.cxx
@@ -60,7 +60,7 @@ SAL_IMPLEMENT_MAIN()
tools::extendApplicationEnvironment();
Reference< XMultiServiceFactory > xMS;
- xMS = cppu::createRegistryServiceFactory( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "applicat.rdb" ) ), sal_True );
+ xMS = cppu::createRegistryServiceFactory( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "types.rdb" ) ), rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "applicat.rdb" ) ), sal_True );
InitVCL( xMS );
::Main();
diff --git a/vos/inc/vos/execabl.hxx b/vos/inc/vos/execabl.hxx
index 04e0ef837b02..5788fb598662 100644
--- a/vos/inc/vos/execabl.hxx
+++ b/vos/inc/vos/execabl.hxx
@@ -50,7 +50,7 @@ namespace vos
@version 0.1
*/
-class IExecutable : public NAMESPACE_VOS(IReference)
+class IExecutable : public vos::IReference
{
public:
@@ -82,8 +82,8 @@ public:
/** OExecutable
added default impl. of IReferenceCounter
*/
-class OExecutable : public NAMESPACE_VOS(IExecutable),
- public NAMESPACE_VOS(OReference)
+class OExecutable : public vos::IExecutable,
+ public vos::OReference
{
public:
diff --git a/vos/inc/vos/macros.hxx b/vos/inc/vos/macros.hxx
index ca1b750d67f4..be91b6d00aa2 100644
--- a/vos/inc/vos/macros.hxx
+++ b/vos/inc/vos/macros.hxx
@@ -149,9 +149,6 @@
// def. for arbitrary namespace
#define VOS_NAMESPACE(class_name, name_space) name_space::class_name
-// sal_Int16 def. for namespace vos
-#define NAMESPACE_VOS(class_name) vos::class_name
-
// sal_Int16 def. for namespace std
#define NAMESPACE_STD(class_name) std::class_name
diff --git a/vos/inc/vos/pipe.hxx b/vos/inc/vos/pipe.hxx
index e9b1145a36ee..ce378272c9b9 100644
--- a/vos/inc/vos/pipe.hxx
+++ b/vos/inc/vos/pipe.hxx
@@ -48,10 +48,10 @@ class OStreamPipe;
/** Represents a pipe.
*/
-class OPipe : public NAMESPACE_VOS(OReference),
- public NAMESPACE_VOS(OObject)
+class OPipe : public vos::OReference,
+ public vos::OObject
{
- VOS_DECLARE_CLASSINFO(NAMESPACE_VOS(OPipe));
+ VOS_DECLARE_CLASSINFO(vos::OPipe);
public:
/*
@@ -101,7 +101,7 @@ public:
@param Security
*/
OPipe(const ::rtl::OUString& strName, TPipeOption Options,
- const NAMESPACE_VOS(OSecurity)& rSecurity);
+ const vos::OSecurity& rSecurity);
/** Copy constructor.
*/
@@ -132,7 +132,7 @@ public:
@return True if socket was successfully created.
*/
sal_Bool SAL_CALL create(const ::rtl::OUString& strName, TPipeOption Options,
- const NAMESPACE_VOS(OSecurity)& rSecurity);
+ const vos::OSecurity& rSecurity);
/** Assignment operator. If pipe was already created, the old one will
be discarded.
@@ -191,10 +191,10 @@ public:
/** A pipe to send or receive a stream of data.
*/
-class OStreamPipe : public NAMESPACE_VOS(OPipe),
- public NAMESPACE_VOS(IStream)
+class OStreamPipe : public vos::OPipe,
+ public vos::IStream
{
- VOS_DECLARE_CLASSINFO(NAMESPACE_VOS(OStreamPipe));
+ VOS_DECLARE_CLASSINFO(vos::OStreamPipe);
public:
/** Creates an unattached pipe. You must attach the pipe to an oslPipe
diff --git a/vos/inc/vos/process.hxx b/vos/inc/vos/process.hxx
index e41a050acaa0..0b98278d117e 100644
--- a/vos/inc/vos/process.hxx
+++ b/vos/inc/vos/process.hxx
@@ -284,7 +284,7 @@ class OExtCommandLineImpl;
class OExtCommandLine : public OObject
{
VOS_DECLARE_CLASSINFO(VOS_NAMESPACE(OExtCommandLine, vos));
- static NAMESPACE_VOS(OExtCommandLineImpl)* pExtImpl;
+ static vos::OExtCommandLineImpl* pExtImpl;
public:
diff --git a/vos/inc/vos/refernce.hxx b/vos/inc/vos/refernce.hxx
index 25f0f39eb0f3..8f5a0ec799fb 100644
--- a/vos/inc/vos/refernce.hxx
+++ b/vos/inc/vos/refernce.hxx
@@ -82,7 +82,7 @@ private:
ORefCount& SAL_CALL operator= (const ORefCount&);
};
-class OReference : public NAMESPACE_VOS(IReference)
+class OReference : public vos::IReference
{
public:
OReference();
diff --git a/vos/inc/vos/signal.hxx b/vos/inc/vos/signal.hxx
index ea9db4850490..f2bff35998ec 100644
--- a/vos/inc/vos/signal.hxx
+++ b/vos/inc/vos/signal.hxx
@@ -46,7 +46,7 @@ SignalHandlerFunction_impl signalHandlerFunction_impl;
@version 1.0
*/
-class OSignalHandler : public NAMESPACE_VOS(OObject)
+class OSignalHandler : public vos::OObject
{
VOS_DECLARE_CLASSINFO(VOS_NAMESPACE(OSignalHandler, vos));
diff --git a/vos/inc/vos/socket.hxx b/vos/inc/vos/socket.hxx
index cfd51fbb069b..f803a455129c 100644
--- a/vos/inc/vos/socket.hxx
+++ b/vos/inc/vos/socket.hxx
@@ -189,7 +189,7 @@ public:
/** Base class for socket addresses.
*/
-class ISocketAddr : public NAMESPACE_VOS(ISocketTypes)
+class ISocketAddr : public vos::ISocketTypes
{
public:
virtual ~ISocketAddr() { }
@@ -202,11 +202,11 @@ public:
virtual sal_Bool SAL_CALL operator== (oslSocketAddr Addr)= 0;
};
-class OSocketAddr : public NAMESPACE_VOS(ISocketAddr),
- public NAMESPACE_VOS(OObject)
+class OSocketAddr : public vos::ISocketAddr,
+ public vos::OObject
{
- VOS_DECLARE_CLASSINFO(NAMESPACE_VOS(OSocketAddr));
+ VOS_DECLARE_CLASSINFO(vos::OSocketAddr);
public:
/** Creates socket address of unknown type.
@@ -274,9 +274,9 @@ protected:
/** Represents an internet-address.
*/
-class OInetSocketAddr : public NAMESPACE_VOS(OSocketAddr)
+class OInetSocketAddr : public vos::OSocketAddr
{
- VOS_DECLARE_CLASSINFO(NAMESPACE_VOS(OInetSocketAddr));
+ VOS_DECLARE_CLASSINFO(vos::OInetSocketAddr);
public:
/** Creates an empty internet-address (INADDR_ANY).
@@ -359,9 +359,9 @@ public:
/** Represents an IPX/SPX address.
*/
-class OIpxSocketAddr : public NAMESPACE_VOS(OSocketAddr)
+class OIpxSocketAddr : public vos::OSocketAddr
{
- VOS_DECLARE_CLASSINFO(NAMESPACE_VOS(OIpxSocketAddr));
+ VOS_DECLARE_CLASSINFO(vos::OIpxSocketAddr);
public:
typedef oslSocketIpxNetNumber TIpxNetNumber;
@@ -430,11 +430,11 @@ public:
/** Represents a socket.
*/
-class OSocket : public NAMESPACE_VOS(ISocketTypes),
- public NAMESPACE_VOS(OReference),
- public NAMESPACE_VOS(OObject)
+class OSocket : public vos::ISocketTypes,
+ public vos::OReference,
+ public vos::OObject
{
- VOS_DECLARE_CLASSINFO(NAMESPACE_VOS(OSocket));
+ VOS_DECLARE_CLASSINFO(vos::OSocket);
protected:
typedef ORefObj<oslSocket> SockRef;
@@ -809,10 +809,10 @@ public:
/** A socket to send or receive a stream of data.
*/
-class OStreamSocket : public NAMESPACE_VOS(OSocket),
- public NAMESPACE_VOS(IStream)
+class OStreamSocket : public vos::OSocket,
+ public vos::IStream
{
- VOS_DECLARE_CLASSINFO(NAMESPACE_VOS(OStreamSocket));
+ VOS_DECLARE_CLASSINFO(vos::OStreamSocket);
public:
/** Creates an unattached socket. You must attach the socket to an oslSocket
@@ -952,9 +952,9 @@ protected:
/** A socket to accept incoming connections.
*/
-class OAcceptorSocket : public NAMESPACE_VOS(OSocket)
+class OAcceptorSocket : public vos::OSocket
{
- VOS_DECLARE_CLASSINFO(NAMESPACE_VOS(OAcceptorSocket));
+ VOS_DECLARE_CLASSINFO(vos::OAcceptorSocket);
public:
/** Creates a socket that can accept connections.
@@ -1014,9 +1014,9 @@ public:
/** A socket to initiate a conenction.
*/
-class OConnectorSocket : public NAMESPACE_VOS(OStreamSocket)
+class OConnectorSocket : public vos::OStreamSocket
{
- VOS_DECLARE_CLASSINFO(NAMESPACE_VOS(OConnectorSocket));
+ VOS_DECLARE_CLASSINFO(vos::OConnectorSocket);
public:
/** Creates a socket that can accept connections.
@@ -1050,9 +1050,9 @@ public:
/** A connectionless socket to send and receive datagrams.
*/
-class ODatagramSocket : public NAMESPACE_VOS(OSocket)
+class ODatagramSocket : public vos::OSocket
{
- VOS_DECLARE_CLASSINFO(NAMESPACE_VOS(ODatagramSocket));
+ VOS_DECLARE_CLASSINFO(vos::ODatagramSocket);
public:
/** Creates a datagram socket.
diff --git a/vos/inc/vos/stream.hxx b/vos/inc/vos/stream.hxx
index 5e25aa1d103a..6df13d5ddb28 100644
--- a/vos/inc/vos/stream.hxx
+++ b/vos/inc/vos/stream.hxx
@@ -37,7 +37,7 @@ namespace vos
/** Adds seeking capabilities to IStream
*/
-class IPositionableStream : public NAMESPACE_VOS(IStream)
+class IPositionableStream : public vos::IStream
{
public:
@@ -75,8 +75,8 @@ protected:
/** Implements IPositionableStream
*/
-class OStream : public NAMESPACE_VOS(OObject),
- public NAMESPACE_VOS(IPositionableStream)
+class OStream : public vos::OObject,
+ public vos::IPositionableStream
{
VOS_DECLARE_CLASSINFO(VOS_NAMESPACE(OStream, vos));
diff --git a/vos/inc/vos/thread.hxx b/vos/inc/vos/thread.hxx
index 16f64c0e0812..d84fdfdadccc 100644
--- a/vos/inc/vos/thread.hxx
+++ b/vos/inc/vos/thread.hxx
@@ -53,8 +53,8 @@ ThreadWorkerFunction_impl threadWorkerFunction_impl;
@version 1.0
*/
-class OThread : public NAMESPACE_VOS(IRunnable),
- public NAMESPACE_VOS(OObject)
+class OThread : public vos::IRunnable,
+ public vos::OObject
{
VOS_DECLARE_CLASSINFO(VOS_NAMESPACE(OThread, vos));
@@ -203,7 +203,7 @@ protected:
friend void threadWorkerFunction_impl(void *);
};
-class OThreadData : public NAMESPACE_VOS(OObject)
+class OThreadData : public vos::OObject
{
VOS_DECLARE_CLASSINFO(VOS_NAMESPACE(OThreadData, vos));
diff --git a/vos/source/pipe.cxx b/vos/source/pipe.cxx
index a7d8e655414d..777d1a76b36b 100644
--- a/vos/source/pipe.cxx
+++ b/vos/source/pipe.cxx
@@ -138,7 +138,7 @@ sal_Bool OPipe::create( const rtl::OUString& strName, TPipeOption Options )
/*****************************************************************************/
sal_Bool OPipe::create( const rtl::OUString& strName,
TPipeOption Options,
- const NAMESPACE_VOS(OSecurity)& rSecurity )
+ const vos::OSecurity& rSecurity )
{
// if this was a valid pipe, decrease reference
if ((m_pPipeRef) && (m_pPipeRef->release() == 0))
diff --git a/vos/source/process.cxx b/vos/source/process.cxx
index 71c8729d9023..59b1af3223d4 100644
--- a/vos/source/process.cxx
+++ b/vos/source/process.cxx
@@ -485,7 +485,7 @@ void OExtCommandLineImpl::init()
namespace
{
- struct lclMutex : public rtl::Static< NAMESPACE_VOS(OMutex), lclMutex > {};
+ struct lclMutex : public rtl::Static< vos::OMutex, lclMutex > {};
}
OExtCommandLineImpl* OExtCommandLine::pExtImpl=0;
diff --git a/vos/source/signal.cxx b/vos/source/signal.cxx
index 1f879f8b225c..eb1b65191918 100644
--- a/vos/source/signal.cxx
+++ b/vos/source/signal.cxx
@@ -35,7 +35,7 @@ using namespace vos;
oslSignalAction vos::signalHandlerFunction_impl(
void * pthis, oslSignalInfo * pInfo)
{
- NAMESPACE_VOS(OSignalHandler)* pThis= (NAMESPACE_VOS(OSignalHandler)*)pthis;
+ vos::OSignalHandler* pThis= (vos::OSignalHandler*)pthis;
return ((oslSignalAction)pThis->signal(pInfo));
}
diff --git a/vos/source/thread.cxx b/vos/source/thread.cxx
index 8b2c8826b753..94cdfbdf970b 100644
--- a/vos/source/thread.cxx
+++ b/vos/source/thread.cxx
@@ -34,7 +34,7 @@ using namespace vos;
void vos::threadWorkerFunction_impl(void * pthis)
{
- NAMESPACE_VOS(OThread)* pThis= (NAMESPACE_VOS(OThread)*)pthis;
+ vos::OThread* pThis= (vos::OThread*)pthis;
// call Handler-Function of OThread-derived class
pThis->run();
diff --git a/vos/source/timer.cxx b/vos/source/timer.cxx
index 1c1e2385b60c..a365415672e9 100644
--- a/vos/source/timer.cxx
+++ b/vos/source/timer.cxx
@@ -41,7 +41,7 @@
class OTimerManagerCleanup;
-class NAMESPACE_VOS(OTimerManager) : public NAMESPACE_VOS(OThread)
+class vos::OTimerManager : public vos::OThread
{
public:
@@ -53,13 +53,13 @@ public:
~OTimerManager();
/// register timer
- sal_Bool SAL_CALL registerTimer(NAMESPACE_VOS(OTimer)* pTimer);
+ sal_Bool SAL_CALL registerTimer(vos::OTimer* pTimer);
/// unregister timer
- sal_Bool SAL_CALL unregisterTimer(NAMESPACE_VOS(OTimer)* pTimer);
+ sal_Bool SAL_CALL unregisterTimer(vos::OTimer* pTimer);
/// lookup timer
- sal_Bool SAL_CALL lookupTimer(const NAMESPACE_VOS(OTimer)* pTimer);
+ sal_Bool SAL_CALL lookupTimer(const vos::OTimer* pTimer);
/// retrieves the "Singleton" TimerManager Instance
static OTimerManager* SAL_CALL getTimerManager();
@@ -77,17 +77,17 @@ protected:
virtual void SAL_CALL onTerminated();
// sorted-queue data
- NAMESPACE_VOS(OTimer)* m_pHead;
+ vos::OTimer* m_pHead;
// List Protection
- NAMESPACE_VOS(OMutex) m_Lock;
+ vos::OMutex m_Lock;
// Signal the insertion of a timer
- NAMESPACE_VOS(OCondition) m_notEmpty;
+ vos::OCondition m_notEmpty;
// Synchronize access to OTimerManager
- static NAMESPACE_VOS(OMutex) m_Access;
+ static vos::OMutex m_Access;
// "Singleton Pattern"
- static NAMESPACE_VOS(OTimerManager)* m_pManager;
+ static vos::OTimerManager* m_pManager;
friend class OTimerManagerCleanup;
@@ -267,8 +267,8 @@ TTimeValue OTimer::getRemainingTime() const
// Timer manager
//
-OMutex NAMESPACE_VOS(OTimerManager)::m_Access;
-OTimerManager* NAMESPACE_VOS(OTimerManager)::m_pManager=0;
+OMutex vos::OTimerManager::m_Access;
+OTimerManager* vos::OTimerManager::m_pManager=0;
OTimerManager::OTimerManager()
{