summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--automation/source/server/statemnt.cxx2
-rw-r--r--automation/source/testtool/objtest.cxx2
-rw-r--r--basegfx/source/polygon/b3dpolygontools.cxx167
-rw-r--r--bridges/prj/build.lst1
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx18
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_hppa/call.cxx145
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_hppa/cpp2uno.cxx728
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_hppa/except.cxx337
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_hppa/makefile.mk86
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_hppa/share.hxx102
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_hppa/uno2cpp.cxx524
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_ia64/uno2cpp.cxx27
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_m68k/cpp2uno.cxx2
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_x86-64/abi.cxx10
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_x86-64/abi.hxx2
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_x86-64/call.s3
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx28
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx25
-rw-r--r--bridges/source/cpp_uno/shared/vtablefactory.cxx10
-rw-r--r--configure.in22
-rw-r--r--desktop/source/app/app.cxx9
-rw-r--r--drawinglayer/inc/drawinglayer/geometry/viewinformation2d.hxx7
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/sceneprimitive2d.hxx20
-rw-r--r--drawinglayer/inc/drawinglayer/processor2d/hittestprocessor2d.hxx2
-rw-r--r--drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx2
-rw-r--r--drawinglayer/inc/drawinglayer/processor3d/cutfindprocessor3d.hxx86
-rw-r--r--drawinglayer/prj/d.lst2
-rw-r--r--drawinglayer/source/geometry/viewinformation2d.cxx40
-rw-r--r--drawinglayer/source/primitive2d/sceneprimitive2d.cxx148
-rw-r--r--drawinglayer/source/processor2d/contourextractor2d.cxx9
-rw-r--r--drawinglayer/source/processor2d/hittestprocessor2d.cxx158
-rw-r--r--drawinglayer/source/processor2d/vclpixelprocessor2d.cxx6
-rw-r--r--drawinglayer/source/processor2d/vclprocessor2d.cxx92
-rw-r--r--drawinglayer/source/processor3d/cutfindprocessor3d.cxx199
-rw-r--r--drawinglayer/source/processor3d/makefile.mk1
-rw-r--r--extensions/source/bibliography/bibload.cxx2
-rw-r--r--extensions/source/bibliography/bibview.hxx2
-rw-r--r--fpicker/source/unx/gnome/SalGtkPicker.cxx13
-rw-r--r--i18npool/source/search/makefile.mk6
-rw-r--r--i18npool/source/search/textsearch.cxx1
-rw-r--r--jvmfwk/plugins/sunmajor/pluginlib/vendorbase.hxx6
-rw-r--r--moz/makefile.mk4
-rw-r--r--nss/makefile.mk2
-rw-r--r--nss/nss.patch30
-rw-r--r--officecfg/registry/data/org/openoffice/Office/Common.xcu8
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/Common.xcs34
-rw-r--r--oox/inc/oox/core/namespaces.hxx104
-rw-r--r--oox/prj/d.lst1
-rw-r--r--oox/source/core/filterbase.cxx2
-rw-r--r--oox/source/docprop/docprophandler.cxx6
-rw-r--r--oox/source/shape/ShapeContextHandler.cxx12
-rw-r--r--oox/source/token/gennamespaces.pl65
-rw-r--r--oox/source/token/makefile.mk16
-rw-r--r--oox/source/token/namespaces.txt48
-rw-r--r--pyuno/source/loader/makefile.mk2
-rw-r--r--pyuno/source/module/makefile.mk2
-rw-r--r--pyuno/source/module/pyuno_gc.cxx10
-rw-r--r--sal/rtl/source/macro.hxx2
-rw-r--r--sal/typesconfig/typesconfig.c2
-rw-r--r--sc/source/core/data/cell.cxx6
-rw-r--r--sc/source/core/data/document.cxx6
-rw-r--r--sc/source/core/data/table1.cxx17
-rw-r--r--sc/source/core/data/table5.cxx6
-rw-r--r--sc/source/filter/excel/xename.cxx12
-rw-r--r--sc/source/ui/docshell/arealink.cxx4
-rw-r--r--sc/source/ui/docshell/docfunc.cxx6
-rw-r--r--sc/source/ui/docshell/docsh.cxx12
-rw-r--r--sc/source/ui/docshell/docsh5.cxx3
-rw-r--r--sc/source/ui/docshell/olinefun.cxx12
-rw-r--r--sc/source/ui/inc/privsplt.hxx1
-rw-r--r--scp2/source/ooo/file_library_ooo.scp3
-rw-r--r--scp2/source/ooo/makefile.mk3
-rw-r--r--sd/source/ui/dlg/ins_paste.cxx4
-rw-r--r--sd/source/ui/view/Outliner.cxx3
-rw-r--r--set_soenv.in11
-rw-r--r--setup_native/prj/d.lst5
-rw-r--r--setup_native/scripts/admin.pl203
-rw-r--r--setup_native/source/opensolaris/bundledextensions/README80
-rw-r--r--setup_native/source/opensolaris/bundledextensions/installed1
-rw-r--r--setup_native/source/opensolaris/bundledextensions/ooo_bundled_extensions.xml60
-rw-r--r--setup_native/source/opensolaris/bundledextensions/svc-ooo_bundled_extensions108
-rw-r--r--setup_native/tests/opensolaris/bundledextensions/send_ooo32
-rw-r--r--sfx2/source/dialog/dinfdlg.cxx14
-rw-r--r--sfx2/source/doc/SfxDocumentMetaData.cxx66
-rwxr-xr-x[-rw-r--r--]solenv/bin/build.pl412
-rw-r--r--solenv/bin/cws.pl90
-rw-r--r--solenv/inc/minor.mk6
-rw-r--r--solenv/inc/rules.mk18
-rw-r--r--solenv/inc/unx.mk4
-rw-r--r--solenv/inc/unxfbsdx.mk1
-rw-r--r--solenv/inc/unxlnga.mk2
-rw-r--r--solenv/inc/unxlnghppa.mk39
-rw-r--r--solenv/inc/unxlngm68k.mk2
-rw-r--r--solenv/inc/unxlngr.mk1
-rw-r--r--solenv/inc/unxlngx.mk1
-rw-r--r--svtools/inc/calendar.hxx1
-rw-r--r--svtools/inc/privsplt.hxx86
-rw-r--r--svtools/inc/sectctr.hxx154
-rw-r--r--svtools/inc/svtools/editbrowsebox.hxx1
-rw-r--r--svtools/inc/svtools/embedhlp.hxx10
-rw-r--r--svtools/inc/svtools/section.hxx104
-rw-r--r--svtools/inc/svtools/svmedit.hxx1
-rw-r--r--svtools/inc/svtools/valueset.hxx1
-rw-r--r--svtools/prj/d.lst3
-rw-r--r--svtools/source/contnr/ivctrl.cxx5
-rw-r--r--svtools/source/misc/embedhlp.cxx41
-rw-r--r--svx/inc/svx/fmmodel.hxx10
-rw-r--r--svx/inc/svx/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx13
-rw-r--r--svx/inc/svx/sdr/primitive2d/sdrolecontentprimitive2d.hxx7
-rw-r--r--svx/inc/svx/sdr/primitive2d/sdrrectangleprimitive2d.hxx9
-rw-r--r--svx/inc/svx/svddrgmt.hxx20
-rw-r--r--svx/inc/svx/svdfppt.hxx2
-rw-r--r--svx/source/cui/numpages.cxx92
-rw-r--r--svx/source/customshapes/EnhancedCustomShape2d.cxx58
-rw-r--r--svx/source/customshapes/EnhancedCustomShape3d.cxx12
-rw-r--r--svx/source/engine3d/helperhittest3d.cxx183
-rw-r--r--svx/source/form/fmcontrollayout.cxx205
-rw-r--r--svx/source/form/fmmodel.cxx39
-rw-r--r--svx/source/form/fmobj.cxx86
-rw-r--r--svx/source/form/formcontrolfactory.cxx107
-rw-r--r--svx/source/inc/fmcontrollayout.hxx16
-rw-r--r--svx/source/inc/fmobj.hxx8
-rw-r--r--svx/source/msfilter/msdffimp.cxx3
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx11
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrole2obj.cxx5
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrrectobj.cxx8
-rw-r--r--svx/source/sdr/overlay/overlaymanager.cxx16
-rw-r--r--svx/source/sdr/overlay/overlaymanagerbuffered.cxx3
-rw-r--r--svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx24
-rw-r--r--svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx7
-rw-r--r--svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx10
-rw-r--r--svx/source/svdraw/svddrgmt.cxx50
-rw-r--r--svx/source/svdraw/svdfppt.cxx11
-rw-r--r--sw/inc/docstat.hxx11
-rw-r--r--sw/inc/docufld.hxx2
-rw-r--r--sw/inc/swrect.hxx129
-rw-r--r--sw/inc/txatbase.hxx8
-rw-r--r--sw/inc/txtatr.hxx9
-rw-r--r--sw/inc/undobj.hxx5
-rw-r--r--sw/source/core/bastyp/swrect.cxx119
-rw-r--r--sw/source/core/bastyp/swregion.cxx2
-rw-r--r--sw/source/core/doc/doc.cxx50
-rw-r--r--sw/source/core/doc/docfmt.cxx71
-rw-r--r--sw/source/core/doc/docredln.cxx11
-rw-r--r--sw/source/core/doc/docsort.cxx26
-rw-r--r--sw/source/core/doc/docstat.cxx6
-rw-r--r--sw/source/core/docnode/ndtbl.cxx4
-rw-r--r--sw/source/core/docnode/swthreadmanager.cxx18
-rw-r--r--sw/source/core/fields/docufld.cxx14
-rw-r--r--sw/source/core/inc/swthreadmanager.hxx15
-rw-r--r--sw/source/core/layout/sectfrm.cxx4
-rw-r--r--sw/source/core/text/atrstck.cxx19
-rw-r--r--sw/source/core/text/itrcrsr.cxx25
-rw-r--r--sw/source/core/txtnode/fntcache.cxx4
-rw-r--r--sw/source/core/txtnode/ndtxt.cxx17
-rw-r--r--sw/source/core/txtnode/thints.cxx80
-rw-r--r--sw/source/core/txtnode/txtatr2.cxx8
-rw-r--r--sw/source/core/txtnode/txtedt.cxx1
-rw-r--r--sw/source/core/undo/rolbck.cxx2
-rw-r--r--sw/source/core/undo/undobj.cxx26
-rw-r--r--sw/source/core/undo/unredln.cxx51
-rw-r--r--sw/source/core/unocore/unocrsrhelper.cxx4
-rw-r--r--sw/source/core/unocore/unodraw.cxx5
-rw-r--r--sw/source/core/unocore/unoobj2.cxx6
-rw-r--r--sw/source/core/unocore/unoport.cxx4
-rw-r--r--sw/source/core/unocore/unoportenum.cxx1
-rw-r--r--sw/source/core/unocore/unotext.cxx54
-rw-r--r--sw/source/filter/basflt/shellio.cxx43
-rw-r--r--sw/source/filter/xml/xmlexp.cxx14
-rw-r--r--sw/source/filter/xml/xmlfmte.cxx6
-rw-r--r--sw/source/ui/fldui/fldfunc.cxx2
-rw-r--r--sw/source/ui/uno/unomod.cxx6
-rw-r--r--sw/source/ui/utlui/navipi.cxx4
-rw-r--r--testtools/com/sun/star/comp/bridge/TestComponent.java21
-rw-r--r--testtools/source/bridgetest/bridgetest.cxx22
-rw-r--r--testtools/source/bridgetest/cli/cli_cs_testobj.cs20
-rw-r--r--testtools/source/bridgetest/cli/cli_vb_testobj.vb2
-rw-r--r--testtools/source/bridgetest/cppobj.cxx9
-rw-r--r--testtools/source/bridgetest/idl/bridgetest.idl62
-rw-r--r--testtools/source/bridgetest/makefile.mk31
-rw-r--r--testtools/source/bridgetest/pyuno/makefile.mk15
-rw-r--r--toolkit/inc/toolkit/helper/property.hxx1
-rw-r--r--toolkit/source/awt/vclxwindow.cxx27
-rw-r--r--toolkit/source/awt/vclxwindows.cxx6
-rw-r--r--toolkit/source/controls/unocontrolmodel.cxx7
-rw-r--r--toolkit/source/helper/property.cxx15
-rw-r--r--tools/inc/tools/solar.h2
-rw-r--r--vcl/aqua/source/gdi/salgdi.cxx6
-rw-r--r--vcl/inc/vcl/bitmapex.hxx13
-rw-r--r--vcl/inc/vcl/button.hxx28
-rw-r--r--vcl/inc/vcl/controldata.hxx60
-rw-r--r--vcl/inc/vcl/ctrl.hxx52
-rw-r--r--vcl/inc/vcl/edit.hxx1
-rw-r--r--vcl/inc/vcl/fixbrd.hxx1
-rw-r--r--vcl/inc/vcl/fixed.hxx13
-rw-r--r--vcl/inc/vcl/group.hxx5
-rw-r--r--vcl/inc/vcl/ilstbox.hxx1
-rw-r--r--vcl/inc/vcl/outdev.hxx25
-rw-r--r--vcl/inc/vcl/slider.hxx1
-rw-r--r--vcl/inc/vcl/tabctrl.hxx3
-rwxr-xr-xvcl/inc/vcl/textlayout.hxx134
-rw-r--r--vcl/inc/vcl/window.hxx1
-rw-r--r--vcl/source/control/button.cxx175
-rw-r--r--vcl/source/control/combobox.cxx6
-rw-r--r--vcl/source/control/ctrl.cxx189
-rw-r--r--vcl/source/control/edit.cxx20
-rw-r--r--vcl/source/control/fixed.cxx108
-rw-r--r--vcl/source/control/group.cxx44
-rw-r--r--vcl/source/control/ilstbox.cxx40
-rw-r--r--vcl/source/control/lstbox.cxx6
-rw-r--r--vcl/source/control/spinfld.cxx4
-rw-r--r--vcl/source/control/tabctrl.cxx74
-rw-r--r--vcl/source/fontsubset/cff.cxx78
-rw-r--r--vcl/source/gdi/bitmapex.cxx73
-rw-r--r--vcl/source/gdi/makefile.mk82
-rw-r--r--vcl/source/gdi/outdev3.cxx182
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx5
-rwxr-xr-xvcl/source/gdi/sallayout.cxx8
-rwxr-xr-xvcl/source/gdi/textlayout.cxx384
-rw-r--r--vcl/source/window/status.cxx7
-rw-r--r--vcl/source/window/window.cxx2
-rw-r--r--vcl/unx/gtk/window/gtkframe.cxx16
-rw-r--r--vcl/unx/inc/plugins/gtk/gtkframe.hxx7
-rw-r--r--vcl/win/source/gdi/winlayout.cxx5
-rwxr-xr-xvcl/workben/outdevgrind.cxx12
-rw-r--r--writerfilter/inc/dmapper/DomainMapper.hxx8
-rw-r--r--writerfilter/inc/resourcemodel/TableData.hxx21
-rw-r--r--writerfilter/inc/resourcemodel/TableManager.hxx96
-rw-r--r--writerfilter/inc/resourcemodel/WW8ResourceModel.hxx8
-rw-r--r--writerfilter/qa/documents/docx/numbering/num-1.docxbin0 -> 11288 bytes
-rw-r--r--writerfilter/qa/documents/docx/pictures/Word DocumentOffice 2007 Format Sample6.docxbin0 -> 302738 bytes
-rw-r--r--writerfilter/qa/documents/docx/pictures/i97645 New example.docxbin0 -> 102969 bytes
-rw-r--r--writerfilter/qa/documents/docx/pictures/test-image.docxbin0 -> 24026 bytes
-rw-r--r--writerfilter/qa/documents/docx/pictures/test-image1.docxbin0 -> 61174 bytes
-rw-r--r--writerfilter/qa/documents/docx/pictures/test.docxbin0 -> 22007 bytes
-rw-r--r--writerfilter/qa/documents/docx/redlines/test-review-brk.docxbin0 -> 10621 bytes
-rw-r--r--writerfilter/qa/documents/docx/redlines/test-review-para.docxbin0 -> 10682 bytes
-rw-r--r--writerfilter/qa/documents/docx/redlines/test-review-stack.docxbin0 -> 10598 bytes
-rw-r--r--writerfilter/qa/documents/docx/tables/nested-tables.docxbin0 -> 11079 bytes
-rw-r--r--writerfilter/qa/documents/docx/tables/nested-tables2.docxbin0 -> 10521 bytes
-rw-r--r--writerfilter/qa/documents/docx/tables/nested-tables3.docxbin0 -> 11482 bytes
-rw-r--r--writerfilter/qa/documents/docx/tables/nested-tables4.docxbin0 -> 13956 bytes
-rw-r--r--writerfilter/qa/documents/docx/tables/nested-tables5.docxbin0 -> 10761 bytes
-rw-r--r--writerfilter/qa/documents/docx/tables/parentinvguid.docxbin0 -> 139481 bytes
-rw-r--r--writerfilter/qa/documents/docx/tables/table-styles.docxbin0 -> 13859 bytes
-rw-r--r--writerfilter/qa/documents/docx/tables/test-grid.docxbin0 -> 10978 bytes
-rw-r--r--writerfilter/qa/documents/docx/tables/test-paras.docxbin0 -> 13586 bytes
-rw-r--r--writerfilter/qa/documents/docx/tables/test-simple.docxbin0 -> 10527 bytes
-rw-r--r--writerfilter/qa/documents/docx/tables/two-tables.docxbin0 -> 10619 bytes
-rw-r--r--writerfilter/qa/documents/docx/tables/updatejpegprocessing.docxbin0 -> 24439 bytes
-rw-r--r--writerfilter/qa/documents/docx/test-page-format.docxbin0 -> 20846 bytes
-rw-r--r--writerfilter/source/dmapper/BorderHandler.cxx8
-rw-r--r--writerfilter/source/dmapper/BorderHandler.hxx1
-rw-r--r--writerfilter/source/dmapper/CellColorHandler.cxx5
-rw-r--r--writerfilter/source/dmapper/ConversionHelper.cxx7
-rw-r--r--writerfilter/source/dmapper/DomainMapper.cxx132
-rw-r--r--writerfilter/source/dmapper/DomainMapperTableHandler.cxx323
-rw-r--r--writerfilter/source/dmapper/DomainMapperTableHandler.hxx7
-rw-r--r--writerfilter/source/dmapper/DomainMapperTableManager.cxx299
-rw-r--r--writerfilter/source/dmapper/DomainMapperTableManager.hxx55
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx345
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.hxx69
-rw-r--r--writerfilter/source/dmapper/FontTable.cxx9
-rw-r--r--writerfilter/source/dmapper/FontTable.hxx3
-rw-r--r--writerfilter/source/dmapper/GraphicHelpers.cxx223
-rw-r--r--writerfilter/source/dmapper/GraphicHelpers.hxx48
-rw-r--r--writerfilter/source/dmapper/GraphicImport.cxx184
-rw-r--r--writerfilter/source/dmapper/GraphicImport.hxx11
-rw-r--r--writerfilter/source/dmapper/ListTable.cxx282
-rw-r--r--writerfilter/source/dmapper/ListTable.hxx2
-rw-r--r--writerfilter/source/dmapper/OLEHandler.cxx62
-rw-r--r--writerfilter/source/dmapper/OLEHandler.hxx9
-rw-r--r--writerfilter/source/dmapper/PageBordersHandler.cxx121
-rw-r--r--writerfilter/source/dmapper/PageBordersHandler.hxx57
-rw-r--r--writerfilter/source/dmapper/PropertyIds.cxx9
-rw-r--r--writerfilter/source/dmapper/PropertyIds.hxx6
-rw-r--r--writerfilter/source/dmapper/PropertyMap.cxx68
-rw-r--r--writerfilter/source/dmapper/PropertyMap.hxx16
-rw-r--r--writerfilter/source/dmapper/SettingsTable.cxx87
-rw-r--r--writerfilter/source/dmapper/SettingsTable.hxx46
-rw-r--r--writerfilter/source/dmapper/StyleSheetTable.cxx468
-rw-r--r--writerfilter/source/dmapper/StyleSheetTable.hxx46
-rw-r--r--writerfilter/source/dmapper/TDefTableHandler.cxx19
-rw-r--r--writerfilter/source/dmapper/TDefTableHandler.hxx4
-rw-r--r--writerfilter/source/dmapper/TablePropertiesHandler.cxx217
-rw-r--r--writerfilter/source/dmapper/TablePropertiesHandler.hxx83
-rw-r--r--writerfilter/source/dmapper/TblStylePrHandler.cxx69
-rw-r--r--writerfilter/source/dmapper/TblStylePrHandler.hxx64
-rw-r--r--writerfilter/source/dmapper/ThemeTable.hxx1
-rw-r--r--writerfilter/source/dmapper/makefile.mk9
-rw-r--r--writerfilter/source/ooxml/OOXMLFastContextHandler.cxx70
-rw-r--r--writerfilter/source/ooxml/OOXMLFastContextHandler.hxx8
-rw-r--r--writerfilter/source/ooxml/makefile.mk13
-rw-r--r--writerfilter/source/ooxml/model.xml141
-rw-r--r--writerfilter/source/ooxml/modelpreprocess.xsl2
-rw-r--r--writerfilter/source/ooxml/namespace_preprocess.pl65
-rw-r--r--writerfilter/source/ooxml/resourcestools.xsl96
-rw-r--r--writerfilter/source/resourcemodel/WW8Analyzer.cxx8
-rw-r--r--writerfilter/source/resourcemodel/WW8Analyzer.hxx2
-rw-r--r--writerfilter/source/resourcemodel/resourcemodel.cxx10
-rw-r--r--writerfilter/source/resourcemodel/resourcemodel.hxx3
-rw-r--r--writerperfect/prj/d.lst2
-rw-r--r--xmloff/source/script/XMLEventExport.cxx5
303 files changed, 10000 insertions, 3107 deletions
diff --git a/automation/source/server/statemnt.cxx b/automation/source/server/statemnt.cxx
index 4219d1d5b099..65be45907b90 100644
--- a/automation/source/server/statemnt.cxx
+++ b/automation/source/server/statemnt.cxx
@@ -4288,7 +4288,7 @@ BOOL StatementControl::HandleCommonMethods( Window *pControl )
Edit *pMyEd = new Edit(pDlg,WB_CENTER | WB_BORDER );
pMyEd->SetSizePixel(Size(100,30));
- pDlg->SetText(CUniString("Schließen"));
+ pDlg->SetText(UniString("Schließen", RTL_TEXTENCODING_ISO_8859_1));
pDlg->Show();
pMyEd->Show();
ULONG nTime = Time().GetTime();
diff --git a/automation/source/testtool/objtest.cxx b/automation/source/testtool/objtest.cxx
index e068530459a8..d3937963c155 100644
--- a/automation/source/testtool/objtest.cxx
+++ b/automation/source/testtool/objtest.cxx
@@ -521,6 +521,8 @@ void TestToolObj::LoadIniFile() // Laden der IniEinstellungen, die d
abGP.Append( "20" ); // Linux ia64
#elif defined LINUX && defined S390
abGP.Append( "21" ); // Linux S390
+#elif defined LINUX && defined HPPA
+ abGP.Append( "22" ); // Linux PA-RISC
#else
#error ("unknown platform. please request an ID for your platform on qa/dev")
#endif
diff --git a/basegfx/source/polygon/b3dpolygontools.cxx b/basegfx/source/polygon/b3dpolygontools.cxx
index ea303886dd88..52e0f0fcc36f 100644
--- a/basegfx/source/polygon/b3dpolygontools.cxx
+++ b/basegfx/source/polygon/b3dpolygontools.cxx
@@ -875,52 +875,147 @@ namespace basegfx
}
else
{
+ bool bRetval(false);
const B3DVector aPlaneNormal(rCandidate.getNormal());
if(!aPlaneNormal.equalZero())
{
- const double fAbsX(fabs(aPlaneNormal.getX()));
- const double fAbsY(fabs(aPlaneNormal.getY()));
- const double fAbsZ(fabs(aPlaneNormal.getZ()));
+ const sal_uInt32 nPointCount(rCandidate.count());
- if(fAbsX > fAbsY && fAbsX > fAbsZ)
+ if(nPointCount)
{
- // normal points mostly in X-Direction, use YZ-Polygon projection for check
- B3DHomMatrix aTrans;
+ B3DPoint aCurrentPoint(rCandidate.getB3DPoint(nPointCount - 1));
+ const double fAbsX(fabs(aPlaneNormal.getX()));
+ const double fAbsY(fabs(aPlaneNormal.getY()));
+ const double fAbsZ(fabs(aPlaneNormal.getZ()));
- aTrans.set(0, 0, 0.0);
- aTrans.set(0, 1, 1.0);
- aTrans.set(1, 1, 0.0);
- aTrans.set(1, 2, 1.0);
-
- const B2DPolygon aYZ(createB2DPolygonFromB3DPolygon(rCandidate, aTrans));
-
- return isInside(aYZ, B2DPoint(rPoint.getY(), rPoint.getZ()), bWithBorder);
- }
- else if(fAbsY > fAbsX && fAbsY > fAbsZ)
- {
- // normal points mostly in Y-Direction, use XZ-Polygon projection for check
- B3DHomMatrix aTrans;
-
- aTrans.set(1, 1, 0.0);
- aTrans.set(1, 2, 1.0);
-
- const B2DPolygon aXZ(createB2DPolygonFromB3DPolygon(rCandidate, aTrans));
-
- return isInside(aXZ, B2DPoint(rPoint.getX(), rPoint.getZ()), bWithBorder);
- }
- else
- {
- // normal points mostly in Z-Direction, use XY-Polygon projection for check
- B3DHomMatrix aTrans;
-
- const B2DPolygon aXY(createB2DPolygonFromB3DPolygon(rCandidate, aTrans));
-
- return isInside(aXY, B2DPoint(rPoint.getX(), rPoint.getY()), bWithBorder);
+ if(fAbsX > fAbsY && fAbsX > fAbsZ)
+ {
+ // normal points mostly in X-Direction, use YZ-Polygon projection for check
+ // x -> y, y -> z
+ for(sal_uInt32 a(0); a < nPointCount; a++)
+ {
+ const B3DPoint aPreviousPoint(aCurrentPoint);
+ aCurrentPoint = rCandidate.getB3DPoint(a);
+
+ // cross-over in Z?
+ const bool bCompZA(fTools::more(aPreviousPoint.getZ(), rPoint.getZ()));
+ const bool bCompZB(fTools::more(aCurrentPoint.getZ(), rPoint.getZ()));
+
+ if(bCompZA != bCompZB)
+ {
+ // cross-over in Y?
+ const bool bCompYA(fTools::more(aPreviousPoint.getY(), rPoint.getY()));
+ const bool bCompYB(fTools::more(aCurrentPoint.getY(), rPoint.getY()));
+
+ if(bCompYA == bCompYB)
+ {
+ if(bCompYA)
+ {
+ bRetval = !bRetval;
+ }
+ }
+ else
+ {
+ const double fCompare(
+ aCurrentPoint.getY() - (aCurrentPoint.getZ() - rPoint.getZ()) *
+ (aPreviousPoint.getY() - aCurrentPoint.getY()) /
+ (aPreviousPoint.getZ() - aCurrentPoint.getZ()));
+
+ if(fTools::more(fCompare, rPoint.getY()))
+ {
+ bRetval = !bRetval;
+ }
+ }
+ }
+ }
+ }
+ else if(fAbsY > fAbsX && fAbsY > fAbsZ)
+ {
+ // normal points mostly in Y-Direction, use XZ-Polygon projection for check
+ // x -> x, y -> z
+ for(sal_uInt32 a(0); a < nPointCount; a++)
+ {
+ const B3DPoint aPreviousPoint(aCurrentPoint);
+ aCurrentPoint = rCandidate.getB3DPoint(a);
+
+ // cross-over in Z?
+ const bool bCompZA(fTools::more(aPreviousPoint.getZ(), rPoint.getZ()));
+ const bool bCompZB(fTools::more(aCurrentPoint.getZ(), rPoint.getZ()));
+
+ if(bCompZA != bCompZB)
+ {
+ // cross-over in X?
+ const bool bCompXA(fTools::more(aPreviousPoint.getX(), rPoint.getX()));
+ const bool bCompXB(fTools::more(aCurrentPoint.getX(), rPoint.getX()));
+
+ if(bCompXA == bCompXB)
+ {
+ if(bCompXA)
+ {
+ bRetval = !bRetval;
+ }
+ }
+ else
+ {
+ const double fCompare(
+ aCurrentPoint.getX() - (aCurrentPoint.getZ() - rPoint.getZ()) *
+ (aPreviousPoint.getX() - aCurrentPoint.getX()) /
+ (aPreviousPoint.getZ() - aCurrentPoint.getZ()));
+
+ if(fTools::more(fCompare, rPoint.getX()))
+ {
+ bRetval = !bRetval;
+ }
+ }
+ }
+ }
+ }
+ else
+ {
+ // normal points mostly in Z-Direction, use XY-Polygon projection for check
+ // x -> x, y -> y
+ for(sal_uInt32 a(0); a < nPointCount; a++)
+ {
+ const B3DPoint aPreviousPoint(aCurrentPoint);
+ aCurrentPoint = rCandidate.getB3DPoint(a);
+
+ // cross-over in Y?
+ const bool bCompYA(fTools::more(aPreviousPoint.getY(), rPoint.getY()));
+ const bool bCompYB(fTools::more(aCurrentPoint.getY(), rPoint.getY()));
+
+ if(bCompYA != bCompYB)
+ {
+ // cross-over in X?
+ const bool bCompXA(fTools::more(aPreviousPoint.getX(), rPoint.getX()));
+ const bool bCompXB(fTools::more(aCurrentPoint.getX(), rPoint.getX()));
+
+ if(bCompXA == bCompXB)
+ {
+ if(bCompXA)
+ {
+ bRetval = !bRetval;
+ }
+ }
+ else
+ {
+ const double fCompare(
+ aCurrentPoint.getX() - (aCurrentPoint.getY() - rPoint.getY()) *
+ (aPreviousPoint.getX() - aCurrentPoint.getX()) /
+ (aPreviousPoint.getY() - aCurrentPoint.getY()));
+
+ if(fTools::more(fCompare, rPoint.getX()))
+ {
+ bRetval = !bRetval;
+ }
+ }
+ }
+ }
+ }
}
}
- return false;
+ return bRetval;
}
}
diff --git a/bridges/prj/build.lst b/bridges/prj/build.lst
index 430c49e8a849..c6e342520672 100644
--- a/bridges/prj/build.lst
+++ b/bridges/prj/build.lst
@@ -21,6 +21,7 @@ br bridges\source\cpp_uno\gcc3_linux_s390x nmake - u br_gccl3x br_unotypes br_i
br bridges\source\cpp_uno\gcc3_linux_sparc nmake - u br_gccl3s br_unotypes br_cppuno_shared br_inc NULL
br bridges\source\cpp_uno\gcc3_linux_arm nmake - u br_gccl3r br_unotypes NULL
br bridges\source\cpp_uno\gcc3_linux_ia64 nmake - u br_gccl3a br_unotypes NULL
+br bridges\source\cpp_uno\gcc3_linux_hppa nmake - u br_gccl3h br_unotypes NULL
br bridges\source\cpp_uno\gcc3_macosx_intel nmake - u br_gcc3macoxi br_cppuno_shared br_unotypes br_inc NULL
br bridges\source\cpp_uno\gcc3_macosx_powerpc nmake - u br_gcc3macoxp br_cppuno_shared br_unotypes br_inc NULL
br bridges\source\cpp_uno\cc50_solaris_sparc nmake - u br_cc50sols br_unotypes br_cppuno_shared br_inc NULL
diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx
index b365bdb8aee1..f59a16b2ac38 100644
--- a/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx
@@ -45,7 +45,17 @@
#include <stdio.h>
#include <string.h>
-#if defined(__ARM_EABI__) && !defined(__SOFTFP__)
+/*
+ * Based on http://gcc.gnu.org/PR41443
+ * References to __SOFTFP__ are incorrect for EABI; the __SOFTFP__ code
+ * should be used for *soft-float ABI* whether or not VFP is enabled,
+ * and __SOFTFP__ does specifically mean soft-float not soft-float ABI.
+ *
+ * Changing the conditionals to __SOFTFP__ || __ARM_EABI__ then
+ * -mfloat-abi=softfp should work. -mfloat-abi=hard won't; that would
+ * need both a new macro to identify the hard-VFP ABI.
+ */
+#if !defined(__ARM_EABI__) && !defined(__SOFTFP__)
#error Not Implemented
/*
@@ -103,7 +113,7 @@ namespace arm
void MapReturn(long r0, long r1, typelib_TypeClass eReturnType, void *pRegisterReturn)
{
-#ifndef __SOFTFP__
+#if !defined(__ARM_EABI__) && !defined(__SOFTFP__)
register float fret asm("f0");
register double dret asm("f0");
#endif
@@ -128,14 +138,14 @@ void MapReturn(long r0, long r1, typelib_TypeClass eReturnType, void *pRegisterR
*(unsigned char*)pRegisterReturn = (unsigned char)r0;
break;
case typelib_TypeClass_FLOAT:
-#ifdef __SOFTFP__
+#if defined(__ARM_EABI__) || defined(__SOFTFP__)
((long*)pRegisterReturn)[0] = r0;
#else
*(float*)pRegisterReturn = fret;
#endif
break;
case typelib_TypeClass_DOUBLE:
-#ifdef __SOFTFP__
+#if defined(__ARM_EABI__) || defined(__SOFTFP__)
((long*)pRegisterReturn)[1] = r1;
((long*)pRegisterReturn)[0] = r0;
#else
diff --git a/bridges/source/cpp_uno/gcc3_linux_hppa/call.cxx b/bridges/source/cpp_uno/gcc3_linux_hppa/call.cxx
new file mode 100644
index 000000000000..cd30e224bef5
--- /dev/null
+++ b/bridges/source/cpp_uno/gcc3_linux_hppa/call.cxx
@@ -0,0 +1,145 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: uno2cpp.cxx,v $
+ * $Revision: 1.2 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include <malloc.h>
+#include <rtl/alloc.h>
+
+#include <com/sun/star/uno/genfunc.hxx>
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include <uno/data.h>
+
+#include <bridges/cpp_uno/shared/bridge.hxx>
+#include <bridges/cpp_uno/shared/types.hxx>
+#include <bridges/cpp_uno/shared/unointerfaceproxy.hxx>
+#include <bridges/cpp_uno/shared/vtables.hxx>
+
+#include "share.hxx"
+
+#include <stdio.h>
+#include <string.h>
+
+using namespace ::rtl;
+using namespace ::com::sun::star::uno;
+
+void MapReturn(sal_uInt32 ret0, sal_uInt32 ret1, typelib_TypeDescription *pReturnTypeDescr, bool bRegisterReturn, sal_uInt32 *pRegisterReturn)
+{
+ register float fret asm("fr4");
+ register double dret asm("fr4");
+
+ switch (pReturnTypeDescr->eTypeClass)
+ {
+ case typelib_TypeClass_HYPER:
+ case typelib_TypeClass_UNSIGNED_HYPER:
+ pRegisterReturn[1] = ret1;
+ case typelib_TypeClass_LONG:
+ case typelib_TypeClass_UNSIGNED_LONG:
+ case typelib_TypeClass_ENUM:
+ case typelib_TypeClass_CHAR:
+ case typelib_TypeClass_SHORT:
+ case typelib_TypeClass_UNSIGNED_SHORT:
+ case typelib_TypeClass_BOOLEAN:
+ case typelib_TypeClass_BYTE:
+ pRegisterReturn[0] = ret0;
+ break;
+ case typelib_TypeClass_FLOAT:
+ *(float*)pRegisterReturn = fret;
+ break;
+ case typelib_TypeClass_DOUBLE:
+ *(double*)pRegisterReturn = dret;
+ break;
+ case typelib_TypeClass_STRUCT:
+ case typelib_TypeClass_EXCEPTION:
+ {
+ if (bRegisterReturn)
+ {
+ pRegisterReturn[0] = ret0;
+ pRegisterReturn[1] = ret1;
+ }
+ break;
+ }
+ default:
+ break;
+ }
+}
+
+//Moved callVirtual into this .cxx so that I can do this and get gcc to not
+//touch r28 without having to learn any more pa-risc assembly than is
+//strictly necessary
+register sal_uInt32 r28 __asm__("%r28");
+
+void callVirtualMethod(void * pThis, sal_uInt32 nVtableIndex,
+ void * pRegisterReturn, typelib_TypeDescription *pReturnTypeDescr, bool bRegisterReturn,
+ sal_uInt32 *pStack, sal_uInt32 nStack, sal_uInt32 *pGPR, double *pFPR) __attribute__((noinline));
+
+void callVirtualMethod(void * pThis, sal_uInt32 nVtableIndex,
+ void * pRegisterReturn, typelib_TypeDescription *pReturnTypeDescr, bool bRegisterReturn,
+ sal_uInt32 *pStack, sal_uInt32 nStack, sal_uInt32 *pGPR, double *pFPR)
+{
+ register sal_uInt32* sp __asm__("%r30");
+
+ sal_uInt32 pMethod = *((sal_uInt32*)pThis);
+ pMethod += 4 * nVtableIndex;
+ pMethod = *((sal_uInt32 *)pMethod);
+
+#ifdef CMC_DEBUG
+ fprintf(stderr, "this is %p\n", pGPR[0]);
+ for (int i = 0; i < hppa::MAX_GPR_REGS ; ++i)
+ fprintf(stderr, "normal reg %d is %d %x\n", i, pGPR[i], pGPR[i]);
+
+ for (int i = 0; i < hppa::MAX_SSE_REGS ; ++i)
+ fprintf(stderr, "float reg %d is %x\n", i, pFPR[i]);
+
+ for (int i = 0; i < nStack; ++i)
+ fprintf(stderr, "stack bytes are %x\n", pStack[i]);
+#endif
+
+ //Always reserve 4 slots, and align to 8 bytes
+ sal_uInt32 nStackBytes = ( ( nStack + 4 + 1 ) >> 1 ) * 8;
+ __builtin_alloca(nStackBytes);
+ sal_uInt32 *stack = sp-8;
+ int o = -5;
+ for (sal_uInt32 i = 0; i < nStack; ++i, --o)
+ stack[o] = pStack[i];
+
+ typedef int (* FunctionCall )( sal_uInt32, sal_uInt32, sal_uInt32, sal_uInt32 );
+ FunctionCall pFunc = (FunctionCall)pMethod;
+
+ asm volatile("fldd %0, %%fr4" : : "m"(pFPR[0]) : "fr4");
+ asm volatile("fldd %0, %%fr5" : : "m"(pFPR[1]) : "fr5");
+ asm volatile("fldd %0, %%fr6" : : "m"(pFPR[2]) : "fr6");
+ asm volatile("fldd %0, %%fr7" : : "m"(pFPR[3]) : "fr7");
+ asm volatile("ldw %0, %%r28" : : "m"(pRegisterReturn) : "r28");
+ (*pFunc)(pGPR[0], pGPR[1], pGPR[2], pGPR[3]);
+
+ register sal_uInt32 r29 __asm__("%r29");
+ MapReturn(r28, r29, pReturnTypeDescr, bRegisterReturn, (sal_uInt32*)pRegisterReturn);
+}
+
+/* vi:set tabstop=4 shiftwidth=4 expandtab: */
diff --git a/bridges/source/cpp_uno/gcc3_linux_hppa/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_hppa/cpp2uno.cxx
new file mode 100644
index 000000000000..a78d7694c798
--- /dev/null
+++ b/bridges/source/cpp_uno/gcc3_linux_hppa/cpp2uno.cxx
@@ -0,0 +1,728 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: cpp2uno.cxx,v $
+ * $Revision: 1.2 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include <malloc.h>
+#include <hash_map>
+
+#include <rtl/alloc.h>
+#include <osl/mutex.hxx>
+
+#include <com/sun/star/uno/genfunc.hxx>
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include <uno/data.h>
+#include <typelib/typedescription.hxx>
+
+#include "bridges/cpp_uno/shared/bridge.hxx"
+#include "bridges/cpp_uno/shared/cppinterfaceproxy.hxx"
+#include "bridges/cpp_uno/shared/types.hxx"
+#include "bridges/cpp_uno/shared/vtablefactory.hxx"
+
+#include "share.hxx"
+
+#include <dlfcn.h>
+
+
+using namespace ::osl;
+using namespace ::rtl;
+using namespace ::com::sun::star::uno;
+
+namespace
+{
+
+ static typelib_TypeClass cpp2uno_call(
+ bridges::cpp_uno::shared::CppInterfaceProxy* pThis,
+ const typelib_TypeDescription * pMemberTypeDescr,
+ typelib_TypeDescriptionReference * pReturnTypeRef,
+ sal_Int32 nParams, typelib_MethodParameter * pParams,
+ long r8, void ** gpreg, double *fpreg, void ** ovrflw,
+ sal_Int64 * pRegisterReturn /* space for register return */ )
+ {
+ void ** startovrflw;
+ int nregs = 0; //number of words passed in registers
+
+#ifdef CMC_DEBUG
+ fprintf(stderr, "cpp2uno_call\n");
+#endif
+ // return
+ typelib_TypeDescription * pReturnTypeDescr = 0;
+ if (pReturnTypeRef)
+ TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef );
+
+ void * pUnoReturn = 0;
+ // complex return ptr: if != 0 && != pUnoReturn, reconversion need
+ void * pCppReturn = 0;
+
+ if (pReturnTypeDescr)
+ {
+ if (hppa::isRegisterReturn(pReturnTypeRef))
+ {
+#ifdef CMC_DEBUG
+ fprintf(stderr, "simple return\n");
+#endif
+ pUnoReturn = pRegisterReturn; // direct way for simple types
+ }
+ else
+ {
+#ifdef CMC_DEBUG
+ fprintf(stderr, "complex return via r8\n");
+#endif
+ pCppReturn = (void *)r8;
+
+ pUnoReturn = (bridges::cpp_uno::shared::relatesToInterfaceType( pReturnTypeDescr )
+ ? alloca( pReturnTypeDescr->nSize )
+ : pCppReturn); // direct way
+ }
+ }
+ // pop this
+ gpreg++;
+ fpreg++;
+ nregs++;
+
+ // stack space
+ OSL_ENSURE( sizeof(void *) == sizeof(sal_Int32), "### unexpected size!" );
+ // parameters
+ void ** pUnoArgs = (void **)alloca( 4 * sizeof(void *) * nParams );
+ void ** pCppArgs = pUnoArgs + nParams;
+ // indizes of values this have to be converted (interface conversion
+ // cpp<=>uno)
+ sal_Int32 * pTempIndizes = (sal_Int32 *)(pUnoArgs + (2 * nParams));
+ // type descriptions for reconversions
+ typelib_TypeDescription ** ppTempParamTypeDescr =
+ (typelib_TypeDescription **)(pUnoArgs + (3 * nParams));
+
+ sal_Int32 nTempIndizes = 0;
+ bool bOverFlowUsed = false;
+ for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos )
+ {
+ const typelib_MethodParameter & rParam = pParams[nPos];
+ typelib_TypeDescription * pParamTypeDescr = 0;
+ TYPELIB_DANGER_GET( &pParamTypeDescr, rParam.pTypeRef );
+
+ if (!rParam.bOut && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr ))
+ {
+ switch (pParamTypeDescr->eTypeClass)
+ {
+ case typelib_TypeClass_DOUBLE:
+ if (nregs < hppa::MAX_WORDS_IN_REGS && (nregs & 1))
+ {
+ gpreg++;
+ fpreg++;
+ nregs++;
+ }
+ if (nregs < hppa::MAX_WORDS_IN_REGS-1)
+ {
+ fpreg++;
+ pCppArgs[nPos] = pUnoArgs[nPos] = fpreg;
+ gpreg+=2;
+ fpreg+=2;
+ nregs+=2;
+ }
+ else
+ {
+ if ((startovrflw-ovrflw) & 4)
+ ovrflw--;
+ pCppArgs[nPos] = pUnoArgs[nPos] = ((char*)ovrflw - 4);
+ bOverFlowUsed = true;
+ }
+ if (bOverFlowUsed) ovrflw-=2;
+ break;
+ case typelib_TypeClass_FLOAT:
+ if (nregs < hppa::MAX_WORDS_IN_REGS)
+ {
+ pCppArgs[nPos] = pUnoArgs[nPos] = fpreg;
+ gpreg++;
+ fpreg++;
+ nregs++;
+ }
+ else
+ {
+ pCppArgs[nPos] = pUnoArgs[nPos] = ovrflw;
+ bOverFlowUsed = true;
+ }
+ if (bOverFlowUsed) ovrflw--;
+ break;
+ case typelib_TypeClass_HYPER:
+ case typelib_TypeClass_UNSIGNED_HYPER:
+ if (nregs < hppa::MAX_WORDS_IN_REGS && (nregs & 1))
+ {
+ gpreg++;
+ fpreg++;
+ nregs++;
+ }
+ if (nregs < hppa::MAX_WORDS_IN_REGS-1)
+ {
+ pCppArgs[nPos] = pUnoArgs[nPos] = gpreg;
+ gpreg+=2;
+ fpreg+=2;
+ nregs+=2;
+ }
+ else
+ {
+ if ((startovrflw-ovrflw) & 4)
+ ovrflw--;
+ pCppArgs[nPos] = pUnoArgs[nPos] = ((char*)ovrflw - 4);
+ bOverFlowUsed = true;
+ }
+ if (bOverFlowUsed) ovrflw-=2;
+ break;
+ case typelib_TypeClass_BYTE:
+ case typelib_TypeClass_BOOLEAN:
+ if (nregs < hppa::MAX_WORDS_IN_REGS)
+ {
+ pCppArgs[nPos] = pUnoArgs[nPos] = ((char*)gpreg + 3);
+ gpreg++;
+ fpreg++;
+ nregs++;
+ }
+ else
+ {
+ pCppArgs[nPos] = pUnoArgs[nPos] = ((char*)ovrflw+3);
+ bOverFlowUsed = true;
+ }
+ if (bOverFlowUsed) ovrflw--;
+ break;
+ case typelib_TypeClass_CHAR:
+ case typelib_TypeClass_SHORT:
+ case typelib_TypeClass_UNSIGNED_SHORT:
+ if (nregs < hppa::MAX_WORDS_IN_REGS)
+ {
+ pCppArgs[nPos] = pUnoArgs[nPos] = ((char*)gpreg+2);
+ gpreg++;
+ fpreg++;
+ nregs++;
+ }
+ else
+ {
+ pCppArgs[nPos] = pUnoArgs[nPos] = ((char*)ovrflw+2);
+ bOverFlowUsed = true;
+ }
+ if (bOverFlowUsed) ovrflw--;
+ break;
+ case typelib_TypeClass_ENUM:
+ case typelib_TypeClass_LONG:
+ case typelib_TypeClass_UNSIGNED_LONG:
+ default:
+ if (nregs < hppa::MAX_WORDS_IN_REGS)
+ {
+ pCppArgs[nPos] = pUnoArgs[nPos] = gpreg;
+ gpreg++;
+ fpreg++;
+ nregs++;
+ }
+ else
+ {
+ pCppArgs[nPos] = pUnoArgs[nPos] = ovrflw;
+ bOverFlowUsed = true;
+ }
+ if (bOverFlowUsed) ovrflw--;
+ break;
+ }
+ // no longer needed
+ TYPELIB_DANGER_RELEASE( pParamTypeDescr );
+ }
+ else // ptr to complex value | ref
+ {
+ void *pCppStack;
+
+ if (nregs < hppa::MAX_WORDS_IN_REGS)
+ {
+ pCppArgs[nPos] = pCppStack = *gpreg;
+ gpreg++;
+ fpreg++;
+ nregs++;
+ }
+ else
+ {
+ pCppArgs[nPos] = pCppStack = *ovrflw;
+ bOverFlowUsed = true;
+ }
+ if (bOverFlowUsed) ovrflw--;
+
+ if (! rParam.bIn) // is pure out
+ {
+ // uno out is unconstructed mem!
+ pUnoArgs[nPos] = alloca( pParamTypeDescr->nSize );
+ pTempIndizes[nTempIndizes] = nPos;
+ // will be released at reconversion
+ ppTempParamTypeDescr[nTempIndizes++] = pParamTypeDescr;
+ }
+ // is in/inout
+ else if (bridges::cpp_uno::shared::relatesToInterfaceType(
+ pParamTypeDescr ))
+ {
+ uno_copyAndConvertData( pUnoArgs[nPos] = alloca( pParamTypeDescr->nSize ),
+ pCppStack, pParamTypeDescr,
+ pThis->getBridge()->getCpp2Uno() );
+ pTempIndizes[nTempIndizes] = nPos; // has to be reconverted
+ // will be released at reconversion
+ ppTempParamTypeDescr[nTempIndizes++] = pParamTypeDescr;
+ }
+ else // direct way
+ {
+ pUnoArgs[nPos] = pCppStack;
+ // no longer needed
+ TYPELIB_DANGER_RELEASE( pParamTypeDescr );
+ }
+ }
+ }
+
+ // ExceptionHolder
+ uno_Any aUnoExc; // Any will be constructed by callee
+ uno_Any * pUnoExc = &aUnoExc;
+
+#ifdef CMC_DEBUG
+ fprintf(stderr, "before dispatch\n");
+#endif
+ // invoke uno dispatch call
+ (*pThis->getUnoI()->pDispatcher)(
+ pThis->getUnoI(), pMemberTypeDescr, pUnoReturn, pUnoArgs, &pUnoExc );
+
+#ifdef CMC_DEBUG
+ fprintf(stderr, "after dispatch\n");
+#endif
+
+ // in case an exception occured...
+ if (pUnoExc)
+ {
+ // destruct temporary in/inout params
+ for ( ; nTempIndizes--; )
+ {
+ sal_Int32 nIndex = pTempIndizes[nTempIndizes];
+
+ if (pParams[nIndex].bIn) // is in/inout => was constructed
+ uno_destructData( pUnoArgs[nIndex],
+ ppTempParamTypeDescr[nTempIndizes], 0 );
+ TYPELIB_DANGER_RELEASE( ppTempParamTypeDescr[nTempIndizes] );
+ }
+ if (pReturnTypeDescr)
+ TYPELIB_DANGER_RELEASE( pReturnTypeDescr );
+
+ CPPU_CURRENT_NAMESPACE::raiseException( &aUnoExc,
+ pThis->getBridge()->getUno2Cpp() ); // has to destruct the any
+ // is here for dummy
+ return typelib_TypeClass_VOID;
+ }
+ else // else no exception occured...
+ {
+ // temporary params
+ for ( ; nTempIndizes--; )
+ {
+ sal_Int32 nIndex = pTempIndizes[nTempIndizes];
+ typelib_TypeDescription * pParamTypeDescr =
+ ppTempParamTypeDescr[nTempIndizes];
+
+ if (pParams[nIndex].bOut) // inout/out
+ {
+ // convert and assign
+ uno_destructData( pCppArgs[nIndex], pParamTypeDescr,
+ cpp_release );
+ uno_copyAndConvertData( pCppArgs[nIndex], pUnoArgs[nIndex],
+ pParamTypeDescr, pThis->getBridge()->getUno2Cpp() );
+ }
+ // destroy temp uno param
+ uno_destructData( pUnoArgs[nIndex], pParamTypeDescr, 0 );
+
+ TYPELIB_DANGER_RELEASE( pParamTypeDescr );
+ }
+ // return
+ if (pCppReturn) // has complex return
+ {
+ if (pUnoReturn != pCppReturn) // needs reconversion
+ {
+ uno_copyAndConvertData( pCppReturn, pUnoReturn,
+ pReturnTypeDescr, pThis->getBridge()->getUno2Cpp() );
+ // destroy temp uno return
+ uno_destructData( pUnoReturn, pReturnTypeDescr, 0 );
+ }
+ // complex return ptr is set to eax
+ *(void **)pRegisterReturn = pCppReturn;
+ }
+ if (pReturnTypeDescr)
+ {
+ typelib_TypeClass eRet =
+ (typelib_TypeClass)pReturnTypeDescr->eTypeClass;
+ TYPELIB_DANGER_RELEASE( pReturnTypeDescr );
+ return eRet;
+ }
+ else
+ return typelib_TypeClass_VOID;
+ }
+ }
+
+
+ //=====================================================================
+ static typelib_TypeClass cpp_mediate(
+ sal_Int32 nFunctionIndex, sal_Int32 nVtableOffset,
+ void ** gpreg, double* fpreg,
+ long sp, long r8,
+ sal_Int64 * pRegisterReturn /* space for register return */ )
+
+ {
+ void ** ovrflw = (void**)(sp);
+#ifdef CMC_DEBUG
+ fprintf(stderr, "cpp_mediate with\n");
+ fprintf(stderr, "%x %x\n", nFunctionIndex, nVtableOffset);
+ fprintf(stderr, "and %x %x\n", (long)(ovrflw[0]), (long)(ovrflw[-1]));
+ fprintf(stderr, "and %x %x\n", (long)(ovrflw[-2]), (long)(ovrflw[-3]));
+ fprintf(stderr, "and %x %x\n", (long)(ovrflw[-4]), (long)(ovrflw[-5]));
+ fprintf(stderr, "and %x %x\n", (long)(ovrflw[-6]), (long)(ovrflw[-7]));
+ fprintf(stderr, "and %x %x\n", (long)(ovrflw[-8]), (long)(ovrflw[-9]));
+ fprintf(stderr, "and %x %x\n", (long)(ovrflw[-10]), (long)(ovrflw[-11]));
+ fprintf(stderr, "and %x %x\n", (long)(ovrflw[-12]), (long)(ovrflw[-13]));
+ fprintf(stderr, "and %x %x\n", (long)(ovrflw[-14]), (long)(ovrflw[-15]));
+#endif
+ OSL_ENSURE( sizeof(sal_Int32)==sizeof(void *), "### unexpected!" );
+
+ // gpreg: [ret *], this, [other gpr params]
+ // fpreg: [fpr params]
+ // ovrflw: [gpr or fpr params (properly aligned)]
+
+ void * pThis;
+ if (nFunctionIndex & 0x80000000 )
+ {
+ nFunctionIndex &= 0x7fffffff;
+ pThis = gpreg[1];
+#ifdef CMC_DEBUG
+ fprintf(stderr, "pThis is gpreg[1]\n");
+#endif
+ }
+ else
+ {
+ pThis = gpreg[0];
+#ifdef CMC_DEBUG
+ fprintf(stderr, "pThis is gpreg[0]\n");
+#endif
+ }
+
+ pThis = static_cast< char * >(pThis) - nVtableOffset;
+
+ bridges::cpp_uno::shared::CppInterfaceProxy * pCppI =
+ bridges::cpp_uno::shared::CppInterfaceProxy::castInterfaceToProxy(
+ pThis);
+
+ typelib_InterfaceTypeDescription * pTypeDescr = pCppI->getTypeDescr();
+
+ OSL_ENSURE( nFunctionIndex < pTypeDescr->nMapFunctionIndexToMemberIndex,
+ "### illegal vtable index!" );
+ if (nFunctionIndex >= pTypeDescr->nMapFunctionIndexToMemberIndex)
+ {
+ throw RuntimeException(
+ OUString::createFromAscii("illegal vtable index!"),
+ (XInterface *)pCppI );
+ }
+
+ // determine called method
+ OSL_ENSURE( nFunctionIndex < pTypeDescr->nMapFunctionIndexToMemberIndex,
+ "### illegal vtable index!" );
+ sal_Int32 nMemberPos =
+ pTypeDescr->pMapFunctionIndexToMemberIndex[nFunctionIndex];
+ OSL_ENSURE( nMemberPos < pTypeDescr->nAllMembers,
+ "### illegal member index!" );
+
+ TypeDescription aMemberDescr( pTypeDescr->ppAllMembers[nMemberPos] );
+
+ typelib_TypeClass eRet;
+ switch (aMemberDescr.get()->eTypeClass)
+ {
+ case typelib_TypeClass_INTERFACE_ATTRIBUTE:
+ {
+ if (pTypeDescr->pMapMemberIndexToFunctionIndex[nMemberPos] ==
+ nFunctionIndex)
+ {
+ // is GET method
+ eRet = cpp2uno_call(
+ pCppI, aMemberDescr.get(),
+ ((typelib_InterfaceAttributeTypeDescription *)aMemberDescr.get())->pAttributeTypeRef,
+ 0, 0, // no params
+ r8, gpreg, fpreg, ovrflw, pRegisterReturn );
+ }
+ else
+ {
+ // is SET method
+ typelib_MethodParameter aParam;
+ aParam.pTypeRef =
+ ((typelib_InterfaceAttributeTypeDescription *)aMemberDescr.get())->pAttributeTypeRef;
+ aParam.bIn = sal_True;
+ aParam.bOut = sal_False;
+
+ eRet = cpp2uno_call(
+ pCppI, aMemberDescr.get(),
+ 0, // indicates void return
+ 1, &aParam,
+ r8, gpreg, fpreg, ovrflw, pRegisterReturn );
+ }
+ break;
+ }
+ case typelib_TypeClass_INTERFACE_METHOD:
+ {
+ // is METHOD
+ switch (nFunctionIndex)
+ {
+ case 1: // acquire()
+ pCppI->acquireProxy(); // non virtual call!
+ eRet = typelib_TypeClass_VOID;
+ break;
+ case 2: // release()
+ pCppI->releaseProxy(); // non virtual call!
+ eRet = typelib_TypeClass_VOID;
+ break;
+ case 0: // queryInterface() opt
+ {
+ typelib_TypeDescription * pTD = 0;
+ TYPELIB_DANGER_GET(&pTD,
+ reinterpret_cast<Type *>(gpreg[1])->getTypeLibType());
+ if (pTD)
+ {
+ XInterface * pInterface = 0;
+ (*pCppI->getBridge()->getCppEnv()->getRegisteredInterface)(
+ pCppI->getBridge()->getCppEnv(),
+ (void **)&pInterface, pCppI->getOid().pData,
+ (typelib_InterfaceTypeDescription *)pTD );
+
+ if (pInterface)
+ {
+ ::uno_any_construct(
+ reinterpret_cast< uno_Any * >( r8 ),
+ &pInterface, pTD, cpp_acquire );
+ pInterface->release();
+ TYPELIB_DANGER_RELEASE( pTD );
+ *(void **)pRegisterReturn = (void*)r8;
+ eRet = typelib_TypeClass_ANY;
+ break;
+ }
+ TYPELIB_DANGER_RELEASE( pTD );
+ }
+ } // else perform queryInterface()
+ default:
+ eRet = cpp2uno_call(
+ pCppI, aMemberDescr.get(),
+ ((typelib_InterfaceMethodTypeDescription *)aMemberDescr.get())->pReturnTypeRef,
+ ((typelib_InterfaceMethodTypeDescription *)aMemberDescr.get())->nParams,
+ ((typelib_InterfaceMethodTypeDescription *)aMemberDescr.get())->pParams,
+ r8, gpreg, fpreg, ovrflw, pRegisterReturn );
+ }
+ break;
+ }
+ default:
+ {
+ throw RuntimeException(
+ OUString::createFromAscii("no member description found!"),
+ (XInterface *)pCppI );
+ // is here for dummy
+ eRet = typelib_TypeClass_VOID;
+ }
+ }
+
+ return eRet;
+ }
+}
+
+//=======================================================================
+/**
+ * is called on incoming vtable calls
+ * (called by asm snippets)
+ */
+
+sal_Int64 cpp_vtable_call( sal_uInt32 in0, sal_uInt32 in1, sal_uInt32 in2, sal_uInt32 in3, sal_uInt32 firstonstack )
+{
+ register sal_Int32 r21 asm("r21");
+ register sal_Int32 r22 asm("r22");
+ register sal_Int32 r28 asm("r28");
+ sal_Int32 functionIndex = r21;
+ sal_Int32 vtableOffset = r22;
+ sal_Int32 r8 = r28;
+
+ long sp = (long)&firstonstack;
+
+ sal_uInt32 gpreg[hppa::MAX_GPR_REGS];
+ gpreg[0] = in0;
+ gpreg[1] = in1;
+ gpreg[2] = in2;
+ gpreg[3] = in3;
+
+ float fpreg[hppa::MAX_SSE_REGS]; //todo
+ register float f0 asm("fr4"); fpreg[0] = f0;
+ register float f1 asm("fr5"); fpreg[1] = f1;
+ register float f2 asm("fr6"); fpreg[2] = f2;
+ register float f3 asm("fr7"); fpreg[3] = f3;
+
+ double dpreg[hppa::MAX_SSE_REGS]; //todo
+ register double d0 asm("fr4"); dpreg[0] = d0;
+ register double d1 asm("fr5"); dpreg[1] = d1;
+ register double d2 asm("fr6"); dpreg[2] = d2;
+ register double d3 asm("fr7"); dpreg[3] = d3;
+
+
+#ifdef CMC_DEBUG
+ fprintf(stderr, "got to cpp_vtable_call with %x %x\n", functionIndex, vtableOffset);
+ for (int i = 0; i < hppa::MAX_GPR_REGS; ++i)
+ fprintf(stderr, "reg %d is %d %x\n", i, gpreg[i], gpreg[i]);
+ for (int i = 0; i < hppa::MAX_SSE_REGS; ++i)
+ fprintf(stderr, "float reg %d is %f %x\n", i, fpreg[i], ((long*)fpreg)[i]);
+ for (int i = 0; i < 4; ++i)
+ fprintf(stderr, "double reg %d is %f %llx\n", i, dpreg[i], ((long long*)dpreg)[i]);
+#endif
+
+ sal_Int64 nRegReturn;
+
+ typelib_TypeClass aType =
+ cpp_mediate( functionIndex, vtableOffset, (void**)gpreg, dpreg, sp, r8, &nRegReturn);
+
+ switch( aType )
+ {
+ case typelib_TypeClass_FLOAT:
+ f0 = (*((float*)&nRegReturn));
+ break;
+ case typelib_TypeClass_DOUBLE:
+ d0 = (*((double*)&nRegReturn));
+ break;
+ default:
+ break;
+ }
+
+ return nRegReturn;
+}
+
+
+namespace
+{
+ const int codeSnippetSize = 44;
+
+# define unldil(v) (((v & 0x7c) << 14) | ((v & 0x180) << 7) | ((v & 0x3) << 12) | ((v & 0xffe00) >> 8) | ((v & 0x100000) >> 20))
+# define L21(v) unldil(((unsigned long)(v) >> 11) & 0x1fffff) //Left 21 bits
+# define R11(v) (((unsigned long)(v) & 0x7FF) << 1) //Right 11 bits
+
+ unsigned char *codeSnippet(unsigned char* code, sal_Int32 functionIndex,
+ sal_Int32 vtableOffset, bool bHasHiddenParam)
+ {
+ if (bHasHiddenParam)
+ functionIndex |= 0x80000000;
+
+ unsigned char * p = code;
+ *(unsigned long*)&p[0] = 0xeaa00000; // b,l 0x8,r21
+ *(unsigned long*)&p[4] = 0xd6a01c1e; // depwi 0,31,2,r21
+ *(unsigned long*)&p[8] = 0x4aa10040; // ldw 32(r21),r1
+
+ *(unsigned long*)&p[12] = 0x22A00000 | L21(functionIndex); // ldil L<functionIndex>,r21
+ *(unsigned long*)&p[16] = 0x36B50000 | R11(functionIndex); // ldo R<functionIndex>,r21
+
+ *(unsigned long*)&p[20] = 0x22C00000 | L21(vtableOffset); // ldil L<vtableOffset>,r22
+ *(unsigned long*)&p[24] = 0x36D60000 | R11(vtableOffset); // ldo R<vtableOffset>,r22
+
+ *(unsigned long*)&p[28] = 0x0c201094; // ldw 0(r1),r20
+ *(unsigned long*)&p[32] = 0xea80c000; // bv r0(r20)
+ *(unsigned long*)&p[36] = 0x0c281093; // ldw 4(r1),r19
+ *(unsigned long*)&p[40] = ((unsigned long)(cpp_vtable_call) & ~2);
+
+ return code + codeSnippetSize;
+ }
+}
+
+struct bridges::cpp_uno::shared::VtableFactory::Slot { void * fn; };
+
+bridges::cpp_uno::shared::VtableFactory::Slot *
+bridges::cpp_uno::shared::VtableFactory::mapBlockToVtable(void * block)
+{
+ return static_cast< Slot * >(block) + 2;
+}
+
+sal_Size bridges::cpp_uno::shared::VtableFactory::getBlockSize(
+ sal_Int32 slotCount)
+{
+ return (slotCount + 2) * sizeof (Slot) + slotCount * codeSnippetSize;
+}
+
+bridges::cpp_uno::shared::VtableFactory::Slot *
+bridges::cpp_uno::shared::VtableFactory::initializeBlock(
+ void * block, sal_Int32 slotCount)
+{
+ Slot * slots = mapBlockToVtable(block);
+ slots[-2].fn = 0;
+ slots[-1].fn = 0;
+ return slots + slotCount;
+}
+
+unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions(
+ Slot ** slots, unsigned char * code, sal_PtrDiff writetoexecdiff,
+ typelib_InterfaceTypeDescription const * type, sal_Int32 functionOffset,
+ sal_Int32 functionCount, sal_Int32 vtableOffset)
+{
+ (*slots) -= functionCount;
+ Slot * s = *slots;
+ for (sal_Int32 i = 0; i < type->nMembers; ++i)
+ {
+ typelib_TypeDescription * member = 0;
+ TYPELIB_DANGER_GET(&member, type->ppMembers[i]);
+ OSL_ASSERT(member != 0);
+ switch (member->eTypeClass)
+ {
+ case typelib_TypeClass_INTERFACE_ATTRIBUTE:
+ // Getter:
+ (s++)->fn = code + writetoexecdiff;
+ code = codeSnippet(code, functionOffset++, vtableOffset, false);
+ // Setter:
+ if (!reinterpret_cast<
+ typelib_InterfaceAttributeTypeDescription * >(
+ member)->bReadOnly)
+ {
+ (s++)->fn = code + writetoexecdiff;
+ code = codeSnippet(code, functionOffset++, vtableOffset, false);
+ }
+ break;
+ case typelib_TypeClass_INTERFACE_METHOD:
+ {
+ (s++)->fn = code + writetoexecdiff;
+ code = codeSnippet(code, functionOffset++, vtableOffset, false);
+ break;
+ }
+ default:
+ OSL_ASSERT(false);
+ break;
+ }
+ TYPELIB_DANGER_RELEASE(member);
+ }
+ return code;
+}
+
+void bridges::cpp_uno::shared::VtableFactory::flushCode(
+ unsigned char const *beg, unsigned char const *end)
+{
+ void *p = (void*)((size_t)beg & ~31);
+ size_t stride = 32;
+ while (p < end)
+ {
+ asm volatile("fdc (%0)\n\t"
+ "sync\n\t"
+ "fic,m %1(%%sr4, %0)\n\t"
+ "sync" : "+r"(p) : "r"(stride) : "memory");
+ }
+}
+
+/* vi:set tabstop=4 shiftwidth=4 expandtab: */
diff --git a/bridges/source/cpp_uno/gcc3_linux_hppa/except.cxx b/bridges/source/cpp_uno/gcc3_linux_hppa/except.cxx
new file mode 100644
index 000000000000..8242bacaedc6
--- /dev/null
+++ b/bridges/source/cpp_uno/gcc3_linux_hppa/except.cxx
@@ -0,0 +1,337 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: except.cxx,v $
+ * $Revision: 1.2 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include <stdio.h>
+#include <string.h>
+#include <dlfcn.h>
+#include <cxxabi.h>
+#include <hash_map>
+
+#include <rtl/strbuf.hxx>
+#include <rtl/ustrbuf.hxx>
+#include <osl/diagnose.h>
+#include <osl/mutex.hxx>
+
+#include <com/sun/star/uno/genfunc.hxx>
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include <typelib/typedescription.hxx>
+#include <uno/any2.h>
+
+#include "share.hxx"
+
+
+using namespace ::std;
+using namespace ::osl;
+using namespace ::rtl;
+using namespace ::com::sun::star::uno;
+using namespace ::__cxxabiv1;
+
+extern sal_Int32 * pHack;
+extern sal_Int32 nHack;
+
+namespace CPPU_CURRENT_NAMESPACE
+{
+ void dummy_can_throw_anything( char const * )
+ {
+ }
+
+ //===================================================================
+ static OUString toUNOname( char const * p ) SAL_THROW( () )
+ {
+#if OSL_DEBUG_LEVEL > 1
+ char const * start = p;
+#endif
+
+ // example: N3com3sun4star4lang24IllegalArgumentExceptionE
+
+ OUStringBuffer buf( 64 );
+ OSL_ASSERT( 'N' == *p );
+ ++p; // skip N
+
+ while ('E' != *p)
+ {
+ // read chars count
+ long n = (*p++ - '0');
+ while ('0' <= *p && '9' >= *p)
+ {
+ n *= 10;
+ n += (*p++ - '0');
+ }
+ buf.appendAscii( p, n );
+ p += n;
+ if ('E' != *p)
+ buf.append( (sal_Unicode)'.' );
+ }
+
+#if OSL_DEBUG_LEVEL > 1
+ OUString ret( buf.makeStringAndClear() );
+ OString c_ret( OUStringToOString( ret, RTL_TEXTENCODING_ASCII_US ) );
+ fprintf( stderr, "> toUNOname(): %s => %s\n", start, c_ret.getStr() );
+ return ret;
+#else
+ return buf.makeStringAndClear();
+#endif
+ }
+
+ //=====================================================================
+ class RTTI
+ {
+ typedef hash_map< OUString, type_info *, OUStringHash > t_rtti_map;
+
+ Mutex m_mutex;
+ t_rtti_map m_rttis;
+ t_rtti_map m_generatedRttis;
+
+ void * m_hApp;
+
+ public:
+ RTTI() SAL_THROW( () );
+ ~RTTI() SAL_THROW( () );
+
+ type_info * getRTTI(typelib_CompoundTypeDescription *) SAL_THROW( () );
+ };
+ //____________________________________________________________________
+ RTTI::RTTI() SAL_THROW( () )
+ : m_hApp( dlopen( 0, RTLD_LAZY ) )
+ {
+ }
+ //____________________________________________________________________
+ RTTI::~RTTI() SAL_THROW( () )
+ {
+ dlclose( m_hApp );
+ }
+
+ //____________________________________________________________________
+ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THROW( () )
+ {
+ type_info * rtti;
+
+ OUString const & unoName = *(OUString const *)&pTypeDescr->aBase.pTypeName;
+
+ MutexGuard guard( m_mutex );
+ t_rtti_map::const_iterator iRttiFind( m_rttis.find( unoName ) );
+ if (iRttiFind == m_rttis.end())
+ {
+ // RTTI symbol
+ OStringBuffer buf( 64 );
+ buf.append( RTL_CONSTASCII_STRINGPARAM("_ZTIN") );
+ sal_Int32 index = 0;
+ do
+ {
+ OUString token( unoName.getToken( 0, '.', index ) );
+ buf.append( token.getLength() );
+ OString c_token( OUStringToOString( token, RTL_TEXTENCODING_ASCII_US ) );
+ buf.append( c_token );
+ }
+ while (index >= 0);
+ buf.append( 'E' );
+
+ OString symName( buf.makeStringAndClear() );
+ rtti = (type_info *)dlsym( m_hApp, symName.getStr() );
+
+ if (rtti)
+ {
+ pair< t_rtti_map::iterator, bool > insertion(
+ m_rttis.insert( t_rtti_map::value_type( unoName, rtti ) ) );
+ OSL_ENSURE( insertion.second, "### inserting new rtti failed?!" );
+ }
+ else
+ {
+ // try to lookup the symbol in the generated rtti map
+ t_rtti_map::const_iterator iFind( m_generatedRttis.find( unoName ) );
+ if (iFind == m_generatedRttis.end())
+ {
+ // we must generate it !
+ // symbol and rtti-name is nearly identical,
+ // the symbol is prefixed with _ZTI
+ char const * rttiName = symName.getStr() +4;
+#if OSL_DEBUG_LEVEL > 1
+ fprintf( stderr,"generated rtti for %s\n", rttiName );
+#endif
+ if (pTypeDescr->pBaseTypeDescription)
+ {
+ // ensure availability of base
+ type_info * base_rtti = getRTTI(
+ (typelib_CompoundTypeDescription *)pTypeDescr->pBaseTypeDescription );
+ rtti = new __si_class_type_info(
+ strdup( rttiName ), (__class_type_info *)base_rtti );
+ }
+ else
+ {
+ // this class has no base class
+ rtti = new __class_type_info( strdup( rttiName ) );
+ }
+
+ pair< t_rtti_map::iterator, bool > insertion(
+ m_generatedRttis.insert( t_rtti_map::value_type( unoName, rtti ) ) );
+ OSL_ENSURE( insertion.second, "### inserting new generated rtti failed?!" );
+ }
+ else // taking already generated rtti
+ {
+ rtti = iFind->second;
+ }
+ }
+ }
+ else
+ {
+ rtti = iRttiFind->second;
+ }
+
+ return rtti;
+ }
+
+ //------------------------------------------------------------------
+ static void deleteException( void * pExc )
+ {
+ __cxa_exception const * header = ((__cxa_exception const *)pExc - 1);
+ typelib_TypeDescription * pTD = 0;
+ OUString unoName( toUNOname( header->exceptionType->name() ) );
+ ::typelib_typedescription_getByName( &pTD, unoName.pData );
+ OSL_ENSURE( pTD, "### unknown exception type! leaving out destruction => leaking!!!" );
+ if (pTD)
+ {
+ ::uno_destructData( pExc, pTD, cpp_release );
+ ::typelib_typedescription_release( pTD );
+ }
+ }
+
+ //==================================================================
+ void raiseException( uno_Any * pUnoExc, uno_Mapping * pUno2Cpp )
+ {
+#if OSL_DEBUG_LEVEL > 1
+ OString cstr(
+ OUStringToOString(
+ *reinterpret_cast< OUString const * >( &pUnoExc->pType->pTypeName ),
+ RTL_TEXTENCODING_ASCII_US ) );
+ fprintf( stderr, "> uno exception occured: %s\n", cstr.getStr() );
+#endif
+ void * pCppExc;
+ type_info * rtti;
+
+ {
+ // construct cpp exception object
+ typelib_TypeDescription * pTypeDescr = 0;
+ TYPELIB_DANGER_GET( &pTypeDescr, pUnoExc->pType );
+ OSL_ASSERT( pTypeDescr );
+ if (! pTypeDescr)
+ {
+ throw RuntimeException(
+ OUString( RTL_CONSTASCII_USTRINGPARAM("cannot get typedescription for type ") ) +
+ *reinterpret_cast< OUString const * >( &pUnoExc->pType->pTypeName ),
+ Reference< XInterface >() );
+ }
+
+ pCppExc = __cxa_allocate_exception( pTypeDescr->nSize );
+ ::uno_copyAndConvertData( pCppExc, pUnoExc->pData, pTypeDescr, pUno2Cpp );
+
+ // destruct uno exception
+ ::uno_any_destruct( pUnoExc, 0 );
+ // avoiding locked counts
+ static RTTI * s_rtti = 0;
+ if (! s_rtti)
+ {
+ MutexGuard guard( Mutex::getGlobalMutex() );
+ if (! s_rtti)
+ {
+#ifdef LEAK_STATIC_DATA
+ s_rtti = new RTTI();
+#else
+ static RTTI rtti_data;
+ s_rtti = &rtti_data;
+#endif
+ }
+ }
+ rtti = (type_info *)s_rtti->getRTTI( (typelib_CompoundTypeDescription *) pTypeDescr );
+ TYPELIB_DANGER_RELEASE( pTypeDescr );
+ OSL_ENSURE( rtti, "### no rtti for throwing exception!" );
+ if (! rtti)
+ {
+ throw RuntimeException(
+ OUString( RTL_CONSTASCII_USTRINGPARAM("no rtti for type ") ) +
+ *reinterpret_cast< OUString const * >( &pUnoExc->pType->pTypeName ),
+ Reference< XInterface >() );
+ }
+ }
+
+
+ __cxa_throw( pCppExc, rtti, deleteException );
+ }
+
+ static void* getAdjustedPtr(__cxa_exception* header)
+ {
+ return header->adjustedPtr;
+ }
+
+ //===================================================================
+ void fillUnoException( __cxa_exception * header, uno_Any * pUnoExc, uno_Mapping * pCpp2Uno )
+ {
+ if (! header)
+ {
+ RuntimeException aRE(
+ OUString( RTL_CONSTASCII_USTRINGPARAM("no exception header!") ),
+ Reference< XInterface >() );
+ Type const & rType = ::getCppuType( &aRE );
+ uno_type_any_constructAndConvert( pUnoExc, &aRE, rType.getTypeLibType(), pCpp2Uno );
+#if OSL_DEBUG_LEVEL > 0
+ OString cstr( OUStringToOString( aRE.Message, RTL_TEXTENCODING_ASCII_US ) );
+ OSL_ENSURE( 0, cstr.getStr() );
+#endif
+ return;
+ }
+
+ typelib_TypeDescription * pExcTypeDescr = 0;
+ OUString unoName( toUNOname( header->exceptionType->name() ) );
+#if OSL_DEBUG_LEVEL > 1
+ OString cstr_unoName( OUStringToOString( unoName, RTL_TEXTENCODING_ASCII_US ) );
+ fprintf( stderr, "> c++ exception occured: %s\n", cstr_unoName.getStr() );
+#endif
+ typelib_typedescription_getByName( &pExcTypeDescr, unoName.pData );
+ if (0 == pExcTypeDescr)
+ {
+ RuntimeException aRE(
+ OUString( RTL_CONSTASCII_USTRINGPARAM("exception type not found: ") ) + unoName,
+ Reference< XInterface >() );
+ Type const & rType = ::getCppuType( &aRE );
+ uno_type_any_constructAndConvert( pUnoExc, &aRE, rType.getTypeLibType(), pCpp2Uno );
+#if OSL_DEBUG_LEVEL > 0
+ OString cstr( OUStringToOString( aRE.Message, RTL_TEXTENCODING_ASCII_US ) );
+ OSL_ENSURE( 0, cstr.getStr() );
+#endif
+ }
+ else
+ {
+ // construct uno exception any
+ uno_any_constructAndConvert( pUnoExc, getAdjustedPtr(header), pExcTypeDescr, pCpp2Uno );
+ typelib_typedescription_release( pExcTypeDescr );
+ }
+ }
+}
+
+/* vi:set tabstop=4 shiftwidth=4 expandtab: */
diff --git a/bridges/source/cpp_uno/gcc3_linux_hppa/makefile.mk b/bridges/source/cpp_uno/gcc3_linux_hppa/makefile.mk
new file mode 100644
index 000000000000..fcdcea72454f
--- /dev/null
+++ b/bridges/source/cpp_uno/gcc3_linux_hppa/makefile.mk
@@ -0,0 +1,86 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2008 by Sun Microsystems, Inc.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.2 $
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+PRJ=..$/..$/..
+
+PRJNAME=bridges
+TARGET=gcc3_uno
+LIBTARGET=no
+ENABLE_EXCEPTIONS=TRUE
+NO_BSYMBOLIC=TRUE
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : settings.mk
+
+# --- Files --------------------------------------------------------
+
+.IF "$(COM)$(OS)$(CPU)" == "GCCLINUXH"
+
+.IF "$(cppu_no_leak)" == ""
+CFLAGS += -DLEAK_STATIC_DATA
+.ENDIF
+
+CFLAGSCXX += -fno-omit-frame-pointer
+
+NOOPTFILES= \
+ $(SLO)$/cpp2uno.obj \
+ $(SLO)$/except.obj \
+ $(SLO)$/uno2cpp.obj \
+ $(SLO)$/call.obj
+
+CFLAGSNOOPT=-O0
+
+SLOFILES= \
+ $(SLO)$/cpp2uno.obj \
+ $(SLO)$/except.obj \
+ $(SLO)$/uno2cpp.obj \
+ $(SLO)$/call.obj
+
+SHL1TARGET= $(TARGET)
+
+SHL1DEF=$(MISC)$/$(SHL1TARGET).def
+SHL1IMPLIB=i$(TARGET)
+SHL1VERSIONMAP=..$/..$/bridge_exports.map
+SHL1RPATH=URELIB
+
+SHL1OBJS = $(SLOFILES)
+SHL1LIBS = $(SLB)$/cpp_uno_shared.lib
+
+SHL1STDLIBS= \
+ $(CPPULIB) \
+ $(SALLIB)
+
+.ENDIF
+
+# --- Targets ------------------------------------------------------
+
+.INCLUDE : target.mk
diff --git a/bridges/source/cpp_uno/gcc3_linux_hppa/share.hxx b/bridges/source/cpp_uno/gcc3_linux_hppa/share.hxx
new file mode 100644
index 000000000000..eedfdf75da8d
--- /dev/null
+++ b/bridges/source/cpp_uno/gcc3_linux_hppa/share.hxx
@@ -0,0 +1,102 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: share.hxx,v $
+ * $Revision: 1.2 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "uno/mapping.h"
+
+#include <typeinfo>
+#include <exception>
+#include <cstddef>
+
+namespace CPPU_CURRENT_NAMESPACE
+{
+
+ void dummy_can_throw_anything( char const * );
+
+
+// ----- following decl from libstdc++-v3/libsupc++/unwind-cxx.h and unwind.h
+
+struct _Unwind_Exception
+{
+ unsigned exception_class __attribute__((__mode__(__DI__)));
+ void * exception_cleanup;
+ unsigned private_1 __attribute__((__mode__(__word__)));
+ unsigned private_2 __attribute__((__mode__(__word__)));
+} __attribute__((__aligned__));
+
+struct __cxa_exception
+{
+ ::std::type_info *exceptionType;
+ void (*exceptionDestructor)(void *);
+
+ ::std::unexpected_handler unexpectedHandler;
+ ::std::terminate_handler terminateHandler;
+
+ __cxa_exception *nextException;
+
+ int handlerCount;
+
+ int handlerSwitchValue;
+ const unsigned char *actionRecord;
+ const unsigned char *languageSpecificData;
+ void *catchTemp;
+ void *adjustedPtr;
+
+ _Unwind_Exception unwindHeader;
+};
+
+extern "C" void *__cxa_allocate_exception(
+ std::size_t thrown_size ) throw();
+extern "C" void __cxa_throw (
+ void *thrown_exception, std::type_info *tinfo, void (*dest) (void *) ) __attribute__((noreturn));
+
+struct __cxa_eh_globals
+{
+ __cxa_exception *caughtExceptions;
+ unsigned int uncaughtExceptions;
+};
+extern "C" __cxa_eh_globals *__cxa_get_globals () throw();
+
+// -----
+
+//==================================================================================================
+void raiseException(
+ uno_Any * pUnoExc, uno_Mapping * pUno2Cpp );
+//==================================================================================================
+void fillUnoException(
+ __cxa_exception * header, uno_Any *, uno_Mapping * pCpp2Uno );
+}
+
+
+namespace hppa
+{
+ enum hppalimits { MAX_WORDS_IN_REGS = 4, MAX_GPR_REGS = 4, MAX_SSE_REGS = 4 };
+
+ bool isRegisterReturn( typelib_TypeDescriptionReference *pTypeRef );
+}
diff --git a/bridges/source/cpp_uno/gcc3_linux_hppa/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_hppa/uno2cpp.cxx
new file mode 100644
index 000000000000..a342568d5bf8
--- /dev/null
+++ b/bridges/source/cpp_uno/gcc3_linux_hppa/uno2cpp.cxx
@@ -0,0 +1,524 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: uno2cpp.cxx,v $
+ * $Revision: 1.2 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include <malloc.h>
+#include <rtl/alloc.h>
+
+#include <com/sun/star/uno/genfunc.hxx>
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include <uno/data.h>
+
+#include <bridges/cpp_uno/shared/bridge.hxx>
+#include <bridges/cpp_uno/shared/types.hxx>
+#include <bridges/cpp_uno/shared/unointerfaceproxy.hxx>
+#include <bridges/cpp_uno/shared/vtables.hxx>
+
+#include "share.hxx"
+
+#include <stdio.h>
+#include <string.h>
+
+using namespace ::rtl;
+using namespace ::com::sun::star::uno;
+
+void callVirtualMethod(void * pThis, sal_uInt32 nVtableIndex,
+ void * pRegisterReturn, typelib_TypeDescription *pReturnTypeDescr, bool bRegisterReturn,
+ sal_uInt32 *pStack, sal_uInt32 nStack, sal_uInt32 *pGPR, double *pFPR);
+
+#define INSERT_INT32( pSV, nr, pGPR, pDS, bOverFlow )\
+ if (nr < hppa::MAX_WORDS_IN_REGS) \
+ { \
+ pGPR[nr++] = *reinterpret_cast<sal_uInt32 *>( pSV ); \
+ } \
+ else \
+ bOverFlow = true; \
+ if (bOverFlow) \
+ *pDS++ = *reinterpret_cast<sal_uInt32 *>( pSV );
+
+#define INSERT_INT64( pSV, nr, pGPR, pDS, pStart, bOverFlow )\
+ if ( (nr < hppa::MAX_WORDS_IN_REGS) && (nr % 2) ) \
+ { \
+ ++nr; \
+ } \
+ if ( nr < hppa::MAX_WORDS_IN_REGS ) \
+ { \
+ pGPR[nr++] = *reinterpret_cast<sal_uInt32 *>( pSV ); \
+ pGPR[nr++] = *(reinterpret_cast<sal_uInt32 *>( pSV ) + 1); \
+ } \
+ else \
+ bOverFlow = true; \
+ if ( bOverFlow ) \
+ { \
+ if ( (pDS - pStart) % 2) \
+ ++pDS; \
+ *pDS++ = reinterpret_cast<sal_uInt32 *>( pSV )[1]; \
+ *pDS++ = reinterpret_cast<sal_uInt32 *>( pSV )[0]; \
+ }
+
+#define INSERT_FLOAT( pSV, nr, pFPR, pDS, bOverFlow ) \
+ if (nr < hppa::MAX_WORDS_IN_REGS) \
+ { \
+ sal_uInt32 *pDouble = (sal_uInt32 *)&(pFPR[nr++]); \
+ pDouble[0] = *reinterpret_cast<sal_uInt32 *>( pSV ); \
+ } \
+ else \
+ bOverFlow = true; \
+ if (bOverFlow) \
+ *pDS++ = *reinterpret_cast<sal_uInt32 *>( pSV );
+
+#define INSERT_DOUBLE( pSV, nr, pFPR, pDS, pStart, bOverFlow ) \
+ if ( (nr < hppa::MAX_WORDS_IN_REGS) && (nr % 2) ) \
+ { \
+ ++nr; \
+ } \
+ if ( nr < hppa::MAX_WORDS_IN_REGS ) \
+ { \
+ sal_uInt32 *pDouble = (sal_uInt32 *)&(pFPR[nr+1]); \
+ pDouble[0] = *reinterpret_cast<sal_uInt32 *>( pSV ); \
+ pDouble[1] = *(reinterpret_cast<sal_uInt32 *>( pSV ) + 1); \
+ nr+=2; \
+ } \
+ else \
+ bOverFlow = true; \
+ if ( bOverFlow ) \
+ { \
+ if ( (pDS - pStart) % 2) \
+ ++pDS; \
+ *pDS++ = reinterpret_cast<sal_uInt32 *>( pSV )[1]; \
+ *pDS++ = reinterpret_cast<sal_uInt32 *>( pSV )[0]; \
+ }
+
+#define INSERT_INT16( pSV, nr, pGPR, pDS, bOverFlow ) \
+ if ( nr < hppa::MAX_WORDS_IN_REGS ) \
+ pGPR[nr++] = *reinterpret_cast<sal_uInt16 *>( pSV ); \
+ else \
+ bOverFlow = true; \
+ if (bOverFlow) \
+ *pDS++ = *reinterpret_cast<sal_uInt16 *>( pSV );
+
+#define INSERT_INT8( pSV, nr, pGPR, pDS, bOverFlow ) \
+ if ( nr < hppa::MAX_WORDS_IN_REGS ) \
+ pGPR[nr++] = *reinterpret_cast<sal_uInt8 *>( pSV ); \
+ else \
+ bOverFlow = true; \
+ if (bOverFlow) \
+ *pDS++ = *reinterpret_cast<sal_uInt8 *>( pSV );
+
+namespace hppa
+{
+ bool is_complex_struct(const typelib_TypeDescription * type)
+ {
+ const typelib_CompoundTypeDescription * p
+ = reinterpret_cast< const typelib_CompoundTypeDescription * >(type);
+ for (sal_Int32 i = 0; i < p->nMembers; ++i)
+ {
+ if (p->ppTypeRefs[i]->eTypeClass == typelib_TypeClass_STRUCT ||
+ p->ppTypeRefs[i]->eTypeClass == typelib_TypeClass_EXCEPTION)
+ {
+ typelib_TypeDescription * t = 0;
+ TYPELIB_DANGER_GET(&t, p->ppTypeRefs[i]);
+ bool b = is_complex_struct(t);
+ TYPELIB_DANGER_RELEASE(t);
+ if (b) {
+ return true;
+ }
+ }
+ else if (!bridges::cpp_uno::shared::isSimpleType(p->ppTypeRefs[i]->eTypeClass))
+ return true;
+ }
+ if (p->pBaseTypeDescription != 0)
+ return is_complex_struct(&p->pBaseTypeDescription->aBase);
+ return false;
+ }
+
+ bool isRegisterReturn( typelib_TypeDescriptionReference *pTypeRef )
+ {
+ if (bridges::cpp_uno::shared::isSimpleType(pTypeRef))
+ return true;
+ else if (pTypeRef->eTypeClass == typelib_TypeClass_STRUCT || pTypeRef->eTypeClass == typelib_TypeClass_EXCEPTION)
+ {
+ typelib_TypeDescription * pTypeDescr = 0;
+ TYPELIB_DANGER_GET( &pTypeDescr, pTypeRef );
+
+ /* If the struct is larger than 8 bytes, then there is a buffer at r8 to stick the return value into */
+ bool bRet = pTypeDescr->nSize <= 8 && !is_complex_struct(pTypeDescr);
+
+ TYPELIB_DANGER_RELEASE( pTypeDescr );
+ return bRet;
+ }
+ return false;
+ }
+}
+
+
+namespace {
+//=======================================================================
+static void cpp_call(
+ bridges::cpp_uno::shared::UnoInterfaceProxy * pThis,
+ bridges::cpp_uno::shared::VtableSlot aVtableSlot,
+ typelib_TypeDescriptionReference * pReturnTypeRef,
+ sal_Int32 nParams, typelib_MethodParameter * pParams,
+ void * pUnoReturn, void * pUnoArgs[], uno_Any ** ppUnoExc )
+{
+ // max space for: [complex ret ptr], values|ptr ...
+ sal_uInt32 * pStack = (sal_uInt32 *)__builtin_alloca(
+ sizeof(sal_Int32) + ((nParams+2) * sizeof(sal_Int64)) );
+ sal_uInt32 * pStackStart = pStack;
+
+ sal_uInt32 pGPR[hppa::MAX_GPR_REGS];
+ double pFPR[hppa::MAX_SSE_REGS];
+ sal_uInt32 nRegs=0;
+
+ // return
+ typelib_TypeDescription * pReturnTypeDescr = 0;
+ TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef );
+ OSL_ENSURE( pReturnTypeDescr, "### expected return type description!" );
+
+ void * pCppReturn = 0; // if != 0 && != pUnoReturn, needs reconversion
+ bool bOverFlow = false;
+ bool bRegisterReturn = true;
+
+ if (pReturnTypeDescr)
+ {
+
+ bRegisterReturn = hppa::isRegisterReturn(pReturnTypeRef);
+ if (bRegisterReturn)
+ pCppReturn = pUnoReturn; // direct way for simple types
+ else
+ {
+ // complex return via ptr
+ pCppReturn = (bridges::cpp_uno::shared::relatesToInterfaceType( pReturnTypeDescr )
+ ? __builtin_alloca( pReturnTypeDescr->nSize )
+ : pUnoReturn); // direct way
+ }
+ }
+ // push this
+ void * pAdjustedThisPtr = reinterpret_cast< void ** >(pThis->getCppI())
+ + aVtableSlot.offset;
+ INSERT_INT32( &pAdjustedThisPtr, nRegs, pGPR, pStack, bOverFlow );
+
+ // stack space
+ OSL_ENSURE( sizeof(void *) == sizeof(sal_Int32), "### unexpected size!" );
+ // args
+ void ** pCppArgs = (void **)alloca( 3 * sizeof(void *) * nParams );
+ // indizes of values this have to be converted (interface conversion cpp<=>uno)
+ sal_Int32 * pTempIndizes = (sal_Int32 *)(pCppArgs + nParams);
+ // type descriptions for reconversions
+ typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pCppArgs + (2 * nParams));
+
+ sal_Int32 nTempIndizes = 0;
+
+ for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos )
+ {
+ const typelib_MethodParameter & rParam = pParams[nPos];
+ typelib_TypeDescription * pParamTypeDescr = 0;
+ TYPELIB_DANGER_GET( &pParamTypeDescr, rParam.pTypeRef );
+
+ if (!rParam.bOut && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr ))
+ {
+ uno_copyAndConvertData( pCppArgs[nPos] = alloca(8), pUnoArgs[nPos],
+ pParamTypeDescr, pThis->getBridge()->getUno2Cpp() );
+
+ switch (pParamTypeDescr->eTypeClass)
+ {
+ case typelib_TypeClass_HYPER:
+ case typelib_TypeClass_UNSIGNED_HYPER:
+#ifdef CMC_DEBUG
+ fprintf(stderr, "hyper is %llx\n", *((long long*)pCppArgs[nPos]));
+#endif
+ INSERT_INT64( pCppArgs[nPos], nRegs, pGPR, pStack, pStackStart, bOverFlow );
+ break;
+ case typelib_TypeClass_LONG:
+ case typelib_TypeClass_UNSIGNED_LONG:
+ case typelib_TypeClass_ENUM:
+#ifdef CMC_DEBUG
+ fprintf(stderr, "long is %x\n", pCppArgs[nPos]);
+#endif
+ INSERT_INT32( pCppArgs[nPos], nRegs, pGPR, pStack, bOverFlow );
+ break;
+ case typelib_TypeClass_SHORT:
+ case typelib_TypeClass_CHAR:
+ case typelib_TypeClass_UNSIGNED_SHORT:
+ INSERT_INT16( pCppArgs[nPos], nRegs, pGPR, pStack, bOverFlow );
+ break;
+ case typelib_TypeClass_BOOLEAN:
+ case typelib_TypeClass_BYTE:
+ INSERT_INT8( pCppArgs[nPos], nRegs, pGPR, pStack, bOverFlow );
+ break;
+ case typelib_TypeClass_FLOAT:
+ INSERT_FLOAT( pCppArgs[nPos], nRegs, pFPR, pStack, bOverFlow );
+ break;
+ case typelib_TypeClass_DOUBLE:
+ INSERT_DOUBLE( pCppArgs[nPos], nRegs, pFPR, pStack, pStackStart, bOverFlow );
+ break;
+ default:
+ break;
+ }
+ // no longer needed
+ TYPELIB_DANGER_RELEASE( pParamTypeDescr );
+ }
+ else // ptr to complex value | ref
+ {
+ if (! rParam.bIn) // is pure out
+ {
+ // cpp out is constructed mem, uno out is not!
+ uno_constructData(
+ pCppArgs[nPos] = alloca( pParamTypeDescr->nSize ),
+ pParamTypeDescr );
+ pTempIndizes[nTempIndizes] = nPos; // default constructed for cpp call
+ // will be released at reconversion
+ ppTempParamTypeDescr[nTempIndizes++] = pParamTypeDescr;
+ }
+ // is in/inout
+ else if (bridges::cpp_uno::shared::relatesToInterfaceType( pParamTypeDescr ))
+ {
+ uno_copyAndConvertData(
+ pCppArgs[nPos] = alloca( pParamTypeDescr->nSize ),
+ pUnoArgs[nPos], pParamTypeDescr, pThis->getBridge()->getUno2Cpp() );
+
+ pTempIndizes[nTempIndizes] = nPos; // has to be reconverted
+ // will be released at reconversion
+ ppTempParamTypeDescr[nTempIndizes++] = pParamTypeDescr;
+ }
+ else // direct way
+ {
+ pCppArgs[nPos] = pUnoArgs[nPos];
+ // no longer needed
+ TYPELIB_DANGER_RELEASE( pParamTypeDescr );
+ }
+ INSERT_INT32( &(pCppArgs[nPos]), nRegs, pGPR, pStack, bOverFlow );
+ }
+ }
+
+ try
+ {
+ callVirtualMethod(
+ pAdjustedThisPtr, aVtableSlot.index,
+ pCppReturn, pReturnTypeDescr, bRegisterReturn,
+ pStackStart,
+ (pStack - pStackStart), pGPR, pFPR);
+
+ // NO exception occured...
+ *ppUnoExc = 0;
+
+ // reconvert temporary params
+ for ( ; nTempIndizes--; )
+ {
+ sal_Int32 nIndex = pTempIndizes[nTempIndizes];
+ typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndizes];
+
+ if (pParams[nIndex].bIn)
+ {
+ if (pParams[nIndex].bOut) // inout
+ {
+ uno_destructData( pUnoArgs[nIndex], pParamTypeDescr, 0 ); // destroy uno value
+ uno_copyAndConvertData( pUnoArgs[nIndex], pCppArgs[nIndex], pParamTypeDescr,
+ pThis->getBridge()->getCpp2Uno() );
+ }
+ }
+ else // pure out
+ {
+ uno_copyAndConvertData( pUnoArgs[nIndex], pCppArgs[nIndex], pParamTypeDescr,
+ pThis->getBridge()->getCpp2Uno() );
+ }
+ // destroy temp cpp param => cpp: every param was constructed
+ uno_destructData( pCppArgs[nIndex], pParamTypeDescr, cpp_release );
+
+ TYPELIB_DANGER_RELEASE( pParamTypeDescr );
+ }
+ // return value
+ if (pCppReturn && pUnoReturn != pCppReturn)
+ {
+ uno_copyAndConvertData( pUnoReturn, pCppReturn, pReturnTypeDescr,
+ pThis->getBridge()->getCpp2Uno() );
+ uno_destructData( pCppReturn, pReturnTypeDescr, cpp_release );
+ }
+ }
+ catch (...)
+ {
+ // fill uno exception
+ fillUnoException( CPPU_CURRENT_NAMESPACE::__cxa_get_globals()->caughtExceptions, *ppUnoExc, pThis->getBridge()->getCpp2Uno() );
+
+ // temporary params
+ for ( ; nTempIndizes--; )
+ {
+ sal_Int32 nIndex = pTempIndizes[nTempIndizes];
+ // destroy temp cpp param => cpp: every param was constructed
+ uno_destructData( pCppArgs[nIndex], ppTempParamTypeDescr[nTempIndizes], cpp_release );
+ TYPELIB_DANGER_RELEASE( ppTempParamTypeDescr[nTempIndizes] );
+ }
+
+ // return type
+ if (pReturnTypeDescr)
+ TYPELIB_DANGER_RELEASE( pReturnTypeDescr );
+ }
+}
+}
+
+namespace bridges { namespace cpp_uno { namespace shared {
+
+void unoInterfaceProxyDispatch(
+ uno_Interface * pUnoI, const typelib_TypeDescription * pMemberDescr,
+ void * pReturn, void * pArgs[], uno_Any ** ppException )
+{
+ // is my surrogate
+ bridges::cpp_uno::shared::UnoInterfaceProxy * pThis
+ = static_cast< bridges::cpp_uno::shared::UnoInterfaceProxy * >(pUnoI);
+#if OSL_DEBUG_LEVEL > 0
+ typelib_InterfaceTypeDescription * pTypeDescr = pThis->pTypeDescr;
+#endif
+
+ switch (pMemberDescr->eTypeClass)
+ {
+ case typelib_TypeClass_INTERFACE_ATTRIBUTE:
+ {
+#if OSL_DEBUG_LEVEL > 0
+ // determine vtable call index
+ sal_Int32 nMemberPos = ((typelib_InterfaceMemberTypeDescription *)pMemberDescr)->nPosition;
+ OSL_ENSURE( nMemberPos < pTypeDescr->nAllMembers, "### member pos out of range!" );
+#endif
+
+ VtableSlot aVtableSlot(
+ getVtableSlot(
+ reinterpret_cast<typelib_InterfaceAttributeTypeDescription const *>
+ (pMemberDescr)));
+
+ if (pReturn)
+ {
+ // dependent dispatch
+ cpp_call(
+ pThis, aVtableSlot,
+ ((typelib_InterfaceAttributeTypeDescription *)pMemberDescr)->pAttributeTypeRef,
+ 0, 0, // no params
+ pReturn, pArgs, ppException );
+ }
+ else
+ {
+ // is SET
+ typelib_MethodParameter aParam;
+ aParam.pTypeRef =
+ ((typelib_InterfaceAttributeTypeDescription *)pMemberDescr)->pAttributeTypeRef;
+ aParam.bIn = sal_True;
+ aParam.bOut = sal_False;
+
+ typelib_TypeDescriptionReference * pReturnTypeRef = 0;
+ OUString aVoidName( RTL_CONSTASCII_USTRINGPARAM("void") );
+ typelib_typedescriptionreference_new(
+ &pReturnTypeRef, typelib_TypeClass_VOID, aVoidName.pData );
+
+ // dependent dispatch
+ aVtableSlot.index += 1;
+ cpp_call(
+ pThis, aVtableSlot, // get, then set method
+ pReturnTypeRef,
+ 1, &aParam,
+ pReturn, pArgs, ppException );
+
+ typelib_typedescriptionreference_release( pReturnTypeRef );
+ }
+
+ break;
+ }
+ case typelib_TypeClass_INTERFACE_METHOD:
+ {
+#if OSL_DEBUG_LEVEL > 0
+ // determine vtable call index
+ sal_Int32 nMemberPos = ((typelib_InterfaceMemberTypeDescription *)pMemberDescr)->nPosition;
+ OSL_ENSURE( nMemberPos < pTypeDescr->nAllMembers, "### member pos out of range!" );
+#endif
+
+ VtableSlot aVtableSlot(
+ getVtableSlot(
+ reinterpret_cast<typelib_InterfaceMethodTypeDescription const *>
+ (pMemberDescr)));
+
+ switch (aVtableSlot.index)
+ {
+ // standard calls
+ case 1: // acquire uno interface
+ (*pUnoI->acquire)( pUnoI );
+ *ppException = 0;
+ break;
+ case 2: // release uno interface
+ (*pUnoI->release)( pUnoI );
+ *ppException = 0;
+ break;
+ case 0: // queryInterface() opt
+ {
+ typelib_TypeDescription * pTD = 0;
+ TYPELIB_DANGER_GET( &pTD, reinterpret_cast< Type * >( pArgs[0] )->getTypeLibType() );
+ if (pTD)
+ {
+ uno_Interface * pInterface = 0;
+ (*pThis->getBridge()->getUnoEnv()->getRegisteredInterface)(
+ pThis->getBridge()->getUnoEnv(),
+ (void **)&pInterface, pThis->oid.pData, (typelib_InterfaceTypeDescription *)pTD );
+
+ if (pInterface)
+ {
+ ::uno_any_construct(
+ reinterpret_cast< uno_Any * >( pReturn ),
+ &pInterface, pTD, 0 );
+ (*pInterface->release)( pInterface );
+ TYPELIB_DANGER_RELEASE( pTD );
+ *ppException = 0;
+ break;
+ }
+
+ TYPELIB_DANGER_RELEASE( pTD );
+ }
+ } // else perform queryInterface()
+ default:
+ // dependent dispatch
+ cpp_call(
+ pThis, aVtableSlot,
+ ((typelib_InterfaceMethodTypeDescription *)pMemberDescr)->pReturnTypeRef,
+ ((typelib_InterfaceMethodTypeDescription *)pMemberDescr)->nParams,
+ ((typelib_InterfaceMethodTypeDescription *)pMemberDescr)->pParams,
+ pReturn, pArgs, ppException );
+ }
+ break;
+ }
+ default:
+ {
+ ::com::sun::star::uno::RuntimeException aExc(
+ OUString( RTL_CONSTASCII_USTRINGPARAM("illegal member type description!") ),
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >() );
+
+ Type const & rExcType = ::getCppuType( &aExc );
+ // binary identical null reference
+ ::uno_type_any_construct( *ppException, &aExc, rExcType.getTypeLibType(), 0 );
+ }
+ }
+}
+
+} } }
+
+/* vi:set tabstop=4 shiftwidth=4 expandtab: */
diff --git a/bridges/source/cpp_uno/gcc3_linux_ia64/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_ia64/uno2cpp.cxx
index 35b16d882632..d1d98f222738 100644
--- a/bridges/source/cpp_uno/gcc3_linux_ia64/uno2cpp.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_ia64/uno2cpp.cxx
@@ -91,6 +91,31 @@ void MapReturn(const ia64::RegReturn &rRet, double dret, typelib_TypeDescription
namespace ia64
{
+ bool is_complex_struct(const typelib_TypeDescription * type)
+ {
+ const typelib_CompoundTypeDescription * p
+ = reinterpret_cast< const typelib_CompoundTypeDescription * >(type);
+ for (sal_Int32 i = 0; i < p->nMembers; ++i)
+ {
+ if (p->ppTypeRefs[i]->eTypeClass == typelib_TypeClass_STRUCT ||
+ p->ppTypeRefs[i]->eTypeClass == typelib_TypeClass_EXCEPTION)
+ {
+ typelib_TypeDescription * t = 0;
+ TYPELIB_DANGER_GET(&t, p->ppTypeRefs[i]);
+ bool b = is_complex_struct(t);
+ TYPELIB_DANGER_RELEASE(t);
+ if (b) {
+ return true;
+ }
+ }
+ else if (!bridges::cpp_uno::shared::isSimpleType(p->ppTypeRefs[i]->eTypeClass))
+ return true;
+ }
+ if (p->pBaseTypeDescription != 0)
+ return is_complex_struct(&p->pBaseTypeDescription->aBase);
+ return false;
+ }
+
bool is_complex_struct( typelib_TypeDescriptionReference *pTypeRef )
{
if (pTypeRef->eTypeClass == typelib_TypeClass_STRUCT || pTypeRef->eTypeClass == typelib_TypeClass_EXCEPTION)
@@ -98,7 +123,7 @@ namespace ia64
typelib_TypeDescription * pTypeDescr = 0;
TYPELIB_DANGER_GET( &pTypeDescr, pTypeRef );
- bool bRet = bridges::cpp_uno::shared::relatesToInterfaceType( pTypeDescr );
+ bool bRet = is_complex_struct( pTypeDescr );
TYPELIB_DANGER_RELEASE( pTypeDescr );
return bRet;
diff --git a/bridges/source/cpp_uno/gcc3_linux_m68k/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_m68k/cpp2uno.cxx
index 0581b52f0c8d..1d63ebde491f 100644
--- a/bridges/source/cpp_uno/gcc3_linux_m68k/cpp2uno.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_m68k/cpp2uno.cxx
@@ -256,7 +256,7 @@ namespace
// destroy temp uno return
uno_destructData( pUnoReturn, pReturnTypeDescr, 0 );
}
- // complex return ptr is set to eax
+ // complex return ptr is set to return reg
*(void **)pRegisterReturn = pCppReturn;
}
if (pReturnTypeDescr)
diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.cxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.cxx
index 2aeaf9423859..ad0faa1a01aa 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.cxx
@@ -229,6 +229,7 @@ classify_argument( typelib_TypeDescriptionReference *pTypeRef, enum x86_64_reg_c
for ( sal_Int32 nMember = 0; nMember < pStruct->nMembers; ++nMember )
{
typelib_TypeDescriptionReference *pTypeInStruct = pStruct->ppTypeRefs[ nMember ];
+ rByteOffset = pStruct->pMemberOffsets[ nMember ];
int num = classify_argument( pTypeInStruct, subclasses, rByteOffset );
@@ -243,9 +244,6 @@ classify_argument( typelib_TypeDescriptionReference *pTypeRef, enum x86_64_reg_c
int pos = rByteOffset / 8;
classes[i + pos] = merge_classes( subclasses[i], classes[i + pos] );
}
-
- if ( pTypeInStruct->eTypeClass != typelib_TypeClass_STRUCT )
- rByteOffset = pStruct->pMemberOffsets[ nMember ];
}
TYPELIB_DANGER_RELEASE( pTypeDescr );
@@ -332,7 +330,7 @@ bool x86_64::return_in_hidden_param( typelib_TypeDescriptionReference *pTypeRef
return examine_argument( pTypeRef, true, g, s ) == 0;
}
-void x86_64::fill_struct( typelib_TypeDescriptionReference *pTypeRef, void * const *pGPR, void * const *pSSE, void *pStruct )
+void x86_64::fill_struct( typelib_TypeDescriptionReference *pTypeRef, const sal_uInt64 *pGPR, const double *pSSE, void *pStruct )
{
enum x86_64_reg_class classes[MAX_CLASSES];
int offset = 0;
@@ -346,12 +344,12 @@ void x86_64::fill_struct( typelib_TypeDescriptionReference *pTypeRef, void * con
{
case X86_64_INTEGER_CLASS:
case X86_64_INTEGERSI_CLASS:
- *pStructAlign++ = *reinterpret_cast<sal_uInt64 *>( *pGPR++ );
+ *pStructAlign++ = *pGPR++;
break;
case X86_64_SSE_CLASS:
case X86_64_SSESF_CLASS:
case X86_64_SSEDF_CLASS:
- *pStructAlign++ = *reinterpret_cast<sal_uInt64 *>( *pSSE++ );
+ *pStructAlign++ = *reinterpret_cast<const sal_uInt64 *>( pSSE++ );
break;
default:
break;
diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.hxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.hxx
index 5fffe680c28a..c5b7d94d2e01 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.hxx
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.hxx
@@ -63,7 +63,7 @@ bool examine_argument( typelib_TypeDescriptionReference *pTypeRef, bool bInRetur
*/
bool return_in_hidden_param( typelib_TypeDescriptionReference *pTypeRef );
-void fill_struct( typelib_TypeDescriptionReference *pTypeRef, void * const *pGPR, void * const *pSSE, void *pStruct );
+void fill_struct( typelib_TypeDescriptionReference *pTypeRef, const sal_uInt64* pGPR, const double* pSSE, void *pStruct );
} // namespace x86_64
diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/call.s b/bridges/source/cpp_uno/gcc3_linux_x86-64/call.s
index 736230705d5a..a0572ef61641 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/call.s
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/call.s
@@ -43,6 +43,9 @@ privateSnippetExecutor:
je .Lfloat
movq -144(%rbp), %rax # Return value (int case)
+ movq -136(%rbp), %rdx # Return value (int case)
+ movq -144(%rbp), %xmm0 # Return value (int case)
+ movq -136(%rbp), %xmm1 # Return value (int case)
jmp .Lfinish
.Lfloat:
movlpd -144(%rbp), %xmm0 # Return value (float/double case)
diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx
index 5fb2bd7e12a3..c1e938446e77 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx
@@ -126,7 +126,10 @@ static typelib_TypeClass cpp2uno_call(
int nUsedGPR = 0;
int nUsedSSE = 0;
- bool bFitsRegisters = x86_64::examine_argument( rParam.pTypeRef, false, nUsedGPR, nUsedSSE );
+#if OSL_DEBUG_LEVEL > 1
+ bool bFitsRegisters =
+#endif
+ x86_64::examine_argument( rParam.pTypeRef, false, nUsedGPR, nUsedSSE );
if ( !rParam.bOut && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr ) ) // value
{
// Simple types must fit exactly one register on x86_64
@@ -159,28 +162,7 @@ static typelib_TypeClass cpp2uno_call(
else // struct <= 16 bytes || ptr to complex value || ref
{
void *pCppStack;
- char pTmpStruct[16];
-
- if ( bFitsRegisters && !rParam.bOut &&
- ( pParamTypeDescr->eTypeClass == typelib_TypeClass_STRUCT ||
- pParamTypeDescr->eTypeClass == typelib_TypeClass_EXCEPTION ) )
- {
- if ( ( nr_gpr + nUsedGPR <= x86_64::MAX_GPR_REGS ) && ( nr_fpr + nUsedSSE <= x86_64::MAX_SSE_REGS ) )
- {
- x86_64::fill_struct( rParam.pTypeRef, gpreg, fpreg, pTmpStruct );
-#if OSL_DEBUG_LEVEL > 1
- fprintf( stderr, "nUsedGPR == %d, nUsedSSE == %d, pTmpStruct[0] == 0x%x, pTmpStruct[1] == 0x%x, **gpreg == 0x%lx\n",
- nUsedGPR, nUsedSSE, pTmpStruct[0], pTmpStruct[1], *(sal_uInt64*)*gpreg );
-#endif
-
- pCppArgs[nPos] = pCppStack = reinterpret_cast<void *>( pTmpStruct );
- gpreg += nUsedGPR;
- fpreg += nUsedSSE;
- }
- else
- pCppArgs[nPos] = pCppStack = *ovrflw++;
- }
- else if ( nr_gpr < x86_64::MAX_GPR_REGS )
+ if ( nr_gpr < x86_64::MAX_GPR_REGS )
{
pCppArgs[nPos] = pCppStack = *gpreg++;
nr_gpr++;
diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx
index 7199794409a8..23c40121afb7 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx
@@ -53,13 +53,13 @@ using namespace ::com::sun::star::uno;
//==================================================================================================
static void callVirtualMethod(void * pThis, sal_uInt32 nVtableIndex,
- void * pRegisterReturn, typelib_TypeDescription * pReturnTypeDescr, bool bSimpleReturn,
+ void * pRegisterReturn, typelib_TypeDescriptionReference * pReturnTypeRef, bool bSimpleReturn,
sal_uInt64 *pStack, sal_uInt32 nStack,
sal_uInt64 *pGPR, sal_uInt32 nGPR,
double *pFPR, sal_uInt32 nFPR) __attribute__((noinline));
static void callVirtualMethod(void * pThis, sal_uInt32 nVtableIndex,
- void * pRegisterReturn, typelib_TypeDescription * pReturnTypeDescr, bool bSimpleReturn,
+ void * pRegisterReturn, typelib_TypeDescriptionReference * pReturnTypeRef, bool bSimpleReturn,
sal_uInt64 *pStack, sal_uInt32 nStack,
sal_uInt64 *pGPR, sal_uInt32 nGPR,
double *pFPR, sal_uInt32 nFPR)
@@ -113,6 +113,7 @@ static void callVirtualMethod(void * pThis, sal_uInt32 nVtableIndex,
sal_uInt64 rax;
sal_uInt64 rdx;
double xmm0;
+ double xmm1;
asm volatile (
@@ -147,13 +148,14 @@ static void callVirtualMethod(void * pThis, sal_uInt32 nVtableIndex,
"movq %%rax, %4\n\t"
"movq %%rdx, %5\n\t"
"movsd %%xmm0, %6\n\t"
+ "movsd %%xmm1, %7\n\t"
:
: "m" ( pMethod ), "m" ( pGPR ), "m" ( pFPR ), "m" ( nFPR ),
- "m" ( rax ), "m" ( rdx ), "m" ( xmm0 )
+ "m" ( rax ), "m" ( rdx ), "m" ( xmm0 ), "m" ( xmm1 )
: "rax", "rdi", "rsi", "rdx", "rcx", "r8", "r9", "r11"
);
- switch (pReturnTypeDescr->eTypeClass)
+ switch (pReturnTypeRef->eTypeClass)
{
case typelib_TypeClass_HYPER:
case typelib_TypeClass_UNSIGNED_HYPER:
@@ -179,12 +181,17 @@ static void callVirtualMethod(void * pThis, sal_uInt32 nVtableIndex,
break;
default:
{
- sal_Int32 const nRetSize = pReturnTypeDescr->nSize;
+ sal_Int32 const nRetSize = pReturnTypeRef->pType->nSize;
if (bSimpleReturn && nRetSize <= 16 && nRetSize > 0)
{
- if (nRetSize > 8)
- static_cast<sal_uInt64 *>(pRegisterReturn)[1] = rdx;
- static_cast<sal_uInt64 *>(pRegisterReturn)[0] = rax;
+ sal_uInt64 longs[2];
+ longs[0] = rax;
+ longs[1] = rdx;
+
+ double doubles[2];
+ doubles[0] = xmm0;
+ doubles[1] = xmm1;
+ x86_64::fill_struct( pReturnTypeRef, &longs[0], &doubles[0], pRegisterReturn);
}
break;
}
@@ -367,7 +374,7 @@ static void cpp_call(
{
callVirtualMethod(
pAdjustedThisPtr, aVtableSlot.index,
- pCppReturn, pReturnTypeDescr, bSimpleReturn,
+ pCppReturn, pReturnTypeRef, bSimpleReturn,
pStackStart, ( pStack - pStackStart ),
pGPR, nGPR,
pFPR, nFPR );
diff --git a/bridges/source/cpp_uno/shared/vtablefactory.cxx b/bridges/source/cpp_uno/shared/vtablefactory.cxx
index 34e5f9635974..3784f3959594 100644
--- a/bridges/source/cpp_uno/shared/vtablefactory.cxx
+++ b/bridges/source/cpp_uno/shared/vtablefactory.cxx
@@ -272,7 +272,7 @@ bool VtableFactory::createBlock(Block &block, sal_Int32 slotCount) const
char *tmpfname = new char[aTmpName.getLength()+1];
strncpy(tmpfname, aTmpName.getStr(), aTmpName.getLength()+1);
if ((block.fd = mkstemp(tmpfname)) == -1)
- perror("creation of executable memory area failed");
+ perror("creation of executable memory area failed");
if (block.fd == -1)
{
delete[] tmpfname;
@@ -280,7 +280,13 @@ bool VtableFactory::createBlock(Block &block, sal_Int32 slotCount) const
}
unlink(tmpfname);
delete[] tmpfname;
- ftruncate(block.fd, block.size);
+ if (ftruncate(block.fd, block.size) == -1)
+ {
+ perror("truncation of executable memory area failed");
+ close(block.fd);
+ block.fd = -1;
+ break;
+ }
block.start = mmap(NULL, block.size, PROT_READ | PROT_WRITE, MAP_SHARED, block.fd, 0);
if (block.start== MAP_FAILED) {
block.start = 0;
diff --git a/configure.in b/configure.in
index e41fa919e752..37fa42796ce9 100644
--- a/configure.in
+++ b/configure.in
@@ -130,7 +130,7 @@ AC_ARG_ENABLE(evolution2,
],,)
AC_ARG_WITH(system-stdlibs,
[ --with-system-stdlibs use libstdc++/libgcc_s already on system
-],,checkforprelink=yes)
+],,checkforstdlibproblems=yes)
AC_ARG_WITH(system-mspack,
[ --with-system-mspack use libmspack already installed on system
],,)
@@ -2709,7 +2709,7 @@ _ACEOF
if ! $CXX $CXXFLAGS $CPPFLAGS -fpic -S visibility.cxx 2>/dev/null > /dev/null; then
gccvisbroken=yes
else
- if $EGREP -q '@PLT|\$stub' visibility.s; then
+ if $EGREP -q '@PLT|\$stub|\(PLT\)' visibility.s; then
gccvisbroken=no;
else
gccvisbroken=yes;
@@ -2889,8 +2889,8 @@ if test "$SOLAR_JAVA" != ""; then
_jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED s/[[-A-Za-z]]*//`
_jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
- if test "$_jdk_ver" -lt 10600; then
- AC_MSG_ERROR([IBM JDK is too old, you need at least 1.6])
+ if test "$_jdk_ver" -lt 10500; then
+ AC_MSG_ERROR([IBM JDK is too old, you need at least 1.5])
fi
AC_MSG_RESULT([checked (IBM JDK $_jdk)])
@@ -3581,10 +3581,16 @@ dnl ===================================================================
dnl Check for prelinked libgcc_s.so.1
dnl ===================================================================
if test -z "$with_system_stdlibs" -a -z "$with_system_libs"; then
- if test -n "$checkforprelink" -a -f /etc/rpm/macros.prelink; then
- with_system_stdlibs=yes
- AC_MSG_WARN([prelinked libgcc_s.so.1, enabling --with-system-stdlibs, use --without-system-stdlibs to override])
- echo "prelinked libgcc_s.so.1, enabling --with-system-stdlibs, use --without-system-stdlibs to override" >> warn
+ if test -n "$checkforstdlibproblems"; then
+ if test -f /etc/rpm/macros.prelink; then
+ with_system_stdlibs=yes
+ AC_MSG_WARN([prelinked libgcc_s.so.1, enabling --with-system-stdlibs, use --without-system-stdlibs to override])
+ echo "prelinked libgcc_s.so.1, enabling --with-system-stdlibs, use --without-system-stdlibs to override" >> warn
+ elif test "$GCC" = "yes" -a ! -e `$CC -print-file-name=libgcc_s.so.1`; then
+ with_system_stdlibs=yes
+ AC_MSG_WARN([platform doesn't have a libgcc_s.so.1, enabling --with-system-stdlibs, use --without-system-stdlibs to override])
+ echo "platform doesn't have a libgcc_s.so.1, enabling --with-system-stdlibs, use --without-system-stdlibs to override" >> warn
+ fi
fi
fi
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index d4e0a91c1d17..efc689b54ff8 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -1738,8 +1738,15 @@ sal_Bool Desktop::InitializeQuickstartMode( Reference< XMultiServiceFactory >& r
aSeq[0] <<= bQuickstart;
// Try to instanciate quickstart service. This service is not mandatory, so
- // do nothing if service is not available.
+ // do nothing if service is not available
+
+ // #i105753# the following if was invented for performance
+ // unfortunately this broke the QUARTZ behavior which is to always run
+ // in quickstart mode since Mac applications do not usually quit
+ // when the last document closes
+ #ifndef QUARTZ
if ( bQuickstart )
+ #endif
{
Reference < XComponent > xQuickstart( rSMgr->createInstanceWithArguments(
DEFINE_CONST_UNICODE( "com.sun.star.office.Quickstart" ), aSeq ),
diff --git a/drawinglayer/inc/drawinglayer/geometry/viewinformation2d.hxx b/drawinglayer/inc/drawinglayer/geometry/viewinformation2d.hxx
index 94a5623a2a77..0a87b268c8b1 100644
--- a/drawinglayer/inc/drawinglayer/geometry/viewinformation2d.hxx
+++ b/drawinglayer/inc/drawinglayer/geometry/viewinformation2d.hxx
@@ -149,6 +149,13 @@ namespace drawinglayer
/// On-demand prepared Viewport in discrete units for convenience
const basegfx::B2DRange& getDiscreteViewport() const;
+ /** support reduced DisplayQuality, PropertyName is 'ReducedDisplayQuality'. This
+ is used e.g. to allow to lower display quality for OverlayPrimitives and
+ may lead to simpler decompositions in the local create2DDecomposition
+ implementations of the primitives
+ */
+ bool getReducedDisplayQuality() const;
+
/** Get the uno::Sequence< beans::PropertyValue > which contains all ViewInformation
Use this call if You need to extract all contained ViewInformation. The ones
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/sceneprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/sceneprimitive2d.hxx
index d7fbfd4deaee..8ffc9a332e5c 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/sceneprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/sceneprimitive2d.hxx
@@ -41,6 +41,7 @@
#include <drawinglayer/attribute/sdrattribute3d.hxx>
#include <drawinglayer/geometry/viewinformation3d.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <vcl/bitmapex.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -70,9 +71,13 @@ namespace drawinglayer
double mfOldDiscreteSizeY;
basegfx::B2DRange maOldUnitVisiblePart;
+ // the last created BitmapEx, e.g. for fast HitTest. This does not really need
+ // memory since BitmapEx is internally RefCounted
+ BitmapEx maOldRenderedBitmap;
+
// private helpers
bool impGetShadow3D(const geometry::ViewInformation2D& rViewInformation) const;
- void calculateDsicreteSizes(
+ void calculateDiscreteSizes(
const geometry::ViewInformation2D& rViewInformation,
basegfx::B2DRange& rDiscreteRange,
basegfx::B2DRange& rVisibleDiscreteRange,
@@ -87,7 +92,18 @@ namespace drawinglayer
// Geometry extractor. Shadow will be added as in createLocalDecomposition, but
// the 3D content is not converted to a bitmap visualisation but to projected 2D gemetry. This
// helper is useful e.g. for Contour extraction or HitTests.
- Primitive2DSequence getGeometry2D(const geometry::ViewInformation2D& rViewInformation) const;
+ Primitive2DSequence getGeometry2D() const;
+ Primitive2DSequence getShadow2D(const geometry::ViewInformation2D& rViewInformation) const;
+
+ // Fast HitTest which uses the last buffered BitmapEx from the last
+ // rendered area if available. The return value describes if the check
+ // could be done with the current information, so do NOT use o_rResult
+ // when it returns false. o_rResult will be changed on return true and
+ // then contains a definitive answer if content of this scene is hit or
+ // not. On return false, it is normally necessary to use the geometric
+ // HitTest (see CutFindProcessor usages). The given HitPoint
+ // has to be in logic coordinates in scene's ObjectCoordinateSystem.
+ bool tryToCheckLastVisualisationDirectHit(const basegfx::B2DPoint& rLogicHitPoint, bool& o_rResult) const;
// constructor/destructor
ScenePrimitive2D(
diff --git a/drawinglayer/inc/drawinglayer/processor2d/hittestprocessor2d.hxx b/drawinglayer/inc/drawinglayer/processor2d/hittestprocessor2d.hxx
index 1eeaefd2dade..c0ab33052883 100644
--- a/drawinglayer/inc/drawinglayer/processor2d/hittestprocessor2d.hxx
+++ b/drawinglayer/inc/drawinglayer/processor2d/hittestprocessor2d.hxx
@@ -43,6 +43,7 @@
namespace basegfx { class B2DPolygon; }
namespace basegfx { class B2DPolyPolygon; }
+namespace drawinglayer { namespace primitive2d { class ScenePrimitive2D; }}
//////////////////////////////////////////////////////////////////////////////
@@ -80,6 +81,7 @@ namespace drawinglayer
bool checkFillHitWithTolerance(
const basegfx::B2DPolyPolygon& rPolyPolygon,
double fDiscreteHitTolerance);
+ void check3DHit(const primitive2d::ScenePrimitive2D& rCandidate);
public:
HitTestProcessor2D(
diff --git a/drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx b/drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx
index e29b413190ab..66ca140c2e56 100644
--- a/drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx
+++ b/drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx
@@ -51,6 +51,7 @@ namespace drawinglayer { namespace primitive2d {
class BitmapPrimitive2D;
class FillBitmapPrimitive2D;
class PolyPolygonGradientPrimitive2D;
+ class PolyPolygonBitmapPrimitive2D;
class PolyPolygonColorPrimitive2D;
class MetafilePrimitive2D;
class MaskPrimitive2D;
@@ -100,6 +101,7 @@ namespace drawinglayer
void RenderBitmapPrimitive2D(const primitive2d::BitmapPrimitive2D& rBitmapCandidate);
void RenderFillBitmapPrimitive2D(const primitive2d::FillBitmapPrimitive2D& rFillBitmapCandidate);
void RenderPolyPolygonGradientPrimitive2D(const primitive2d::PolyPolygonGradientPrimitive2D& rPolygonCandidate);
+ void RenderPolyPolygonBitmapPrimitive2D(const primitive2d::PolyPolygonBitmapPrimitive2D& rPolygonCandidate);
void RenderPolyPolygonColorPrimitive2D(const primitive2d::PolyPolygonColorPrimitive2D& rPolygonCandidate);
void RenderMetafilePrimitive2D(const primitive2d::MetafilePrimitive2D& rPolygonCandidate);
void RenderMaskPrimitive2DPixel(const primitive2d::MaskPrimitive2D& rMaskCandidate);
diff --git a/drawinglayer/inc/drawinglayer/processor3d/cutfindprocessor3d.hxx b/drawinglayer/inc/drawinglayer/processor3d/cutfindprocessor3d.hxx
new file mode 100644
index 000000000000..8a800d6d24b1
--- /dev/null
+++ b/drawinglayer/inc/drawinglayer/processor3d/cutfindprocessor3d.hxx
@@ -0,0 +1,86 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: zbufferprocessor3d.hxx,v $
+ *
+ * $Revision: 1.4 $
+ *
+ * last change: $Author: aw $ $Date: 2008-06-24 15:30:18 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_DRAWINGLAYER_PROCESSOR3D_CUTFINDPROCESSOR3D_HXX
+#define INCLUDED_DRAWINGLAYER_PROCESSOR3D_CUTFINDPROCESSOR3D_HXX
+
+#include <drawinglayer/processor3d/defaultprocessor3d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace processor3d
+ {
+ class CutFindProcessor : public BaseProcessor3D
+ {
+ private:
+ // the start and stop point for the cut vector
+ basegfx::B3DPoint maFront;
+ basegfx::B3DPoint maBack;
+
+ // the found cut points
+ ::std::vector< basegfx::B3DPoint > maResult;
+
+ // #i102956# the transformation change from TransformPrimitive3D processings
+ // needs to be remembered to be able to transform found cuts to the
+ // basic coordinate system the processor starts with
+ basegfx::B3DHomMatrix maCombinedTransform;
+
+ // bitfield
+ bool mbAnyHit : 1;
+
+ // as tooling, the process() implementation takes over API handling and calls this
+ // virtual render method when the primitive implementation is BasePrimitive3D-based.
+ virtual void processBasePrimitive3D(const primitive3d::BasePrimitive3D& rCandidate);
+
+ public:
+ CutFindProcessor(const geometry::ViewInformation3D& rViewInformation,
+ const basegfx::B3DPoint& rFront,
+ const basegfx::B3DPoint& rBack,
+ bool bAnyHit);
+
+ // data access
+ const ::std::vector< basegfx::B3DPoint >& getCutPoints() const { return maResult; }
+ bool getAnyHit() const { return mbAnyHit; }
+ };
+ } // end of namespace processor3d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PROCESSOR3D_CUTFINDPROCESSOR3D_HXX
+
+// eof
diff --git a/drawinglayer/prj/d.lst b/drawinglayer/prj/d.lst
index 0068b32c24ae..1ba3c2e7b614 100644
--- a/drawinglayer/prj/d.lst
+++ b/drawinglayer/prj/d.lst
@@ -90,6 +90,8 @@ mkdir: %_DEST%\inc%_EXT%\drawinglayer\processor2d
mkdir: %_DEST%\inc%_EXT%\drawinglayer\processor3d
..\inc\drawinglayer\processor3d\baseprocessor3d.hxx %_DEST%\inc%_EXT%\drawinglayer\processor3d\baseprocessor3d.hxx
+..\inc\drawinglayer\processor3d\cutfindprocessor3d.hxx %_DEST%\inc%_EXT%\drawinglayer\processor3d\cutfindprocessor3d.hxx
+..\inc\drawinglayer\processor3d\defaultprocessor3d.hxx %_DEST%\inc%_EXT%\drawinglayer\processor3d\defaultprocessor3d.hxx
..\inc\drawinglayer\processor3d\zbufferprocessor3d.hxx %_DEST%\inc%_EXT%\drawinglayer\processor3d\zbufferprocessor3d.hxx
..\inc\drawinglayer\processor3d\tbufferprocessor3d.hxx %_DEST%\inc%_EXT%\drawinglayer\processor3d\tbufferprocessor3d.hxx
diff --git a/drawinglayer/source/geometry/viewinformation2d.cxx b/drawinglayer/source/geometry/viewinformation2d.cxx
index 372de9936935..706684c5f7d8 100644
--- a/drawinglayer/source/geometry/viewinformation2d.cxx
+++ b/drawinglayer/source/geometry/viewinformation2d.cxx
@@ -81,12 +81,18 @@ namespace drawinglayer
basegfx::B2DRange maDiscreteViewport;
// the DrawPage which is target of visualisation. This is needed e.g. for
- // the view-dependent decomposition of PageNumber TextFields
+ // the view-dependent decomposition of PageNumber TextFields.
+ // This parameter is buffered here, but mainly resides in mxExtendedInformation,
+ // so it will be interpreted, but held there. It will also not be added
+ // to mxExtendedInformation in impFillViewInformationFromContent (it's there already)
uno::Reference< drawing::XDrawPage > mxVisualizedPage;
// the point in time
double mfViewTime;
+ // bitfield
+ bool mbReducedDisplayQuality : 1;
+
// the complete PropertyValue representation (if already created)
uno::Sequence< beans::PropertyValue > mxViewInformation;
@@ -125,6 +131,12 @@ namespace drawinglayer
return s_sNameProperty;
}
+ const ::rtl::OUString& getNamePropertyReducedDisplayQuality()
+ {
+ static ::rtl::OUString s_sNameProperty(RTL_CONSTASCII_USTRINGPARAM("ReducedDisplayQuality"));
+ return s_sNameProperty;
+ }
+
void impInterpretPropertyValues(const uno::Sequence< beans::PropertyValue >& rViewParameters)
{
if(rViewParameters.hasElements())
@@ -139,7 +151,17 @@ namespace drawinglayer
{
const beans::PropertyValue& rProp = rViewParameters[a];
- if(rProp.Name == getNamePropertyObjectTransformation())
+ if(rProp.Name == getNamePropertyReducedDisplayQuality())
+ {
+ // extra information; add to filtered information
+ mxExtendedInformation[nExtendedInsert++] = rProp;
+
+ // for performance reasons, also cache content locally
+ sal_Bool bSalBool = sal_True;
+ rProp.Value >>= bSalBool;
+ mbReducedDisplayQuality = bSalBool;
+ }
+ else if(rProp.Name == getNamePropertyObjectTransformation())
{
com::sun::star::geometry::AffineMatrix2D aAffineMatrix2D;
rProp.Value >>= aAffineMatrix2D;
@@ -185,6 +207,7 @@ namespace drawinglayer
const bool bViewportUsed(!maViewport.isEmpty());
const bool bTimeUsed(0.0 < mfViewTime);
const bool bVisualizedPageUsed(mxVisualizedPage.is());
+ const bool bReducedDisplayQualityUsed(true == mbReducedDisplayQuality);
const bool bExtraInformation(mxExtendedInformation.hasElements());
sal_uInt32 nIndex(0);
const sal_uInt32 nCount(
@@ -193,6 +216,7 @@ namespace drawinglayer
(bViewportUsed ? 1 : 0) +
(bTimeUsed ? 1 : 0) +
(bVisualizedPageUsed ? 1 : 0) +
+ (bReducedDisplayQualityUsed ? 1 : 0) +
(bExtraInformation ? mxExtendedInformation.getLength() : 0));
mxViewInformation.realloc(nCount);
@@ -265,6 +289,7 @@ namespace drawinglayer
maDiscreteViewport(),
mxVisualizedPage(rxDrawPage),
mfViewTime(fViewTime),
+ mbReducedDisplayQuality(false),
mxViewInformation(),
mxExtendedInformation()
{
@@ -281,6 +306,7 @@ namespace drawinglayer
maDiscreteViewport(),
mxVisualizedPage(),
mfViewTime(),
+ mbReducedDisplayQuality(false),
mxViewInformation(rViewParameters),
mxExtendedInformation()
{
@@ -355,6 +381,11 @@ namespace drawinglayer
return mxVisualizedPage;
}
+ bool getReducedDisplayQuality() const
+ {
+ return mbReducedDisplayQuality;
+ }
+
const uno::Sequence< beans::PropertyValue >& getViewInformationSequence() const
{
if(!mxViewInformation.hasElements())
@@ -501,6 +532,11 @@ namespace drawinglayer
return mpViewInformation2D->getDiscreteViewport();
}
+ bool ViewInformation2D::getReducedDisplayQuality() const
+ {
+ return mpViewInformation2D->getReducedDisplayQuality();
+ }
+
const uno::Sequence< beans::PropertyValue >& ViewInformation2D::getViewInformationSequence() const
{
return mpViewInformation2D->getViewInformationSequence();
diff --git a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
index f52af2da6a6d..ad36a40ea996 100644
--- a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
@@ -100,7 +100,7 @@ namespace drawinglayer
return maShadowPrimitives.hasElements();
}
- void ScenePrimitive2D::calculateDsicreteSizes(
+ void ScenePrimitive2D::calculateDiscreteSizes(
const geometry::ViewInformation2D& rViewInformation,
basegfx::B2DRange& rDiscreteRange,
basegfx::B2DRange& rVisibleDiscreteRange,
@@ -110,23 +110,12 @@ namespace drawinglayer
rDiscreteRange = basegfx::B2DRange(0.0, 0.0, 1.0, 1.0);
rDiscreteRange.transform(rViewInformation.getObjectToViewTransformation() * getObjectTransformation());
- // force to discrete expanded bounds (it grows, so expanding works perfectly well)
- rDiscreteRange.expand(basegfx::B2DTuple(floor(rDiscreteRange.getMinX()), floor(rDiscreteRange.getMinY())));
- rDiscreteRange.expand(basegfx::B2DTuple(ceil(rDiscreteRange.getMaxX()), ceil(rDiscreteRange.getMaxY())));
-
// clip it against discrete Viewport (if set)
rVisibleDiscreteRange = rDiscreteRange;
if(!rViewInformation.getViewport().isEmpty())
{
rVisibleDiscreteRange.intersect(rViewInformation.getDiscreteViewport());
-
- if(!rVisibleDiscreteRange.isEmpty())
- {
- // force to discrete expanded bounds, too
- rVisibleDiscreteRange.expand(basegfx::B2DTuple(floor(rVisibleDiscreteRange.getMinX()), floor(rVisibleDiscreteRange.getMinY())));
- rVisibleDiscreteRange.expand(basegfx::B2DTuple(ceil(rVisibleDiscreteRange.getMaxX()), ceil(rVisibleDiscreteRange.getMaxY())));
- }
}
if(rVisibleDiscreteRange.isEmpty())
@@ -177,11 +166,11 @@ namespace drawinglayer
}
}
- // get the involved ranges (see helper method calculateDsicreteSizes for details)
+ // get the involved ranges (see helper method calculateDiscreteSizes for details)
basegfx::B2DRange aDiscreteRange;
basegfx::B2DRange aVisibleDiscreteRange;
basegfx::B2DRange aUnitVisibleRange;
- calculateDsicreteSizes(rViewInformation, aDiscreteRange, aVisibleDiscreteRange, aUnitVisibleRange);
+ calculateDiscreteSizes(rViewInformation, aDiscreteRange, aVisibleDiscreteRange, aUnitVisibleRange);
if(!aVisibleDiscreteRange.isEmpty())
{
@@ -200,6 +189,31 @@ namespace drawinglayer
fViewSizeY *= fReduceFactor;
}
+ if(rViewInformation.getReducedDisplayQuality())
+ {
+ // when reducing the visualisation is allowed (e.g. an OverlayObject
+ // only needed for dragging), reduce resolution extra
+ // to speed up dragging interactions
+ const double fArea(fViewSizeX * fViewSizeY);
+ double fReducedVisualisationFactor(1.0 / (sqrt(fArea) * (1.0 / 170.0)));
+
+ if(fReducedVisualisationFactor > 1.0)
+ {
+ fReducedVisualisationFactor = 1.0;
+ }
+ else if(fReducedVisualisationFactor < 0.20)
+ {
+ fReducedVisualisationFactor = 0.20;
+ }
+
+ if(fReducedVisualisationFactor != 1.0)
+ {
+ fReduceFactor *= fReducedVisualisationFactor;
+ fViewSizeX *= fReducedVisualisationFactor;
+ fViewSizeY *= fReducedVisualisationFactor;
+ }
+ }
+
// calculate logic render size in world coordinates for usage in renderer
basegfx::B2DVector aLogicRenderSize(
aDiscreteRange.getWidth() * fReduceFactor,
@@ -207,9 +221,8 @@ namespace drawinglayer
aLogicRenderSize *= rViewInformation.getInverseObjectToViewTransformation();
// determine the oversample value
- static bool bDoOversample(false);
static sal_uInt16 nDefaultOversampleValue(3);
- const sal_uInt16 nOversampleValue((bDoOversample || aDrawinglayerOpt.IsAntiAliasing()) ? nDefaultOversampleValue : 0);
+ const sal_uInt16 nOversampleValue(aDrawinglayerOpt.IsAntiAliasing() ? nDefaultOversampleValue : 0);
// use default 3D primitive processor to create BitmapEx for aUnitVisiblePart and process
processor3d::ZBufferProcessor3D aZBufferProcessor3D(
@@ -224,18 +237,16 @@ namespace drawinglayer
aZBufferProcessor3D.processNonTransparent(getChildren3D());
aZBufferProcessor3D.processTransparent(getChildren3D());
- const BitmapEx aNewBitmap(aZBufferProcessor3D.getBitmapEx());
- const Size aBitmapSizePixel(aNewBitmap.GetSizePixel());
+ const_cast< ScenePrimitive2D* >(this)->maOldRenderedBitmap = aZBufferProcessor3D.getBitmapEx();
+ const Size aBitmapSizePixel(maOldRenderedBitmap.GetSizePixel());
if(aBitmapSizePixel.getWidth() && aBitmapSizePixel.getHeight())
{
// create transform for the created bitmap in discrete coordinates first.
- // #i97772# Do not forget to apply evtl. render size reduction to scaling
basegfx::B2DHomMatrix aNew2DTransform;
- const double fSizeReductionFactor(1.0 / fReduceFactor);
- aNew2DTransform.set(0, 0, (double)(aBitmapSizePixel.getWidth() - 1) * fSizeReductionFactor);
- aNew2DTransform.set(1, 1, (double)(aBitmapSizePixel.getHeight() - 1) * fSizeReductionFactor);
+ aNew2DTransform.set(0, 0, aVisibleDiscreteRange.getWidth());
+ aNew2DTransform.set(1, 1, aVisibleDiscreteRange.getHeight());
aNew2DTransform.set(0, 2, aVisibleDiscreteRange.getMinX());
aNew2DTransform.set(1, 2, aVisibleDiscreteRange.getMinY());
@@ -243,7 +254,7 @@ namespace drawinglayer
aNew2DTransform *= rViewInformation.getInverseObjectToViewTransformation();
// create bitmap primitive and add
- const Primitive2DReference xRef(new BitmapPrimitive2D(aNewBitmap, aNew2DTransform));
+ const Primitive2DReference xRef(new BitmapPrimitive2D(maOldRenderedBitmap, aNew2DTransform));
appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, xRef);
// test: Allow to add an outline in the debugger when tests are needed
@@ -262,17 +273,10 @@ namespace drawinglayer
return aRetval;
}
- Primitive2DSequence ScenePrimitive2D::getGeometry2D(const geometry::ViewInformation2D& rViewInformation) const
+ Primitive2DSequence ScenePrimitive2D::getGeometry2D() const
{
Primitive2DSequence aRetval;
- // create 2D shadows from contained 3D primitives
- if(impGetShadow3D(rViewInformation))
- {
- // add extracted 2d shadows (before 3d scene creations itself)
- aRetval = maShadowPrimitives;
- }
-
// create 2D projected geometry from 3D geometry
if(getChildren3D().hasElements())
{
@@ -284,14 +288,68 @@ namespace drawinglayer
// process local primitives
aGeometryProcessor.process(getChildren3D());
- // fetch result and append
- Primitive2DSequence a2DExtractedPrimitives(aGeometryProcessor.getPrimitive2DSequence());
- appendPrimitive2DSequenceToPrimitive2DSequence(aRetval, a2DExtractedPrimitives);
+ // fetch result
+ aRetval = aGeometryProcessor.getPrimitive2DSequence();
}
return aRetval;
}
+ Primitive2DSequence ScenePrimitive2D::getShadow2D(const geometry::ViewInformation2D& rViewInformation) const
+ {
+ Primitive2DSequence aRetval;
+
+ // create 2D shadows from contained 3D primitives
+ if(impGetShadow3D(rViewInformation))
+ {
+ // add extracted 2d shadows (before 3d scene creations itself)
+ aRetval = maShadowPrimitives;
+ }
+
+ return aRetval;
+ }
+
+ bool ScenePrimitive2D::tryToCheckLastVisualisationDirectHit(const basegfx::B2DPoint& rLogicHitPoint, bool& o_rResult) const
+ {
+ if(!maOldRenderedBitmap.IsEmpty() && !maOldUnitVisiblePart.isEmpty())
+ {
+ basegfx::B2DHomMatrix aInverseSceneTransform(getObjectTransformation());
+ aInverseSceneTransform.invert();
+ const basegfx::B2DPoint aRelativePoint(aInverseSceneTransform * rLogicHitPoint);
+
+ if(maOldUnitVisiblePart.isInside(aRelativePoint))
+ {
+ // calculate coordinates relative to visualized part
+ double fDivisorX(maOldUnitVisiblePart.getWidth());
+ double fDivisorY(maOldUnitVisiblePart.getHeight());
+
+ if(basegfx::fTools::equalZero(fDivisorX))
+ {
+ fDivisorX = 1.0;
+ }
+
+ if(basegfx::fTools::equalZero(fDivisorY))
+ {
+ fDivisorY = 1.0;
+ }
+
+ const double fRelativeX((aRelativePoint.getX() - maOldUnitVisiblePart.getMinX()) / fDivisorX);
+ const double fRelativeY((aRelativePoint.getY() - maOldUnitVisiblePart.getMinY()) / fDivisorY);
+
+ // combine with real BitmapSizePixel to get bitmap coordinates
+ const Size aBitmapSizePixel(maOldRenderedBitmap.GetSizePixel());
+ const sal_Int32 nX(basegfx::fround(fRelativeX * aBitmapSizePixel.Width()));
+ const sal_Int32 nY(basegfx::fround(fRelativeY * aBitmapSizePixel.Height()));
+
+ // try to get a statement about transparency in that pixel
+ o_rResult = (0xff != maOldRenderedBitmap.GetTransparency(nX, nY));
+ return true;
+ }
+ }
+
+ return false;
+ }
+
ScenePrimitive2D::ScenePrimitive2D(
const primitive3d::Primitive3DSequence& rxChildren3D,
const attribute::SdrSceneAttribute& rSdrSceneAttribute,
@@ -308,7 +366,8 @@ namespace drawinglayer
mbShadow3DChecked(false),
mfOldDiscreteSizeX(0.0),
mfOldDiscreteSizeY(0.0),
- maOldUnitVisiblePart()
+ maOldUnitVisiblePart(),
+ maOldRenderedBitmap()
{
}
@@ -359,7 +418,7 @@ namespace drawinglayer
{
::osl::MutexGuard aGuard( m_aMutex );
- // get the involved ranges (see helper method calculateDsicreteSizes for details)
+ // get the involved ranges (see helper method calculateDiscreteSizes for details)
basegfx::B2DRange aDiscreteRange;
basegfx::B2DRange aUnitVisibleRange;
bool bNeedNewDecomposition(false);
@@ -368,21 +427,22 @@ namespace drawinglayer
if(getLocalDecomposition().hasElements())
{
basegfx::B2DRange aVisibleDiscreteRange;
- calculateDsicreteSizes(rViewInformation, aDiscreteRange, aVisibleDiscreteRange, aUnitVisibleRange);
+ calculateDiscreteSizes(rViewInformation, aDiscreteRange, aVisibleDiscreteRange, aUnitVisibleRange);
bDiscreteSizesAreCalculated = true;
- // display has changed and cannot be reused when resolution did change
- if(!basegfx::fTools::equal(aDiscreteRange.getWidth(), mfOldDiscreteSizeX) ||
- !basegfx::fTools::equal(aDiscreteRange.getHeight(), mfOldDiscreteSizeY))
+ // needs to be painted when the new part is not part of the last
+ // decomposition
+ if(!maOldUnitVisiblePart.isInside(aUnitVisibleRange))
{
bNeedNewDecomposition = true;
}
+ // display has changed and cannot be reused when resolution got bigger. It
+ // can be reused when resolution got smaller, though.
if(!bNeedNewDecomposition)
{
- // needs to be painted when the new part is not part of the last
- // decomposition
- if(!maOldUnitVisiblePart.isInside(aUnitVisibleRange))
+ if(basegfx::fTools::more(aDiscreteRange.getWidth(), mfOldDiscreteSizeX) ||
+ basegfx::fTools::more(aDiscreteRange.getHeight(), mfOldDiscreteSizeY))
{
bNeedNewDecomposition = true;
}
@@ -400,7 +460,7 @@ namespace drawinglayer
if(!bDiscreteSizesAreCalculated)
{
basegfx::B2DRange aVisibleDiscreteRange;
- calculateDsicreteSizes(rViewInformation, aDiscreteRange, aVisibleDiscreteRange, aUnitVisibleRange);
+ calculateDiscreteSizes(rViewInformation, aDiscreteRange, aVisibleDiscreteRange, aUnitVisibleRange);
}
// remember last used NewDiscreteSize and NewUnitVisiblePart
diff --git a/drawinglayer/source/processor2d/contourextractor2d.cxx b/drawinglayer/source/processor2d/contourextractor2d.cxx
index b7931aed5c27..1f629cb25c9c 100644
--- a/drawinglayer/source/processor2d/contourextractor2d.cxx
+++ b/drawinglayer/source/processor2d/contourextractor2d.cxx
@@ -162,7 +162,8 @@ namespace drawinglayer
{
// 2D Scene primitive containing 3D stuff; extract 2D contour in world coordinates
const primitive2d::ScenePrimitive2D& rScenePrimitive2DCandidate(static_cast< const primitive2d::ScenePrimitive2D& >(rCandidate));
- const primitive2d::Primitive2DSequence xExtracted2DSceneGeometry(rScenePrimitive2DCandidate.getGeometry2D(getViewInformation2D()));
+ const primitive2d::Primitive2DSequence xExtracted2DSceneGeometry(rScenePrimitive2DCandidate.getGeometry2D());
+ const primitive2d::Primitive2DSequence xExtracted2DSceneShadow(rScenePrimitive2DCandidate.getShadow2D(getViewInformation2D()));
// proccess content
if(xExtracted2DSceneGeometry.hasElements())
@@ -170,6 +171,12 @@ namespace drawinglayer
process(xExtracted2DSceneGeometry);
}
+ // proccess content
+ if(xExtracted2DSceneShadow.hasElements())
+ {
+ process(xExtracted2DSceneShadow);
+ }
+
break;
}
case PRIMITIVE2D_ID_WRONGSPELLPRIMITIVE2D :
diff --git a/drawinglayer/source/processor2d/hittestprocessor2d.cxx b/drawinglayer/source/processor2d/hittestprocessor2d.cxx
index 8a2d732cbb2f..4ffef7515389 100644
--- a/drawinglayer/source/processor2d/hittestprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/hittestprocessor2d.cxx
@@ -48,6 +48,8 @@
#include <drawinglayer/primitive2d/sceneprimitive2d.hxx>
#include <drawinglayer/primitive2d/hittestprimitive2d.hxx>
#include <drawinglayer/primitive2d/pointarrayprimitive2d.hxx>
+#include <basegfx/matrix/b3dhommatrix.hxx>
+#include <drawinglayer/processor3d/cutfindprocessor3d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -164,6 +166,121 @@ namespace drawinglayer
return bRetval;
}
+ void HitTestProcessor2D::check3DHit(const primitive2d::ScenePrimitive2D& rCandidate)
+ {
+ // calculate relative point in unified 2D scene
+ const basegfx::B2DPoint aLogicHitPosition(getViewInformation2D().getInverseObjectToViewTransformation() * getDiscreteHitPosition());
+
+ // use bitmap check in ScenePrimitive2D
+ bool bTryFastResult(false);
+
+ if(rCandidate.tryToCheckLastVisualisationDirectHit(aLogicHitPosition, bTryFastResult))
+ {
+ mbHit = bTryFastResult;
+ }
+ else
+ {
+ basegfx::B2DHomMatrix aInverseSceneTransform(rCandidate.getObjectTransformation());
+ aInverseSceneTransform.invert();
+ const basegfx::B2DPoint aRelativePoint(aInverseSceneTransform * aLogicHitPosition);
+
+ // check if test point is inside scene's unified area at all
+ if(aRelativePoint.getX() >= 0.0 && aRelativePoint.getX() <= 1.0
+ && aRelativePoint.getY() >= 0.0 && aRelativePoint.getY() <= 1.0)
+ {
+ // get 3D view information
+ const geometry::ViewInformation3D& rObjectViewInformation3D = rCandidate.getViewInformation3D();
+
+ // create HitPoint Front and Back, transform to object coordinates
+ basegfx::B3DHomMatrix aViewToObject(rObjectViewInformation3D.getObjectToView());
+ aViewToObject.invert();
+ const basegfx::B3DPoint aFront(aViewToObject * basegfx::B3DPoint(aRelativePoint.getX(), aRelativePoint.getY(), 0.0));
+ const basegfx::B3DPoint aBack(aViewToObject * basegfx::B3DPoint(aRelativePoint.getX(), aRelativePoint.getY(), 1.0));
+
+ if(!aFront.equal(aBack))
+ {
+ const primitive3d::Primitive3DSequence& rPrimitives = rCandidate.getChildren3D();
+
+ if(rPrimitives.hasElements())
+ {
+ // make BoundVolume empty and overlapping test for speedup
+ const basegfx::B3DRange aObjectRange(
+ drawinglayer::primitive3d::getB3DRangeFromPrimitive3DSequence(
+ rPrimitives, rObjectViewInformation3D));
+
+ if(!aObjectRange.isEmpty())
+ {
+ const basegfx::B3DRange aFrontBackRange(aFront, aBack);
+
+ if(aObjectRange.overlaps(aFrontBackRange))
+ {
+ // bound volumes hit, geometric cut tests needed
+ drawinglayer::processor3d::CutFindProcessor aCutFindProcessor(
+ rObjectViewInformation3D,
+ aFront,
+ aBack,
+ true);
+ aCutFindProcessor.process(rPrimitives);
+
+ mbHit = (0 != aCutFindProcessor.getCutPoints().size());
+ }
+ }
+ }
+ }
+ }
+
+ // This is needed to check hit with 3D shadows, too. HitTest is without shadow
+ // to keep compatible with previous versions. Keeping here as reference
+ //
+ // if(!getHit())
+ // {
+ // // if scene has shadow, check hit with shadow, too
+ // const primitive2d::Primitive2DSequence xExtracted2DSceneShadow(rCandidate.getShadow2D(getViewInformation2D()));
+ //
+ // if(xExtracted2DSceneShadow.hasElements())
+ // {
+ // // proccess extracted 2D content
+ // process(xExtracted2DSceneShadow);
+ // }
+ // }
+
+ if(!getHit())
+ {
+ // empty 3D scene; Check for border hit
+ basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
+ aOutline.transform(rCandidate.getObjectTransformation());
+
+ mbHit = checkHairlineHitWithTolerance(aOutline, getDiscreteHitTolerance());
+ }
+
+ // This is what the previous version did. Keeping it here for reference
+ //
+ // // 2D Scene primitive containing 3D stuff; extract 2D contour in world coordinates
+ // // This may be refined later to an own 3D HitTest renderer which processes the 3D
+ // // geometry directly
+ // const primitive2d::ScenePrimitive2D& rScenePrimitive2DCandidate(static_cast< const primitive2d::ScenePrimitive2D& >(rCandidate));
+ // const primitive2d::Primitive2DSequence xExtracted2DSceneGeometry(rScenePrimitive2DCandidate.getGeometry2D());
+ // const primitive2d::Primitive2DSequence xExtracted2DSceneShadow(rScenePrimitive2DCandidate.getShadow2D(getViewInformation2D()));
+ //
+ // if(xExtracted2DSceneGeometry.hasElements() || xExtracted2DSceneShadow.hasElements())
+ // {
+ // // proccess extracted 2D content
+ // process(xExtracted2DSceneGeometry);
+ // process(xExtracted2DSceneShadow);
+ // }
+ // else
+ // {
+ // // empty 3D scene; Check for border hit
+ // const basegfx::B2DRange aRange(rCandidate.getB2DRange(getViewInformation2D()));
+ // if(!aRange.isEmpty())
+ // {
+ // const basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(aRange));
+ // mbHit = checkHairlineHitWithTolerance(aOutline, getDiscreteHitTolerance());
+ // }
+ // }
+ }
+ }
+
void HitTestProcessor2D::processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate)
{
if(getHit())
@@ -334,25 +451,8 @@ namespace drawinglayer
{
if(!getHitTextOnly())
{
- // 2D Scene primitive containing 3D stuff; extract 2D contour in world coordinates
- // This may be refined later to an own 3D HitTest renderer which processes the 3D
- // geometry directly
- const primitive2d::ScenePrimitive2D& rScenePrimitive2DCandidate(static_cast< const primitive2d::ScenePrimitive2D& >(rCandidate));
- const primitive2d::Primitive2DSequence xExtracted2DSceneGeometry(rScenePrimitive2DCandidate.getGeometry2D(getViewInformation2D()));
-
- if(xExtracted2DSceneGeometry.hasElements())
- {
- // proccess extracted 2D content
- process(xExtracted2DSceneGeometry);
- }
- else
- {
- // empty 3D scene; Check for border hit
- const basegfx::B2DRange aRange(rCandidate.getB2DRange(getViewInformation2D()));
- basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(aRange));
-
- mbHit = checkHairlineHitWithTolerance(aOutline, getDiscreteHitTolerance());
- }
+ const primitive2d::ScenePrimitive2D& rSceneCandidate(static_cast< const primitive2d::ScenePrimitive2D& >(rCandidate));
+ check3DHit(rSceneCandidate);
}
break;
@@ -365,14 +465,23 @@ namespace drawinglayer
// ignorable primitives
break;
}
+ case PRIMITIVE2D_ID_SHADOWPRIMITIVE2D :
+ {
+ // Ignore shadows; we do not want to have shadows hittable.
+ // Remove this one to make shadows hittable on demand.
+ break;
+ }
case PRIMITIVE2D_ID_TEXTSIMPLEPORTIONPRIMITIVE2D :
case PRIMITIVE2D_ID_TEXTDECORATEDPORTIONPRIMITIVE2D :
{
// for text use the BoundRect of the primitive itself
const basegfx::B2DRange aRange(rCandidate.getB2DRange(getViewInformation2D()));
- basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(aRange));
- mbHit = checkFillHitWithTolerance(basegfx::B2DPolyPolygon(aOutline), getDiscreteHitTolerance());
+ if(!aRange.isEmpty())
+ {
+ const basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(aRange));
+ mbHit = checkFillHitWithTolerance(basegfx::B2DPolyPolygon(aOutline), getDiscreteHitTolerance());
+ }
break;
}
@@ -392,9 +501,12 @@ namespace drawinglayer
// - For Bitamps, the mask and/or alpha information may be used
// - For MetaFiles, the MetaFile content may be used
const basegfx::B2DRange aRange(rCandidate.getB2DRange(getViewInformation2D()));
- basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(aRange));
- mbHit = checkFillHitWithTolerance(basegfx::B2DPolyPolygon(aOutline), getDiscreteHitTolerance());
+ if(!aRange.isEmpty())
+ {
+ const basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(aRange));
+ mbHit = checkFillHitWithTolerance(basegfx::B2DPolyPolygon(aOutline), getDiscreteHitTolerance());
+ }
}
break;
diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index 8e2f89bb82a6..ef351002a1ea 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -218,6 +218,12 @@ namespace drawinglayer
}
break;
}
+ case PRIMITIVE2D_ID_POLYPOLYGONBITMAPPRIMITIVE2D :
+ {
+ // direct draw of bitmap
+ RenderPolyPolygonBitmapPrimitive2D(static_cast< const primitive2d::PolyPolygonBitmapPrimitive2D& >(rCandidate));
+ break;
+ }
case PRIMITIVE2D_ID_POLYPOLYGONCOLORPRIMITIVE2D :
{
// direct draw of PolyPolygon with color
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx
index e5a88812dd10..ede5aee730cf 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx
@@ -565,6 +565,98 @@ namespace drawinglayer
}
}
+ // direct draw of bitmap
+ void VclProcessor2D::RenderPolyPolygonBitmapPrimitive2D(const primitive2d::PolyPolygonBitmapPrimitive2D& rPolygonCandidate)
+ {
+ bool bDone(false);
+ const basegfx::B2DPolyPolygon& rPolyPolygon = rPolygonCandidate.getB2DPolyPolygon();
+
+ if(rPolyPolygon.count())
+ {
+ const attribute::FillBitmapAttribute& rFillBitmapAttribute = rPolygonCandidate.getFillBitmap();
+ const Bitmap& rBitmap = rFillBitmapAttribute.getBitmap();
+
+ if(rBitmap.IsEmpty())
+ {
+ // empty bitmap, done
+ bDone = true;
+ }
+ else
+ {
+ // try to catch cases where the bitmap will be color-modified to a single
+ // color (e.g. shadow). This would NOT be optimizable with an alpha channel
+ // at the Bitmap which we do not have here. When this should change, this
+ // optimization has to be reworked accordingly.
+ const sal_uInt32 nBColorModifierStackCount(maBColorModifierStack.count());
+
+ if(nBColorModifierStackCount)
+ {
+ const basegfx::BColorModifier& rTopmostModifier = maBColorModifierStack.getBColorModifier(nBColorModifierStackCount - 1);
+
+ if(basegfx::BCOLORMODIFYMODE_REPLACE == rTopmostModifier.getMode())
+ {
+ // the bitmap fill is in unified color, so we can replace it with
+ // a single polygon fill. The form of the fill depends on tiling
+ if(rFillBitmapAttribute.getTiling())
+ {
+ // with tiling, fill the whole PolyPolygon with the modifier color
+ basegfx::B2DPolyPolygon aLocalPolyPolygon(rPolyPolygon);
+
+ aLocalPolyPolygon.transform(maCurrentTransformation);
+ mpOutputDevice->SetLineColor();
+ mpOutputDevice->SetFillColor(Color(rTopmostModifier.getBColor()));
+ mpOutputDevice->DrawPolyPolygon(aLocalPolyPolygon);
+ }
+ else
+ {
+ // without tiling, only the area common to the bitmap tile and the
+ // PolyPolygon is filled. Create the bitmap tile area in object
+ // coordinates. For this, the object transformation needs to be created
+ // from the already scaled PolyPolygon. The tile area in object
+ // coordinates wil always be non-rotated, so it's not necessary to
+ // work with a polygon here
+ basegfx::B2DRange aTileRange(rFillBitmapAttribute.getTopLeft(),
+ rFillBitmapAttribute.getTopLeft() + rFillBitmapAttribute.getSize());
+ const basegfx::B2DRange aPolyPolygonRange(rPolyPolygon.getB2DRange());
+ basegfx::B2DHomMatrix aNewObjectTransform;
+
+ aNewObjectTransform.set(0, 0, aPolyPolygonRange.getWidth());
+ aNewObjectTransform.set(1, 1, aPolyPolygonRange.getHeight());
+ aNewObjectTransform.set(0, 2, aPolyPolygonRange.getMinX());
+ aNewObjectTransform.set(1, 2, aPolyPolygonRange.getMinY());
+ aTileRange.transform(aNewObjectTransform);
+
+ // now clip the object polyPolygon against the tile range
+ // to get the common area (OR)
+ basegfx::B2DPolyPolygon aTarget = basegfx::tools::clipPolyPolygonOnRange(rPolyPolygon, aTileRange, true, false);
+
+ if(aTarget.count())
+ {
+ aTarget.transform(maCurrentTransformation);
+ mpOutputDevice->SetLineColor();
+ mpOutputDevice->SetFillColor(Color(rTopmostModifier.getBColor()));
+ mpOutputDevice->DrawPolyPolygon(aTarget);
+ }
+ }
+
+ bDone = true;
+ }
+ }
+ }
+ }
+ else
+ {
+ // empty polyPolygon, done
+ bDone = true;
+ }
+
+ if(!bDone)
+ {
+ // use default decomposition
+ process(rPolygonCandidate.get2DDecomposition(getViewInformation2D()));
+ }
+ }
+
// direct draw of PolyPolygon with color
void VclProcessor2D::RenderPolyPolygonColorPrimitive2D(const primitive2d::PolyPolygonColorPrimitive2D& rPolygonCandidate)
{
diff --git a/drawinglayer/source/processor3d/cutfindprocessor3d.cxx b/drawinglayer/source/processor3d/cutfindprocessor3d.cxx
new file mode 100644
index 000000000000..99f5801c60e3
--- /dev/null
+++ b/drawinglayer/source/processor3d/cutfindprocessor3d.cxx
@@ -0,0 +1,199 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: zbufferprocessor3d.cxx,v $
+ *
+ * $Revision: 1.5 $
+ *
+ * last change: $Author: aw $ $Date: 2008-06-24 15:31:09 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_drawinglayer.hxx"
+
+#include <drawinglayer/processor3d/cutfindprocessor3d.hxx>
+#include <drawinglayer/primitive3d/drawinglayer_primitivetypes3d.hxx>
+#include <drawinglayer/primitive3d/transformprimitive3d.hxx>
+#include <drawinglayer/primitive3d/hatchtextureprimitive3d.hxx>
+#include <drawinglayer/primitive3d/hittestprimitive3d.hxx>
+#include <drawinglayer/primitive3d/polypolygonprimitive3d.hxx>
+#include <basegfx/polygon/b3dpolygon.hxx>
+#include <basegfx/polygon/b3dpolygontools.hxx>
+#include <basegfx/polygon/b3dpolypolygontools.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace processor3d
+ {
+ CutFindProcessor::CutFindProcessor(const geometry::ViewInformation3D& rViewInformation,
+ const basegfx::B3DPoint& rFront,
+ const basegfx::B3DPoint& rBack,
+ bool bAnyHit)
+ : BaseProcessor3D(rViewInformation),
+ maFront(rFront),
+ maBack(rBack),
+ maResult(),
+ maCombinedTransform(),
+ mbAnyHit(bAnyHit)
+ {
+ }
+
+ void CutFindProcessor::processBasePrimitive3D(const primitive3d::BasePrimitive3D& rCandidate)
+ {
+ if(getAnyHit() && maResult.size())
+ {
+ // stop processing as soon as a hit was recognized
+ return;
+ }
+
+ // it is a BasePrimitive3D implementation, use getPrimitiveID() call for switch
+ switch(rCandidate.getPrimitiveID())
+ {
+ case PRIMITIVE3D_ID_TRANSFORMPRIMITIVE3D :
+ {
+ // transform group.
+ const primitive3d::TransformPrimitive3D& rPrimitive = static_cast< const primitive3d::TransformPrimitive3D& >(rCandidate);
+
+ // remember old and transform front, back to object coordinates
+ const basegfx::B3DPoint aLastFront(maFront);
+ const basegfx::B3DPoint aLastBack(maBack);
+ basegfx::B3DHomMatrix aInverseTrans(rPrimitive.getTransformation());
+ aInverseTrans.invert();
+ maFront *= aInverseTrans;
+ maBack *= aInverseTrans;
+
+ // remember current and create new transformation; add new object transform from right side
+ const geometry::ViewInformation3D aLastViewInformation3D(getViewInformation3D());
+ const geometry::ViewInformation3D aNewViewInformation3D(
+ aLastViewInformation3D.getObjectTransformation() * rPrimitive.getTransformation(),
+ aLastViewInformation3D.getOrientation(),
+ aLastViewInformation3D.getProjection(),
+ aLastViewInformation3D.getDeviceToView(),
+ aLastViewInformation3D.getViewTime(),
+ aLastViewInformation3D.getExtendedInformationSequence());
+ updateViewInformation(aNewViewInformation3D);
+
+ // #i102956# remember needed back-transform for found cuts (combine from right side)
+ const basegfx::B3DHomMatrix aLastCombinedTransform(maCombinedTransform);
+ maCombinedTransform = maCombinedTransform * rPrimitive.getTransformation();
+
+ // let break down
+ process(rPrimitive.getChildren());
+
+ // restore transformations and front, back
+ maCombinedTransform = aLastCombinedTransform;
+ updateViewInformation(aLastViewInformation3D);
+ maFront = aLastFront;
+ maBack = aLastBack;
+ break;
+ }
+ case PRIMITIVE3D_ID_POLYGONHAIRLINEPRIMITIVE3D :
+ {
+ // PolygonHairlinePrimitive3D, not used for hit test with planes, ignore. This
+ // means that also thick line expansion will not be hit-tested as
+ // PolyPolygonMaterialPrimitive3D
+ break;
+ }
+ case PRIMITIVE3D_ID_HATCHTEXTUREPRIMITIVE3D :
+ {
+ // #i97321#
+ // For HatchTexturePrimitive3D, do not use the decomposition since it will produce
+ // clipped hatch lines in 3D. It can be used when the hatch also has a filling, but for
+ // simplicity, just use the children which are the PolyPolygonMaterialPrimitive3D
+ // which define the hatched areas anyways; for HitTest this is more than adequate
+ const primitive3d::HatchTexturePrimitive3D& rPrimitive = static_cast< const primitive3d::HatchTexturePrimitive3D& >(rCandidate);
+ process(rPrimitive.getChildren());
+ break;
+ }
+ case PRIMITIVE3D_ID_HITTESTPRIMITIVE3D :
+ {
+ // HitTestPrimitive3D, force usage due to we are doing a hit test and this
+ // primitive only gets generated on 3d objects without fill, exactly for this
+ // purpose
+ const primitive3d::HitTestPrimitive3D& rPrimitive = static_cast< const primitive3d::HitTestPrimitive3D& >(rCandidate);
+ process(rPrimitive.getChildren());
+ break;
+ }
+ case PRIMITIVE3D_ID_POLYPOLYGONMATERIALPRIMITIVE3D :
+ {
+ // PolyPolygonMaterialPrimitive3D
+ const primitive3d::PolyPolygonMaterialPrimitive3D& rPrimitive = static_cast< const primitive3d::PolyPolygonMaterialPrimitive3D& >(rCandidate);
+
+ if(!maFront.equal(maBack))
+ {
+ const basegfx::B3DPolyPolygon& rPolyPolygon = rPrimitive.getB3DPolyPolygon();
+ const sal_uInt32 nPolyCount(rPolyPolygon.count());
+
+ if(nPolyCount)
+ {
+ const basegfx::B3DPolygon aPolygon(rPolyPolygon.getB3DPolygon(0));
+ const sal_uInt32 nPointCount(aPolygon.count());
+
+ if(nPointCount > 2)
+ {
+ const basegfx::B3DVector aPlaneNormal(aPolygon.getNormal());
+
+ if(!aPlaneNormal.equalZero())
+ {
+ const basegfx::B3DPoint aPointOnPlane(aPolygon.getB3DPoint(0));
+ double fCut(0.0);
+
+ if(basegfx::tools::getCutBetweenLineAndPlane(aPlaneNormal, aPointOnPlane, maFront, maBack, fCut))
+ {
+ const basegfx::B3DPoint aCutPoint(basegfx::interpolate(maFront, maBack, fCut));
+
+ if(basegfx::tools::isInside(rPolyPolygon, aCutPoint, false))
+ {
+ // #i102956# add result. Do not forget to do this in the coordinate
+ // system the processor get started with, so use the collected
+ // combined transformation from processed TransformPrimitive3D's
+ maResult.push_back(maCombinedTransform * aCutPoint);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ break;
+ }
+ default :
+ {
+ // process recursively
+ process(rCandidate.get3DDecomposition(getViewInformation3D()));
+ break;
+ }
+ }
+ }
+ } // end of namespace processor3d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/processor3d/makefile.mk b/drawinglayer/source/processor3d/makefile.mk
index 8ca0097c435a..2ae2ae52f2f2 100644
--- a/drawinglayer/source/processor3d/makefile.mk
+++ b/drawinglayer/source/processor3d/makefile.mk
@@ -46,6 +46,7 @@ ENABLE_EXCEPTIONS=TRUE
SLOFILES= \
$(SLO)$/baseprocessor3d.obj \
+ $(SLO)$/cutfindprocessor3d.obj \
$(SLO)$/defaultprocessor3d.obj \
$(SLO)$/shadow3dextractor.obj \
$(SLO)$/geometry2dextractor.obj \
diff --git a/extensions/source/bibliography/bibload.cxx b/extensions/source/bibliography/bibload.cxx
index 3d9667b94f06..a554741c666a 100644
--- a/extensions/source/bibliography/bibload.cxx
+++ b/extensions/source/bibliography/bibload.cxx
@@ -370,7 +370,7 @@ void BibliographyLoader::loadView(const Reference< XFrame > & rFrame, const rtl:
BibBookContainer *pMyWindow = new BibBookContainer( pParent, m_pDatMan );
pMyWindow->Show();
- ::bib::BibView* pView = new ::bib::BibView( pMyWindow, m_pDatMan, WB_SECTION_STYLE | WB_3DLOOK );
+ ::bib::BibView* pView = new ::bib::BibView( pMyWindow, m_pDatMan, WB_VSCROLL | WB_HSCROLL | WB_3DLOOK );
pView->Show();
m_pDatMan->SetView( pView );
diff --git a/extensions/source/bibliography/bibview.hxx b/extensions/source/bibliography/bibview.hxx
index 57b713e0f24d..feb8eceb0e35 100644
--- a/extensions/source/bibliography/bibview.hxx
+++ b/extensions/source/bibliography/bibview.hxx
@@ -32,8 +32,6 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/awt/XControlContainer.hpp>
-#include <svtools/section.hxx>
-#include <svtools/sectctr.hxx>
#include "formcontrolcontainer.hxx"
#include "bibshortcuthandler.hxx"
diff --git a/fpicker/source/unx/gnome/SalGtkPicker.cxx b/fpicker/source/unx/gnome/SalGtkPicker.cxx
index b6b9d2bb36ab..cde61d801495 100644
--- a/fpicker/source/unx/gnome/SalGtkPicker.cxx
+++ b/fpicker/source/unx/gnome/SalGtkPicker.cxx
@@ -73,6 +73,8 @@ rtl::OUString SalGtkPicker::uritounicode(const gchar* pIn)
INetURLObject aURL(sURL);
if (INET_PROT_FILE == aURL.GetProtocol())
{
+ // all the URLs are handled by office in UTF-8
+ // so the Gnome FP related URLs should be converted accordingly
gchar *pEncodedFileName = g_filename_from_uri(pIn, NULL, NULL);
if ( pEncodedFileName )
{
@@ -94,12 +96,19 @@ rtl::OUString SalGtkPicker::uritounicode(const gchar* pIn)
rtl::OString SalGtkPicker::unicodetouri(const rtl::OUString &rURL)
{
+ // all the URLs are handled by office in UTF-8 ( and encoded with "%xx" codes based on UTF-8 )
+ // so the Gnome FP related URLs should be converted accordingly
OString sURL = OUStringToOString(rURL, RTL_TEXTENCODING_UTF8);
INetURLObject aURL(rURL);
if (INET_PROT_FILE == aURL.GetProtocol())
{
- rtl::OUString sOUURL = aURL.getExternalURL(INetURLObject::DECODE_WITH_CHARSET, osl_getThreadTextEncoding());
- sURL = OUStringToOString( sOUURL, osl_getThreadTextEncoding());
+ OUString aNewURL = Reference<uri::XExternalUriReferenceTranslator>(Reference<XMultiServiceFactory>(comphelper::getProcessServiceFactory(), UNO_QUERY_THROW)->createInstance(OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uri.ExternalUriReferenceTranslator"))), UNO_QUERY_THROW)->translateToExternal( rURL );
+
+ if( aNewURL.getLength() )
+ {
+ // At this point the URL should contain ascii characters only actually
+ sURL = OUStringToOString( aNewURL, osl_getThreadTextEncoding() );
+ }
}
return sURL;
}
diff --git a/i18npool/source/search/makefile.mk b/i18npool/source/search/makefile.mk
index 1b48919624f6..2e81ec3f1d53 100644
--- a/i18npool/source/search/makefile.mk
+++ b/i18npool/source/search/makefile.mk
@@ -50,6 +50,12 @@ SLOFILES= \
$(EXCEPTIONSFILES) \
$(SLO)$/levdis.obj
+# on unxsoli, no optimization for textsearch because of i105945
+.IF "$(OS)$(COM)$(CPUNAME)"=="SOLARISC52INTEL"
+EXCEPTIONSNOOPTFILES= \
+ $(SLO)$/textsearch.obj
+.ENDIF
+
SHL1TARGET= $(TARGET)
SHL1OBJS= $(SLOFILES)
diff --git a/i18npool/source/search/textsearch.cxx b/i18npool/source/search/textsearch.cxx
index 96f033f4e4e3..2518a6cb0481 100644
--- a/i18npool/source/search/textsearch.cxx
+++ b/i18npool/source/search/textsearch.cxx
@@ -562,6 +562,7 @@ sal_Int32 TextSearch::GetDiff( const sal_Unicode cChr ) const
}
+// TextSearch::NSrchFrwrd is mis-optimized on unxsoli (#i105945#)
SearchResult TextSearch::NSrchFrwrd( const OUString& searchStr, sal_Int32 startPos, sal_Int32 endPos )
throw(RuntimeException)
{
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.hxx b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.hxx
index 680a1be74f41..b1be7cefc1a9 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.hxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.hxx
@@ -70,9 +70,11 @@ namespace jfw_plugin
#define JFW_PLUGIN_ARCH "ia64"
#elif defined M68K
#define JFW_PLUGIN_ARCH "m68k"
-#else // SPARC, INTEL, POWERPC, MIPS, ARM, IA64, M68K
+#elif defined HPPA
+#define JFW_PLUGIN_ARCH "parisc"
+#else // SPARC, INTEL, POWERPC, MIPS, ARM, IA64, M68K, HPPA
#error unknown plattform
-#endif // SPARC, INTEL, POWERPC, MIPS, ARM
+#endif // SPARC, INTEL, POWERPC, MIPS, ARM, IA64, M68K, HPPA
class MalformedVersionException
diff --git a/moz/makefile.mk b/moz/makefile.mk
index 3722229bf74d..b28605f6a073 100644
--- a/moz/makefile.mk
+++ b/moz/makefile.mk
@@ -183,6 +183,10 @@ CXXFLAGS+=-m64
.ENDIF
.EXPORT : CXXFLAGS
.ENDIF # "$(COMNAME)"=="sunpro5"
+.IF "$(COM)$(OS)$(CPUNAME)" == "GCCLINUXPOWERPC64"
+CXXFLAGS:=-mminimal-toc
+.EXPORT : CXXFLAGS
+.ENDIF
.ENDIF
.IF "$(OS)"=="SOLARIS" && "$(CPUNAME)"=="SPARC" && "$(CPU)"=="U"
diff --git a/nss/makefile.mk b/nss/makefile.mk
index 4ddd2b39015f..26bc88c80146 100644
--- a/nss/makefile.mk
+++ b/nss/makefile.mk
@@ -58,7 +58,7 @@ BUILD_OPT=1
.IF "$(GUI)"=="UNX"
.IF "$(OS)$(COM)"=="LINUXGCC"
-.IF "$(CPU)"=="X"
+.IF "$(BUILD64)"=="1"
# force 64-bit buildmode
USE_64:=1
.EXPORT : USE_64
diff --git a/nss/nss.patch b/nss/nss.patch
index d37d892dd6b8..32831ea29d52 100644
--- a/nss/nss.patch
+++ b/nss/nss.patch
@@ -1,5 +1,5 @@
--- misc/mozilla/nsprpub/config/rules.mk 2009-05-02 01:08:01.000000000 +0200
-+++ misc/build/mozilla/nsprpub/config/rules.mk 2009-09-17 10:29:39.823155149 +0200
++++ misc/build/mozilla/nsprpub/config/rules.mk 2009-10-20 17:03:24.733286198 +0200
@@ -350,7 +350,12 @@
ifdef NS_USE_GCC
$(RC) $(RCFLAGS) $(filter-out -U%,$(DEFINES)) $(INCLUDES:-I%=--include-dir %) -o $@ $<
@@ -15,7 +15,7 @@
@echo $(RES) finished
endif
--- misc/mozilla/nsprpub/configure 2009-05-08 15:12:31.000000000 +0200
-+++ misc/build/mozilla/nsprpub/configure 2009-09-17 10:31:55.064081763 +0200
++++ misc/build/mozilla/nsprpub/configure 2009-10-20 17:03:24.759501457 +0200
@@ -3898,7 +3898,7 @@
PR_MD_CSRCS=linux.c
MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
@@ -26,7 +26,7 @@
_DEBUG_FLAGS="-g -fno-inline" # most people on linux use gcc/gdb, and that
# combo is not yet good at debugging inlined
--- misc/mozilla/security/coreconf/Darwin.mk 2009-07-30 23:36:02.000000000 +0200
-+++ misc/build/mozilla/security/coreconf/Darwin.mk 2009-09-17 11:11:36.442683705 +0200
++++ misc/build/mozilla/security/coreconf/Darwin.mk 2009-10-20 17:03:24.767804881 +0200
@@ -39,8 +39,12 @@
DEFAULT_COMPILER = cc
@@ -43,7 +43,7 @@
ifndef CPU_ARCH
--- misc/mozilla/security/coreconf/Linux.mk 2009-07-30 01:43:41.000000000 +0200
-+++ misc/build/mozilla/security/coreconf/Linux.mk 2009-09-17 10:39:40.372245066 +0200
++++ misc/build/mozilla/security/coreconf/Linux.mk 2009-10-20 17:04:09.972612751 +0200
@@ -46,8 +46,11 @@
IMPL_STRATEGY = _PTH
endif
@@ -67,8 +67,22 @@
DSO_LDFLAGS =
LDFLAGS += $(ARCHFLAG)
+@@ -161,8 +164,13 @@
+ #
+ CPU_TAG = _$(CPU_ARCH)
+
++ifeq ($(SYSTEM_ZLIB),YES)
++# Currently (3.12.4) only the tools modutil and signtool are linked with libz
++# If USE_SYSTEM_ZLIB is not set then the tools link statically libzlib.a which
++# is also build in nss.
+ USE_SYSTEM_ZLIB = 1
+ ZLIB_LIBS = -lz
++endif
+
+ # The -rpath '$$ORIGIN' linker option instructs this library to search for its
+ # dependencies in the same directory where it resides.
--- misc/mozilla/security/coreconf/SunOS5.mk 2009-06-11 02:55:32.000000000 +0200
-+++ misc/build/mozilla/security/coreconf/SunOS5.mk 2009-09-17 10:42:17.845459669 +0200
++++ misc/build/mozilla/security/coreconf/SunOS5.mk 2009-10-20 17:03:24.786509911 +0200
@@ -89,8 +89,12 @@
# OPTIMIZER += -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer
endif
@@ -85,7 +99,7 @@
OS_CFLAGS += $(NOMD_OS_CFLAGS) $(ARCHFLAG)
ifndef BUILD_OPT
--- misc/mozilla/security/coreconf/arch.mk 2009-06-05 04:14:49.000000000 +0200
-+++ misc/build/mozilla/security/coreconf/arch.mk 2009-09-17 10:45:27.710858021 +0200
++++ misc/build/mozilla/security/coreconf/arch.mk 2009-10-20 17:03:24.807236644 +0200
@@ -324,7 +324,12 @@
# IMPL_STRATEGY may be defined too.
#
@@ -101,7 +115,7 @@
ifeq (,$(filter-out WIN%,$(OS_TARGET)))
ifndef BUILD_OPT
--- misc/mozilla/security/coreconf/rules.mk 2009-08-11 05:23:39.000000000 +0200
-+++ misc/build/mozilla/security/coreconf/rules.mk 2009-09-17 10:48:07.361462582 +0200
++++ misc/build/mozilla/security/coreconf/rules.mk 2009-10-20 17:03:24.815121351 +0200
@@ -355,7 +355,12 @@
ifdef NS_USE_GCC
$(RC) $(filter-out -U%,$(DEFINES)) $(INCLUDES:-I%=--include-dir %) -o $@ $<
@@ -117,7 +131,7 @@
@echo $(RES) finished
endif
--- misc/mozilla/security/nss/cmd/platlibs.mk 2009-06-18 01:01:48.000000000 +0200
-+++ misc/build/mozilla/security/nss/cmd/platlibs.mk 2009-09-17 11:08:16.697236076 +0200
++++ misc/build/mozilla/security/nss/cmd/platlibs.mk 2009-10-20 17:03:24.831220397 +0200
@@ -41,27 +41,28 @@
ifeq ($(OS_ARCH), SunOS)
ifeq ($(BUILD_SUN_PKG), 1)
diff --git a/officecfg/registry/data/org/openoffice/Office/Common.xcu b/officecfg/registry/data/org/openoffice/Office/Common.xcu
index c9747dc9dea0..c9e64be54ee5 100644
--- a/officecfg/registry/data/org/openoffice/Office/Common.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/Common.xcu
@@ -521,6 +521,14 @@
<prop oor:name="DynamicBorderColors" oor:type="xs:boolean">
<value>true</value>
</prop>
+ <prop oor:name="UseDocumentTextMetrics" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ </node>
+ <node oor:name="com.sun.star.sheet.SpreadsheetDocument">
+ <prop oor:name="UseDocumentTextMetrics" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
</node>
</node>
</node>
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index 246b1bcdb974..f9df58b8e30c 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -844,11 +844,28 @@
</prop>
<prop oor:name="DynamicBorderColors" oor:type="xs:boolean">
<info>
- <desc>specifies whether the controls should use dynamic border coloring, if possible.
-Dymamic border coloring means that when the mouse is hovered over a control, and when a control receives the focus, this is indicated with special border colors.</desc>
+ <desc>
+ specifies whether the controls should use dynamic border coloring, if possible.
+ Dymamic border coloring means that when the mouse is hovered over a control, and when a control receives the focus, this is indicated with special border colors.
+ </desc>
</info>
<value>false</value>
</prop>
+ <prop oor:name="UseDocumentTextMetrics" oor:type="xs:boolean">
+ <info>
+ <desc>
+ controls whether form controls, when they render their text, use the same metrics as the document
+ does. If this is set to &lt;true&gt;, then the control text's appearance better matches the text
+ in the surrounding document.&lt;/p&gt;
+ &lt;p&gt;Technically, documents use a reference device for formatting, which usually has a higher
+ resolution than the actual output device. The option decides whether form controls should use
+ the same reference device as the surrounding document. However, some of OOo's document implementations
+ do not properly use their reference device in all situations, in which case the option might better
+ be disabled.&lt;p&gt;
+ </desc>
+ </info>
+ <value>true</value>
+ </prop>
</group>
<group oor:name="ProductVersionID">
<info>
@@ -1158,8 +1175,8 @@ Dymamic border coloring means that when the mouse is hovered over a control, and
<desc>
This switch decides if Interactions in the DrawingLayer are visualized using Wireframe or Full-Object
previews. If false, only Wireframe will be used. If true, Full-Object preview which gives a much better
- feedback about the object interaction will be used. This mode is used for modification and creation of
- objects. During interaction, a geometric copy of the object(s) is shown with 50% transparence in the
+ feedback about the object interaction will be used. This mode is used for modification and creation of
+ objects. During interaction, a geometric copy of the object(s) is shown with 50% transparence in the
foreground. That copy shows exactly what You will get when You end the interaction.
</desc>
<label>This switch determines if DrawingLayer Interactions show Wireframe or Full-Object preview.</label>
@@ -1181,7 +1198,8 @@ Dymamic border coloring means that when the mouse is hovered over a control, and
<prop oor:name="QuadraticFormControlRenderLimit" oor:type="xs:int">
<info>
<author>AW</author>
- <desc>This defines a Limitation for the default raster conversion of FormControls in edit mode.
+ <desc>
+ This defines a Limitation for the default raster conversion of FormControls in edit mode.
These have the ability to be displayed using this fallback to Bitmaps.
The number is the maximum number of pixels to use, e.g. 300x150 Pixels is allowed as default.
When FormControls would need more Pixels than this, the Bitmap will be limited and scaled to the needed pixel size at paint time.
@@ -1194,8 +1212,8 @@ Dymamic border coloring means that when the mouse is hovered over a control, and
<info>
<author>AW</author>
<desc>
- This switch defines if the selections in the applications (text or cells) are visualized using
- inverse (XOR) when set to false (the old selection method, also used when in HighContrast mode)
+ This switch defines if the selections in the applications (text or cells) are visualized using
+ inverse (XOR) when set to false (the old selection method, also used when in HighContrast mode)
or a transparent overlay selection using the system's selection color.
</desc>
<label>This switch defines if for text/cell selections the old inverse or the new transparent selection is to be used.</label>
@@ -6524,7 +6542,7 @@ Dymamic border coloring means that when the mouse is hovered over a control, and
<desc>Contains settings for smart tags.</desc>
</info>
<group oor:name="Writer">
- <info>
+ <info>
<author>FME</author>
<desc>Contains Writer specific settings for smart tags.</desc>
</info>
diff --git a/oox/inc/oox/core/namespaces.hxx b/oox/inc/oox/core/namespaces.hxx
deleted file mode 100644
index 643e595b8051..000000000000
--- a/oox/inc/oox/core/namespaces.hxx
+++ /dev/null
@@ -1,104 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: namespaces.hxx,v $
- * $Revision: 1.5.4.1 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef OOX_CORE_NAMESPACES_HXX
-#define OOX_CORE_NAMESPACES_HXX
-
-#include <sal/types.h>
-
-namespace oox {
-
-// ============================================================================
-
-// relations, XML
-const sal_Int32 NMSP_XML = 1 << 16;
-const sal_Int32 NMSP_PACKAGE_RELATIONSHIPS = 2 << 16;
-const sal_Int32 NMSP_RELATIONSHIPS = 3 << 16;
-const sal_Int32 NMSP_CONTENT_TYPES = 4 << 16;
-// office global
-const sal_Int32 NMSP_ACTIVATION = 12 << 16;
-// DrawingML
-const sal_Int32 NMSP_DRAWINGML = 21 << 16;
-const sal_Int32 NMSP_DIAGRAM = 22 << 16;
-const sal_Int32 NMSP_CHART = 23 << 16;
-// VML
-const sal_Int32 NMSP_VML = 31 << 16;
-const sal_Int32 NMSP_OFFICE = 32 << 16;
-const sal_Int32 NMSP_VML_DOC = 33 << 16; // Word VML
-const sal_Int32 NMSP_VML_XLS = 34 << 16; // Excel VML
-const sal_Int32 NMSP_VML_PPT = 35 << 16; // PowerPoint VML
-const sal_Int32 NMSP_AX = 36 << 16; // ActiveX (for OCX form controls)
-// SpreadsheetML
-const sal_Int32 NMSP_XLS = 41 << 16;
-const sal_Int32 NMSP_XDR = 42 << 16; // SpreadsheetDrawingML
-const sal_Int32 NMSP_XM = 43 << 16; // Macro sheet
-// PresentationML
-const sal_Int32 NMSP_PPT = 51 << 16;
-// Document properties
-const sal_Int32 NMSP_COREPR = 61 << 16;
-const sal_Int32 NMSP_DC = 62 << 16;
-const sal_Int32 NMSP_DCTERMS = 63 << 16;
-const sal_Int32 NMSP_EXTPR = 64 << 16;
-const sal_Int32 NMSP_CUSTPR = 65 << 16;
-const sal_Int32 NMSP_VT = 66 << 16;
-
-// ----------------------------------------------------------------------------
-
-const sal_Int32 TOKEN_MASK = SAL_MAX_UINT16;
-const sal_Int32 NMSP_MASK = SAL_MAX_INT16 << 16;
-
-/** Returns the token identifier of the passed element without namespace. */
-inline sal_Int32 getToken( sal_Int32 nElement ) { return nElement & TOKEN_MASK; }
-
-/** Returns the namespace of the passed element without token identifier. */
-inline sal_Int32 getNamespace( sal_Int32 nElement ) { return nElement & NMSP_MASK; }
-
-// ----------------------------------------------------------------------------
-
-// defines for tokens with specific namespaces, can be used in switch/cases
-#define A_TOKEN( token ) (::oox::NMSP_DRAWINGML | XML_##token)
-#define AX_TOKEN( token ) (::oox::NMSP_AX | XML_##token)
-#define C_TOKEN( token ) (::oox::NMSP_CHART | XML_##token)
-#define O_TOKEN( token ) (::oox::NMSP_OFFICE | XML_##token)
-#define PPT_TOKEN( token ) (::oox::NMSP_PPT | XML_##token)
-#define R_TOKEN( token ) (::oox::NMSP_RELATIONSHIPS | XML_##token)
-#define VML_TOKEN( token ) (::oox::NMSP_VML | XML_##token)
-#define VMLX_TOKEN( token ) (::oox::NMSP_VML_XLS | XML_##token)
-#define XDR_TOKEN( token ) (::oox::NMSP_XDR | XML_##token)
-#define XLS_TOKEN( token ) (::oox::NMSP_XLS | XML_##token)
-#define XM_TOKEN( token ) (::oox::NMSP_XM | XML_##token)
-#define XML_TOKEN( token ) (::oox::NMSP_XML | XML_##token)
-
-// ============================================================================
-
-} // namespace oox
-
-#endif // OOX_CORE_NAMESPACES_HXX
-
diff --git a/oox/prj/d.lst b/oox/prj/d.lst
index 50ec05955ca6..2c9d8d5bae74 100644
--- a/oox/prj/d.lst
+++ b/oox/prj/d.lst
@@ -18,6 +18,7 @@ mkdir: %_DEST%\inc%_EXT%\oox\vml
..\%__SRC%\inc\tokens.hxx %_DEST%\inc%_EXT%\oox\core\tokens.hxx
..\source\token\tokens.txt %_DEST%\inc%_EXT%\oox\token.txt
+..\source\token\namespaces.txt %_DEST%\inc%_EXT%\oox\namespaces.txt
..\inc\oox\dllapi.h %_DEST%\inc%_EXT%\oox\dllapi.h
..\inc\oox\helper\binarystreambase.hxx %_DEST%\inc%_EXT%\oox\helper\binarystreambase.hxx
..\inc\oox\helper\helper.hxx %_DEST%\inc%_EXT%\oox\helper\helper.hxx
diff --git a/oox/source/core/filterbase.cxx b/oox/source/core/filterbase.cxx
index c5b423380e82..f2f9ef09b9e5 100644
--- a/oox/source/core/filterbase.cxx
+++ b/oox/source/core/filterbase.cxx
@@ -600,7 +600,7 @@ sal_Bool SAL_CALL FilterBase::filter( const Sequence< PropertyValue >& rMediaDes
{
setMediaDescriptor( rMediaDescSeq );
DocumentOpenedGuard aOpenedGuard( mxImpl->maFileUrl );
- if( aOpenedGuard.isValid() )
+ if( aOpenedGuard.isValid() || !mxImpl->maFileUrl.getLength() )
{
mxImpl->initializeFilter();
switch( mxImpl->meDirection )
diff --git a/oox/source/docprop/docprophandler.cxx b/oox/source/docprop/docprophandler.cxx
index 185a061acea4..3e5a4830b691 100644
--- a/oox/source/docprop/docprophandler.cxx
+++ b/oox/source/docprop/docprophandler.cxx
@@ -78,13 +78,15 @@ void OOXMLDocPropHandler::AddCustomProperty( const uno::Any& aAny )
{
if ( m_aCustomPropertyName.getLength() )
{
- uno::Reference< beans::XPropertyContainer > xUserProps = m_xDocProp->getUserDefinedProperties();
+ const uno::Reference< beans::XPropertyContainer > xUserProps =
+ m_xDocProp->getUserDefinedProperties();
if ( !xUserProps.is() )
throw uno::RuntimeException();
try
{
- xUserProps->addProperty( m_aCustomPropertyName, beans::PropertyAttribute::TRANSIENT, aAny );
+ xUserProps->addProperty( m_aCustomPropertyName,
+ beans::PropertyAttribute::REMOVEABLE, aAny );
}
catch( beans::PropertyExistException& )
{
diff --git a/oox/source/shape/ShapeContextHandler.cxx b/oox/source/shape/ShapeContextHandler.cxx
index 8f5165726710..204ed459c7fc 100644
--- a/oox/source/shape/ShapeContextHandler.cxx
+++ b/oox/source/shape/ShapeContextHandler.cxx
@@ -33,6 +33,11 @@
#include "oox/vml/vmlshape.hxx"
#include "oox/vml/vmlshapecontainer.hxx"
+#if DEBUG
+#include <iostream>
+using namespace std;
+#endif
+
namespace oox { namespace shape {
using namespace ::com::sun::star;
@@ -90,6 +95,9 @@ ShapeContextHandler::getGraphicShapeContext(::sal_Int32 Element )
uno::Reference<xml::sax::XFastContextHandler>
ShapeContextHandler::getDrawingShapeContext()
{
+#if DEBUG
+ clog << "ShapeContextHandler::getDrawingShapeContext" << endl;
+#endif
if (!mxDrawingFragmentHandler.is())
{
mpDrawing.reset( new oox::vml::Drawing( *mxFilterBase, mxDrawPage, oox::vml::VMLDRAWING_WORD ) );
@@ -109,6 +117,7 @@ ShapeContextHandler::getContextHandler()
switch (mnStartToken & NMSP_MASK)
{
+ case NMSP_DOC:
case NMSP_VML:
xResult.set(getDrawingShapeContext());
break;
@@ -179,6 +188,9 @@ ShapeContextHandler::createFastChildContext
const uno::Reference< xml::sax::XFastAttributeList > & Attribs)
throw (uno::RuntimeException, xml::sax::SAXException)
{
+#if DEBUG
+ clog << "ShapeContextHandler::createFastChildContext" << endl;
+#endif
uno::Reference< xml::sax::XFastContextHandler > xResult;
uno::Reference< xml::sax::XFastContextHandler > xContextHandler(getContextHandler());
diff --git a/oox/source/token/gennamespaces.pl b/oox/source/token/gennamespaces.pl
new file mode 100644
index 000000000000..b3d277b85c2f
--- /dev/null
+++ b/oox/source/token/gennamespaces.pl
@@ -0,0 +1,65 @@
+$ARGV0 = shift @ARGV;
+$ARGV1 = shift @ARGV;
+
+open ( NAMESPACES, $ARGV0 ) || die "can't open namespaces file: $!";
+
+
+open ( HXX, ">$ARGV1" ) or die "can't open namespaces.hxx file: $!";
+
+print ( HXX "#ifndef OOX_NAMESPACES_HXX\n" );
+print ( HXX "#define OOX_NAMESPACES_HXX\n\n" );
+print ( HXX "#include <sal/types.h>\n\n" );
+print ( HXX "namespace oox {\n\n" );
+
+$group = 0;
+$i = 1;
+while ( <NAMESPACES> )
+{
+ chomp( $_ );
+ $_ =~ s/\s*//g;
+ if ( $_ =~ m/^$/ )
+ {
+ # Start a new group
+ print ( HXX "\n" );
+ $i = 0;
+ $group++;
+ }
+ elsif ( $_ =~ m/^[^#]/ )
+ {
+ # Neither an empty line nor a comment
+ $_ =~ /^[a-zA-Z0-9-_]+$/ or die "Invalid namespace token $_";
+ $id = "NMSP_$_";
+ $id =~ s/-/_/g;
+ $no = $group*10 + $i;
+ print ( HXX "const sal_Int32 $id = $no << 16;\n" );
+ ++$i;
+ }
+}
+close ( NAMESPACES );
+
+print ( HXX "\nconst sal_Int32 TOKEN_MASK = SAL_MAX_UINT16;\n" );
+print ( HXX "const sal_Int32 NMSP_MASK = SAL_MAX_INT16 << 16;\n" );
+
+print ( HXX "/** Returns the token identifier of the passed element without namespace. */\n" );
+print ( HXX "inline sal_Int32 getToken( sal_Int32 nElement ) { return nElement & TOKEN_MASK; }\n\n" );
+
+print ( HXX "/** Returns the namespace of the passed element without token identifier. */\n" );
+print ( HXX "inline sal_Int32 getNamespace( sal_Int32 nElement ) { return nElement & NMSP_MASK; }\n\n" );
+
+print ( HXX "// defines for tokens with specific namespaces, can be used in switch/cases\n\n" );
+print ( HXX "#define A_TOKEN( token ) (::oox::NMSP_DRAWINGML | XML_##token)\n" );
+print ( HXX "#define AX_TOKEN( token ) (::oox::NMSP_AX | XML_##token)\n" );
+print ( HXX "#define C_TOKEN( token ) (::oox::NMSP_CHART | XML_##token)\n" );
+print ( HXX "#define O_TOKEN( token ) (::oox::NMSP_OFFICE | XML_##token)\n" );
+print ( HXX "#define PPT_TOKEN( token ) (::oox::NMSP_PPT | XML_##token)\n" );
+print ( HXX "#define R_TOKEN( token ) (::oox::NMSP_RELATIONSHIPS | XML_##token)\n" );
+print ( HXX "#define VML_TOKEN( token ) (::oox::NMSP_VML | XML_##token)\n" );
+print ( HXX "#define VMLX_TOKEN( token ) (::oox::NMSP_VML_XLS | XML_##token)\n" );
+print ( HXX "#define XDR_TOKEN( token ) (::oox::NMSP_XDR | XML_##token)\n" );
+print ( HXX "#define XLS_TOKEN( token ) (::oox::NMSP_XLS | XML_##token)\n" );
+print ( HXX "#define XM_TOKEN( token ) (::oox::NMSP_XM | XML_##token)\n" );
+print ( HXX "#define XML_TOKEN( token ) (::oox::NMSP_XML | XML_##token)\n" );
+
+
+print ( HXX "} // namespace oox\n\n" );
+print ( HXX "#endif // OOX_NAMESPACES_HXX\n" );
diff --git a/oox/source/token/makefile.mk b/oox/source/token/makefile.mk
index 3cce788d2508..cda48a6b11a0 100644
--- a/oox/source/token/makefile.mk
+++ b/oox/source/token/makefile.mk
@@ -51,16 +51,26 @@ SLOFILES = \
.INCLUDE : target.mk
-$(MISC)$/tokens.gperf $(INCCOM)$/tokenwords.inc $(INCCOM)$/tokens.hxx $(INCCOM)$/propertywords.inc $(INCCOM)$/properties.hxx :
+$(MISC)$/tokens.gperf $(INCCOM)$/tokenwords.inc $(INCCOM)$/tokens.hxx $(INCCOM)$/propertywords.inc $(INCCOM)$/properties.hxx $(INCCOM)$/oox$/core$/namespaces.hxx :
@@noop $(assign do_phony:=.PHONY)
$(MISC)$/do_tokens $(do_phony) : tokens.txt gentoken.pl $(MISC)$/tokens.gperf $(INCCOM)$/tokenwords.inc $(INCCOM)$/tokens.hxx
- $(PERL) gentoken.pl tokens.txt $(INCCOM)$/tokens.hxx $(INCCOM)$/tokenwords.inc $(MISC)$/tokens.gperf && $(TOUCH) $@
+ $(PERL) gentoken.pl tokens.txt $(INCCOM)$/tokens.hxx $(INCCOM)$/tokenwords.inc $(MISC)$/tokens.gperf && $(TOUCH) $@
+
+$(INCCOM)$/oox:
+ $(MKDIR) $(INCCOM)$/oox
+
+$(INCCOM)$/oox$/core: $(INCCOM)$/oox
+ $(MKDIR) $(INCCOM)$/oox$/core
+
+$(MISC)$/do_namespaces $(do_phony) : namespaces.txt gennamespaces.pl
+ $(MKDIRHIER) $(INCCOM)$/oox$/core
+ $(PERL) gennamespaces.pl namespaces.txt $(INCCOM)$/oox$/core$/namespaces.hxx && $(TOUCH) $@
$(INCCOM)$/tokens.inc : $(MISC)$/tokens.gperf $(MISC)$/do_tokens
$(AUGMENT_LIBRARY_PATH) gperf --compare-strncmp $(MISC)$/tokens.gperf | $(SED) -e "s/(char\*)0/(char\*)0, 0/g" | $(GREP) -v "^#line" >$(INCCOM)$/tokens.inc
-$(SLO)$/tokenmap.obj : $(INCCOM)$/tokens.inc $(INCCOM)$/tokenwords.inc $(INCCOM)$/tokens.hxx $(MISC)$/do_tokens
+$(SLO)$/tokenmap.obj : $(INCCOM)$/tokens.inc $(INCCOM)$/tokenwords.inc $(INCCOM)$/tokens.hxx $(INCCOM)$/oox$/core$/namespaces.hxx $(MISC)$/do_tokens $(MISC)$/do_namespaces
$(MISC)$/do_properties $(do_phony) : properties.txt genproperties.pl $(INCCOM)$/properties.hxx $(INCCOM)$/propertywords.inc
$(PERL) genproperties.pl properties.txt $(INCCOM)$/properties.hxx $(INCCOM)$/propertywords.inc && $(TOUCH) $@
diff --git a/oox/source/token/namespaces.txt b/oox/source/token/namespaces.txt
new file mode 100644
index 000000000000..63ca76e95f54
--- /dev/null
+++ b/oox/source/token/namespaces.txt
@@ -0,0 +1,48 @@
+# Relations, XML
+XML
+PACKAGE_RELATIONSHIPS
+RELATIONSHIPS
+CONTENT_TYPES
+
+# Office global
+THEME
+ACTIVATION
+MATH
+
+#DrawingML
+DRAWINGML
+PICTURE
+DIAGRAM
+CHART
+DOC_DRAWINGML
+
+# VML
+VML
+OFFICE
+VML_DOC
+VML_XLS
+VML_PPT
+AX
+
+#SpreadsheetML
+XLS
+XDR
+XM
+
+#PresentationML
+PPT
+
+#WordprocessingML
+DOC
+SML
+
+# Document properties
+COREPR
+DC
+DCTERMS
+EXTPR
+CUSTPR
+VT
+
+# Other elements: used by writerfilter
+SPRM
diff --git a/pyuno/source/loader/makefile.mk b/pyuno/source/loader/makefile.mk
index 6e4f96ed7014..f9f00e4f13ae 100644
--- a/pyuno/source/loader/makefile.mk
+++ b/pyuno/source/loader/makefile.mk
@@ -42,7 +42,7 @@ DLLPRE =
#-------------------------------------------------------------------
-.IF "$(OS)$(CPU)$(COMEX)" == "SOLARISS4"
+.IF "$(OS)$(COMEX)" == "SOLARIS4"
# no -Bdirect for SunWS CC
DIRECT = $(LINKFLAGSDEFS)
.ENDIF
diff --git a/pyuno/source/module/makefile.mk b/pyuno/source/module/makefile.mk
index 2357d0062ed0..2928d29668aa 100644
--- a/pyuno/source/module/makefile.mk
+++ b/pyuno/source/module/makefile.mk
@@ -42,7 +42,7 @@ LINKFLAGSDEFS = # do not fail with missing symbols
.IF "$(L10N_framework)"==""
#-------------------------------------------------------------------
-.IF "$(OS)$(CPU)$(COMEX)" == "SOLARISS4"
+.IF "$(OS)$(COMEX)" == "SOLARIS4"
# no -Bdirect for SunWS CC
DIRECT = $(LINKFLAGSDEFS)
.ENDIF
diff --git a/pyuno/source/module/pyuno_gc.cxx b/pyuno/source/module/pyuno_gc.cxx
index 513c14a99378..1e0ca08ff954 100644
--- a/pyuno/source/module/pyuno_gc.cxx
+++ b/pyuno/source/module/pyuno_gc.cxx
@@ -43,6 +43,12 @@ public:
};
StaticDestructorGuard guard;
+static bool isAfterUnloadOrPy_Finalize()
+{
+ return g_destructorsOfStaticObjectsHaveBeenCalled ||
+ !Py_IsInitialized();
+}
+
class GCThread : public ::osl::Thread
{
PyObject *mPyObject;
@@ -64,7 +70,7 @@ GCThread::GCThread( PyInterpreterState *interpreter, PyObject * object ) :
void GCThread::run()
{
// otherwise we crash here, when main has been left already
- if( g_destructorsOfStaticObjectsHaveBeenCalled )
+ if( isAfterUnloadOrPy_Finalize() )
return;
try
{
@@ -100,7 +106,7 @@ void GCThread::onTerminated()
void decreaseRefCount( PyInterpreterState *interpreter, PyObject *object )
{
// otherwise we crash in the last after main ...
- if( g_destructorsOfStaticObjectsHaveBeenCalled )
+ if( isAfterUnloadOrPy_Finalize() )
return;
// delegate to a new thread, because there does not seem
diff --git a/sal/rtl/source/macro.hxx b/sal/rtl/source/macro.hxx
index a007d9e1cdab..2f0b723d236a 100644
--- a/sal/rtl/source/macro.hxx
+++ b/sal/rtl/source/macro.hxx
@@ -94,6 +94,8 @@ this is inserted for the case that the preprocessor ignores error
# define THIS_ARCH "IA64"
#elif defined M68K
# define THIS_ARCH "M68K"
+#elif defined HPPA
+# define THIS_ARCH "HPPA"
#endif
#if ! defined THIS_ARCH
diff --git a/sal/typesconfig/typesconfig.c b/sal/typesconfig/typesconfig.c
index 932d80fd979a..c9d6ede62cb7 100644
--- a/sal/typesconfig/typesconfig.c
+++ b/sal/typesconfig/typesconfig.c
@@ -163,7 +163,7 @@ int check( TestFunc func, Type eT, void* p )
|* Letzte Aenderung
|*
*************************************************************************/
-#if defined(IA64) || defined(ARM32)
+#if defined(IA64) || defined(ARM32) || defined(HPPA)
int forceerror()
{
diff --git a/sc/source/core/data/cell.cxx b/sc/source/core/data/cell.cxx
index aea2bf4ff276..cfd7caafa3f3 100644
--- a/sc/source/core/data/cell.cxx
+++ b/sc/source/core/data/cell.cxx
@@ -1641,8 +1641,9 @@ void ScFormulaCell::InterpretTail( ScInterpretTailParameter eTailParam )
if ( eOld == svHybridCell ) // string result from SetFormulaResultString?
eOld = svString; // ScHybridCellToken has a valid GetString method
+ // #i106045# use approxEqual to compare with stored value
bContentChanged = (eOld != eNew ||
- (eNew == svDouble && aResult.GetDouble() != aNewResult.GetDouble()) ||
+ (eNew == svDouble && !rtl::math::approxEqual( aResult.GetDouble(), aNewResult.GetDouble() )) ||
(eNew == svString && aResult.GetString() != aNewResult.GetString()));
}
}
@@ -1662,7 +1663,8 @@ void ScFormulaCell::InterpretTail( ScInterpretTailParameter eTailParam )
if ( bChanged && !bContentChanged && pDocument->IsStreamValid(aPos.Tab()) )
{
if ( ( eOld == svUnknown && ( eNew == svError || ( eNew == svDouble && aNewResult.GetDouble() == 0.0 ) ) ) ||
- ( eOld == svHybridCell && eNew == svString && aResult.GetString() == aNewResult.GetString() ) )
+ ( eOld == svHybridCell && eNew == svString && aResult.GetString() == aNewResult.GetString() ) ||
+ ( eOld == svDouble && eNew == svDouble && rtl::math::approxEqual( aResult.GetDouble(), aNewResult.GetDouble() ) ) )
{
// no change, see above
}
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 8b04d5a0500e..077983b4382b 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -476,6 +476,12 @@ BOOL ScDocument::RenameTab( SCTAB nTab, const String& rName, BOOL /* bUpdateRef
if ( pChartListenerCollection )
pChartListenerCollection->UpdateChartsContainingTab( nTab );
pTab[nTab]->SetName(rName);
+
+ // If formulas refer to the renamed sheet, the TokenArray remains valid,
+ // but the XML stream must be re-generated.
+ for (i=0; i<=MAXTAB; ++i)
+ if (pTab[i] && pTab[i]->IsStreamValid())
+ pTab[i]->SetStreamValid( FALSE );
}
}
return bValid;
diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx
index 10197e3a9ad5..403377342661 100644
--- a/sc/source/core/data/table1.cxx
+++ b/sc/source/core/data/table1.cxx
@@ -238,6 +238,8 @@ void ScTable::SetName( const String& rNewName )
bIsOlk = bOderSo = TRUE;
aName = rNewName;
aUpperName.Erase(); // invalidated if the name is changed
+
+ // SetStreamValid is handled in ScDocument::RenameTab
}
const String& ScTable::GetUpperName() const
@@ -291,6 +293,9 @@ void ScTable::SetLink( BYTE nMode,
aLinkOpt = rOpt; // Filter-Optionen
aLinkTab = rTab; // Tabellenname in Quelldatei
nLinkRefreshDelay = nRefreshDelay; // refresh delay in seconds, 0==off
+
+ if (IsStreamValid())
+ SetStreamValid(FALSE);
}
USHORT ScTable::GetOptimalColWidth( SCCOL nCol, OutputDevice* pDev,
@@ -1457,17 +1462,26 @@ void ScTable::DoColResize( SCCOL nCol1, SCCOL nCol2, SCSIZE nAdd )
void ScTable::SetRepeatColRange( const ScRange* pNew )
{
SET_PRINTRANGE( pRepeatColRange, pNew );
+
+ if (IsStreamValid())
+ SetStreamValid(FALSE);
}
void ScTable::SetRepeatRowRange( const ScRange* pNew )
{
SET_PRINTRANGE( pRepeatRowRange, pNew );
+
+ if (IsStreamValid())
+ SetStreamValid(FALSE);
}
void ScTable::ClearPrintRanges()
{
aPrintRanges.clear();
bPrintEntireSheet = FALSE;
+
+ if (IsStreamValid())
+ SetStreamValid(FALSE);
}
void ScTable::AddPrintRange( const ScRange& rNew )
@@ -1475,6 +1489,9 @@ void ScTable::AddPrintRange( const ScRange& rNew )
bPrintEntireSheet = FALSE;
if( aPrintRanges.size() < 0xFFFF )
aPrintRanges.push_back( rNew );
+
+ if (IsStreamValid())
+ SetStreamValid(FALSE);
}
//UNUSED2009-05 void ScTable::SetPrintRange( const ScRange& rNew )
diff --git a/sc/source/core/data/table5.cxx b/sc/source/core/data/table5.cxx
index eb959dfb2ffa..4a0cd9e135d5 100644
--- a/sc/source/core/data/table5.cxx
+++ b/sc/source/core/data/table5.cxx
@@ -249,6 +249,9 @@ void ScTable::RemoveManualBreaks()
if (pRowFlags)
pRowFlags->AndValue( 0, MAXROW, sal::static_int_cast<BYTE>(~CR_MANUALBREAK) );
+
+ if (IsStreamValid())
+ SetStreamValid(FALSE);
}
BOOL ScTable::HasManualBreaks() const
@@ -287,6 +290,9 @@ void ScTable::SetProtection(const ScTableProtection* pProtect)
pTabProtection.reset(new ScTableProtection(*pProtect));
else
pTabProtection.reset(NULL);
+
+ if (IsStreamValid())
+ SetStreamValid(FALSE);
}
ScTableProtection* ScTable::GetProtection()
diff --git a/sc/source/filter/excel/xename.cxx b/sc/source/filter/excel/xename.cxx
index ace7a66dc1f9..004fbfa2932c 100644
--- a/sc/source/filter/excel/xename.cxx
+++ b/sc/source/filter/excel/xename.cxx
@@ -636,10 +636,13 @@ void XclExpNameManagerImpl::CreateBuiltInNames()
// Calc document does not care about sheet index in print ranges
aRange.aStart.SetTab( nScTab );
aRange.aEnd.SetTab( nScTab );
+ aRange.Justify();
aRangeList.Append( aRange );
}
- GetAddressConverter().ValidateRangeList( aRangeList, true );
- GetNameManager().InsertBuiltInName( EXC_BUILTIN_PRINTAREA, aRangeList );
+ // create the NAME record (do not warn if ranges are shrunken)
+ GetAddressConverter().ValidateRangeList( aRangeList, false );
+ if( aRangeList.Count() > 0 )
+ GetNameManager().InsertBuiltInName( EXC_BUILTIN_PRINTAREA, aRangeList );
}
// *** 2) print titles *** ----------------------------------------
@@ -656,8 +659,9 @@ void XclExpNameManagerImpl::CreateBuiltInNames()
0, pRowRange->aStart.Row(), nScTab,
GetXclMaxPos().Col(), pRowRange->aEnd.Row(), nScTab ) );
// create the NAME record
- GetAddressConverter().ValidateRangeList( aTitleList, true );
- GetNameManager().InsertBuiltInName( EXC_BUILTIN_PRINTTITLES, aTitleList );
+ GetAddressConverter().ValidateRangeList( aTitleList, false );
+ if( aTitleList.Count() > 0 )
+ GetNameManager().InsertBuiltInName( EXC_BUILTIN_PRINTTITLES, aTitleList );
// *** 3) filter ranges *** ---------------------------------------
diff --git a/sc/source/ui/docshell/arealink.cxx b/sc/source/ui/docshell/arealink.cxx
index fd3a562ecb42..fa00559b4f27 100644
--- a/sc/source/ui/docshell/arealink.cxx
+++ b/sc/source/ui/docshell/arealink.cxx
@@ -172,6 +172,10 @@ void __EXPORT ScAreaLink::Closed()
bAddUndo = FALSE; // nur einmal
}
+ SCTAB nDestTab = aDestArea.aStart.Tab();
+ if (pDoc->IsStreamValid(nDestTab))
+ pDoc->SetStreamValid(nDestTab, FALSE);
+
SvBaseLink::Closed();
}
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index cb5d2ead509f..f9039a88f658 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -3079,6 +3079,9 @@ BOOL ScDocFunc::InsertPageBreak( BOOL bColumn, const ScAddress& rPos,
pDoc->SetRowFlags( static_cast<SCROW>(nPos), nTab, nFlags );
pDoc->UpdatePageBreaks( nTab );
+ if (pDoc->IsStreamValid(nTab))
+ pDoc->SetStreamValid(nTab, FALSE);
+
if (bColumn)
{
rDocShell.PostPaint( static_cast<SCCOL>(nPos)-1, 0, nTab, MAXCOL, MAXROW, nTab, PAINT_GRID );
@@ -3135,6 +3138,9 @@ BOOL ScDocFunc::RemovePageBreak( BOOL bColumn, const ScAddress& rPos,
pDoc->SetRowFlags( static_cast<SCROW>(nPos), nTab, nFlags );
pDoc->UpdatePageBreaks( nTab );
+ if (pDoc->IsStreamValid(nTab))
+ pDoc->SetStreamValid(nTab, FALSE);
+
if (bColumn)
{
rDocShell.PostPaint( static_cast<SCCOL>(nPos)-1, 0, nTab, MAXCOL, MAXROW, nTab, PAINT_GRID );
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index f7d1e2ccae2f..3d1226ae576d 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -2390,9 +2390,9 @@ void ScDocShell::SetDrawModified( BOOL bIsModified /* = TRUE */ )
SetModified( bIsModified );
+ SfxBindings* pBindings = GetViewBindings();
if (bUpdate)
{
- SfxBindings* pBindings = GetViewBindings();
if (pBindings)
{
pBindings->Invalidate( SID_SAVEDOC );
@@ -2402,6 +2402,16 @@ void ScDocShell::SetDrawModified( BOOL bIsModified /* = TRUE */ )
if (bIsModified)
{
+ if (pBindings)
+ {
+ // #i105960# Undo etc used to be volatile.
+ // They always have to be invalidated, including drawing layer or row height changes
+ // (but not while pPaintLockData is set).
+ pBindings->Invalidate( SID_UNDO );
+ pBindings->Invalidate( SID_REDO );
+ pBindings->Invalidate( SID_REPEAT );
+ }
+
if ( aDocument.IsChartListenerCollectionNeedsUpdate() )
{
aDocument.UpdateChartListenerCollection();
diff --git a/sc/source/ui/docshell/docsh5.cxx b/sc/source/ui/docshell/docsh5.cxx
index b7c726deeb71..5b2da76475df 100644
--- a/sc/source/ui/docshell/docsh5.cxx
+++ b/sc/source/ui/docshell/docsh5.cxx
@@ -840,8 +840,9 @@ BOOL ScDocShell::MoveTable( SCTAB nSrcTab, SCTAB nDestTab, BOOL bCopy, BOOL bRec
ScDocShellModificator aModificator( *this );
// #i92477# be consistent with ScDocFunc::InsertTable: any index past the last sheet means "append"
+ // #i101139# nDestTab must be the target position, not APPEND (for CopyTabProtection etc.)
if ( nDestTab >= aDocument.GetTableCount() )
- nDestTab = SC_TAB_APPEND;
+ nDestTab = aDocument.GetTableCount();
if (bCopy)
{
diff --git a/sc/source/ui/docshell/olinefun.cxx b/sc/source/ui/docshell/olinefun.cxx
index 1da178aaa0c2..20ffb63f43fd 100644
--- a/sc/source/ui/docshell/olinefun.cxx
+++ b/sc/source/ui/docshell/olinefun.cxx
@@ -137,6 +137,9 @@ BOOL ScOutlineDocFunc::MakeOutline( const ScRange& rRange, BOOL bColumns, BOOL b
pUndoTab, bColumns, TRUE ) );
}
+ if (pDoc->IsStreamValid(nTab))
+ pDoc->SetStreamValid(nTab, FALSE);
+
USHORT nParts = 0; // Datenbereich nicht geaendert
if ( bColumns )
nParts |= PAINT_TOP;
@@ -200,6 +203,9 @@ BOOL ScOutlineDocFunc::RemoveOutline( const ScRange& rRange, BOOL bColumns, BOOL
pUndoTab, bColumns, FALSE ) );
}
+ if (pDoc->IsStreamValid(nTab))
+ pDoc->SetStreamValid(nTab, FALSE);
+
USHORT nParts = 0; // Datenbereich nicht geaendert
if ( bColumns )
nParts |= PAINT_TOP;
@@ -265,6 +271,9 @@ BOOL ScOutlineDocFunc::RemoveAllOutlines( SCTAB nTab, BOOL bRecord, BOOL bApi )
pDoc->UpdatePageBreaks( nTab );
+ if (pDoc->IsStreamValid(nTab))
+ pDoc->SetStreamValid(nTab, FALSE);
+
rDocShell.PostPaint( 0,0,nTab, MAXCOL,MAXROW,nTab,
PAINT_GRID | PAINT_LEFT | PAINT_TOP | PAINT_SIZE );
rDocShell.SetDocumentModified();
@@ -333,6 +342,9 @@ BOOL ScOutlineDocFunc::AutoOutline( const ScRange& rRange, BOOL bRecord, BOOL bA
pUndoDoc, pUndoTab ) );
}
+ if (pDoc->IsStreamValid(nTab))
+ pDoc->SetStreamValid(nTab, FALSE);
+
rDocShell.PostPaint( 0,0,nTab, MAXCOL,MAXROW,nTab, PAINT_LEFT | PAINT_TOP | PAINT_SIZE );
rDocShell.SetDocumentModified();
lcl_InvalidateOutliner( rDocShell.GetViewBindings() );
diff --git a/sc/source/ui/inc/privsplt.hxx b/sc/source/ui/inc/privsplt.hxx
index d3b7c9ad96b8..901fa6c87eb9 100644
--- a/sc/source/ui/inc/privsplt.hxx
+++ b/sc/source/ui/inc/privsplt.hxx
@@ -54,6 +54,7 @@ class ScPrivatSplit : public Control
short nDeltaX;
short nDeltaY;
+ using Control::ImplInitSettings;
void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
diff --git a/scp2/source/ooo/file_library_ooo.scp b/scp2/source/ooo/file_library_ooo.scp
index 16855101dfd2..a49efd11958f 100644
--- a/scp2/source/ooo/file_library_ooo.scp
+++ b/scp2/source/ooo/file_library_ooo.scp
@@ -1561,6 +1561,9 @@ End
#ifndef DISABLE_NEON
SPECIAL_UNO_LIB_FILE_PATCH(gid_File_Lib_Ucpdav1,ucpdav1)
+ #ifndef SYSTEM_NEON
+ SPECIAL_LIB_FILE(gid_File_Lib_Neon,neon)
+ #endif
#endif
SPECIAL_UNO_LIB_FILE_PATCH(gid_File_Lib_Ucpfile1,ucpfile1)
diff --git a/scp2/source/ooo/makefile.mk b/scp2/source/ooo/makefile.mk
index 0d85cc529b63..24027743d58a 100644
--- a/scp2/source/ooo/makefile.mk
+++ b/scp2/source/ooo/makefile.mk
@@ -212,6 +212,9 @@ SCPDEFS+=-DISOLANG_MAJOR=$(ISOLANG_MAJOR)
.IF "$(DISABLE_NEON)" == "TRUE"
SCPDEFS+=-DDISABLE_NEON
.ENDIF
+.IF "$(SYSTEM_NEON)" == "YES"
+SCPDEFS+=-DSYSTEM_NEON
+.ENDIF
# if yes or unset (neon not used) -> do not install openssl library!
.IF $(SYSTEM_OPENSSL) != "YES"
diff --git a/sd/source/ui/dlg/ins_paste.cxx b/sd/source/ui/dlg/ins_paste.cxx
index 9f2c3bf0b6b6..422acbec4a73 100644
--- a/sd/source/ui/dlg/ins_paste.cxx
+++ b/sd/source/ui/dlg/ins_paste.cxx
@@ -31,6 +31,10 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sd.hxx"
+#ifdef SD_DLLIMPLEMENTATION
+#undef SD_DLLIMPLEMENTATION
+#endif
+
#include "ins_paste.hrc"
#include "ins_paste.hxx"
diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index 233976585e58..ba5836e8f1db 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -334,6 +334,9 @@ void Outliner::EndSpelling (void)
{
if (mbViewShellValid)
{
+ // Keep old view shell alive until we release the outliner view.
+ ::boost::shared_ptr<ViewShell> pOldViewShell (mpViewShell);
+
ViewShellBase* pBase = PTR_CAST(ViewShellBase,SfxViewShell::Current());
if (pBase != NULL)
mpViewShell = pBase->GetMainViewShell();
diff --git a/set_soenv.in b/set_soenv.in
index 462fb9533e97..ca39aa90a054 100644
--- a/set_soenv.in
+++ b/set_soenv.in
@@ -495,6 +495,17 @@ elsif ( $platform =~ m/linux/ )
$JRETOOLKITDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."m68k".$ds."server";
$JRETHREADDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."m68k".$ds."native_threads";
}
+ elsif ($platform =~ m/^hppa/)
+ { print "Setting Linux hppa specific values... ";
+ $outfile = "LinuxHPPAEnv.Set";
+ $CPU = "H";
+ $CPUNAME = "HPPA";
+ $OUTPATH = "unxlnghppa";
+ $JRELIBDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."hppa";
+ $JRETOOLKITDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."hppa".$ds."server";
+ $JRETHREADDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."hppa".$ds."native_threads";
+ $EPM_FLAGS = "-a hppa";
+ }
elsif ($platform =~ m/^alpha/)
{ print "Setting Linux Alpha specific values... ";
$outfile = "LinuxAlphaEnv.Set";
diff --git a/setup_native/prj/d.lst b/setup_native/prj/d.lst
index a573b94fd5cb..9d429454ebba 100644
--- a/setup_native/prj/d.lst
+++ b/setup_native/prj/d.lst
@@ -8,6 +8,7 @@ mkdir: %_DEST%\bin%_EXT%\userscripts
..\%__SRC%\bin\uninstall %_DEST%\bin%_EXT%\userscripts\uninstall
..\%__SRC%\bin\noarch\fake-db-1.0-0.noarch.rpm %_DEST%\bin%_EXT%\openoffice.org-userland-1.0-0.noarch.rpm
+mkdir: %_DEST%\bin%_EXT%\osolsmf
..\%__SRC%\bin\ulfconv %_DEST%\bin%_EXT%\ulfconv
..\%__SRC%\bin\langpackscript.sh %_DEST%\bin%_EXT%\langpackscript.sh
..\%__SRC%\bin\linuxpatchscript.sh %_DEST%\bin%_EXT%\linuxpatchscript.sh
@@ -33,6 +34,10 @@ mkdir: %_DEST%\bin%_EXT%\userscripts
..\source\java\openofficeorg_setup.gif %_DEST%\bin%_EXT%\osl\Setup.gif
..\source\java\javaversion.dat %_DEST%\bin%_EXT%\javaversion.dat
..\source\java\javaversion2.dat %_DEST%\bin%_EXT%\javaversion2.dat
+..\source\opensolaris\bundledextensions\installed %_DEST%\bin%_EXT%\osolsmf\installed
+..\source\opensolaris\bundledextensions\README %_DEST%\bin%_EXT%\osolsmf\README
+..\source\opensolaris\bundledextensions\ooo_bundled_extensions.xml %_DEST%\bin%_EXT%\osolsmf\ooo_bundled_extensions.xml
+..\source\opensolaris\bundledextensions\svc-ooo_bundled_extensions %_DEST%\bin%_EXT%\osolsmf\svc-ooo_bundled_extensions
..\source\packinfo\solariscopyrightfile %_DEST%\bin%_EXT%\solariscopyrightfile
..\source\packinfo\*.txt %_DEST%\bin%_EXT%\*.txt
..\source\packinfo\*.pcp %_DEST%\bin%_EXT%\*.pcp
diff --git a/setup_native/scripts/admin.pl b/setup_native/scripts/admin.pl
index 81d5649ffec6..ebb16d0ef008 100644
--- a/setup_native/scripts/admin.pl
+++ b/setup_native/scripts/admin.pl
@@ -46,6 +46,7 @@ BEGIN
$savetemppath = "";
$msiinfo_available = 0;
$path_displayed = 0;
+ $localmsidbpath = "";
$plat = $^O;
@@ -69,7 +70,7 @@ sub usage
{
print <<Ende;
----------------------------------------------------------------------
-$prog V1.0 (c) Sun Microsystems 2008
+$prog V1.0 (c) Sun Microsystems 2009
This program installs a Windows Installer installation set
without using msiexec.exe. The installation is comparable
with an administrative installation using the Windows Installer
@@ -150,6 +151,33 @@ sub controlparameter
}
#############################################################################
+# The program msidb.exe can be located next to the Perl program. Then it is
+# not neccessary to find it in the PATH variable.
+#############################################################################
+
+sub check_local_msidb
+{
+ my $msidbname = "msidb.exe";
+ my $perlprogramm = $0;
+ my $path = $perlprogramm;
+
+ get_path_from_fullqualifiedname(\$path);
+
+ $path =~ s/\\\s*$//;
+ $path =~ s/\/\s*$//;
+
+ my $msidbpath = "";
+ if ( $path =~ /^\s*$/ ) { $msidbpath = $msidbname; }
+ else { $msidbpath = $path . $separator . $msidbname; }
+
+ if ( -f $msidbpath )
+ {
+ $localmsidbpath = $msidbpath;
+ print "Using $msidbpath (next to \"admin.pl\")\n";
+ }
+}
+
+#############################################################################
# Converting a string list with separator $listseparator
# into an array
#############################################################################
@@ -198,7 +226,8 @@ sub check_system_path
}
my $patharrayref = convert_stringlist_into_array(\$pathvariable, $local_pathseparator);
- my @needed_files_in_path = ("msidb.exe", "expand.exe");
+ my @needed_files_in_path = ("expand.exe");
+ if ( $localmsidbpath eq "" ) { push(@needed_files_in_path, "msidb.exe"); } # not found locally -> search in path
my @optional_files_in_path = ("msiinfo.exe");
print("\nChecking required files:\n");
@@ -386,7 +415,7 @@ sub get_path_from_fullqualifiedname
if ( $$longfilenameref =~ /\Q$separator\E/ ) # Is there a separator in the path? Otherwise the path is empty.
{
- if ( $$longfilenameref =~ /^\s*(\S.*\S\Q$separator\E)(\S.+\S?)/ )
+ if ( $$longfilenameref =~ /^\s*(\S.*\Q$separator\E)(\S.+\S?)/ )
{
$$longfilenameref = $1;
}
@@ -486,6 +515,7 @@ sub extract_tables_from_database
my ($fullmsidatabasepath, $workdir, $tablelist) = @_;
my $msidb = "msidb.exe"; # Has to be in the path
+ if ( $localmsidbpath ) { $msidb = $localmsidbpath; }
my $infoline = "";
my $systemcall = "";
my $returnvalue = "";
@@ -513,6 +543,117 @@ sub extract_tables_from_database
}
}
+########################################################
+# Check, if this installation set contains
+# internal cabinet files included into the msi
+# database.
+########################################################
+
+sub check_for_internal_cabfiles
+{
+ my ($cabfilehash) = @_;
+
+ my $contains_internal_cabfiles = 0;
+ my %allcabfileshash = ();
+
+ foreach my $filename ( keys %{$cabfilehash} )
+ {
+ if ( $filename =~ /^\s*\#/ ) # starting with a hash
+ {
+ $contains_internal_cabfiles = 1;
+ # setting real filename without hash as key and name with hash as value
+ my $realfilename = $filename;
+ $realfilename =~ s/^\s*\#//;
+ $allcabfileshash{$realfilename} = $filename;
+ }
+ }
+
+ return ( $contains_internal_cabfiles, \%allcabfileshash );
+}
+
+#################################################################
+# Exclude all cab files from the msi database.
+#################################################################
+
+sub extract_cabs_from_database
+{
+ my ($msidatabase, $allcabfiles) = @_;
+
+ my $infoline = "";
+ my $fullsuccess = 1;
+ my $msidb = "msidb.exe"; # Has to be in the path
+ if ( $localmsidbpath ) { $msidb = $localmsidbpath; }
+
+ my @all_excluded_cabfiles = ();
+
+ if( $^O =~ /cygwin/i )
+ {
+ $msidatabase = qx{cygpath -w "$msidatabase"};
+ $msidatabase =~ s/\\/\\\\/g;
+ $msidatabase =~ s/\s*$//g;
+ }
+ else
+ {
+ # msidb.exe really wants backslashes. (And double escaping because system() expands the string.)
+ $msidatabase =~ s/\//\\\\/g;
+ }
+
+ foreach my $onefile ( keys %{$allcabfiles} )
+ {
+ my $systemcall = $msidb . " -d " . $msidatabase . " -x " . $onefile;
+ system($systemcall);
+ push(@all_excluded_cabfiles, $onefile);
+ }
+
+ \@all_excluded_cabfiles;
+}
+
+################################################################################
+# Collect all DiskIds to the corresponding cabinet files from Media.idt.
+################################################################################
+
+sub analyze_media_file
+{
+ my ($filecontent) = @_;
+
+ my %diskidhash = ();
+
+ for ( my $i = 0; $i <= $#{$filecontent}; $i++ )
+ {
+ if ( $i < 3 ) { next; }
+
+ if ( ${$filecontent}[$i] =~ /^\s*(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\s*$/ )
+ {
+ my $diskid = $1;
+ my $cabfile = $4;
+
+ $diskidhash{$cabfile} = $diskid;
+ }
+ }
+
+ return \%diskidhash;
+}
+
+sub analyze_customaction_file
+{
+ my ($filecontent) = @_;
+
+ my $register_extensions_exists = 0;
+
+ my %table = ();
+
+ for ( my $i = 0; $i <= $#{$filecontent}; $i++ )
+ {
+ if ( ${$filecontent}[$i] =~ /^\s*RegisterExtensions\s+/ )
+ {
+ $register_extensions_exists = 1;
+ last;
+ }
+ }
+
+ return $register_extensions_exists;
+}
+
################################################################################
# Analyzing the content of Directory.idt
#################################################################################
@@ -930,6 +1071,10 @@ sub register_one_extension
$localextension =~ s/\\/\\\\/g;
}
+ if ( $^O =~ /cygwin/i ) {
+ $executable = "./" . $executable;
+ }
+
my $systemcall = $executable . " add --shared --verbose " . "\"" . $localextension . "\"" . " -env:UserInstallation=file://" . $temppath . " 2\>\&1 |";
print "... $systemcall\n";
@@ -1142,6 +1287,7 @@ $starttime = time();
getparameter();
controlparameter();
+check_local_msidb();
check_system_path();
my $temppath = get_temppath();
@@ -1153,9 +1299,36 @@ create_directory($helperdir);
# Get File.idt, Component.idt and Directory.idt from database
-my $tablelist = "File Directory Component";
+my $tablelist = "File Directory Component Media CustomAction";
extract_tables_from_database($databasepath, $helperdir, $tablelist);
+# Set unpackdir
+my $unpackdir = $helperdir . $separator . "unpack";
+create_directory($unpackdir);
+
+# Reading media table to check for internal cabinet files
+my $filename = $helperdir . $separator . "Media.idt";
+if ( ! -f $filename ) { exit_program("ERROR: Could not find required file: $filename !"); }
+my $filecontent = read_file($filename);
+my $cabfilehash = analyze_media_file($filecontent);
+
+# Check, if there are internal cab files
+my ( $contains_internal_cabfiles, $all_internal_cab_files) = check_for_internal_cabfiles($cabfilehash);
+
+if ( $contains_internal_cabfiles )
+{
+ # Set unpackdir
+ my $cabdir = $helperdir . $separator . "internal_cabs";
+ create_directory($cabdir);
+ my $from = cwd();
+ chdir($cabdir);
+ # Exclude all cabinet files from database
+ my $all_excluded_cabs = extract_cabs_from_database($databasepath, $all_internal_cab_files);
+ print "Unpacking files from internal cabinet file(s)\n";
+ foreach my $cabfile ( @{$all_excluded_cabs} ) { unpack_cabinet_file($cabfile, $unpackdir); }
+ chdir($from);
+}
+
# Unpack all cab files into $helperdir, cab files must be located next to msi database
my $installdir = $databasepath;
@@ -1166,11 +1339,7 @@ make_absolute_filename_to_relative_filename(\$databasefilename);
my $cabfiles = find_file_with_file_extension("cab", $installdir);
-if ( $#{$cabfiles} < 0 ) { exit_program("ERROR: Did not find any cab file in directory $installdir"); }
-
-# Set unpackdir
-my $unpackdir = $helperdir . $separator . "unpack";
-create_directory($unpackdir);
+if (( $#{$cabfiles} < 0 ) && ( ! $contains_internal_cabfiles )) { exit_program("ERROR: Did not find any cab file in directory $installdir"); }
print "Unpacking files from cabinet file(s)\n";
for ( my $i = 0; $i <= $#{$cabfiles}; $i++ )
@@ -1180,8 +1349,8 @@ for ( my $i = 0; $i <= $#{$cabfiles}; $i++ )
}
# Reading tables
-my $filename = $helperdir . $separator . "Directory.idt";
-my $filecontent = read_file($filename);
+$filename = $helperdir . $separator . "Directory.idt";
+$filecontent = read_file($filename);
my $dirhash = analyze_directory_file($filecontent);
$filename = $helperdir . $separator . "Component.idt";
@@ -1203,8 +1372,16 @@ my $msidatabase = $targetdir . $separator . $databasefilename;
my $copyreturn = copy($databasepath, $msidatabase);
if ( ! $copyreturn) { exit_program("ERROR: Could not copy $source to $dest\n"); }
-# Registering extensions
-register_extensions($unopkgfile, $extensions, $temppath);
+# Reading tables
+$filename = $helperdir . $separator . "CustomAction.idt";
+$filecontent = read_file($filename);
+my $register_extensions_exists = analyze_customaction_file($filecontent);
+
+if ( $register_extensions_exists )
+{
+ # Registering extensions
+ register_extensions($unopkgfile, $extensions, $temppath);
+}
# Saving info in Summary Information Stream of msi database (required for following patches)
if ( $msiinfo_available ) { write_sis_info($msidatabase); }
diff --git a/setup_native/source/opensolaris/bundledextensions/README b/setup_native/source/opensolaris/bundledextensions/README
new file mode 100644
index 000000000000..f64c225d9df9
--- /dev/null
+++ b/setup_native/source/opensolaris/bundledextensions/README
@@ -0,0 +1,80 @@
+================================================================================
+Installation information
+================================================================================
+
+In order to properly install the bundled extensions, such as dictionaries, it is
+necessary that the files
+
+installed
+ooo_bundled_extensions.xml
+svc-ooo_bundled_extensions
+
+are part of the OpenOffice.org IPS package. They must be added to the package
+after all other files have been added. Those other files are the SVR4 packages
+of OOo which can be imported by pkg (pkg import).
+The files have to be uploaded this way:
+
+pkgsend -s url_to_pkg_server add file installed mode=644 owner=root group=bin path=${EXTENSIONPATH}/installed restart_fmri=svc:/application/ooo_bundled_extensions:default
+pkgsend -s url_to_pkg_server add file svc-ooo_bundled_extensions mode=744 owner=root group=bin path=/lib/svc/method/svc-ooo_bundled_extensions
+pkgsend -s url_to_pkg_server add file ooo_bundled_extensions.xml mode=644 owner=root group=bin path=/var/svc/manifest/application/ooo_bundled_extensions.xml restart_fmri=svc:/system/manifest-import:default
+
+
+---
+
+${EXTENSIONPATH} must be replaced by the path to the folder containing the
+bundled extensions. This path changes with every major release of OOo because of
+the version number which is part of a folder name. The
+current value is:
+
+EXTENSIONPATH=/opt/openoffice.org3/share/extension/install
+
+The service was tested with OpenSolaris release 2009.6 and may not work with a
+previous release.
+
+
+================================================================================
+What do these files do
+================================================================================
+
+The three files constitute a SMF service. When this service is started, then it
+installes the bundled extensions which are contained in
+/opt/openoffice.org3/share/extension/install. To install them, the service calls
+"unopkg add --shared ..." with the appropriate arguments.
+
+The service is started initially after the installation of
+ooo_bundled_extensions.xml. At this time, all files of OOo, including the
+extensions, have been copied to their destination. The service calls unopkg on
+behalf of every extension and adds the path to that extension to the file
+'installed'. The file 'installed' is used to remember what extensions have
+already been installed with unopkg. This will prevent to reinstall those
+extensions whenever the service is restarted.
+
+When a new version of OOo becomes available, then the respective OOo package
+containes a new version of 'installed'. That is, it contains a version string,
+such as 3.2.0. The sole reason for that string is, to change the content of this
+file in every release. Otherwise IPS would not replace the installed version of
+'installed' with the one contained in the package.
+
+The update procedure of OOo will replace 'installed'. 'installed' is associated
+with a restart_fmri of the service ooo_bundled_extensions. That is after
+copying 'installed' the service will be restarted. It then installes all
+extensions contained in /opt/openoffice.org3/share/extension/install, because
+the newly installed 'installed' file does not contain any entries yet, except
+for the version string.
+
+
+================================================================================
+Known issues
+================================================================================
+
+If OOo, which contains this service, is uninstalled and later it is installed
+again, then the bundled extensions are not installed. That is, unopkg is not
+called to install them with OOo's Extensions Manager. The reasons is a bug in
+OpenSolaris:
+
+http://defect.opensolaris.org/bz/show_bug.cgi?id=5742
+
+To work around this, one can call after uninstalling OOo
+
+svccfg delete -f ooo_bundled_extensions
+svccfg delete smf/manifest
diff --git a/setup_native/source/opensolaris/bundledextensions/installed b/setup_native/source/opensolaris/bundledextensions/installed
new file mode 100644
index 000000000000..0c8d8df5ae26
--- /dev/null
+++ b/setup_native/source/opensolaris/bundledextensions/installed
@@ -0,0 +1 @@
+${OOOPACKAGEVERSION}
diff --git a/setup_native/source/opensolaris/bundledextensions/ooo_bundled_extensions.xml b/setup_native/source/opensolaris/bundledextensions/ooo_bundled_extensions.xml
new file mode 100644
index 000000000000..66acd508c281
--- /dev/null
+++ b/setup_native/source/opensolaris/bundledextensions/ooo_bundled_extensions.xml
@@ -0,0 +1,60 @@
+<?xml version="1.0"?>
+
+<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
+
+<service_bundle type="manifest" name="ooo_bundled_extensions">
+
+<service
+ name="application/ooo_bundled_extensions"
+ type="service"
+ version="1">
+
+ <create_default_instance enabled="true" />
+ <single_instance/>
+
+ <dependency name="service_available"
+ grouping="require_all"
+ restart_on="none"
+ type="service">
+ <service_fmri value="svc:/system/filesystem/local:default" />
+ </dependency>
+
+ <exec_method
+ type="method" name="start"
+ exec="/lib/svc/method/svc-ooo_bundled_extensions start"
+ timeout_seconds="160">
+ <method_context>
+ <method_credential user="root" group="root" />
+ </method_context>
+ </exec_method>
+
+
+ <exec_method
+ type="method" name="stop"
+ exec="/lib/svc/method/svc-ooo_bundled_extensions stop"
+ timeout_seconds="160" >
+ <method_context>
+ <method_credential user="root" group="root" />
+ </method_context>
+ </exec_method>
+
+ <property_group name="startd" type="framework">
+ <propval name="duration" type="astring"
+ value="transient" />
+ <propval name="ignore_error"
+ type="astring" value="core,signal" />
+
+ </property_group>
+
+ <stability value="Unstable" />
+
+ <template>
+ <common_name>
+ <loctext xml:lang="C">
+ Installation of OpenOffice.org's bundled extensions.
+ </loctext>
+ </common_name>
+ </template>
+</service>
+
+</service_bundle>
diff --git a/setup_native/source/opensolaris/bundledextensions/svc-ooo_bundled_extensions b/setup_native/source/opensolaris/bundledextensions/svc-ooo_bundled_extensions
new file mode 100644
index 000000000000..696277011133
--- /dev/null
+++ b/setup_native/source/opensolaris/bundledextensions/svc-ooo_bundled_extensions
@@ -0,0 +1,108 @@
+#!/sbin/sh
+
+. /lib/svc/share/smf_include.sh
+
+#The start method is used for installing and updating the
+#extensions. The service keeps a list
+#(share/extensions/install/installed) of the extensions which were
+#already installed. During installation, the bundled extensions are
+#copied to the install folder (share/extensions/install). Finally this
+#service, which is part of the office installation package, will be
+#started and the start "method" of this script is called. Then all
+#extensions in the "install" folder are checked if they are already
+#installed by reading the list "installed". Because the list is empty
+#at this time, all the extensions will be installed.
+#
+#If this service is restarted then the script checks if there is an
+#extensions which is not yet installed, that is there is no entry for
+#it in the 'installed' file. Only if this is the case then that
+#extensions will be installed and its path is added to 'installed'.
+#
+#In case of an update, new versions of existing extensions and
+#completely new extensions may be copied to the 'install' folder. Also
+#a new 'installed' file will be copied which replaces the existing
+#file. The new 'installed' file does not contain any entries of
+#installed extensions. Therefore the next time when the start method is
+#run all extensions contained in share/extensions/install will be
+#installed.
+
+#Create the folder which contains the temporary user installation
+INSTDIR=`/usr/bin/mktemp -d "/tmp/userinstall.XXXXXX"`
+
+OOO_BASE_DIR="/opt/openoffice.org/basis${OOOBASEVERSION}"
+
+case "$1" in
+'start')
+ EXTENSIONDIR=/opt/openoffice.org${OOOBRANDPACKAGEVERSION}/share/extension/install
+ for FILE in $EXTENSIONDIR/*.oxt
+ do
+ #We check if the file exist, because if there is no extension
+ #then $FILE will contain "<..>/*.oxt"
+ if [ -f "$FILE" ]; then
+ #Determine if this extension is already installed. We do
+ #that by checking the file "installed" which contains a
+ #list of all installed extensions including the full path
+ EXTENSIONFILE=`basename $FILE`
+ INSTALLED=`sed -n "/$EXTENSIONFILE/p" $EXTENSIONDIR/installed`
+
+ if [ -z "$INSTALLED" ]; then
+ #We have not found the name of the extension in the
+ #list. That is, it has not been installed (with unopkg) yet.
+ #Therefore we do it now.
+ echo installing $FILE
+ /opt/openoffice.org${OOOBRANDPACKAGEVERSION}/program/unopkg add --shared --bundled "$FILE" '-env:UserInstallation=file://$INSTDIR' '-env:UNO_JAVA_JFW_INSTALL_DATA=$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1'
+ #Let us remember that this extensions has been installed
+ #by adding the path name of the extension to the file
+ #installed
+ echo $FILE >> $EXTENSIONDIR/installed
+ fi
+ fi
+ done
+
+ #Now check for extensions which need to be uninstalled
+ #(unopkg). This is the case if the list of extensions in the file
+ #installed contains the name of an extension which does not exist
+ #in the the folder <..>/share/extension/install.
+# LINE=""
+# NEWCONTENT=""
+# REMOVED=""
+# LIST=`cat $EXTENSIONDIR/installed`
+# #remove blank lines
+# LIST=`echo "$LIST" | sed '/^[:blank:]*$/d'`
+
+# echo "$LIST" | while [ 1 ]
+# do
+# read LINE || break
+# if [ ! -f "$LINE" ]; then
+# #The extension file has been removed from
+# #share/extension/install. Now we remove the installed
+# #extension
+# echo removing `basename $LINE`
+# /opt/openoffice.org${OOOBRANDPACKAGEVERSION}/program/unopkg remove --shared --bundled "`basename $LINE`" '-env:UserInstallation=file://$INSTDIR' '-env:UNO_JAVA_JFW_INSTALL_DATA=$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1'
+# REMOVED=1
+# else
+# NEWCONTENT+=$LINE
+# NEWCONTENT+="\n"
+# fi
+# done
+
+# #Write the new list to the file "installed". It now has all names
+# #remove which refered to previously removed extensions (removed
+# #from .../share/extension/install)
+# if [ "$REMOVED" ]; then
+# #remove the last empty line
+# NEWCONTENT=`echo "$NEWCONTENT" | sed '/^[:space:]*$/d'`
+# echo "$NEWCONTENT" > $EXTENSIONDIR/installed
+# fi
+
+ ;;
+ 'stop')
+ echo "#### stop ####"
+ ;;
+ *)
+ echo "Usage: $0 { start | stop }"
+ exit 1
+ ;;
+esac
+
+exit $SMF_EXIT_OK
diff --git a/setup_native/tests/opensolaris/bundledextensions/send_ooo b/setup_native/tests/opensolaris/bundledextensions/send_ooo
new file mode 100644
index 000000000000..669e63ceda1b
--- /dev/null
+++ b/setup_native/tests/opensolaris/bundledextensions/send_ooo
@@ -0,0 +1,32 @@
+#! /bin/bash
+
+
+if [ $# = 0 ]
+then
+echo "usage: send_ooo path_to_pkg_folder
+
+The files
+installed,
+ooo_bundled_extension.xml,
+svc-ooo_bundled_extension
+must be in the current directory. The pkg.depotd or the service
+application/pkg/server must listen to port 80"
+
+exit
+fi
+
+
+EXTENSIONPATH=/opt/openoffice.org3/share/extension/install
+
+eval `pkgsend -s http://localhost:80 open ooo_test@3.2-1`
+pkgsend -s http://localhost:80 import $1/openofficeorg-ure
+pkgsend -s http://localhost:80 import $1/ooobasis*
+pkgsend -s http://localhost:80 import $1/openofficeorg3*
+
+pkgsend -s http://localhost:80 add file installed mode=644 owner=root group=bin path=${EXTENSIONPATH}/installed restart_fmri=svc:/application/ooo_bundled_extensions:default
+pkgsend -s http://localhost:80 add file svc-ooo_bundled_extensions mode=744 owner=root group=bin path=/lib/svc/method/svc-ooo_bundled_extensions
+pkgsend -s http://localhost:80 add file ooo_bundled_extensions.xml mode=644 owner=root group=bin path=/var/svc/manifest/application/ooo_bundled_extensions.xml restart_fmri=svc:/system/manifest-import:default
+
+pkgsend -s http://localhost:80 add set name=description value="OOo 3.2 with dictionaries: en fr es da de"
+pkgsend -s http://localhost:80 close
+
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index 484e953f1cf4..e0a57c2e5e9e 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -269,8 +269,12 @@ SfxDocumentInfoItem::SfxDocumentInfoItem( const String& rFile,
for ( sal_Int32 i = 0; i < nCount; ++i )
{
// "fix" property? => not a custom property => ignore it!
- if ( !(pProps[i].Attributes & ::com::sun::star::beans::PropertyAttribute::REMOVABLE) )
+ if (!(pProps[i].Attributes &
+ ::com::sun::star::beans::PropertyAttribute::REMOVABLE))
+ {
+ DBG_ASSERT(false, "non-removable user-defined property?");
continue;
+ }
uno::Any aValue = xSet->getPropertyValue(pProps[i].Name);
CustomProperty* pProp = new CustomProperty( pProps[i].Name, aValue );
@@ -424,7 +428,13 @@ void SfxDocumentInfoItem::UpdateDocumentInfo(
const beans::Property* pProps = lProps.getConstArray();
sal_Int32 nCount = lProps.getLength();
for ( sal_Int32 j = 0; j < nCount; ++j )
- xContainer->removeProperty( pProps[j].Name );
+ {
+ if ((pProps[j].Attributes &
+ ::com::sun::star::beans::PropertyAttribute::REMOVABLE))
+ {
+ xContainer->removeProperty( pProps[j].Name );
+ }
+ }
for ( sal_uInt32 k = 0; k < m_aCustomProperties.size(); ++k )
{
diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx b/sfx2/source/doc/SfxDocumentMetaData.cxx
index 1423e712242e..ef36831ab681 100644
--- a/sfx2/source/doc/SfxDocumentMetaData.cxx
+++ b/sfx2/source/doc/SfxDocumentMetaData.cxx
@@ -79,6 +79,7 @@
#include "comphelper/storagehelper.hxx"
#include "comphelper/mediadescriptor.hxx"
#include "comphelper/sequenceasvector.hxx"
+#include "comphelper/stlunosequence.hxx"
#include "sot/storage.hxx"
#include "sfx2/docfile.hxx"
#include "sax/tools/converter.hxx"
@@ -322,7 +323,7 @@ private:
/// standard meta data (multiple occurrences)
std::map< ::rtl::OUString,
std::vector<css::uno::Reference<css::xml::dom::XNode> > > m_metaList;
- /// user-defined meta data (meta:user-defined)
+ /// user-defined meta data (meta:user-defined) @ATTENTION may be null!
css::uno::Reference<css::beans::XPropertyContainer> m_xUserDefined;
// now for some meta-data attributes; these are not updated directly in the
// DOM because updates (detecting "empty" elements) would be quite messy
@@ -998,9 +999,12 @@ SfxDocumentMetaData::updateElement(const char *i_name,
void SAL_CALL SfxDocumentMetaData::updateUserDefinedAndAttributes()
{
createUserDefined();
- css::uno::Reference<css::beans::XPropertySet> xPSet(m_xUserDefined,css::uno::UNO_QUERY_THROW);
- std::pair<css::uno::Sequence< ::rtl::OUString>, AttrVector> udStringsAttrs = propsToStrings(xPSet);
- (void) setMetaList("meta:user-defined", udStringsAttrs.first,&udStringsAttrs.second);
+ const css::uno::Reference<css::beans::XPropertySet> xPSet(m_xUserDefined,
+ css::uno::UNO_QUERY_THROW);
+ const std::pair<css::uno::Sequence< ::rtl::OUString>, AttrVector>
+ udStringsAttrs( propsToStrings(xPSet) );
+ (void) setMetaList("meta:user-defined", udStringsAttrs.first,
+ &udStringsAttrs.second);
// update elements with attributes
std::vector<std::pair<const char *, ::rtl::OUString> > attributes;
@@ -1217,15 +1221,13 @@ void SAL_CALL SfxDocumentMetaData::init(
std::vector<css::uno::Reference<css::xml::dom::XNode> > & vec =
m_metaList[::rtl::OUString::createFromAscii("meta:user-defined")];
- // user-defined meta data: create PropertyBag which only accepts property
- // values of allowed types
+ m_xUserDefined.clear(); // #i105826#: reset (may be re-initialization)
if ( !vec.empty() )
{
createUserDefined();
}
// user-defined meta data: initialize PropertySet from DOM nodes
-
for (std::vector<css::uno::Reference<css::xml::dom::XNode> >::iterator
it = vec.begin(); it != vec.end(); ++it) {
css::uno::Reference<css::xml::dom::XElement> xElem(*it,
@@ -1301,10 +1303,14 @@ void SAL_CALL SfxDocumentMetaData::init(
////////////////////////////////////////////////////////////////////////////
SfxDocumentMetaData::SfxDocumentMetaData(
- css::uno::Reference< css::uno::XComponentContext > const & context) :
- BaseMutex(), SfxDocumentMetaData_Base(m_aMutex),
- m_xContext(context), m_NotifyListeners(m_aMutex),
- m_isInitialized(false), m_isModified(false)
+ css::uno::Reference< css::uno::XComponentContext > const & context)
+ : BaseMutex()
+ , SfxDocumentMetaData_Base(m_aMutex)
+ , m_xContext(context)
+ , m_NotifyListeners(m_aMutex)
+ , m_isInitialized(false)
+ , m_isModified(false)
+ , m_AutoloadSecs(0)
{
DBG_ASSERT(context.is(), "SfxDocumentMetaData: context is null");
DBG_ASSERT(context->getServiceManager().is(),
@@ -2168,7 +2174,7 @@ void SAL_CALL SfxDocumentMetaData::setModified( ::sal_Bool bModified )
::osl::MutexGuard g(m_aMutex);
checkInit();
m_isModified = bModified;
- if ( !bModified )
+ if ( !bModified && m_xUserDefined.is() )
{
xMB.set(m_xUserDefined, css::uno::UNO_QUERY);
DBG_ASSERT(xMB.is(),
@@ -2241,6 +2247,8 @@ void SAL_CALL SfxDocumentMetaData::serialize(
void SfxDocumentMetaData::createUserDefined()
{
+ // user-defined meta data: create PropertyBag which only accepts property
+ // values of allowed types
if ( !m_xUserDefined.is() )
{
css::uno::Sequence<css::uno::Type> types(10);
@@ -2258,29 +2266,37 @@ void SfxDocumentMetaData::createUserDefined()
args[0] <<= css::beans::NamedValue(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AllowedTypes")),
css::uno::makeAny(types));
- // #i94175#: ODF 1.1 allows empty user-defined property names!
- args[1] <<= css::beans::NamedValue(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AllowEmptyPropertyName")),
+ // #i94175#: ODF allows empty user-defined property names!
+ args[1] <<= css::beans::NamedValue( ::rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("AllowEmptyPropertyName")),
css::uno::makeAny(sal_True));
- css::uno::Reference<css::lang::XMultiComponentFactory> xMsf (m_xContext->getServiceManager());
+ const css::uno::Reference<css::lang::XMultiComponentFactory> xMsf(
+ m_xContext->getServiceManager());
m_xUserDefined.set(
- xMsf->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.beans.PropertyBag")), m_xContext),
+ xMsf->createInstanceWithContext(
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.beans.PropertyBag")), m_xContext),
css::uno::UNO_QUERY_THROW);
- css::uno::Reference<css::lang::XInitialization> xInit(m_xUserDefined,
- css::uno::UNO_QUERY);
+ const css::uno::Reference<css::lang::XInitialization> xInit(
+ m_xUserDefined, css::uno::UNO_QUERY);
if (xInit.is()) {
xInit->initialize(args);
}
- css::uno::Reference<css::util::XModifyBroadcaster> xMB(m_xUserDefined,css::uno::UNO_QUERY);
+ const css::uno::Reference<css::util::XModifyBroadcaster> xMB(
+ m_xUserDefined, css::uno::UNO_QUERY);
if (xMB.is())
{
- css::uno::Sequence< css::uno::Reference< css::uno::XInterface > > aListener = m_NotifyListeners.getElements();
- const css::uno::Reference< css::uno::XInterface >* pIter = aListener.getConstArray();
- const css::uno::Reference< css::uno::XInterface >* pEnd = pIter + aListener.getLength();
- for(;pIter != pEnd;++pIter )
- xMB->addModifyListener(css::uno::Reference< css::util::XModifyListener >(*pIter,css::uno::UNO_QUERY));
+ const css::uno::Sequence<css::uno::Reference<css::uno::XInterface> >
+ listeners(m_NotifyListeners.getElements());
+ for (css::uno::Reference< css::uno::XInterface > const * iter =
+ ::comphelper::stl_begin(listeners);
+ iter != ::comphelper::stl_end(listeners); ++iter) {
+ xMB->addModifyListener(
+ css::uno::Reference< css::util::XModifyListener >(*iter,
+ css::uno::UNO_QUERY));
+ }
}
}
}
diff --git a/solenv/bin/build.pl b/solenv/bin/build.pl
index 40c310929eaa..cc0677220777 100644..100755
--- a/solenv/bin/build.pl
+++ b/solenv/bin/build.pl
@@ -96,18 +96,12 @@
$modules_number++;
$perl = "";
$remove_command = "";
- if ( $^O eq 'MSWin32' ) {
- $perl = "$ENV{PERL}";
- $remove_command = "rmdir /S /Q";
- $nul = '> NULL';
- } else {
- use Cwd 'chdir';
- $perl = 'perl';
- $remove_command = 'rm -rf';
- $nul = '> /dev/null';
- };
+ use Cwd 'chdir';
+ $perl = 'perl';
+ $remove_command = 'rm -rf';
+ $nul = '> /dev/null';
- $QuantityToBuild = 0;
+ $processes_to_run = 0;
# delete $pid when not needed
%projects_deps_hash = (); # hash of projects with no dependencies,
# that could be built now
@@ -117,7 +111,7 @@
%running_children = ();
$dependencies_hash = 0;
$cmd_file = '';
- $BuildAllParents = 0;
+ $build_all_parents = 0;
$show = 0;
$checkparents = 0;
$deliver = 0;
@@ -135,7 +129,7 @@
@broken_modules_names = (); # array of modules, which cannot be built further
@dmake_args = ();
%dead_parents = ();
- $CurrentPrj = '';
+ $initial_module = '';
$all_dependent = 1; # a flag indicating if the hash has independent keys
$build_from_with_branches = '';
$build_all_cont = '';
@@ -207,12 +201,15 @@
my %module_paths = (); # hash with absolute module paths
my %active_modules = ();
my $generate_config = 0;
+ my $add_modules_to_config = 0;
my %add_to_config = ();
my %remove_from_config = ();
my $clear_config = 0;
my $finisched_children = 0;
my $debug = 0;
%module_deps_hash_pids = ();
+ my @argv = @ARGV;
+ my $source_config_file;
### main ###
get_options();
@@ -234,11 +231,11 @@
$deliver_env{'L10N_framework'}++;
};
- if ($generate_config) {
+ if ($generate_config && ($clear_config || (scalar keys %remove_from_config)||(scalar keys %add_to_config))) {
generate_config_file();
exit 0;
}
- $StandDir = get_stand_dir(); # This also sets $CurrentPrj
+ $StandDir = get_stand_dir(); # This also sets $initial_module
get_module_and_buildlist_paths();
provide_consistency() if (defined $ENV{CWS_WORK_STAMP} && defined($ENV{COMMON_ENV_TOOLS}));
@@ -278,14 +275,14 @@
start_interactive() if ($interactive);
if ($checkparents) {
- GetParentDeps( $CurrentPrj, \%global_deps_hash );
+ get_parent_deps( $initial_module, \%global_deps_hash );
} else {
- BuildAll();
+ build_all();
}
if (scalar keys %broken_build) {
cancel_build();
# } elsif (!$custom_job && $post_custom_job) {
-# do_post_custom_job(CorrectPath($StandDir.$CurrentPrj));
+# do_post_custom_job(CorrectPath($StandDir.$initial_module));
};
print_warnings();
if (scalar keys %active_modules) {
@@ -294,11 +291,10 @@
};
};
if (scalar keys %dead_parents) {
- my ($DeadPrj);
print $new_line.$new_line;
print $echo."WARNING! Project(s):\n";
- foreach $DeadPrj (keys %dead_parents) {
- print $echo."$DeadPrj\n";
+ foreach (keys %dead_parents) {
+ print $echo."$_\n";
};
print $new_line;
print $echo."not found and couldn't be built. Dependencies on that module(s) ignored. Maybe you should correct build lists.\n";
@@ -352,7 +348,7 @@ sub rename_file {
sub generate_config_file {
my $source_config = SourceConfig -> new();
- my $source_config_file = $source_config->get_config_file_path();
+ $source_config_file = $source_config->get_config_file_path();
my $temp_config_file = File::Temp::tmpnam($ENV{TMP});
my @config_content_new = ();
my $addition_message;
@@ -364,7 +360,6 @@ sub generate_config_file {
close SOURCE_CONFIG_FILE;
my ($module_section, $repository_section);
foreach (@config_content) {
- $line++;
if ((!/^\S+/)||(/^\s*#+/)) {
push(@config_content_new, $_);
next;
@@ -422,8 +417,7 @@ sub generate_config_file {
};
print_warnings();
print $addition_message if ($addition_message);
- print "Module(s) $removal_message removed from $source_config_file\n" if ($removal_message);
- exit(0);
+ print "Module(s):\n$removal_message\nremoved from $source_config_file\n" if ($removal_message);
};
#
@@ -437,50 +431,25 @@ sub add_modules_to_source_config {
$message .= "$_ ";
};
if ($message) {
- return 'Module(s) ' .$message . 'are added to the ' . $source_config_file . "\n\n";
+ return "Module(s):\n" .$message . "\nare added to the " . $source_config_file . "\n\n";
} else {
return '';
};
};
sub start_interactive {
- if ( $^O eq 'MSWin32' ) {
- my $posix_sys_wait = 'POSIX ":sys_wait_h"';
- eval "use $posix_sys_wait";
- die "couldn't use $posix_sys_wait: $!\n" if ($@);
-
- pipe(FROM_PARENT, TO_CHILD) or die "pipe: $!";
- pipe(HTML_PIPE, TO_PARENT) or die "pipe: $!";
-
+ $pid = open(HTML_PIPE, "-|");
+ print "Pipe is open\n";
- if (my $pid = fork()) {
- $html_listener_pid = 1;
- close FROM_PARENT;
- close TO_PARENT;
- ioctl(HTML_PIPE, 0x8004667e, 1);
- return;
- } else {
- close HTML_PIPE;
- close TO_CHILD;
- select TO_PARENT;
- $|++;
- $parent_process = 0;
- start_html_listener();
- }
- } else {
- $pid = open(HTML_PIPE, "-|");
- print "Pipe is open\n";
-
- if ($pid) { # parent
- # make file handle non-bloking
- my $flags = '';
- fcntl(HTML_PIPE, F_GETFL, $flags);
- $flags |= O_NONBLOCK;
- fcntl(HTML_PIPE, F_SETFL, $flags);
- } else { # child
- $parent_process = 0;
- start_html_listener();
- };
+ if ($pid) { # parent
+ # make file handle non-bloking
+ my $flags = '';
+ fcntl(HTML_PIPE, F_GETFL, $flags);
+ $flags |= O_NONBLOCK;
+ fcntl(HTML_PIPE, F_SETFL, $flags);
+ } else { # child
+ $parent_process = 0;
+ start_html_listener();
};
};
@@ -516,7 +485,6 @@ sub start_html_message_trigger {
if ($child_id) {
# parent
- $html_message_trigger{$child_id}++;
# print "started listener trigger\n";
} else {
my $buffer_size = 1024;
@@ -673,20 +641,20 @@ sub get_build_list_path {
#
# Get dependencies hash of the current and all parent projects
#
-sub GetParentDeps {
+sub get_parent_deps {
my (%parents_deps_hash, $module, $parent);
my $prj_dir = shift;
my $deps_hash = shift;
- my @UnresolvedParents = get_parents_array($prj_dir);
- $parents_deps_hash{$_}++ foreach (@UnresolvedParents);
+ my @unresolved_parents = get_parents_array($prj_dir);
+ $parents_deps_hash{$_}++ foreach (@unresolved_parents);
$$deps_hash{$prj_dir} = \%parents_deps_hash;
- while ($module = pop(@UnresolvedParents)) {
+ while ($module = pop(@unresolved_parents)) {
my %parents_deps_hash = ();
$parents_deps_hash{$_}++ foreach (get_parents_array($module));
$$deps_hash{$module} = \%parents_deps_hash;
foreach $Parent (keys %parents_deps_hash) {
if (!defined($$deps_hash{$Parent})) {
- push (@UnresolvedParents, $Parent);
+ push (@unresolved_parents, $Parent);
};
};
};
@@ -743,19 +711,16 @@ sub reverse_dependensies {
#
# Build everything that should be built
#
-sub BuildAll {
- if ($BuildAllParents) {
+sub build_all {
+ if ($build_all_parents) {
my ($Prj, $PrjDir, $orig_prj);
- GetParentDeps( $CurrentPrj, \%global_deps_hash);
+ get_parent_deps( $initial_module, \%global_deps_hash);
if (scalar keys %active_modules) {
- $active_modules{$CurrentPrj}++;
- $modules_types{$CurrentPrj} = 'mod';
+ $active_modules{$initial_module}++;
+ $modules_types{$initial_module} = 'mod';
};
modules_classify(keys %global_deps_hash);
store_weights(\%global_deps_hash);
- if (keys %active_modules && ($build_from || $incompatible)) {
- print_error("There are active module in $source_config_file. Please remove these modules to proceed.\n");
- };
prepare_build_from(\%global_deps_hash) if ($build_from);
prepare_incompatible_build(\%global_deps_hash) if ($incompatible);
if ($build_all_cont || $build_since) {
@@ -763,12 +728,25 @@ sub BuildAll {
push (@warnings, "\nThere are active module in $source_config_file. Inactive modules are skipped.\n\n");
prepare_build_all_cont(\%global_deps_hash);
};
+ if ($generate_config) {
+ %add_to_config = %global_deps_hash;
+ generate_config_file();
+ exit 0;
+ } elsif (keys %incompatibles) {
+ my @missing_modules = ();
+ foreach (keys %global_deps_hash) {
+ push(@missing_modules, $_) if (!defined $active_modules{$_});
+ };
+ if (scalar @missing_modules) {
+ print_error("There are modules:\n@missing_modules\n\nthat should be built, but they are not activated. Please, verify your $source_config_file.\n");
+ };
+ };
backup_deps_hash(\%global_deps_hash, \%global_deps_hash_backup);
expand_dependencies (\%global_deps_hash_backup);
reverse_dependensies(\%global_deps_hash_backup);
$modules_number = scalar keys %global_deps_hash;
initialize_html_info($_) foreach (keys %global_deps_hash);
- if ($QuantityToBuild) {
+ if ($processes_to_run) {
build_multiprocessing();
return;
};
@@ -789,7 +767,7 @@ sub BuildAll {
my $info_hash = $html_info{$Prj};
$$info_hash{DIRS} = check_deps_hash(\%LocalDepsHash, $Prj);
$module_by_hash{\%LocalDepsHash} = $Prj;
- BuildDependent(\%LocalDepsHash);
+ build_dependent(\%LocalDepsHash);
print $check_error_string;
};
@@ -797,16 +775,16 @@ sub BuildAll {
$build_is_finished{$Prj}++;
};
} else {
- store_build_list_content($CurrentPrj);
- get_module_dep_hash($CurrentPrj, \%LocalDepsHash);
- initialize_html_info($CurrentPrj);
- my $info_hash = $html_info{$CurrentPrj};
- $$info_hash{DIRS} = check_deps_hash(\%LocalDepsHash, $CurrentPrj);
- $module_by_hash{\%LocalDepsHash} = $CurrentPrj;
+ store_build_list_content($initial_module);
+ get_module_dep_hash($initial_module, \%LocalDepsHash);
+ initialize_html_info($initial_module);
+ my $info_hash = $html_info{$initial_module};
+ $$info_hash{DIRS} = check_deps_hash(\%LocalDepsHash, $initial_module);
+ $module_by_hash{\%LocalDepsHash} = $initial_module;
if ($server_mode) {
run_server();
} else {
- BuildDependent(\%LocalDepsHash);
+ build_dependent(\%LocalDepsHash);
};
};
};
@@ -884,7 +862,8 @@ sub dmake_dir {
};
_exit(0);
} elsif ($error_code && ($error_code != -1)) {
- print_error("Error $? occurred while making $BuildDir");
+ return $error_code;
+# print_error("Error $? occurred while making $BuildDir");
};
};
@@ -1075,7 +1054,7 @@ sub get_deps_hash {
if (scalar @errors) {
my $message = "$module_to_build/prj/build.lst has wrongly written string(s):\n";
$message .= "$_\n" foreach(@errors);
- if ($QuantityToBuild) {
+ if ($processes_to_run) {
$broken_build{$module_to_build} = $message;
$dependencies_hash = undef;
return;
@@ -1097,7 +1076,7 @@ sub get_deps_hash {
add_prerequisite_job($dependencies_hash, $module_to_build, $pre_custom_job);
add_prerequisite_job($dependencies_hash, $module_to_build, $pre_job);
add_dependent_job($dependencies_hash, $module_to_build, $custom_job);
- add_dependent_job($dependencies_hash, $module_to_build, $post_job) if ($module_to_build ne $CurrentPrj);
+ add_dependent_job($dependencies_hash, $module_to_build, $post_job) if ($module_to_build ne $initial_module);
add_dependent_job($dependencies_hash, $module_to_build, $post_custom_job);
};
store_weights($dependencies_hash);
@@ -1163,11 +1142,7 @@ sub mark_platform {
#
sub CorrectPath {
$_ = shift;
- if ( ($^O eq 'MSWin32') && (!defined $ENV{SHELL})) {
- s/\//\\/g;
- } else {;
- s/\\/\//g;
- };
+ s/\\/\//g;
return $_;
};
@@ -1232,7 +1207,7 @@ sub get_stand_dir {
do {
foreach (@possible_build_lists) {# ('build.lst', 'build.xlist');
if (-e $StandDir . '/prj/'.$_) {
- $CurrentPrj = File::Basename::basename($StandDir);
+ $initial_module = File::Basename::basename($StandDir);
$StandDir = File::Basename::dirname($StandDir);
return $StandDir;
} elsif ($StandDir eq $previous_dir) {
@@ -1381,9 +1356,9 @@ sub find_indep_prj {
my ($Dependencies, $i);
my @candidates = ();
$all_dependent = 1;
- handle_dead_children(0) if ($QuantityToBuild);
+ handle_dead_children(0) if ($processes_to_run);
my $children = children_number();
- return '' if (!$server_mode && $children && ($children >= $QuantityToBuild));
+ return '' if (!$server_mode && $children && ($children >= $processes_to_run));
$Dependencies = shift;
if (scalar keys %$Dependencies) {
foreach my $job (keys %$Dependencies) {
@@ -1500,7 +1475,7 @@ sub print_error {
sub usage {
print STDERR "\nbuild\n";
- print STDERR "Syntax: build [--all|-a[:prj_name]]|[--from|-f prj_name1[:prj_name2] [prj_name3 [...]]]|[--since|-c prj_name] [--with_branches|-b]|[--prepare|-p][:platform] [--deliver|-d [--dlv_switch deliver_switch]]] [-P processes|--server [--setenvstring \"string\"] [--client_timeout MIN] [--port port1[:port2:...:portN]]] [--show|-s] [--help|-h] [--file|-F] [--ignore|-i] [--version|-V] [--mode|-m OOo[,SO[,EXT]] [--html [--html_path html_file_path] [--dontgraboutput]] [--pre_job=pre_job_sring] [--job=job_string|-j] [--post_job=post_job_sring] [--stoponerror] [--genconf [--removeall|--clear|--remove|--add module1,module2[,...,moduleN]]] [--interactive]\n";
+ print STDERR "Syntax: build [--all|-a[:prj_name]]|[--from|-f prj_name1[:prj_name2] [prj_name3 [...]]]|[--since|-c prj_name] [--with_branches|-b]|[--prepare|-p][:platform] [--deliver|-d [--dlv_switch deliver_switch]]] [-P processes|--server [--setenvstring \"string\"] [--client_timeout MIN] [--port port1[:port2:...:portN]]] [--show|-s] [--help|-h] [--file|-F] [--ignore|-i] [--version|-V] [--mode|-m OOo[,SO[,EXT]] [--html [--html_path html_file_path] [--dontgraboutput]] [--pre_job=pre_job_sring] [--job=job_string|-j] [--post_job=post_job_sring] [--stoponerror] [--genconf [--removeall|--clear|--remove|--add [module1,module2[,...,moduleN]]]] [--interactive]\n";
print STDERR "Example1: build --from sfx2\n";
print STDERR " - build all projects dependent from sfx2, starting with sfx2, finishing with the current module\n";
print STDERR "Example2: build --all:sfx2\n";
@@ -1555,10 +1530,10 @@ sub usage {
sub get_options {
my ($arg, $dont_grab_output);
while ($arg = shift @ARGV) {
- $arg =~ /^-P$/ and $QuantityToBuild = shift @ARGV and next;
- $arg =~ /^-P(\d+)$/ and $QuantityToBuild = $1 and next;
- $arg =~ /^--all$/ and $BuildAllParents = 1 and next;
- $arg =~ /^-a$/ and $BuildAllParents = 1 and next;
+ $arg =~ /^-P$/ and $processes_to_run = shift @ARGV and next;
+ $arg =~ /^-P(\d+)$/ and $processes_to_run = $1 and next;
+ $arg =~ /^--all$/ and $build_all_parents = 1 and next;
+ $arg =~ /^-a$/ and $build_all_parents = 1 and next;
$arg =~ /^--show$/ and $show = 1 and next;
$arg =~ /^--checkmodules$/ and $checkparents = 1 and $ignore = 1 and next;
$arg =~ /^-s$/ and $show = 1 and next;
@@ -1571,17 +1546,17 @@ sub get_options {
$arg =~ /^--file$/ and $cmd_file = shift @ARGV and next;
$arg =~ /^-F$/ and $cmd_file = shift @ARGV and next;
- $arg =~ /^--with_branches$/ and $BuildAllParents = 1
+ $arg =~ /^--with_branches$/ and $build_all_parents = 1
and $build_from_with_branches = shift @ARGV and next;
- $arg =~ /^-b$/ and $BuildAllParents = 1
+ $arg =~ /^-b$/ and $build_all_parents = 1
and $build_from_with_branches = shift @ARGV and next;
- $arg =~ /^--all:(\S+)$/ and $BuildAllParents = 1
+ $arg =~ /^--all:(\S+)$/ and $build_all_parents = 1
and $build_all_cont = $1 and next;
- $arg =~ /^-a:(\S+)$/ and $BuildAllParents = 1
+ $arg =~ /^-a:(\S+)$/ and $build_all_parents = 1
and $build_all_cont = $1 and next;
if ($arg =~ /^--from$/ || $arg =~ /^-f$/) {
- $BuildAllParents = 1;
+ $build_all_parents = 1;
get_incomp_projects();
next;
};
@@ -1589,11 +1564,11 @@ sub get_options {
$arg =~ /^-p$/ and $prepare = 1 and next;
$arg =~ /^--prepare:/ and $prepare = 1 and $only_platform = $' and next;
$arg =~ /^-p:/ and $prepare = 1 and $only_platform = $' and next;
- $arg =~ /^--since$/ and $BuildAllParents = 1
+ $arg =~ /^--since$/ and $build_all_parents = 1
and $build_since = shift @ARGV and next;
- $arg =~ /^-c$/ and $BuildAllParents = 1
+ $arg =~ /^-c$/ and $build_all_parents = 1
and $build_since = shift @ARGV and next;
- $arg =~ /^-s$/ and $BuildAllParents = 1
+ $arg =~ /^-s$/ and $build_all_parents = 1
and $build_since = shift @ARGV and next;
$arg =~ /^--help$/ and usage() and do_exit(0);
$arg =~ /^-h$/ and usage() and do_exit(0);
@@ -1601,10 +1576,14 @@ sub get_options {
$arg =~ /^--genconf$/ and $generate_config = 1 and next;
if ($arg =~ /^--add$/) {
get_list_of_modules(\%add_to_config);
+ $add_modules_to_config++;
next;
};
if ($arg =~ /^--remove$/) {
get_list_of_modules(\%remove_from_config);
+ if (!scalar %remove_from_config) {
+ print_error('No module list supplied!!');
+ };
next;
};
($arg =~ /^--clear$/ || $arg =~ /^--removeall$/) and $clear_config = 1 and next;
@@ -1637,7 +1616,7 @@ sub get_options {
# print_error('Please prepare the workspace on one of UNIX platforms') if ($prepare && ($ENV{GUI} ne 'UNX'));
print_error('Switches --with_branches and --since collision') if ($build_from_with_branches && $build_since);
if ($show) {
- $QuantityToBuild = 0;
+ $processes_to_run = 0;
$cmd_file = '';
};
print_error('Switches --job and --deliver collision') if ($custom_job && $deliver);
@@ -1647,7 +1626,7 @@ sub get_options {
if ($prepare) {
print_error("--prepare is for use with --from switch only!\n") if (!$incompatible);
};
- if ($QuantityToBuild) {
+ if ($processes_to_run) {
if ($ignore && !$html) {
print_error("Cannot ignore errors in multiprocessing build");
};
@@ -1675,8 +1654,8 @@ sub get_options {
if ((scalar %add_to_config) || (scalar %remove_from_config)) {
print_error('"--add" or/and "--remove"' . $error_message);
};
- } elsif ((!scalar %add_to_config) && !$clear_config && (!scalar %remove_from_config)){
- print_error('Please supply necessary switch for "--genconf" (--add|--remove|--removeall)');
+ } elsif ((!scalar %add_to_config) && !$clear_config && (!scalar %remove_from_config) && !$build_all_parents){
+ print_error('Please supply necessary switch for "--genconf" (--add|--remove|--removeall). --add can be used with --from and such');
};
if ($only_platform) {
@@ -1698,7 +1677,7 @@ sub get_options {
sub get_module_and_buildlist_paths {
my $source_config = SourceConfig -> new($StandDir);
- my $source_config_file = $source_config->get_config_file_path();
+ $source_config_file = $source_config->get_config_file_path();
$active_modules{$_}++ foreach ($source_config->get_active_modules());
my %active_modules_copy = %active_modules;
foreach ($source_config->get_all_modules()) {
@@ -1744,33 +1723,37 @@ sub get_switch_options {
#
sub cancel_build {
# close_server_socket();
- $modules_number -= scalar keys %global_deps_hash;
my $broken_modules_number = scalar @broken_modules_names;
+ my $message_part = 'build ';
+ if (scalar keys %incompatibles) {
+ my @incompatible_modules = keys %incompatibles;
+ if ($stop_build_on_error) {
+ $message_part .= "--from @incompatible_modules:@broken_modules_names\n";
+ } else {
+ $message_part .= "--from @broken_modules_names\n";
+ };
+ } else {
+ $message_part .= "--all:@broken_modules_names\n";
+ };
if ($broken_modules_number) {
- $modules_number -= $broken_modules_number;
print "\n";
print $broken_modules_number;
print " module(s): ";
foreach (@broken_modules_names) {
print "\n\t$_";
-# RemoveFromDependencies($_, \%global_deps_hash);
};
print "\nneed(s) to be rebuilt\n\nReason(s):\n\n";
foreach (keys %broken_build) {
print "ERROR: error " . $broken_build{$_} . " occurred while making $_\n";
};
- print "\nAttention: if you build and deliver the above module(s) you may prolongue your the build issuing command \"build --from @broken_modules_names\"\n";
+ print "\nAttention: if you fix the errors in above module(s) you may prolongue your the build issuing command:\n\n\t" . $message_part;
} else {
-# if ($ENV{GUI} eq 'WNT') {
- while (children_number()) {
- handle_dead_children(1);
- }
- foreach (keys %broken_build) {
- print "ERROR: error " . $broken_build{$_} . " occurred while making $_\n";
- };
-# } else {
-# kill 9 => -$$;
-# };
+ while (children_number()) {
+ handle_dead_children(1);
+ }
+ foreach (keys %broken_build) {
+ print "ERROR: error " . $broken_build{$_} . " occurred while making $_\n";
+ };
};
print "\n";
do_exit(1);
@@ -1827,9 +1810,9 @@ sub handle_dead_children {
};
};
};
- sleep 1 if (children_number() >= $QuantityToBuild || ($force_wait && ($running_children == children_number())));
+ sleep 1 if (children_number() >= $processes_to_run || ($force_wait && ($running_children == children_number())));
} else {
- if (children_number() >= $QuantityToBuild ||
+ if (children_number() >= $processes_to_run ||
($force_wait && ($running_children == children_number()))) {
$pid = wait();
} else {
@@ -1845,7 +1828,7 @@ sub handle_dead_children {
$finisched_children++;
};
};
- } while(children_number() >= $QuantityToBuild);
+ } while(children_number() >= $processes_to_run);
};
sub give_second_chance {
@@ -1881,38 +1864,44 @@ sub clear_from_child {
#
# Build the entire project according to queue of dependencies
#
-sub BuildDependent {
+sub build_dependent {
$dependencies_hash = shift;
my $pid = 0;
my $child_nick = '';
$running_children{$dependencies_hash} = 0 if (!defined $running_children{$dependencies_hash});
while ($child_nick = pick_prj_to_build($dependencies_hash)) {
- if ($QuantityToBuild) {
+ if ($processes_to_run) {
do {
if (defined $modules_with_errors{$dependencies_hash} && !$ignore) {
- return 0 if ($BuildAllParents);
+ return 0 if ($build_all_parents);
last;
};
# start current child & all
# that could be started now
- start_child($child_nick, $dependencies_hash) if ($child_nick);
- return 1 if ($BuildAllParents);
+ if ($child_nick) {
+ start_child($child_nick, $dependencies_hash);
+ return 1 if ($build_all_parents);
+ } else {
+ return 0 if ($build_all_parents);
+ if (scalar keys %$dependencies_hash) {
+ handle_dead_children(1);
+ };
+ };
$child_nick = pick_prj_to_build($dependencies_hash);
} while (scalar keys %$dependencies_hash || $child_nick);
while (children_number()) {
-# print "#### 1902: Starting waiting for dead child\n";
handle_dead_children(1);
};
-# if (defined $last_module) {
-# $build_is_finished{$last_module}++ if (!defined $modules_with_errors{$last_module});
-# };
if (defined $modules_with_errors{$dependencies_hash}) {
cancel_build();
}
mp_success_exit();
} else {
- dmake_dir($child_nick);
+ if (dmake_dir($child_nick)) {
+ push(@broken_modules_names, $module_by_hash{$dependencies_hash});
+ cancel_build();
+ };
};
$child_nick = '';
};
@@ -2010,7 +1999,7 @@ sub build_multiprocessing {
sub mp_success_exit {
# close_server_socket();
# if (!$custom_job && $post_custom_job) {
-# do_post_custom_job(CorrectPath($StandDir.$CurrentPrj));
+# do_post_custom_job(CorrectPath($StandDir.$initial_module));
# };
print "\nMultiprocessing build is finished\n";
print "Maximal number of processes run: $maximal_processes\n";
@@ -2045,7 +2034,7 @@ sub build_actual_queue {
delete $$build_queue{$Prj};
next;
};
- $started_children =+ BuildDependent($projects_deps_hash{$Prj});
+ $started_children =+ build_dependent($projects_deps_hash{$Prj});
if ((!scalar keys %{$projects_deps_hash{$Prj}}) &&
!$running_children{$projects_deps_hash{$Prj}}) {
if (!defined $modules_with_errors{$projects_deps_hash{$Prj}} || $ignore)
@@ -2142,7 +2131,7 @@ sub print_announce {
$prj_type = $modules_types{$Prj} if (defined $modules_types{$Prj});
my $text;
if ($prj_type eq 'lnk') {
- if (scalar keys %active_modules && (!defined $active_modules{$Prj})) {
+ if (!defined $active_modules{$Prj}) {
$text = "Skipping module $Prj\n";
} else {
$text = "Skipping link to $Prj\n";
@@ -2193,7 +2182,7 @@ sub modules_classify {
next;
};
if (( $module_paths{$module} =~ /\.lnk$/) || ($module_paths{$module} =~ /\.link$/)
- || (scalar keys %active_modules && (!defined $active_modules{$module}))) {
+ || (!defined $active_modules{$module})) {
$modules_types{$module} = 'lnk';
next;
};
@@ -2224,19 +2213,10 @@ sub provide_consistency {
#
sub get_workspace_lst
{
- my $home;
- if ( $^O eq 'MSWin32' ) {
- $home = $ENV{TEMP};
- }
- else {
- $home = $ENV{HOME};
- }
- my $inifile = "$home/localini/stand.lst";
+ my $home = $ENV{HOME};
+ my $inifile = $ENV{HOME}. '/localini/stand.lst';
if (-f $inifile) {
return $inifile;
-# } else {
-# $inifile = get_globalini() . "/stand.lst";
-# return $inifile if (-f $inifile);
};
return '';
}
@@ -2391,7 +2371,11 @@ sub prepare_incompatible_build {
delete $$deps_hash{$build_all_cont};
};
@modules_built = keys %$deps_hash;
- clear_delivered() if ($prepare);
+ %add_to_config = %$deps_hash;
+ if ($prepare) {
+ generate_config_file();
+ clear_delivered();
+ }
my $old_output_tree = '';
foreach $prj (sort keys %$deps_hash) {
if ($prepare) {
@@ -2416,7 +2400,7 @@ sub prepare_incompatible_build {
if ($old_output_tree) {
push(@warnings, 'Some module(s) contain old output tree(s)!');
};
- if (scalar @warnings) {
+ if (!$generate_config && scalar @warnings) {
print "WARNING(S):\n";
print STDERR "$_\n" foreach (@warnings);
print "\nATTENTION: If you are performing an incompatible build, please break the build with Ctrl+C and prepare the workspace with \"--prepare\" switch!\n\n" if (!$prepare);
@@ -2439,7 +2423,7 @@ sub prepare_build_from {
my ($prj, $deps_hash);
$deps_hash = shift;
my %from_deps_hash = (); # hash of dependencies of the -from project
- GetParentDeps($build_from_with_branches, \%from_deps_hash);
+ get_parent_deps($build_from_with_branches, \%from_deps_hash);
foreach $prj (keys %from_deps_hash) {
delete $$deps_hash{$prj};
RemoveFromDependencies($prj, $deps_hash);
@@ -2508,9 +2492,9 @@ sub get_list_of_modules {
};
};
};
- if (!scalar %$hash_ref) {
- print_error('No module list supplied!!');
- };
+# if (!scalar %$hash_ref) {
+# print_error('No module list supplied!!');
+# };
};
sub get_incomp_projects {
@@ -2530,6 +2514,26 @@ sub get_incomp_projects {
};
};
+sub get_workspace_platforms {
+ my $workspace_patforms = shift;
+ my $solver_path = $ENV{SOLARVERSION};
+ opendir(SOLVERDIR, $solver_path);
+ @dir_list = readdir(SOLVERDIR);
+ close SOLVERDIR;
+ foreach (@dir_list) {
+ next if /^common/;
+ next if /^\./;
+ if (open(LS, "ls $solver_path/$_/inc/*minor.mk 2>$nul |")) {
+ foreach my $string (<LS>) {
+ chomp $string;
+ if ($string =~ /minor.mk$/) {
+ $$workspace_patforms{$_}++
+ };
+ };
+ close LS;
+ };
+ };
+};
sub get_platforms {
my $platforms_ref = shift;
@@ -2542,17 +2546,22 @@ sub get_platforms {
my $workspace_lst = get_workspace_lst();
if ($workspace_lst) {
- my $workspace_db = GenInfoParser->new();
- my $success = $workspace_db->load_list($workspace_lst);
- if ( !$success ) {
- print_error("Can't load workspace list '$workspace_lst'.", 4);
- }
- my $access_path = $ENV{WORK_STAMP} . '/Environments';
- my @platforms_available = $workspace_db->get_keys($access_path);
- my $solver = $ENV{SOLARVERSION};
- foreach (@platforms_available) {
- my $s_path = $solver . '/' . $_;
- $$platforms_ref{$_}++ if (-d $s_path);
+ my $workspace_db;
+ eval { $workspace_db = GenInfoParser->new(); };
+ if (!$@) {
+ my $success = $workspace_db->load_list($workspace_lst);
+ if ( !$success ) {
+ print_error("Can't load workspace list '$workspace_lst'.", 4);
+ }
+ my $access_path = $ENV{WORK_STAMP} . '/Environments';
+ my @platforms_available = $workspace_db->get_keys($access_path);
+ my $solver = $ENV{SOLARVERSION};
+ foreach (@platforms_available) {
+ my $s_path = $solver . '/' . $_;
+ $$platforms_ref{$_}++ if (-d $s_path);
+ };
+ } else {
+ get_workspace_platforms(\%platforms);
};
};
@@ -2621,12 +2630,8 @@ sub read_ssolar_vars {
my ($setsolar, $tmp_file);
$setsolar = $ENV{ENV_ROOT} . '/etools/setsolar.pl';
my ($platform, $solar_vars) = @_;
- if ( $^O eq 'MSWin32' ) {
- $tmp_file = $ENV{TEMP} . "\\solar.env.$$.tmp";
- } else {
- $setsolar = '/net/jumbo2.germany/buildenv/r/etools/setsolar.pl' if ! -e $setsolar;
- $tmp_file = $ENV{HOME} . "/.solar.env.$$.tmp";
- };
+ $setsolar = '/net/jumbo2.germany/buildenv/r/etools/setsolar.pl' if ! -e $setsolar;
+ $tmp_file = $ENV{HOME} . "/.solar.env.$$.tmp";
if (!-e $setsolar) {
print STDERR "There is no setsolar found. Falling back to current platform settings\n";
return;
@@ -2663,14 +2668,8 @@ sub get_solar_vars {
next if(!/^\w+\s+(\w+)/o);
next if (!defined $deliver_env{$1});
$var = $1;
- if ( $^O eq 'MSWin32' ) {
- my $string_tail = $';
- $string_tail =~ /=(\S+)$/o;
- $value = $1;
- } else {
- /\'(\S+)\'$/o;
- $value = $1;
- };
+ /\'(\S+)\'$/o;
+ $value = $1;
$$solar_vars{$var} = $value;
};
close SOLARTABLE;
@@ -2691,8 +2690,8 @@ sub get_current_module {
if ( ! $result ) {
print_error("Cannot rename $module_name: $!\n");
}
- if ( $CurrentPrj eq $link_name) {
- $CurrentPrj = $module_name;
+ if ( $initial_module eq $link_name) {
+ $initial_module = $module_name;
}
chdir $module_name;
getcwd();
@@ -2700,26 +2699,17 @@ sub get_current_module {
sub check_dir {
my $start_dir = getcwd();
- my @dir_entries = split(/[\\\/]/, $start_dir);
+ my @dir_entries = split(/[\\\/]/, $ENV{PWD});
my $current_module = $dir_entries[$#dir_entries];
- $current_module = $` if (($current_module =~ /(\.lnk)$/) || ($current_module =~ /(\.link)$/));
- my $link_name = $ENV{SOLARSRC}.'/'.$current_module.$1;
- if ( $^O eq 'MSWin32' ) {
- $start_dir =~ s/\\/\//go;
- $link_name =~ s/\\/\//go;
- if (lc($start_dir) eq lc($link_name)) {
- get_current_module($current_module);
- };
- } elsif ((-l $link_name) && (chdir $link_name)) {
- if ($start_dir eq getcwd()) {
- # we're dealing with link => fallback to SOLARSRC under UNIX
- $StandDir = $ENV{SOLARSRC}.'/';
- get_current_module($current_module);
- return;
- } else {
- chdir $start_dir;
- getcwd();
- };
+ if (($current_module =~ /(\.lnk)$/) || ($current_module =~ /(\.link)$/)) {
+ $current_module = $`;
+ # we're dealing with a link => fallback to SOLARSRC under UNIX
+ $StandDir = $ENV{SOLARSRC}.'/';
+ get_current_module($current_module);
+ return;
+ } else {
+ chdir $start_dir;
+ getcwd();
};
};
@@ -2836,7 +2826,7 @@ sub generate_html_file {
print HTML 'document.write(" </ul>");' . "\n";
print HTML 'document.write(" </div>");' . "\n";
};
- if ($BuildAllParents) {
+ if ($build_all_parents) {
print HTML 'document.write("<table valign=top cellpadding=0 hspace=0 vspace=0 cellspacing=0 border=0>");' . "\n";
print HTML 'document.write(" <tr>");' . "\n";
print HTML 'document.write(" <td><a id=ErroneousModules href=\"javascript:top.Error(\'\', \'';
@@ -2874,7 +2864,7 @@ sub generate_html_file {
foreach (@modules_order) {
next if ($modules_types{$_} eq 'lnk');
- next if (scalar keys %active_modules && (!defined $active_modules{$_}));
+ next if (!defined $active_modules{$_});
my ($errors_info_line, $dirs_info_line, $errors_number, $successes_percent, $errors_percent, $time) = get_html_info($_);
#<one module>
print HTML 'document.write(" <tr>");' . "\n";
@@ -3517,7 +3507,7 @@ sub get_job_string {
my $build_queue = shift;
my $job = $dmake;
my ($job_dir, $dependencies_hash);
- if ($BuildAllParents) {
+ if ($build_all_parents) {
fill_modules_queue($build_queue);
do {
($job_dir, $dependencies_hash) = pick_jobdir($build_queue);
diff --git a/solenv/bin/cws.pl b/solenv/bin/cws.pl
index 96ea6610fa67..801d62add78c 100644
--- a/solenv/bin/cws.pl
+++ b/solenv/bin/cws.pl
@@ -59,9 +59,11 @@ use Cws;
#### globals ####
-# TODO: replace dummy vales with actual SVN->hg migration milestones
+# TODO: replace dummy vales with actual SVN->hg and source_config migration milestones
my $dev300_migration_milestone = 'm64';
+my $dev300_source_config_milestone = 'm65';
my $ooo320_migration_milestone = 'm999';
+my $ooo320_source_config_milestone = 'm999';
# valid command with possible abbreviations
my @valid_commands = (
@@ -101,6 +103,9 @@ for (@valid_commands) {
# set by --debug switch
my $debug = 0;
+# set by --profile switch
+my $profile = 0;
+
#### main ####
@@ -126,6 +131,7 @@ sub parse_command_line
'migration',
'childworkspace|child|c=s',
'debug',
+ 'profile',
'commit|C',
'switch|s',
'platforms|p=s',
@@ -195,6 +201,10 @@ sub verify_options
$debug = 1;
next;
}
+ if ( /profile/ ) {
+ $profile = 1;
+ next;
+ }
if (!exists $valid_command_options_hash{$_}) {
print_error("can't use option '--$_' with subcommand '$command'.", 1);
}
@@ -576,7 +586,7 @@ sub hg_local_clone_repository
hg_strip($dest, $revision);
}
my $t2 = Benchmark->new();
- print_time_elapsed($t1, $t2);
+ print_time_elapsed($t1, $t2) if $profile;
}
sub hg_lan_clone_repository
@@ -589,7 +599,7 @@ sub hg_lan_clone_repository
print_message("... clone LAN repository '$lan_source' to '$dest'");
hg_clone($lan_source, $dest, "-U -r $milestone_tag");
my $t2 = Benchmark->new();
- print_time_elapsed($t1, $t2);
+ print_time_elapsed($t1, $t2) if $profile;
}
sub hg_remote_pull_repository
@@ -601,7 +611,7 @@ sub hg_remote_pull_repository
print_message("... pull from REMOTE repository '$remote_source' to '$dest'");
hg_pull($dest, $remote_source);
my $t2 = Benchmark->new();
- print_time_elapsed($t1, $t2);
+ print_time_elapsed($t1, $t2) if $profile;
}
sub hg_update_repository
@@ -612,7 +622,7 @@ sub hg_update_repository
print_message("... update repository '$dest'");
hg_update($dest);
my $t2 = Benchmark->new();
- print_time_elapsed($t1, $t2);
+ print_time_elapsed($t1, $t2) if $profile;
}
# Check if clone source and destination are on the same filesystem,
@@ -1312,10 +1322,11 @@ sub relink_workspace {
sub update_solver
{
- my $platform = shift;
- my $source = shift;
- my $solver = shift;
- my $milestone = shift;
+ my $platform = shift;
+ my $source = shift;
+ my $solver = shift;
+ my $milestone = shift;
+ my $source_config = shift;
my @zip_sub_dirs = ('bin', 'doc', 'idl', 'inc', 'lib', 'par', 'pck', 'pdb', 'pus', 'rdb', 'res', 'xml', 'sdf');
@@ -1344,6 +1355,7 @@ sub update_solver
my $nzips = @zips;
print_message("... unzipping $nzips zip archives for platform '$platform'");
+
foreach(@zips) {
my $zip = Archive::Zip->new();
unless ( $zip->read( "$platform_source/$_" ) == AZ_OK ) {
@@ -1351,7 +1363,8 @@ sub update_solver
}
# TODO: check for erorrs
foreach (@zip_sub_dirs) {
- unless ( $zip->extractTree($_, "$platform_solver/$_.$milestone") == AZ_OK ) {
+ my $extract_destination = $source_config ? "$platform_solver/$_" : "$platform_solver/$_.$milestone";
+ unless ( $zip->extractTree($_, $extract_destination) == AZ_OK ) {
print_error("Can't extract stream from zip file '$platform_source/$_': $!.", 44);
}
}
@@ -1453,11 +1466,40 @@ sub get_scm_for_milestone
}
}
else {
- $scm = 'SVN'
+ $scm = 'SVN';
}
return $scm;
}
+# TODO: special provisions for "source_config" migration, remove this
+# some time after migration
+sub get_source_config_for_milestone
+{
+ my $masterws = shift;
+ my $milestone = shift;
+
+ my $milestone_sequence_number = extract_milestone_sequence_number($milestone);
+ my $dev300_migration_sequence_number = extract_milestone_sequence_number($dev300_source_config_milestone);
+ my $ooo320_migration_sequence_number = extract_milestone_sequence_number($ooo320_source_config_milestone);
+
+ my $source_config = 0;
+
+ if ( $masterws eq 'DEV300' ) {
+ if ( $milestone_sequence_number >= $dev300_migration_sequence_number ) {
+ $source_config = 1;
+ }
+ }
+ elsif ( $masterws eq 'OOO320' ) {
+ if ( $milestone_sequence_number >= $ooo320_migration_sequence_number ) {
+ $source_config = '1';
+ }
+ }
+ else {
+ $source_config = 0;
+ }
+ return $source_config;
+}
+
sub extract_milestone_sequence_number
{
my $milestone = shift;
@@ -2264,11 +2306,24 @@ sub do_fetch
hg_clone_repository('ooo', $cws, "$work_master/ooo", $clone_milestone_only);
hg_clone_repository('so', $cws, "$work_master/sun", $clone_milestone_only);
}
- my $linkdir = "$work_master/src.$milestone";
- if ( !mkdir($linkdir) ) {
- print_error("Can't create directory '$linkdir': $!.", 8);
+ if ( get_source_config_for_milestone($masterws, $milestone) ) {
+ # write source_config file
+ my $source_config_file = "$work_master/source_config";
+ if ( !open(SOURCE_CONFIG, ">$source_config_file") ) {
+ print_error("Can't create source_config file '$source_config_file': $!.", 8);
+ }
+ print SOURCE_CONFIG "[repositories]\n";
+ print SOURCE_CONFIG "ooo=active\n";
+ print SOURCE_CONFIG "sun=active\n";
+ close(SOURCE_CONFIG);
+ }
+ else {
+ my $linkdir = "$work_master/src.$milestone";
+ if ( !mkdir($linkdir) ) {
+ print_error("Can't create directory '$linkdir': $!.", 8);
+ }
+ relink_workspace($linkdir);
}
- relink_workspace($linkdir);
}
else {
if ( $scm eq 'SVN' ) {
@@ -2294,12 +2349,13 @@ sub do_fetch
print_error("Can't create directory '$solver': $!.", 8);
}
}
+ my $source_config = get_source_config_for_milestone($masterws, $milestone);
foreach(@platforms) {
my $time_solver_start = Benchmark->new();
print_message("... copying platform solver '$_'.");
- update_solver($_, $prebuild_dir, $solver, $milestone);
+ update_solver($_, $prebuild_dir, $solver, $milestone, $source_config);
my $time_solver_stop = Benchmark->new();
- print_time_elapsed($time_solver_start, $time_solver_stop);
+ print_time_elapsed($time_solver_start, $time_solver_stop) if $profile;
}
}
my $time_fetch_stop = Benchmark->new();
diff --git a/solenv/inc/minor.mk b/solenv/inc/minor.mk
index 542c3d16be86..b952cb5586fb 100644
--- a/solenv/inc/minor.mk
+++ b/solenv/inc/minor.mk
@@ -1,5 +1,5 @@
RSCVERSION=300
-RSCREVISION=300m65(Build:9457)
-BUILD=9457
-LAST_MINOR=m65
+RSCREVISION=300m66(Build:9460)
+BUILD=9460
+LAST_MINOR=m66
SOURCEVERSION=DEV300
diff --git a/solenv/inc/rules.mk b/solenv/inc/rules.mk
index 71909c8d348b..7b8e6f2aaadd 100644
--- a/solenv/inc/rules.mk
+++ b/solenv/inc/rules.mk
@@ -224,7 +224,7 @@ $(SLO)/%.obj : %.cpp
.ENDIF # "$(nodep)"==""
$(SLO)/%.obj : $(MISC)/%.cxx
- @echo Compiling: $(PRJNAME)/$(OUTPATH)/misc/$(<:f)
+ @echo Compiling: $(PRJNAME)/$(INPATH)/misc/$(<:f)
.IF "$(GUI)"=="UNX"
.IF "$(TEST)"!=""
$(COMMAND_ECHO)$(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXSLO) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) -E $(CFLAGSINCXX)$(MISC)/$*.cxx
@@ -249,7 +249,7 @@ $(SLO)/%.obj : $(MISC)/%.cxx
.ENDIF # "$(nodep)"==""
$(SLO)/%.obj : $(MISC)/%.cc
- @echo Compiling: $(PRJNAME)/$(OUTPATH)/misc/$(<:f)
+ @echo Compiling: $(PRJNAME)/$(INPATH)/misc/$(<:f)
.IF "$(GUI)"=="UNX"
.IF "$(TEST)"!=""
$(COMMAND_ECHO)$(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXSLO) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) -E $(CFLAGSINCXX)$(MISC)/$*.cc
@@ -266,7 +266,7 @@ $(SLO)/%.obj : $(MISC)/%.cc
.ENDIF
$(OBJ)/%.obj : $(MISC)/%.cxx
- @echo Compiling: $(PRJNAME)/$(OUTPATH)/misc/$(<:f)
+ @echo Compiling: $(PRJNAME)/$(INPATH)/misc/$(<:f)
.IF "$(GUI)"=="UNX"
.IF "$(TEST)"!=""
$(COMMAND_ECHO)$(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXOBJ) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(CDEFSMT) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) -E $(CFLAGSINCXX)$(MISC)/$*.cxx
@@ -321,7 +321,7 @@ $(OBJ)/%.obj : %.c
.ENDIF # "$(nodep)"==""
$(OBJ)/%.obj : $(MISC)/%.c
- @echo Compiling: $(PRJNAME)/$(OUTPATH)/misc/$(<:f)
+ @echo Compiling: $(PRJNAME)/$(INPATH)/misc/$(<:f)
.IF "$(GUI)"=="UNX"
@$(RM) $@ $(@:s/.obj/.o/)
$(COMMAND_ECHO)$(CC) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)/$*.o $(MISC)/$*.c
@@ -343,7 +343,7 @@ $(OBJ)/%.obj : $(MISC)/%.c
.ENDIF # "$(nodep)"==""
$(SLO)/%.obj : $(MISC)/%.c
- @echo Compiling: $(PRJNAME)/$(OUTPATH)/misc/$(<:f)
+ @echo Compiling: $(PRJNAME)/$(INPATH)/misc/$(<:f)
.IF "$(GUI)"=="UNX"
@$(RM) $@ $(@:s/.obj/.o/)
$(COMMAND_ECHO)$(CC) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(SLO)/$*.o $(MISC)/$*.c
@@ -404,7 +404,7 @@ $(OBJ)/%.obj : %.m
# Objective-C files
$(OBJ)/%.obj : $(MISC)/%.m
- @echo Compiling: $(PRJNAME)/$(OUTPATH)/misc/$(<:f)
+ @echo Compiling: $(PRJNAME)/$(INPATH)/misc/$(<:f)
.IF "$(OS)"=="MACOSX"
@$(RM) $@ $(@:s/.obj/.o/)
$(COMMAND_ECHO)$(objc) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(OBJCFLAGS) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)/$*.o $(MISC)/$*.m
@@ -415,7 +415,7 @@ $(OBJ)/%.obj : $(MISC)/%.m
# Objective-C files
$(SLO)/%.obj : $(MISC)/%.m
- @echo Compiling: $(PRJNAME)/$(OUTPATH)/misc/$(<:f)
+ @echo Compiling: $(PRJNAME)/$(INPATH)/misc/$(<:f)
.IF "$(OS)"=="MACOSX"
@$(RM) $@ $(@:s/.obj/.o/)
$(COMMAND_ECHO)$(objc) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(OBJCFLAGS) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(SLO)/$*.o $(MISC)/$*.m
@@ -461,7 +461,7 @@ $(OBJ)/%.obj : %.mm
# Objective-C++ files
$(OBJ)/%.obj : $(MISC)/%.mm
- @echo Compiling: $(PRJNAME)/$(OUTPATH)/misc/$(<:f)
+ @echo Compiling: $(PRJNAME)/$(INPATH)/misc/$(<:f)
.IF "$(OS)"=="MACOSX"
@$(RM) $@ $(@:s/.obj/.o/)
$(COMMAND_ECHO)$(objcpp) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(OBJCXXFLAGS) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)/$*.o $(MISC)/$*.mm
@@ -476,7 +476,7 @@ $(OBJ)/%.obj : $(MISC)/%.mm
# Objective-C++ files
$(SLO)/%.obj : $(MISC)/%.mm
- @echo Compiling: $(PRJNAME)/$(OUTPATH)/misc/$(<:f)
+ @echo Compiling: $(PRJNAME)/$(INPATH)/misc/$(<:f)
.IF "$(OS)"=="MACOSX"
@$(RM) $@ $(@:s/.obj/.o/)
$(COMMAND_ECHO)$(objcpp) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(OBJCXXFLAGS) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(SLO)/$*.o $(MISC)/$*.mm
diff --git a/solenv/inc/unx.mk b/solenv/inc/unx.mk
index 718e23c01b4e..bb5a4864484d 100644
--- a/solenv/inc/unx.mk
+++ b/solenv/inc/unx.mk
@@ -179,6 +179,10 @@
.INCLUDE : unxlngm68k.mk
.ENDIF
+.IF "$(COM)$(OS)$(CPU)" == "GCCLINUXH"
+.INCLUDE : unxlnghppa.mk
+.ENDIF
+
# --- general *ix settings ---
HC=hc
HCFLAGS=
diff --git a/solenv/inc/unxfbsdx.mk b/solenv/inc/unxfbsdx.mk
index 61edc8dcaf51..62817d5604fc 100644
--- a/solenv/inc/unxfbsdx.mk
+++ b/solenv/inc/unxfbsdx.mk
@@ -50,3 +50,4 @@ CFLAGSOPT= # no optimizing for non products
# platform specific identifier for shared libs
DLLPOSTFIX=fx
+BUILD64=1
diff --git a/solenv/inc/unxlnga.mk b/solenv/inc/unxlnga.mk
index 6baf600fee35..2f18fe7b43c6 100644
--- a/solenv/inc/unxlnga.mk
+++ b/solenv/inc/unxlnga.mk
@@ -33,5 +33,5 @@
.INCLUDE : unxlng.mk
CFLAGS+=-DIA64
-CFLAGSCXX+=-fno-use-cxa-atexit
DLLPOSTFIX=la
+BUILD64=1
diff --git a/solenv/inc/unxlnghppa.mk b/solenv/inc/unxlnghppa.mk
new file mode 100644
index 000000000000..240eef609365
--- /dev/null
+++ b/solenv/inc/unxlnghppa.mk
@@ -0,0 +1,39 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2008 by Sun Microsystems, Inc.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# $RCSfile: unxlnghppa.mk,v $
+#
+# $Revision: 1.2 $
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+# mk file for Unix Linux HPPA using GCC, please make generic modifications to unxlng.mk
+PICSWITCH:=-fPIC
+.INCLUDE : unxlng.mk
+CDEFS+=-DHPPA
+CFLAGS+=
+CFLAGSCC+=
+CFLAGSCXX+=
+DLLPOSTFIX=lh
diff --git a/solenv/inc/unxlngm68k.mk b/solenv/inc/unxlngm68k.mk
index a206d61543b2..25d5118839e4 100644
--- a/solenv/inc/unxlngm68k.mk
+++ b/solenv/inc/unxlngm68k.mk
@@ -37,5 +37,5 @@ PICSWITCH:=-fPIC
CDEFS+=-DM68K
CFLAGS+=-fsigned-char -fno-omit-frame-pointer
CFLAGSCC+=-fsigned-char
-CFLAGSCXX+=-fsigned-char -fno-use-cxa-atexit
+CFLAGSCXX+=-fsigned-char
DLLPOSTFIX=lm
diff --git a/solenv/inc/unxlngr.mk b/solenv/inc/unxlngr.mk
index 8a82cefb0b14..b108888d190b 100644
--- a/solenv/inc/unxlngr.mk
+++ b/solenv/inc/unxlngr.mk
@@ -35,5 +35,4 @@ CDEFAULTOPT=-Os
.INCLUDE : unxlng.mk
CDEFS+=-DARM32
CFLAGS+=-fno-omit-frame-pointer
-CFLAGSCXX+=-fno-use-cxa-atexit
DLLPOSTFIX=lr
diff --git a/solenv/inc/unxlngx.mk b/solenv/inc/unxlngx.mk
index 5bb9f5b198b2..ba74a55cfdc3 100644
--- a/solenv/inc/unxlngx.mk
+++ b/solenv/inc/unxlngx.mk
@@ -33,7 +33,6 @@
.INCLUDE : unxlng.mk
CDEFS+=-DX86_64
-CFLAGSCXX+=-fno-use-cxa-atexit
MODULES_WITH_WARNINGS+=\
svx
DLLPOSTFIX=lx
diff --git a/svtools/inc/calendar.hxx b/svtools/inc/calendar.hxx
index 6f20a7f8c6c3..1c81945a669c 100644
--- a/svtools/inc/calendar.hxx
+++ b/svtools/inc/calendar.hxx
@@ -251,6 +251,7 @@ private:
USHORT mnDragScrollHitTest;
#ifdef _SV_CALENDAR_CXX
+ using Control::ImplInitSettings;
using Window::ImplInit;
SVT_DLLPRIVATE void ImplInit( WinBits nWinStyle );
SVT_DLLPRIVATE void ImplInitSettings();
diff --git a/svtools/inc/privsplt.hxx b/svtools/inc/privsplt.hxx
deleted file mode 100644
index 50a500de8848..000000000000
--- a/svtools/inc/privsplt.hxx
+++ /dev/null
@@ -1,86 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: privsplt.hxx,v $
- * $Revision: 1.3 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _SV_PRIVSPLT_HXX
-#define _SV_PRIVSPLT_HXX
-
-#include <vcl/fixed.hxx>
-
-enum PRIVSPLIT_DIRECTION {PRIVSPLIT_HORZ,PRIVSPLIT_VERT };
-
-class SvPrivatSplit : public FixedLine
-{
- private:
-
- Link aCtrModifiedLink;
- BOOL aMovingFlag;
- Pointer aWinPointer;
- PRIVSPLIT_DIRECTION eAdrSplit;
- short nOldX;
- short nOldY;
- short nNewX;
- short nNewY;
- short nMinPos;
- short nMaxPos;
- Range aXMovingRange;
- Range aYMovingRange;
- short nDeltaX;
- short nDeltaY;
- void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
-
- protected:
- virtual void MouseButtonDown( const MouseEvent& rMEvt );
- virtual void Tracking( const TrackingEvent& rTEvt );
-
- public:
-
- SvPrivatSplit( Window* pWindow, const ResId& rResId,PRIVSPLIT_DIRECTION eAdrSplit);
-
- SvPrivatSplit( Window* pParent,PRIVSPLIT_DIRECTION eAdrSplit, WinBits nStyle = 0);
-
- virtual short GetDeltaX();
- virtual short GetDeltaY();
-
- virtual void CtrModified();
-
- void SetXRange(Range cRgeX);
- void SetYRange(Range cRgeY);
-
- void MoveSplitTo(Point aPos);
-
- virtual void StateChanged( StateChangedType nType );
- virtual void DataChanged( const DataChangedEvent& rDCEvt );
-
- void SetCtrModifiedHdl( const Link& rLink ) { aCtrModifiedLink = rLink; }
- const Link& GetCtrModifiedHdl() const { return aCtrModifiedLink; }
-};
-
-
-#endif
diff --git a/svtools/inc/sectctr.hxx b/svtools/inc/sectctr.hxx
deleted file mode 100644
index da73e7aed4a7..000000000000
--- a/svtools/inc/sectctr.hxx
+++ /dev/null
@@ -1,154 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: sectctr.hxx,v $
- * $Revision: 1.4 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _SV_SECTCTR_HXX
-#define _SV_SECTCTR_HXX
-
-#include <vcl/sv.h>
-#include <vcl/ctrl.hxx>
-
-class ImplSplitWindow;
-class ScrollBar;
-class ScrollBarBox;
-class SvSection;
-
-#define SECTION_APPEND ((USHORT)0xFFFF)
-#define SECTION_NOTFOUND ((USHORT)0xFFFF)
-
-#define WB_SECTION_STYLE WB_VSCROLL | WB_HSCROLL | WB_TABSTOP
-
-class SvSectionControl : public Control
-{
-private:
-
- Window aSplitWinContainer;
- ImplSplitWindow* pSplitWin;
- ScrollBar* pVScrollBar;
- ScrollBar* pHScrollBar;
- ScrollBarBox* pScrollBarBox;
- DockingWindow* pDummy;
- long nRealHeight;
- long nMaxHeight;
- long nMinWidth;
- Wallpaper aWallpaper;
-
- DECL_LINK( ScrollHdl, ScrollBar* );
- DECL_LINK( EndScrollHdl, ScrollBar* );
-
-
-protected:
-
- virtual void Resize();
- virtual void Paint( const Rectangle& rRect );
- virtual void StateChanged( StateChangedType nStateChange );
- virtual void DataChanged( const DataChangedEvent& rDCEvt );
- virtual void Command( const CommandEvent& rCEvt );
- virtual long PreNotify( NotifyEvent& rNEvt );
- virtual long Notify( NotifyEvent& rNEvt );
- virtual long KeyEventNotify( const KeyEvent& rKEvt );
- using Control::SetPosSizePixel;
- virtual void SetPosSizePixel( long nX, long nY,long nWidth, long nHeight,USHORT nFlags);
-
-
-
- long CalcMaxHeight();
- long CalcRealHeight();
- long CalcSectionWidth();
-
- void SetScrollBars(BOOL bVert,BOOL bHorz);
- void ShowScrollBarBox();
- void UpdateScrollBars();
-
- BOOL VScrollResize(Size &aSize);
- BOOL HScrollResize(Size &aSize);
- void SetChildPos(long nPos, BOOL bScrolling = TRUE);
-
-public:
- SvSectionControl( Window* pParent,WinBits nStyle = WB_SECTION_STYLE);
- SvSectionControl( Window* pParent, const ResId& rResId );
- ~SvSectionControl();
-
-
- void InsertSection( USHORT nSectionId,SvSection* pSection,long nSize,USHORT nPos);
- void InsertSection( USHORT nSectionId,SvSection* pSection,USHORT nPos);
- void RemoveSection( USHORT nSectionId );
- void Clear();
-
- USHORT GetSectionCount() const;
- USHORT GetSectionId( USHORT nPos ) const;
- USHORT GetSectionPos( USHORT nSectionId ) const;
- USHORT GetSectionId( const Point& rPos ) const;
-
- void SetSectionSize( USHORT nId, long nNewSize );
- long GetSectionSize( USHORT nId ) const;
-
- /*
- void SetCurSectionId( USHORT nSectionId );
- USHORT GetCurSectionId() const;
-
- void SetFirstSectionId( USHORT nSectionId );
- USHORT GetFirstSectionId() const { return GetSectionId( mnFirstSectionPos ); }
-
- void MakeVisible( USHORT nSectionId );
- */
-
- void SetSectionWidth( USHORT nSectionId, long nWidth);
- long GetSectionWidth( USHORT nSectionId ) const;
-
- void SetSection( USHORT nSectionId, SvSection* pPage );
- SvSection* GetSection( USHORT nSectionId ) const;
-
- void SetSectionText( USHORT nSectionId, const XubString& rText );
- XubString GetSectionText( USHORT nSectionId ) const;
-
- void SetHelpText( USHORT nSectionId, const XubString& rText );
- const XubString& GetHelpText( USHORT nSectionId ) const;
-
- void SetHelpId( USHORT nSectionId, ULONG nHelpId );
- ULONG GetHelpId( USHORT nSectionId ) const;
-
- void SetHelpText( const XubString& rText )
- { Control::SetHelpText( rText ); }
- const XubString& GetHelpText() const
- { return Control::GetHelpText(); }
-
- void SetHelpId( ULONG nId )
- { Control::SetHelpId( nId ); }
- ULONG GetHelpId() const
- { return Control::GetHelpId(); }
-
- using Control::SetBackground;
- void SetBackground( const Wallpaper& rBackground ){aWallpaper=rBackground; }
- const Wallpaper& GetBackground() const { return aWallpaper; }
-
-};
-
-
-#endif
diff --git a/svtools/inc/svtools/editbrowsebox.hxx b/svtools/inc/svtools/editbrowsebox.hxx
index c72c7c54f877..60fcbc9efb1a 100644
--- a/svtools/inc/svtools/editbrowsebox.hxx
+++ b/svtools/inc/svtools/editbrowsebox.hxx
@@ -675,6 +675,7 @@ namespace svt
private:
virtual void PaintField(OutputDevice& rDev, const Rectangle& rRect,
sal_uInt16 nColumnId ) const;
+ using Control::ImplInitSettings;
SVT_DLLPRIVATE void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
SVT_DLLPRIVATE void DetermineFocus( const sal_uInt16 _nGetFocusFlags = 0);
inline void HideAndDisable(CellControllerRef& rController);
diff --git a/svtools/inc/svtools/embedhlp.hxx b/svtools/inc/svtools/embedhlp.hxx
index f4cccd3115b8..68763a3fd487 100644
--- a/svtools/inc/svtools/embedhlp.hxx
+++ b/svtools/inc/svtools/embedhlp.hxx
@@ -6,9 +6,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: embedhlp.hxx,v $
- * $Revision: 1.2 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -131,6 +128,13 @@ namespace svt
BOOL is() const { return mxObj.is(); }
BOOL IsChart() const;
+
+ // #i104867#
+ // Provides a graphic version number for the fetchable Graphic during this object's lifetime. Internally,
+ // that number is incremented at each change of the Graphic. This mechanism is needed to identify if a
+ // remembered Graphic (e.g. primitives) has changed compared to the current one, but without actively
+ // fetching the Graphic what would be too expensive e.g. for charts
+ sal_uInt32 getGraphicVersion() const;
void SetDefaultSizeForChart( const Size& rSizeIn_100TH_MM );//#i103460# charts do not necessaryly have an own size within ODF files, in this case they need to use the size settings from the surrounding frame, which is made available with this method
};
}
diff --git a/svtools/inc/svtools/section.hxx b/svtools/inc/svtools/section.hxx
deleted file mode 100644
index 48941d06b7ca..000000000000
--- a/svtools/inc/svtools/section.hxx
+++ /dev/null
@@ -1,104 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: section.hxx,v $
- * $Revision: 1.3 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _SV_SECTION_HXX
-#define _SV_SECTION_HXX
-
-#include <vcl/sv.h>
-#include <vcl/ctrl.hxx>
-#include <vcl/dockwin.hxx>
-#include <vcl/tabpage.hxx>
-#include <svtools/expander.hxx>
-#include <svtools/privsplt.hxx>
-
-class SvSectionControl;
-
-class SvSection : public DockingWindow
-{
-private:
- SvSectionControl* pSectionControl;
- USHORT nSectionID;
- Window* pChildWin;
- XubString aName;
- long nHeight;
- long nMinHeight;
- long nMinWidth;
- long nOldHeight;
-
- DECL_LINK( ToggleHdl, SvExpander* );
- DECL_LINK( SplitHdl, SvPrivatSplit* );
-
- void ImplExpandSection();
- void ImplShrinkSection();
-
-protected:
- SvExpander aExpander;
- Window aChildWinContainer;
- SvPrivatSplit aPrivatSplit;
-
- virtual void Resize();
- virtual void Paint( const Rectangle& rRect );
- virtual long Notify( NotifyEvent& rNEvt );
-
-public:
- SvSection(const XubString& rName,SvSectionControl* pParent,
- WinBits nStyle = 0);
- SvSection(const XubString& rName,SvSectionControl* pParent,
- Window* pChildWin, WinBits nStyle = 0);
-
- virtual void SetScrollPos(long nPos);
- void SetChildPos(long nPos);
-
- void SetSectionControl(SvSectionControl* pParent);
- const SvSectionControl* GetSectionControl()const ;
- void SetSectionText( const XubString& );
- const XubString& GetSectionText() const {return aName;}
-
- void SetChildWin(Window* pChildWin);
- Window* GetChildWin() const {return pChildWin;}
-
- void SetSectionID(USHORT nId) {nSectionID=nId;}
- USHORT GetSectionID() const {return nSectionID;}
-
- void SetMaxHeight(long nHeight);
- long GetMaxHeight();
-
- void SetMinHeight(long nHeight);
- long GetMinHeight();
-
- void SetMinWidth(long nWidth);
- long GetMinWidth();
-
- void ExpandSection();
- void ShrinkSection();
- BOOL IsExpanded();
-};
-
-#endif
diff --git a/svtools/inc/svtools/svmedit.hxx b/svtools/inc/svtools/svmedit.hxx
index b1e0d368c9ba..ccf77299965c 100644
--- a/svtools/inc/svtools/svmedit.hxx
+++ b/svtools/inc/svtools/svmedit.hxx
@@ -61,6 +61,7 @@ protected:
void DataChanged( const DataChangedEvent& rDCEvt );
virtual long PreNotify( NotifyEvent& rNEvt );
long Notify( NotifyEvent& rNEvt );
+ using Control::ImplInitSettings;
void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
WinBits ImplInitStyle( WinBits nStyle );
diff --git a/svtools/inc/svtools/valueset.hxx b/svtools/inc/svtools/valueset.hxx
index 647851008c8f..fc12f9517b6d 100644
--- a/svtools/inc/svtools/valueset.hxx
+++ b/svtools/inc/svtools/valueset.hxx
@@ -285,6 +285,7 @@ private:
#ifdef _SV_VALUESET_CXX
friend class ValueSetAcc;
friend class ValueItemAcc;
+ using Control::ImplInitSettings;
using Window::ImplInit;
SVT_DLLPRIVATE void ImplInit();
SVT_DLLPRIVATE void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
diff --git a/svtools/prj/d.lst b/svtools/prj/d.lst
index 3dc9c0b013bb..aebe1dabc908 100644
--- a/svtools/prj/d.lst
+++ b/svtools/prj/d.lst
@@ -210,9 +210,6 @@ mkdir: %_DEST%\inc%_EXT%\svtools
..\inc\instrm.hxx %_DEST%\inc%_EXT%\svtools\instrm.hxx
..\inc\outstrm.hxx %_DEST%\inc%_EXT%\svtools\outstrm.hxx
-..\inc\svtools\section.hxx %_DEST%\inc%_EXT%\svtools\section.hxx
-..\inc\sectctr.hxx %_DEST%\inc%_EXT%\svtools\sectctr.hxx
-..\inc\privsplt.hxx %_DEST%\inc%_EXT%\svtools\privsplt.hxx
..\inc\expander.hxx %_DEST%\inc%_EXT%\svtools\expander.hxx
..\source\svsql\converter.hxx %_DEST%\inc%_EXT%\svtools\converter.hxx
diff --git a/svtools/source/contnr/ivctrl.cxx b/svtools/source/contnr/ivctrl.cxx
index b3b5829b479e..916738af70ae 100644
--- a/svtools/source/contnr/ivctrl.cxx
+++ b/svtools/source/contnr/ivctrl.cxx
@@ -579,8 +579,7 @@ Rectangle SvtIconChoiceCtrl::GetBoundingBox( SvxIconChoiceCtrlEntry* pEntry ) co
void SvtIconChoiceCtrl::FillLayoutData() const
{
- DBG_ASSERT( !mpLayoutData, "SvtIconChoiceCtrl::FillLayoutData: shouldn't this be called with non-existent layout data only?" );
- mpLayoutData = new ::vcl::ControlLayoutData();
+ CreateLayoutData();
SvtIconChoiceCtrl* pNonConstMe = const_cast< SvtIconChoiceCtrl* >( this );
@@ -598,7 +597,7 @@ void SvtIconChoiceCtrl::FillLayoutData() const
sal_Bool bLargeIconMode = WB_ICON == ( _pImp->GetStyle() & ( VIEWMODE_MASK ) );
sal_uInt16 nTextPaintFlags = bLargeIconMode ? PAINTFLAG_HOR_CENTERED : PAINTFLAG_VER_CENTERED;
- _pImp->PaintItem( aTextRect, IcnViewFieldTypeText, pEntry, nTextPaintFlags, pNonConstMe, &sEntryText, mpLayoutData );
+ _pImp->PaintItem( aTextRect, IcnViewFieldTypeText, pEntry, nTextPaintFlags, pNonConstMe, &sEntryText, GetLayoutData() );
++nPos;
}
diff --git a/svtools/source/misc/embedhlp.cxx b/svtools/source/misc/embedhlp.cxx
index 6bd1126f8082..edddb7c1ab6d 100644
--- a/svtools/source/misc/embedhlp.cxx
+++ b/svtools/source/misc/embedhlp.cxx
@@ -7,7 +7,6 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: embedhlp.cxx,v $
- * $Revision: 1.28 $
*
* This file is part of OpenOffice.org.
*
@@ -189,7 +188,6 @@ void SAL_CALL EmbedEventListener_Impl::modified( const lang::EventObject& ) thro
pObject->UpdateReplacementOnDemand();
}
}
-
}
void SAL_CALL EmbedEventListener_Impl::notifyEvent( const document::EventObject& aEvent ) throw( uno::RuntimeException )
@@ -250,6 +248,9 @@ struct EmbeddedObjectRef_Impl
sal_Int64 nViewAspect;
BOOL bIsLocked;
sal_Bool bNeedUpdate;
+
+ // #i104867#
+ sal_uInt32 mnGraphicVersion;
awt::Size aDefaultSizeForChart_In_100TH_MM;//#i103460# charts do not necessaryly have an own size within ODF files, in this case they need to use the size settings from the surrounding frame, which is made available with this member
};
@@ -262,6 +263,7 @@ void EmbeddedObjectRef::Construct_Impl()
mpImp->nViewAspect = embed::Aspects::MSOLE_CONTENT;
mpImp->bIsLocked = FALSE;
mpImp->bNeedUpdate = sal_False;
+ mpImp->mnGraphicVersion = 0;
mpImp->aDefaultSizeForChart_In_100TH_MM = awt::Size(8000,7000);
}
@@ -297,12 +299,14 @@ EmbeddedObjectRef::EmbeddedObjectRef( const EmbeddedObjectRef& rObj )
mpImp->pGraphic = 0;
mpImp->pHCGraphic = 0;
+ mpImp->mnGraphicVersion = 0;
}
EmbeddedObjectRef::~EmbeddedObjectRef()
{
delete mpImp->pGraphic;
- if ( mpImp->pHCGraphic ) DELETEZ( mpImp->pHCGraphic );
+ if ( mpImp->pHCGraphic )
+ DELETEZ( mpImp->pHCGraphic );
Clear();
}
/*
@@ -453,10 +457,15 @@ void EmbeddedObjectRef::GetReplacement( BOOL bUpdate )
DELETEZ( mpImp->pGraphic );
mpImp->aMediaType = ::rtl::OUString();
mpImp->pGraphic = new Graphic;
- if ( mpImp->pHCGraphic ) DELETEZ( mpImp->pHCGraphic );
+ if ( mpImp->pHCGraphic )
+ DELETEZ( mpImp->pHCGraphic );
+ mpImp->mnGraphicVersion++;
}
else if ( !mpImp->pGraphic )
+ {
mpImp->pGraphic = new Graphic;
+ mpImp->mnGraphicVersion++;
+ }
else
{
DBG_ERROR("No update, but replacement exists already!");
@@ -469,6 +478,7 @@ void EmbeddedObjectRef::GetReplacement( BOOL bUpdate )
GraphicFilter* pGF = GraphicFilter::GetGraphicFilter();
if( mpImp->pGraphic )
pGF->ImportGraphic( *mpImp->pGraphic, String(), *pGraphicStream, GRFILTER_FORMAT_DONTKNOW );
+ mpImp->mnGraphicVersion++;
delete pGraphicStream;
}
}
@@ -598,6 +608,7 @@ Graphic* EmbeddedObjectRef::GetHCGraphic() const
mpImp->pHCGraphic = pGraphic;
else
delete pGraphic;
+ mpImp->mnGraphicVersion++;
}
delete pStream;
@@ -615,7 +626,9 @@ void EmbeddedObjectRef::SetGraphicStream( const uno::Reference< io::XInputStream
delete mpImp->pGraphic;
mpImp->pGraphic = new Graphic();
mpImp->aMediaType = rMediaType;
- if ( mpImp->pHCGraphic ) DELETEZ( mpImp->pHCGraphic );
+ if ( mpImp->pHCGraphic )
+ DELETEZ( mpImp->pHCGraphic );
+ mpImp->mnGraphicVersion++;
SvStream* pGraphicStream = ::utl::UcbStreamHelper::CreateStream( xInGrStream );
@@ -623,6 +636,7 @@ void EmbeddedObjectRef::SetGraphicStream( const uno::Reference< io::XInputStream
{
GraphicFilter* pGF = GraphicFilter::GetGraphicFilter();
pGF->ImportGraphic( *mpImp->pGraphic, String(), *pGraphicStream, GRFILTER_FORMAT_DONTKNOW );
+ mpImp->mnGraphicVersion++;
if ( mpImp->pContainer )
{
@@ -645,7 +659,9 @@ void EmbeddedObjectRef::SetGraphic( const Graphic& rGraphic, const ::rtl::OUStri
delete mpImp->pGraphic;
mpImp->pGraphic = new Graphic( rGraphic );
mpImp->aMediaType = rMediaType;
- if ( mpImp->pHCGraphic ) DELETEZ( mpImp->pHCGraphic );
+ if ( mpImp->pHCGraphic )
+ DELETEZ( mpImp->pHCGraphic );
+ mpImp->mnGraphicVersion++;
if ( mpImp->pContainer )
SetGraphicToContainer( rGraphic, *mpImp->pContainer, mpImp->aPersistName, rMediaType );
@@ -880,7 +896,9 @@ void EmbeddedObjectRef::UpdateReplacementOnDemand()
{
DELETEZ( mpImp->pGraphic );
mpImp->bNeedUpdate = sal_True;
- if ( mpImp->pHCGraphic ) DELETEZ( mpImp->pHCGraphic );
+ if ( mpImp->pHCGraphic )
+ DELETEZ( mpImp->pHCGraphic );
+ mpImp->mnGraphicVersion++;
if( mpImp->pContainer )
{
@@ -914,6 +932,12 @@ BOOL EmbeddedObjectRef::IsChart() const
return sal_False;
}
+// #i104867#
+sal_uInt32 EmbeddedObjectRef::getGraphicVersion() const
+{
+ return mpImp->mnGraphicVersion;
+}
+
void EmbeddedObjectRef::SetDefaultSizeForChart( const Size& rSizeIn_100TH_MM )
{
//#i103460# charts do not necessaryly have an own size within ODF files,
@@ -928,4 +952,5 @@ void EmbeddedObjectRef::SetDefaultSizeForChart( const Size& rSizeIn_100TH_MM )
xSizeTransmitter->setDefaultSize( mpImp->aDefaultSizeForChart_In_100TH_MM );
}
-}
+} // namespace svt
+
diff --git a/svx/inc/svx/fmmodel.hxx b/svx/inc/svx/fmmodel.hxx
index 2f61967bc3ac..f831729b5006 100644
--- a/svx/inc/svx/fmmodel.hxx
+++ b/svx/inc/svx/fmmodel.hxx
@@ -89,14 +89,16 @@ public:
/** check whether the OpenInDesignMode has been set explicitly or been loaded (<FALSE/>)
or if it still has the default value from construction (<TRUE/>)
*/
- sal_Bool OpenInDesignModeIsDefaulted( );
+ sal_Bool OpenInDesignModeIsDefaulted();
-//#if 0 // _SOLAR__PRIVATE
- void implSetOpenInDesignMode( sal_Bool _bOpenDesignMode, sal_Bool _bForce );
+ /** determines whether form controls should use the SdrModel's reference device for text rendering
+ */
+ sal_Bool ControlsUseRefDevice() const;
FmXUndoEnvironment& GetUndoEnv();
-//#endif
+private:
+ void implSetOpenInDesignMode( sal_Bool _bOpenDesignMode, sal_Bool _bForce );
};
#endif // _FM_FMMODEL_HXX
diff --git a/svx/inc/svx/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx
index 4eddc4386a0d..8f7f0eb23cb3 100644
--- a/svx/inc/svx/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx
+++ b/svx/inc/svx/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx
@@ -56,8 +56,13 @@ namespace drawinglayer
// defines if SdrTextWordWrapItem was set at SdrObjCustomShape which means
// that the text needs to be block formatted
unsigned mbWordWrap : 1;
- // #SJ# Allow text clipping against TextBox in special cases (used for SC)
- unsigned mbForceTextClipToTextRange : 1;
+
+ // #SJ# Allow text clipping against TextBox in special cases (used for SC)
+ unsigned mbForceTextClipToTextRange : 1;
+
+ // defines that the object contains/is a 3D AutoShape. Needed for
+ // making exceptions with shadow generation
+ unsigned mb3DShape : 1;
protected:
// local decomposition.
@@ -69,7 +74,8 @@ namespace drawinglayer
const Primitive2DSequence& rSubPrimitives,
const basegfx::B2DHomMatrix& rTextBox,
bool bWordWrap,
- bool bForceTextClipToTextRange);
+ bool bForceTextClipToTextRange,
+ bool b3DShape);
// data access
const attribute::SdrShadowTextAttribute& getSdrSTAttribute() const { return maSdrSTAttribute; }
@@ -77,6 +83,7 @@ namespace drawinglayer
const basegfx::B2DHomMatrix& getTextBox() const { return maTextBox; }
bool getWordWrap() const { return mbWordWrap; }
bool isForceTextClipToTextRange() const { return mbForceTextClipToTextRange; }
+ bool get3DShape() const { return mb3DShape; }
// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
diff --git a/svx/inc/svx/sdr/primitive2d/sdrolecontentprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrolecontentprimitive2d.hxx
index 70e28d599a44..9ee4f3f69417 100644
--- a/svx/inc/svx/sdr/primitive2d/sdrolecontentprimitive2d.hxx
+++ b/svx/inc/svx/sdr/primitive2d/sdrolecontentprimitive2d.hxx
@@ -53,6 +53,11 @@ namespace drawinglayer
SdrObjectWeakRef mpSdrOle2Obj;
basegfx::B2DHomMatrix maObjectTransform;
+ // #i104867# The GraphicVersion number to identify in operator== if
+ // the graphic has changed, but without fetching it (which may
+ // be expensive, e.g. triggering chart creation)
+ sal_uInt32 mnGraphicVersion;
+
// bitfield
unsigned mbHighContrast : 1;
@@ -64,6 +69,7 @@ namespace drawinglayer
SdrOleContentPrimitive2D(
const SdrOle2Obj& rSdrOle2Obj,
const basegfx::B2DHomMatrix& rObjectTransform,
+ sal_uInt32 nGraphicVersion,
bool bHighContrast);
// compare operator
@@ -74,6 +80,7 @@ namespace drawinglayer
// data access
const basegfx::B2DHomMatrix& getObjectTransform() const { return maObjectTransform; }
+ sal_uInt32 getGraphicVersion() const { return mnGraphicVersion; }
bool getHighContrast() const { return mbHighContrast; }
// provide unique ID
diff --git a/svx/inc/svx/sdr/primitive2d/sdrrectangleprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrrectangleprimitive2d.hxx
index 650cc1a882c5..23bbc2676f22 100644
--- a/svx/inc/svx/sdr/primitive2d/sdrrectangleprimitive2d.hxx
+++ b/svx/inc/svx/sdr/primitive2d/sdrrectangleprimitive2d.hxx
@@ -55,9 +55,8 @@ namespace drawinglayer
double mfCornerRadiusY; // [0.0..1.0] relative to 1/2 height
// bitfield
- // flag which decides if this is a text frame. If Yes, the HitArea
- // should be the filled geometry
- bool mbTextFrame : 1;
+ // flag which decides if the HitArea should be the filled geometry
+ bool mbForceFillForHitTest : 1;
protected:
// local decomposition.
@@ -69,7 +68,7 @@ namespace drawinglayer
const attribute::SdrLineFillShadowTextAttribute& rSdrLFSTAttribute,
double fCornerRadiusX,
double fCornerRadiusY,
- bool bTextFrame);
+ bool bForceFillForHitTest);
// data access
const basegfx::B2DHomMatrix& getTransform() const { return maTransform; }
@@ -77,7 +76,7 @@ namespace drawinglayer
double getCornerRadiusX() const { return mfCornerRadiusX; }
double getCornerRadiusY() const { return mfCornerRadiusY; }
bool isCornerRadiusUsed() const { return (0.0 != mfCornerRadiusX || 0.0 != mfCornerRadiusY); }
- bool getTextFrame() const { return mbTextFrame; }
+ bool getForceFillForHitTest() const { return mbForceFillForHitTest; }
// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
diff --git a/svx/inc/svx/svddrgmt.hxx b/svx/inc/svx/svddrgmt.hxx
index fa4e09c9a324..91112a7dd287 100644
--- a/svx/inc/svx/svddrgmt.hxx
+++ b/svx/inc/svx/svddrgmt.hxx
@@ -107,6 +107,22 @@ public:
//////////////////////////////////////////////////////////////////////////////
+class SdrDragEntryPrimitive2DSequence : public SdrDragEntry
+{
+private:
+ drawinglayer::primitive2d::Primitive2DSequence maPrimitive2DSequence;
+
+public:
+ SdrDragEntryPrimitive2DSequence(
+ const drawinglayer::primitive2d::Primitive2DSequence& rSequence,
+ bool bAddToTransparent);
+ virtual ~SdrDragEntryPrimitive2DSequence();
+
+ virtual drawinglayer::primitive2d::Primitive2DSequence createPrimitive2DSequenceInCurrentState(SdrDragMethod& rDragMethod);
+};
+
+//////////////////////////////////////////////////////////////////////////////
+
class SdrDragEntryPointGlueDrag : public SdrDragEntry
{
private:
@@ -138,6 +154,7 @@ protected:
void clearSdrDragEntries() { for(sal_uInt32 a(0); a < maSdrDragEntries.size(); a++) { delete maSdrDragEntries[a]; } maSdrDragEntries.clear(); }
void addSdrDragEntry(SdrDragEntry* pNew) { if(pNew) { maSdrDragEntries.push_back(pNew); }}
virtual void createSdrDragEntries();
+ virtual void createSdrDragEntryForSdrObject(const SdrObject& rOriginal, sdr::contact::ObjectContact& rObjectContact, bool bModify);
// access for derivated classes to maOverlayObjectList
void clearOverlayObjectList() { maOverlayObjectList.clear(); }
@@ -236,6 +253,9 @@ private:
void ImpCheckSnap(const Point& rPt);
+protected:
+ virtual void createSdrDragEntryForSdrObject(const SdrObject& rOriginal, sdr::contact::ObjectContact& rObjectContact, bool bModify);
+
public:
TYPEINFO();
SdrDragMove(SdrDragView& rNewView);
diff --git a/svx/inc/svx/svdfppt.hxx b/svx/inc/svx/svdfppt.hxx
index 63f196876e93..fb7f75598c4e 100644
--- a/svx/inc/svx/svdfppt.hxx
+++ b/svx/inc/svx/svdfppt.hxx
@@ -610,7 +610,7 @@ public:
UINT32& nMappedFontId, Font& rFont, char nDefault ) const;
const PptDocumentAtom& GetDocumentAtom() const { return aDocAtom; }
virtual const PptSlideLayoutAtom* GetSlideLayoutAtom() const;
- SdrObject* CreateTable( SdrObject* pGroupObject, sal_uInt32* pTableArry, SvxMSDffSolverContainer* ) const;
+ SdrObject* CreateTable( SdrObject* pGroupObject, sal_uInt32* pTableArry, SvxMSDffSolverContainer* );
};
////////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/svx/source/cui/numpages.cxx b/svx/source/cui/numpages.cxx
index 0e2840894e9a..6454b3dd7c2a 100644
--- a/svx/source/cui/numpages.cxx
+++ b/svx/source/cui/numpages.cxx
@@ -378,18 +378,12 @@ int SvxSingleNumPickTabPage::DeactivatePage(SfxItemSet *_pSet)
void SvxSingleNumPickTabPage::Reset( const SfxItemSet& rSet )
{
- const SfxPoolItem* pItem;
-// nActNumLvl = ((SwNumBulletTabDialog*)GetTabDialog())->GetActNumLevel();
- //im Draw gibt es das Item als WhichId, im Writer nur als SlotId
- SfxItemState eState = rSet.GetItemState(SID_ATTR_NUMBERING_RULE, FALSE, &pItem);
- if(eState != SFX_ITEM_SET)
- {
- nNumItemId = rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE);
- eState = rSet.GetItemState(nNumItemId, FALSE, &pItem);
- }
- DBG_ASSERT(eState == SFX_ITEM_SET, "kein Item gefunden!");
+ nNumItemId = rSet.GetPool() ? rSet.GetPool()->GetWhich( SID_ATTR_NUMBERING_RULE ) : SID_ATTR_NUMBERING_RULE;
+
+ const SvxNumBulletItem& rItem = static_cast< const SvxNumBulletItem& >( rSet.Get( nNumItemId, TRUE ) );
+
delete pSaveNum;
- pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule());
+ pSaveNum = new SvxNumRule(*rItem.GetNumRule());
if(!pActNum)
pActNum = new SvxNumRule(*pSaveNum);
@@ -570,17 +564,12 @@ int SvxBulletPickTabPage::DeactivatePage(SfxItemSet *_pSet)
void SvxBulletPickTabPage::Reset( const SfxItemSet& rSet )
{
- const SfxPoolItem* pItem;
- //im Draw gibt es das Item als WhichId, im Writer nur als SlotId
- SfxItemState eState = rSet.GetItemState(SID_ATTR_NUMBERING_RULE, FALSE, &pItem);
- if(eState != SFX_ITEM_SET)
- {
- nNumItemId = rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE);
- eState = rSet.GetItemState(nNumItemId, FALSE, &pItem);
- }
- DBG_ASSERT(eState == SFX_ITEM_SET, "kein Item gefunden!");
+ nNumItemId = rSet.GetPool() ? rSet.GetPool()->GetWhich( SID_ATTR_NUMBERING_RULE ) : SID_ATTR_NUMBERING_RULE;
+
+ const SvxNumBulletItem& rItem = static_cast< const SvxNumBulletItem& >( rSet.Get( nNumItemId, TRUE ) );
+
delete pSaveNum;
- pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule());
+ pSaveNum = new SvxNumRule(*rItem.GetNumRule());
// nActNumLvl = ((SwNumBulletTabDialog*)GetTabDialog())->GetActNumLevel();
@@ -800,17 +789,12 @@ int SvxNumPickTabPage::DeactivatePage(SfxItemSet *_pSet)
void SvxNumPickTabPage::Reset( const SfxItemSet& rSet )
{
- const SfxPoolItem* pItem;
- //im Draw gibt es das Item als WhichId, im Writer nur als SlotId
- SfxItemState eState = rSet.GetItemState(SID_ATTR_NUMBERING_RULE, FALSE, &pItem);
- if(eState != SFX_ITEM_SET)
- {
- nNumItemId = rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE);
- eState = rSet.GetItemState(nNumItemId, FALSE, &pItem);
- }
- DBG_ASSERT(eState == SFX_ITEM_SET, "kein Item gefunden!");
+ nNumItemId = rSet.GetPool() ? rSet.GetPool()->GetWhich( SID_ATTR_NUMBERING_RULE ) : SID_ATTR_NUMBERING_RULE;
+
+ const SvxNumBulletItem& rItem = static_cast< const SvxNumBulletItem& >( rSet.Get( nNumItemId, TRUE ) );
+
delete pSaveNum;
- pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule());
+ pSaveNum = new SvxNumRule(*rItem.GetNumRule());
// nActNumLvl = ((SwNumBulletTabDialog*)GetTabDialog())->GetActNumLevel();
if(!pActNum)
@@ -1105,17 +1089,12 @@ BOOL SvxBitmapPickTabPage::FillItemSet( SfxItemSet& rSet )
void SvxBitmapPickTabPage::Reset( const SfxItemSet& rSet )
{
- const SfxPoolItem* pItem;
- //im Draw gibt es das Item als WhichId, im Writer nur als SlotId
- SfxItemState eState = rSet.GetItemState(SID_ATTR_NUMBERING_RULE, FALSE, &pItem);
- if(eState != SFX_ITEM_SET)
- {
- nNumItemId = rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE);
- eState = rSet.GetItemState(nNumItemId, FALSE, &pItem);
- }
- DBG_ASSERT(eState == SFX_ITEM_SET, "kein Item gefunden!");
+ nNumItemId = rSet.GetPool() ? rSet.GetPool()->GetWhich( SID_ATTR_NUMBERING_RULE ) : SID_ATTR_NUMBERING_RULE;
+
+ const SvxNumBulletItem& rItem = static_cast< const SvxNumBulletItem& >( rSet.Get( nNumItemId, TRUE ) );
+
delete pSaveNum;
- pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule());
+ pSaveNum = new SvxNumRule(*rItem.GetNumRule());
if(!pActNum)
pActNum = new SvxNumRule(*pSaveNum);
@@ -1537,17 +1516,12 @@ BOOL SvxNumOptionsTabPage::FillItemSet( SfxItemSet& rSet )
--------------------------------------------------*/
void SvxNumOptionsTabPage::Reset( const SfxItemSet& rSet )
{
- const SfxPoolItem* pItem;
- //im Draw gibt es das Item als WhichId, im Writer nur als SlotId
- SfxItemState eState = rSet.GetItemState(SID_ATTR_NUMBERING_RULE, FALSE, &pItem);
- if(eState != SFX_ITEM_SET)
- {
- nNumItemId = rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE);
- eState = rSet.GetItemState(nNumItemId, FALSE, &pItem);
- }
- DBG_ASSERT(eState == SFX_ITEM_SET, "kein Item gefunden!");
+ nNumItemId = rSet.GetPool() ? rSet.GetPool()->GetWhich( SID_ATTR_NUMBERING_RULE ) : SID_ATTR_NUMBERING_RULE;
+
+ const SvxNumBulletItem& rItem = static_cast< const SvxNumBulletItem& >( rSet.Get( nNumItemId, TRUE ) );
+
delete pSaveNum;
- pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule());
+ pSaveNum = new SvxNumRule(*rItem.GetNumRule());
// Ebenen einfuegen
if(!aLevelLB.GetEntryCount())
@@ -1591,6 +1565,7 @@ void SvxNumOptionsTabPage::Reset( const SfxItemSet& rSet )
pPreviewWIN->SetNumRule(pActNum);
aSameLevelCB.Check(pActNum->IsContinuousNumbering());
+ const SfxPoolItem* pItem = 0;
//ColorListBox bei Bedarf fuellen
if ( pActNum->IsFeatureSupported( NUM_BULLET_COLOR ) )
{
@@ -3434,17 +3409,12 @@ BOOL SvxNumPositionTabPage::FillItemSet( SfxItemSet& rSet )
--------------------------------------------------*/
void SvxNumPositionTabPage::Reset( const SfxItemSet& rSet )
{
- const SfxPoolItem* pItem;
- //im Draw gibt es das Item als WhichId, im Writer nur als SlotId
- SfxItemState eState = rSet.GetItemState(SID_ATTR_NUMBERING_RULE, FALSE, &pItem);
- if(eState != SFX_ITEM_SET)
- {
- nNumItemId = rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE);
- eState = rSet.GetItemState(nNumItemId, FALSE, &pItem);
- }
- DBG_ASSERT(eState == SFX_ITEM_SET, "kein Item gefunden!");
+ nNumItemId = rSet.GetPool() ? rSet.GetPool()->GetWhich( SID_ATTR_NUMBERING_RULE ) : SID_ATTR_NUMBERING_RULE;
+
+ const SvxNumBulletItem& rItem = static_cast< const SvxNumBulletItem& >( rSet.Get( nNumItemId, TRUE ) );
+
delete pSaveNum;
- pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule());
+ pSaveNum = new SvxNumRule(*rItem.GetNumRule());
// Ebenen einfuegen
if(!aLevelLB.GetEntryCount())
diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx
index 36bb586b01d6..0ef28d7972dc 100644
--- a/svx/source/customshapes/EnhancedCustomShape2d.cxx
+++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx
@@ -696,7 +696,16 @@ EnhancedCustomShape2d::EnhancedCustomShape2d( SdrObject* pAObj ) :
ClearItem( SDRATTR_TEXTDIRECTION ); //SJ: vertical writing is not required, by removing this item no outliner is created
- // For primitive rendering, shadow handling is done completely based on the geometry, so i removed it here
+ // #i105323# For 2D AtoShapes, the shadow attirbute does not need to be applied to any
+ // of the constucted helper SdrObjects. This would lead to problems since the shadow
+ // of one helper object would fall on one helper object behind it (e.g. with the
+ // eyes of the smiley shape). This is not wanted; instead a single shadow 'behind'
+ // the AutoShape visualisation is wanted. This is done with primitive functionailty
+ // now in SdrCustomShapePrimitive2D::create2DDecomposition, but only for 2D objects
+ // (see there and in EnhancedCustomShape3d::Create3DObject to read more).
+ // This exception may be removed later when AutoShapes will create primitives directly.
+ // So, currently remove the ShadowAttribute from the ItemSet to not apply it to any
+ // 2D helper shape.
ClearItem(SDRATTR_SHADOW);
Point aP( pCustomShapeObj->GetSnapRect().Center() );
@@ -731,23 +740,23 @@ EnhancedCustomShape2d::EnhancedCustomShape2d( SdrObject* pAObj ) :
/*const sal_Int32* pDefData =*/ ApplyShapeAttributes( rGeometryItem );
switch( eSpType )
{
- case mso_sptCan : nColorData = 0x20400000; break;
- case mso_sptCube : nColorData = 0x302e0000; break;
- case mso_sptActionButtonBlank : nColorData = 0x502ce400; break;
- case mso_sptActionButtonHome : nColorData = 0x702ce4ce; break;
- case mso_sptActionButtonHelp : nColorData = 0x602ce4c0; break;
- case mso_sptActionButtonInformation : nColorData = 0x702ce4c5; break;
- case mso_sptActionButtonBackPrevious : nColorData = 0x602ce4c0; break;
- case mso_sptActionButtonForwardNext : nColorData = 0x602ce4c0; break;
- case mso_sptActionButtonBeginning : nColorData = 0x602ce4c0; break;
- case mso_sptActionButtonEnd : nColorData = 0x602ce4c0; break;
- case mso_sptActionButtonReturn : nColorData = 0x602ce4c0; break;
- case mso_sptActionButtonDocument : nColorData = 0x702ce4ec; break;
- case mso_sptActionButtonSound : nColorData = 0x602ce4c0; break;
- case mso_sptActionButtonMovie : nColorData = 0x602ce4c0; break;
- case mso_sptBevel : nColorData = 0x502ce400; break;
- case mso_sptFoldedCorner : nColorData = 0x20e00000; break;
- case mso_sptSmileyFace : nColorData = 0x20e00000; break;
+ case mso_sptCan : nColorData = 0x20400000; break;
+ case mso_sptCube : nColorData = 0x302e0000; break;
+ case mso_sptActionButtonBlank : nColorData = 0x502ce400; break;
+ case mso_sptActionButtonHome : nColorData = 0x702ce4ce; break;
+ case mso_sptActionButtonHelp : nColorData = 0x602ce4c0; break;
+ case mso_sptActionButtonInformation : nColorData = 0x702ce4c5; break;
+ case mso_sptActionButtonBackPrevious : nColorData = 0x602ce4c0; break;
+ case mso_sptActionButtonForwardNext : nColorData = 0x602ce4c0; break;
+ case mso_sptActionButtonBeginning : nColorData = 0x602ce4c0; break;
+ case mso_sptActionButtonEnd : nColorData = 0x602ce4c0; break;
+ case mso_sptActionButtonReturn : nColorData = 0x602ce4c0; break;
+ case mso_sptActionButtonDocument : nColorData = 0x702ce4ec; break;
+ case mso_sptActionButtonSound : nColorData = 0x602ce4c0; break;
+ case mso_sptActionButtonMovie : nColorData = 0x602ce4c0; break;
+ case mso_sptBevel : nColorData = 0x502ce400; break;
+ case mso_sptFoldedCorner : nColorData = 0x20e00000; break;
+ case mso_sptSmileyFace : nColorData = 0x20e00000; break;
case mso_sptNil :
{
if( sShapeType.getLength() > 4 &&
@@ -1701,6 +1710,19 @@ void EnhancedCustomShape2d::CreateSubPath( sal_uInt16& rSrcPt, sal_uInt16& rSegm
if(aNewB2DPolyPolygon.count())
{
+ if( !bLineGeometryNeededOnly )
+ {
+ // hack aNewB2DPolyPolygon to fill logic rect - this is
+ // needed to produce gradient fills that look like mso
+ aNewB2DPolygon.clear();
+ aNewB2DPolygon.append(basegfx::B2DPoint(0,0));
+ aNewB2DPolyPolygon.append(aNewB2DPolygon);
+
+ aNewB2DPolygon.clear();
+ aNewB2DPolygon.append(basegfx::B2DPoint(aLogicRect.GetWidth(),
+ aLogicRect.GetHeight()));
+ aNewB2DPolyPolygon.append(aNewB2DPolygon);
+ }
// #i37011#
bool bForceCreateTwoObjects(false);
diff --git a/svx/source/customshapes/EnhancedCustomShape3d.cxx b/svx/source/customshapes/EnhancedCustomShape3d.cxx
index 2beab9adbe7a..07f7c2ab6bea 100644
--- a/svx/source/customshapes/EnhancedCustomShape3d.cxx
+++ b/svx/source/customshapes/EnhancedCustomShape3d.cxx
@@ -323,7 +323,17 @@ SdrObject* EnhancedCustomShape3d::Create3DObject( const SdrObject* pShape2d, con
Point aCenter( aSnapRect.Center() );
SfxItemSet aSet( pCustomShape->GetMergedItemSet() );
- aSet.ClearItem( SDRATTR_TEXTDIRECTION ); //SJ: vertical writing is not required, by removing this item no outliner is created
+
+ //SJ: vertical writing is not required, by removing this item no outliner is created
+ aSet.ClearItem( SDRATTR_TEXTDIRECTION );
+
+ // #i105323# For 3D AutoShapes, the shadow attribute has to be applied to each
+ // created visualisation helper model shape individually. The shadow itself
+ // will then be rendered from the 3D renderer correctly for the whole 3D scene
+ // (and thus behind all objects of which the visualisation may be built). So,
+ // dio NOT remove it from the ItemSet here.
+ // aSet.ClearItem(SDRATTR_SHADOW);
+
std::vector< E3dCompoundObject* > aPlaceholderObjectList;
double fExtrusionBackward, fExtrusionForward;
diff --git a/svx/source/engine3d/helperhittest3d.cxx b/svx/source/engine3d/helperhittest3d.cxx
index 821c0ba07c32..ad70d3399c8f 100644
--- a/svx/source/engine3d/helperhittest3d.cxx
+++ b/svx/source/engine3d/helperhittest3d.cxx
@@ -36,18 +36,10 @@
#include <svx/svdpage.hxx>
#include <svx/scene3d.hxx>
#include <svditer.hxx>
-#include <drawinglayer/processor3d/baseprocessor3d.hxx>
-#include <drawinglayer/primitive3d/drawinglayer_primitivetypes3d.hxx>
-#include <drawinglayer/primitive3d/transformprimitive3d.hxx>
-#include <drawinglayer/primitive3d/polygonprimitive3d.hxx>
-#include <drawinglayer/primitive3d/polypolygonprimitive3d.hxx>
+#include <drawinglayer/processor3d/cutfindprocessor3d.hxx>
#include <svx/sdr/contact/viewcontactofe3d.hxx>
#include <svx/sdr/contact/viewcontactofe3dscene.hxx>
-#include <basegfx/polygon/b3dpolygontools.hxx>
-#include <basegfx/polygon/b3dpolypolygontools.hxx>
-#include <drawinglayer/primitive3d/hittestprimitive3d.hxx>
#include <com/sun/star/uno/Sequence.h>
-#include <drawinglayer/primitive3d/hatchtextureprimitive3d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -80,176 +72,13 @@ public:
//////////////////////////////////////////////////////////////////////////////
-namespace drawinglayer
-{
- namespace processor3d
- {
- class CutFindProcessor : public BaseProcessor3D
- {
- private:
- // the start and stop point for the cut vector
- basegfx::B3DPoint maFront;
- basegfx::B3DPoint maBack;
-
- // the found cut points
- ::std::vector< basegfx::B3DPoint > maResult;
-
- // #i102956# the transformation change from TransformPrimitive3D processings
- // needs to be remembered to be able to transform found cuts to the
- // basic coordinate system the processor starts with
- basegfx::B3DHomMatrix maCombinedTransform;
-
- // as tooling, the process() implementation takes over API handling and calls this
- // virtual render method when the primitive implementation is BasePrimitive3D-based.
- virtual void processBasePrimitive3D(const primitive3d::BasePrimitive3D& rCandidate);
-
- public:
- CutFindProcessor(const geometry::ViewInformation3D& rViewInformation,
- const basegfx::B3DPoint& rFront,
- const basegfx::B3DPoint& rBack)
- : BaseProcessor3D(rViewInformation),
- maFront(rFront),
- maBack(rBack),
- maResult(),
- maCombinedTransform()
- {}
-
- // data access
- const ::std::vector< basegfx::B3DPoint >& getCutPoints() const { return maResult; }
- };
-
- void CutFindProcessor::processBasePrimitive3D(const primitive3d::BasePrimitive3D& rCandidate)
- {
- // it is a BasePrimitive3D implementation, use getPrimitiveID() call for switch
- switch(rCandidate.getPrimitiveID())
- {
- case PRIMITIVE3D_ID_TRANSFORMPRIMITIVE3D :
- {
- // transform group.
- const primitive3d::TransformPrimitive3D& rPrimitive = static_cast< const primitive3d::TransformPrimitive3D& >(rCandidate);
-
- // remember old and transform front, back to object coordinates
- const basegfx::B3DPoint aLastFront(maFront);
- const basegfx::B3DPoint aLastBack(maBack);
- basegfx::B3DHomMatrix aInverseTrans(rPrimitive.getTransformation());
- aInverseTrans.invert();
- maFront *= aInverseTrans;
- maBack *= aInverseTrans;
-
- // remember current and create new transformation; add new object transform from right side
- const geometry::ViewInformation3D aLastViewInformation3D(getViewInformation3D());
- const geometry::ViewInformation3D aNewViewInformation3D(
- aLastViewInformation3D.getObjectTransformation() * rPrimitive.getTransformation(),
- aLastViewInformation3D.getOrientation(),
- aLastViewInformation3D.getProjection(),
- aLastViewInformation3D.getDeviceToView(),
- aLastViewInformation3D.getViewTime(),
- aLastViewInformation3D.getExtendedInformationSequence());
- updateViewInformation(aNewViewInformation3D);
-
- // #i102956# remember needed back-transform for found cuts (combine from right side)
- const basegfx::B3DHomMatrix aLastCombinedTransform(maCombinedTransform);
- maCombinedTransform = maCombinedTransform * rPrimitive.getTransformation();
-
- // let break down
- process(rPrimitive.getChildren());
-
- // restore transformations and front, back
- maCombinedTransform = aLastCombinedTransform;
- updateViewInformation(aLastViewInformation3D);
- maFront = aLastFront;
- maBack = aLastBack;
- break;
- }
- case PRIMITIVE3D_ID_POLYGONHAIRLINEPRIMITIVE3D :
- {
- // PolygonHairlinePrimitive3D, not used for hit test with planes, ignore. This
- // means that also thick line expansion will not be hit-tested as
- // PolyPolygonMaterialPrimitive3D
- break;
- }
- case PRIMITIVE3D_ID_HATCHTEXTUREPRIMITIVE3D :
- {
- // #i97321#
- // For HatchTexturePrimitive3D, do not use the decomposition since it will produce
- // clipped hatch lines in 3D. It can be used when the hatch also has a filling, but for
- // simplicity, just use the children which are the PolyPolygonMaterialPrimitive3D
- // which define the hatched areas anyways; for HitTest this is more than adequate
- const primitive3d::HatchTexturePrimitive3D& rPrimitive = static_cast< const primitive3d::HatchTexturePrimitive3D& >(rCandidate);
- process(rPrimitive.getChildren());
- break;
- }
- case PRIMITIVE3D_ID_HITTESTPRIMITIVE3D :
- {
- // HitTestPrimitive3D, force usage due to we are doing a hit test and this
- // primitive only gets generated on 3d objects without fill, exactly for this
- // purpose
- const primitive3d::HitTestPrimitive3D& rPrimitive = static_cast< const primitive3d::HitTestPrimitive3D& >(rCandidate);
- process(rPrimitive.getChildren());
- break;
- }
- case PRIMITIVE3D_ID_POLYPOLYGONMATERIALPRIMITIVE3D :
- {
- // PolyPolygonMaterialPrimitive3D
- const primitive3d::PolyPolygonMaterialPrimitive3D& rPrimitive = static_cast< const primitive3d::PolyPolygonMaterialPrimitive3D& >(rCandidate);
-
- if(!maFront.equal(maBack))
- {
- const basegfx::B3DPolyPolygon& rPolyPolygon = rPrimitive.getB3DPolyPolygon();
- const sal_uInt32 nPolyCount(rPolyPolygon.count());
-
- if(nPolyCount)
- {
- const basegfx::B3DPolygon aPolygon(rPolyPolygon.getB3DPolygon(0));
- const sal_uInt32 nPointCount(aPolygon.count());
-
- if(nPointCount > 2)
- {
- const basegfx::B3DVector aPlaneNormal(aPolygon.getNormal());
-
- if(!aPlaneNormal.equalZero())
- {
- const basegfx::B3DPoint aPointOnPlane(aPolygon.getB3DPoint(0));
- double fCut(0.0);
-
- if(basegfx::tools::getCutBetweenLineAndPlane(aPlaneNormal, aPointOnPlane, maFront, maBack, fCut))
- {
- const basegfx::B3DPoint aCutPoint(basegfx::interpolate(maFront, maBack, fCut));
-
- if(basegfx::tools::isInside(rPolyPolygon, aCutPoint, false))
- {
- // #i102956# add result. Do not forget to do this in the coordinate
- // system the processor get started with, so use the collected
- // combined transformation from processed TransformPrimitive3D's
- maResult.push_back(maCombinedTransform * aCutPoint);
- }
- }
- }
- }
- }
- }
-
- break;
- }
- default :
- {
- // process recursively
- process(rCandidate.get3DDecomposition(getViewInformation3D()));
- break;
- }
- }
- }
- } // end of namespace processor3d
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-
void getAllHit3DObjectWithRelativePoint(
const basegfx::B3DPoint& rFront,
const basegfx::B3DPoint& rBack,
const E3dCompoundObject& rObject,
const drawinglayer::geometry::ViewInformation3D& rObjectViewInformation3D,
- ::std::vector< basegfx::B3DPoint >& o_rResult)
+ ::std::vector< basegfx::B3DPoint >& o_rResult,
+ bool bAnyHit)
{
o_rResult.clear();
@@ -271,7 +100,7 @@ void getAllHit3DObjectWithRelativePoint(
if(aObjectRange.overlaps(aFrontBackRange))
{
// bound volumes hit, geometric cut tests needed
- drawinglayer::processor3d::CutFindProcessor aCutFindProcessor(rObjectViewInformation3D, rFront, rBack);
+ drawinglayer::processor3d::CutFindProcessor aCutFindProcessor(rObjectViewInformation3D, rFront, rBack, bAnyHit);
aCutFindProcessor.process(aPrimitives);
o_rResult = aCutFindProcessor.getCutPoints();
}
@@ -388,7 +217,7 @@ SVX_DLLPUBLIC void getAllHit3DObjectsSortedFrontToBack(
{
// get all hit points with object
::std::vector< basegfx::B3DPoint > aHitsWithObject;
- getAllHit3DObjectWithRelativePoint(aFront, aBack, *pCandidate, aViewInfo3D, aHitsWithObject);
+ getAllHit3DObjectWithRelativePoint(aFront, aBack, *pCandidate, aViewInfo3D, aHitsWithObject, false);
for(sal_uInt32 a(0); a < aHitsWithObject.size(); a++)
{
@@ -452,7 +281,7 @@ bool checkHitSingle3DObject(
{
// get all hit points with object
::std::vector< basegfx::B3DPoint > aHitsWithObject;
- getAllHit3DObjectWithRelativePoint(aFront, aBack, rCandidate, aViewInfo3D, aHitsWithObject);
+ getAllHit3DObjectWithRelativePoint(aFront, aBack, rCandidate, aViewInfo3D, aHitsWithObject, true);
if(aHitsWithObject.size())
{
diff --git a/svx/source/form/fmcontrollayout.cxx b/svx/source/form/fmcontrollayout.cxx
index 92e987db796c..9748426c0b26 100644
--- a/svx/source/form/fmcontrollayout.cxx
+++ b/svx/source/form/fmcontrollayout.cxx
@@ -30,17 +30,28 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
+
#include "fmcontrollayout.hxx"
-#ifndef _SVX_FMPROP_HRC
#include "fmprop.hrc"
-#endif
/** === begin UNO includes === **/
#include <com/sun/star/form/FormComponentType.hpp>
#include <com/sun/star/awt/VisualEffect.hpp>
+#include <com/sun/star/i18n/ScriptType.hpp>
+#include <com/sun/star/lang/Locale.hpp>
+#include <com/sun/star/awt/FontDescriptor.hpp>
+#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/container/XChild.hpp>
/** === end UNO includes === **/
-#include <tools/debug.hxx>
+
#include <comphelper/processfactory.hxx>
+#include <i18npool/mslangid.hxx>
+#include <svtools/syslocale.hxx>
+#include <toolkit/helper/vclunohelper.hxx>
+#include <tools/debug.hxx>
+#include <tools/diagnose_ex.h>
+#include <vcl/outdev.hxx>
//........................................................................
namespace svxform
@@ -48,15 +59,171 @@ namespace svxform
//........................................................................
using namespace ::utl;
- using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::awt;
- using namespace ::com::sun::star::beans;
- using namespace ::com::sun::star::form;
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::uno::XInterface;
+ using ::com::sun::star::uno::UNO_QUERY;
+ using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::com::sun::star::uno::UNO_SET_THROW;
+ using ::com::sun::star::uno::Exception;
+ using ::com::sun::star::uno::RuntimeException;
+ using ::com::sun::star::uno::Any;
+ using ::com::sun::star::uno::makeAny;
+ using ::com::sun::star::uno::Sequence;
+ using ::com::sun::star::uno::Type;
+ using ::com::sun::star::beans::XPropertySet;
+ using ::com::sun::star::beans::XPropertySetInfo;
+ using ::com::sun::star::lang::Locale;
+ using ::com::sun::star::awt::FontDescriptor;
+ using ::com::sun::star::style::XStyleFamiliesSupplier;
+ using ::com::sun::star::lang::XServiceInfo;
+ using ::com::sun::star::container::XNameAccess;
+ using ::com::sun::star::container::XChild;
+ /** === end UNO using === **/
+ namespace FormComponentType = ::com::sun::star::form::FormComponentType;
+ namespace VisualEffect = ::com::sun::star::awt::VisualEffect;
+ namespace ScriptType = ::com::sun::star::i18n::ScriptType;
+
+ //--------------------------------------------------------------------
+ namespace
+ {
+ //....................................................................
+ template< class INTERFACE_TYPE >
+ Reference< INTERFACE_TYPE > getTypedModelNode( const Reference< XInterface >& _rxModelNode )
+ {
+ Reference< INTERFACE_TYPE > xTypedNode( _rxModelNode, UNO_QUERY );
+ if ( xTypedNode.is() )
+ return xTypedNode;
+ else
+ {
+ Reference< XChild > xChild( _rxModelNode, UNO_QUERY );
+ if ( xChild.is() )
+ return getTypedModelNode< INTERFACE_TYPE >( xChild->getParent() );
+ else
+ return NULL;
+ }
+ }
+
+ //....................................................................
+ static bool lcl_getDocumentDefaultStyleAndFamily( const Reference< XInterface >& _rxDocument, ::rtl::OUString& _rFamilyName, ::rtl::OUString& _rStyleName ) SAL_THROW(( Exception ))
+ {
+ bool bSuccess = true;
+ Reference< XServiceInfo > xDocumentSI( _rxDocument, UNO_QUERY );
+ if ( xDocumentSI.is() )
+ {
+ if ( xDocumentSI->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.text.TextDocument" ) ) )
+ || xDocumentSI->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.text.WebDocument" ) ) )
+ )
+ {
+ _rFamilyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ParagraphStyles" ) );
+ _rStyleName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Standard" ) );
+ }
+ else if ( xDocumentSI->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sheet.SpreadsheetDocument" ) ) ) )
+ {
+ _rFamilyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CellStyles" ) );
+ _rStyleName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Default" ) );
+ }
+ else if ( xDocumentSI->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.drawing.DrawingDocument" ) ) )
+ || xDocumentSI->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.presentation.PresentationDocument" ) ) )
+ )
+ {
+ _rFamilyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "graphics" ) );
+ _rStyleName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "standard" ) );
+ }
+ else
+ bSuccess = false;
+ }
+ return bSuccess;
+ }
+
+ //....................................................................
+ static void lcl_initializeControlFont( const Reference< XPropertySet >& _rxModel )
+ {
+ try
+ {
+ Reference< XPropertySet > xStyle( ControlLayouter::getDefaultDocumentTextStyle( _rxModel ), UNO_SET_THROW );
+ Reference< XPropertySetInfo > xStylePSI( xStyle->getPropertySetInfo(), UNO_SET_THROW );
+
+ // determine the script type associated with the system locale
+ const LocaleDataWrapper& rSysLocaleData = SvtSysLocale().GetLocaleData();
+ const sal_Int16 eSysLocaleScriptType = MsLangId::getScriptType( MsLangId::convertLocaleToLanguage( rSysLocaleData.getLocale() ) );
+
+ // depending on this script type, use the right property from the document's style which controls the
+ // default locale for document content
+ const sal_Char* pCharLocalePropertyName = "CharLocale";
+ switch ( eSysLocaleScriptType )
+ {
+ case ScriptType::LATIN:
+ // already defaulted above
+ break;
+ case ScriptType::ASIAN:
+ pCharLocalePropertyName = "CharLocaleAsian";
+ break;
+ case ScriptType::COMPLEX:
+ pCharLocalePropertyName = "CharLocaleComplex";
+ break;
+ default:
+ OSL_ENSURE( false, "lcl_initializeControlFont: unexpected script type for system locale!" );
+ break;
+ }
+
+ ::rtl::OUString sCharLocalePropertyName = ::rtl::OUString::createFromAscii( pCharLocalePropertyName );
+ Locale aDocumentCharLocale;
+ if ( xStylePSI->hasPropertyByName( sCharLocalePropertyName ) )
+ {
+ OSL_VERIFY( xStyle->getPropertyValue( sCharLocalePropertyName ) >>= aDocumentCharLocale );
+ }
+ // fall back to CharLocale property at the style
+ if ( !aDocumentCharLocale.Language.getLength() )
+ {
+ sCharLocalePropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharLocale" ) );
+ if ( xStylePSI->hasPropertyByName( sCharLocalePropertyName ) )
+ {
+ OSL_VERIFY( xStyle->getPropertyValue( sCharLocalePropertyName ) >>= aDocumentCharLocale );
+ }
+ }
+ // fall back to the system locale
+ if ( !aDocumentCharLocale.Language.getLength() )
+ {
+ aDocumentCharLocale = rSysLocaleData.getLocale();
+ }
+
+ // retrieve a default font for this locale, and set it at the control
+ Font aFont = OutputDevice::GetDefaultFont( DEFAULTFONT_SANS, MsLangId::convertLocaleToLanguage( aDocumentCharLocale ), DEFAULTFONT_FLAGS_ONLYONE );
+ FontDescriptor aFontDesc = VCLUnoHelper::CreateFontDescriptor( aFont );
+ _rxModel->setPropertyValue(
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FontDescriptor" ) ),
+ makeAny( aFontDesc )
+ );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+ }
//====================================================================
//= ControlLayouter
//====================================================================
//--------------------------------------------------------------------
+ Reference< XPropertySet > ControlLayouter::getDefaultDocumentTextStyle( const Reference< XPropertySet >& _rxModel )
+ {
+ // the style family collection
+ Reference< XStyleFamiliesSupplier > xSuppStyleFamilies( getTypedModelNode< XStyleFamiliesSupplier >( _rxModel.get() ), UNO_SET_THROW );
+ Reference< XNameAccess > xStyleFamilies( xSuppStyleFamilies->getStyleFamilies(), UNO_SET_THROW );
+
+ // the names of the family, and the style - depends on the document type we live in
+ ::rtl::OUString sFamilyName, sStyleName;
+ if ( !lcl_getDocumentDefaultStyleAndFamily( xSuppStyleFamilies.get(), sFamilyName, sStyleName ) )
+ throw RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "unknown document type!" ) ), NULL );
+
+ // the concrete style
+ Reference< XNameAccess > xStyleFamily( xStyleFamilies->getByName( sFamilyName ), UNO_QUERY_THROW );
+ return Reference< XPropertySet >( xStyleFamily->getByName( sStyleName ), UNO_QUERY_THROW );
+ }
+
+ //--------------------------------------------------------------------
void ControlLayouter::initializeControlLayout( const Reference< XPropertySet >& _rxControlModel, DocumentType _eDocType )
{
DBG_ASSERT( _rxControlModel.is(), "ControlLayouter::initializeControlLayout: invalid model!" );
@@ -65,10 +232,7 @@ namespace svxform
try
{
- Reference< XPropertySetInfo > xPSI( _rxControlModel->getPropertySetInfo() );
- if ( !xPSI.is() )
- // can't do anything
- return;
+ Reference< XPropertySetInfo > xPSI( _rxControlModel->getPropertySetInfo(), UNO_SET_THROW );
// the control type
sal_Int16 nClassId = FormComponentType::CONTROL;
@@ -114,6 +278,13 @@ namespace svxform
if ( xPSI->hasPropertyByName( FM_PROP_VISUALEFFECT ) )
_rxControlModel->setPropertyValue( FM_PROP_VISUALEFFECT, makeAny( nVisualEffect ) );
}
+
+ // the font (only if we use the document's ref devices for rendering control text, otherwise, the
+ // default font of VCL controls is assumed to be fine)
+ if ( useDocumentReferenceDevice( _eDocType )
+ && xPSI->hasPropertyByName( FM_PROP_FONT )
+ )
+ lcl_initializeControlFont( _rxControlModel );
}
catch( const Exception& )
{
@@ -141,6 +312,18 @@ namespace svxform
return bDynamicBorderColor;
}
+ //--------------------------------------------------------------------
+ bool ControlLayouter::useDocumentReferenceDevice( DocumentType _eDocType )
+ {
+ if ( _eDocType == eUnknownDocumentType )
+ return false;
+ OConfigurationNode aConfig = getLayoutSettings( _eDocType );
+ Any aUseRefDevice = aConfig.getNodeValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UseDocumentTextMetrics" ) ) );
+ bool bUseRefDevice = false;
+ OSL_VERIFY( aUseRefDevice >>= bUseRefDevice );
+ return bUseRefDevice;
+ }
+
//........................................................................
} // namespace svxform
//........................................................................
diff --git a/svx/source/form/fmmodel.cxx b/svx/source/form/fmmodel.cxx
index 09008ae220b9..a09d0f78173a 100644
--- a/svx/source/form/fmmodel.cxx
+++ b/svx/source/form/fmmodel.cxx
@@ -30,30 +30,27 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
+
+#include "fmundo.hxx"
+#include "fmdocumentclassification.hxx"
+#include "fmcontrollayout.hxx"
+
+#include <svx/fmmodel.hxx>
+#include <svx/fmpage.hxx>
+#include <svx/svdobj.hxx>
#include <tools/debug.hxx>
#ifndef SVX_LIGHT
-#ifndef _SFX_OBJSH_HXX //autogen
#include <sfx2/objsh.hxx>
-#endif
#else
class SfxObjectShell;
#endif
-#ifndef _FM_FMMODEL_HXX
-#include <svx/fmmodel.hxx>
-#endif
-
-#ifndef _FM_PAGE_HXX
-#include <svx/fmpage.hxx>
-#endif
-#include "fmundo.hxx"
-#ifndef _SVX_SVDOBJ_HXX
-#include <svx/svdobj.hxx>
-#endif
+#include <boost/optional.hpp>
using ::com::sun::star::uno::Reference;
using ::com::sun::star::container::XNameContainer;
+using namespace svxform;
TYPEINIT1(FmFormModel, SdrModel);
@@ -62,11 +59,14 @@ struct FmFormModelImplData
FmXUndoEnvironment* pUndoEnv;
sal_Bool bOpenInDesignIsDefaulted;
sal_Bool bMovingPage;
+ ::boost::optional< sal_Bool >
+ aControlsUseRefDevice;
FmFormModelImplData()
:pUndoEnv( NULL )
,bOpenInDesignIsDefaulted( sal_True )
,bMovingPage( sal_False )
+ ,aControlsUseRefDevice()
{
}
};
@@ -314,6 +314,19 @@ sal_Bool FmFormModel::OpenInDesignModeIsDefaulted( )
#endif
//------------------------------------------------------------------------
+sal_Bool FmFormModel::ControlsUseRefDevice() const
+{
+ if ( !m_pImpl->aControlsUseRefDevice )
+ {
+ DocumentType eDocType = eUnknownDocumentType;
+ if ( m_pObjShell )
+ eDocType = DocumentClassification::classifyHostDocument( m_pObjShell->GetModel() );
+ m_pImpl->aControlsUseRefDevice.reset( ControlLayouter::useDocumentReferenceDevice( eDocType ) );
+ }
+ return *m_pImpl->aControlsUseRefDevice;
+}
+
+//------------------------------------------------------------------------
void FmFormModel::SetAutoControlFocus( sal_Bool _bAutoControlFocus )
{
#ifndef SVX_LIGHT
diff --git a/svx/source/form/fmobj.cxx b/svx/source/form/fmobj.cxx
index f2773b7350fa..b5a055730f71 100644
--- a/svx/source/form/fmobj.cxx
+++ b/svx/source/form/fmobj.cxx
@@ -81,6 +81,10 @@ FmFormObj::FmFormObj(const ::rtl::OUString& rModelName,sal_Int32 _nType)
,m_pLastKnownRefDevice ( NULL )
{
DBG_CTOR(FmFormObj, NULL);
+
+ // normally, this is done in SetUnoControlModel, but if the call happened in the base class ctor,
+ // then our incarnation of it was not called (since we were not constructed at this time).
+ impl_checkRefDevice_nothrow( true );
}
//------------------------------------------------------------------
@@ -124,6 +128,45 @@ void FmFormObj::ClearObjEnv()
}
//------------------------------------------------------------------
+void FmFormObj::impl_checkRefDevice_nothrow( bool _force )
+{
+ const FmFormModel* pFormModel = PTR_CAST( FmFormModel, GetModel() );
+ if ( !pFormModel || !pFormModel->ControlsUseRefDevice() )
+ return;
+
+ OutputDevice* pCurrentRefDevice = pFormModel ? pFormModel->GetRefDevice() : NULL;
+ if ( ( m_pLastKnownRefDevice == pCurrentRefDevice ) && !_force )
+ return;
+
+ Reference< XControlModel > xControlModel( GetUnoControlModel() );
+ if ( !xControlModel.is() )
+ return;
+
+ m_pLastKnownRefDevice = pCurrentRefDevice;
+ if ( m_pLastKnownRefDevice == NULL )
+ return;
+
+ try
+ {
+ Reference< XPropertySet > xModelProps( GetUnoControlModel(), UNO_QUERY_THROW );
+ Reference< XPropertySetInfo > xPropertyInfo( xModelProps->getPropertySetInfo(), UNO_SET_THROW );
+
+ static const ::rtl::OUString sRefDevicePropName( RTL_CONSTASCII_USTRINGPARAM( "ReferenceDevice" ) );
+ if ( xPropertyInfo->hasPropertyByName( sRefDevicePropName ) )
+ {
+ VCLXDevice* pUnoRefDevice = new VCLXDevice;
+ pUnoRefDevice->SetOutputDevice( m_pLastKnownRefDevice );
+ Reference< XDevice > xRefDevice( pUnoRefDevice );
+ xModelProps->setPropertyValue( sRefDevicePropName, makeAny( xRefDevice ) );
+ }
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+}
+
+//------------------------------------------------------------------
void FmFormObj::impl_isolateControlModel_nothrow()
{
try
@@ -360,38 +403,10 @@ SdrObject* FmFormObj::Clone() const
}
//------------------------------------------------------------------
-void FmFormObj::ReformatText()
+void FmFormObj::NbcReformatText()
{
- const FmFormModel* pFormModel = PTR_CAST( FmFormModel, GetModel() );
- OutputDevice* pCurrentRefDevice = pFormModel ? pFormModel->GetRefDevice() : NULL;
-
- if ( m_pLastKnownRefDevice != pCurrentRefDevice )
- {
- m_pLastKnownRefDevice = pCurrentRefDevice;
-
- try
- {
- Reference< XPropertySet > xModelProps( GetUnoControlModel(), UNO_QUERY );
- Reference< XPropertySetInfo > xPropertyInfo;
- if ( xModelProps.is() )
- xPropertyInfo = xModelProps->getPropertySetInfo();
-
- const ::rtl::OUString sRefDevicePropName( RTL_CONSTASCII_USTRINGPARAM( "ReferenceDevice" ) );
- if ( xPropertyInfo.is() && xPropertyInfo->hasPropertyByName( sRefDevicePropName ) )
- {
- VCLXDevice* pUnoRefDevice = new VCLXDevice;
- pUnoRefDevice->SetOutputDevice( m_pLastKnownRefDevice );
- Reference< XDevice > xRefDevice( pUnoRefDevice );
- xModelProps->setPropertyValue( sRefDevicePropName, makeAny( xRefDevice ) );
- }
- }
- catch( const Exception& )
- {
- OSL_ENSURE( sal_False, "FmFormObj::ReformatText: caught an exception!" );
- }
- }
-
- SdrUnoObj::ReformatText();
+ impl_checkRefDevice_nothrow( false );
+ SdrUnoObj::NbcReformatText();
}
//------------------------------------------------------------------
@@ -564,6 +579,13 @@ Reference< XInterface > FmFormObj::ensureModelEnv(const Reference< XInterface >
}
//------------------------------------------------------------------
+void FmFormObj::SetModel( SdrModel* _pNewModel )
+{
+ SdrUnoObj::SetModel( _pNewModel );
+ impl_checkRefDevice_nothrow();
+}
+
+//------------------------------------------------------------------
FmFormObj* FmFormObj::GetFormObject( SdrObject* _pSdrObject )
{
FmFormObj* pFormObject = dynamic_cast< FmFormObj* >( _pSdrObject );
@@ -595,6 +617,8 @@ void FmFormObj::SetUnoControlModel( const Reference< com::sun::star::awt::XContr
SdrUnoObj::SetUnoControlModel( _rxModel );
// TODO: call something like formObjectInserted at the form page, to tell it the new model
+
+ impl_checkRefDevice_nothrow( true );
}
//------------------------------------------------------------------
diff --git a/svx/source/form/formcontrolfactory.cxx b/svx/source/form/formcontrolfactory.cxx
index de1a7d76b526..da3c2634b63c 100644
--- a/svx/source/form/formcontrolfactory.cxx
+++ b/svx/source/form/formcontrolfactory.cxx
@@ -44,8 +44,6 @@
#include <com/sun/star/form/FormComponentType.hpp>
#include <com/sun/star/awt/ScrollBarOrientation.hpp>
#include <com/sun/star/form/XGridColumnFactory.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
#include <com/sun/star/style/VerticalAlignment.hpp>
#include <com/sun/star/awt/LineEndFormat.hpp>
#include <com/sun/star/awt/ImageScaleMode.hpp>
@@ -53,6 +51,7 @@
#include <com/sun/star/util/XNumberFormatTypes.hpp>
#include <com/sun/star/sdbc/ColumnValue.hpp>
#include <com/sun/star/text/WritingMode2.hpp>
+#include <com/sun/star/awt/FontDescriptor.hpp>
/** === end UNO includes === **/
#include <comphelper/componentcontext.hxx>
@@ -88,15 +87,16 @@ namespace svxform
using ::com::sun::star::beans::PropertyValue;
using ::com::sun::star::container::XChild;
using ::com::sun::star::form::XGridColumnFactory;
- using ::com::sun::star::lang::XServiceInfo;
- using ::com::sun::star::style::XStyleFamiliesSupplier;
- using ::com::sun::star::container::XNameAccess;
using ::com::sun::star::style::VerticalAlignment_MIDDLE;
using ::com::sun::star::beans::Property;
using ::com::sun::star::uno::TypeClass_DOUBLE;
using ::com::sun::star::uno::TypeClass_LONG;
using ::com::sun::star::util::XNumberFormats;
using ::com::sun::star::util::XNumberFormatTypes;
+ using ::com::sun::star::awt::FontDescriptor;
+ using ::com::sun::star::lang::Locale;
+ using ::com::sun::star::lang::XServiceInfo;
+ using ::com::sun::star::container::XNameAccess;
/** === end UNO using === **/
namespace FormComponentType = ::com::sun::star::form::FormComponentType;
namespace ScrollBarOrientation = ::com::sun::star::awt::ScrollBarOrientation;
@@ -236,65 +236,6 @@ namespace svxform
}
return aInfo;
}
- /*
- ATTENTION!
- Broken for solaris? It seems that the old used template argument TYPE was already
- defined as a macro ... which expand to ... "TYPE "!?
- All platforms are OK - excepting Solaris. There the line "template< class TYPE >"
- was expanded to "template < class TYPE " where the closing ">" was missing.
- */
- #ifdef MYTYPE
- #error "Who defines the macro MYTYPE, which is used as template argument here?"
- #endif
-
- //....................................................................
- template< class MYTYPE >
- Reference< MYTYPE > getTypedModelNode( const Reference< XInterface >& _rxModelNode )
- {
- Reference< MYTYPE > xTypedNode( _rxModelNode, UNO_QUERY );
- if ( xTypedNode.is() )
- return xTypedNode;
- else
- {
- Reference< XChild > xChild( _rxModelNode, UNO_QUERY );
- if ( xChild.is() )
- return getTypedModelNode< MYTYPE >( xChild->getParent() );
- else
- return NULL;
- }
- }
-
- //....................................................................
- static bool lcl_getDocumentDefaultStyleAndFamily( const Reference< XInterface >& _rxDocument, ::rtl::OUString& _rFamilyName, ::rtl::OUString& _rStyleName ) SAL_THROW(( Exception ))
- {
- bool bSuccess = true;
- Reference< XServiceInfo > xDocumentSI( _rxDocument, UNO_QUERY );
- if ( xDocumentSI.is() )
- {
- if ( xDocumentSI->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.text.TextDocument" ) ) )
- || xDocumentSI->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.text.WebDocument" ) ) )
- )
- {
- _rFamilyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ParagraphStyles" ) );
- _rStyleName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Standard" ) );
- }
- else if ( xDocumentSI->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sheet.SpreadsheetDocument" ) ) ) )
- {
- _rFamilyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CellStyles" ) );
- _rStyleName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Default" ) );
- }
- else if ( xDocumentSI->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.drawing.DrawingDocument" ) ) )
- || xDocumentSI->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.presentation.PresentationDocument" ) ) )
- )
- {
- _rFamilyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "graphics" ) );
- _rStyleName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "standard" ) );
- }
- else
- bSuccess = false;
- }
- return bSuccess;
- }
//....................................................................
static const sal_Char* aCharacterAndParagraphProperties[] =
@@ -430,41 +371,13 @@ namespace svxform
//....................................................................
static void lcl_initializeCharacterAttributes( const Reference< XPropertySet >& _rxModel )
{
- // need to initialize the attributes from the "Default" style of the document we live in
-
try
{
- // the style family collection
- Reference< XStyleFamiliesSupplier > xSuppStyleFamilies = getTypedModelNode< XStyleFamiliesSupplier >( _rxModel.get() );
- Reference< XNameAccess > xStyleFamilies;
- if ( xSuppStyleFamilies.is() )
- xStyleFamilies = xSuppStyleFamilies->getStyleFamilies();
- OSL_ENSURE( xStyleFamilies.is(), "lcl_initializeCharacterAttributes: could not obtain the style families!" );
- if ( !xStyleFamilies.is() )
- return;
-
- // the names of the family, and the style - depends on the document type we live in
- ::rtl::OUString sFamilyName, sStyleName;
- bool bKnownDocumentType = lcl_getDocumentDefaultStyleAndFamily( xSuppStyleFamilies.get(), sFamilyName, sStyleName );
- OSL_ENSURE( bKnownDocumentType, "lcl_initializeCharacterAttributes: Huh? What document type is this?" );
- if ( !bKnownDocumentType )
- return;
-
- // the concrete style
- Reference< XNameAccess > xStyleFamily( xStyleFamilies->getByName( sFamilyName ), UNO_QUERY );
- Reference< XPropertySet > xStyle;
- if ( xStyleFamily.is() )
- xStyleFamily->getByName( sStyleName ) >>= xStyle;
- OSL_ENSURE( xStyle.is(), "lcl_initializeCharacterAttributes: could not retrieve the style!" );
- if ( !xStyle.is() )
- return;
-
- // transfer all properties which are described by the com.sun.star.style.
- Reference< XPropertySetInfo > xSourcePropInfo( xStyle->getPropertySetInfo() );
- Reference< XPropertySetInfo > xDestPropInfo( _rxModel->getPropertySetInfo() );
- OSL_ENSURE( xSourcePropInfo.is() && xDestPropInfo.is(), "lcl_initializeCharacterAttributes: no property set info!" );
- if ( !xSourcePropInfo.is() || !xDestPropInfo.is() )
- return;
+ Reference< XPropertySet > xStyle( ControlLayouter::getDefaultDocumentTextStyle( _rxModel ), UNO_SET_THROW );
+
+ // transfer all properties which are described by the style
+ Reference< XPropertySetInfo > xSourcePropInfo( xStyle->getPropertySetInfo(), UNO_SET_THROW );
+ Reference< XPropertySetInfo > xDestPropInfo( _rxModel->getPropertySetInfo(), UNO_SET_THROW );
::rtl::OUString sPropertyName;
const sal_Char** pCharacterProperty = aCharacterAndParagraphProperties;
diff --git a/svx/source/inc/fmcontrollayout.hxx b/svx/source/inc/fmcontrollayout.hxx
index 1110c274b9f8..c5abe43f3228 100644
--- a/svx/source/inc/fmcontrollayout.hxx
+++ b/svx/source/inc/fmcontrollayout.hxx
@@ -62,6 +62,22 @@ namespace svxform
*/
static bool useDynamicBorderColor( DocumentType _eDocType );
+ /** determines whether for the given document type, form controls should use the document's reference device
+ for text rendering
+ */
+ static bool useDocumentReferenceDevice( DocumentType _eDocType );
+
+ /** gets the "default" style in a document which can be used if some default text format is needed
+
+ It depends on the type document type which concrete kind of style is returned, but it is expected to support
+ the css.style.CharacterProperties service.
+
+ @param _rxModel
+ a form component.
+ */
+ static ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
+ getDefaultDocumentTextStyle( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxModel );
+
private:
ControlLayouter(); // never implemented
diff --git a/svx/source/inc/fmobj.hxx b/svx/source/inc/fmobj.hxx
index 4099f241b72a..25f792ed7417 100644
--- a/svx/source/inc/fmobj.hxx
+++ b/svx/source/inc/fmobj.hxx
@@ -86,12 +86,14 @@ public:
virtual sal_uInt32 GetObjInventor() const;
virtual sal_uInt16 GetObjIdentifier() const;
- virtual void ReformatText();
+ virtual void NbcReformatText();
virtual SdrObject* Clone() const;
// #116235# virtual SdrObject* Clone(SdrPage* pPage, SdrModel* pModel) const;
virtual void operator= (const SdrObject& rObj);
+ virtual void SetModel(SdrModel* pNewModel);
+
virtual void clonedFrom(const FmFormObj* _pSource);
static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> ensureModelEnv(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& _rSourceContainer, const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer> _rTopLevelDestContainer);
@@ -124,6 +126,10 @@ private:
its parent.
*/
void impl_isolateControlModel_nothrow();
+
+ /** forwards the reference device of our SdrModel to the control model
+ */
+ void impl_checkRefDevice_nothrow( bool _force = false );
};
diff --git a/svx/source/msfilter/msdffimp.cxx b/svx/source/msfilter/msdffimp.cxx
index fc71feb18740..e787d07f673d 100644
--- a/svx/source/msfilter/msdffimp.cxx
+++ b/svx/source/msfilter/msdffimp.cxx
@@ -7099,6 +7099,8 @@ BOOL SvxMSDffManager::GetBLIPDirect( SvStream& rBLIPStream, Graphic& rData, Rect
aZCodec.Decompress( rBLIPStream, *pOut );
aZCodec.EndCompression();
pOut->Seek( STREAM_SEEK_TO_BEGIN );
+ pOut->SetResizeOffset( 0 ); // sj: #i102257# setting ResizeOffset of 0 prevents from seeking
+ // behind the stream end (allocating too much memory)
pGrStream = pOut;
}
@@ -8184,6 +8186,7 @@ void SvxMSDffManager::removeShapeId( SdrObject* pShape )
maShapeIdContainer.erase( aIter );
break;
}
+ aIter++;
}
}
diff --git a/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx b/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx
index 5f632f60ab85..9d19e752396c 100644
--- a/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx
@@ -39,6 +39,7 @@
#include <svx/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
+#include <svx/obj3d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -134,6 +135,7 @@ namespace sdr
// create Primitive2DSequence from sub-geometry
const SdrObject* pSdrObjRepresentation = GetCustomShapeObj().GetSdrObjectFromCustomShape();
+ bool b3DShape(false);
if(pSdrObjRepresentation)
{
@@ -142,6 +144,12 @@ namespace sdr
while(aIterator.IsMore())
{
SdrObject& rCandidate = *aIterator.Next();
+
+ if(!b3DShape && dynamic_cast< E3dObject* >(&rCandidate))
+ {
+ b3DShape = true;
+ }
+
const drawinglayer::primitive2d::Primitive2DSequence xNew(rCandidate.GetViewContact().getViewIndependentPrimitive2DSequence());
drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(xGroup, xNew);
}
@@ -220,7 +228,8 @@ namespace sdr
xGroup,
aTextBoxMatrix,
bWordWrap,
- false)); // #SJ# New parameter to force to clipped BlockText for SC
+ false, // #SJ# New parameter to force to clipped BlockText for SC
+ b3DShape));
xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
diff --git a/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx b/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx
index 3c239b12113c..a054e881b7c3 100644
--- a/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx
@@ -113,6 +113,11 @@ namespace sdr
new drawinglayer::primitive2d::SdrOleContentPrimitive2D(
GetOle2Obj(),
aObjectMatrix,
+
+ // #i104867# add GraphicVersion number to be able to check for
+ // content change in the primitive later
+ GetOle2Obj().getEmbeddedObjectRef().getGraphicVersion(),
+
bHighContrast));
// create primitive. Use Ole2 primitive here. Prepare attribute settings, will be used soon anyways.
diff --git a/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx b/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx
index 8ba8ae8ab4c9..cefb3e065165 100644
--- a/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx
@@ -39,6 +39,7 @@
#include <svx/sdr/primitive2d/sdrrectangleprimitive2d.hxx>
#include <svtools/itemset.hxx>
#include <svx/sdr/primitive2d/sdrprimitivetools.hxx>
+#include <svx/svdmodel.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -104,6 +105,10 @@ namespace sdr
double fCornerRadiusY;
drawinglayer::primitive2d::calculateRelativeCornerRadius(nCornerRadius, aObjectRange, fCornerRadiusX, fCornerRadiusY);
+ // #i105856# use knowledge about pickthrough from the model
+ const bool bPickThroughTransparentTextFrames(
+ GetRectObj().GetModel() && GetRectObj().GetModel()->IsPickThroughTransparentTextFrames());
+
// create primitive
const drawinglayer::primitive2d::Primitive2DReference xReference(
new drawinglayer::primitive2d::SdrRectanglePrimitive2D(
@@ -111,7 +116,8 @@ namespace sdr
*pAttribute,
fCornerRadiusX,
fCornerRadiusY,
- GetRectObj().IsTextFrame()));
+ // #i105856# use fill for HitTest when TextFrame and not PickThrough
+ GetRectObj().IsTextFrame() && !bPickThroughTransparentTextFrames));
xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
diff --git a/svx/source/sdr/overlay/overlaymanager.cxx b/svx/source/sdr/overlay/overlaymanager.cxx
index 79d493b6d9d0..24a5fb56a8cf 100644
--- a/svx/source/sdr/overlay/overlaymanager.cxx
+++ b/svx/source/sdr/overlay/overlaymanager.cxx
@@ -44,6 +44,10 @@
//////////////////////////////////////////////////////////////////////////////
+using namespace com::sun::star;
+
+//////////////////////////////////////////////////////////////////////////////
+
namespace sdr
{
namespace overlay
@@ -140,6 +144,18 @@ namespace sdr
maViewInformation2D(0),
mfDiscreteOne(0.0)
{
+ // set Property 'ReducedDisplayQuality' to true to allow simpler interaction
+ // visualisations
+ static bool bUseReducedDisplayQualityForDrag(true);
+
+ if(bUseReducedDisplayQualityForDrag)
+ {
+ uno::Sequence< beans::PropertyValue > xProperties(1);
+ xProperties[0].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReducedDisplayQuality"));
+ xProperties[0].Value <<= true;
+ maViewInformation2D = drawinglayer::geometry::ViewInformation2D(xProperties);
+ }
+
if(pOldOverlayManager)
{
// take over OverlayObjects from given OverlayManager. Copy
diff --git a/svx/source/sdr/overlay/overlaymanagerbuffered.cxx b/svx/source/sdr/overlay/overlaymanagerbuffered.cxx
index 3fedc40f37cf..13a83f0fc235 100644
--- a/svx/source/sdr/overlay/overlaymanagerbuffered.cxx
+++ b/svx/source/sdr/overlay/overlaymanagerbuffered.cxx
@@ -370,6 +370,9 @@ namespace sdr
OverlayManager::ImpDrawMembers(aBufferRememberedRangeLogic, getOutputDevice());
}
+ // #i80730# removed: VCL hack for transparent child windows
+ // No longer needed, checked in DEV300 m54
+
// #i80730# restore visibility of VCL cursor
if(bCursorWasEnabled)
{
diff --git a/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx
index e2dce7b551ed..af3e6aacb410 100644
--- a/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx
@@ -68,7 +68,20 @@ namespace drawinglayer
// add shadow
if(aRetval.hasElements() && getSdrSTAttribute().getShadow())
{
- aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrSTAttribute().getShadow());
+ // #i105323# add generic shadow only for 2D shapes. For
+ // 3D shapes shadow will be set at the individual created
+ // visualisation objects and be visualized by the 3d renderer
+ // as a single shadow.
+ //
+ // The shadow for AutoShapes could be handled uniformely by not setting any
+ // shadow items at the helper model objects and only adding shadow here for
+ // 2D and 3D (and it works, too), but this would lead to two 3D scenes for
+ // the 3D object; one for the shadow aond one for the content. The one for the
+ // shadow will be correct (using ColorModifierStack), but expensive.
+ if(!get3DShape())
+ {
+ aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrSTAttribute().getShadow());
+ }
}
return aRetval;
@@ -79,13 +92,15 @@ namespace drawinglayer
const Primitive2DSequence& rSubPrimitives,
const basegfx::B2DHomMatrix& rTextBox,
bool bWordWrap,
- bool bForceTextClipToTextRange)
+ bool bForceTextClipToTextRange,
+ bool b3DShape)
: BasePrimitive2D(),
maSdrSTAttribute(rSdrSTAttribute),
maSubPrimitives(rSubPrimitives),
maTextBox(rTextBox),
mbWordWrap(bWordWrap),
- mbForceTextClipToTextRange(bForceTextClipToTextRange)
+ mbForceTextClipToTextRange(bForceTextClipToTextRange),
+ mb3DShape(b3DShape)
{
}
@@ -99,7 +114,8 @@ namespace drawinglayer
&& getSubPrimitives() == rCompare.getSubPrimitives()
&& getTextBox() == rCompare.getTextBox()
&& getWordWrap() == rCompare.getWordWrap()
- && isForceTextClipToTextRange() == rCompare.isForceTextClipToTextRange());
+ && isForceTextClipToTextRange() == rCompare.isForceTextClipToTextRange()
+ && get3DShape() == rCompare.get3DShape());
}
return false;
diff --git a/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx
index 67fee9215b73..e682c0e04b55 100644
--- a/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx
@@ -157,10 +157,12 @@ namespace drawinglayer
SdrOleContentPrimitive2D::SdrOleContentPrimitive2D(
const SdrOle2Obj& rSdrOle2Obj,
const basegfx::B2DHomMatrix& rObjectTransform,
+ sal_uInt32 nGraphicVersion,
bool bHighContrast)
: BasePrimitive2D(),
mpSdrOle2Obj(const_cast< SdrOle2Obj* >(&rSdrOle2Obj)),
maObjectTransform(rObjectTransform),
+ mnGraphicVersion(nGraphicVersion),
mbHighContrast(bHighContrast)
{
}
@@ -176,6 +178,11 @@ namespace drawinglayer
return ((bBothNot || bBothAndEqual)
&& getObjectTransform() == rCompare.getObjectTransform()
+
+ // #i104867# to find out if the Graphic content of the
+ // OLE has changed, use GraphicVersion number
+ && getGraphicVersion() == rCompare.getGraphicVersion()
+
&& getHighContrast() == rCompare.getHighContrast());
}
diff --git a/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx
index edb2837ef670..097cd5edd445 100644
--- a/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx
@@ -68,7 +68,7 @@ namespace drawinglayer
*getSdrLFSTAttribute().getFill(),
getSdrLFSTAttribute().getFillFloatTransGradient()));
}
- else if(getTextFrame())
+ else if(getForceFillForHitTest())
{
// if no fill and it's a text frame, create a fill for HitTest and
// BoundRect fallback
@@ -89,7 +89,7 @@ namespace drawinglayer
getTransform(),
*getSdrLFSTAttribute().getLine()));
}
- else if(!getTextFrame())
+ else if(!getForceFillForHitTest())
{
// if initially no line is defined and it's not a text frame, create
// a line for HitTest and BoundRect
@@ -127,13 +127,13 @@ namespace drawinglayer
const attribute::SdrLineFillShadowTextAttribute& rSdrLFSTAttribute,
double fCornerRadiusX,
double fCornerRadiusY,
- bool bTextFrame)
+ bool bForceFillForHitTest)
: BasePrimitive2D(),
maTransform(rTransform),
maSdrLFSTAttribute(rSdrLFSTAttribute),
mfCornerRadiusX(fCornerRadiusX),
mfCornerRadiusY(fCornerRadiusY),
- mbTextFrame(bTextFrame)
+ mbForceFillForHitTest(bForceFillForHitTest)
{
}
@@ -147,7 +147,7 @@ namespace drawinglayer
&& getCornerRadiusY() == rCompare.getCornerRadiusY()
&& getTransform() == rCompare.getTransform()
&& getSdrLFSTAttribute() == rCompare.getSdrLFSTAttribute()
- && getTextFrame() == rCompare.getTextFrame());
+ && getForceFillForHitTest() == rCompare.getForceFillForHitTest());
}
return false;
diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx
index eb6412b20259..a8d588e73fe5 100644
--- a/svx/source/svdraw/svddrgmt.cxx
+++ b/svx/source/svdraw/svddrgmt.cxx
@@ -206,6 +206,32 @@ drawinglayer::primitive2d::Primitive2DSequence SdrDragEntrySdrObject::createPrim
////////////////////////////////////////////////////////////////////////////////////////////////////
+SdrDragEntryPrimitive2DSequence::SdrDragEntryPrimitive2DSequence(
+ const drawinglayer::primitive2d::Primitive2DSequence& rSequence,
+ bool bAddToTransparent)
+: SdrDragEntry(),
+ maPrimitive2DSequence(rSequence)
+{
+ // add parts to transparent overlay stuff eventually
+ setAddToTransparent(bAddToTransparent);
+}
+
+SdrDragEntryPrimitive2DSequence::~SdrDragEntryPrimitive2DSequence()
+{
+}
+
+drawinglayer::primitive2d::Primitive2DSequence SdrDragEntryPrimitive2DSequence::createPrimitive2DSequenceInCurrentState(SdrDragMethod& rDragMethod)
+{
+ drawinglayer::primitive2d::Primitive2DReference aTransformPrimitive2D(
+ new drawinglayer::primitive2d::TransformPrimitive2D(
+ rDragMethod.getCurrentTransformation(),
+ maPrimitive2DSequence));
+
+ return drawinglayer::primitive2d::Primitive2DSequence(&aTransformPrimitive2D, 1);
+}
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
SdrDragEntryPointGlueDrag::SdrDragEntryPointGlueDrag(const std::vector< basegfx::B2DPoint >& rPositions, bool bIsPointDrag)
: maPositions(rPositions),
mbIsPointDrag(bIsPointDrag)
@@ -318,6 +344,13 @@ void SdrDragMethod::createSdrDragEntries()
}
}
+void SdrDragMethod::createSdrDragEntryForSdrObject(const SdrObject& rOriginal, sdr::contact::ObjectContact& rObjectContact, bool bModify)
+{
+ // add full obejct drag; Clone() at the object has to work
+ // for this
+ addSdrDragEntry(new SdrDragEntrySdrObject(rOriginal, rObjectContact, bModify));
+}
+
void SdrDragMethod::createSdrDragEntries_SolidDrag()
{
const sal_uInt32 nMarkAnz(getSdrDragView().GetMarkedObjectCount());
@@ -359,7 +392,7 @@ void SdrDragMethod::createSdrDragEntries_SolidDrag()
{
// add full obejct drag; Clone() at the object has to work
// for this
- addSdrDragEntry(new SdrDragEntrySdrObject(*pCandidate, rOC, true));
+ createSdrDragEntryForSdrObject(*pCandidate, rOC, true);
}
if(bAddWireframe)
@@ -1358,6 +1391,21 @@ Pointer SdrDragObjOwn::GetSdrDragPointer() const
TYPEINIT1(SdrDragMove,SdrDragMethod);
+void SdrDragMove::createSdrDragEntryForSdrObject(const SdrObject& rOriginal, sdr::contact::ObjectContact& rObjectContact, bool /*bModify*/)
+{
+ // for SdrDragMove, use current Primitive2DSequence of SdrObject visualisation
+ // in given ObjectContact directly
+ sdr::contact::ViewContact& rVC = rOriginal.GetViewContact();
+ sdr::contact::ViewObjectContact& rVOC = rVC.GetViewObjectContact(rObjectContact);
+ sdr::contact::DisplayInfo aDisplayInfo;
+
+ // Do not use the last ViewPort set at the OC from the last ProcessDisplay(),
+ // here we want the complete primitive sequence without visibility clippings
+ rObjectContact.resetViewPort();
+
+ addSdrDragEntry(new SdrDragEntryPrimitive2DSequence(rVOC.getPrimitive2DSequenceHierarchy(aDisplayInfo), true));
+}
+
void SdrDragMove::applyCurrentTransformationToSdrObject(SdrObject& rTarget)
{
rTarget.Move(Size(DragStat().GetDX(), DragStat().GetDY()));
diff --git a/svx/source/svdraw/svdfppt.cxx b/svx/source/svdraw/svdfppt.cxx
index af38c34e0749..347a5005bd78 100644
--- a/svx/source/svdraw/svdfppt.cxx
+++ b/svx/source/svdraw/svdfppt.cxx
@@ -7662,7 +7662,7 @@ void ApplyCellLineAttributes( const SdrObject* pLine, Reference< XTable >& xTabl
}
}
-SdrObject* SdrPowerPointImport::CreateTable( SdrObject* pGroup, sal_uInt32* pTableArry, SvxMSDffSolverContainer* pSolverContainer ) const
+SdrObject* SdrPowerPointImport::CreateTable( SdrObject* pGroup, sal_uInt32* pTableArry, SvxMSDffSolverContainer* pSolverContainer )
{
SdrObject* pRet = pGroup;
sal_uInt32 nRows = pTableArry[ 1 ];
@@ -7786,6 +7786,15 @@ SdrObject* SdrPowerPointImport::CreateTable( SdrObject* pGroup, sal_uInt32* pTab
pTable->uno_unlock();
pTable->SetSnapRect( pGroup->GetSnapRect() );
pRet = pTable;
+
+ //Remove Objects from shape map
+ SdrObjListIter aIter( *pGroup, IM_DEEPWITHGROUPS );
+ while( aIter.IsMore() )
+ {
+ SdrObject* pPartObj = aIter.Next();
+ removeShapeId( pPartObj );
+ }
+
SdrObject::Free( pGroup );
}
catch( Exception& )
diff --git a/sw/inc/docstat.hxx b/sw/inc/docstat.hxx
index 9e03f57d5a97..4575796440bf 100644
--- a/sw/inc/docstat.hxx
+++ b/sw/inc/docstat.hxx
@@ -33,12 +33,6 @@
#include <tools/solar.h>
#include "swdllapi.h"
-///////////////////////////////////////////////////////////////////////////
-// PRODUCT: struct SwInternStat ist nur fuer CORE Interne Statistics und
-// hat nichts in einer ProductVersion zu suchen.
-///////////////////////////////////////////////////////////////////////////
-
-struct SwInternStat;
struct SW_DLLPUBLIC SwDocStat
{
@@ -46,11 +40,14 @@ struct SW_DLLPUBLIC SwDocStat
USHORT nGrf;
USHORT nOLE;
ULONG nPage;
+ /// paragraphs for document statistic: non-empty and non-hidden ones
ULONG nPara;
+ /// all paragraphs, including empty/hidden ones
+ ULONG nAllPara;
ULONG nWord;
ULONG nChar;
BOOL bModified;
- SwInternStat* pInternStat;
+
SwDocStat();
void Reset();
};
diff --git a/sw/inc/docufld.hxx b/sw/inc/docufld.hxx
index 88c4e650cfd0..f3e41abf199f 100644
--- a/sw/inc/docufld.hxx
+++ b/sw/inc/docufld.hxx
@@ -548,6 +548,8 @@ public:
const OutlinerParaObject* GetTextObject() const;
void SetTextObject( OutlinerParaObject* pText );
+ sal_uInt32 GetNumberOfParagraphs() const;
+
virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, USHORT nWhich ) const;
virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, USHORT nWhich );
virtual String GetDescription() const;
diff --git a/sw/inc/swrect.hxx b/sw/inc/swrect.hxx
index fc6d0238820e..c5ded7255c49 100644
--- a/sw/inc/swrect.hxx
+++ b/sw/inc/swrect.hxx
@@ -35,10 +35,8 @@ class SvStream;
class SwRect
{
- long nX;
- long nY;
- long nWidth;
- long nHeight;
+ Point m_Point;
+ Size m_Size;
public:
@@ -177,137 +175,133 @@ typedef void (SwRect:: *SwRectSetPos)( const Point& );
//---------------------------------- Set-Methoden
inline void SwRect::Chg( const Point& rNP, const Size &rNS )
{
- nX = rNP.X(); nY = rNP.Y();
- nWidth = rNS.Width(); nHeight = rNS.Height();
+ m_Point = rNP;
+ m_Size = rNS;
}
inline void SwRect::Pos( const Point& rNew )
{
- nX = rNew.X(); nY = rNew.Y();
+ m_Point = rNew;
}
inline void SwRect::Pos( const long nNewX, const long nNewY )
{
- nX = nNewX; nY = nNewY;
+ m_Point.setX(nNewX);
+ m_Point.setY(nNewY);
}
inline void SwRect::SSize( const Size& rNew )
{
- nWidth = rNew.Width(); nHeight = rNew.Height();
+ m_Size = rNew;
}
inline void SwRect::SSize( const long nNewHeight, const long nNewWidth )
{
- nWidth = nNewWidth; nHeight = nNewHeight;
+ m_Size.setWidth(nNewWidth);
+ m_Size.setHeight(nNewHeight);
}
inline void SwRect::Width( long nNew )
{
- nWidth = nNew;
+ m_Size.setWidth(nNew);
}
inline void SwRect::Height( long nNew )
{
- nHeight = nNew;
+ m_Size.setHeight(nNew);
}
inline void SwRect::Left( const long nLeft )
{
- nWidth += nX - nLeft;
- nX = nLeft;
+ m_Size.Width() += m_Point.getX() - nLeft;
+ m_Point.setX(nLeft);
}
inline void SwRect::Right( const long nRight )
{
- nWidth = nRight - nX + 1;
+ m_Size.setWidth(nRight - m_Point.getX() + 1);
}
inline void SwRect::Top( const long nTop )
{
- nHeight += nY - nTop;
- nY = nTop;
+ m_Size.Height() += m_Point.getY() - nTop;
+ m_Point.setY(nTop);
}
inline void SwRect::Bottom( const long nBottom )
{
- nHeight = nBottom - nY + 1;
+ m_Size.setHeight(nBottom - m_Point.getY() + 1);
}
//----------------------------------- Get-Methoden
inline const Point &SwRect::Pos() const
{
- return *(Point*)(&nX);
+ return m_Point;
}
inline Point &SwRect::Pos()
{
- return *(Point*)(&nX);
+ return m_Point;
}
inline const Size &SwRect::SSize() const
{
- return *(Size*)(&nWidth);
+ return m_Size;
}
inline Size &SwRect::SSize()
{
- return *(Size*)(&nWidth);
+ return m_Size;
}
inline long SwRect::Width() const
{
- return nWidth;
+ return m_Size.Width();
}
inline long SwRect::Height() const
{
- return nHeight;
+ return m_Size.Height();
}
inline long SwRect::Left() const
{
- return nX;
+ return m_Point.X();
}
inline long SwRect::Right() const
{
- return nWidth ? nX + nWidth - 1 : nX;
+ return m_Size.getWidth() ? m_Point.getX() + m_Size.getWidth() - 1 : m_Point.getX();
}
inline long SwRect::Top() const
{
- return nY;
+ return m_Point.Y();
}
inline long SwRect::Bottom() const
{
- return nHeight ? nY + nHeight - 1 : nY;
+ return m_Size.getHeight() ? m_Point.getY() + m_Size.getHeight() - 1 : m_Point.getY();
}
//----------------------------------- operatoren
inline SwRect &SwRect::operator = ( const SwRect &rRect )
{
- nX = rRect.Left();
- nY = rRect.Top();
- nWidth = rRect.Width();
- nHeight = rRect.Height();
+ m_Point = rRect.m_Point;
+ m_Size = rRect.m_Size;
return *this;
}
inline BOOL SwRect::operator == ( const SwRect& rRect ) const
{
- return (nX == rRect.Left() &&
- nY == rRect.Top() &&
- nWidth == rRect.Width() &&
- nHeight == rRect.Height());
+ return (m_Point == rRect.m_Point && m_Size == rRect.m_Size);
}
inline BOOL SwRect::operator != ( const SwRect& rRect ) const
{
- return (nX != rRect.Left() ||
- nY != rRect.Top() ||
- nWidth != rRect.Width() ||
- nHeight != rRect.Height());
+ return (m_Point != rRect.m_Point || m_Size != rRect.m_Size);
}
inline SwRect &SwRect::operator+=( const Point &rPt )
{
- nX += rPt.X(); nY += rPt.Y();
+ m_Point += rPt;
return *this;
}
inline SwRect &SwRect::operator-=( const Point &rPt )
{
- nX -= rPt.X(); nY -= rPt.Y();
+ m_Point -= rPt;
return *this;
}
inline SwRect &SwRect::operator+=( const Size &rSz )
{
- nWidth += rSz.Width(); nHeight += rSz.Height();
+ m_Size.Width() += rSz.Width();
+ m_Size.Height() += rSz.Height();
return *this;
}
inline SwRect &SwRect::operator-=( const Size &rSz )
{
- nWidth -= rSz.Width(); nHeight -= rSz.Height();
+ m_Size.Width() -= rSz.Width();
+ m_Size.Height() -= rSz.Height();
return *this;
}
@@ -315,10 +309,10 @@ inline SwRect &SwRect::operator-=( const Size &rSz )
//--------------------------- Sonstiges
inline Rectangle SwRect::SVRect() const
{
- ASSERT( nWidth && nHeight, "SVRect() ohne Widht oder Height" );
- return Rectangle( nX, nY,
- nX + nWidth - 1, //Right()
- nY + nHeight - 1 ); //Bottom()
+ ASSERT( !IsEmpty(), "SVRect() without Width or Height" );
+ return Rectangle( m_Point.getX(), m_Point.getY(),
+ m_Point.getX() + m_Size.getWidth() - 1, //Right()
+ m_Point.getY() + m_Size.getHeight() - 1 ); //Bottom()
}
inline SwRect SwRect::GetIntersection( const SwRect& rRect ) const
@@ -328,51 +322,44 @@ inline SwRect SwRect::GetIntersection( const SwRect& rRect ) const
inline BOOL SwRect::HasArea() const
{
- return nHeight && nWidth;
+ return !IsEmpty();
}
inline BOOL SwRect::IsEmpty() const
{
- return !(nHeight && nWidth);
+ return !(m_Size.getHeight() && m_Size.getWidth());
}
inline void SwRect::Clear()
{
- nX = nY = nWidth = nHeight = 0;
+ m_Point.setX(0);
+ m_Point.setY(0);
+ m_Size.setWidth(0);
+ m_Size.setHeight(0);
}
//-------------------------- CToren
inline SwRect::SwRect() :
- nX( 0 ),
- nY( 0 ),
- nWidth ( 0 ),
- nHeight( 0 )
+ m_Point( 0, 0 ),
+ m_Size( 0, 0 )
{
}
inline SwRect::SwRect( const SwRect &rRect ) :
- nX( rRect.Left() ),
- nY( rRect.Top() ),
- nWidth ( rRect.Width() ),
- nHeight( rRect.Height() )
+ m_Point( rRect.m_Point ),
+ m_Size( rRect.m_Size )
{
}
inline SwRect::SwRect( const Point& rLT, const Size& rSize ) :
- nX( rLT.X() ),
- nY( rLT.Y() ),
- nWidth ( rSize.Width() ),
- nHeight( rSize.Height())
+ m_Point( rLT ),
+ m_Size( rSize )
{
}
inline SwRect::SwRect( const Point& rLT, const Point& rRB ) :
- nX( rLT.X() ),
- nY( rLT.Y() ),
- nWidth ( rRB.X() - rLT.X() + 1 ),
- nHeight( rRB.Y() - rLT.Y() + 1 )
+ m_Point( rLT ),
+ m_Size( rRB.X() - rLT.X() + 1, rRB.Y() - rLT.Y() + 1 )
{
}
inline SwRect::SwRect( long X, long Y, long W, long H ) :
- nX( X ),
- nY( Y ),
- nWidth ( W ),
- nHeight( H )
+ m_Point( X, Y ),
+ m_Size( W, H )
{
}
diff --git a/sw/inc/txatbase.hxx b/sw/inc/txatbase.hxx
index 2a49460a05ca..32fedb3753a0 100644
--- a/sw/inc/txatbase.hxx
+++ b/sw/inc/txatbase.hxx
@@ -121,7 +121,6 @@ public:
inline const SwTOXMark &GetTOXMark() const;
inline const SwFmtRefMark &GetRefMark() const;
inline const SwFmtINetFmt &GetINetFmt() const;
- inline const SvXMLAttrContainerItem &GetXMLAttrContainer() const;
inline const SwFmtRuby &GetRuby() const;
inline const SwFmtMeta &GetMeta() const;
@@ -230,13 +229,6 @@ inline const SwFmtINetFmt& SwTxtAttr::GetINetFmt() const
return (const SwFmtINetFmt&)(*m_pAttr);
}
-inline const SvXMLAttrContainerItem& SwTxtAttr::GetXMLAttrContainer() const
-{
- ASSERT( m_pAttr && m_pAttr->Which() == RES_UNKNOWNATR_CONTAINER,
- "Wrong attribute" );
- return (const SvXMLAttrContainerItem&)(*m_pAttr);
-}
-
inline const SwFmtRuby& SwTxtAttr::GetRuby() const
{
ASSERT( m_pAttr && m_pAttr->Which() == RES_TXTATR_CJK_RUBY,
diff --git a/sw/inc/txtatr.hxx b/sw/inc/txtatr.hxx
index 92b51fede495..d9e9463a30a7 100644
--- a/sw/inc/txtatr.hxx
+++ b/sw/inc/txtatr.hxx
@@ -60,15 +60,6 @@ public:
};
-// ATT_XMLCONTAINERITEM ******************************
-
-class SwTxtXMLAttrContainer : public SwTxtAttrEnd
-{
-public:
- SwTxtXMLAttrContainer( SvXMLAttrContainerItem& rAttr,
- xub_StrLen nStart, xub_StrLen nEnd );
-};
-
// ******************************
class SwTxtAttrNesting : public SwTxtAttrEnd
diff --git a/sw/inc/undobj.hxx b/sw/inc/undobj.hxx
index aaafa3fca76a..daefe85aa09a 100644
--- a/sw/inc/undobj.hxx
+++ b/sw/inc/undobj.hxx
@@ -206,6 +206,11 @@ namespace nsDelCntntType
const DelCntntType DELCNT_CHKNOCNTNT = 0x80;
}
+/// will DelCntntIndex destroy a frame anchored at character at rAnchorPos?
+bool IsDestroyFrameAnchoredAtChar(SwPosition const & rAnchorPos,
+ SwPosition const & rStart, SwPosition const & rEnd,
+ DelCntntType const nDelCntntType = nsDelCntntType::DELCNT_ALL);
+
// diese Klasse muss in ein Undo-Object vererbt werden, wenn dieses Inhalt
// fuers Redo/Undo ... speichert
class SwUndoSaveCntnt
diff --git a/sw/source/core/bastyp/swrect.cxx b/sw/source/core/bastyp/swrect.cxx
index 21fd4c7a2970..b92047dbb39a 100644
--- a/sw/source/core/bastyp/swrect.cxx
+++ b/sw/source/core/bastyp/swrect.cxx
@@ -53,13 +53,12 @@
SwRect::SwRect( const Rectangle &rRect ) :
- nX( rRect.Left() ),
- nY( rRect.Top() )
+ m_Point( rRect.Left(), rRect.Top() )
{
- nWidth = rRect.Right() == RECT_EMPTY ? 0 :
- rRect.Right() - rRect.Left() +1;
- nHeight = rRect.Bottom() == RECT_EMPTY ? 0 :
- rRect.Bottom() - rRect.Top() + 1;
+ m_Size.setWidth(rRect.Right() == RECT_EMPTY ? 0 :
+ rRect.Right() - rRect.Left() +1);
+ m_Size.setHeight(rRect.Bottom() == RECT_EMPTY ? 0 :
+ rRect.Bottom() - rRect.Top() + 1);
}
/*************************************************************************
@@ -139,7 +138,7 @@ SwRect& SwRect::Intersection( const SwRect& rRect )
}
else
//Def.: Bei einer leeren Intersection wird nur die SSize genullt.
- nHeight = nWidth = 0;
+ SSize(0, 0);
return *this;
}
@@ -239,76 +238,88 @@ BOOL SwRect::IsOver( const SwRect& rRect ) const
void SwRect::Justify()
{
- if ( nHeight < 0 )
+ if ( m_Size.getHeight() < 0 )
{
- nY = nY + nHeight + 1;
- nHeight = -nHeight;
+ m_Point.Y() += m_Size.getHeight() + 1;
+ m_Size.setHeight(-m_Size.getHeight());
}
- if ( nWidth < 0 )
+ if ( m_Size.getWidth() < 0 )
{
- nX = nX + nWidth + 1;
- nWidth = -nWidth;
+ m_Point.Y() += m_Size.getWidth() + 1;
+ m_Size.setWidth(-m_Size.getWidth());
}
}
// Similiar to the inline methods, but we need the function pointers
-void SwRect::_Width( const long nNew ) { nWidth = nNew; }
-void SwRect::_Height( const long nNew ) { nHeight = nNew; }
-void SwRect::_Left( const long nLeft ){ nWidth += nX - nLeft; nX = nLeft; }
-void SwRect::_Right( const long nRight ){ nWidth = nRight - nX; }
-void SwRect::_Top( const long nTop ){ nHeight += nY - nTop; nY = nTop; }
-void SwRect::_Bottom( const long nBottom ){ nHeight = nBottom - nY; }
-
-long SwRect::_Width() const{ return nWidth; }
-long SwRect::_Height() const{ return nHeight; }
-long SwRect::_Left() const{ return nX; }
-long SwRect::_Right() const{ return nX + nWidth; }
-long SwRect::_Top() const{ return nY; }
-long SwRect::_Bottom() const{ return nY + nHeight; }
-
-void SwRect::AddWidth( const long nAdd ) { nWidth += nAdd; }
-void SwRect::AddHeight( const long nAdd ) { nHeight += nAdd; }
-void SwRect::SubLeft( const long nSub ){ nWidth += nSub; nX -= nSub; }
-void SwRect::AddRight( const long nAdd ){ nWidth += nAdd; }
-void SwRect::SubTop( const long nSub ){ nHeight += nSub; nY -= nSub; }
-void SwRect::AddBottom( const long nAdd ){ nHeight += nAdd; }
-void SwRect::SetPosX( const long nNew ){ nX = nNew; }
-void SwRect::SetPosY( const long nNew ){ nY = nNew; }
+void SwRect::_Width( const long nNew ) { m_Size.setWidth(nNew); }
+void SwRect::_Height( const long nNew ) { m_Size.setHeight(nNew); }
+void SwRect::_Left( const long nLeft ){ m_Size.Width() += m_Point.getX() - nLeft; m_Point.setX(nLeft); }
+void SwRect::_Right( const long nRight ){ m_Size.setWidth(nRight - m_Point.getX()); }
+void SwRect::_Top( const long nTop ){ m_Size.Height() += m_Point.getY() - nTop; m_Point.setY(nTop); }
+void SwRect::_Bottom( const long nBottom ){ m_Size.setHeight(nBottom - m_Point.getY()); }
+
+long SwRect::_Width() const{ return m_Size.getWidth(); }
+long SwRect::_Height() const{ return m_Size.getHeight(); }
+long SwRect::_Left() const{ return m_Point.getX(); }
+long SwRect::_Right() const{ return m_Point.getX() + m_Size.getWidth(); }
+long SwRect::_Top() const{ return m_Point.getY(); }
+long SwRect::_Bottom() const{ return m_Point.getY() + m_Size.getHeight(); }
+
+void SwRect::AddWidth( const long nAdd ) { m_Size.Width() += nAdd; }
+void SwRect::AddHeight( const long nAdd ) { m_Size.Height() += nAdd; }
+void SwRect::SubLeft( const long nSub ){ m_Size.Width() += nSub; m_Point.X() -= nSub; }
+void SwRect::AddRight( const long nAdd ){ m_Size.Width() += nAdd; }
+void SwRect::SubTop( const long nSub ){ m_Size.Height() += nSub; m_Point.Y() -= nSub; }
+void SwRect::AddBottom( const long nAdd ){ m_Size.Height() += nAdd; }
+void SwRect::SetPosX( const long nNew ){ m_Point.setX(nNew); }
+void SwRect::SetPosY( const long nNew ){ m_Point.setY(nNew); }
const Size SwRect::_Size() const { return SSize(); }
-const Size SwRect::SwappedSize() const { return Size( nHeight, nWidth ); }
+const Size SwRect::SwappedSize() const { return Size( m_Size.getHeight(), m_Size.getWidth() ); }
const Point SwRect::TopLeft() const { return Pos(); }
-const Point SwRect::TopRight() const { return Point( nX + nWidth, nY ); }
-const Point SwRect::BottomLeft() const { return Point( nX, nY + nHeight ); }
+const Point SwRect::TopRight() const { return Point( m_Point.getX() + m_Size.getWidth(), m_Point.getY() ); }
+const Point SwRect::BottomLeft() const { return Point( m_Point.getX(), m_Point.getY() + m_Size.getHeight() ); }
const Point SwRect::BottomRight() const
- { return Point( nX + nWidth, nY + nHeight ); }
-long SwRect::GetLeftDistance( long nLimit ) const { return nX - nLimit; }
-long SwRect::GetBottomDistance( long nLim ) const { return nLim - nY - nHeight;}
-long SwRect::GetTopDistance( long nLimit ) const { return nY - nLimit; }
-long SwRect::GetRightDistance( long nLim ) const { return nLim - nX - nWidth; }
+ { return Point( m_Point.getX() + m_Size.getWidth(), m_Point.getY() + m_Size.getHeight() ); }
+long SwRect::GetLeftDistance( long nLimit ) const { return m_Point.getX() - nLimit; }
+long SwRect::GetBottomDistance( long nLim ) const { return nLim - m_Point.getY() - m_Size.getHeight();}
+long SwRect::GetTopDistance( long nLimit ) const { return m_Point.getY() - nLimit; }
+long SwRect::GetRightDistance( long nLim ) const { return nLim - m_Point.getX() - m_Size.getWidth(); }
BOOL SwRect::OverStepLeft( long nLimit ) const
- { return nLimit > nX && nX + nWidth > nLimit; }
+ { return nLimit > m_Point.getX() && m_Point.getX() + m_Size.getWidth() > nLimit; }
BOOL SwRect::OverStepBottom( long nLimit ) const
- { return nLimit > nY && nY + nHeight > nLimit; }
+ { return nLimit > m_Point.getY() && m_Point.getY() + m_Size.getHeight() > nLimit; }
BOOL SwRect::OverStepTop( long nLimit ) const
- { return nLimit > nY && nY + nHeight > nLimit; }
+ { return nLimit > m_Point.getY() && m_Point.getY() + m_Size.getHeight() > nLimit; }
BOOL SwRect::OverStepRight( long nLimit ) const
- { return nLimit > nX && nX + nWidth > nLimit; }
+ { return nLimit > m_Point.getX() && m_Point.getX() + m_Size.getWidth() > nLimit; }
void SwRect::SetLeftAndWidth( long nLeft, long nNew )
- { nX = nLeft; nWidth = nNew; }
+{
+ m_Point.setX(nLeft);
+ m_Size.setWidth(nNew);
+}
void SwRect::SetTopAndHeight( long nTop, long nNew )
- { nY = nTop; nHeight = nNew; }
+{
+ m_Point.setY(nTop);
+ m_Size.setHeight(nNew);
+}
void SwRect::SetRightAndWidth( long nRight, long nNew )
- { nX = nRight - nNew; nWidth = nNew; }
+{
+ m_Point.setX(nRight - nNew);
+ m_Size.setWidth(nNew);
+}
void SwRect::SetBottomAndHeight( long nBottom, long nNew )
- { nY = nBottom - nNew; nHeight = nNew; }
+{
+ m_Point.setY(nBottom - nNew);
+ m_Size.setHeight(nNew);
+}
void SwRect::SetUpperLeftCorner( const Point& rNew )
- { nX = rNew.nA; nY = rNew.nB; }
+ { m_Point = rNew; }
void SwRect::SetUpperRightCorner( const Point& rNew )
- { nX = rNew.nA - nWidth; nY = rNew.nB; }
+ { m_Point = Point(rNew.nA - m_Size.getWidth(), rNew.nB); }
void SwRect::SetLowerLeftCorner( const Point& rNew )
- { nX = rNew.nA; nY = rNew.nB - nHeight; }
+ { m_Point = Point(rNew.nA, rNew.nB - m_Size.getHeight()); }
#ifndef PRODUCT
/*************************************************************************
diff --git a/sw/source/core/bastyp/swregion.cxx b/sw/source/core/bastyp/swregion.cxx
index ba8ee121a362..2bab385f0b5a 100644
--- a/sw/source/core/bastyp/swregion.cxx
+++ b/sw/source/core/bastyp/swregion.cxx
@@ -117,7 +117,7 @@ void SwRegionRects::operator-=( const SwRect &rRect )
if ( 0 < (nTmp = aInter.Top() - aTmp.Top()) )
{
const long nOldVal = aTmp.Height();
- aTmp.SSize().Height() = nTmp;
+ aTmp.Height(nTmp);
InsertRect( aTmp, i, bDel );
aTmp.Height( nOldVal );
}
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index 0441d14edf1d..0c18b725d9f7 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -106,6 +106,8 @@
#include <SwUndoFmt.hxx>
#include <unocrsr.hxx>
#include <docsh.hxx>
+#include <docufld.hxx>
+
#include <vector>
#include <osl/diagnose.h>
@@ -465,6 +467,9 @@ void SwDoc::setPrinter(/*[in]*/ SfxPrinter *pP,/*[in]*/ bool bDeleteOld,/*[in]*/
if ( bDeleteOld )
delete pPrt;
pPrt = pP;
+
+ if ( pDrawModel && !get( IDocumentSettingAccess::USE_VIRTUAL_DEVICE ) )
+ pDrawModel->SetRefDevice( pPrt );
}
if ( bCallPrtDataChanged &&
@@ -493,6 +498,9 @@ void SwDoc::setVirtualDevice(/*[in]*/ VirtualDevice* pVd,/*[in]*/ bool bDeleteOl
if ( bDeleteOld )
delete pVirDev;
pVirDev = pVd;
+
+ if ( pDrawModel && get( IDocumentSettingAccess::USE_VIRTUAL_DEVICE ) )
+ pDrawModel->SetRefDevice( pVirDev );
}
}
@@ -528,6 +536,9 @@ void SwDoc::setReferenceDeviceType(/*[in]*/ bool bNewVirtual,/*[in]*/ bool bNewH
pMyVirDev->SetReferenceDevice( VirtualDevice::REFDEV_MODE06 );
else
pMyVirDev->SetReferenceDevice( VirtualDevice::REFDEV_MODE_MSO1 );
+
+ if( pDrawModel )
+ pDrawModel->SetRefDevice( pMyVirDev );
}
else
{
@@ -537,8 +548,10 @@ void SwDoc::setReferenceDeviceType(/*[in]*/ bool bNewVirtual,/*[in]*/ bool bNewH
// triggers this funny situation:
// getReferenceDevice()->getPrinter()->CreatePrinter_()
// ->setPrinter()-> PrtDataChanged()
- getPrinter( true );
+ SfxPrinter* pPrinter = getPrinter( true );
// <--
+ if( pDrawModel )
+ pDrawModel->SetRefDevice( pPrinter );
}
set(IDocumentSettingAccess::USE_VIRTUAL_DEVICE, bNewVirtual );
@@ -1066,6 +1079,24 @@ void SwDoc::UpdateDocStat( SwDocStat& rStat )
}
}
+ // #i93174#: notes contain paragraphs that are not nodes
+ {
+ SwFieldType * const pPostits( GetSysFldType(RES_POSTITFLD) );
+ SwClientIter aIter(*pPostits);
+ SwFmtFld const * pFmtFld =
+ static_cast<SwFmtFld const*>(aIter.First( TYPE(SwFmtFld) ));
+ while (pFmtFld)
+ {
+ if (pFmtFld->IsFldInDoc())
+ {
+ SwPostItField const * const pField(
+ static_cast<SwPostItField const*>(pFmtFld->GetFld()));
+ rStat.nAllPara += pField->GetNumberOfParagraphs();
+ }
+ pFmtFld = static_cast<SwFmtFld const*>(aIter.Next());
+ }
+ }
+
rStat.nPage = GetRootFrm() ? GetRootFrm()->GetPageNum() : 0;
rStat.bModified = FALSE;
SetDocStat( rStat );
@@ -1091,12 +1122,21 @@ void SwDoc::UpdateDocStat( SwDocStat& rStat )
aStat[n++].Value <<= (sal_Int32)rStat.nChar;
// For e.g. autotext documents there is no pSwgInfo (#i79945)
- if (GetDocShell()) {
- uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
- GetDocShell()->GetModel(), uno::UNO_QUERY_THROW);
- uno::Reference<document::XDocumentProperties> xDocProps(
+ SfxObjectShell * const pObjShell( GetDocShell() );
+ if (pObjShell)
+ {
+ const uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
+ pObjShell->GetModel(), uno::UNO_QUERY_THROW);
+ const uno::Reference<document::XDocumentProperties> xDocProps(
xDPS->getDocumentProperties());
+ // #i96786#: do not set modified flag when updating statistics
+ const bool bDocWasModified( IsModified() );
+ const ModifyBlocker_Impl b(pObjShell);
xDocProps->setDocumentStatistics(aStat);
+ if (!bDocWasModified)
+ {
+ ResetModified();
+ }
}
// event. Stat. Felder Updaten
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index c054b7ee5579..af3b5ddedf37 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -625,7 +625,7 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet,
(RES_TXTATR_CHARFMT == nWhich) ||
(RES_TXTATR_INETFMT == nWhich) ||
(RES_TXTATR_AUTOFMT == nWhich) ||
- isUNKNOWNATR(nWhich) )
+ (RES_TXTATR_UNKNOWN_CONTAINER == nWhich) )
{
pCharSet = &rChgSet;
bCharAttr = true;
@@ -636,7 +636,8 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet,
|| isPARATR_LIST(nWhich)
// <--
|| isFRMATR(nWhich)
- || isGRFATR(nWhich) )
+ || isGRFATR(nWhich)
+ || isUNKNOWNATR(nWhich) )
{
pOtherSet = &rChgSet;
bOtherAttr = true;
@@ -653,7 +654,7 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet,
RES_TXTATR_AUTOFMT, RES_TXTATR_AUTOFMT,
RES_TXTATR_INETFMT, RES_TXTATR_INETFMT,
RES_TXTATR_CHARFMT, RES_TXTATR_CHARFMT,
- RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1,
+ RES_TXTATR_UNKNOWN_CONTAINER, RES_TXTATR_UNKNOWN_CONTAINER,
0 );
SfxItemSet* pTmpOtherItemSet = new SfxItemSet( pDoc->GetAttrPool(),
@@ -663,6 +664,7 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet,
// <--
RES_FRMATR_BEGIN, RES_FRMATR_END-1,
RES_GRFATR_BEGIN, RES_GRFATR_END-1,
+ RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1,
0 );
pTmpCharItemSet->Put( rChgSet );
@@ -755,7 +757,7 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet,
SfxItemSet aTxtSet( pDoc->GetAttrPool(),
RES_TXTATR_REFMARK, RES_TXTATR_TOXMARK,
RES_TXTATR_META, RES_TXTATR_METAFIELD,
- RES_TXTATR_CJK_RUBY, RES_TXTATR_WITHEND_END-1,
+ RES_TXTATR_CJK_RUBY, RES_TXTATR_CJK_RUBY,
0 );
aTxtSet.Put( rChgSet );
@@ -1744,36 +1746,45 @@ BOOL lcl_SetTxtFmtColl( const SwNodePtr& rpNode, void* pArgs )
pFmt != pCNd->GetFmtColl() &&
pFmt->GetItemState( RES_PARATR_NUMRULE ) == SFX_ITEM_SET )
{
- // --> OD 2008-04-08 #refactorlists#
-// if ( pPara->pHistory )
-// {
-// SwTxtNode* pTNd( dynamic_cast<SwTxtNode*>(pCNd) );
-// ASSERT( pTNd,
-// "<lcl_SetTxtFmtColl(..)> - text node expected -> crash" );
-// SwRegHistory aRegH( pTNd, *pTNd, pPara->pHistory );
-// pCNd->ResetAttr( RES_PARATR_NUMRULE );
-// }
-// else
-// {
-// pCNd->ResetAttr( RES_PARATR_NUMRULE );
-// }
- std::auto_ptr< SwRegHistory > pRegH;
- if ( pPara->pHistory )
+ // --> OD 2009-09-07 #b6876367#
+ // Check, if the list style of the paragraph will change.
+ bool bChangeOfListStyleAtParagraph( true );
+ SwTxtNode* pTNd( dynamic_cast<SwTxtNode*>(pCNd) );
+ ASSERT( pTNd,
+ "<lcl_SetTxtFmtColl(..)> - text node expected -> crash" );
{
- SwTxtNode* pTNd( dynamic_cast<SwTxtNode*>(pCNd) );
- ASSERT( pTNd,
- "<lcl_SetTxtFmtColl(..)> - text node expected -> crash" );
- pRegH.reset( new SwRegHistory( pTNd, *pTNd, pPara->pHistory ) );
+ SwNumRule* pNumRuleAtParagraph( pTNd->GetNumRule() );
+ if ( pNumRuleAtParagraph )
+ {
+ const SwNumRuleItem& rNumRuleItemAtParagraphStyle =
+ pFmt->GetNumRule();
+ if ( rNumRuleItemAtParagraphStyle.GetValue() ==
+ pNumRuleAtParagraph->GetName() )
+ {
+ bChangeOfListStyleAtParagraph = false;
+ }
+ }
}
- pCNd->ResetAttr( RES_PARATR_NUMRULE );
+ if ( bChangeOfListStyleAtParagraph )
+ {
+ // --> OD 2008-04-08 #refactorlists#
+ std::auto_ptr< SwRegHistory > pRegH;
+ if ( pPara->pHistory )
+ {
+ pRegH.reset( new SwRegHistory( pTNd, *pTNd, pPara->pHistory ) );
+ }
+
+ pCNd->ResetAttr( RES_PARATR_NUMRULE );
- // reset all list attributes
- pCNd->ResetAttr( RES_PARATR_LIST_LEVEL );
- pCNd->ResetAttr( RES_PARATR_LIST_ISRESTART );
- pCNd->ResetAttr( RES_PARATR_LIST_RESTARTVALUE );
- pCNd->ResetAttr( RES_PARATR_LIST_ISCOUNTED );
- pCNd->ResetAttr( RES_PARATR_LIST_ID );
+ // reset all list attributes
+ pCNd->ResetAttr( RES_PARATR_LIST_LEVEL );
+ pCNd->ResetAttr( RES_PARATR_LIST_ISRESTART );
+ pCNd->ResetAttr( RES_PARATR_LIST_RESTARTVALUE );
+ pCNd->ResetAttr( RES_PARATR_LIST_ISCOUNTED );
+ pCNd->ResetAttr( RES_PARATR_LIST_ID );
+ }
+ // <--
}
// <--
}
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index daeda48ccae3..5f0170c1947f 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -309,9 +309,11 @@ Verhalten von Delete-Redline:
bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
{
-#ifndef PRODUCT
+#if 0
+// #i93179# disabled: ASSERT in ~SwIndexReg #ifndef PRODUCT
SwRedline aCopy( *pNewRedl );
#endif
+ bool bError = true;
_CHECK_REDLINE( this )
if( IsRedlineOn() && !IsShowOriginal( eRedlineMode ) &&
@@ -431,6 +433,7 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
pRedlineTbl->Insert( pRedl );
}
+ bError = false;
bDelete = true;
}
else if( (( POS_BEFORE == eCmpPos &&
@@ -446,6 +449,7 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
pRedlineTbl->Remove( n );
pRedlineTbl->Insert( pRedl );
+ bError = false;
bDelete = true;
}
else if ( POS_OUTSIDE == eCmpPos )
@@ -1108,7 +1112,8 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
case POS_EQUAL:
case POS_INSIDE:
- delete pNewRedl, pNewRedl = 0;
+ // TODO Check if there is any side effect
+ //delete pNewRedl, pNewRedl = 0;
break;
case POS_OUTSIDE:
@@ -1271,7 +1276,7 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
}
_CHECK_REDLINE( this )
- return 0 != pNewRedl;
+ return ( 0 != pNewRedl ) || !bError;
}
void SwDoc::CompressRedlines()
diff --git a/sw/source/core/doc/docsort.cxx b/sw/source/core/doc/docsort.cxx
index 67fec1f7d33d..3f1a6babac56 100644
--- a/sw/source/core/doc/docsort.cxx
+++ b/sw/source/core/doc/docsort.cxx
@@ -386,7 +386,7 @@ BOOL SwDoc::SortText(const SwPaM& rPaM, const SwSortOptions& rOpt)
{
if( bUndo )
{
- pRedlUndo = new SwUndoRedlineSort( rPaM, rOpt );
+ pRedlUndo = new SwUndoRedlineSort( *pRedlPam,rOpt );
DoUndo( FALSE );
}
// erst den Bereich kopieren, dann
@@ -471,20 +471,36 @@ BOOL SwDoc::SortText(const SwPaM& rPaM, const SwSortOptions& rOpt)
AppendUndo( pRedlUndo );
}
- // nBeg ist der Start vom sortierten Bereich
+ // nBeg is start of sorted range
SwNodeIndex aSttIdx( GetNodes(), nBeg );
- // der Kopierte Bereich ist das Geloeschte
- AppendRedline( new SwRedline( nsRedlineType_t::REDLINE_DELETE, *pRedlPam ), true);
+ // the copied range is deleted
+ SwRedline *const pDeleteRedline(
+ new SwRedline( nsRedlineType_t::REDLINE_DELETE, *pRedlPam ));
- // das sortierte ist das Eingefuegte
+ // pRedlPam points to nodes that may be deleted (hidden) by
+ // AppendRedline, so adjust it beforehand to prevent ASSERT
pRedlPam->GetPoint()->nNode = aSttIdx;
SwCntntNode* pCNd = aSttIdx.GetNode().GetCntntNode();
pRedlPam->GetPoint()->nContent.Assign( pCNd, 0 );
+ AppendRedline(pDeleteRedline, true);
+
+ // the sorted range is inserted
AppendRedline( new SwRedline( nsRedlineType_t::REDLINE_INSERT, *pRedlPam ), true);
if( pRedlUndo )
+ {
+ SwNodeIndex aInsEndIdx( pRedlPam->GetMark()->nNode, -1 );
+ pRedlPam->GetMark()->nNode = aInsEndIdx;
+ SwCntntNode *const pPrevNode =
+ pRedlPam->GetMark()->nNode.GetNode().GetCntntNode();
+ pRedlPam->GetMark()->nContent.Assign( pPrevNode, pPrevNode->Len() );
+
+ pRedlUndo->SetValues( *pRedlPam );
+ }
+
+ if( pRedlUndo )
pRedlUndo->SetOffset( aSttIdx );
delete pRedlPam, pRedlPam = 0;
diff --git a/sw/source/core/doc/docstat.cxx b/sw/source/core/doc/docstat.cxx
index 23e6fe5b055d..04c85a3a8d2a 100644
--- a/sw/source/core/doc/docstat.cxx
+++ b/sw/source/core/doc/docstat.cxx
@@ -45,10 +45,10 @@ SwDocStat::SwDocStat() :
nOLE(0),
nPage(1),
nPara(1),
+ nAllPara(1),
nWord(0),
nChar(0),
- bModified(TRUE),
- pInternStat(0)
+ bModified(TRUE)
{}
/************************************************************************
@@ -62,9 +62,9 @@ void SwDocStat::Reset()
nOLE = 0;
nPage = 1;
nPara = 1;
+ nAllPara= 1;
nWord = 0;
nChar = 0;
bModified = TRUE;
- pInternStat = 0;
}
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index a7e7675966c3..6407e505aa0c 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -1322,7 +1322,8 @@ SwTableNode* SwNodes::TextToTable( const std::vector< std::vector<SwNodeRange> >
SwTxtNode& rTxtNode = static_cast<SwTxtNode&>(rNode);
// setze den bei allen TextNode in der Tabelle den TableNode
// als StartNode
- rTxtNode.pStartOfSection = pTblNd;
+// FIXME: this is setting wrong node StartOfSections in nested tables.
+// rTxtNode.pStartOfSection = pTblNd;
// remove PageBreaks/PageDesc/ColBreak
const SwAttrSet* pSet = rTxtNode.GetpSwAttrSet();
if( pSet )
@@ -1401,7 +1402,6 @@ SwTableNode* SwNodes::TextToTable( const std::vector< std::vector<SwNodeRange> >
aCellNodeIdx = SwNodeIndex( *aCellNodeIdx.GetNode().EndOfSectionNode() );
}
-
// Section der Box zuweisen
pBox = new SwTableBox( pBoxFmt, *pSttNd, pLine );
pLine->GetTabBoxes().C40_INSERT( SwTableBox, pBox, nBoxes++ );
diff --git a/sw/source/core/docnode/swthreadmanager.cxx b/sw/source/core/docnode/swthreadmanager.cxx
index 61ffa301f708..3f06c26de608 100644
--- a/sw/source/core/docnode/swthreadmanager.cxx
+++ b/sw/source/core/docnode/swthreadmanager.cxx
@@ -39,35 +39,29 @@
@author OD
*/
-SwThreadManager* SwThreadManager::mpThreadManager = 0;
-osl::Mutex* SwThreadManager::mpGetManagerMutex = new osl::Mutex();
+bool SwThreadManager::mbThreadManagerInstantiated = false;
SwThreadManager::SwThreadManager()
: mpThreadManagerImpl( new ThreadManager( SwThreadJoiner::GetThreadJoiner() ) )
{
mpThreadManagerImpl->Init();
+ mbThreadManagerInstantiated = true;
}
SwThreadManager::~SwThreadManager()
{
- delete mpThreadManagerImpl;
}
+struct InitInstance : public rtl::Static<SwThreadManager, InitInstance> {};
+
SwThreadManager& SwThreadManager::GetThreadManager()
{
- osl::MutexGuard aGuard(*mpGetManagerMutex);
-
- if ( mpThreadManager == 0 )
- {
- mpThreadManager = new SwThreadManager();
- }
-
- return *mpThreadManager;
+ return InitInstance::get();
}
bool SwThreadManager::ExistsThreadManager()
{
- return (mpThreadManager != 0);
+ return mbThreadManagerInstantiated;
}
oslInterlockedCount SwThreadManager::AddThread( const rtl::Reference< ObservableThread >& rThread )
diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx
index 6bb8ff4902ea..9f1b19db95fa 100644
--- a/sw/source/core/fields/docufld.cxx
+++ b/sw/source/core/fields/docufld.cxx
@@ -1147,16 +1147,9 @@ String SwDocInfoField::Expand() const
->createInstance(::rtl::OUString::createFromAscii("com.sun.star.script.Converter")), uno::UNO_QUERY );
uno::Any aNew = xConverter->convertToSimpleType( aAny, uno::TypeClass_STRING );
aNew >>= sVal;
- ((SwDocInfoField*)this)->aContent = sVal;
+ const_cast<SwDocInfoField*>(this)->aContent = sVal;
}
}
- else
- {
- // property is "void" - means it has not been added until now - do it!
- aAny <<= ::rtl::OUString(aContent);
- uno::Reference < beans::XPropertyContainer > xCont( xSet, uno::UNO_QUERY );
- xCont->addProperty( aName, ::com::sun::star::beans::PropertyAttribute::REMOVEABLE, aAny );
- }
}
catch (uno::Exception&) {}
}
@@ -1877,6 +1870,11 @@ void SwPostItField::SetTextObject( OutlinerParaObject* pText )
mpText = pText;
}
+sal_uInt32 SwPostItField::GetNumberOfParagraphs() const
+{
+ return (mpText) ? mpText->Count() : 1;
+}
+
/*-----------------05.03.98 13:42-------------------
--------------------------------------------------*/
diff --git a/sw/source/core/inc/swthreadmanager.hxx b/sw/source/core/inc/swthreadmanager.hxx
index a8a0de5d0d4e..e3d08955433b 100644
--- a/sw/source/core/inc/swthreadmanager.hxx
+++ b/sw/source/core/inc/swthreadmanager.hxx
@@ -34,6 +34,10 @@
#include <osl/mutex.hxx>
#include <rtl/ref.hxx>
+#include <boost/utility.hpp>
+#include <memory>
+
+
class ObservableThread;
class ThreadManager;
@@ -45,6 +49,7 @@ class ThreadManager;
@author OD
*/
class SwThreadManager
+ : private ::boost::noncopyable
{
public:
@@ -52,6 +57,9 @@ class SwThreadManager
static bool ExistsThreadManager();
+ // private: don't call!
+ SwThreadManager();
+ // private: don't call!
~SwThreadManager();
oslInterlockedCount AddThread( const rtl::Reference< ObservableThread >& rThread );
@@ -76,12 +84,9 @@ class SwThreadManager
bool StartingOfThreadsSuspended();
private:
- static SwThreadManager* mpThreadManager;
- static osl::Mutex* mpGetManagerMutex;
+ static bool mbThreadManagerInstantiated;
- ThreadManager* mpThreadManagerImpl;
-
- SwThreadManager();
+ ::std::auto_ptr<ThreadManager> mpThreadManagerImpl;
};
#endif
diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx
index e6275cb5481a..f7c615ae640f 100644
--- a/sw/source/core/layout/sectfrm.cxx
+++ b/sw/source/core/layout/sectfrm.cxx
@@ -1160,6 +1160,10 @@ void SwSectionFrm::SimpleFormat()
SWRECTFN( this )
if( GetPrev() || GetUpper() )
{
+ // --> OD 2009-09-28 #b6882166#
+ // assure notifications on position changes.
+ const SwLayNotify aNotify( this );
+ // <--
(this->*fnRect->fnMakePos)( GetUpper(), GetPrev(), FALSE );
bValidPos = TRUE;
}
diff --git a/sw/source/core/text/atrstck.cxx b/sw/source/core/text/atrstck.cxx
index a6ed9f42255b..7db8ec2e2506 100644
--- a/sw/source/core/text/atrstck.cxx
+++ b/sw/source/core/text/atrstck.cxx
@@ -523,13 +523,11 @@ void SwAttrHandler::PushAndChg( const SwTxtAttr& rAttr, SwFont& rFnt )
sal_Bool SwAttrHandler::Push( const SwTxtAttr& rAttr, const SfxPoolItem& rItem )
{
- ASSERT( rItem.Which() < RES_TXTATR_WITHEND_END ||
- RES_UNKNOWNATR_CONTAINER == rItem.Which() ,
+ ASSERT( rItem.Which() < RES_TXTATR_WITHEND_END,
"I do not want this attribute, nWhich >= RES_TXTATR_WITHEND_END" );
// robust
- if ( RES_TXTATR_WITHEND_END <= rItem.Which() ||
- RES_UNKNOWNATR_CONTAINER == rItem.Which() )
+ if ( RES_TXTATR_WITHEND_END <= rItem.Which() )
return sal_False;
USHORT nStack = StackPos[ rItem.Which() ];
@@ -557,6 +555,9 @@ sal_Bool SwAttrHandler::Push( const SwTxtAttr& rAttr, const SfxPoolItem& rItem )
void SwAttrHandler::PopAndChg( const SwTxtAttr& rAttr, SwFont& rFnt )
{
+ if ( RES_TXTATR_WITHEND_END <= rAttr.Which() )
+ return; // robust
+
// these special attributes in fact represent a collection of attributes
// they have to be removed from each stack they belong to
if ( RES_TXTATR_INETFMT == rAttr.Which() ||
@@ -583,7 +584,7 @@ void SwAttrHandler::PopAndChg( const SwTxtAttr& rAttr, SwFont& rFnt )
}
// this is the usual case, we have a basic attribute, remove it from the
// stack and reset the font
- else if ( RES_UNKNOWNATR_CONTAINER != rAttr.Which() )
+ else
{
aAttrStack[ StackPos[ rAttr.Which() ] ].Remove( rAttr );
// reset font according to attribute on top of stack
@@ -600,13 +601,13 @@ void SwAttrHandler::PopAndChg( const SwTxtAttr& rAttr, SwFont& rFnt )
void SwAttrHandler::Pop( const SwTxtAttr& rAttr )
{
- ASSERT( rAttr.Which() < RES_TXTATR_WITHEND_END ||
- RES_UNKNOWNATR_CONTAINER == rAttr.Which() ,
+ ASSERT( rAttr.Which() < RES_TXTATR_WITHEND_END,
"I do not have this attribute, nWhich >= RES_TXTATR_WITHEND_END" );
- if ( RES_UNKNOWNATR_CONTAINER != rAttr.Which() &&
- rAttr.Which() < RES_TXTATR_WITHEND_END )
+ if ( rAttr.Which() < RES_TXTATR_WITHEND_END )
+ {
aAttrStack[ StackPos[ rAttr.Which() ] ].Remove( rAttr );
+ }
}
/*************************************************************************
diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx
index cf6603d8a4d7..c42ba1c25df0 100644
--- a/sw/source/core/text/itrcrsr.cxx
+++ b/sw/source/core/text/itrcrsr.cxx
@@ -158,7 +158,7 @@ void SwTxtMargin::CtorInitTxtMargin( SwTxtFrm *pNewFrm, SwTxtSizeInfo *pNewInf )
const SwTxtNode *pNode = pFrm->GetTxtNode();
const SvxLRSpaceItem &rSpace = pFrm->GetTxtNode()->GetSwAttrSet().GetLRSpace();
- // --> OD 2009-09-02 #i95907#
+ // --> OD 2009-09-08 #i95907#, #b6879723#
const bool bListLevelIndentsApplicable = pFrm->GetTxtNode()->AreListLevelIndentsApplicable();
// <--
@@ -183,7 +183,7 @@ void SwTxtMargin::CtorInitTxtMargin( SwTxtFrm *pNewFrm, SwTxtSizeInfo *pNewInf )
pFrm->Prt().Left() +
nLMWithNum -
pNode->GetLeftMarginWithNum( sal_False ) -
- // --> OD 2009-09-02 #i95907#
+ // --> OD 2009-09-08 #i95907#, #b6879723#
// rSpace.GetLeft() +
// rSpace.GetTxtLeft();
( bListLevelIndentsApplicable
@@ -193,14 +193,18 @@ void SwTxtMargin::CtorInitTxtMargin( SwTxtFrm *pNewFrm, SwTxtSizeInfo *pNewInf )
}
else
{
- if ( !pNode->getIDocumentSettingAccess()->get(IDocumentSettingAccess::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING) )
+ // --> OD 2009-09-08 #i95907#, #b6879723#
+// if ( !pNode->getIDocumentSettingAccess()->get(IDocumentSettingAccess::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING) )
+ if ( bListLevelIndentsApplicable ||
+ !pNode->getIDocumentSettingAccess()->get(IDocumentSettingAccess::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING) )
+ // <--
{
// this calculation is identical this the calculation for R2L layout - see above
nLeft = pFrm->Frm().Left() +
pFrm->Prt().Left() +
nLMWithNum -
pNode->GetLeftMarginWithNum( sal_False ) -
- // --> OD 2009-09-02 #i95907#
+ // --> OD 2009-09-08 #i95907#, #b6879723#
// rSpace.GetLeft() +
// rSpace.GetTxtLeft();
( bListLevelIndentsApplicable
@@ -223,7 +227,7 @@ void SwTxtMargin::CtorInitTxtMargin( SwTxtFrm *pNewFrm, SwTxtSizeInfo *pNewInf )
// paras inside cells inside new documents:
( pNode->getIDocumentSettingAccess()->get(IDocumentSettingAccess::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING) ||
!pFrm->IsInTab() ||
- !nLMWithNum) )
+ !nLMWithNum ) )
// <--
{
nLeft = pFrm->Prt().Left() + pFrm->Frm().Left();
@@ -235,8 +239,8 @@ void SwTxtMargin::CtorInitTxtMargin( SwTxtFrm *pNewFrm, SwTxtSizeInfo *pNewInf )
nFirst = nLeft;
else
{
- short nFLOfst;
- long nFirstLineOfs;
+ short nFLOfst = 0;
+ long nFirstLineOfs = 0;
if( !pNode->GetFirstLineOfsWithNum( nFLOfst ) &&
rSpace.IsAutoFirst() )
{
@@ -290,8 +294,13 @@ void SwTxtMargin::CtorInitTxtMargin( SwTxtFrm *pNewFrm, SwTxtSizeInfo *pNewInf )
else
nFirstLineOfs = nFLOfst;
+ // --> OD 2009-09-08 #i95907#, #b6879723#
+// if ( pFrm->IsRightToLeft() ||
+// !pNode->getIDocumentSettingAccess()->get(IDocumentSettingAccess::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING) )
if ( pFrm->IsRightToLeft() ||
- !pNode->getIDocumentSettingAccess()->get(IDocumentSettingAccess::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING) )
+ bListLevelIndentsApplicable ||
+ !pNode->getIDocumentSettingAccess()->get(IDocumentSettingAccess::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING) )
+ // <--
{
nFirst = nLeft + nFirstLineOfs;
}
diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx
index 826398ec2ce6..6f98bd371ead 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -386,7 +386,9 @@ USHORT SwFntObj::GetFontHeight( const ViewShell* pSh, const OutputDevice& rOut )
const FontMetric aOutMet( rRefDev.GetFontMetric() );
long nTmpPrtHeight = (USHORT)aOutMet.GetAscent() + aOutMet.GetDescent();
(void) nTmpPrtHeight;
- ASSERT( nTmpPrtHeight == nPrtHeight, "GetTextHeight != Ascent + Descent" )
+ // #i106098#: do not compare with == here due to rounding error
+ ASSERT( abs(nTmpPrtHeight - nPrtHeight) < 3,
+ "GetTextHeight != Ascent + Descent" );
#endif
((OutputDevice&)rRefDev).SetFont( aOldFnt );
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index f5ebacaac8cd..eb1f5c3e94fc 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -943,9 +943,7 @@ void SwTxtNode::Update( SwIndex const & rPos, const xub_StrLen nChangeLen,
bool bNoExp = false;
bool bResort = false;
const USHORT coArrSz = static_cast<USHORT>(RES_TXTATR_WITHEND_END) -
- static_cast<USHORT>(RES_CHRATR_BEGIN) +
- static_cast<USHORT>(RES_UNKNOWNATR_END) -
- static_cast<USHORT>(RES_UNKNOWNATR_BEGIN);
+ static_cast<USHORT>(RES_CHRATR_BEGIN);
BOOL aDontExp[ coArrSz ];
memset( &aDontExp, 0, coArrSz * sizeof(BOOL) );
@@ -980,14 +978,6 @@ void SwTxtNode::Update( SwIndex const & rPos, const xub_StrLen nChangeLen,
nWhPos = static_cast<USHORT>(nWhich -
RES_CHRATR_BEGIN);
}
- else if (isUNKNOWNATR(nWhich))
- {
- nWhPos = static_cast<USHORT>(
- nWhich -
- static_cast<USHORT>(RES_UNKNOWNATR_BEGIN) +
- static_cast<USHORT>(RES_TXTATR_WITHEND_END) -
- static_cast<USHORT>(RES_CHRATR_BEGIN) );
- }
else
continue;
@@ -2852,6 +2842,9 @@ long SwTxtNode::GetLeftMarginWithNum( BOOL bTxtLeft ) const
BOOL SwTxtNode::GetFirstLineOfsWithNum( short& rFLOffset ) const
{
BOOL bRet( FALSE );
+ // --> OD 2009-09-08 #i95907#, #b6879723#
+ rFLOffset = 0;
+ // <--
// --> OD 2005-11-02 #i51089 - TUNING#
const SwNumRule* pRule = GetNum() ? GetNum()->GetNumRule() : 0L;
@@ -2885,8 +2878,6 @@ BOOL SwTxtNode::GetFirstLineOfsWithNum( short& rFLOffset ) const
}
// <--
}
- else
- rFLOffset = 0;
bRet = TRUE;
}
diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx
index 12f8e210e7c5..81bdb95f0699 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -1065,11 +1065,6 @@ SwTxtAttr* MakeTxtAttr( SwDoc & rDoc, SfxPoolItem& rAttr,
case RES_TXTATR_TOXMARK:
pNew = new SwTxtTOXMark( (SwTOXMark&)rNew, nStt, &nEnd );
break;
- case RES_UNKNOWNATR_CONTAINER:
- case RES_TXTATR_UNKNOWN_CONTAINER:
- pNew = new SwTxtXMLAttrContainer( (SvXMLAttrContainerItem&)rNew,
- nStt, nEnd );
- break;
case RES_TXTATR_CJK_RUBY:
pNew = new SwTxtRuby( (SwFmtRuby&)rNew, nStt, nEnd );
break;
@@ -1669,8 +1664,7 @@ BOOL SwTxtNode::SetAttr( const SfxItemSet& rSet, xub_StrLen nStt,
SfxItemSet aCharSet( *rSet.GetPool(), aCharAutoFmtSetRange );
- USHORT nWhich, nCount = 0;
- SwTxtAttr* pNew;
+ USHORT nCount = 0;
SfxItemIter aIter( *pSet );
const SfxPoolItem* pItem = aIter.GetCurItem();
@@ -1678,8 +1672,10 @@ BOOL SwTxtNode::SetAttr( const SfxItemSet& rSet, xub_StrLen nStt,
{
if ( pItem && (reinterpret_cast<SfxPoolItem*>(-1) != pItem))
{
- nWhich = pItem->Which();
- if ( isCHRATR(nWhich) || isTXTATR(nWhich) || isUNKNOWNATR(nWhich) )
+ const USHORT nWhich = pItem->Which();
+ ASSERT( isCHRATR(nWhich) || isTXTATR(nWhich),
+ "SwTxtNode::SetAttr(): unknown attribute" );
+ if ( isCHRATR(nWhich) || isTXTATR(nWhich) )
{
if ((RES_TXTATR_CHARFMT == nWhich) &&
(GetDoc()->GetDfltCharFmt() ==
@@ -1698,7 +1694,8 @@ BOOL SwTxtNode::SetAttr( const SfxItemSet& rSet, xub_StrLen nStt,
}
else
{
- pNew = MakeTxtAttr( *GetDoc(),
+
+ SwTxtAttr *const pNew = MakeTxtAttr( *GetDoc(),
const_cast<SfxPoolItem&>(*pItem), nStt, nEnd );
if ( pNew )
{
@@ -1862,20 +1859,18 @@ BOOL SwTxtNode::GetAttr( SfxItemSet& rSet, xub_StrLen nStt, xub_StrLen nEnd,
}
const USHORT nSize = m_pSwpHints->Count();
- USHORT n;
- xub_StrLen nAttrStart;
- const xub_StrLen* pAttrEnd;
if( nStt == nEnd ) // kein Bereich:
{
- for( n = 0; n < nSize; ++n ) //
+ for (USHORT n = 0; n < nSize; ++n)
{
const SwTxtAttr* pHt = (*m_pSwpHints)[n];
- nAttrStart = *pHt->GetStart();
+ const xub_StrLen nAttrStart = *pHt->GetStart();
if( nAttrStart > nEnd ) // ueber den Bereich hinaus
break;
- if( 0 == ( pAttrEnd = pHt->GetEnd() )) // nie Attribute ohne Ende
+ const xub_StrLen* pAttrEnd = pHt->GetEnd();
+ if ( ! pAttrEnd ) // no attributes without end
continue;
if( ( nAttrStart < nStt &&
@@ -1889,22 +1884,21 @@ BOOL SwTxtNode::GetAttr( SfxItemSet& rSet, xub_StrLen nStt, xub_StrLen nEnd,
else // es ist ein Bereich definiert
{
// --> FME 2007-03-13 #i75299#
- std::vector< SwPoolItemEndPair >* pAttrArr = 0;
+ ::std::auto_ptr< std::vector< SwPoolItemEndPair > > pAttrArr;
// <--
const USHORT coArrSz = static_cast<USHORT>(RES_TXTATR_WITHEND_END) -
- static_cast<USHORT>(RES_CHRATR_BEGIN) +
- static_cast<USHORT>(RES_UNKNOWNATR_END) -
- static_cast<USHORT>(RES_UNKNOWNATR_BEGIN);
+ static_cast<USHORT>(RES_CHRATR_BEGIN);
- for( n = 0; n < nSize; ++n )
+ for (USHORT n = 0; n < nSize; ++n)
{
const SwTxtAttr* pHt = (*m_pSwpHints)[n];
- nAttrStart = *pHt->GetStart();
+ const xub_StrLen nAttrStart = *pHt->GetStart();
if( nAttrStart > nEnd ) // ueber den Bereich hinaus
break;
- if( 0 == ( pAttrEnd = pHt->GetEnd() )) // nie Attribute ohne Ende
+ const xub_StrLen* pAttrEnd = pHt->GetEnd();
+ if ( ! pAttrEnd ) // no attributes without end
continue;
BOOL bChkInvalid = FALSE;
@@ -1927,7 +1921,7 @@ BOOL SwTxtNode::GetAttr( SfxItemSet& rSet, xub_StrLen nStt, xub_StrLen nEnd,
if( bChkInvalid )
{
// uneindeutig ?
- SfxItemIter* pItemIter = 0;
+ ::std::auto_ptr< SfxItemIter > pItemIter;
const SfxPoolItem* pItem = 0;
if ( RES_TXTATR_AUTOFMT == pHt->Which() )
@@ -1935,7 +1929,7 @@ BOOL SwTxtNode::GetAttr( SfxItemSet& rSet, xub_StrLen nStt, xub_StrLen nEnd,
const SfxItemSet* pAutoSet = CharFmt::GetItemSet( pHt->GetAttr() );
if ( pAutoSet )
{
- pItemIter = new SfxItemIter( *pAutoSet );
+ pItemIter.reset( new SfxItemIter( *pAutoSet ) );
pItem = pItemIter->GetCurItem();
}
}
@@ -1947,9 +1941,14 @@ BOOL SwTxtNode::GetAttr( SfxItemSet& rSet, xub_StrLen nStt, xub_StrLen nEnd,
while ( pItem )
{
const USHORT nHintWhich = pItem->Which();
+ ASSERT(!isUNKNOWNATR(nHintWhich),
+ "SwTxtNode::GetAttr(): unkonwn attribute?");
- if( !pAttrArr )
- pAttrArr = new std::vector< SwPoolItemEndPair >( coArrSz );
+ if ( !pAttrArr.get() )
+ {
+ pAttrArr.reset(
+ new std::vector< SwPoolItemEndPair >(coArrSz));
+ }
std::vector< SwPoolItemEndPair >::iterator pPrev = pAttrArr->begin();
if (isCHRATR(nHintWhich) ||
@@ -1957,12 +1956,6 @@ BOOL SwTxtNode::GetAttr( SfxItemSet& rSet, xub_StrLen nStt, xub_StrLen nEnd,
{
pPrev += nHintWhich - RES_CHRATR_BEGIN;
}
- else if (isUNKNOWNATR(nHintWhich))
- {
- pPrev += nHintWhich - RES_UNKNOWNATR_BEGIN + (
- static_cast< USHORT >(RES_TXTATR_WITHEND_END) -
- static_cast< USHORT >(RES_CHRATR_BEGIN) );
- }
else
{
pPrev = pAttrArr->end();
@@ -2006,28 +1999,21 @@ BOOL SwTxtNode::GetAttr( SfxItemSet& rSet, xub_StrLen nStt, xub_StrLen nEnd,
}
}
- pItem = ( pItemIter && !pItemIter->IsAtEnd() ) ? pItemIter->NextItem() : 0;
+ pItem = ( pItemIter.get() && !pItemIter->IsAtEnd() )
+ ? pItemIter->NextItem() : 0;
} // end while
-
- delete pItemIter;
}
}
- if( pAttrArr )
+ if ( pAttrArr.get() )
{
- for( n = 0; n < coArrSz; ++n )
+ for (USHORT n = 0; n < coArrSz; ++n)
{
const SwPoolItemEndPair& rItemPair = (*pAttrArr)[ n ];
if( (0 != rItemPair.mpItem) && ((SfxPoolItem*)-1 != rItemPair.mpItem) )
{
- USHORT nWh;
- if( n < static_cast<USHORT>( static_cast<USHORT>(RES_TXTATR_WITHEND_END) -
- static_cast<USHORT>(RES_CHRATR_BEGIN) ) )
- nWh = static_cast<USHORT>(n + RES_CHRATR_BEGIN);
- else
- nWh = n - static_cast<USHORT>( static_cast<USHORT>(RES_TXTATR_WITHEND_END) -
- static_cast<USHORT>(RES_CHRATR_BEGIN) +
- static_cast<USHORT>(RES_UNKNOWNATR_BEGIN) );
+ const USHORT nWh =
+ static_cast<USHORT>(n + RES_CHRATR_BEGIN);
if( nEnd <= rItemPair.mnEndPos ) // hinter oder genau Ende
{
@@ -2039,8 +2025,6 @@ BOOL SwTxtNode::GetAttr( SfxItemSet& rSet, xub_StrLen nStt, xub_StrLen nEnd,
rSet.InvalidateItem( nWh );
}
}
-
- delete pAttrArr;
}
}
if( aFmtSet.Count() )
diff --git a/sw/source/core/txtnode/txtatr2.cxx b/sw/source/core/txtnode/txtatr2.cxx
index 18db65d13dc8..afed4e1af732 100644
--- a/sw/source/core/txtnode/txtatr2.cxx
+++ b/sw/source/core/txtnode/txtatr2.cxx
@@ -31,7 +31,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include <hintids.hxx>
#include <hints.hxx>
#include <sfx2/objsh.hxx>
@@ -52,13 +51,6 @@
TYPEINIT1(SwTxtINetFmt,SwClient);
TYPEINIT1(SwTxtRuby,SwClient);
-// ATT_XMLCONTAINERITEM ******************************
-
-SwTxtXMLAttrContainer::SwTxtXMLAttrContainer(
- SvXMLAttrContainerItem& rAttr,
- xub_StrLen nStt, xub_StrLen nEnde )
- : SwTxtAttrEnd( rAttr, nStt, nEnde )
-{}
/*************************************************************************
* class SwTxtCharFmt
diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx
index b34d013f3264..03efd19df3e8 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -1676,6 +1676,7 @@ void SwTxtNode::ReplaceTextOnly( xub_StrLen nPos, xub_StrLen nLen,
void SwTxtNode::CountWords( SwDocStat& rStat,
xub_StrLen nStt, xub_StrLen nEnd ) const
{
+ ++rStat.nAllPara; // #i93174#: count _all_ paragraphs
if( nStt < nEnd )
{
if ( !IsHidden() )
diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx
index ffc831fe16e5..908fc480fe66 100644
--- a/sw/source/core/undo/rolbck.cxx
+++ b/sw/source/core/undo/rolbck.cxx
@@ -833,7 +833,7 @@ SwHistoryResetAttrSet::SwHistoryResetAttrSet( const SfxItemSet& rSet,
, m_Array( (BYTE)rSet.Count() )
{
SfxItemIter aIter( rSet );
- bool bAutoStyle = true;
+ bool bAutoStyle = false;
while( TRUE )
{
diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index 87522d4d59f8..3b090e875ea8 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -666,14 +666,9 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark,
{
if( !pHistory )
pHistory = new SwHistory;
- if( pAPos->nNode < pEnd->nNode &&
- ( ( nsDelCntntType::DELCNT_CHKNOCNTNT & nDelCntntType ) ||
- ( pStt->nNode < pAPos->nNode || !pStt->nContent.GetIndex() ) ) )
+ if (IsDestroyFrameAnchoredAtChar(
+ *pAPos, *pStt, *pEnd, nDelCntntType))
{
- // Here we identified the objects to destroy:
- // - anchored between start and end of the selection
- // - anchored in start of the selection with "CheckNoContent"
- // - anchored in start of sel. and the selection start at pos 0
pHistory->Add( *pFmt, nChainInsPos );
n = n >= rSpzArr.Count() ? rSpzArr.Count() : n+1;
}
@@ -1388,3 +1383,20 @@ String DenoteSpecialCharacters(const String & rStr)
return aResult;
}
+
+bool IsDestroyFrameAnchoredAtChar(SwPosition const & rAnchorPos,
+ SwPosition const & rStart, SwPosition const & rEnd,
+ DelCntntType const nDelCntntType)
+{
+
+ // Here we identified the objects to destroy:
+ // - anchored between start and end of the selection
+ // - anchored in start of the selection with "CheckNoContent"
+ // - anchored in start of sel. and the selection start at pos 0
+ return (rAnchorPos.nNode < rEnd.nNode)
+ && ( (nsDelCntntType::DELCNT_CHKNOCNTNT & nDelCntntType)
+ || (rStart.nNode < rAnchorPos.nNode)
+ || !rStart.nContent.GetIndex()
+ );
+}
+
diff --git a/sw/source/core/undo/unredln.cxx b/sw/source/core/undo/unredln.cxx
index e2cb9fb37428..21103ebb224d 100644
--- a/sw/source/core/undo/unredln.cxx
+++ b/sw/source/core/undo/unredln.cxx
@@ -247,6 +247,12 @@ void SwUndoRedlineSort::_Undo( SwUndoIter& rIter )
// im aSaveRange steht der kopierte, sprich der originale.
SwDoc& rDoc = rIter.GetDoc();
+ SwPosition* pStart = rIter.pAktPam->Start();
+ SwPosition* pEnd = rIter.pAktPam->End();
+
+ SwNodeIndex aPrevIdx( pStart->nNode, -1 );
+ ULONG nOffsetTemp = pEnd->nNode.GetIndex() - pStart->nNode.GetIndex();
+
if( 0 == ( nsRedlineMode_t::REDLINE_SHOW_DELETE & rDoc.GetRedlineMode()) )
{
// die beiden Redline Objecte suchen und diese dann anzeigen lassen,
@@ -254,17 +260,17 @@ void SwUndoRedlineSort::_Undo( SwUndoIter& rIter )
// das Geloeschte ist versteckt, also suche das INSERT
// Redline Object. Dahinter steht das Geloeschte
USHORT nFnd = rDoc.GetRedlinePos(
- *rDoc.GetNodes()[ nSttNode + nOffset + 1 ],
+ *rDoc.GetNodes()[ nSttNode + 1 ],
nsRedlineType_t::REDLINE_INSERT );
ASSERT( USHRT_MAX != nFnd && nFnd+1 < rDoc.GetRedlineTbl().Count(),
"kein Insert Object gefunden" );
++nFnd;
- rDoc.GetRedlineTbl()[nFnd]->Show();
- SetPaM( *rIter.pAktPam );
+ rDoc.GetRedlineTbl()[nFnd]->Show( 1 );
}
{
SwPaM aTmp( *rIter.pAktPam->GetMark() );
+ aTmp.GetMark()->nContent = 0;
aTmp.SetMark();
aTmp.GetPoint()->nNode = nSaveEndNode;
aTmp.GetPoint()->nContent.Assign( aTmp.GetCntntNode(), nSaveEndCntnt );
@@ -272,13 +278,52 @@ void SwUndoRedlineSort::_Undo( SwUndoIter& rIter )
}
rDoc.DelFullPara( *rIter.pAktPam );
+
+ SwPaM* pPam = rIter.pAktPam;
+ pPam->DeleteMark();
+ pPam->GetPoint()->nNode.Assign( aPrevIdx.GetNode(), +1 );
+ SwCntntNode* pCNd = pPam->GetCntntNode();
+ pPam->GetPoint()->nContent.Assign(pCNd, 0 );
+ pPam->SetMark();
+
+ pPam->GetPoint()->nNode += nOffsetTemp;
+ pCNd = pPam->GetCntntNode();
+ pPam->GetPoint()->nContent.Assign( pCNd, pCNd->Len() );
+
+ SetValues( *pPam );
+
SetPaM( *rIter.pAktPam );
}
void SwUndoRedlineSort::_Redo( SwUndoIter& rIter )
{
SwPaM& rPam = *rIter.pAktPam;
+
+ SwPaM* pPam = &rPam;
+ SwPosition* pStart = pPam->Start();
+ SwPosition* pEnd = pPam->End();
+
+ SwNodeIndex aPrevIdx( pStart->nNode, -1 );
+ ULONG nOffsetTemp = pEnd->nNode.GetIndex() - pStart->nNode.GetIndex();
+ xub_StrLen nCntStt = pStart->nContent.GetIndex();
+
rIter.GetDoc().SortText( rPam, *pOpt );
+
+ pPam->DeleteMark();
+ pPam->GetPoint()->nNode.Assign( aPrevIdx.GetNode(), +1 );
+ SwCntntNode* pCNd = pPam->GetCntntNode();
+ xub_StrLen nLen = pCNd->Len();
+ if( nLen > nCntStt )
+ nLen = nCntStt;
+ pPam->GetPoint()->nContent.Assign(pCNd, nLen );
+ pPam->SetMark();
+
+ pPam->GetPoint()->nNode += nOffsetTemp;
+ pCNd = pPam->GetCntntNode();
+ pPam->GetPoint()->nContent.Assign( pCNd, pCNd->Len() );
+
+ SetValues( rPam );
+
SetPaM( rPam );
rPam.GetPoint()->nNode = nSaveEndNode;
rPam.GetPoint()->nContent.Assign( rPam.GetCntntNode(), nSaveEndCntnt );
diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx
index 8c84dce7948a..194200bfad0c 100644
--- a/sw/source/core/unocore/unocrsrhelper.cxx
+++ b/sw/source/core/unocore/unocrsrhelper.cxx
@@ -1032,9 +1032,11 @@ void makeRedline( SwPaM& rPaM,
}
SwRedline* pRedline = new SwRedline( aRedlineData, rPaM );
+ RedlineMode_t nPrevMode = pRedlineAccess->GetRedlineMode( );
+
pRedlineAccess->SetRedlineMode_intern(nsRedlineMode_t::REDLINE_ON);
bool bRet = pRedlineAccess->AppendRedline( pRedline, false );
- pRedlineAccess->SetRedlineMode_intern(nsRedlineMode_t::REDLINE_NONE);
+ pRedlineAccess->SetRedlineMode_intern( nPrevMode );
if( !bRet )
throw lang::IllegalArgumentException();
}
diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx
index 11b3eae5a16a..f8256a7ada0b 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -2117,6 +2117,7 @@ void SwXShape::attach(const uno::Reference< text::XTextRange > & xTextRange)
OTextCursorHelper* pCursor = 0;
SwXTextPortion* pPortion = 0;
SwXText* pText = 0;
+ SwXParagraph* pParagraph = 0;
pRange = reinterpret_cast< SwXTextRange * >(
sal::static_int_cast< sal_IntPtr >( xRangeTunnel->getSomething( SwXTextRange::getUnoTunnelId()) ));
@@ -2126,6 +2127,8 @@ void SwXShape::attach(const uno::Reference< text::XTextRange > & xTextRange)
sal::static_int_cast< sal_IntPtr >( xRangeTunnel->getSomething( OTextCursorHelper::getUnoTunnelId()) ));
pPortion = reinterpret_cast< SwXTextPortion * >(
sal::static_int_cast< sal_IntPtr >( xRangeTunnel->getSomething( SwXTextPortion::getUnoTunnelId()) ));
+ pParagraph = reinterpret_cast< SwXParagraph * >(
+ sal::static_int_cast< sal_IntPtr >( xRangeTunnel->getSomething( SwXParagraph::getUnoTunnelId( ) ) ) );
if (pRange)
pDoc = pRange->GetDoc();
@@ -2137,6 +2140,8 @@ void SwXShape::attach(const uno::Reference< text::XTextRange > & xTextRange)
{
pDoc = pPortion->GetCursor()->GetDoc();
}
+ else if ( !pDoc && pParagraph && pParagraph->GetTxtNode( ) )
+ pDoc = pParagraph->GetTxtNode( )->GetDoc( );
}
diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx
index b7764778d31c..0d606ab2f50d 100644
--- a/sw/source/core/unocore/unoobj2.cxx
+++ b/sw/source/core/unocore/unoobj2.cxx
@@ -1192,6 +1192,12 @@ SwXTextRange::SwXTextRange(SwFrmFmt& rTblFmt) :
m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_CURSOR)),
pMark(NULL)
{
+ SwTable* pTable = SwTable::FindTable( &rTblFmt );
+ SwTableNode* pTblNode = pTable->GetTableNode( );
+ SwPosition aPosition( *pTblNode );
+ SwPaM aPam( aPosition );
+
+ _CreateNewBookmark( aPam );
}
SwXTextRange::~SwXTextRange()
diff --git a/sw/source/core/unocore/unoport.cxx b/sw/source/core/unocore/unoport.cxx
index 04d073a09df3..7071eb59731d 100644
--- a/sw/source/core/unocore/unoport.cxx
+++ b/sw/source/core/unocore/unoport.cxx
@@ -719,10 +719,6 @@ uno::Sequence< beans::GetDirectPropertyTolerantResult > SAL_CALL SwXTextPortion:
aResult.Result = beans::TolerantPropertySetResultType::SUCCESS;
aResultVector.push_back( aResult );
}
- // this assertion should never occur!
- DBG_ASSERT( !aResultVector.size() || aResult.Result != beans::TolerantPropertySetResultType::UNKNOWN_FAILURE,
- "unknown failure while retrieving property" );
-
}
}
catch (beans::UnknownPropertyException &)
diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx
index b49816d9c9e3..a8426cf8b438 100644
--- a/sw/source/core/unocore/unoportenum.cxx
+++ b/sw/source/core/unocore/unoportenum.cxx
@@ -831,7 +831,6 @@ lcl_ExportHints(
case RES_TXTATR_AUTOFMT:
case RES_TXTATR_INETFMT:
case RES_TXTATR_CHARFMT:
- case RES_TXTATR_UNKNOWN_CONTAINER:
break; // these are handled as properties of a "Text" portion
default:
DBG_ERROR("unknown attribute");
diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx
index 56e3cbacd822..7ae4b209f49f 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -66,6 +66,8 @@
#include <memory>
#include <stdlib.h>
+#include <iostream>
+
using namespace ::com::sun::star;
using ::rtl::OUString;
@@ -1827,19 +1829,11 @@ uno::Reference< text::XTextTable > SwXText::convertToTable(
*/
if(aStartCellPam.Start()->nNode < aEndCellPam.End()->nNode)
{
- const SwNode& rStartNode = aStartCellPam.Start()->nNode.GetNode();
- if(!rStartNode.IsTxtNode() ||
- !aEndCellPam.End()->nNode.GetNode().IsTxtNode())
- {
- //start and end of the cell must be on a SwTxtNode
- bExcept = true;
- break;
- }
// increment on each StartNode and decrement on each EndNode
// we must reach zero at the end and must not go below zero
long nOpenNodeBlock = 0;
SwNodeIndex aCellIndex = aStartCellPam.Start()->nNode;
- while( ++aCellIndex < aEndCellPam.End()->nNode.GetIndex())
+ while( aCellIndex < aEndCellPam.End()->nNode.GetIndex())
{
if( aCellIndex.GetNode().IsStartNode() )
++nOpenNodeBlock;
@@ -1850,6 +1844,7 @@ uno::Reference< text::XTextTable > SwXText::convertToTable(
bExcept = true;
break;
}
+ ++aCellIndex;
}
if( nOpenNodeBlock != 0)
{
@@ -1895,7 +1890,9 @@ uno::Reference< text::XTextTable > SwXText::convertToTable(
//node border anyway
}
else
+ {
bExcept = true;
+ }
}
//now check if there's a need to insert another paragraph break
if( aEndCellPam.End()->nContent.GetIndex() < aEndCellPam.End()->nNode.GetNode().GetTxtNode()->Len())
@@ -1952,7 +1949,22 @@ uno::Reference< text::XTextTable > SwXText::convertToTable(
const beans::PropertyValue* pTableProperties = rTableProperties.getConstArray();
sal_Int32 nProperty = 0;
for( ; nProperty < rTableProperties.getLength(); ++nProperty)
- xPrSet->setPropertyValue( pTableProperties[nProperty].Name, pTableProperties[nProperty].Value );
+ {
+ try
+ {
+ xPrSet->setPropertyValue( pTableProperties[nProperty].Name, pTableProperties[nProperty].Value );
+ }
+ catch ( const uno::Exception e )
+ {
+#if DEBUG
+ std::clog << "Exception when setting property: ";
+ std::clog << rtl::OUStringToOString( pTableProperties[nProperty].Name, RTL_TEXTENCODING_UTF8 ).getStr( );
+ std::clog << ". Message: ";
+ std::clog << rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_UTF8 ).getStr( );
+ std::clog << std::endl;
+#endif
+ }
+ }
//apply row properties
uno::Reference< table::XTableRows > xRows = xRet->getRows();
@@ -2009,6 +2021,7 @@ uno::Reference< text::XTextTable > SwXText::convertToTable(
//--<
#endif
+
//apply cell properties
for( nRow = 0; nRow < rCellProperties.getLength(); ++nRow)
{
@@ -2021,7 +2034,8 @@ uno::Reference< text::XTextTable > SwXText::convertToTable(
uno::Reference< beans::XPropertySet > xCell( pTextTable->getCellByPosition(nCell, nRow), uno::UNO_QUERY );
for( nProperty = 0; nProperty < nCellProperties; ++nProperty)
{
- if(aCellProperties[nProperty].Name.equalsAsciiL(
+ const OUString& rName = aCellProperties[nProperty].Name;
+ if( rName.equalsAsciiL(
RTL_CONSTASCII_STRINGPARAM ( "VerticalMerge")))
{
//determine left border position
@@ -2085,7 +2099,23 @@ uno::Reference< text::XTextTable > SwXText::convertToTable(
}
}
else
- xCell->setPropertyValue(aCellProperties[nProperty].Name, aCellProperties[nProperty].Value);
+ {
+ try
+ {
+ xCell->setPropertyValue(rName, aCellProperties[nProperty].Value);
+ }
+ catch ( const uno::Exception e )
+ {
+ // Apply the paragraph and char properties to the cell's content
+ uno::Reference< text::XText > xCellText( xCell, uno::UNO_QUERY );
+ uno::Reference< text::XTextCursor > xCellCurs = xCellText->createTextCursor( );
+ xCellCurs->gotoStart( false );
+ xCellCurs->gotoEnd( true );
+
+ uno::Reference< beans::XPropertySet > xCellTextProps( xCellCurs, uno::UNO_QUERY );
+ xCellTextProps->setPropertyValue( rName, aCellProperties[nProperty].Value );
+ }
+ }
}
}
}
diff --git a/sw/source/filter/basflt/shellio.cxx b/sw/source/filter/basflt/shellio.cxx
index aaa640de0ef4..e21433271845 100644
--- a/sw/source/filter/basflt/shellio.cxx
+++ b/sw/source/filter/basflt/shellio.cxx
@@ -158,7 +158,7 @@ ULONG SwReader::Read( const Reader& rOptions )
SwNodeIndex aSplitIdx( pDoc->GetNodes() );
RedlineMode_t eOld = pDoc->GetRedlineMode();
- pDoc->SetRedlineMode_intern( nsRedlineMode_t::REDLINE_IGNORE );
+ RedlineMode_t ePostReadRedlineMode( nsRedlineMode_t::REDLINE_IGNORE );
// Array von FlyFormaten
SwSpzFrmFmts aFlyFrmArr;
@@ -170,6 +170,8 @@ ULONG SwReader::Read( const Reader& rOptions )
if( bSaveUndo )
pUndo = new SwUndoInsDoc( *pPam );
+ pDoc->SetRedlineMode_intern( nsRedlineMode_t::REDLINE_IGNORE );
+
SwPaM* pUndoPam = 0;
if( bDocUndo || pCrsr )
{
@@ -190,8 +192,15 @@ ULONG SwReader::Read( const Reader& rOptions )
xub_StrLen nEndCntnt = pCNd ? pCNd->Len() - nSttCntnt : 0;
SwNodeIndex aEndPos( pPam->GetPoint()->nNode, 1 );
+ pDoc->SetRedlineMode_intern( eOld );
+
nError = po->Read( *pDoc, GetBaseURL(), *pPam, aFileName );
+ // an ODF document may contain redline mode in settings.xml; save it!
+ ePostReadRedlineMode = pDoc->GetRedlineMode();
+
+ pDoc->SetRedlineMode_intern( nsRedlineMode_t::REDLINE_IGNORE );
+
if( !IsError( nError )) // dann setzen wir das Ende mal richtig
{
aEndPos--;
@@ -230,13 +239,27 @@ ULONG SwReader::Read( const Reader& rOptions )
const SwFmtAnchor& rAnchor = pFrmFmt->GetAnchor();
if( USHRT_MAX == aFlyFrmArr.GetPos( pFrmFmt) )
{
- if( FLY_PAGE == rAnchor.GetAnchorId() ||
- ( FLY_AT_CNTNT == rAnchor.GetAnchorId() &&
- rAnchor.GetCntntAnchor() &&
- ( pUndoPam->GetPoint()->nNode ==
- rAnchor.GetCntntAnchor()->nNode ||
- pUndoPam->GetMark()->nNode ==
- rAnchor.GetCntntAnchor()->nNode ) ) )
+ SwPosition const*const pFrameAnchor(
+ rAnchor.GetCntntAnchor());
+ if ( (FLY_PAGE == rAnchor.GetAnchorId())
+ || ( pFrameAnchor
+ && ( ( (FLY_AT_CNTNT == rAnchor.GetAnchorId())
+ && ( (pUndoPam->GetPoint()->nNode ==
+ pFrameAnchor->nNode)
+ || (pUndoPam->GetMark()->nNode ==
+ pFrameAnchor->nNode)
+ )
+ )
+ // #i97570# also check frames anchored AT char
+ || ( (FLY_AUTO_CNTNT == rAnchor.GetAnchorId())
+ && !IsDestroyFrameAnchoredAtChar(
+ *pFrameAnchor,
+ *pUndoPam->GetPoint(),
+ *pUndoPam->GetMark())
+ )
+ )
+ )
+ )
{
if( bChkHeaderFooter &&
FLY_AT_CNTNT == rAnchor.GetAnchorId() &&
@@ -351,7 +374,9 @@ ULONG SwReader::Read( const Reader& rOptions )
pDoc->UpdateLinks( TRUE );
// <--
- eOld = (RedlineMode_t)(pDoc->GetRedlineMode() & ~nsRedlineMode_t::REDLINE_IGNORE);
+ // not insert: set the redline mode read from settings.xml
+ eOld = static_cast<RedlineMode_t>(
+ ePostReadRedlineMode & ~nsRedlineMode_t::REDLINE_IGNORE);
pDoc->SetFieldsDirty(false, NULL, 0);
}
diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx
index 0c2a5cec8f71..cd3c5d1734d4 100644
--- a/sw/source/filter/xml/xmlexp.cxx
+++ b/sw/source/filter/xml/xmlexp.cxx
@@ -41,13 +41,9 @@
#include <com/sun/star/xforms/XFormsSupplier.hpp>
#include <svx/svdmodel.hxx>
#include <svx/svdpage.hxx>
-#ifndef _XMLGRHLP_HXX
-#ifndef _XMLGRHLP_HXX
#include <svx/xmlgrhlp.hxx>
-#endif
#include <svx/xmleohlp.hxx>
#include <svx/xmlgrhlp.hxx>
-#endif
#include <svx/eeitem.hxx>
#include <svx/svddef.hxx>
#include <xmloff/nmspmap.hxx>
@@ -66,9 +62,7 @@
#include <xmltexte.hxx>
#include <xmlexp.hxx>
#include <sfx2/viewsh.hxx>
-#ifndef _COMPHELPER_PROCESSFACTORYHXX_
#include <comphelper/processfactory.hxx>
-#endif
#include <docary.hxx>
#include <svx/unolingu.hxx>
#include <svx/forbiddencharacterstable.hxx>
@@ -326,13 +320,15 @@ sal_uInt32 SwXMLExport::exportDoc( enum XMLTokenEnum eClass )
// figures given above
// The styles in pDoc also count the default style that never
// gets exported -> subtract one.
- sal_Int32 nRef = 1;
+ sal_Int32 nRef = 1; // meta.xml
nRef += pDoc->GetCharFmts()->Count() - 1;
nRef += pDoc->GetFrmFmts()->Count() - 1;
nRef += pDoc->GetTxtFmtColls()->Count() - 1;
// nRef += pDoc->GetPageDescCnt();
- nRef += aDocStat.nPara;
- pProgress->SetReference( 2*nRef );
+ nRef *= 2; // for the above styles, xmloff will increment by 2!
+ // #i93174#: count all paragraphs for the progress bar
+ nRef += aDocStat.nAllPara; // 1: only content, no autostyle
+ pProgress->SetReference( nRef );
pProgress->SetValue( 0 );
}
}
diff --git a/sw/source/filter/xml/xmlfmte.cxx b/sw/source/filter/xml/xmlfmte.cxx
index f4a4a676c9a2..8a2586392a30 100644
--- a/sw/source/filter/xml/xmlfmte.cxx
+++ b/sw/source/filter/xml/xmlfmte.cxx
@@ -38,16 +38,11 @@
#include "xmlexpit.hxx"
#include <xmloff/nmspmap.hxx>
#include <xmloff/XMLTextListAutoStylePool.hxx>
-#ifndef _XMLOFF_XMLTEXTMASTERPAGEEXPORT
#include <xmloff/XMLTextMasterPageExport.hxx>
-#endif
-#ifndef _XMLOFF_TXTPRMAP_HXX
#include <xmloff/txtprmap.hxx>
-#endif
#include <xmloff/xmlaustp.hxx>
#include <xmloff/families.hxx>
-#include <xmloff/ProgressBarHelper.hxx>
#include <format.hxx>
#include <fmtpdsc.hxx>
#include <pagedesc.hxx>
@@ -58,6 +53,7 @@
#include "xmlexp.hxx"
#include <SwStyleNameMapper.hxx>
+
using ::rtl::OUString;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::uno;
diff --git a/sw/source/ui/fldui/fldfunc.cxx b/sw/source/ui/fldui/fldfunc.cxx
index 1531df836622..8603497ecaca 100644
--- a/sw/source/ui/fldui/fldfunc.cxx
+++ b/sw/source/ui/fldui/fldfunc.cxx
@@ -460,7 +460,7 @@ IMPL_LINK( SwFldFuncPage, ListModifyHdl, Control*, pControl)
{
aListItemsLB.SetUpdateMode(FALSE);
if(pControl == &aListAddPB ||
- pControl == &aListItemED && aListAddPB.IsEnabled())
+ (pControl == &aListItemED && aListAddPB.IsEnabled()))
{
String sEntry(aListItemED.GetText());
aListItemsLB.InsertEntry(sEntry);
diff --git a/sw/source/ui/uno/unomod.cxx b/sw/source/ui/uno/unomod.cxx
index bfdb2b1d2460..ed6d61898804 100644
--- a/sw/source/ui/uno/unomod.cxx
+++ b/sw/source/ui/uno/unomod.cxx
@@ -576,17 +576,17 @@ void SwXPrintSettings::_getSingleValue( const comphelper::PropertyInfo & rInfo,
break;
case HANDLE_PRINTSET_PROSPECT_RTL:
{
- rValue <<= mpPrtOpt->IsPrintProspect_RTL();
+ bBoolVal = mpPrtOpt->IsPrintProspect_RTL();
}
break;
case HANDLE_PRINTSET_PLACEHOLDER:
{
- rValue <<= mpPrtOpt->IsPrintTextPlaceholder();
+ bBoolVal = mpPrtOpt->IsPrintTextPlaceholder();
}
break;
case HANDLE_PRINTSET_HIDDEN_TEXT:
{
- rValue <<= mpPrtOpt->IsPrintHiddenText();
+ bBoolVal = mpPrtOpt->IsPrintHiddenText();
}
break;
default:
diff --git a/sw/source/ui/utlui/navipi.cxx b/sw/source/ui/utlui/navipi.cxx
index 78fc237f8b20..4776ae5b6bdc 100644
--- a/sw/source/ui/utlui/navipi.cxx
+++ b/sw/source/ui/utlui/navipi.cxx
@@ -1034,8 +1034,8 @@ void SwNavigationPI::StateChanged( USHORT nSID, SfxItemState /*eState*/,
aContentTree.SetActiveShell(pWrtShell);
BOOL bGlobal = IsGlobalDoc();
aContentToolBox.EnableItem(FN_GLOBAL_SWITCH, bGlobal);
- if(!bGlobal && IsGlobalMode() ||
- !IsGlobalMode() && pConfig->IsGlobalActive())
+ if( (!bGlobal && IsGlobalMode()) ||
+ (!IsGlobalMode() && pConfig->IsGlobalActive()) )
{
ToggleTree();
}
diff --git a/testtools/com/sun/star/comp/bridge/TestComponent.java b/testtools/com/sun/star/comp/bridge/TestComponent.java
index aaaa2cb8ae10..3a3c60b8146d 100644
--- a/testtools/com/sun/star/comp/bridge/TestComponent.java
+++ b/testtools/com/sun/star/comp/bridge/TestComponent.java
@@ -47,12 +47,17 @@ import test.testtools.bridgetest.TestEnum;
import test.testtools.bridgetest.TestPolyStruct;
import test.testtools.bridgetest.TestPolyStruct2;
import test.testtools.bridgetest.TestStruct;
+import test.testtools.bridgetest.SmallStruct;
+import test.testtools.bridgetest.MediumStruct;
+import test.testtools.bridgetest.BigStruct;
+import test.testtools.bridgetest.AllFloats;
import test.testtools.bridgetest.XBridgeTest;
import test.testtools.bridgetest.XBridgeTest2;
import test.testtools.bridgetest.XCurrentContextChecker;
import test.testtools.bridgetest.XMulti;
import test.testtools.bridgetest.XRecursiveCall;
+
import com.sun.star.lang.IllegalArgumentException;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.lang.XSingleServiceFactory;
@@ -474,6 +479,22 @@ public class TestComponent {
return _testDataElements;
}
+ public SmallStruct echoSmallStruct( SmallStruct i_Struct) throws com.sun.star.uno.RuntimeException {
+ return i_Struct;
+ }
+
+ public MediumStruct echoMediumStruct( MediumStruct i_Struct) throws com.sun.star.uno.RuntimeException {
+ return i_Struct;
+ }
+
+ public BigStruct echoBigStruct( BigStruct i_Struct) throws com.sun.star.uno.RuntimeException {
+ return i_Struct;
+ }
+
+ public AllFloats echoAllFloats( AllFloats i_Struct) throws com.sun.star.uno.RuntimeException {
+ return i_Struct;
+ }
+
// Attributes
public boolean getBool() throws com.sun.star.uno.RuntimeException {
return _bool;
diff --git a/testtools/source/bridgetest/bridgetest.cxx b/testtools/source/bridgetest/bridgetest.cxx
index d8b3a120bf68..45edf5f53392 100644
--- a/testtools/source/bridgetest/bridgetest.cxx
+++ b/testtools/source/bridgetest/bridgetest.cxx
@@ -32,6 +32,7 @@
#include "precompiled_testtools.hxx"
#include <stdio.h>
+#include <string.h>
#include <osl/diagnose.h>
#include "osl/diagnose.hxx"
#include <osl/time.h>
@@ -533,6 +534,27 @@ static sal_Bool performTest(
bRet = check( equals( aData, aRet ) && equals( aData, aRet2 ) , "struct comparison test") && bRet;
+ {
+ SmallStruct aIn(1, 2);
+ SmallStruct aOut = xLBT->echoSmallStruct(aIn);
+ bRet = check( memcmp(&aIn, &aOut, sizeof(SmallStruct)) == 0, "small struct test" ) && bRet;
+ }
+ {
+ MediumStruct aIn(1, 2, 3, 4);
+ MediumStruct aOut = xLBT->echoMediumStruct(aIn);
+ bRet = check( memcmp(&aIn, &aOut, sizeof(MediumStruct)) == 0, "medium struct test" ) && bRet;
+ }
+ {
+ BigStruct aIn(1, 2, 3, 4, 5, 6, 7, 8);
+ BigStruct aOut = xLBT->echoBigStruct(aIn);
+ bRet = check( memcmp(&aIn, &aOut, sizeof(BigStruct)) == 0, "big struct test" ) && bRet;
+ }
+ {
+ AllFloats aIn(1.1f, 2.2f, 3.3f, 4.4f);
+ AllFloats aOut = xLBT->echoAllFloats(aIn);
+ bRet = check( memcmp(&aIn, &aOut, sizeof(AllFloats)) == 0, "all floats struct test" ) && bRet;
+ }
+
// Test extended attributes that raise exceptions:
try {
xLBT->getRaiseAttr1();
diff --git a/testtools/source/bridgetest/cli/cli_cs_testobj.cs b/testtools/source/bridgetest/cli/cli_cs_testobj.cs
index 5cff3c9d53a9..2f1c9dde78f6 100644
--- a/testtools/source/bridgetest/cli/cli_cs_testobj.cs
+++ b/testtools/source/bridgetest/cli/cli_cs_testobj.cs
@@ -227,6 +227,26 @@ public class BridgeTestObject : WeakBase, XRecursiveCall, XBridgeTest2
return _testDataElements;
}
+ public SmallStruct echoSmallStruct(/*[in]*/SmallStruct arg)
+ {
+ return arg;
+ }
+
+ public MediumStruct echoMediumStruct(/*[in]*/MediumStruct arg)
+ {
+ return arg;
+ }
+
+ public BigStruct echoBigStruct(/*[in]*/BigStruct arg)
+ {
+ return arg;
+ }
+
+ public AllFloats echoAllFloats(/*[in]*/AllFloats arg)
+ {
+ return arg;
+ }
+
// Attributes
public bool Bool
{
diff --git a/testtools/source/bridgetest/cli/cli_vb_testobj.vb b/testtools/source/bridgetest/cli/cli_vb_testobj.vb
index 1d9482a07b58..a03291f666af 100644
--- a/testtools/source/bridgetest/cli/cli_vb_testobj.vb
+++ b/testtools/source/bridgetest/cli/cli_vb_testobj.vb
@@ -200,7 +200,7 @@ Public Class VBBridgeTestObject
Return m_testDataElements
End Function
-
+
' Attributes ---------------------------------------------------------
Public Overridable Property Bool As Boolean _
Implements XBridgeTest2.Bool
diff --git a/testtools/source/bridgetest/cppobj.cxx b/testtools/source/bridgetest/cppobj.cxx
index eedbf54454f3..9a8a6508a069 100644
--- a/testtools/source/bridgetest/cppobj.cxx
+++ b/testtools/source/bridgetest/cppobj.cxx
@@ -217,6 +217,15 @@ public:
TestData& rStruct )
throw(com::sun::star::uno::RuntimeException);
+ virtual SmallStruct SAL_CALL echoSmallStruct(const SmallStruct& rStruct) throw(com::sun::star::uno::RuntimeException)
+ { return rStruct; }
+ virtual MediumStruct SAL_CALL echoMediumStruct(const MediumStruct& rStruct) throw(com::sun::star::uno::RuntimeException)
+ { return rStruct; }
+ virtual BigStruct SAL_CALL echoBigStruct(const BigStruct& rStruct) throw(com::sun::star::uno::RuntimeException)
+ { return rStruct; }
+ virtual AllFloats SAL_CALL echoAllFloats(const AllFloats& rStruct) throw(com::sun::star::uno::RuntimeException)
+ { return rStruct; }
+
virtual sal_Bool SAL_CALL getBool() throw(com::sun::star::uno::RuntimeException)
{ return _aData.Bool; }
virtual sal_Int8 SAL_CALL getByte() throw(com::sun::star::uno::RuntimeException)
diff --git a/testtools/source/bridgetest/idl/bridgetest.idl b/testtools/source/bridgetest/idl/bridgetest.idl
index fce8c1a21adc..206956755ee1 100644
--- a/testtools/source/bridgetest/idl/bridgetest.idl
+++ b/testtools/source/bridgetest/idl/bridgetest.idl
@@ -72,6 +72,48 @@ struct TestSimple
TestEnum Enum;
};
/**
+ * equal to max size returned in registers on x86_64
+ */
+struct SmallStruct
+{
+ hyper a;
+ hyper b;
+};
+/**
+ * equal to max size returned in registers on ia64
+ */
+struct MediumStruct
+{
+ hyper a;
+ hyper b;
+ hyper c;
+ hyper d;
+};
+/**
+ * bigger than max size returned in registers on ia64
+ */
+struct BigStruct
+{
+ hyper a;
+ hyper b;
+ hyper c;
+ hyper d;
+ hyper e;
+ hyper f;
+ hyper g;
+ hyper h;
+};
+/**
+ * all floats, ia64 handles them specially
+ */
+struct AllFloats
+{
+ float a;
+ float b;
+ float c;
+ float d;
+};
+/**
* complex types adding string, inteface, any
*/
struct TestElement : TestSimple
@@ -207,6 +249,26 @@ interface XBridgeTestBase : com::sun::star::uno::XInterface
[out] sequence< TestElement > aSequence,
[out] TestData aStruct );
+ /**
+ * register return test 1
+ */
+ SmallStruct echoSmallStruct( [in] SmallStruct aStruct );
+
+ /**
+ * register return test 2
+ */
+ MediumStruct echoMediumStruct( [in] MediumStruct aStruct );
+
+ /**
+ * register return test 3
+ */
+ BigStruct echoBigStruct( [in] BigStruct aStruct );
+
+ /**
+ * register return test 4
+ */
+ AllFloats echoAllFloats( [in] AllFloats aStruct );
+
[attribute] boolean Bool;
[attribute] byte Byte;
[attribute] char Char;
diff --git a/testtools/source/bridgetest/makefile.mk b/testtools/source/bridgetest/makefile.mk
index 3dfb18c7dd4d..f9c952d4d40e 100644
--- a/testtools/source/bridgetest/makefile.mk
+++ b/testtools/source/bridgetest/makefile.mk
@@ -52,7 +52,6 @@ GIVE_EXEC_RIGHTS=@echo
MY_URE_INTERNAL_JAVA_DIR=$(strip $(subst,\,/ file:///$(shell @$(WRAPCMD) echo $(SOLARBINDIR))))
MY_LOCAL_CLASSDIR=$(strip $(subst,\,/ file:///$(shell $(WRAPCMD) echo $(PWD)$/$(CLASSDIR))))
.ELSE
-BATCH_INPROCESS=bridgetest_inprocess
GIVE_EXEC_RIGHTS=chmod +x
MY_URE_INTERNAL_JAVA_DIR=file://$(SOLARBINDIR)
MY_LOCAL_CLASSDIR=file://$(PWD)$/$(CLASSDIR)
@@ -134,37 +133,33 @@ JAVATARGETS=\
.INCLUDE : target.mk
.IF "$(L10N_framework)"==""
ALLTAR: \
- test \
+ runtest \
$(DLLDEST)$/uno_types.rdb \
$(DLLDEST)$/uno_services.rdb \
- $(DLLDEST)$/bridgetest_inprocess$(BATCH_SUFFIX) \
$(DLLDEST)$/bridgetest_server$(BATCH_SUFFIX) \
$(DLLDEST)$/bridgetest_client$(BATCH_SUFFIX) \
$(JAVATARGETS)
#################################################################
-test:
- echo $(compcheck)
+runtest : $(DLLDEST)$/uno_types.rdb $(DLLDEST)$/uno_services.rdb makefile.mk
+.IF "$(COM)$(OS)$(CPU)" == "GCCMACOSXP"
+ @echo "Mac OSX PPC GCC fails this test!, likely broken UNO bridge. Fix me."
+.ELSE
+ cd $(DLLDEST) && $(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/uno \
+ -ro uno_services.rdb -ro uno_types.rdb \
+ -s com.sun.star.test.bridge.BridgeTest -- \
+ com.sun.star.test.bridge.CppTestObject
+.ENDIF
$(DLLDEST)$/uno_types.rdb : $(SOLARBINDIR)$/udkapi.rdb
echo $(DLLDEST)
$(GNUCOPY) $? $@
$(REGMERGE) $@ / $(BIN)$/bridgetest.rdb
-$(DLLDEST)$/bridgetest_inprocess$(BATCH_SUFFIX) .ERRREMOVE: makefile.mk
-.IF "$(USE_SHELL)" == "bash"
- echo '$(AUGMENT_LIBRARY_PATH)' uno -ro uno_services.rdb -ro uno_types.rdb \
- -s com.sun.star.test.bridge.BridgeTest -- \
- com.sun.star.test.bridge.CppTestObject > $@
-.ELSE
- echo ERROR: this script can only be created properly for USE_SHELL=bash > $@
-.ENDIF
- $(GIVE_EXEC_RIGHTS) $@
-
$(DLLDEST)$/bridgetest_client$(BATCH_SUFFIX) .ERRREMOVE: makefile.mk
.IF "$(USE_SHELL)" == "bash"
- echo '$(AUGMENT_LIBRARY_PATH)' uno -ro uno_services.rdb -ro uno_types.rdb \
+ echo '$(AUGMENT_LIBRARY_PATH)' '$(SOLARBINDIR)'/uno -ro uno_services.rdb -ro uno_types.rdb \
-s com.sun.star.test.bridge.BridgeTest -- \
-u \''uno:socket,host=127.0.0.1,port=2002;urp;test'\' > $@
.ELSE
@@ -174,7 +169,7 @@ $(DLLDEST)$/bridgetest_client$(BATCH_SUFFIX) .ERRREMOVE: makefile.mk
$(DLLDEST)$/bridgetest_server$(BATCH_SUFFIX) .ERRREMOVE: makefile.mk
.IF "$(USE_SHELL)" == "bash"
- echo '$(AUGMENT_LIBRARY_PATH)' uno -ro uno_services.rdb -ro uno_types.rdb \
+ echo '$(AUGMENT_LIBRARY_PATH)' '$(SOLARBINDIR)'/uno -ro uno_services.rdb -ro uno_types.rdb \
-s com.sun.star.test.bridge.CppTestObject \
-u \''uno:socket,host=127.0.0.1,port=2002;urp;test'\' --singleaccept \
> $@
@@ -201,7 +196,7 @@ $(DLLDEST)$/bridgetest_javaserver$(BATCH_SUFFIX) : makefile.mk
$(DLLDEST)$/bridgetest_inprocess_java$(BATCH_SUFFIX) .ERRREMOVE: makefile.mk
.IF "$(USE_SHELL)" == "bash"
- echo '$(AUGMENT_LIBRARY_PATH)' uno -ro uno_services.rdb -ro uno_types.rdb \
+ echo '$(AUGMENT_LIBRARY_PATH)' '$(SOLARBINDIR)'/uno -ro uno_services.rdb -ro uno_types.rdb \
-s com.sun.star.test.bridge.BridgeTest \
-env:URE_INTERNAL_JAVA_DIR=$(MY_URE_INTERNAL_JAVA_DIR) \
-- com.sun.star.test.bridge.JavaTestObject noCurrentContext > $@
diff --git a/testtools/source/bridgetest/pyuno/makefile.mk b/testtools/source/bridgetest/pyuno/makefile.mk
index 44b9f98603b7..bffce7689d1e 100644
--- a/testtools/source/bridgetest/pyuno/makefile.mk
+++ b/testtools/source/bridgetest/pyuno/makefile.mk
@@ -50,8 +50,17 @@ DOLLAR_SIGN=\$$
DOLLAR_SIGN=$$
.ENDIF
-#these are temporary
-PYTHON=$(WRAPCMD) python
+.IF "$(SYSTEM_PYTHON)"!="YES"
+PYTHON=$(AUGMENT_LIBRARY_PATH) $(WRAPCMD) $(SOLARBINDIR)/python
+.ELSE # "$(SYSTEM_PYTHON)"!="YES"
+PYTHON=$(AUGMENT_LIBRARY_PATH) $(WRAPCMD) python
+.ENDIF # "$(SYSTEM_PYTHON)"!="YES"
+.IF "$(GUI)"=="WNT"
+PYTHONPATH:=$(SOLARLIBDIR)$/pyuno;$(PWD);$(SOLARLIBDIR);$(SOLARLIBDIR)$/python;$(SOLARLIBDIR)$/python$/lib-dynload
+.ELSE # "$(GUI)"=="WNT"
+PYTHONPATH:=$(SOLARLIBDIR)$/pyuno:$(PWD):$(SOLARLIBDIR):$(SOLARLIBDIR)$/python:$(SOLARLIBDIR)$/python$/lib-dynload
+.ENDIF # "$(GUI)"=="WNT"
+.EXPORT: PYTHONPATH
.IF "$(GUI)"!="WNT" && "$(GUI)"!="OS2"
.IF "$(USE_SHELL)"=="bash"
@@ -111,7 +120,7 @@ doc .PHONY:
@echo start test with dmake runtest
runtest : ALL
- cd $(DLLDEST) && $(TEST_ENV) && python main.py
+ cd $(DLLDEST) && $(TEST_ENV) && $(PYTHON) main.py
cd $(DLLDEST) && $(TEST_ENV) && $(WRAPCMD) $(REGCOMP) -register -br pyuno_regcomp.rdb -r dummy.rdb \
-l com.sun.star.loader.Python $(foreach,i,$(PYCOMPONENTS) -c vnd.openoffice.pymodule:$(i))
cd $(DLLDEST) && $(TEST_ENV) && $(WRAPCMD) $(REGCOMP) -register -br pyuno_regcomp.rdb -r dummy2.rdb \
diff --git a/toolkit/inc/toolkit/helper/property.hxx b/toolkit/inc/toolkit/helper/property.hxx
index fbfe90494279..f82df1f5b53f 100644
--- a/toolkit/inc/toolkit/helper/property.hxx
+++ b/toolkit/inc/toolkit/helper/property.hxx
@@ -197,6 +197,7 @@ namespace rtl {
#define BASEPROPERTY_GRID_COLUMNMODEL 143
#define BASEPROPERTY_GRID_SELECTIONMODE 144
#define BASEPROPERTY_ENABLEVISIBLE 145 // sal_Bool
+#define BASEPROPERTY_REFERENCE_DEVICE 146
// Keine gebundenen Properties, werden immer aus der Property BASEPROPERTY_FONTDESCRIPTOR entnommen.
diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx
index 9ca21c5fb36b..3d2069ab8385 100644
--- a/toolkit/source/awt/vclxwindow.cxx
+++ b/toolkit/source/awt/vclxwindow.cxx
@@ -64,6 +64,7 @@
#include <vcl/dockwin.hxx>
#include <vcl/pdfextoutdevdata.hxx>
#include <vcl/tabpage.hxx>
+#include <vcl/button.hxx>
#include <comphelper/asyncnotification.hxx>
#include <toolkit/helper/solarrelease.hxx>
@@ -76,6 +77,7 @@ using ::com::sun::star::uno::UNO_QUERY;
using ::com::sun::star::lang::EventObject;
using ::com::sun::star::awt::XWindowListener2;
using ::com::sun::star::awt::XDockableWindowListener;
+using ::com::sun::star::awt::XDevice;
using ::com::sun::star::style::VerticalAlignment;
using ::com::sun::star::style::VerticalAlignment_TOP;
using ::com::sun::star::style::VerticalAlignment_MIDDLE;
@@ -1585,6 +1587,18 @@ void VCLXWindow::setProperty( const ::rtl::OUString& PropertyName, const ::com::
sal_uInt16 nPropType = GetPropertyId( PropertyName );
switch ( nPropType )
{
+ case BASEPROPERTY_REFERENCE_DEVICE:
+ {
+ Control* pControl = dynamic_cast< Control* >( pWindow );
+ OSL_ENSURE( pControl, "VCLXWindow::setProperty( RefDevice ): need a Control for this!" );
+ if ( !pControl )
+ break;
+ Reference< XDevice > xDevice( Value, UNO_QUERY );
+ OutputDevice* pDevice = VCLUnoHelper::GetOutputDevice( xDevice );
+ pControl->SetReferenceDevice( pDevice );
+ }
+ break;
+
case BASEPROPERTY_CONTEXT_WRITING_MODE:
{
OSL_VERIFY( Value >>= mpImpl->mnContextWritingMode );
@@ -2103,6 +2117,19 @@ void VCLXWindow::setProperty( const ::rtl::OUString& PropertyName, const ::com::
sal_uInt16 nPropType = GetPropertyId( PropertyName );
switch ( nPropType )
{
+ case BASEPROPERTY_REFERENCE_DEVICE:
+ {
+ Control* pControl = dynamic_cast< Control* >( GetWindow() );
+ OSL_ENSURE( pControl, "VCLXWindow::setProperty( RefDevice ): need a Control for this!" );
+ if ( !pControl )
+ break;
+
+ VCLXDevice* pDevice = new VCLXDevice;
+ pDevice->SetOutputDevice( pControl->GetReferenceDevice() );
+ aProp <<= Reference< XDevice >( pDevice );
+ }
+ break;
+
case BASEPROPERTY_CONTEXT_WRITING_MODE:
aProp <<= mpImpl->mnContextWritingMode;
break;
diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx
index b49fa1a621d6..ff5dd437ef52 100644
--- a/toolkit/source/awt/vclxwindows.cxx
+++ b/toolkit/source/awt/vclxwindows.cxx
@@ -408,6 +408,7 @@ void VCLXButton::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
BASEPROPERTY_VERTICALALIGN,
BASEPROPERTY_WRITING_MODE,
BASEPROPERTY_CONTEXT_WRITING_MODE,
+ BASEPROPERTY_REFERENCE_DEVICE,
0);
VCLXImageConsumer::ImplGetPropertyIds( rIds );
}
@@ -817,6 +818,7 @@ void VCLXCheckBox::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
BASEPROPERTY_VERTICALALIGN,
BASEPROPERTY_WRITING_MODE,
BASEPROPERTY_CONTEXT_WRITING_MODE,
+ BASEPROPERTY_REFERENCE_DEVICE,
0);
VCLXImageConsumer::ImplGetPropertyIds( rIds );
}
@@ -1116,6 +1118,7 @@ void VCLXRadioButton::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
BASEPROPERTY_VERTICALALIGN,
BASEPROPERTY_WRITING_MODE,
BASEPROPERTY_CONTEXT_WRITING_MODE,
+ BASEPROPERTY_REFERENCE_DEVICE,
0);
VCLXImageConsumer::ImplGetPropertyIds( rIds );
}
@@ -1540,6 +1543,7 @@ void VCLXListBox::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
BASEPROPERTY_ALIGN,
BASEPROPERTY_WRITING_MODE,
BASEPROPERTY_CONTEXT_WRITING_MODE,
+ BASEPROPERTY_REFERENCE_DEVICE,
BASEPROPERTY_MOUSE_WHEEL_BEHAVIOUR,
0);
VCLXWindow::ImplGetPropertyIds( rIds );
@@ -2759,6 +2763,7 @@ void VCLXFixedText::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
BASEPROPERTY_VERTICALALIGN,
BASEPROPERTY_WRITING_MODE,
BASEPROPERTY_CONTEXT_WRITING_MODE,
+ BASEPROPERTY_REFERENCE_DEVICE,
0);
VCLXWindow::ImplGetPropertyIds( rIds );
}
@@ -3762,6 +3767,7 @@ void VCLXComboBox::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
BASEPROPERTY_ALIGN,
BASEPROPERTY_WRITING_MODE,
BASEPROPERTY_CONTEXT_WRITING_MODE,
+ BASEPROPERTY_REFERENCE_DEVICE,
BASEPROPERTY_MOUSE_WHEEL_BEHAVIOUR,
0);
// no, don't call VCLXEdit here - it has properties which we do *not* want to have at at combo box
diff --git a/toolkit/source/controls/unocontrolmodel.cxx b/toolkit/source/controls/unocontrolmodel.cxx
index cc5faa27eec8..a4febcd33b33 100644
--- a/toolkit/source/controls/unocontrolmodel.cxx
+++ b/toolkit/source/controls/unocontrolmodel.cxx
@@ -38,6 +38,7 @@
#include <com/sun/star/awt/FontSlant.hpp>
#include <com/sun/star/awt/MouseWheelBehavior.hpp>
#include <com/sun/star/graphic/XGraphicProvider.hpp>
+#include <com/sun/star/awt/XDevice.hpp>
#include <com/sun/star/text/WritingMode2.hpp>
#include <com/sun/star/io/XMarkableStream.hpp>
#include <toolkit/controls/unocontrolmodel.hxx>
@@ -262,7 +263,11 @@ void UnoControlModel::ImplPropertyChanged( sal_uInt16 )
switch ( nPropId )
{
case BASEPROPERTY_GRAPHIC:
- aDefault <<= makeAny( Reference< graphic::XGraphic >() );
+ aDefault <<= Reference< graphic::XGraphic >();
+ break;
+
+ case BASEPROPERTY_REFERENCE_DEVICE:
+ aDefault <<= Reference< awt::XDevice >();
break;
case BASEPROPERTY_VERTICALALIGN:
diff --git a/toolkit/source/helper/property.cxx b/toolkit/source/helper/property.cxx
index e71c03bae47d..a59af95a2e1f 100644
--- a/toolkit/source/helper/property.cxx
+++ b/toolkit/source/helper/property.cxx
@@ -47,6 +47,7 @@
#include <com/sun/star/awt/FontUnderline.hpp>
#include <com/sun/star/awt/FontStrikeout.hpp>
#include <com/sun/star/awt/FontPitch.hpp>
+#include <com/sun/star/awt/XDevice.hpp>
#include <com/sun/star/awt/tree/XTreeDataModel.hpp>
#include <com/sun/star/awt/grid/XGridDataModel.hpp>
#include <com/sun/star/awt/grid/XGridColumnModel.hpp>
@@ -65,6 +66,7 @@
using ::com::sun::star::uno::Any;
using ::com::sun::star::uno::Sequence;
using ::com::sun::star::uno::Reference;
+using ::com::sun::star::awt::XDevice;
using ::com::sun::star::awt::FontDescriptor;
using ::com::sun::star::style::VerticalAlignment;
@@ -275,12 +277,13 @@ ImplPropertyInfo* ImplGetPropertyInfos( sal_uInt16& rElementCount )
DECL_PROP_2 ( "URL", URL, ::rtl::OUString, BOUND, MAYBEDEFAULT ),
DECL_PROP_2 ( "WritingMode", WRITING_MODE, sal_Int16, BOUND, MAYBEDEFAULT ),
DECL_PROP_3 ( "ContextWritingMode", CONTEXT_WRITING_MODE, sal_Int16, BOUND, MAYBEDEFAULT, TRANSIENT ),
- DECL_PROP_2 ( "ShowRowHeader", GRID_SHOWROWHEADER, sal_Bool, BOUND, MAYBEDEFAULT ),
- DECL_PROP_2 ( "ShowColumnHeader", GRID_SHOWCOLUMNHEADER, sal_Bool, BOUND, MAYBEDEFAULT ),
- DECL_PROP_3 ( "GridDataModel", GRID_DATAMODEL, Reference< ::com::sun::star::awt::grid::XGridDataModel >, BOUND, MAYBEDEFAULT, MAYBEVOID ),
- DECL_PROP_3 ( "ColumnModel", GRID_COLUMNMODEL, Reference< ::com::sun::star::awt::grid::XGridColumnModel >, BOUND, MAYBEDEFAULT, MAYBEVOID ),
- DECL_PROP_3 ( "SelectionModel", GRID_SELECTIONMODE, ::com::sun::star::view::SelectionType, BOUND, MAYBEDEFAULT, MAYBEVOID ),
- DECL_PROP_2 ( "EnableVisible", ENABLEVISIBLE, sal_Bool, BOUND, MAYBEDEFAULT )
+ DECL_PROP_2 ( "ShowRowHeader", GRID_SHOWROWHEADER, sal_Bool, BOUND, MAYBEDEFAULT ),
+ DECL_PROP_2 ( "ShowColumnHeader", GRID_SHOWCOLUMNHEADER, sal_Bool, BOUND, MAYBEDEFAULT ),
+ DECL_PROP_3 ( "GridDataModel", GRID_DATAMODEL, Reference< ::com::sun::star::awt::grid::XGridDataModel >, BOUND, MAYBEDEFAULT, MAYBEVOID ),
+ DECL_PROP_3 ( "ColumnModel", GRID_COLUMNMODEL, Reference< ::com::sun::star::awt::grid::XGridColumnModel >, BOUND, MAYBEDEFAULT, MAYBEVOID ),
+ DECL_PROP_3 ( "SelectionModel", GRID_SELECTIONMODE, ::com::sun::star::view::SelectionType, BOUND, MAYBEDEFAULT, MAYBEVOID ),
+ DECL_PROP_2 ( "EnableVisible", ENABLEVISIBLE, sal_Bool, BOUND, MAYBEDEFAULT ),
+ DECL_PROP_3 ( "ReferenceDevice", REFERENCE_DEVICE, Reference< XDevice >,BOUND, MAYBEDEFAULT, TRANSIENT )
};
pPropertyInfos = aImplPropertyInfos;
nElements = sizeof( aImplPropertyInfos ) / sizeof( ImplPropertyInfo );
diff --git a/tools/inc/tools/solar.h b/tools/inc/tools/solar.h
index 46fe42b9c36f..cd069886d8b6 100644
--- a/tools/inc/tools/solar.h
+++ b/tools/inc/tools/solar.h
@@ -385,6 +385,8 @@ template<typename T> inline T Abs(T a) { return (a>=0?a:-a); }
#define __DLLEXTENSION "la.so"
#elif defined LINUX && defined M68K
#define __DLLEXTENSION "lm.so"
+#elif defined LINUX && defined HPPA
+ #define __DLLEXTENSION "lh.so"
#elif defined LINUX
#error unknown plattform
#elif defined FREEBSD && defined X86
diff --git a/vcl/aqua/source/gdi/salgdi.cxx b/vcl/aqua/source/gdi/salgdi.cxx
index e0905fe1d377..f389abd19a82 100644
--- a/vcl/aqua/source/gdi/salgdi.cxx
+++ b/vcl/aqua/source/gdi/salgdi.cxx
@@ -966,13 +966,15 @@ bool AquaSalGraphics::drawPolyLine( const ::basegfx::B2DPolygon& rPolyLine,
if( nPointCount <= 0 )
return true;
- // reject strange requests
+ // reject requests that cannot be handled yet
if( rLineWidths.getX() != rLineWidths.getY() )
return false;
// #i101491# Aqua does not support B2DLINEJOIN_NONE; return false to use
// the fallback (own geometry preparation)
- if(basegfx::B2DLINEJOIN_NONE == eLineJoin)
+ // #i104886# linejoin-mode and thus the above only applies to "fat" lines
+ if( (basegfx::B2DLINEJOIN_NONE == eLineJoin)
+ && (rLineWidths.getX() > 1.3) )
return false;
// setup line attributes
diff --git a/vcl/inc/vcl/bitmapex.hxx b/vcl/inc/vcl/bitmapex.hxx
index 3da80ce8c2f1..e5ddf50f1efa 100644
--- a/vcl/inc/vcl/bitmapex.hxx
+++ b/vcl/inc/vcl/bitmapex.hxx
@@ -381,6 +381,19 @@ public:
const BmpFilterParam* pFilterParam = NULL,
const Link* pProgress = NULL );
+ /** Get transparency at given position
+
+ @param nX
+ integer X-Position in Bitmap
+
+ @param nY
+ integer Y-Position in Bitmap
+
+ @return transparency value in the range of [0 .. 255] where
+ 0 is not transparent, 255 is fully transparent
+ */
+ sal_uInt8 GetTransparency(sal_Int32 nX, sal_Int32 nY) const;
+
public:
friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStm, const BitmapEx& rBitmapEx );
diff --git a/vcl/inc/vcl/button.hxx b/vcl/inc/vcl/button.hxx
index 94df24a9cea7..b80edf6712cd 100644
--- a/vcl/inc/vcl/button.hxx
+++ b/vcl/inc/vcl/button.hxx
@@ -144,10 +144,10 @@ protected:
SAL_DLLPRIVATE PushButton( const PushButton & );
SAL_DLLPRIVATE PushButton& operator=( const PushButton & );
-protected:
- using Window::ImplInit;
SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
+ using Control::ImplInitSettings;
+ using Window::ImplInit;
public:
SAL_DLLPRIVATE void ImplSetDefButton( BOOL bSet );
SAL_DLLPRIVATE static void ImplDrawPushButtonFrame( Window* pDev, Rectangle& rRect, USHORT nStyle );
@@ -158,6 +158,10 @@ protected:
PushButton( WindowType nType );
virtual void FillLayoutData() const;
+ virtual const Font&
+ GetCanonicalFont( const StyleSettings& _rStyle ) const;
+ virtual const Color&
+ GetCanonicalTextColor( const StyleSettings& _rStyle ) const;
public:
PushButton( Window* pParent, WinBits nStyle = 0 );
PushButton( Window* pParent, const ResId& rResId );
@@ -307,19 +311,20 @@ private:
SAL_DLLPRIVATE void ImplDrawRadioButtonState();
SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
const Point& rPos, const Size& rSize,
- const Size& rImageSize, long nImageSep,
- Rectangle& rStateRect, Rectangle& rMouseRect,
- bool bLayout = false );
+ const Size& rImageSize, Rectangle& rStateRect,
+ Rectangle& rMouseRect, bool bLayout = false );
SAL_DLLPRIVATE void ImplDrawRadioButton( bool bLayout = false );
SAL_DLLPRIVATE void ImplInvalidateOrDrawRadioButtonState();
SAL_DLLPRIVATE void ImplUncheckAllOther();
SAL_DLLPRIVATE Size ImplGetRadioImageSize() const;
+ SAL_DLLPRIVATE long ImplGetImageToTextDistance() const;
// Copy assignment is forbidden and not implemented.
SAL_DLLPRIVATE RadioButton(const RadioButton &);
SAL_DLLPRIVATE RadioButton& operator= (const RadioButton &);
protected:
+ using Control::ImplInitSettings;
using Window::ImplInit;
SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
@@ -330,6 +335,10 @@ public:
protected:
virtual void FillLayoutData() const;
+ virtual const Font&
+ GetCanonicalFont( const StyleSettings& _rStyle ) const;
+ virtual const Color&
+ GetCanonicalTextColor( const StyleSettings& _rStyle ) const;
inline void SetMouseRect( const Rectangle& _rMouseRect ) { maMouseRect = _rMouseRect; }
inline const Rectangle& GetMouseRect( ) const { return maMouseRect; }
@@ -420,10 +429,10 @@ private:
SAL_DLLPRIVATE void ImplInvalidateOrDrawCheckBoxState();
SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
const Point& rPos, const Size& rSize,
- const Size& rImageSize, long nImageSep,
- Rectangle& rStateRect,
+ const Size& rImageSize, Rectangle& rStateRect,
Rectangle& rMouseRect, bool bLayout );
SAL_DLLPRIVATE void ImplDrawCheckBox( bool bLayout = false );
+ SAL_DLLPRIVATE long ImplGetImageToTextDistance() const;
SAL_DLLPRIVATE Size ImplGetCheckImageSize() const;
// Copy assignment is forbidden and not implemented.
@@ -431,10 +440,15 @@ private:
SAL_DLLPRIVATE CheckBox& operator= (const CheckBox &);
protected:
+ using Control::ImplInitSettings;
using Window::ImplInit;
SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
SAL_DLLPRIVATE virtual void FillLayoutData() const;
+ SAL_DLLPRIVATE virtual const Font&
+ GetCanonicalFont( const StyleSettings& _rStyle ) const;
+ SAL_DLLPRIVATE virtual const Color&
+ GetCanonicalTextColor( const StyleSettings& _rStyle ) const;
public:
SAL_DLLPRIVATE void ImplCheck();
diff --git a/vcl/inc/vcl/controldata.hxx b/vcl/inc/vcl/controldata.hxx
new file mode 100644
index 000000000000..9ea698e792bd
--- /dev/null
+++ b/vcl/inc/vcl/controldata.hxx
@@ -0,0 +1,60 @@
+/*************************************************************************
+* 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_CONTROLDATA_HXX
+#define VCL_CONTROLDATA_HXX
+
+#include <vcl/controllayout.hxx>
+
+//........................................................................
+namespace vcl
+{
+//........................................................................
+
+ //====================================================================
+ //= ImplControlData
+ //====================================================================
+ struct ImplControlData
+ {
+ mutable ControlLayoutData* mpLayoutData;
+ OutputDevice* mpReferenceDevice;
+
+ ImplControlData()
+ :mpLayoutData( NULL )
+ ,mpReferenceDevice( NULL )
+ {
+ }
+
+ ~ImplControlData()
+ {
+ delete mpLayoutData;
+ }
+ };
+
+//........................................................................
+} // namespace vcl
+//........................................................................
+
+#endif // VCL_CONTROLDATA_HXX
diff --git a/vcl/inc/vcl/ctrl.hxx b/vcl/inc/vcl/ctrl.hxx
index 7bb5620ef93f..535f75549991 100644
--- a/vcl/inc/vcl/ctrl.hxx
+++ b/vcl/inc/vcl/ctrl.hxx
@@ -38,7 +38,7 @@
#include <vcl/salnativewidgets.hxx>
// forward
-namespace vcl { struct ControlLayoutData; }
+namespace vcl { struct ImplControlData; struct ControlLayoutData; }
// -----------
// - Control -
@@ -47,11 +47,12 @@ namespace vcl { struct ControlLayoutData; }
class VCL_DLLPUBLIC Control : public Window
{
protected:
- mutable vcl::ControlLayoutData* mpLayoutData;
+ ::vcl::ImplControlData* mpControlData;
+
private:
- BOOL mbHasFocus;
- Link maGetFocusHdl;
- Link maLoseFocusHdl;
+ BOOL mbHasFocus;
+ Link maGetFocusHdl;
+ Link maLoseFocusHdl;
SAL_DLLPRIVATE void ImplInitControlData();
@@ -66,6 +67,14 @@ protected:
// helper method for composite controls
void AppendLayoutData( const Control& rSubControl ) const;
+ /// creates the mpData->mpLayoutData structure
+ void CreateLayoutData() const;
+ /// determines whether we currently have layout data
+ bool HasLayoutData() const;
+ /// returns the current layout data
+ ::vcl::ControlLayoutData*
+ GetLayoutData() const;
+
/** this calls both our event listeners, and a specified handler
If the Control instance is destroyed during any of those calls, the
@@ -84,6 +93,25 @@ protected:
ULONG nEvent, const Link& rHandler, void* pCaller
);
+ /** draws the given text onto the given device
+
+ If no reference device is set, the draw request will simply be forwarded to OutputDevice::DrawText. Otherwise,
+ the text will be rendered according to the metrics at the reference device.
+
+ Note that the given rectangle might be modified, it will contain the result of a GetTextRect call (either
+ directly at the target device, or taking the reference device into account) when returning.
+ */
+ void DrawControlText( OutputDevice& _rTargetDevice, Rectangle& _io_rRect,
+ const XubString& _rStr, USHORT _nStyle,
+ MetricVector* _pVector, String* _pDisplayText ) const;
+
+ virtual const Font&
+ GetCanonicalFont( const StyleSettings& _rStyle ) const;
+ virtual const Color&
+ GetCanonicalTextColor( const StyleSettings& _rStyle ) const;
+
+ void ImplInitSettings( const BOOL _bFont, const BOOL _bForeground );
+
//#if 0 // _SOLAR__PRIVATE
public:
SAL_DLLPRIVATE void ImplClearLayoutData() const;
@@ -157,6 +185,20 @@ public:
void SetLayoutDataParent( const Control* pParent ) const;
virtual Size GetOptimalSize(WindowSizeType eType) const;
+
+ /** sets a reference device used for rendering control text
+ @seealso DrawControlText
+ */
+ void SetReferenceDevice( OutputDevice* _referenceDevice );
+ OutputDevice* GetReferenceDevice() const;
+
+ Font GetUnzoomedControlPointFont() const
+ {
+ Font aFont( GetCanonicalFont( GetSettings().GetStyleSettings() ) );
+ if ( IsControlFont() )
+ aFont.Merge( GetControlFont() );
+ return aFont;
+ }
};
#endif // _SV_CTRL_HXX
diff --git a/vcl/inc/vcl/edit.hxx b/vcl/inc/vcl/edit.hxx
index 534d63b3427c..fb99bd028631 100644
--- a/vcl/inc/vcl/edit.hxx
+++ b/vcl/inc/vcl/edit.hxx
@@ -124,6 +124,7 @@ private:
SAL_DLLPRIVATE ::com::sun::star::uno::Reference < ::com::sun::star::i18n::XBreakIterator > ImplGetBreakIterator() const;
protected:
+ using Control::ImplInitSettings;
using Window::ImplInit;
SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
SAL_DLLPRIVATE WinBits ImplInitStyle( WinBits nStyle );
diff --git a/vcl/inc/vcl/fixbrd.hxx b/vcl/inc/vcl/fixbrd.hxx
index 52de68d1c71f..68e1e69b9054 100644
--- a/vcl/inc/vcl/fixbrd.hxx
+++ b/vcl/inc/vcl/fixbrd.hxx
@@ -57,6 +57,7 @@ private:
BOOL mbTransparent;
private:
+ using Control::ImplInitSettings;
using Window::ImplInit;
SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
SAL_DLLPRIVATE WinBits ImplInitStyle( WinBits nStyle );
diff --git a/vcl/inc/vcl/fixed.hxx b/vcl/inc/vcl/fixed.hxx
index ba576f280b83..a5c834fce486 100644
--- a/vcl/inc/vcl/fixed.hxx
+++ b/vcl/inc/vcl/fixed.hxx
@@ -47,6 +47,7 @@ class VCL_DLLPUBLIC FixedText : public Control
{
//#if 0 // _SOLAR__PRIVATE
private:
+ using Control::ImplInitSettings;
using Window::ImplInit;
SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
SAL_DLLPRIVATE WinBits ImplInitStyle( WinBits nStyle );
@@ -58,6 +59,11 @@ public:
//#endif
protected:
virtual void FillLayoutData() const;
+ virtual const Font&
+ GetCanonicalFont( const StyleSettings& _rStyle ) const;
+ virtual const Color&
+ GetCanonicalTextColor( const StyleSettings& _rStyle ) const;
+
public:
FixedText( Window* pParent, WinBits nStyle = 0 );
FixedText( Window* pParent, const ResId& rResId );
@@ -81,6 +87,7 @@ public:
class VCL_DLLPUBLIC FixedLine : public Control
{
private:
+ using Control::ImplInitSettings;
using Window::ImplInit;
SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
SAL_DLLPRIVATE WinBits ImplInitStyle( WinBits nStyle );
@@ -89,6 +96,10 @@ private:
protected:
virtual void FillLayoutData() const;
+ virtual const Font&
+ GetCanonicalFont( const StyleSettings& _rStyle ) const;
+ virtual const Color&
+ GetCanonicalTextColor( const StyleSettings& _rStyle ) const;
public:
FixedLine( Window* pParent, WinBits nStyle = WB_HORZ );
@@ -113,6 +124,7 @@ private:
Bitmap maBitmap;
Bitmap maBitmapHC;
+ using Control::ImplInitSettings;
using Window::ImplInit;
SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
SAL_DLLPRIVATE WinBits ImplInitStyle( WinBits nStyle );
@@ -153,6 +165,7 @@ private:
BOOL mbInUserDraw;
private:
+ using Control::ImplInitSettings;
using Window::ImplInit;
SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
SAL_DLLPRIVATE WinBits ImplInitStyle( WinBits nStyle );
diff --git a/vcl/inc/vcl/group.hxx b/vcl/inc/vcl/group.hxx
index 0e84344587c7..7d5dd43fbee3 100644
--- a/vcl/inc/vcl/group.hxx
+++ b/vcl/inc/vcl/group.hxx
@@ -42,6 +42,7 @@
class VCL_DLLPUBLIC GroupBox : public Control
{
private:
+ using Control::ImplInitSettings;
using Window::ImplInit;
SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
SAL_DLLPRIVATE WinBits ImplInitStyle( WinBits nStyle );
@@ -50,6 +51,10 @@ private:
const Point& rPos, const Size& rSize, bool bLayout = false );
virtual void FillLayoutData() const;
+ virtual const Font&
+ GetCanonicalFont( const StyleSettings& _rStyle ) const;
+ virtual const Color&
+ GetCanonicalTextColor( const StyleSettings& _rStyle ) const;
public:
GroupBox( Window* pParent, WinBits nStyle = 0 );
diff --git a/vcl/inc/vcl/ilstbox.hxx b/vcl/inc/vcl/ilstbox.hxx
index e5f6696005fa..81dd32ef2705 100644
--- a/vcl/inc/vcl/ilstbox.hxx
+++ b/vcl/inc/vcl/ilstbox.hxx
@@ -369,6 +369,7 @@ public:
void SetReadOnly( BOOL bReadOnly ) { mbReadOnly = bReadOnly; }
BOOL IsReadOnly() const { return mbReadOnly; }
+ using Control::ImplInitSettings;
void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
USHORT ImplGetTextStyle() const;
diff --git a/vcl/inc/vcl/outdev.hxx b/vcl/inc/vcl/outdev.hxx
index f4e42846dd5e..130492a2bd0c 100644
--- a/vcl/inc/vcl/outdev.hxx
+++ b/vcl/inc/vcl/outdev.hxx
@@ -103,8 +103,12 @@ namespace awt {
typedef std::vector< Rectangle > MetricVector;
-namespace vcl { class PDFWriterImpl; }
-namespace vcl { class ExtOutDevData; }
+namespace vcl
+{
+ class PDFWriterImpl;
+ class ExtOutDevData;
+ class ITextLayout;
+}
#define OUTDEV_BUFFER_SIZE 128
@@ -431,9 +435,13 @@ public:
SAL_DLLPRIVATE SalLayout* ImplGlyphFallbackLayout( SalLayout*, ImplLayoutArgs& ) const;
SAL_DLLPRIVATE long ImplGetTextWidth( const SalLayout& ) const;
- SAL_DLLPRIVATE void ImplDrawText( const Rectangle& rRect,
+ static
+ SAL_DLLPRIVATE XubString ImplGetEllipsisString( const OutputDevice& rTargetDevice, const XubString& rStr,
+ long nMaxWidth, USHORT nStyle, const ::vcl::ITextLayout& _rLayout );
+ static
+ SAL_DLLPRIVATE void ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& rRect,
const String& rOrigStr, USHORT nStyle,
- MetricVector* pVector, String* pDisplayText );
+ MetricVector* pVector, String* pDisplayText, ::vcl::ITextLayout& _rLayout );
SAL_DLLPRIVATE void ImplDrawTextBackground( const SalLayout& );
SAL_DLLPRIVATE void ImplDrawTextLines( SalLayout&, FontStrikeout eStrikeout, FontUnderline eUnderline, FontUnderline eOverline, BOOL bWordLine, BOOL bUnderlineAbove );
SAL_DLLPRIVATE bool ImplDrawRotateText( SalLayout& );
@@ -456,7 +464,8 @@ public:
SAL_DLLPRIVATE void ImplDrawMnemonicLine( long nX, long nY, long nWidth );
SAL_DLLPRIVATE void ImplGetEmphasisMark( PolyPolygon& rPolyPoly, BOOL& rPolyLine, Rectangle& rRect1, Rectangle& rRect2, long& rYOff, long& rWidth, FontEmphasisMark eEmphasis, long nHeight, short nOrient );
SAL_DLLPRIVATE void ImplDrawEmphasisMark( long nBaseX, long nX, long nY, const PolyPolygon& rPolyPoly, BOOL bPolyLine, const Rectangle& rRect1, const Rectangle& rRect2 );
- SAL_DLLPRIVATE long ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo, long nWidth, const XubString& rStr, USHORT nStyle ) const;
+ static
+ SAL_DLLPRIVATE long ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo, long nWidth, const XubString& rStr, USHORT nStyle, const ::vcl::ITextLayout& _rLayout );
SAL_DLLPRIVATE void ImplInitFontList() const;
SAL_DLLPRIVATE void ImplUpdateFontData( bool bNewFontLists );
SAL_DLLPRIVATE static void ImplUpdateAllFontData( bool bNewFontLists );
@@ -649,10 +658,12 @@ public:
GDIMetaFile& rMtf );
void DrawText( const Rectangle& rRect,
const XubString& rStr, USHORT nStyle = 0,
- MetricVector* pVector = NULL, String* pDisplayText = NULL );
+ MetricVector* pVector = NULL, String* pDisplayText = NULL,
+ ::vcl::ITextLayout* _pTextLayout = NULL );
Rectangle GetTextRect( const Rectangle& rRect,
const XubString& rStr, USHORT nStyle = TEXT_DRAW_WORDBREAK,
- TextRectInfo* pInfo = NULL ) const;
+ TextRectInfo* pInfo = NULL,
+ const ::vcl::ITextLayout* _pTextLayout = NULL ) const;
XubString GetEllipsisString( const XubString& rStr, long nMaxWidth,
USHORT nStyle = TEXT_DRAW_ENDELLIPSIS ) const;
void DrawCtrlText( const Point& rPos, const XubString& rStr,
diff --git a/vcl/inc/vcl/slider.hxx b/vcl/inc/vcl/slider.hxx
index 396ed0ca83cb..c3dfcfd42608 100644
--- a/vcl/inc/vcl/slider.hxx
+++ b/vcl/inc/vcl/slider.hxx
@@ -70,6 +70,7 @@ private:
Link maSlideHdl;
Link maEndSlideHdl;
+ using Control::ImplInitSettings;
using Window::ImplInit;
SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
diff --git a/vcl/inc/vcl/tabctrl.hxx b/vcl/inc/vcl/tabctrl.hxx
index 378459b9eadb..30edf6227a60 100644
--- a/vcl/inc/vcl/tabctrl.hxx
+++ b/vcl/inc/vcl/tabctrl.hxx
@@ -78,6 +78,7 @@ private:
Link maActivateHdl;
Link maDeactivateHdl;
+ using Control::ImplInitSettings;
SAL_DLLPRIVATE void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
SAL_DLLPRIVATE ImplTabItem* ImplGetItem( USHORT nId ) const;
SAL_DLLPRIVATE void ImplScrollBtnsColor();
@@ -101,6 +102,8 @@ protected:
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
virtual void FillLayoutData() const;
+ virtual const Font& GetCanonicalFont( const StyleSettings& _rStyle ) const;
+ virtual const Color& GetCanonicalTextColor( const StyleSettings& _rStyle ) const;
SAL_DLLPRIVATE Rectangle* ImplFindPartRect( const Point& rPt );
public:
diff --git a/vcl/inc/vcl/textlayout.hxx b/vcl/inc/vcl/textlayout.hxx
new file mode 100755
index 000000000000..4c290452e2ad
--- /dev/null
+++ b/vcl/inc/vcl/textlayout.hxx
@@ -0,0 +1,134 @@
+/*************************************************************************
+* 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_TEXTLAYOUT_HXX
+#define VCL_TEXTLAYOUT_HXX
+
+#include "vcl/outdev.hxx"
+
+#include <tools/solar.h>
+#include <tools/string.hxx>
+
+#include <memory>
+
+class Control;
+
+//........................................................................
+namespace vcl
+{
+//........................................................................
+
+ //====================================================================
+ //= ITextLayout
+ //====================================================================
+ class SAL_NO_VTABLE ITextLayout
+ {
+ public:
+ virtual long GetTextWidth( const XubString& _rText, xub_StrLen _nStartIndex, xub_StrLen _nLength ) const = 0;
+ virtual void DrawText( const Point& _rStartPoint, const XubString& _rText, xub_StrLen _nStartIndex, xub_StrLen _nLength,
+ MetricVector* _pVector, String* _pDisplayText ) = 0;
+ virtual bool GetCaretPositions( const XubString& _rText, sal_Int32* _pCaretXArray, xub_StrLen _nStartIndex, xub_StrLen _nLength ) const = 0;
+ virtual xub_StrLen GetTextBreak( const XubString& _rText, long _nMaxTextWidth, xub_StrLen _nStartIndex, xub_StrLen _nLength ) const = 0;
+ virtual bool DecomposeTextRectAction() const = 0;
+ };
+
+ //====================================================================
+ //= DefaultTextLayout
+ //====================================================================
+ /** is an implementation of the ITextLayout interface which simply delegates its calls to the respective
+ methods of an OutputDevice instance, without any inbetween magic.
+ */
+ class DefaultTextLayout : public ITextLayout
+ {
+ public:
+ DefaultTextLayout( OutputDevice& _rTargetDevice )
+ :m_rTargetDevice( _rTargetDevice )
+ {
+ }
+ virtual ~DefaultTextLayout();
+
+ // ITextLayout overridables
+ virtual long GetTextWidth(
+ const XubString& _rText,
+ xub_StrLen _nStartIndex,
+ xub_StrLen _nLength
+ ) const;
+ virtual void DrawText(
+ const Point& _rStartPoint,
+ const XubString& _rText,
+ xub_StrLen _nStartIndex,
+ xub_StrLen _nLength,
+ MetricVector* _pVector,
+ String* _pDisplayText
+ );
+ virtual bool GetCaretPositions(
+ const XubString& _rText,
+ sal_Int32* _pCaretXArray,
+ xub_StrLen _nStartIndex,
+ xub_StrLen _nLength
+ ) const;
+ virtual xub_StrLen GetTextBreak(
+ const XubString& _rText,
+ long _nMaxTextWidth,
+ xub_StrLen _nStartIndex,
+ xub_StrLen _nLength
+ ) const;
+ virtual bool DecomposeTextRectAction() const;
+
+ private:
+ OutputDevice& m_rTargetDevice;
+ };
+
+ //====================================================================
+ //= ControlTextRenderer
+ //====================================================================
+ class ReferenceDeviceTextLayout;
+ /** a class which allows rendering text of a Control onto a device, by taking into account the metrics of
+ a reference device.
+ */
+ class ControlTextRenderer
+ {
+ public:
+ ControlTextRenderer( const Control& _rControl, OutputDevice& _rTargetDevice, OutputDevice& _rReferenceDevice );
+ virtual ~ControlTextRenderer();
+
+ Rectangle DrawText( const Rectangle& _rRect,
+ const XubString& _rText, USHORT _nStyle = 0,
+ MetricVector* _pVector = NULL, String* _pDisplayText = NULL );
+
+ private:
+ ControlTextRenderer(); // never implemented
+ ControlTextRenderer( const ControlTextRenderer& ); // never implemented
+ ControlTextRenderer& operator=( const ControlTextRenderer& ); // never implemented
+
+ private:
+ ::std::auto_ptr< ReferenceDeviceTextLayout > m_pImpl;
+ };
+
+//........................................................................
+} // namespace vcl
+//........................................................................
+
+#endif // VCL_TEXTLAYOUT_HXX
diff --git a/vcl/inc/vcl/window.hxx b/vcl/inc/vcl/window.hxx
index eba46362d94e..56fdb22ddc57 100644
--- a/vcl/inc/vcl/window.hxx
+++ b/vcl/inc/vcl/window.hxx
@@ -321,7 +321,6 @@ typedef USHORT StateChangedType;
#define IMPL_MSGBOX_OFFSET_EXTRA_X 0
#define IMPL_MSGBOX_OFFSET_EXTRA_Y 2
#define IMPL_SEP_MSGBOX_IMAGE 8
-#define IMPL_SEP_BUTTON_IMAGE 4
#define DLGWINDOW_PREV 0
#define DLGWINDOW_NEXT 1
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index e7a4aadb8694..53a060af6bd6 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -50,7 +50,7 @@
#include <tools/poly.hxx>
#include <vcl/button.hxx>
#include <vcl/window.h>
-#include <vcl/controllayout.hxx>
+#include <vcl/controldata.hxx>
#ifndef _SV_NATIVEWIDGET_HXX
#include <vcl/salnativewidgets.hxx>
#endif
@@ -383,8 +383,8 @@ void Button::ImplDrawAlignedImage( OutputDevice* pDev, Point& rPos,
WinBits nWinStyle = GetStyle();
Rectangle aOutRect( rPos, rSize );
- MetricVector *pVector = bLayout ? &mpLayoutData->m_aUnicodeBoundRects : NULL;
- String *pDisplayText = bLayout ? &mpLayoutData->m_aDisplayText : NULL;
+ MetricVector *pVector = bLayout ? &mpControlData->mpLayoutData->m_aUnicodeBoundRects : NULL;
+ String *pDisplayText = bLayout ? &mpControlData->mpLayoutData->m_aDisplayText : NULL;
ImageAlign eImageAlign = mpButtonData->meImageAlign;
Size aImageSize = mpButtonData->maImage.GetSizePixel();
@@ -406,13 +406,12 @@ void Button::ImplDrawAlignedImage( OutputDevice* pDev, Point& rPos,
}
else if ( bDrawText && !bDrawImage && !bHasSymbol )
{
- aOutRect = pDev->GetTextRect( aOutRect, aText, nTextStyle );
- rSize = aOutRect.GetSize();
- rPos = aOutRect.TopLeft();
+ DrawControlText( *pDev, aOutRect, aText, nTextStyle, pVector, pDisplayText );
ImplSetFocusRect( aOutRect );
+ rSize = aOutRect.GetSize();
+ rPos = aOutRect.TopLeft();
- pDev->DrawText( aOutRect, aText, nTextStyle, pVector, pDisplayText );
return;
}
@@ -853,31 +852,25 @@ WinBits PushButton::ImplInitStyle( const Window* pPrevWindow, WinBits nStyle )
return nStyle;
}
+// -----------------------------------------------------------------
+
+const Font& PushButton::GetCanonicalFont( const StyleSettings& _rStyle ) const
+{
+ return _rStyle.GetPushButtonFont();
+}
+
+// -----------------------------------------------------------------
+const Color& PushButton::GetCanonicalTextColor( const StyleSettings& _rStyle ) const
+{
+ return _rStyle.GetButtonTextColor();
+}
+
// -----------------------------------------------------------------------
void PushButton::ImplInitSettings( BOOL bFont,
BOOL bForeground, BOOL bBackground )
{
- const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
-
- if ( bFont )
- {
- Font aFont = rStyleSettings.GetPushButtonFont();
- if ( IsControlFont() )
- aFont.Merge( GetControlFont() );
- SetZoomedPointFont( aFont );
- }
-
- if ( bForeground || bFont )
- {
- Color aColor;
- if ( IsControlForeground() )
- aColor = GetControlForeground();
- else
- aColor = rStyleSettings.GetButtonTextColor();
- SetTextColor( aColor );
- SetTextFillColor();
- }
+ Button::ImplInitSettings( bFont, bForeground );
if ( bBackground )
{
@@ -1659,7 +1652,7 @@ void PushButton::KeyUp( const KeyEvent& rKEvt )
void PushButton::FillLayoutData() const
{
- mpLayoutData = new vcl::ControlLayoutData();
+ mpControlData->mpLayoutData = new vcl::ControlLayoutData();
const_cast<PushButton*>(this)->ImplDrawPushButton( true );
}
@@ -2225,31 +2218,25 @@ WinBits RadioButton::ImplInitStyle( const Window* pPrevWindow, WinBits nStyle )
return nStyle;
}
+// -----------------------------------------------------------------
+
+const Font& RadioButton::GetCanonicalFont( const StyleSettings& _rStyle ) const
+{
+ return _rStyle.GetRadioCheckFont();
+}
+
+// -----------------------------------------------------------------
+const Color& RadioButton::GetCanonicalTextColor( const StyleSettings& _rStyle ) const
+{
+ return _rStyle.GetRadioCheckTextColor();
+}
+
// -----------------------------------------------------------------------
void RadioButton::ImplInitSettings( BOOL bFont,
BOOL bForeground, BOOL bBackground )
{
- const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
-
- if ( bFont )
- {
- Font aFont = rStyleSettings.GetRadioCheckFont();
- if ( IsControlFont() )
- aFont.Merge( GetControlFont() );
- SetZoomedPointFont( aFont );
- }
-
- if ( bForeground || bFont )
- {
- Color aColor;
- if ( IsControlForeground() )
- aColor = GetControlForeground();
- else
- aColor = rStyleSettings.GetRadioCheckTextColor();
- SetTextColor( aColor );
- SetTextFillColor();
- }
+ Button::ImplInitSettings( bFont, bForeground );
if ( bBackground )
{
@@ -2424,16 +2411,14 @@ if ( bNativeOK == FALSE )
void RadioButton::ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
const Point& rPos, const Size& rSize,
- const Size& rImageSize, long nImageSep,
- Rectangle& rStateRect,
- Rectangle& rMouseRect,
- bool bLayout )
+ const Size& rImageSize, Rectangle& rStateRect,
+ Rectangle& rMouseRect, bool bLayout )
{
WinBits nWinStyle = GetStyle();
XubString aText( GetText() );
Rectangle aRect( rPos, rSize );
- MetricVector* pVector = bLayout ? &mpLayoutData->m_aUnicodeBoundRects : NULL;
- String* pDisplayText = bLayout ? &mpLayoutData->m_aDisplayText : NULL;
+ MetricVector* pVector = bLayout ? &mpControlData->mpLayoutData->m_aUnicodeBoundRects : NULL;
+ String* pDisplayText = bLayout ? &mpControlData->mpLayoutData->m_aDisplayText : NULL;
pDev->Push( PUSH_CLIPREGION );
pDev->IntersectClipRegion( Rectangle( rPos, rSize ) );
@@ -2446,9 +2431,9 @@ void RadioButton::ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
{
USHORT nTextStyle = Button::ImplGetTextStyle( aText, nWinStyle, nDrawFlags );
+ const long nImageSep = GetDrawPixel( pDev, ImplGetImageToTextDistance() );
Size aSize( rSize );
Point aPos( rPos );
-
aPos.X() += rImageSize.Width() + nImageSep;
aSize.Width() -= rImageSize.Width() + nImageSep;
@@ -2578,7 +2563,7 @@ void RadioButton::ImplDrawRadioButton( bool bLayout )
// Draw control text
ImplDraw( this, 0, Point(), GetOutputSizePixel(),
- aImageSize, IMPL_SEP_BUTTON_IMAGE, maStateRect, maMouseRect, bLayout );
+ aImageSize, maStateRect, maMouseRect, bLayout );
if( !bLayout || (IsNativeControlSupported(CTRL_RADIOBUTTON, PART_ENTIRE_CONTROL)==TRUE) )
{
@@ -2854,7 +2839,7 @@ void RadioButton::KeyUp( const KeyEvent& rKEvt )
void RadioButton::FillLayoutData() const
{
- mpLayoutData = new vcl::ControlLayoutData();
+ mpControlData->mpLayoutData = new vcl::ControlLayoutData();
const_cast<RadioButton*>(this)->ImplDrawRadioButton( true );
}
@@ -2909,8 +2894,7 @@ void RadioButton::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize
pDev->SetTextFillColor();
ImplDraw( pDev, nFlags, aPos, aSize,
- aImageSize, GetDrawPixel( pDev, IMPL_SEP_BUTTON_IMAGE ),
- aStateRect, aMouseRect );
+ aImageSize, aStateRect, aMouseRect );
Point aCenterPos = aStateRect.Center();
long nRadX = aImageSize.Width()/2;
@@ -3158,6 +3142,15 @@ void RadioButton::Check( BOOL bCheck )
// -----------------------------------------------------------------------
+long RadioButton::ImplGetImageToTextDistance() const
+{
+ // 4 pixels, but take zoom into account, so the text doesn't "jump" relative to surrounding elements,
+ // which might have been aligned with the text of the check box
+ return CalcZoom( 4 );
+}
+
+// -----------------------------------------------------------------------
+
Size RadioButton::ImplGetRadioImageSize() const
{
Size aSize;
@@ -3331,12 +3324,12 @@ Size RadioButton::CalcMinimumSize( long nMaxWidth ) const
{
// subtract what will be added later
nMaxWidth-=2;
- nMaxWidth -= IMPL_SEP_BUTTON_IMAGE;
+ nMaxWidth -= ImplGetImageToTextDistance();
Size aTextSize = GetTextRect( Rectangle( Point(), Size( nMaxWidth > 0 ? nMaxWidth : 0x7fffffff, 0x7fffffff ) ),
aText, FixedText::ImplGetTextStyle( GetStyle() ) ).GetSize();
aSize.Width()+=2; // for focus rect
- aSize.Width() += IMPL_SEP_BUTTON_IMAGE;
+ aSize.Width() += ImplGetImageToTextDistance();
aSize.Width() += aTextSize.Width();
if ( aSize.Height() < aTextSize.Height() )
aSize.Height() = aTextSize.Height();
@@ -3395,31 +3388,25 @@ WinBits CheckBox::ImplInitStyle( const Window* pPrevWindow, WinBits nStyle )
return nStyle;
}
+// -----------------------------------------------------------------
+
+const Font& CheckBox::GetCanonicalFont( const StyleSettings& _rStyle ) const
+{
+ return _rStyle.GetRadioCheckFont();
+}
+
+// -----------------------------------------------------------------
+const Color& CheckBox::GetCanonicalTextColor( const StyleSettings& _rStyle ) const
+{
+ return _rStyle.GetRadioCheckTextColor();
+}
+
// -----------------------------------------------------------------------
void CheckBox::ImplInitSettings( BOOL bFont,
BOOL bForeground, BOOL bBackground )
{
- const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
-
- if ( bFont )
- {
- Font aFont = rStyleSettings.GetRadioCheckFont();
- if ( IsControlFont() )
- aFont.Merge( GetControlFont() );
- SetZoomedPointFont( aFont );
- }
-
- if ( bForeground || bFont )
- {
- Color aColor;
- if ( IsControlForeground() )
- aColor = GetControlForeground();
- else
- aColor = rStyleSettings.GetRadioCheckTextColor();
- SetTextColor( aColor );
- SetTextFillColor();
- }
+ Button::ImplInitSettings( bFont, bForeground );
if ( bBackground )
{
@@ -3527,9 +3514,8 @@ void CheckBox::ImplDrawCheckBoxState()
void CheckBox::ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
const Point& rPos, const Size& rSize,
- const Size& rImageSize, long nImageSep,
- Rectangle& rStateRect, Rectangle& rMouseRect,
- bool bLayout )
+ const Size& rImageSize, Rectangle& rStateRect,
+ Rectangle& rMouseRect, bool bLayout )
{
WinBits nWinStyle = GetStyle();
XubString aText( GetText() );
@@ -3543,6 +3529,7 @@ void CheckBox::ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
{
USHORT nTextStyle = Button::ImplGetTextStyle( aText, nWinStyle, nDrawFlags );
+ const long nImageSep = GetDrawPixel( pDev, ImplGetImageToTextDistance() );
Size aSize( rSize );
Point aPos( rPos );
aPos.X() += rImageSize.Width() + nImageSep;
@@ -3640,7 +3627,7 @@ void CheckBox::ImplDrawCheckBox( bool bLayout )
HideFocus();
ImplDraw( this, 0, Point(), GetOutputSizePixel(), aImageSize,
- IMPL_SEP_BUTTON_IMAGE, maStateRect, maMouseRect, bLayout );
+ maStateRect, maMouseRect, bLayout );
if( !bLayout )
{
@@ -3797,7 +3784,7 @@ void CheckBox::KeyUp( const KeyEvent& rKEvt )
void CheckBox::FillLayoutData() const
{
- mpLayoutData = new vcl::ControlLayoutData();
+ mpControlData->mpLayoutData = new vcl::ControlLayoutData();
const_cast<CheckBox*>(this)->ImplDrawCheckBox( true );
}
@@ -3852,8 +3839,7 @@ void CheckBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
pDev->SetTextFillColor();
ImplDraw( pDev, nFlags, aPos, aSize,
- aImageSize, GetDrawPixel( pDev, IMPL_SEP_BUTTON_IMAGE ),
- aStateRect, aMouseRect, false );
+ aImageSize, aStateRect, aMouseRect, false );
pDev->SetLineColor();
pDev->SetFillColor( Color( COL_BLACK ) );
@@ -4099,6 +4085,15 @@ void CheckBox::EnableTriState( BOOL bTriState )
// -----------------------------------------------------------------------
+long CheckBox::ImplGetImageToTextDistance() const
+{
+ // 4 pixels, but take zoom into account, so the text doesn't "jump" relative to surrounding elements,
+ // which might have been aligned with the text of the check box
+ return CalcZoom( 4 );
+}
+
+// -----------------------------------------------------------------------
+
Size CheckBox::ImplGetCheckImageSize() const
{
Size aSize;
@@ -4232,12 +4227,12 @@ Size CheckBox::CalcMinimumSize( long nMaxWidth ) const
{
// subtract what will be added later
nMaxWidth-=2;
- nMaxWidth -= IMPL_SEP_BUTTON_IMAGE;
+ nMaxWidth -= ImplGetImageToTextDistance();
Size aTextSize = GetTextRect( Rectangle( Point(), Size( nMaxWidth > 0 ? nMaxWidth : 0x7fffffff, 0x7fffffff ) ),
aText, FixedText::ImplGetTextStyle( GetStyle() ) ).GetSize();
aSize.Width()+=2; // for focus rect
- aSize.Width() += IMPL_SEP_BUTTON_IMAGE;
+ aSize.Width() += ImplGetImageToTextDistance();
aSize.Width() += aTextSize.Width();
if ( aSize.Height() < aTextSize.Height() )
aSize.Height() = aTextSize.Height();
diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx
index f83e46e38302..21707d0182f5 100644
--- a/vcl/source/control/combobox.cxx
+++ b/vcl/source/control/combobox.cxx
@@ -44,7 +44,7 @@
#include <vcl/subedit.hxx>
#include <vcl/event.hxx>
#include <vcl/combobox.hxx>
-#include <vcl/controllayout.hxx>
+#include <vcl/controldata.hxx>
@@ -689,7 +689,7 @@ void ComboBox::Resize()
void ComboBox::FillLayoutData() const
{
- mpLayoutData = new vcl::ControlLayoutData();
+ mpControlData->mpLayoutData = new vcl::ControlLayoutData();
AppendLayoutData( *mpSubEdit );
mpSubEdit->SetLayoutDataParent( this );
Control* pMainWindow = mpImplLB->GetMainWindow();
@@ -1534,7 +1534,7 @@ void ComboBox::SetBorderStyle( USHORT nBorderStyle )
long ComboBox::GetIndexForPoint( const Point& rPoint, USHORT& rPos ) const
{
- if( ! mpLayoutData )
+ if( !HasLayoutData() )
FillLayoutData();
// check whether rPoint fits at all
diff --git a/vcl/source/control/ctrl.cxx b/vcl/source/control/ctrl.cxx
index 55c979fbd69f..1800327df33c 100644
--- a/vcl/source/control/ctrl.cxx
+++ b/vcl/source/control/ctrl.cxx
@@ -39,10 +39,12 @@
#include <vcl/event.hxx>
#include <vcl/ctrl.hxx>
#include <vcl/decoview.hxx>
-#include <vcl/controllayout.hxx>
+#include <vcl/controldata.hxx>
#include <vcl/salnativewidgets.hxx>
+#include <vcl/textlayout.hxx>
-
+#include <comphelper/processfactory.hxx>
+#include <tools/diagnose_ex.h>
using namespace vcl;
@@ -51,7 +53,7 @@ using namespace vcl;
void Control::ImplInitControlData()
{
mbHasFocus = FALSE;
- mpLayoutData = NULL;
+ mpControlData = new ImplControlData;
}
// -----------------------------------------------------------------------
@@ -90,7 +92,7 @@ Control::Control( Window* pParent, const ResId& rResId ) :
Control::~Control()
{
- delete mpLayoutData, mpLayoutData = NULL;
+ delete mpControlData, mpControlData = NULL;
}
// -----------------------------------------------------------------------
@@ -111,7 +113,7 @@ void Control::LoseFocus()
void Control::Resize()
{
- delete mpLayoutData, mpLayoutData = NULL;
+ ImplClearLayoutData();
Window::Resize();
}
@@ -123,10 +125,31 @@ void Control::FillLayoutData() const
// -----------------------------------------------------------------------
+void Control::CreateLayoutData() const
+{
+ DBG_ASSERT( !mpControlData->mpLayoutData, "Control::CreateLayoutData: should be called with non-existent layout data only!" );
+ mpControlData->mpLayoutData = new ::vcl::ControlLayoutData();
+}
+
+// -----------------------------------------------------------------------
+
+bool Control::HasLayoutData() const
+{
+ return mpControlData->mpLayoutData != NULL;
+}
+
+// -----------------------------------------------------------------------
+
+::vcl::ControlLayoutData* Control::GetLayoutData() const
+{
+ return mpControlData->mpLayoutData;
+}
+
+// -----------------------------------------------------------------------
+
void Control::SetText( const String& rStr )
{
- delete mpLayoutData;
- mpLayoutData = NULL;
+ ImplClearLayoutData();
Window::SetText( rStr );
}
@@ -142,9 +165,9 @@ Rectangle ControlLayoutData::GetCharacterBounds( long nIndex ) const
Rectangle Control::GetCharacterBounds( long nIndex ) const
{
- if( ! mpLayoutData )
+ if( !HasLayoutData() )
FillLayoutData();
- return mpLayoutData ? mpLayoutData->GetCharacterBounds( nIndex ) : Rectangle();
+ return mpControlData->mpLayoutData ? mpControlData->mpLayoutData->GetCharacterBounds( nIndex ) : Rectangle();
}
// -----------------------------------------------------------------------
@@ -167,9 +190,9 @@ long ControlLayoutData::GetIndexForPoint( const Point& rPoint ) const
long Control::GetIndexForPoint( const Point& rPoint ) const
{
- if( ! mpLayoutData )
+ if( ! HasLayoutData() )
FillLayoutData();
- return mpLayoutData ? mpLayoutData->GetIndexForPoint( rPoint ) : -1;
+ return mpControlData->mpLayoutData ? mpControlData->mpLayoutData->GetIndexForPoint( rPoint ) : -1;
}
// -----------------------------------------------------------------------
@@ -186,9 +209,9 @@ long ControlLayoutData::GetLineCount() const
long Control::GetLineCount() const
{
- if( ! mpLayoutData )
+ if( !HasLayoutData() )
FillLayoutData();
- return mpLayoutData ? mpLayoutData->GetLineCount() : 0;
+ return mpControlData->mpLayoutData ? mpControlData->mpLayoutData->GetLineCount() : 0;
}
// -----------------------------------------------------------------------
@@ -220,9 +243,9 @@ Pair ControlLayoutData::GetLineStartEnd( long nLine ) const
Pair Control::GetLineStartEnd( long nLine ) const
{
- if( ! mpLayoutData )
+ if( !HasLayoutData() )
FillLayoutData();
- return mpLayoutData ? mpLayoutData->GetLineStartEnd( nLine ) : Pair( -1, -1 );
+ return mpControlData->mpLayoutData ? mpControlData->mpLayoutData->GetLineStartEnd( nLine ) : Pair( -1, -1 );
}
// -----------------------------------------------------------------------
@@ -263,18 +286,18 @@ long ControlLayoutData::ToRelativeLineIndex( long nIndex ) const
long Control::ToRelativeLineIndex( long nIndex ) const
{
- if( ! mpLayoutData )
+ if( !HasLayoutData() )
FillLayoutData();
- return mpLayoutData ? mpLayoutData->ToRelativeLineIndex( nIndex ) : -1;
+ return mpControlData->mpLayoutData ? mpControlData->mpLayoutData->ToRelativeLineIndex( nIndex ) : -1;
}
// -----------------------------------------------------------------------
String Control::GetDisplayText() const
{
- if( ! mpLayoutData )
+ if( !HasLayoutData() )
FillLayoutData();
- return mpLayoutData ? mpLayoutData->m_aDisplayText : GetText();
+ return mpControlData->mpLayoutData ? mpControlData->mpLayoutData->m_aDisplayText : GetText();
}
// -----------------------------------------------------------------------
@@ -321,8 +344,7 @@ void Control::StateChanged( StateChangedType nStateChange )
nStateChange == STATE_CHANGE_CONTROLFONT
)
{
- delete mpLayoutData;
- mpLayoutData = NULL;
+ ImplClearLayoutData();
}
Window::StateChanged( nStateChange );
}
@@ -331,25 +353,25 @@ void Control::StateChanged( StateChangedType nStateChange )
void Control::AppendLayoutData( const Control& rSubControl ) const
{
- if( ! rSubControl.mpLayoutData )
+ if( !rSubControl.HasLayoutData() )
rSubControl.FillLayoutData();
- if( ! rSubControl.mpLayoutData || ! rSubControl.mpLayoutData->m_aDisplayText.Len() )
+ if( !rSubControl.HasLayoutData() || !rSubControl.mpControlData->mpLayoutData->m_aDisplayText.Len() )
return;
- long nCurrentIndex = mpLayoutData->m_aDisplayText.Len();
- mpLayoutData->m_aDisplayText.Append( rSubControl.mpLayoutData->m_aDisplayText );
- int nLines = rSubControl.mpLayoutData->m_aLineIndices.size();
+ long nCurrentIndex = mpControlData->mpLayoutData->m_aDisplayText.Len();
+ mpControlData->mpLayoutData->m_aDisplayText.Append( rSubControl.mpControlData->mpLayoutData->m_aDisplayText );
+ int nLines = rSubControl.mpControlData->mpLayoutData->m_aLineIndices.size();
int n;
- mpLayoutData->m_aLineIndices.push_back( nCurrentIndex );
+ mpControlData->mpLayoutData->m_aLineIndices.push_back( nCurrentIndex );
for( n = 1; n < nLines; n++ )
- mpLayoutData->m_aLineIndices.push_back( rSubControl.mpLayoutData->m_aLineIndices[n] + nCurrentIndex );
- int nRectangles = rSubControl.mpLayoutData->m_aUnicodeBoundRects.size();
+ mpControlData->mpLayoutData->m_aLineIndices.push_back( rSubControl.mpControlData->mpLayoutData->m_aLineIndices[n] + nCurrentIndex );
+ int nRectangles = rSubControl.mpControlData->mpLayoutData->m_aUnicodeBoundRects.size();
Rectangle aRel = const_cast<Control&>(rSubControl).GetWindowExtentsRelative( const_cast<Control*>(this) );
for( n = 0; n < nRectangles; n++ )
{
- Rectangle aRect = rSubControl.mpLayoutData->m_aUnicodeBoundRects[n];
+ Rectangle aRect = rSubControl.mpControlData->mpLayoutData->m_aUnicodeBoundRects[n];
aRect.Move( aRel.Left(), aRel.Top() );
- mpLayoutData->m_aUnicodeBoundRects.push_back( aRect );
+ mpControlData->mpLayoutData->m_aUnicodeBoundRects.push_back( aRect );
}
}
@@ -378,15 +400,15 @@ BOOL Control::ImplCallEventListenersAndHandler( ULONG nEvent, const Link& rHand
void Control::SetLayoutDataParent( const Control* pParent ) const
{
- if( mpLayoutData )
- mpLayoutData->m_pParent = pParent;
+ if( HasLayoutData() )
+ mpControlData->mpLayoutData->m_pParent = pParent;
}
// -----------------------------------------------------------------
void Control::ImplClearLayoutData() const
{
- delete mpLayoutData, mpLayoutData = NULL;
+ delete mpControlData->mpLayoutData, mpControlData->mpLayoutData = NULL;
}
// -----------------------------------------------------------------------
@@ -467,3 +489,102 @@ Size Control::GetOptimalSize(WindowSizeType eType) const
return Size( LONG_MAX, LONG_MAX );
}
}
+
+// -----------------------------------------------------------------
+
+void Control::SetReferenceDevice( OutputDevice* _referenceDevice )
+{
+ if ( mpControlData->mpReferenceDevice == _referenceDevice )
+ return;
+
+ mpControlData->mpReferenceDevice = _referenceDevice;
+ Invalidate();
+}
+
+// -----------------------------------------------------------------
+
+OutputDevice* Control::GetReferenceDevice() const
+{
+ return mpControlData->mpReferenceDevice;
+}
+
+// -----------------------------------------------------------------
+
+const Font& Control::GetCanonicalFont( const StyleSettings& _rStyle ) const
+{
+ return _rStyle.GetLabelFont();
+}
+
+// -----------------------------------------------------------------
+const Color& Control::GetCanonicalTextColor( const StyleSettings& _rStyle ) const
+{
+ return _rStyle.GetLabelTextColor();
+}
+
+// -----------------------------------------------------------------
+void Control::ImplInitSettings( const BOOL _bFont, const BOOL _bForeground )
+{
+ const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+
+ if ( _bFont )
+ {
+ Font aFont( GetCanonicalFont( rStyleSettings ) );
+ if ( IsControlFont() )
+ aFont.Merge( GetControlFont() );
+ SetZoomedPointFont( aFont );
+ }
+
+ if ( _bForeground || _bFont )
+ {
+ Color aColor;
+ if ( IsControlForeground() )
+ aColor = GetControlForeground();
+ else
+ aColor = GetCanonicalTextColor( rStyleSettings );
+ SetTextColor( aColor );
+ SetTextFillColor();
+ }
+}
+
+// -----------------------------------------------------------------
+
+void Control::DrawControlText( OutputDevice& _rTargetDevice, Rectangle& _io_rRect, const XubString& _rStr,
+ USHORT _nStyle, MetricVector* _pVector, String* _pDisplayText ) const
+{
+#ifdef FS_DEBUG
+ if ( !_pVector )
+ {
+ static MetricVector aCharRects;
+ static String sDisplayText;
+ aCharRects.clear();
+ sDisplayText = String();
+ _pVector = &aCharRects;
+ _pDisplayText = &sDisplayText;
+ }
+#endif
+
+ if ( !mpControlData->mpReferenceDevice || ( mpControlData->mpReferenceDevice == &_rTargetDevice ) )
+ {
+ _io_rRect = _rTargetDevice.GetTextRect( _io_rRect, _rStr, _nStyle );
+ _rTargetDevice.DrawText( _io_rRect, _rStr, _nStyle, _pVector, _pDisplayText );
+ }
+ else
+ {
+ ControlTextRenderer aRenderer( *this, _rTargetDevice, *mpControlData->mpReferenceDevice );
+ _io_rRect = aRenderer.DrawText( _io_rRect, _rStr, _nStyle, _pVector, _pDisplayText );
+ }
+
+#ifdef FS_DEBUG
+ _rTargetDevice.Push( PUSH_LINECOLOR | PUSH_FILLCOLOR );
+ _rTargetDevice.SetLineColor( COL_LIGHTRED );
+ _rTargetDevice.SetFillColor();
+ for ( MetricVector::const_iterator cr = _pVector->begin();
+ cr != _pVector->end();
+ ++cr
+ )
+ {
+ _rTargetDevice.DrawRect( *cr );
+ }
+ _rTargetDevice.Pop();
+#endif
+}
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index 5f41a441c6a1..b654e034470f 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -47,7 +47,7 @@
#include <vcl/subedit.hxx>
#include <vcl/edit.hxx>
#include <vcl/svapp.hxx>
-#include <vcl/controllayout.hxx>
+#include <vcl/controldata.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/window.h>
@@ -409,7 +409,7 @@ void Edit::ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground )
if ( IsControlFont() )
aFont.Merge( GetControlFont() );
SetZoomedPointFont( aFont );
- delete mpLayoutData, mpLayoutData = NULL;
+ ImplClearLayoutData();
}
if ( bFont || bForeground )
@@ -526,8 +526,8 @@ void Edit::ImplRepaint( xub_StrLen nStart, xub_StrLen nEnd, bool bLayout )
long nPos = nStart ? pDX[2*nStart] : 0;
aPos.X() = nPos + mnXOffset + ImplGetExtraOffset();
- MetricVector* pVector = &mpLayoutData->m_aUnicodeBoundRects;
- String* pDisplayText = &mpLayoutData->m_aDisplayText;
+ MetricVector* pVector = &mpControlData->mpLayoutData->m_aUnicodeBoundRects;
+ String* pDisplayText = &mpControlData->mpLayoutData->m_aDisplayText;
DrawText( aPos, aText, nStart, nEnd - nStart, pVector, pDisplayText );
@@ -722,7 +722,7 @@ void Edit::ImplDelete( const Selection& rSelection, BYTE nDirection, BYTE nMode
((rSelection.Max() == aText.Len()) && (nDirection == EDIT_DEL_RIGHT))) )
return;
- delete mpLayoutData, mpLayoutData = NULL;
+ ImplClearLayoutData();
Selection aSelection( rSelection );
aSelection.Justify();
@@ -864,7 +864,7 @@ void Edit::ImplInsertText( const XubString& rStr, const Selection* pNewSel, sal_
rtl::OUString aNewText( ImplGetValidString( rStr ) );
ImplTruncateToMaxLen( aNewText, aSelection.Len() );
- delete mpLayoutData, mpLayoutData = NULL;
+ ImplClearLayoutData();
if ( aSelection.Len() )
maText.Erase( (xub_StrLen)aSelection.Min(), (xub_StrLen)aSelection.Len() );
@@ -1006,7 +1006,7 @@ void Edit::ImplSetText( const XubString& rText, const Selection* pNewSelection )
// wird, dann InsertText, damit flackerfrei.
if ( ( rText.Len() <= mnMaxTextLen ) && ( (rText != maText) || (pNewSelection && (*pNewSelection != maSelection)) ) )
{
- delete mpLayoutData, mpLayoutData = NULL;
+ ImplClearLayoutData();
maSelection.Min() = 0;
maSelection.Max() = maText.Len();
if ( mnXOffset || HasPaintEvent() )
@@ -1637,7 +1637,7 @@ BOOL Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
{
if ( !rKEvt.GetKeyCode().IsMod2() )
{
- delete mpLayoutData, mpLayoutData = NULL;
+ ImplClearLayoutData();
uno::Reference < i18n::XBreakIterator > xBI = ImplGetBreakIterator();
Selection aSel( maSelection );
@@ -1858,7 +1858,7 @@ void Edit::KeyInput( const KeyEvent& rKEvt )
void Edit::FillLayoutData() const
{
- mpLayoutData = new vcl::ControlLayoutData();
+ mpControlData->mpLayoutData = new vcl::ControlLayoutData();
const_cast<Edit*>(this)->ImplRepaint( 0, STRING_LEN, true );
}
@@ -2648,7 +2648,7 @@ void Edit::ImplSetSelection( const Selection& rSelection, BOOL bPaint )
if ( aNew != maSelection )
{
- delete mpLayoutData, mpLayoutData = NULL;
+ ImplClearLayoutData();
maSelection = aNew;
if ( bPaint && ( aOld.Len() || aNew.Len() || IsPaintTransparent() ) )
diff --git a/vcl/source/control/fixed.cxx b/vcl/source/control/fixed.cxx
index ecb066d107ce..3d19e288a1ce 100644
--- a/vcl/source/control/fixed.cxx
+++ b/vcl/source/control/fixed.cxx
@@ -33,7 +33,7 @@
#include <vcl/decoview.hxx>
#include <vcl/event.hxx>
#include <vcl/fixed.hxx>
-#include <vcl/controllayout.hxx>
+#include <vcl/controldata.hxx>
#include <vcl/window.h>
#include <tools/rc.h>
@@ -109,40 +109,25 @@ WinBits FixedText::ImplInitStyle( WinBits nStyle )
return nStyle;
}
+// -----------------------------------------------------------------
+
+const Font& FixedText::GetCanonicalFont( const StyleSettings& _rStyle ) const
+{
+ return ( GetStyle() & WB_INFO ) ? _rStyle.GetInfoFont() : _rStyle.GetLabelFont();
+}
+
+// -----------------------------------------------------------------
+const Color& FixedText::GetCanonicalTextColor( const StyleSettings& _rStyle ) const
+{
+ return ( GetStyle() & WB_INFO ) ? _rStyle.GetInfoTextColor() : _rStyle.GetLabelTextColor();
+}
+
// -----------------------------------------------------------------------
void FixedText::ImplInitSettings( BOOL bFont,
BOOL bForeground, BOOL bBackground )
{
- const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
-
- if ( bFont )
- {
- Font aFont;
- if ( GetStyle() & WB_INFO )
- aFont = rStyleSettings.GetInfoFont();
- else
- aFont = rStyleSettings.GetLabelFont();
- if ( IsControlFont() )
- aFont.Merge( GetControlFont() );
- SetZoomedPointFont( aFont );
- }
-
- if ( bForeground || bFont )
- {
- Color aColor;
- if ( IsControlForeground() )
- aColor = GetControlForeground();
- else
- {
- if ( GetStyle() & WB_INFO )
- aColor = rStyleSettings.GetInfoTextColor();
- else
- aColor = rStyleSettings.GetLabelTextColor();
- }
- SetTextColor( aColor );
- SetTextFillColor();
- }
+ Control::ImplInitSettings( bFont, bForeground );
if ( bBackground )
{
@@ -278,17 +263,13 @@ void FixedText::ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
nTextStyle |= TEXT_DRAW_MONO;
if( bFillLayout )
- {
- mpLayoutData->m_aDisplayText = String();
- pDev->DrawText( Rectangle( aPos, rSize ),
- aText,
- nTextStyle,
- &mpLayoutData->m_aUnicodeBoundRects,
- &mpLayoutData->m_aDisplayText
- );
- }
- else
- pDev->DrawText( Rectangle( aPos, rSize ), aText, nTextStyle );
+ mpControlData->mpLayoutData->m_aDisplayText = String();
+
+ Rectangle aRect( Rectangle( aPos, rSize ) );
+ DrawControlText( *pDev, aRect, aText, nTextStyle,
+ bFillLayout ? &mpControlData->mpLayoutData->m_aUnicodeBoundRects : NULL,
+ bFillLayout ? &mpControlData->mpLayoutData->m_aDisplayText : NULL
+ );
}
// -----------------------------------------------------------------------
@@ -446,7 +427,7 @@ Size FixedText::GetOptimalSize(WindowSizeType eType) const
void FixedText::FillLayoutData() const
{
- mpLayoutData = new vcl::ControlLayoutData();
+ mpControlData->mpLayoutData = new vcl::ControlLayoutData();
ImplDraw( const_cast<FixedText*>(this), 0, Point(), GetOutputSizePixel(), true );
}
@@ -468,31 +449,25 @@ WinBits FixedLine::ImplInitStyle( WinBits nStyle )
return nStyle;
}
+// -----------------------------------------------------------------
+
+const Font& FixedLine::GetCanonicalFont( const StyleSettings& _rStyle ) const
+{
+ return _rStyle.GetGroupFont();
+}
+
+// -----------------------------------------------------------------
+const Color& FixedLine::GetCanonicalTextColor( const StyleSettings& _rStyle ) const
+{
+ return _rStyle.GetGroupTextColor();
+}
+
// -----------------------------------------------------------------------
void FixedLine::ImplInitSettings( BOOL bFont,
BOOL bForeground, BOOL bBackground )
{
- const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
-
- if ( bFont )
- {
- Font aFont = rStyleSettings.GetGroupFont();
- if ( IsControlFont() )
- aFont.Merge( GetControlFont() );
- SetZoomedPointFont( aFont );
- }
-
- if ( bForeground || bFont )
- {
- Color aColor;
- if ( IsControlForeground() )
- aColor = GetControlForeground();
- else
- aColor = rStyleSettings.GetGroupTextColor();
- SetTextColor( aColor );
- SetTextFillColor();
- }
+ Control::ImplInitSettings( bFont, bForeground );
if ( bBackground )
{
@@ -526,8 +501,8 @@ void FixedLine::ImplDraw( bool bLayout )
String aText = GetText();
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
WinBits nWinStyle = GetStyle();
- MetricVector* pVector = bLayout ? &mpLayoutData->m_aUnicodeBoundRects : NULL;
- String* pDisplayText = bLayout ? &mpLayoutData->m_aDisplayText : NULL;
+ MetricVector* pVector = bLayout ? &mpControlData->mpLayoutData->m_aUnicodeBoundRects : NULL;
+ String* pDisplayText = bLayout ? &mpControlData->mpLayoutData->m_aDisplayText : NULL;
if ( rStyleSettings.GetOptions() & STYLE_OPTION_MONO )
SetLineColor( Color( COL_BLACK ) );
@@ -574,8 +549,7 @@ void FixedLine::ImplDraw( bool bLayout )
if ( rStyleSettings.GetOptions() & STYLE_OPTION_MONO )
nStyle |= TEXT_DRAW_MONO;
- aRect = GetTextRect( aRect, aText, nStyle );
- DrawText( aRect, aText, nStyle, pVector, pDisplayText );
+ DrawControlText( *this, aRect, aText, nStyle, pVector, pDisplayText );
if( !pVector )
{
@@ -617,7 +591,7 @@ FixedLine::FixedLine( Window* pParent, const ResId& rResId ) :
void FixedLine::FillLayoutData() const
{
- mpLayoutData = new vcl::ControlLayoutData();
+ mpControlData->mpLayoutData = new vcl::ControlLayoutData();
const_cast<FixedLine*>(this)->ImplDraw( true );
}
diff --git a/vcl/source/control/group.cxx b/vcl/source/control/group.cxx
index a844c2f2eb93..4adc91f88d84 100644
--- a/vcl/source/control/group.cxx
+++ b/vcl/source/control/group.cxx
@@ -32,7 +32,7 @@
#include "precompiled_vcl.hxx"
#include <vcl/event.hxx>
#include <vcl/group.hxx>
-#include <vcl/controllayout.hxx>
+#include <vcl/controldata.hxx>
#ifndef _SV_RC_H
#include <tools/rc.h>
@@ -66,31 +66,25 @@ WinBits GroupBox::ImplInitStyle( WinBits nStyle )
return nStyle;
}
+// -----------------------------------------------------------------
+
+const Font& GroupBox::GetCanonicalFont( const StyleSettings& _rStyle ) const
+{
+ return _rStyle.GetGroupFont();
+}
+
+// -----------------------------------------------------------------
+const Color& GroupBox::GetCanonicalTextColor( const StyleSettings& _rStyle ) const
+{
+ return _rStyle.GetGroupTextColor();
+}
+
// -----------------------------------------------------------------------
void GroupBox::ImplInitSettings( BOOL bFont,
BOOL bForeground, BOOL bBackground )
{
- const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
-
- if ( bFont )
- {
- Font aFont = rStyleSettings.GetGroupFont();
- if ( IsControlFont() )
- aFont.Merge( GetControlFont() );
- SetZoomedPointFont( aFont );
- }
-
- if ( bForeground || bFont )
- {
- Color aColor;
- if ( IsControlForeground() )
- aColor = GetControlForeground();
- else
- aColor = rStyleSettings.GetGroupTextColor();
- SetTextColor( aColor );
- SetTextFillColor();
- }
+ Control::ImplInitSettings( bFont, bForeground );
if ( bBackground )
{
@@ -227,16 +221,16 @@ void GroupBox::ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
}
}
- MetricVector* pVector = bLayout ? &mpLayoutData->m_aUnicodeBoundRects : NULL;
- String* pDisplayText = bLayout ? &mpLayoutData->m_aDisplayText : NULL;
- pDev->DrawText( aRect, aText, nTextStyle, pVector, pDisplayText );
+ MetricVector* pVector = bLayout ? &mpControlData->mpLayoutData->m_aUnicodeBoundRects : NULL;
+ String* pDisplayText = bLayout ? &mpControlData->mpLayoutData->m_aDisplayText : NULL;
+ DrawControlText( *pDev, aRect, aText, nTextStyle, pVector, pDisplayText );
}
// -----------------------------------------------------------------------
void GroupBox::FillLayoutData() const
{
- mpLayoutData = new vcl::ControlLayoutData();
+ mpControlData->mpLayoutData = new vcl::ControlLayoutData();
const_cast<GroupBox*>(this)-> ImplDraw( const_cast<GroupBox*>(this), 0, Point(), GetOutputSizePixel(), true );
}
diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx
index c0a28c8b03fd..a915d8e6b9e8 100644
--- a/vcl/source/control/ilstbox.cxx
+++ b/vcl/source/control/ilstbox.cxx
@@ -40,7 +40,7 @@
#include <vcl/lstbox.h>
#include <vcl/ilstbox.hxx>
#include <vcl/i18nhelp.hxx>
-#include <vcl/controllayout.hxx>
+#include <vcl/controldata.hxx>
#include <vcl/unohelp.hxx>
#ifndef _COM_SUN_STAR_UTIL_XCOLLATOR_HPP_
#include <com/sun/star/i18n/XCollator.hpp>
@@ -647,7 +647,7 @@ void ImplListBoxWindow::Clear()
mnTop = 0;
mnLeft = 0;
mbImgsDiffSz = FALSE;
- delete mpLayoutData, mpLayoutData = NULL;
+ ImplClearLayoutData();
mnCurrentPos = LISTBOX_ENTRY_NOTFOUND;
@@ -656,7 +656,7 @@ void ImplListBoxWindow::Clear()
void ImplListBoxWindow::SetUserItemSize( const Size& rSz )
{
- delete mpLayoutData, mpLayoutData = NULL;
+ ImplClearLayoutData();
maUserItemSize = rSz;
ImplCalcMetrics();
}
@@ -778,7 +778,7 @@ void ImplListBoxWindow::ImplCallSelect()
nMRUCount--;
}
- delete mpLayoutData, mpLayoutData = NULL;
+ ImplClearLayoutData();
ImplEntryType* pNewEntry = new ImplEntryType( aSelected );
pNewEntry->mbIsSelected = bSelectNewEntry;
@@ -798,7 +798,7 @@ void ImplListBoxWindow::ImplCallSelect()
USHORT ImplListBoxWindow::InsertEntry( USHORT nPos, ImplEntryType* pNewEntry )
{
- delete mpLayoutData, mpLayoutData = NULL;
+ ImplClearLayoutData();
USHORT nNewPos = mpEntryList->InsertEntry( nPos, pNewEntry, mbSort );
if( (GetStyle() & WB_WORDBREAK) )
@@ -812,7 +812,7 @@ USHORT ImplListBoxWindow::InsertEntry( USHORT nPos, ImplEntryType* pNewEntry )
void ImplListBoxWindow::RemoveEntry( USHORT nPos )
{
- delete mpLayoutData, mpLayoutData = NULL;
+ ImplClearLayoutData();
mpEntryList->RemoveEntry( nPos );
if( mnCurrentPos >= mpEntryList->GetEntryCount() )
mnCurrentPos = LISTBOX_ENTRY_NOTFOUND;
@@ -1062,7 +1062,7 @@ void ImplListBoxWindow::SelectEntry( USHORT nPos, BOOL bSelect )
ImplPaint( nPos );
if ( !IsVisible( nPos ) )
{
- delete mpLayoutData, mpLayoutData = NULL;
+ ImplClearLayoutData();
USHORT nVisibleEntries = GetLastVisibleEntry()-mnTop;
if ( !nVisibleEntries || !IsReallyVisible() || ( nPos < GetTopEntry() ) )
{
@@ -1233,7 +1233,7 @@ BOOL ImplListBoxWindow::SelectEntries( USHORT nSelect, LB_EVENT_TYPE eLET, BOOL
if( HasFocus() )
ImplShowFocusRect();
}
- delete mpLayoutData, mpLayoutData = NULL;
+ ImplClearLayoutData();
}
return bSelectionChanged;
}
@@ -1838,8 +1838,8 @@ void ImplListBoxWindow::DrawEntry( USHORT nPos, BOOL bDrawImage, BOOL bDrawText,
if( bDrawText )
{
- MetricVector* pVector = bLayout ? &mpLayoutData->m_aUnicodeBoundRects : NULL;
- String* pDisplayText = bLayout ? &mpLayoutData->m_aDisplayText : NULL;
+ MetricVector* pVector = bLayout ? &mpControlData->mpLayoutData->m_aUnicodeBoundRects : NULL;
+ String* pDisplayText = bLayout ? &mpControlData->mpLayoutData->m_aDisplayText : NULL;
XubString aStr( mpEntryList->GetEntryText( nPos ) );
if ( aStr.Len() )
{
@@ -1859,7 +1859,7 @@ void ImplListBoxWindow::DrawEntry( USHORT nPos, BOOL bDrawImage, BOOL bDrawText,
}
if( bLayout )
- mpLayoutData->m_aLineIndices.push_back( mpLayoutData->m_aDisplayText.Len() );
+ mpControlData->mpLayoutData->m_aLineIndices.push_back( mpControlData->mpLayoutData->m_aDisplayText.Len() );
// pb: #106948# explicit mirroring for calc
if ( mbMirroring )
@@ -1900,7 +1900,7 @@ void ImplListBoxWindow::DrawEntry( USHORT nPos, BOOL bDrawImage, BOOL bDrawText,
void ImplListBoxWindow::FillLayoutData() const
{
- mpLayoutData = new vcl::ControlLayoutData();
+ mpControlData->mpLayoutData = new vcl::ControlLayoutData();
const_cast<ImplListBoxWindow*>(this)->
ImplDoPaint( Rectangle( Point( 0, 0 ), GetOutputSize() ), true );
}
@@ -1978,7 +1978,7 @@ void ImplListBoxWindow::Resize()
if ( bShowFocusRect )
ImplShowFocusRect();
- delete mpLayoutData, mpLayoutData = NULL;
+ ImplClearLayoutData();
}
// -----------------------------------------------------------------------
@@ -2034,7 +2034,7 @@ void ImplListBoxWindow::SetTopEntry( USHORT nTop )
if ( nTop != mnTop )
{
- delete mpLayoutData, mpLayoutData = NULL;
+ ImplClearLayoutData();
long nDiff = mpEntryList->GetAddedHeight( mnTop, nTop, 0 );
Update();
ImplHideFocusRect();
@@ -2078,7 +2078,7 @@ void ImplListBoxWindow::ScrollHorz( long n )
if ( nDiff )
{
- delete mpLayoutData, mpLayoutData = NULL;
+ ImplClearLayoutData();
mnLeft = sal::static_int_cast<USHORT>(mnLeft + nDiff);
Update();
ImplHideFocusRect();
@@ -2148,7 +2148,7 @@ void ImplListBoxWindow::StateChanged( StateChangedType nType )
ImplInitSettings( FALSE, FALSE, TRUE );
Invalidate();
}
- delete mpLayoutData, mpLayoutData = NULL;
+ ImplClearLayoutData();
}
// -----------------------------------------------------------------------
@@ -2162,7 +2162,7 @@ void ImplListBoxWindow::DataChanged( const DataChangedEvent& rDCEvt )
((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
(rDCEvt.GetFlags() & SETTINGS_STYLE)) )
{
- delete mpLayoutData, mpLayoutData = NULL;
+ ImplClearLayoutData();
ImplInitSettings( TRUE, TRUE, TRUE );
ImplCalcMetrics();
Invalidate();
@@ -2743,7 +2743,7 @@ void ImplWin::MouseButtonDown( const MouseEvent& )
void ImplWin::FillLayoutData() const
{
- mpLayoutData = new vcl::ControlLayoutData();
+ mpControlData->mpLayoutData = new vcl::ControlLayoutData();
const_cast<ImplWin*>(this)->ImplDraw( true );
}
@@ -2936,8 +2936,8 @@ void ImplWin::DrawEntry( BOOL bDrawImage, BOOL bDrawText, BOOL bDrawTextAtImageP
aTextRect.Left() += nMaxWidth + IMG_TXT_DISTANCE;
}
- MetricVector* pVector = bLayout ? &mpLayoutData->m_aUnicodeBoundRects : NULL;
- String* pDisplayText = bLayout ? &mpLayoutData->m_aDisplayText : NULL;
+ MetricVector* pVector = bLayout ? &mpControlData->mpLayoutData->m_aUnicodeBoundRects : NULL;
+ String* pDisplayText = bLayout ? &mpControlData->mpLayoutData->m_aDisplayText : NULL;
DrawText( aTextRect, maString, nTextStyle, pVector, pDisplayText );
}
diff --git a/vcl/source/control/lstbox.cxx b/vcl/source/control/lstbox.cxx
index a4d3cbc22544..ceabbe4ab166 100644
--- a/vcl/source/control/lstbox.cxx
+++ b/vcl/source/control/lstbox.cxx
@@ -43,7 +43,7 @@
#include "vcl/ilstbox.hxx"
#include "vcl/lstbox.hxx"
#include "vcl/combobox.hxx"
-#include "vcl/controllayout.hxx"
+#include "vcl/controldata.hxx"
#include "tools/debug.hxx"
@@ -719,7 +719,7 @@ void ListBox::Resize()
void ListBox::FillLayoutData() const
{
- mpLayoutData = new vcl::ControlLayoutData();
+ mpControlData->mpLayoutData = new vcl::ControlLayoutData();
const Control* pMainWin = mpImplLB->GetMainWindow();
if( mpFloatWin )
{
@@ -743,7 +743,7 @@ void ListBox::FillLayoutData() const
long ListBox::GetIndexForPoint( const Point& rPoint, USHORT& rPos ) const
{
- if( ! mpLayoutData )
+ if( !HasLayoutData() )
FillLayoutData();
// check whether rPoint fits at all
diff --git a/vcl/source/control/spinfld.cxx b/vcl/source/control/spinfld.cxx
index 0d656da40ba7..1cdaa39298df 100644
--- a/vcl/source/control/spinfld.cxx
+++ b/vcl/source/control/spinfld.cxx
@@ -36,7 +36,7 @@
#include "vcl/decoview.hxx"
#include "vcl/spin.h"
#include "vcl/spinfld.hxx"
-#include "vcl/controllayout.hxx"
+#include "vcl/controldata.hxx"
#include "vcl/svdata.hxx"
// =======================================================================
@@ -637,7 +637,7 @@ void SpinField::FillLayoutData() const
{
if( mbSpin )
{
- mpLayoutData = new vcl::ControlLayoutData();
+ mpControlData->mpLayoutData = new vcl::ControlLayoutData();
AppendLayoutData( *GetSubEdit() );
GetSubEdit()->SetLayoutDataParent( this );
}
diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx
index 561d550b1168..9a34629ddf8e 100644
--- a/vcl/source/control/tabctrl.cxx
+++ b/vcl/source/control/tabctrl.cxx
@@ -45,7 +45,7 @@
#include <vcl/button.hxx>
#include <vcl/tabpage.hxx>
#include <vcl/tabctrl.hxx>
-#include <vcl/controllayout.hxx>
+#include <vcl/controldata.hxx>
#include <vcl/sound.hxx>
#include <vcl/window.h>
@@ -169,31 +169,25 @@ void TabControl::ImplInit( Window* pParent, WinBits nStyle )
EnableChildTransparentMode( TRUE );
}
+// -----------------------------------------------------------------
+
+const Font& TabControl::GetCanonicalFont( const StyleSettings& _rStyle ) const
+{
+ return _rStyle.GetAppFont();
+}
+
+// -----------------------------------------------------------------
+const Color& TabControl::GetCanonicalTextColor( const StyleSettings& _rStyle ) const
+{
+ return _rStyle.GetButtonTextColor();
+}
+
// -----------------------------------------------------------------------
void TabControl::ImplInitSettings( BOOL bFont,
BOOL bForeground, BOOL bBackground )
{
- const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
-
- if ( bFont )
- {
- Font aFont = rStyleSettings.GetAppFont();
- if ( IsControlFont() )
- aFont.Merge( GetControlFont() );
- SetZoomedPointFont( aFont );
- }
-
- if ( bForeground || bFont )
- {
- Color aColor;
- if ( IsControlForeground() )
- aColor = GetControlForeground();
- else
- aColor = rStyleSettings.GetButtonTextColor();
- SetTextColor( aColor );
- SetTextFillColor();
- }
+ Control::ImplInitSettings( bFont, bForeground );
if ( bBackground )
{
@@ -232,9 +226,9 @@ void TabControl::ImplInitSettings( BOOL bFont,
void TabControl::ImplFreeLayoutData()
{
- if( mpLayoutData )
+ if( HasLayoutData() )
{
- delete mpLayoutData, mpLayoutData = NULL;
+ ImplClearLayoutData();
mpTabCtrlData->maLayoutPageIdToLine.clear();
mpTabCtrlData->maLayoutLineToPageId.clear();
}
@@ -864,9 +858,9 @@ void TabControl::ImplDrawItem( ImplTabItem* pItem, const Rectangle& rCurRect, bo
if( bLayout )
{
- if( ! mpLayoutData )
+ if( !HasLayoutData() )
{
- mpLayoutData = new vcl::ControlLayoutData();
+ mpControlData->mpLayoutData = new vcl::ControlLayoutData();
mpTabCtrlData->maLayoutLineToPageId.clear();
mpTabCtrlData->maLayoutPageIdToLine.clear();
mpTabCtrlData->maTabRectangles.clear();
@@ -1010,8 +1004,8 @@ void TabControl::ImplDrawItem( ImplTabItem* pItem, const Rectangle& rCurRect, bo
if( bLayout )
{
- int nLine = mpLayoutData->m_aLineIndices.size();
- mpLayoutData->m_aLineIndices.push_back( mpLayoutData->m_aDisplayText.Len() );
+ int nLine = mpControlData->mpLayoutData->m_aLineIndices.size();
+ mpControlData->mpLayoutData->m_aLineIndices.push_back( mpControlData->mpLayoutData->m_aDisplayText.Len() );
mpTabCtrlData->maLayoutPageIdToLine[ (int)pItem->mnId ] = nLine;
mpTabCtrlData->maLayoutLineToPageId[ nLine ] = (int)pItem->mnId;
mpTabCtrlData->maTabRectangles.push_back( aRect );
@@ -1044,8 +1038,8 @@ void TabControl::ImplDrawItem( ImplTabItem* pItem, const Rectangle& rCurRect, bo
DrawCtrlText( Point( nXPos + aImageSize.Width(), nYPos ),
pItem->maFormatText,
0, STRING_LEN, nStyle,
- bLayout ? &mpLayoutData->m_aUnicodeBoundRects : NULL,
- bLayout ? &mpLayoutData->m_aDisplayText : NULL
+ bLayout ? &mpControlData->mpLayoutData->m_aUnicodeBoundRects : NULL,
+ bLayout ? &mpControlData->mpLayoutData->m_aDisplayText : NULL
);
}
@@ -2108,17 +2102,17 @@ Rectangle TabControl::GetCharacterBounds( USHORT nPageId, long nIndex ) const
{
Rectangle aRet;
- if( ! mpLayoutData || ! mpTabCtrlData->maLayoutPageIdToLine.size() )
+ if( !HasLayoutData() || ! mpTabCtrlData->maLayoutPageIdToLine.size() )
FillLayoutData();
- if( mpLayoutData )
+ if( HasLayoutData() )
{
std::hash_map< int, int >::const_iterator it = mpTabCtrlData->maLayoutPageIdToLine.find( (int)nPageId );
if( it != mpTabCtrlData->maLayoutPageIdToLine.end() )
{
- Pair aPair = mpLayoutData->GetLineStartEnd( it->second );
+ Pair aPair = mpControlData->mpLayoutData->GetLineStartEnd( it->second );
if( (aPair.B() - aPair.A()) >= nIndex )
- aRet = mpLayoutData->GetCharacterBounds( aPair.A() + nIndex );
+ aRet = mpControlData->mpLayoutData->GetCharacterBounds( aPair.A() + nIndex );
}
}
@@ -2131,20 +2125,20 @@ long TabControl::GetIndexForPoint( const Point& rPoint, USHORT& rPageId ) const
{
long nRet = -1;
- if( ! mpLayoutData || ! mpTabCtrlData->maLayoutPageIdToLine.size() )
+ if( !HasLayoutData() || ! mpTabCtrlData->maLayoutPageIdToLine.size() )
FillLayoutData();
- if( mpLayoutData )
+ if( HasLayoutData() )
{
- int nIndex = mpLayoutData->GetIndexForPoint( rPoint );
+ int nIndex = mpControlData->mpLayoutData->GetIndexForPoint( rPoint );
if( nIndex != -1 )
{
// what line (->pageid) is this index in ?
- int nLines = mpLayoutData->GetLineCount();
+ int nLines = mpControlData->mpLayoutData->GetLineCount();
int nLine = -1;
while( ++nLine < nLines )
{
- Pair aPair = mpLayoutData->GetLineStartEnd( nLine );
+ Pair aPair = mpControlData->mpLayoutData->GetLineStartEnd( nLine );
if( aPair.A() <= nIndex && aPair.B() >= nIndex )
{
nRet = nIndex - aPair.A();
@@ -2173,10 +2167,10 @@ Rectangle TabControl::GetTabPageBounds( USHORT nPage ) const
{
Rectangle aRet;
- if( ! mpLayoutData || ! mpTabCtrlData->maLayoutPageIdToLine.size() )
+ if( !HasLayoutData() || ! mpTabCtrlData->maLayoutPageIdToLine.size() )
FillLayoutData();
- if( mpLayoutData )
+ if( HasLayoutData() )
{
std::hash_map< int, int >::const_iterator it = mpTabCtrlData->maLayoutPageIdToLine.find( (int)nPage );
if( it != mpTabCtrlData->maLayoutPageIdToLine.end() )
diff --git a/vcl/source/fontsubset/cff.cxx b/vcl/source/fontsubset/cff.cxx
index e5d83dc0733a..dd198ff521db 100644
--- a/vcl/source/fontsubset/cff.cxx
+++ b/vcl/source/fontsubset/cff.cxx
@@ -332,12 +332,13 @@ struct CffLocal
int mnLocalSubrBase;
int mnLocalSubrCount;
int mnLocalSubrBias;
- int mnNominalWidth;
- int mnDefaultWidth;
+
+ ValType maNominalWidth;
+ ValType maDefaultWidth;
// ATM hinting related values
- int mnStemStdHW;
- int mnStemStdVW;
+ ValType maStemStdHW;
+ ValType maStemStdVW;
ValVector maStemSnapH;
ValVector maStemSnapV;
ValVector maBlueValues;
@@ -461,10 +462,10 @@ public: // TODO: is public really needed?
void getHintPair( int nIndex, ValType* nMin, ValType* nEnd) const;
// accessing other charstring specifics
- bool hasCharWidth( void) const { return (mnCharWidth != -1);}
- int getCharWidth( void) const { return mnCharWidth;}
- void setNominalWidth( int nWidth) { mpCffLocal->mnNominalWidth = nWidth;}
- void setDefaultWidth( int nWidth) { mpCffLocal->mnDefaultWidth = nWidth;}
+ bool hasCharWidth( void) const { return (maCharWidth > 0);}
+ ValType getCharWidth( void) const { return maCharWidth;}
+ void setNominalWidth( ValType aWidth) { mpCffLocal->maNominalWidth = aWidth;}
+ void setDefaultWidth( ValType aWidth) { mpCffLocal->maDefaultWidth = aWidth;}
void updateWidth( bool bUseFirstVal);
private:
@@ -477,7 +478,7 @@ private:
int mnHorzHintSize;
ValType mnHintStack[ NMAXHINTS];
- int mnCharWidth;
+ ValType maCharWidth;
};
// --------------------------------------------------------------------
@@ -488,7 +489,7 @@ CffSubsetterContext::CffSubsetterContext( const U8* pBasePtr, int nBaseLen)
, mnStackIdx(0)
, mnHintSize(0)
, mnHorzHintSize(0)
-, mnCharWidth(-1)
+, maCharWidth(-1)
{
// setCharStringType( 1);
// TODO: new CffLocal[ mnFDAryCount];
@@ -542,13 +543,13 @@ inline void CffSubsetterContext::updateWidth( bool bUseFirstVal)
return;
#endif
if( bUseFirstVal) {
- mnCharWidth = static_cast<int>(mpCffLocal->mnNominalWidth + mnValStack[0]);
+ maCharWidth = mpCffLocal->maNominalWidth + mnValStack[0];
// remove bottom stack entry
--mnStackIdx;
for( int i = 0; i < mnStackIdx; ++i)
mnValStack[ i] = mnValStack[ i+1];
} else {
- mnCharWidth = mpCffLocal->mnDefaultWidth;
+ maCharWidth = mpCffLocal->maDefaultWidth;
}
}
@@ -615,7 +616,7 @@ void CffSubsetterContext::readCharString( const U8* pTypeOps, int nTypeLen)
mnStackIdx = 0;
mnHintSize = 0;
mnHorzHintSize = 0;
- mnCharWidth = -1;
+ maCharWidth = -1;
assert( nTypeLen >= 0);
// assert( nEnd <= getLength());
@@ -659,14 +660,14 @@ void CffSubsetterContext::readDictOp( void)
nVal = popVal();
nInt = static_cast<int>(nVal);
switch( nOpId) {
- case 10: mpCffLocal->mnStemStdHW = nInt; break; // "StdHW"
- case 11: mpCffLocal->mnStemStdVW = nInt; break; // "StdVW"
+ case 10: mpCffLocal->maStemStdHW = nVal; break; // "StdHW"
+ case 11: mpCffLocal->maStemStdVW = nVal; break; // "StdVW"
case 15: mnCharsetBase = nInt; break; // "charset"
case 16: mnEncodingBase = nInt; break; // "nEncoding"
case 17: mnCharStrBase = nInt; break; // "nCharStrings"
case 19: mpCffLocal->mnLocalSubrOffs = nInt; break;// "nSubrs"
- case 20: setDefaultWidth( nInt ); break; // "defaultWidthX"
- case 21: setNominalWidth( nInt ); break; // "nominalWidthX"
+ case 20: setDefaultWidth( nVal ); break; // "defaultWidthX"
+ case 21: setNominalWidth( nVal ); break; // "nominalWidthX"
case 909: mpCffLocal->mfBlueScale = nVal; break; // "BlueScale"
case 910: mpCffLocal->mfBlueShift = nVal; break; // "BlueShift"
case 911: mpCffLocal->mfBlueFuzz = nVal; break; // "BlueFuzz"
@@ -1477,7 +1478,7 @@ int CffSubsetterContext::convert2Type1Ops( CffLocal* pCffLocal, const U8* const
mbSawError = false;
mbNeedClose = false;
mbIgnoreHints = false;
-mnHintSize=mnHorzHintSize=mnStackIdx=0; mnCharWidth=-1;//#######
+mnHintSize=mnHorzHintSize=mnStackIdx=0; maCharWidth=-1;//#######
mnCntrMask = 0;
while( mpReadPtr < mpReadEnd)
convertOneTypeOp();
@@ -1673,10 +1674,10 @@ CffLocal::CffLocal( void)
, mnLocalSubrBase( 0)
, mnLocalSubrCount( 0)
, mnLocalSubrBias( 0)
-, mnNominalWidth( 0)
-, mnDefaultWidth( 0)
-, mnStemStdHW( 0)
-, mnStemStdVW( 0)
+, maNominalWidth( 0)
+, maDefaultWidth( 0)
+, maStemStdHW( 0)
+, maStemStdVW( 0)
, mfBlueScale( 0.0)
, mfBlueShift( 0.0)
, mfBlueFuzz( 0.0)
@@ -2296,8 +2297,8 @@ bool CffSubsetterContext::emitAsType1( Type1Emitter& rEmitter,
nPrivEntryCount += (mpCffLocal->mfBlueShift != 0.0);
nPrivEntryCount += (mpCffLocal->mfBlueFuzz != 0.0);
// emit stem hints only if non-default values
- nPrivEntryCount += (mpCffLocal->mnStemStdHW != 0);
- nPrivEntryCount += (mpCffLocal->mnStemStdVW != 0);
+ nPrivEntryCount += (mpCffLocal->maStemStdHW != 0);
+ nPrivEntryCount += (mpCffLocal->maStemStdVW != 0);
nPrivEntryCount += !mpCffLocal->maStemSnapH.empty();
nPrivEntryCount += !mpCffLocal->maStemSnapV.empty();
// emit other hints only if non-default values
@@ -2337,10 +2338,10 @@ bool CffSubsetterContext::emitAsType1( Type1Emitter& rEmitter,
pOut += sprintf( pOut, "/BlueFuzz %.1f def\n", mpCffLocal->mfBlueFuzz);
// emit stem hint related privdict entries
- if( mpCffLocal->mnStemStdHW)
- pOut += sprintf( pOut, "/StdHW [%d] def\n", mpCffLocal->mnStemStdHW);
- if( mpCffLocal->mnStemStdVW)
- pOut += sprintf( pOut, "/StdVW [%d] def\n", mpCffLocal->mnStemStdVW);
+ if( mpCffLocal->maStemStdHW)
+ pOut += sprintf( pOut, "/StdHW [%g] def\n", mpCffLocal->maStemStdHW);
+ if( mpCffLocal->maStemStdVW)
+ pOut += sprintf( pOut, "/StdVW [%g] def\n", mpCffLocal->maStemStdVW);
rEmitter.emitValVector( "/StemSnapH [", "]ND\n", mpCffLocal->maStemSnapH);
rEmitter.emitValVector( "/StemSnapV [", "]ND\n", mpCffLocal->maStemSnapV);
@@ -2413,8 +2414,12 @@ bool CffSubsetterContext::emitAsType1( Type1Emitter& rEmitter,
pOut += sprintf( pOut, " ND\n");
rEmitter.emitAllCrypted();
// provide individual glyphwidths if requested
- if( pGlyphWidths )
- pGlyphWidths[i] = getCharWidth();
+ if( pGlyphWidths ) {
+ ValType aCharWidth = getCharWidth();
+ if( maFontMatrix.size() >= 4)
+ aCharWidth *= 1000.0F * maFontMatrix[0];
+ pGlyphWidths[i] = static_cast<GlyphWidth>(aCharWidth);
+ }
}
pOut += sprintf( pOut, "end end\nreadonly put\nput\n");
pOut += sprintf( pOut, "dup/FontName get exch definefont pop\n");
@@ -2446,8 +2451,17 @@ bool CffSubsetterContext::emitAsType1( Type1Emitter& rEmitter,
// provide details to the subset requesters, TODO: move into own method?
// note: Top and Bottom are flipped between Type1 and VCL
- rFSInfo.m_aFontBBox = Rectangle( Point( static_cast<long>(maFontBBox[0]), static_cast<long>(maFontBBox[1]) ),
- Point( static_cast<long>(maFontBBox[2]), static_cast<long>(maFontBBox[3]) ) );
+ // note: the rest of VCL expects the details below to be scaled like for an emUnits==1000 font
+ ValType fXFactor = 1.0;
+ ValType fYFactor = 1.0;
+ if( maFontMatrix.size() >= 4) {
+ fXFactor = 1000.0F * maFontMatrix[0];
+ fYFactor = 1000.0F * maFontMatrix[3];
+ }
+ rFSInfo.m_aFontBBox = Rectangle( Point( static_cast<long>(maFontBBox[0] * fXFactor),
+ static_cast<long>(maFontBBox[1] * fYFactor) ),
+ Point( static_cast<long>(maFontBBox[2] * fXFactor),
+ static_cast<long>(maFontBBox[3] * fYFactor) ) );
// PDF-Spec says the values below mean the ink bounds!
// TODO: use better approximations for these ink bounds
rFSInfo.m_nAscent = +rFSInfo.m_aFontBBox.Bottom(); // for capital letters
diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx
index cfcac8851089..4e2ed20a7966 100644
--- a/vcl/source/gdi/bitmapex.cxx
+++ b/vcl/source/gdi/bitmapex.cxx
@@ -47,6 +47,7 @@
#include <tools/rc.h>
#endif
#include <vcl/svapp.hxx>
+#include <vcl/bmpacc.hxx>
// ------------
// - BitmapEx -
@@ -761,6 +762,78 @@ void BitmapEx::Draw( OutputDevice* pOutDev,
// ------------------------------------------------------------------
+sal_uInt8 BitmapEx::GetTransparency(sal_Int32 nX, sal_Int32 nY) const
+{
+ sal_uInt8 nTransparency(0xff);
+
+ if(!aBitmap.IsEmpty())
+ {
+ if(nX >= 0 && nX < aBitmapSize.Width() && nY >= 0 && nY < aBitmapSize.Height())
+ {
+ switch(eTransparent)
+ {
+ case TRANSPARENT_NONE:
+ {
+ // not transparent, ergo all covered
+ nTransparency = 0x00;
+ break;
+ }
+ case TRANSPARENT_COLOR:
+ {
+ Bitmap aTestBitmap(aBitmap);
+ BitmapReadAccess* pRead = aTestBitmap.AcquireReadAccess();
+
+ if(pRead)
+ {
+ const Color aColor = pRead->GetColor(nY, nX);
+
+ // if color is not equal to TransparentColor, we are not transparent
+ if(aColor != aTransparentColor)
+ {
+ nTransparency = 0x00;
+ }
+
+ aTestBitmap.ReleaseAccess(pRead);
+ }
+ break;
+ }
+ case TRANSPARENT_BITMAP:
+ {
+ if(!aMask.IsEmpty())
+ {
+ Bitmap aTestBitmap(aMask);
+ BitmapReadAccess* pRead = aTestBitmap.AcquireReadAccess();
+
+ if(pRead)
+ {
+ const BitmapColor aBitmapColor(pRead->GetPixel(nY, nX));
+
+ if(bAlpha)
+ {
+ nTransparency = aBitmapColor.GetIndex();
+ }
+ else
+ {
+ if(0x00 != aBitmapColor.GetIndex())
+ {
+ nTransparency = 0x00;
+ }
+ }
+
+ aTestBitmap.ReleaseAccess(pRead);
+ }
+ }
+ break;
+ }
+ }
+ }
+ }
+
+ return nTransparency;
+}
+
+// ------------------------------------------------------------------
+
SvStream& operator<<( SvStream& rOStm, const BitmapEx& rBitmapEx )
{
rBitmapEx.aBitmap.Write( rOStm );
diff --git a/vcl/source/gdi/makefile.mk b/vcl/source/gdi/makefile.mk
index a09ae92dcb5e..c77508ea159e 100644
--- a/vcl/source/gdi/makefile.mk
+++ b/vcl/source/gdi/makefile.mk
@@ -51,7 +51,34 @@ CDEFS+=-DENABLE_GRAPHITE
# --- Files --------------------------------------------------------
-SLOFILES= $(SLO)$/salmisc.obj \
+EXCEPTIONSFILES= $(SLO)$/salmisc.obj \
+ $(SLO)$/outdev.obj \
+ $(SLO)$/outdev3.obj \
+ $(SLO)$/gfxlink.obj \
+ $(SLO)$/print.obj \
+ $(SLO)$/print2.obj \
+ $(SLO)$/sallayout.obj \
+ $(SLO)$/image.obj \
+ $(SLO)$/impimage.obj \
+ $(SLO)$/impgraph.obj \
+ $(SLO)$/metric.obj \
+ $(SLO)$/pdfwriter_impl.obj \
+ $(SLO)$/pdffontcache.obj\
+ $(SLO)$/fontcfg.obj \
+ $(SLO)$/bmpconv.obj \
+ $(SLO)$/pdfextoutdevdata.obj \
+ $(SLO)$/fontcvt.obj \
+ $(SLO)$/jobset.obj \
+ $(SLO)$/impimagetree.obj \
+ $(SLO)$/pngread.obj \
+ $(SLO)$/pngwrite.obj \
+ $(SLO)$/virdev.obj \
+ $(SLO)$/impprn.obj \
+ $(SLO)$/gdimtf.obj \
+ $(SLO)$/graphictools.obj \
+ $(SLO)$/textlayout.obj
+
+SLOFILES= $(EXCEPTIONSFILES) \
$(SLO)$/animate.obj \
$(SLO)$/impanmvw.obj \
$(SLO)$/bitmap.obj \
@@ -68,81 +95,30 @@ SLOFILES= $(SLO)$/salmisc.obj \
$(SLO)$/cvtsvm.obj \
$(SLO)$/cvtgrf.obj \
$(SLO)$/font.obj \
- $(SLO)$/gdimtf.obj \
- $(SLO)$/gfxlink.obj \
$(SLO)$/gradient.obj \
$(SLO)$/hatch.obj \
$(SLO)$/graph.obj \
- $(SLO)$/image.obj \
- $(SLO)$/impimage.obj \
$(SLO)$/impbmp.obj \
- $(SLO)$/impgraph.obj \
- $(SLO)$/impimagetree.obj \
$(SLO)$/imagerepository.obj \
- $(SLO)$/impprn.obj \
$(SLO)$/impvect.obj \
$(SLO)$/implncvt.obj \
- $(SLO)$/jobset.obj \
$(SLO)$/lineinfo.obj \
$(SLO)$/mapmod.obj \
$(SLO)$/metaact.obj \
- $(SLO)$/metric.obj \
$(SLO)$/octree.obj \
$(SLO)$/outmap.obj \
- $(SLO)$/outdev.obj \
$(SLO)$/outdev2.obj \
- $(SLO)$/outdev3.obj \
$(SLO)$/outdev4.obj \
$(SLO)$/outdev5.obj \
$(SLO)$/outdev6.obj \
- $(SLO)$/virdev.obj \
- $(SLO)$/fontcvt.obj \
- $(SLO)$/print.obj \
- $(SLO)$/print2.obj \
$(SLO)$/regband.obj \
$(SLO)$/region.obj \
$(SLO)$/wall.obj \
- $(SLO)$/fontcfg.obj \
$(SLO)$/base14.obj \
$(SLO)$/pdfwriter.obj \
- $(SLO)$/pdfwriter_impl.obj \
- $(SLO)$/pdffontcache.obj\
- $(SLO)$/sallayout.obj \
$(SLO)$/salgdilayout.obj \
$(SLO)$/extoutdevdata.obj \
- $(SLO)$/pdfextoutdevdata.obj \
- $(SLO)$/salnativewidgets-none.obj \
- $(SLO)$/bmpconv.obj \
- $(SLO)$/pngread.obj \
- $(SLO)$/pngwrite.obj \
- $(SLO)$/graphictools.obj
-
-EXCEPTIONSFILES= $(SLO)$/salmisc.obj \
- $(SLO)$/outdev.obj \
- $(SLO)$/outdev3.obj \
- $(SLO)$/gfxlink.obj \
- $(SLO)$/print.obj \
- $(SLO)$/print2.obj \
- $(SLO)$/sallayout.obj \
- $(SLO)$/image.obj \
- $(SLO)$/impimage.obj \
- $(SLO)$/impgraph.obj \
- $(SLO)$/metric.obj \
- $(SLO)$/pdfwriter_impl.obj \
- $(SLO)$/pdffontcache.obj\
- $(SLO)$/fontcfg.obj \
- $(SLO)$/bmpconv.obj \
- $(SLO)$/pdfextoutdevdata.obj \
- $(SLO)$/fontcvt.obj \
- $(SLO)$/jobset.obj \
- $(SLO)$/impimagetree.obj \
- $(SLO)$/pngread.obj \
- $(SLO)$/pngwrite.obj \
- $(SLO)$/virdev.obj \
- $(SLO)$/impprn.obj \
- $(SLO)$/gdimtf.obj \
- $(SLO)$/graphictools.obj
-
+ $(SLO)$/salnativewidgets-none.obj
# --- Targets ------------------------------------------------------
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index 8a057b3f3c7b..b6e0e1b8d441 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -61,6 +61,7 @@
#include <vcl/edit.hxx>
#include <vcl/fontcfg.hxx>
#include <vcl/sysdata.hxx>
+#include <vcl/textlayout.hxx>
#ifndef _OSL_FILE_H
#include <osl/file.h>
#endif
@@ -5257,7 +5258,7 @@ void OutputDevice::ImplDrawText( SalLayout& rSalLayout )
long OutputDevice::ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo,
long nWidth, const XubString& rStr,
- USHORT nStyle ) const
+ USHORT nStyle, const ::vcl::ITextLayout& _rLayout )
{
DBG_ASSERTWARNING( nWidth >= 0, "ImplGetTextLines: nWidth <= 0!" );
@@ -5295,7 +5296,7 @@ long OutputDevice::ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo,
while ( ( nBreakPos < nLen ) && ( rStr.GetChar( nBreakPos ) != _CR ) && ( rStr.GetChar( nBreakPos ) != _LF ) )
nBreakPos++;
- long nLineWidth = GetTextWidth( rStr, nPos, nBreakPos-nPos );
+ long nLineWidth = _rLayout.GetTextWidth( rStr, nPos, nBreakPos-nPos );
if ( ( nLineWidth > nWidth ) && ( nStyle & TEXT_DRAW_WORDBREAK ) )
{
if ( !xBI.is() )
@@ -5304,7 +5305,7 @@ long OutputDevice::ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo,
if ( xBI.is() )
{
const com::sun::star::lang::Locale& rDefLocale(Application::GetSettings().GetUILocale());
- xub_StrLen nSoftBreak = GetTextBreak( rStr, nWidth, nPos, nBreakPos - nPos );
+ xub_StrLen nSoftBreak = _rLayout.GetTextBreak( rStr, nWidth, nPos, nBreakPos - nPos );
DBG_ASSERT( nSoftBreak < nBreakPos, "Break?!" );
//aHyphOptions.hyphenIndex = nSoftBreak;
i18n::LineBreakResults aLBR = xBI->getLineBreak( aText, nSoftBreak, rDefLocale, nPos, aHyphOptions, aUserOptions );
@@ -5408,7 +5409,7 @@ long OutputDevice::ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo,
} // if ( xHyph.is() )
} // if ( (nStyle & TEXT_DRAW_WORDBREAK_HYPHENATION) == TEXT_DRAW_WORDBREAK_HYPHENATION )
}
- nLineWidth = GetTextWidth( rStr, nPos, nBreakPos-nPos );
+ nLineWidth = _rLayout.GetTextWidth( rStr, nPos, nBreakPos-nPos );
}
else
{
@@ -5422,14 +5423,14 @@ long OutputDevice::ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo,
{
if( nSpacePos > nPos )
nSpacePos--;
- nW = GetTextWidth( rStr, nPos, nSpacePos-nPos );
+ nW = _rLayout.GetTextWidth( rStr, nPos, nSpacePos-nPos );
}
} while( nW > nWidth );
if( nSpacePos != STRING_NOTFOUND )
{
nBreakPos = nSpacePos;
- nLineWidth = GetTextWidth( rStr, nPos, nBreakPos-nPos );
+ nLineWidth = _rLayout.GetTextWidth( rStr, nPos, nBreakPos-nPos );
if( nBreakPos < rStr.Len()-1 )
nBreakPos++;
}
@@ -6159,6 +6160,10 @@ void OutputDevice::DrawTextArray( const Point& rStartPt, const String& rStr,
if ( !IsDeviceOutputNecessary() )
return;
+ if( mbInitClipRegion )
+ ImplInitClipRegion();
+ if( mbOutputClipped )
+ return;
SalLayout* pSalLayout = ImplLayout( rStr, nIndex, nLen, rStartPt, 0, pDXAry, true );
if( pSalLayout )
@@ -6771,9 +6776,10 @@ xub_StrLen OutputDevice::GetTextBreak( const String& rStr, long nTextWidth,
// -----------------------------------------------------------------------
-void OutputDevice::ImplDrawText( const Rectangle& rRect,
+void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& rRect,
const String& rOrigStr, USHORT nStyle,
- MetricVector* pVector, String* pDisplayText )
+ MetricVector* pVector, String* pDisplayText,
+ ::vcl::ITextLayout& _rLayout )
{
Color aOldTextColor;
Color aOldTextFillColor;
@@ -6782,12 +6788,12 @@ void OutputDevice::ImplDrawText( const Rectangle& rRect,
{
BOOL bHighContrastBlack = FALSE;
BOOL bHighContrastWhite = FALSE;
- const StyleSettings& rStyleSettings( GetSettings().GetStyleSettings() );
+ const StyleSettings& rStyleSettings( rTargetDevice.GetSettings().GetStyleSettings() );
if( rStyleSettings.GetHighContrastMode() )
{
Color aCol;
- if( IsBackground() )
- aCol = GetBackground().GetColor();
+ if( rTargetDevice.IsBackground() )
+ aCol = rTargetDevice.GetBackground().GetColor();
else
// best guess is the face color here
// but it may be totally wrong. the background color
@@ -6798,16 +6804,16 @@ void OutputDevice::ImplDrawText( const Rectangle& rRect,
bHighContrastWhite = aCol.IsBright();
}
- aOldTextColor = GetTextColor();
- if ( IsTextFillColor() )
+ aOldTextColor = rTargetDevice.GetTextColor();
+ if ( rTargetDevice.IsTextFillColor() )
{
bRestoreFillColor = TRUE;
- aOldTextFillColor = GetTextFillColor();
+ aOldTextFillColor = rTargetDevice.GetTextFillColor();
}
if( bHighContrastBlack )
- SetTextColor( COL_GREEN );
+ rTargetDevice.SetTextColor( COL_GREEN );
else if( bHighContrastWhite )
- SetTextColor( COL_LIGHTGREEN );
+ rTargetDevice.SetTextColor( COL_LIGHTGREEN );
else
{
// draw disabled text always without shadow
@@ -6818,7 +6824,7 @@ void OutputDevice::ImplDrawText( const Rectangle& rRect,
aRect.Move( 1, 1 );
DrawText( aRect, rOrigStr, nStyle & ~TEXT_DRAW_DISABLE );
*/
- SetTextColor( GetSettings().GetStyleSettings().GetDisableColor() );
+ rTargetDevice.SetTextColor( rTargetDevice.GetSettings().GetStyleSettings().GetDisableColor() );
}
}
@@ -6830,14 +6836,16 @@ void OutputDevice::ImplDrawText( const Rectangle& rRect,
Point aPos = rRect.TopLeft();
- long nTextHeight = GetTextHeight();
- TextAlign eAlign = GetTextAlign();
+ long nTextHeight = rTargetDevice.GetTextHeight();
+ TextAlign eAlign = rTargetDevice.GetTextAlign();
xub_StrLen nMnemonicPos = STRING_NOTFOUND;
String aStr = rOrigStr;
if ( nStyle & TEXT_DRAW_MNEMONIC )
aStr = GetNonMnemonicString( aStr, nMnemonicPos );
+ const bool bDrawMnemonics = !(rTargetDevice.GetSettings().GetStyleSettings().GetOptions() & STYLE_OPTION_NOMNEMONICS) && !pVector;
+
// Mehrzeiligen Text behandeln wir anders
if ( nStyle & TEXT_DRAW_MULTILINE )
{
@@ -6852,7 +6860,7 @@ void OutputDevice::ImplDrawText( const Rectangle& rRect,
if ( nTextHeight )
{
- nMaxTextWidth = ImplGetTextLines( aMultiLineInfo, nWidth, aStr, nStyle );
+ nMaxTextWidth = ImplGetTextLines( aMultiLineInfo, nWidth, aStr, nStyle, _rLayout );
nLines = (xub_StrLen)(nHeight/nTextHeight);
nFormatLines = aMultiLineInfo.Count();
if ( !nLines )
@@ -6874,7 +6882,7 @@ void OutputDevice::ImplDrawText( const Rectangle& rRect,
if ( aLastLine.GetChar( i ) == _LF )
aLastLine.SetChar( i, ' ' );
}
- aLastLine = GetEllipsisString( aLastLine, nWidth, nStyle );
+ aLastLine = ImplGetEllipsisString( rTargetDevice, aLastLine, nWidth, nStyle, _rLayout );
nStyle &= ~(TEXT_DRAW_VCENTER | TEXT_DRAW_BOTTOM);
nStyle |= TEXT_DRAW_TOP;
}
@@ -6892,8 +6900,8 @@ void OutputDevice::ImplDrawText( const Rectangle& rRect,
// Clipping setzen
if ( nStyle & TEXT_DRAW_CLIP )
{
- Push( PUSH_CLIPREGION );
- IntersectClipRegion( rRect );
+ rTargetDevice.Push( PUSH_CLIPREGION );
+ rTargetDevice.IntersectClipRegion( rRect );
}
// Vertikales Alignment
@@ -6906,7 +6914,7 @@ void OutputDevice::ImplDrawText( const Rectangle& rRect,
if ( eAlign == ALIGN_BOTTOM )
aPos.Y() += nTextHeight;
else if ( eAlign == ALIGN_BASELINE )
- aPos.Y() += GetFontMetric().GetAscent();
+ aPos.Y() += rTargetDevice.GetFontMetric().GetAscent();
// Alle Zeilen ausgeben, bis auf die letzte
for ( i = 0; i < nFormatLines; i++ )
@@ -6918,8 +6926,8 @@ void OutputDevice::ImplDrawText( const Rectangle& rRect,
aPos.X() += (nWidth-pLineInfo->GetWidth())/2;
xub_StrLen nIndex = pLineInfo->GetIndex();
xub_StrLen nLineLen = pLineInfo->GetLen();
- DrawText( aPos, aStr, nIndex, nLineLen, pVector, pDisplayText );
- if ( !(GetSettings().GetStyleSettings().GetOptions() & STYLE_OPTION_NOMNEMONICS) && !pVector )
+ _rLayout.DrawText( aPos, aStr, nIndex, nLineLen, pVector, pDisplayText );
+ if ( bDrawMnemonics )
{
if ( (nMnemonicPos >= nIndex) && (nMnemonicPos < nIndex+nLineLen) )
{
@@ -6928,16 +6936,16 @@ void OutputDevice::ImplDrawText( const Rectangle& rRect,
long nMnemonicWidth;
sal_Int32* pCaretXArray = (sal_Int32*) alloca( 2 * sizeof(sal_Int32) * nLineLen );
- /*BOOL bRet =*/ GetCaretPositions( aStr, pCaretXArray,
- nIndex, nLineLen);
+ /*BOOL bRet =*/ _rLayout.GetCaretPositions( aStr, pCaretXArray,
+ nIndex, nLineLen );
long lc_x1 = pCaretXArray[2*(nMnemonicPos - nIndex)];
long lc_x2 = pCaretXArray[2*(nMnemonicPos - nIndex)+1];
- nMnemonicWidth = ::abs((int)(lc_x1 - lc_x2));
+ nMnemonicWidth = rTargetDevice.ImplLogicWidthToDevicePixel( ::abs((int)(lc_x1 - lc_x2)) );
- Point aTempPos = LogicToPixel( aPos );
- nMnemonicX = mnOutOffX + aTempPos.X() + ImplLogicWidthToDevicePixel( Min( lc_x1, lc_x2 ) );
- nMnemonicY = mnOutOffY + aTempPos.Y() + ImplLogicWidthToDevicePixel( GetFontMetric().GetAscent() );
- ImplDrawMnemonicLine( nMnemonicX, nMnemonicY, nMnemonicWidth );
+ Point aTempPos = rTargetDevice.LogicToPixel( aPos );
+ nMnemonicX = rTargetDevice.GetOutOffXPixel() + aTempPos.X() + rTargetDevice.ImplLogicWidthToDevicePixel( Min( lc_x1, lc_x2 ) );
+ nMnemonicY = rTargetDevice.GetOutOffYPixel() + aTempPos.Y() + rTargetDevice.ImplLogicWidthToDevicePixel( rTargetDevice.GetFontMetric().GetAscent() );
+ rTargetDevice.ImplDrawMnemonicLine( nMnemonicX, nMnemonicY, nMnemonicWidth );
}
}
aPos.Y() += nTextHeight;
@@ -6948,26 +6956,26 @@ void OutputDevice::ImplDrawText( const Rectangle& rRect,
// Gibt es noch eine letzte Zeile, dann diese linksbuendig ausgeben,
// da die Zeile gekuerzt wurde
if ( aLastLine.Len() )
- DrawText( aPos, aLastLine, 0, STRING_LEN, pVector, pDisplayText );
+ _rLayout.DrawText( aPos, aLastLine, 0, STRING_LEN, pVector, pDisplayText );
// Clipping zuruecksetzen
if ( nStyle & TEXT_DRAW_CLIP )
- Pop();
+ rTargetDevice.Pop();
}
}
else
{
- long nTextWidth = GetTextWidth( aStr );
+ long nTextWidth = _rLayout.GetTextWidth( aStr, 0, STRING_LEN );
// Evt. Text kuerzen
if ( nTextWidth > nWidth )
{
if ( nStyle & TEXT_DRAW_ELLIPSIS )
{
- aStr = GetEllipsisString( aStr, nWidth, nStyle );
+ aStr = ImplGetEllipsisString( rTargetDevice, aStr, nWidth, nStyle, _rLayout );
nStyle &= ~(TEXT_DRAW_CENTER | TEXT_DRAW_RIGHT);
nStyle |= TEXT_DRAW_LEFT;
- nTextWidth = GetTextWidth( aStr );
+ nTextWidth = _rLayout.GetTextWidth( aStr, 0, aStr.Len() );
}
}
else
@@ -6986,7 +6994,7 @@ void OutputDevice::ImplDrawText( const Rectangle& rRect,
if ( eAlign == ALIGN_BOTTOM )
aPos.Y() += nTextHeight;
else if ( eAlign == ALIGN_BASELINE )
- aPos.Y() += GetFontMetric().GetAscent();
+ aPos.Y() += rTargetDevice.GetFontMetric().GetAscent();
if ( nStyle & TEXT_DRAW_BOTTOM )
aPos.Y() += nHeight-nTextHeight;
@@ -6999,44 +7007,44 @@ void OutputDevice::ImplDrawText( const Rectangle& rRect,
if ( nMnemonicPos != STRING_NOTFOUND )
{
sal_Int32* pCaretXArray = (sal_Int32*) alloca( 2 * sizeof(sal_Int32) * aStr.Len() );
- /*BOOL bRet =*/ GetCaretPositions( aStr, pCaretXArray, 0, aStr.Len() );
+ /*BOOL bRet =*/ _rLayout.GetCaretPositions( aStr, pCaretXArray, 0, aStr.Len() );
long lc_x1 = pCaretXArray[2*(nMnemonicPos)];
long lc_x2 = pCaretXArray[2*(nMnemonicPos)+1];
- nMnemonicWidth = ::abs((int)(lc_x1 - lc_x2));
+ nMnemonicWidth = rTargetDevice.ImplLogicWidthToDevicePixel( ::abs((int)(lc_x1 - lc_x2)) );
- Point aTempPos = LogicToPixel( aPos );
- nMnemonicX = mnOutOffX + aTempPos.X() + ImplLogicWidthToDevicePixel( Min(lc_x1, lc_x2) );
- nMnemonicY = mnOutOffY + aTempPos.Y() + ImplLogicWidthToDevicePixel( GetFontMetric().GetAscent() );
+ Point aTempPos = rTargetDevice.LogicToPixel( aPos );
+ nMnemonicX = rTargetDevice.GetOutOffXPixel() + aTempPos.X() + rTargetDevice.ImplLogicWidthToDevicePixel( Min(lc_x1, lc_x2) );
+ nMnemonicY = rTargetDevice.GetOutOffYPixel() + aTempPos.Y() + rTargetDevice.ImplLogicWidthToDevicePixel( rTargetDevice.GetFontMetric().GetAscent() );
}
if ( nStyle & TEXT_DRAW_CLIP )
{
- Push( PUSH_CLIPREGION );
- IntersectClipRegion( rRect );
- DrawText( aPos, aStr, 0, STRING_LEN, pVector, pDisplayText );
- if ( !(GetSettings().GetStyleSettings().GetOptions() & STYLE_OPTION_NOMNEMONICS) && !pVector )
+ rTargetDevice.Push( PUSH_CLIPREGION );
+ rTargetDevice.IntersectClipRegion( rRect );
+ _rLayout.DrawText( aPos, aStr, 0, STRING_LEN, pVector, pDisplayText );
+ if ( bDrawMnemonics )
{
if ( nMnemonicPos != STRING_NOTFOUND )
- ImplDrawMnemonicLine( nMnemonicX, nMnemonicY, nMnemonicWidth );
+ rTargetDevice.ImplDrawMnemonicLine( nMnemonicX, nMnemonicY, nMnemonicWidth );
}
- Pop();
+ rTargetDevice.Pop();
}
else
{
- DrawText( aPos, aStr, 0, STRING_LEN, pVector, pDisplayText );
- if ( !(GetSettings().GetStyleSettings().GetOptions() & STYLE_OPTION_NOMNEMONICS) && !pVector )
+ _rLayout.DrawText( aPos, aStr, 0, STRING_LEN, pVector, pDisplayText );
+ if ( bDrawMnemonics )
{
if ( nMnemonicPos != STRING_NOTFOUND )
- ImplDrawMnemonicLine( nMnemonicX, nMnemonicY, nMnemonicWidth );
+ rTargetDevice.ImplDrawMnemonicLine( nMnemonicX, nMnemonicY, nMnemonicWidth );
}
}
}
if ( nStyle & TEXT_DRAW_DISABLE && !pVector )
{
- SetTextColor( aOldTextColor );
+ rTargetDevice.SetTextColor( aOldTextColor );
if ( bRestoreFillColor )
- SetTextFillColor( aOldTextFillColor );
+ rTargetDevice.SetTextFillColor( aOldTextFillColor );
}
}
@@ -7069,7 +7077,8 @@ void OutputDevice::AddTextRectActions( const Rectangle& rRect,
// #i47157# Factored out to ImplDrawTextRect(), to be shared
// between us and DrawText()
- ImplDrawText( rRect, rOrigStr, nStyle, NULL, NULL );
+ DefaultTextLayout aLayout( *this );
+ ImplDrawText( *this, rRect, rOrigStr, nStyle, NULL, NULL, aLayout );
// and restore again
EnableOutput( bOutputEnabled );
@@ -7078,10 +7087,9 @@ void OutputDevice::AddTextRectActions( const Rectangle& rRect,
// -----------------------------------------------------------------------
-void OutputDevice::DrawText( const Rectangle& rRect,
- const String& rOrigStr, USHORT nStyle,
- MetricVector* pVector, String* pDisplayText )
-
+void OutputDevice::DrawText( const Rectangle& rRect, const String& rOrigStr, USHORT nStyle,
+ MetricVector* pVector, String* pDisplayText,
+ ::vcl::ITextLayout* _pTextLayout )
{
if( mpOutDevData && mpOutDevData->mpRecordLayout )
{
@@ -7092,10 +7100,11 @@ void OutputDevice::DrawText( const Rectangle& rRect,
DBG_TRACE( "OutputDevice::DrawText( const Rectangle& )" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
- if ( mpMetaFile )
+ bool bDecomposeTextRectAction = ( _pTextLayout != NULL ) && _pTextLayout->DecomposeTextRectAction();
+ if ( mpMetaFile && !bDecomposeTextRectAction )
mpMetaFile->AddAction( new MetaTextRectAction( rRect, rOrigStr, nStyle ) );
- if ( ( !IsDeviceOutputNecessary() && ! pVector ) || !rOrigStr.Len() || rRect.IsEmpty() )
+ if ( ( !IsDeviceOutputNecessary() && !pVector && !bDecomposeTextRectAction ) || !rOrigStr.Len() || rRect.IsEmpty() )
return;
// we need a graphics
@@ -7103,17 +7112,19 @@ void OutputDevice::DrawText( const Rectangle& rRect,
return;
if( mbInitClipRegion )
ImplInitClipRegion();
- if( mbOutputClipped )
+ if( mbOutputClipped && !bDecomposeTextRectAction )
return;
// temporarily disable mtf action generation (ImplDrawText _does_
// create META_TEXT_ACTIONs otherwise)
GDIMetaFile* pMtf = mpMetaFile;
- mpMetaFile = NULL;
+ if ( !bDecomposeTextRectAction )
+ mpMetaFile = NULL;
- // #i47157# Factored out to ImplDrawTextRect(), to be used also
+ // #i47157# Factored out to ImplDrawText(), to be used also
// from AddTextRectActions()
- ImplDrawText( rRect, rOrigStr, nStyle, pVector, pDisplayText );
+ DefaultTextLayout aDefaultLayout( *this );
+ ImplDrawText( *this, rRect, rOrigStr, nStyle, pVector, pDisplayText, _pTextLayout ? *_pTextLayout : aDefaultLayout );
// and enable again
mpMetaFile = pMtf;
@@ -7125,8 +7136,9 @@ void OutputDevice::DrawText( const Rectangle& rRect,
// -----------------------------------------------------------------------
Rectangle OutputDevice::GetTextRect( const Rectangle& rRect,
- const String& rOrigStr, USHORT nStyle,
- TextRectInfo* pInfo ) const
+ const XubString& rStr, USHORT nStyle,
+ TextRectInfo* pInfo,
+ const ::vcl::ITextLayout* _pTextLayout ) const
{
DBG_TRACE( "OutputDevice::GetTextRect()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
@@ -7137,7 +7149,7 @@ Rectangle OutputDevice::GetTextRect( const Rectangle& rRect,
long nMaxWidth;
long nTextHeight = GetTextHeight();
- String aStr = rOrigStr;
+ String aStr = rStr;
if ( nStyle & TEXT_DRAW_MNEMONIC )
aStr = GetNonMnemonicString( aStr );
@@ -7149,7 +7161,8 @@ Rectangle OutputDevice::GetTextRect( const Rectangle& rRect,
xub_StrLen i;
nMaxWidth = 0;
- ImplGetTextLines( aMultiLineInfo, nWidth, aStr, nStyle );
+ DefaultTextLayout aDefaultLayout( *const_cast< OutputDevice* >( this ) );
+ ImplGetTextLines( aMultiLineInfo, nWidth, aStr, nStyle, _pTextLayout ? *_pTextLayout : aDefaultLayout );
nFormatLines = aMultiLineInfo.Count();
if ( !nTextHeight )
nTextHeight = 1;
@@ -7197,7 +7210,7 @@ Rectangle OutputDevice::GetTextRect( const Rectangle& rRect,
else
{
nLines = 1;
- nMaxWidth = GetTextWidth( aStr );
+ nMaxWidth = _pTextLayout ? _pTextLayout->GetTextWidth( aStr, 0, aStr.Len() ) : GetTextWidth( aStr );
if ( pInfo )
{
@@ -7256,11 +7269,20 @@ static BOOL ImplIsCharIn( xub_Unicode c, const sal_Char* pStr )
String OutputDevice::GetEllipsisString( const String& rOrigStr, long nMaxWidth,
USHORT nStyle ) const
{
- DBG_TRACE( "OutputDevice::GetEllipsisString()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
+ DefaultTextLayout aTextLayout( *const_cast< OutputDevice* >( this ) );
+ return ImplGetEllipsisString( *this, rOrigStr, nMaxWidth, nStyle, aTextLayout );
+}
+
+// -----------------------------------------------------------------------
+
+String OutputDevice::ImplGetEllipsisString( const OutputDevice& rTargetDevice, const XubString& rOrigStr, long nMaxWidth,
+ USHORT nStyle, const ::vcl::ITextLayout& _rLayout )
+{
+ DBG_TRACE( "OutputDevice::ImplGetEllipsisString()" );
String aStr = rOrigStr;
- xub_StrLen nIndex = GetTextBreak( aStr, nMaxWidth );
+ xub_StrLen nIndex = _rLayout.GetTextBreak( aStr, nMaxWidth, 0, aStr.Len() );
if ( nIndex != STRING_LEN )
@@ -7271,7 +7293,7 @@ String OutputDevice::GetEllipsisString( const String& rOrigStr, long nMaxWidth,
if ( nIndex > 1 )
{
aStr.AppendAscii( "..." );
- while ( aStr.Len() && (GetTextWidth( aStr ) > nMaxWidth) )
+ while ( aStr.Len() && (_rLayout.GetTextWidth( aStr, 0, aStr.Len() ) > nMaxWidth) )
{
if ( (nIndex > 1) || (nIndex == aStr.Len()) )
nIndex--;
@@ -7307,8 +7329,8 @@ String OutputDevice::GetEllipsisString( const String& rOrigStr, long nMaxWidth,
XubString aLastStr( aStr, nLastContent, aStr.Len() );
XubString aTempLastStr1( RTL_CONSTASCII_USTRINGPARAM( "..." ) );
aTempLastStr1 += aLastStr;
- if ( GetTextWidth( aTempLastStr1 ) > nMaxWidth )
- aStr = GetEllipsisString( aStr, nMaxWidth, nStyle | TEXT_DRAW_ENDELLIPSIS );
+ if ( _rLayout.GetTextWidth( aTempLastStr1, 0, aTempLastStr1.Len() ) > nMaxWidth )
+ aStr = OutputDevice::ImplGetEllipsisString( rTargetDevice, aStr, nMaxWidth, nStyle | TEXT_DRAW_ENDELLIPSIS, _rLayout );
else
{
USHORT nFirstContent = 0;
@@ -7323,7 +7345,7 @@ String OutputDevice::GetEllipsisString( const String& rOrigStr, long nMaxWidth,
nFirstContent++;
if ( nFirstContent >= nLastContent )
- aStr = GetEllipsisString( aStr, nMaxWidth, nStyle | TEXT_DRAW_ENDELLIPSIS );
+ aStr = OutputDevice::ImplGetEllipsisString( rTargetDevice, aStr, nMaxWidth, nStyle | TEXT_DRAW_ENDELLIPSIS, _rLayout );
else
{
if ( nFirstContent > 4 )
@@ -7332,8 +7354,8 @@ String OutputDevice::GetEllipsisString( const String& rOrigStr, long nMaxWidth,
aFirstStr.AppendAscii( "..." );
XubString aTempStr = aFirstStr;
aTempStr += aLastStr;
- if ( GetTextWidth( aTempStr ) > nMaxWidth )
- aStr = GetEllipsisString( aStr, nMaxWidth, nStyle | TEXT_DRAW_ENDELLIPSIS );
+ if ( _rLayout.GetTextWidth( aTempStr, 0, aTempStr.Len() ) > nMaxWidth )
+ aStr = OutputDevice::ImplGetEllipsisString( rTargetDevice, aStr, nMaxWidth, nStyle | TEXT_DRAW_ENDELLIPSIS, _rLayout );
else
{
do
@@ -7357,7 +7379,7 @@ String OutputDevice::GetEllipsisString( const String& rOrigStr, long nMaxWidth,
XubString aTempLastStr( aStr, nLastContent, aStr.Len() );
aTempStr = aFirstStr;
aTempStr += aTempLastStr;
- if ( GetTextWidth( aTempStr ) > nMaxWidth )
+ if ( _rLayout.GetTextWidth( aTempStr, 0, aTempStr.Len() ) > nMaxWidth )
break;
}
}
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index dc3ead5d2d6f..d4fc6fa27117 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -41,7 +41,6 @@
#include <tools/debug.hxx>
#include <tools/zcodec.hxx>
#include <tools/stream.hxx>
-#include <tools/urlobj.hxx> //for relative url
#include <i18npool/mslangid.hxx>
#include <vcl/virdev.hxx>
#include <vcl/bmpacc.hxx>
@@ -51,6 +50,7 @@
#include <vcl/sallayout.hxx>
#include <vcl/metric.hxx>
#include <vcl/fontsubset.hxx>
+#include <vcl/textlayout.hxx>
#include <svsys.h>
#include <vcl/salgdi.hxx>
#include <vcl/svapp.hxx>
@@ -7310,7 +7310,8 @@ void PDFWriterImpl::drawText( const Rectangle& rRect, const String& rOrigStr, US
if ( nTextHeight )
{
- nMaxTextWidth = m_pReferenceDevice->ImplGetTextLines( aMultiLineInfo, nWidth, aStr, nStyle );
+ ::vcl::DefaultTextLayout aLayout( *m_pReferenceDevice );
+ nMaxTextWidth = OutputDevice::ImplGetTextLines( aMultiLineInfo, nWidth, aStr, nStyle, aLayout );
nLines = (xub_StrLen)(nHeight/nTextHeight);
nFormatLines = aMultiLineInfo.Count();
if ( !nLines )
diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx
index 21ac05a498fc..1f44b823ce44 100755
--- a/vcl/source/gdi/sallayout.cxx
+++ b/vcl/source/gdi/sallayout.cxx
@@ -95,11 +95,12 @@ bool IsDiacritic( sal_UCS4 nChar )
if( nChar >= 0x2100 )
return false;
+ // TODO: #i105058# use icu uchar.h's character classification instead of the handcrafted table
struct DiaRange { sal_UCS4 mnMin, mnEnd;};
static const DiaRange aRanges[] = {
{0x0300, 0x0370},
- {0x0590, 0x05C0}, {0x05C1, 0x05C3}, {0x05C3, 0x05C6}, {0x05C7, 0x05C8},
- {0x0610, 0x061B}, {0x064B, 0x0660}, {0x0670, 0x0671}, {0x06D6, 0x06DC}, {0x06DF, 0x06EE},
+ {0x0590, 0x05BE}, {0x05BF, 0x05C0}, {0x05C1, 0x05C3}, {0x05C4, 0x05C6}, {0x05C7, 0x05C8},
+ {0x0610, 0x061B}, {0x064B, 0x0660}, {0x0670, 0x0671}, {0x06D6, 0x06DD}, {0x06DF, 0x06E5}, {0x06E7, 0x06E9}, {0x06EA,0x06EF},
{0x0730, 0x074D}, {0x07A6, 0x07B1}, {0x07EB, 0x07F4},
#if 0 // all known fonts have zero-width diacritics already, so no need to query it
{0x0900, 0x0904}, {0x093C, 0x093D}, {0x0941, 0x0948}, {0x094D, 0x0950}, {0x0951, 0x0958},
@@ -107,7 +108,8 @@ bool IsDiacritic( sal_UCS4 nChar )
{0x0A00, 0x0A05}, {0x0A3C, 0x0A59}, //...
#endif
{0x1DC0, 0x1E00},
- {0x205F, 0x2070}, {0x20D0, 0x2100}
+ {0x205F, 0x2070}, {0x20D0, 0x2100},
+ {0xFB1E, 0xFB1F}
};
// TODO: almost anything is faster than an O(n) search
diff --git a/vcl/source/gdi/textlayout.cxx b/vcl/source/gdi/textlayout.cxx
new file mode 100755
index 000000000000..67a30c351b7a
--- /dev/null
+++ b/vcl/source/gdi/textlayout.cxx
@@ -0,0 +1,384 @@
+/*************************************************************************
+* 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/ctrl.hxx"
+#include "vcl/outdev.hxx"
+#include "vcl/outfont.hxx"
+#include "vcl/textlayout.hxx"
+
+#include <com/sun/star/i18n/ScriptDirection.hpp>
+
+#include <tools/diagnose_ex.h>
+
+#if OSL_DEBUG_LEVEL > 1
+#include <rtl/strbuf.hxx>
+#endif
+
+//........................................................................
+namespace vcl
+{
+//........................................................................
+
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::uno::Exception;
+ namespace ScriptDirection = ::com::sun::star::i18n::ScriptDirection;
+
+ //====================================================================
+ //= DefaultTextLayout
+ //====================================================================
+ //--------------------------------------------------------------------
+ DefaultTextLayout::~DefaultTextLayout()
+ {
+ }
+
+ //--------------------------------------------------------------------
+ long DefaultTextLayout::GetTextWidth( const XubString& _rText, xub_StrLen _nStartIndex, xub_StrLen _nLength ) const
+ {
+ return m_rTargetDevice.GetTextWidth( _rText, _nStartIndex, _nLength );
+ }
+
+ //--------------------------------------------------------------------
+ void DefaultTextLayout::DrawText( const Point& _rStartPoint, const XubString& _rText, xub_StrLen _nStartIndex,
+ xub_StrLen _nLength, MetricVector* _pVector, String* _pDisplayText )
+ {
+ m_rTargetDevice.DrawText( _rStartPoint, _rText, _nStartIndex, _nLength, _pVector, _pDisplayText );
+ }
+
+ //--------------------------------------------------------------------
+ bool DefaultTextLayout::GetCaretPositions( const XubString& _rText, sal_Int32* _pCaretXArray,
+ xub_StrLen _nStartIndex, xub_StrLen _nLength ) const
+ {
+ return m_rTargetDevice.GetCaretPositions( _rText, _pCaretXArray, _nStartIndex, _nLength );
+ }
+
+ //--------------------------------------------------------------------
+ xub_StrLen DefaultTextLayout::GetTextBreak( const XubString& _rText, long _nMaxTextWidth, xub_StrLen _nStartIndex, xub_StrLen _nLength ) const
+ {
+ return m_rTargetDevice.GetTextBreak( _rText, _nMaxTextWidth, _nStartIndex, _nLength );
+ }
+
+ //--------------------------------------------------------------------
+ bool DefaultTextLayout::DecomposeTextRectAction() const
+ {
+ return false;
+ }
+
+ //====================================================================
+ //= ReferenceDeviceTextLayout
+ //====================================================================
+ class ReferenceDeviceTextLayout : public ITextLayout
+ {
+ public:
+ ReferenceDeviceTextLayout( const Control& _rControl, OutputDevice& _rTargetDevice, OutputDevice& _rReferenceDevice );
+ virtual ~ReferenceDeviceTextLayout();
+
+ // ITextLayout
+ virtual long GetTextWidth( const XubString& rStr, xub_StrLen nIndex, xub_StrLen nLen ) const;
+ virtual void DrawText( const Point& _rStartPoint, const XubString& _rText, xub_StrLen _nStartIndex, xub_StrLen _nLength, MetricVector* _pVector, String* _pDisplayText );
+ virtual bool GetCaretPositions( const XubString& _rText, sal_Int32* _pCaretXArray, xub_StrLen _nStartIndex, xub_StrLen _nLength ) const;
+ virtual xub_StrLen GetTextBreak( const XubString& _rText, long _nMaxTextWidth, xub_StrLen _nStartIndex, xub_StrLen _nLength ) const;
+ virtual bool DecomposeTextRectAction() const;
+
+ public:
+ // equivalents to the respective OutputDevice methods, which take the reference device into account
+ long GetTextArray( const XubString& _rText, sal_Int32* _pDXAry, xub_StrLen _nStartIndex, xub_StrLen _nLength ) const;
+ Rectangle DrawText( const Rectangle& _rRect, const XubString& _rText, USHORT _nStyle, MetricVector* _pVector, String* _pDisplayText );
+
+ protected:
+ void onBeginDrawText()
+ {
+ m_aCompleteTextRect.SetEmpty();
+ }
+ Rectangle onEndDrawText()
+ {
+ return m_aCompleteTextRect;
+ }
+
+ private:
+ OutputDevice& m_rTargetDevice;
+ OutputDevice& m_rReferenceDevice;
+ Font m_aUnzoomedPointFont;
+ const Fraction m_aZoom;
+ const bool m_bRTLEnabled;
+
+ Rectangle m_aCompleteTextRect;
+ };
+
+ //====================================================================
+ //= ControlTextRenderer
+ //====================================================================
+ ReferenceDeviceTextLayout::ReferenceDeviceTextLayout( const Control& _rControl, OutputDevice& _rTargetDevice,
+ OutputDevice& _rReferenceDevice )
+ :m_rTargetDevice( _rTargetDevice )
+ ,m_rReferenceDevice( _rReferenceDevice )
+ ,m_aUnzoomedPointFont( _rControl.GetUnzoomedControlPointFont() )
+ ,m_aZoom( _rControl.GetZoom() )
+ ,m_bRTLEnabled( _rControl.IsRTLEnabled() )
+ {
+ m_rTargetDevice.Push( PUSH_MAPMODE | PUSH_FONT | PUSH_TEXTLAYOUTMODE );
+
+ MapMode aTargetMapMode( m_rTargetDevice.GetMapMode() );
+ OSL_ENSURE( aTargetMapMode.GetOrigin() == Point(), "ReferenceDeviceTextLayout::ReferenceDeviceTextLayout: uhm, the code below won't work here ..." );
+
+ // normally, controls simulate "zoom" by "zooming" the font. This is responsible for (part of) the discrepancies
+ // between text in Writer and text in controls in Writer, though both have the same font.
+ // So, if we have a zoom set at the control, then we do not scale the font, but instead modify the map mode
+ // to accomodate for the zoom.
+ aTargetMapMode.SetScaleX( m_aZoom ); // TODO: shouldn't this be "current_scale * zoom"?
+ aTargetMapMode.SetScaleY( m_aZoom );
+
+ // also, use a higher-resolution map unit than "pixels", which should save us some rounding errors when
+ // translating coordinates between the reference device and the target device.
+ OSL_ENSURE( aTargetMapMode.GetMapUnit() == MAP_PIXEL,
+ "ReferenceDeviceTextLayout::ReferenceDeviceTextLayout: this class is not expected to work with such target devices!" );
+ // we *could* adjust all the code in this class to handle this case, but at the moment, it's not necessary
+ const MapUnit eTargetMapUnit = m_rReferenceDevice.GetMapMode().GetMapUnit();
+ aTargetMapMode.SetMapUnit( eTargetMapUnit );
+ OSL_ENSURE( aTargetMapMode.GetMapUnit() != MAP_PIXEL,
+ "ReferenceDeviceTextLayout::ReferenceDeviceTextLayout: a reference device which has map mode PIXEL?!" );
+
+ m_rTargetDevice.SetMapMode( aTargetMapMode );
+
+ // now that the Zoom is part of the map mode, reset the target device's font to the "unzoomed" version
+ Font aDrawFont( m_aUnzoomedPointFont );
+ aDrawFont.SetSize( m_rTargetDevice.LogicToLogic( aDrawFont.GetSize(), MAP_POINT, eTargetMapUnit ) );
+ _rTargetDevice.SetFont( aDrawFont );
+
+ // transfer font to the reference device
+ m_rReferenceDevice.Push( PUSH_FONT | PUSH_TEXTLAYOUTMODE );
+ Font aRefFont( m_aUnzoomedPointFont );
+ aRefFont.SetSize( OutputDevice::LogicToLogic(
+ aRefFont.GetSize(), MAP_POINT, m_rReferenceDevice.GetMapMode().GetMapUnit() ) );
+ m_rReferenceDevice.SetFont( aRefFont );
+ }
+
+ //--------------------------------------------------------------------
+ ReferenceDeviceTextLayout::~ReferenceDeviceTextLayout()
+ {
+ m_rReferenceDevice.Pop();
+ m_rTargetDevice.Pop();
+ }
+
+ //--------------------------------------------------------------------
+ namespace
+ {
+ //................................................................
+ bool lcl_normalizeLength( const XubString& _rText, const xub_StrLen _nStartIndex, xub_StrLen& _io_nLength )
+ {
+ xub_StrLen nTextLength = _rText.Len();
+ if ( _nStartIndex > nTextLength )
+ return false;
+ if ( _nStartIndex + _io_nLength > nTextLength )
+ _io_nLength = nTextLength - _nStartIndex;
+ return true;
+ }
+ }
+
+ //--------------------------------------------------------------------
+ long ReferenceDeviceTextLayout::GetTextArray( const XubString& _rText, sal_Int32* _pDXAry, xub_StrLen _nStartIndex,
+ xub_StrLen _nLength ) const
+ {
+ if ( !lcl_normalizeLength( _rText, _nStartIndex, _nLength ) )
+ return 0;
+
+ // retrieve the character widths from the reference device
+ long nTextWidth = m_rReferenceDevice.GetTextArray( _rText, _pDXAry, _nStartIndex, _nLength );
+#if OSL_DEBUG_LEVEL > 1
+ if ( _pDXAry )
+ {
+ ::rtl::OStringBuffer aTrace;
+ aTrace.append( "ReferenceDeviceTextLayout::GetTextArray( " );
+ aTrace.append( ::rtl::OUStringToOString( _rText, RTL_TEXTENCODING_UTF8 ) );
+ aTrace.append( " ): " );
+ aTrace.append( nTextWidth );
+ aTrace.append( " = ( " );
+ for ( size_t i=0; i<_nLength; )
+ {
+ aTrace.append( _pDXAry[i] );
+ if ( ++i < _nLength )
+ aTrace.append( ", " );
+ }
+ aTrace.append( ")" );
+ OSL_TRACE( aTrace.makeStringAndClear().getStr() );
+ }
+#endif
+ return nTextWidth;
+ }
+
+ //--------------------------------------------------------------------
+ long ReferenceDeviceTextLayout::GetTextWidth( const XubString& _rText, xub_StrLen _nStartIndex, xub_StrLen _nLength ) const
+ {
+ return GetTextArray( _rText, NULL, _nStartIndex, _nLength );
+ }
+
+ //--------------------------------------------------------------------
+ void ReferenceDeviceTextLayout::DrawText( const Point& _rStartPoint, const XubString& _rText, xub_StrLen _nStartIndex, xub_StrLen _nLength, MetricVector* _pVector, String* _pDisplayText )
+ {
+ if ( !lcl_normalizeLength( _rText, _nStartIndex, _nLength ) )
+ return;
+
+ if ( _pVector && _pDisplayText )
+ {
+ MetricVector aGlyphBounds;
+ m_rReferenceDevice.GetGlyphBoundRects( _rStartPoint, _rText, _nStartIndex, _nLength, _nStartIndex, aGlyphBounds );
+ ::std::copy(
+ aGlyphBounds.begin(), aGlyphBounds.end(),
+ ::std::insert_iterator< MetricVector > ( *_pVector, _pVector->end() ) );
+ _pDisplayText->Append( _rText.Copy( _nStartIndex, _nLength ) );
+ return;
+ }
+
+ sal_Int32* pCharWidths = new sal_Int32[ _nLength ];
+ long nTextWidth = GetTextArray( _rText, pCharWidths, _nStartIndex, _nLength );
+ m_rTargetDevice.DrawTextArray( _rStartPoint, _rText, pCharWidths, _nStartIndex, _nLength );
+ delete[] pCharWidths;
+
+ m_aCompleteTextRect.Union( Rectangle( _rStartPoint, Size( nTextWidth, m_rTargetDevice.GetTextHeight() ) ) );
+ }
+
+ //--------------------------------------------------------------------
+ bool ReferenceDeviceTextLayout::GetCaretPositions( const XubString& _rText, sal_Int32* _pCaretXArray,
+ xub_StrLen _nStartIndex, xub_StrLen _nLength ) const
+ {
+ if ( !lcl_normalizeLength( _rText, _nStartIndex, _nLength ) )
+ return false;
+
+ // retrieve the caret positions from the reference device
+ if ( !m_rReferenceDevice.GetCaretPositions( _rText, _pCaretXArray, _nStartIndex, _nLength ) )
+ return false;
+
+ return true;
+ }
+
+ //--------------------------------------------------------------------
+ xub_StrLen ReferenceDeviceTextLayout::GetTextBreak( const XubString& _rText, long _nMaxTextWidth, xub_StrLen _nStartIndex, xub_StrLen _nLength ) const
+ {
+ if ( !lcl_normalizeLength( _rText, _nStartIndex, _nLength ) )
+ return 0;
+
+ return m_rReferenceDevice.GetTextBreak( _rText, _nMaxTextWidth, _nStartIndex, _nLength );
+ }
+
+ //--------------------------------------------------------------------
+ bool ReferenceDeviceTextLayout::DecomposeTextRectAction() const
+ {
+ return true;
+ }
+
+ //--------------------------------------------------------------------
+ namespace
+ {
+ long zoomBy( long _value, const Fraction& _zoom )
+ {
+ double n = (double)_value;
+ n *= (double)_zoom.GetNumerator();
+ n /= (double)_zoom.GetDenominator();
+ return (long)::rtl::math::round( n );
+ }
+ long unzoomBy( long _value, const Fraction& _zoom )
+ {
+ return zoomBy( _value, Fraction( _zoom.GetDenominator(), _zoom.GetNumerator() ) );
+ }
+ }
+
+ //--------------------------------------------------------------------
+ Rectangle ReferenceDeviceTextLayout::DrawText( const Rectangle& _rRect, const XubString& _rText, USHORT _nStyle, MetricVector* _pVector, String* _pDisplayText )
+ {
+ if ( !_rText.Len() )
+ return Rectangle();
+
+ // determine text layout mode from the RTL-ness of the control whose text we render
+ ULONG nTextLayoutMode = m_bRTLEnabled ? TEXT_LAYOUT_BIDI_RTL : TEXT_LAYOUT_BIDI_LTR;
+ m_rReferenceDevice.SetLayoutMode( nTextLayoutMode );
+ m_rTargetDevice.SetLayoutMode( nTextLayoutMode | TEXT_LAYOUT_TEXTORIGIN_LEFT );
+ // TEXT_LAYOUT_TEXTORIGIN_LEFT is because when we do actually draw the text (in DrawText( Point, ... )), then
+ // our caller gives us the left border of the draw position, regardless of script type, text layout,
+ // and the like
+
+ // in our ctor, we set the map mode of the target device from pixel to twip, but our caller doesn't know this,
+ // but passed pixel coordinates. So, adjust the rect.
+ Rectangle aRect( m_rTargetDevice.PixelToLogic( _rRect ) );
+
+ onBeginDrawText();
+ m_rTargetDevice.DrawText( aRect, _rText, _nStyle, _pVector, _pDisplayText, this );
+ Rectangle aTextRect = onEndDrawText();
+
+ if ( aTextRect.IsEmpty() && !aRect.IsEmpty() )
+ {
+ // this happens for instance if we're in a PaintToDevice call, where only a MetaFile is recorded,
+ // but no actual painting happens, so our "DrawText( Point, ... )" is never called
+ // In this case, calculate the rect from what OutputDevice::GetTextRect would give us. This has
+ // the disadvantage of less accuracy, compared with the approach to calculate the rect from the
+ // single "DrawText( Point, ... )" calls, since more intermediate arithmetics will translate
+ // from ref- to target-units.
+ aTextRect = m_rTargetDevice.GetTextRect( aRect, _rText, _nStyle, NULL, this );
+ }
+
+ // similar to above, the text rect now contains TWIPs (or whatever unit the ref device has), but the caller
+ // expects pixel coordinates
+ aTextRect = m_rTargetDevice.LogicToPixel( aTextRect );
+
+ // convert the metric vector
+ if ( _pVector )
+ {
+ for ( MetricVector::iterator charRect = _pVector->begin();
+ charRect != _pVector->end();
+ ++charRect
+ )
+ {
+ *charRect = m_rTargetDevice.LogicToPixel( *charRect );
+ }
+ }
+
+ return aTextRect;
+ }
+
+ //====================================================================
+ //= ControlTextRenderer
+ //====================================================================
+ //--------------------------------------------------------------------
+ ControlTextRenderer::ControlTextRenderer( const Control& _rControl, OutputDevice& _rTargetDevice, OutputDevice& _rReferenceDevice )
+ :m_pImpl( new ReferenceDeviceTextLayout( _rControl, _rTargetDevice, _rReferenceDevice ) )
+ {
+ }
+
+ //--------------------------------------------------------------------
+ ControlTextRenderer::~ControlTextRenderer()
+ {
+ }
+
+ //--------------------------------------------------------------------
+ Rectangle ControlTextRenderer::DrawText( const Rectangle& _rRect, const XubString& _rText, USHORT _nStyle,
+ MetricVector* _pVector, String* _pDisplayText )
+ {
+ return m_pImpl->DrawText( _rRect, _rText, _nStyle, _pVector, _pDisplayText );
+ }
+
+//........................................................................
+} // namespace vcl
+//........................................................................
diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx
index 4aaef6a707b1..ede3bcc107aa 100644
--- a/vcl/source/window/status.cxx
+++ b/vcl/source/window/status.cxx
@@ -1320,8 +1320,13 @@ void StatusBar::SetItemText( USHORT nItemId, const XubString& rText )
// adjust item width - see also DataChanged()
long nFudge = GetTextHeight()/4;
long nWidth = GetTextWidth( pItem->maText ) + nFudge;
- if( nWidth > pItem->mnWidth + STATUSBAR_OFFSET )
+ if( (nWidth > pItem->mnWidth + STATUSBAR_OFFSET) ||
+ ((nWidth < pItem->mnWidth) && (mnDX - STATUSBAR_OFFSET) < mnItemsWidth ))
+ {
pItem->mnWidth = nWidth + STATUSBAR_OFFSET;
+ ImplFormat();
+ Invalidate();
+ }
// Item neu Zeichen, wenn StatusBar sichtbar und
// UpdateMode gesetzt ist
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 63bf407ce49f..371f962c45ac 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -9752,6 +9752,8 @@ void Window::ImplPaintToDevice( OutputDevice* i_pTargetOutDev, const Point& i_rP
EnableOutput();
DBG_ASSERT( GetMapMode().GetMapUnit() == MAP_PIXEL, "MapMode must be PIXEL based" );
+ if ( GetMapMode().GetMapUnit() != MAP_PIXEL )
+ return;
// preserve graphicsstate
Push();
diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx
index eff7319d6efc..99a331be2318 100644
--- a/vcl/unx/gtk/window/gtkframe.cxx
+++ b/vcl/unx/gtk/window/gtkframe.cxx
@@ -772,7 +772,10 @@ void GtkSalFrame::Init( SalFrame* pParent, ULONG nStyle )
m_aForeignTopLevelWindow = None;
m_nStyle = nStyle;
- GtkWindowType eWinType = ((nStyle & SAL_FRAME_STYLE_FLOAT) && ! (nStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION))
+ GtkWindowType eWinType = ( (nStyle & SAL_FRAME_STYLE_FLOAT) &&
+ ! (nStyle & (SAL_FRAME_STYLE_OWNERDRAWDECORATION|
+ SAL_FRAME_STYLE_FLOAT_FOCUSABLE))
+ )
? GTK_WINDOW_POPUP : GTK_WINDOW_TOPLEVEL;
if( nStyle & SAL_FRAME_STYLE_SYSTEMCHILD )
@@ -801,7 +804,7 @@ void GtkSalFrame::Init( SalFrame* pParent, ULONG nStyle )
bool bDecoHandling =
! isChild() &&
( ! (nStyle & SAL_FRAME_STYLE_FLOAT) ||
- (nStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION) );
+ (nStyle & (SAL_FRAME_STYLE_OWNERDRAWDECORATION|SAL_FRAME_STYLE_FLOAT_FOCUSABLE) ) );
/* #i100116# metacity has a peculiar behavior regarding WM_HINT accept focus and _NET_WM_USER_TIME
at some point that may be fixed in metacity and we will have to revisit this
@@ -832,6 +835,11 @@ void GtkSalFrame::Init( SalFrame* pParent, ULONG nStyle )
lcl_set_accept_focus( GTK_WINDOW(m_pWindow), FALSE, true );
bNoDecor = true;
}
+ else if( (nStyle & SAL_FRAME_STYLE_FLOAT_FOCUSABLE) )
+ {
+ eType = GDK_WINDOW_TYPE_HINT_UTILITY;
+ }
+
if( (nStyle & SAL_FRAME_STYLE_PARTIAL_FULLSCREEN ) )
{
eType = GDK_WINDOW_TYPE_HINT_TOOLBAR;
@@ -869,7 +877,7 @@ void GtkSalFrame::Init( SalFrame* pParent, ULONG nStyle )
if( bDecoHandling )
{
gtk_window_set_resizable( GTK_WINDOW(m_pWindow), (nStyle & SAL_FRAME_STYLE_SIZEABLE) ? TRUE : FALSE );
- if( ( (nStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION) ) || bMetaCityToolWindowHack )
+ if( ( (nStyle & (SAL_FRAME_STYLE_OWNERDRAWDECORATION)) ) || bMetaCityToolWindowHack )
lcl_set_accept_focus( GTK_WINDOW(m_pWindow), FALSE, false );
}
@@ -2075,7 +2083,7 @@ void GtkSalFrame::ToTop( USHORT nFlags )
* to our window - which it of course won't since our input hint
* is set to false.
*/
- if( (m_nStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION) )
+ if( (m_nStyle & (SAL_FRAME_STYLE_OWNERDRAWDECORATION|SAL_FRAME_STYLE_FLOAT_FOCUSABLE)) )
XSetInputFocus( getDisplay()->GetDisplay(), GDK_WINDOW_XWINDOW( m_pWindow->window ), RevertToParent, CurrentTime );
}
else
diff --git a/vcl/unx/inc/plugins/gtk/gtkframe.hxx b/vcl/unx/inc/plugins/gtk/gtkframe.hxx
index a8fc6f65d4ee..c2a147517ac8 100644
--- a/vcl/unx/inc/plugins/gtk/gtkframe.hxx
+++ b/vcl/unx/inc/plugins/gtk/gtkframe.hxx
@@ -242,9 +242,10 @@ class GtkSalFrame : public SalFrame
bool isFloatGrabWindow() const
{
return
- (m_nStyle & SAL_FRAME_STYLE_FLOAT) && // only a float can be floatgrab
- !(m_nStyle & SAL_FRAME_STYLE_TOOLTIP) && // tool tips are not
- !(m_nStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION); // toolbars are also not
+ (m_nStyle & SAL_FRAME_STYLE_FLOAT) && // only a float can be floatgrab
+ !(m_nStyle & SAL_FRAME_STYLE_TOOLTIP) && // tool tips are not
+ !(m_nStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION) && // toolbars are also not
+ !(m_nStyle & SAL_FRAME_STYLE_FLOAT_FOCUSABLE); // focusable floats are not
}
bool isChild( bool bPlug = true, bool bSysChild = true )
diff --git a/vcl/win/source/gdi/winlayout.cxx b/vcl/win/source/gdi/winlayout.cxx
index 1b80bf578530..bf56b2a1082b 100644
--- a/vcl/win/source/gdi/winlayout.cxx
+++ b/vcl/win/source/gdi/winlayout.cxx
@@ -6,9 +6,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: winlayout.cxx,v $
- * $Revision: 1.113.6.9 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -1385,7 +1382,7 @@ bool UniscribeLayout::LayoutText( ImplLayoutArgs& rArgs )
mpScriptItems = NULL;
if( nRC != E_OUTOFMEMORY )
return false;
- if( nItemCapacity > (nSubStringEnd - mnSubStringMin) )
+ if( nItemCapacity > (nSubStringEnd - mnSubStringMin) + 16 )
return false;
}
diff --git a/vcl/workben/outdevgrind.cxx b/vcl/workben/outdevgrind.cxx
index a92da7c05531..1109111b63c5 100755
--- a/vcl/workben/outdevgrind.cxx
+++ b/vcl/workben/outdevgrind.cxx
@@ -163,12 +163,12 @@ void setupMethodStubs( functor_vector_type& res )
xub_StrLen nIndex = 0, xub_StrLen nLen = STRING_LEN,
MetricVector* pVector = NULL, String* pDisplayText = NULL );
*/
- add(res,
- "DrawText",
- boost::bind(
- &OutputDevice::DrawText,
- _1,
- aPt1, aString, (USHORT)0, aString.Len(), (MetricVector*)0, (String*)0 ));
+// add(res,
+// "DrawText",
+// boost::bind(
+// &OutputDevice::DrawText,
+// _1,
+// aPt1, aString, (USHORT)0, aString.Len(), (MetricVector*)0, (String*)0, (vcl::ITextLayout*)0 ));
/* void DrawTextArray( const Point& rStartPt, const XubString& rStr,
const sal_Int32* pDXAry = NULL,
diff --git a/writerfilter/inc/dmapper/DomainMapper.hxx b/writerfilter/inc/dmapper/DomainMapper.hxx
index 71c22822affb..d543c0157874 100644
--- a/writerfilter/inc/dmapper/DomainMapper.hxx
+++ b/writerfilter/inc/dmapper/DomainMapper.hxx
@@ -62,7 +62,6 @@ typedef std::vector< com::sun::star::beans::PropertyValue > PropertyValueVector_
namespace writerfilter {
namespace dmapper
{
-using namespace std;
class PropertyMap;
class DomainMapper_Impl;
@@ -109,6 +108,9 @@ public:
virtual void endParagraphGroup();
virtual void startCharacterGroup();
virtual void endCharacterGroup();
+ virtual void startShape( ::com::sun::star::uno::Reference< com::sun::star::drawing::XShape > xShape );
+ virtual void endShape( );
+
virtual void text(const sal_uInt8 * data, size_t len);
virtual void utext(const sal_uInt8 * data, size_t len);
virtual void props(writerfilter::Reference<Properties>::Pointer_t ref);
@@ -120,8 +122,8 @@ public:
void sprm( Sprm& sprm, ::boost::shared_ptr<PropertyMap> pContext, SprmType = SPRM_DEFAULT );
- void PushStyleSheetProperties( ::boost::shared_ptr<PropertyMap> pStyleProperties );
- void PopStyleSheetProperties();
+ void PushStyleSheetProperties( ::boost::shared_ptr<PropertyMap> pStyleProperties, bool bAffectTableMngr = false );
+ void PopStyleSheetProperties( bool bAffectTableMngr = false );
void PushListProperties( ::boost::shared_ptr<PropertyMap> pListProperties );
void PopListProperties();
diff --git a/writerfilter/inc/resourcemodel/TableData.hxx b/writerfilter/inc/resourcemodel/TableData.hxx
index 407395a46de1..c86826feed01 100644
--- a/writerfilter/inc/resourcemodel/TableData.hxx
+++ b/writerfilter/inc/resourcemodel/TableData.hxx
@@ -276,6 +276,11 @@ class WRITERFILTER_DLLPUBLIC TableData
typedef ::std::vector<RowPointer_t> Rows;
/**
+ the table properties
+ */
+ PropertiesPointer mpTableProps;
+
+ /**
the data of the rows of the table
*/
Rows mRows;
@@ -349,6 +354,22 @@ public:
mpRow->insertCellProperties(i, pProps);
}
+ void insertTableProperties( PropertiesPointer pProps )
+ {
+ if ( mpTableProps.get( ) )
+ mpTableProps->insert( pProps );
+ else
+ mpTableProps = pProps;
+ }
+
+ /**
+ Return the table properties.
+ */
+ PropertiesPointer getTableProperties( )
+ {
+ return mpTableProps;
+ }
+
/**
Return number of rows in the table.
*/
diff --git a/writerfilter/inc/resourcemodel/TableManager.hxx b/writerfilter/inc/resourcemodel/TableManager.hxx
index a9cc7f57cc52..cc267273fdf0 100644
--- a/writerfilter/inc/resourcemodel/TableManager.hxx
+++ b/writerfilter/inc/resourcemodel/TableManager.hxx
@@ -103,6 +103,11 @@ public:
@param rT end handle of cell
*/
virtual void endCell(const T & rT) = 0;
+
+ virtual T* getTable( )
+ {
+ return NULL;
+ };
};
template <typename T, typename PropertiesPointer>
@@ -151,16 +156,16 @@ class TableManager
/**
properties of the current cell
*/
- PropertiesPointer mpCellProps;
+ vector< PropertiesPointer > mpCellProps;
/**
properties of the current row
*/
- PropertiesPointer mpRowProps;
+ vector< PropertiesPointer > mpRowProps;
/**
- properties of the current table
- */
+ properties of the current table: don't use them directly.
+ */
PropertiesPointer mpTableProps;
/**
@@ -168,6 +173,7 @@ class TableManager
*/
T mCurHandle;
+ T* mpInnerTable;
/**
stack of table data
@@ -231,7 +237,6 @@ protected:
*/
virtual void clearData();
-
public:
TableManager();
virtual ~TableManager(){}
@@ -351,7 +356,7 @@ public:
template <typename T, typename PropertiesPointer>
TableManager<T, PropertiesPointer>::TableManager()
: mbRowEnd(false), mbInCell(false), mbCellEnd(false), mnTableDepthNew(0),
- mnTableDepth(0)
+ mnTableDepth(0), mpInnerTable( NULL )
{
}
@@ -398,19 +403,30 @@ void TableManager<T, PropertiesPointer>::handle(const T & rHandle)
template <typename T, typename PropertiesPointer>
void TableManager<T, PropertiesPointer>::startLevel()
{
+#if DEBUG
+ std::clog << "TableManager::startLevel()" << std::endl;
+#endif
typename TableData<T, PropertiesPointer>::Pointer_t pTableData
(new TableData<T, PropertiesPointer>(mTableDataStack.size()));
mTableDataStack.push(pTableData);
+
+ PropertiesPointer pEmptyProps;
+ cellProps( pEmptyProps );
}
template <typename T, typename PropertiesPointer>
void TableManager<T, PropertiesPointer>::endLevel()
{
+#if DEBUG
+ std::clog << "TableManager::endLevel()" << std::endl;
+#endif
if (mpTableDataHandler.get() != NULL)
resolveCurrentTable();
-
mTableDataStack.pop();
+
+ if ( mpCellProps.size( ) > 0 )
+ mpCellProps.pop_back( );
}
template <typename T, typename PropertiesPointer>
@@ -426,12 +442,6 @@ template <typename T, typename PropertiesPointer>
void TableManager<T, PropertiesPointer>::endParagraphGroup()
{
sal_Int32 nTableDepthDifference = mnTableDepthNew - mnTableDepth;
- while (nTableDepthDifference > 0)
- {
- startLevel();
-
- --nTableDepthDifference;
- }
while (nTableDepthDifference < 0)
{
endLevel();
@@ -447,14 +457,23 @@ void TableManager<T, PropertiesPointer>::endParagraphGroup()
if (mbRowEnd)
{
endOfRowAction();
- pTableData->endRow(mpRowProps);
- mpRowProps.reset();
+ pTableData->endRow( mpRowProps.back( ) );
+ mpRowProps.back( ).reset();
}
-
- else if (mbInCell)
+ else if ( mbInCell )
{
if (! pTableData->isCellOpen())
- pTableData->addCell(mCurHandle, mpCellProps);
+ {
+ if ( mpInnerTable )
+ {
+ pTableData->addCell( *mpInnerTable, mpCellProps.back( ) );
+ mpInnerTable = NULL;
+ }
+ else
+ {
+ pTableData->addCell( mCurHandle, mpCellProps.back( ) );
+ }
+ }
if (mbCellEnd)
{
@@ -462,7 +481,8 @@ void TableManager<T, PropertiesPointer>::endParagraphGroup()
pTableData->endCell(mCurHandle);
}
}
- mpCellProps.reset();
+ if ( mpCellProps.size( ) > 0 )
+ mpCellProps.back().reset( );
}
template <typename T, typename PropertiesPointer>
@@ -538,10 +558,15 @@ void TableManager<T, PropertiesPointer>::utext(const sal_uInt8 * data, size_t le
template <typename T, typename PropertiesPointer>
void TableManager<T, PropertiesPointer>::cellProps(PropertiesPointer pProps)
{
- if(mpCellProps.get())
- mpCellProps->insert( pProps );
+ if ( mpCellProps.size( ) == mTableDataStack.size( ) )
+ {
+ if ( mpCellProps.back( ).get( ) )
+ mpCellProps.back()->insert( pProps );
+ else
+ mpCellProps.back( ) = pProps;
+ }
else
- mpCellProps = pProps;
+ mpCellProps.push_back( pProps );
}
template <typename T, typename PropertiesPointer>
@@ -554,19 +579,24 @@ void TableManager<T, PropertiesPointer>::cellPropsByCell
template <typename T, typename PropertiesPointer>
void TableManager<T, PropertiesPointer>::insertRowProps(PropertiesPointer pProps)
{
- if( mpRowProps.get() )
- mpRowProps->insert( pProps );
+ if ( mpRowProps.size( ) == ( mTableDataStack.size( ) - 1 ) )
+ {
+ if( mpRowProps.back( ).get( ) )
+ mpRowProps.back( )->insert( pProps );
+ else
+ mpRowProps.back( ) = pProps;
+ }
else
- mpRowProps = pProps;
+ mpRowProps.push_back( pProps );
}
template <typename T, typename PropertiesPointer>
void TableManager<T, PropertiesPointer>::insertTableProps(PropertiesPointer pProps)
{
- if( mpTableProps.get() )
- mpTableProps->insert( pProps );
- else
- mpTableProps = pProps;
+ typename TableData<T, PropertiesPointer>::Pointer_t
+ pTableData = mTableDataStack.top();
+
+ pTableData->insertTableProperties( pProps );
}
template <typename T, typename PropertiesPointer>
@@ -579,7 +609,7 @@ void TableManager<T, PropertiesPointer>::resolveCurrentTable()
unsigned int nRows = pTableData->getRowCount();
- mpTableDataHandler->startTable(nRows, pTableData->getDepth(), mpTableProps);
+ mpTableDataHandler->startTable(nRows, pTableData->getDepth(), pTableData->getTableProperties( ) );
for (unsigned int nRow = 0; nRow < nRows; ++nRow)
{
@@ -602,8 +632,12 @@ void TableManager<T, PropertiesPointer>::resolveCurrentTable()
}
mpTableDataHandler->endTable();
+
+ // The inner table has to be stored only if there is something in the stack
+ // The 0 depth is the dummy table for the whole stream
+ if ( pTableData->getDepth( ) > 1 )
+ mpInnerTable = mpTableDataHandler->getTable( );
}
- mpTableProps.reset();
clearData();
}
diff --git a/writerfilter/inc/resourcemodel/WW8ResourceModel.hxx b/writerfilter/inc/resourcemodel/WW8ResourceModel.hxx
index 05725e08be90..c7c072fefc4d 100644
--- a/writerfilter/inc/resourcemodel/WW8ResourceModel.hxx
+++ b/writerfilter/inc/resourcemodel/WW8ResourceModel.hxx
@@ -35,6 +35,7 @@
#include <memory>
#include <boost/shared_ptr.hpp>
#include <sal/types.h>
+#include <com/sun/star/drawing/XShape.hpp>
#include <com/sun/star/uno/Any.hxx>
#include <WriterFilterDllApi.hxx>
#include <resourcemodel/OutputWithDepth.hxx>
@@ -220,6 +221,13 @@ public:
virtual void endCharacterGroup() = 0;
/**
+ Receives a shape.
+ */
+ virtual void startShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape ) = 0;
+
+ virtual void endShape( ) = 0;
+
+ /**
Receives 8-bit per character text.
@param data buffer containing the text
diff --git a/writerfilter/qa/documents/docx/numbering/num-1.docx b/writerfilter/qa/documents/docx/numbering/num-1.docx
new file mode 100644
index 000000000000..b5e5ffb0b20c
--- /dev/null
+++ b/writerfilter/qa/documents/docx/numbering/num-1.docx
Binary files differ
diff --git a/writerfilter/qa/documents/docx/pictures/Word DocumentOffice 2007 Format Sample6.docx b/writerfilter/qa/documents/docx/pictures/Word DocumentOffice 2007 Format Sample6.docx
new file mode 100644
index 000000000000..eb0d4c256c73
--- /dev/null
+++ b/writerfilter/qa/documents/docx/pictures/Word DocumentOffice 2007 Format Sample6.docx
Binary files differ
diff --git a/writerfilter/qa/documents/docx/pictures/i97645 New example.docx b/writerfilter/qa/documents/docx/pictures/i97645 New example.docx
new file mode 100644
index 000000000000..6cda8590ad21
--- /dev/null
+++ b/writerfilter/qa/documents/docx/pictures/i97645 New example.docx
Binary files differ
diff --git a/writerfilter/qa/documents/docx/pictures/test-image.docx b/writerfilter/qa/documents/docx/pictures/test-image.docx
new file mode 100644
index 000000000000..fff6424514a4
--- /dev/null
+++ b/writerfilter/qa/documents/docx/pictures/test-image.docx
Binary files differ
diff --git a/writerfilter/qa/documents/docx/pictures/test-image1.docx b/writerfilter/qa/documents/docx/pictures/test-image1.docx
new file mode 100644
index 000000000000..bdcc8e088210
--- /dev/null
+++ b/writerfilter/qa/documents/docx/pictures/test-image1.docx
Binary files differ
diff --git a/writerfilter/qa/documents/docx/pictures/test.docx b/writerfilter/qa/documents/docx/pictures/test.docx
new file mode 100644
index 000000000000..72e3c01f3fda
--- /dev/null
+++ b/writerfilter/qa/documents/docx/pictures/test.docx
Binary files differ
diff --git a/writerfilter/qa/documents/docx/redlines/test-review-brk.docx b/writerfilter/qa/documents/docx/redlines/test-review-brk.docx
new file mode 100644
index 000000000000..7c884505f19e
--- /dev/null
+++ b/writerfilter/qa/documents/docx/redlines/test-review-brk.docx
Binary files differ
diff --git a/writerfilter/qa/documents/docx/redlines/test-review-para.docx b/writerfilter/qa/documents/docx/redlines/test-review-para.docx
new file mode 100644
index 000000000000..9bb87be947bf
--- /dev/null
+++ b/writerfilter/qa/documents/docx/redlines/test-review-para.docx
Binary files differ
diff --git a/writerfilter/qa/documents/docx/redlines/test-review-stack.docx b/writerfilter/qa/documents/docx/redlines/test-review-stack.docx
new file mode 100644
index 000000000000..18b3e3063ea6
--- /dev/null
+++ b/writerfilter/qa/documents/docx/redlines/test-review-stack.docx
Binary files differ
diff --git a/writerfilter/qa/documents/docx/tables/nested-tables.docx b/writerfilter/qa/documents/docx/tables/nested-tables.docx
new file mode 100644
index 000000000000..844b29de8517
--- /dev/null
+++ b/writerfilter/qa/documents/docx/tables/nested-tables.docx
Binary files differ
diff --git a/writerfilter/qa/documents/docx/tables/nested-tables2.docx b/writerfilter/qa/documents/docx/tables/nested-tables2.docx
new file mode 100644
index 000000000000..0602ba4fa703
--- /dev/null
+++ b/writerfilter/qa/documents/docx/tables/nested-tables2.docx
Binary files differ
diff --git a/writerfilter/qa/documents/docx/tables/nested-tables3.docx b/writerfilter/qa/documents/docx/tables/nested-tables3.docx
new file mode 100644
index 000000000000..7b61d147237c
--- /dev/null
+++ b/writerfilter/qa/documents/docx/tables/nested-tables3.docx
Binary files differ
diff --git a/writerfilter/qa/documents/docx/tables/nested-tables4.docx b/writerfilter/qa/documents/docx/tables/nested-tables4.docx
new file mode 100644
index 000000000000..6a17180a4ef4
--- /dev/null
+++ b/writerfilter/qa/documents/docx/tables/nested-tables4.docx
Binary files differ
diff --git a/writerfilter/qa/documents/docx/tables/nested-tables5.docx b/writerfilter/qa/documents/docx/tables/nested-tables5.docx
new file mode 100644
index 000000000000..2247b64a7621
--- /dev/null
+++ b/writerfilter/qa/documents/docx/tables/nested-tables5.docx
Binary files differ
diff --git a/writerfilter/qa/documents/docx/tables/parentinvguid.docx b/writerfilter/qa/documents/docx/tables/parentinvguid.docx
new file mode 100644
index 000000000000..8f859fe43a59
--- /dev/null
+++ b/writerfilter/qa/documents/docx/tables/parentinvguid.docx
Binary files differ
diff --git a/writerfilter/qa/documents/docx/tables/table-styles.docx b/writerfilter/qa/documents/docx/tables/table-styles.docx
new file mode 100644
index 000000000000..2136f9d0f4fe
--- /dev/null
+++ b/writerfilter/qa/documents/docx/tables/table-styles.docx
Binary files differ
diff --git a/writerfilter/qa/documents/docx/tables/test-grid.docx b/writerfilter/qa/documents/docx/tables/test-grid.docx
new file mode 100644
index 000000000000..09f95d1a0982
--- /dev/null
+++ b/writerfilter/qa/documents/docx/tables/test-grid.docx
Binary files differ
diff --git a/writerfilter/qa/documents/docx/tables/test-paras.docx b/writerfilter/qa/documents/docx/tables/test-paras.docx
new file mode 100644
index 000000000000..0cef4ae05a5b
--- /dev/null
+++ b/writerfilter/qa/documents/docx/tables/test-paras.docx
Binary files differ
diff --git a/writerfilter/qa/documents/docx/tables/test-simple.docx b/writerfilter/qa/documents/docx/tables/test-simple.docx
new file mode 100644
index 000000000000..2c0c08427d3d
--- /dev/null
+++ b/writerfilter/qa/documents/docx/tables/test-simple.docx
Binary files differ
diff --git a/writerfilter/qa/documents/docx/tables/two-tables.docx b/writerfilter/qa/documents/docx/tables/two-tables.docx
new file mode 100644
index 000000000000..d2e99d3ac9ae
--- /dev/null
+++ b/writerfilter/qa/documents/docx/tables/two-tables.docx
Binary files differ
diff --git a/writerfilter/qa/documents/docx/tables/updatejpegprocessing.docx b/writerfilter/qa/documents/docx/tables/updatejpegprocessing.docx
new file mode 100644
index 000000000000..f62eb61dfdcb
--- /dev/null
+++ b/writerfilter/qa/documents/docx/tables/updatejpegprocessing.docx
Binary files differ
diff --git a/writerfilter/qa/documents/docx/test-page-format.docx b/writerfilter/qa/documents/docx/test-page-format.docx
new file mode 100644
index 000000000000..eba8dea3e126
--- /dev/null
+++ b/writerfilter/qa/documents/docx/test-page-format.docx
Binary files differ
diff --git a/writerfilter/source/dmapper/BorderHandler.cxx b/writerfilter/source/dmapper/BorderHandler.cxx
index 106f20440031..63140b486472 100644
--- a/writerfilter/source/dmapper/BorderHandler.cxx
+++ b/writerfilter/source/dmapper/BorderHandler.cxx
@@ -137,6 +137,8 @@ void BorderHandler::sprm(Sprm & rSprm)
pProperties->resolve(*this);
ConversionHelper::MakeBorderLine( m_nLineWidth, m_nLineType, m_nLineColor,
m_aBorderLines[rSprm.getId() - NS_ooxml::LN_CT_TblBorders_top], m_bOOXML );
+
+ m_aFilledLines[ rSprm.getId( ) - NS_ooxml::LN_CT_TblBorders_top] = true;
}
break;
default:;
@@ -161,7 +163,11 @@ PropertyMapPtr BorderHandler::getProperties()
if( m_bOOXML || m_nCurrentBorderPosition )
{
for( sal_Int32 nProp = 0; nProp < BORDER_COUNT; ++nProp)
- pPropertyMap->Insert( aPropNames[nProp], false, uno::makeAny( m_aBorderLines[nProp] ) );
+ {
+ if ( m_aFilledLines[nProp] ) {
+ pPropertyMap->Insert( aPropNames[nProp], false, uno::makeAny( m_aBorderLines[nProp] ) );
+ }
+ }
}
return pPropertyMap;
}
diff --git a/writerfilter/source/dmapper/BorderHandler.hxx b/writerfilter/source/dmapper/BorderHandler.hxx
index 703518d61b6e..be3d0f7b1055 100644
--- a/writerfilter/source/dmapper/BorderHandler.hxx
+++ b/writerfilter/source/dmapper/BorderHandler.hxx
@@ -63,6 +63,7 @@ private:
sal_Int32 m_nLineDistance;
bool m_bOOXML;
+ bool m_aFilledLines[BORDER_COUNT];
::com::sun::star::table::BorderLine m_aBorderLines[BORDER_COUNT];
public:
diff --git a/writerfilter/source/dmapper/CellColorHandler.cxx b/writerfilter/source/dmapper/CellColorHandler.cxx
index 508893888255..2e1e9d6d06b4 100644
--- a/writerfilter/source/dmapper/CellColorHandler.cxx
+++ b/writerfilter/source/dmapper/CellColorHandler.cxx
@@ -110,6 +110,11 @@ void CellColorHandler::attribute(Id rName, Value & rVal)
// }
// }
// break;
+ case NS_ooxml::LN_CT_Shd_themeFill:
+ case NS_ooxml::LN_CT_Shd_themeFillTint:
+ case NS_ooxml::LN_CT_Shd_themeFillShade:
+ // ignored
+ break;
default:
OSL_ENSURE( false, "unknown attribute");
}
diff --git a/writerfilter/source/dmapper/ConversionHelper.cxx b/writerfilter/source/dmapper/ConversionHelper.cxx
index 43d805b162ac..efb7bc710338 100644
--- a/writerfilter/source/dmapper/ConversionHelper.cxx
+++ b/writerfilter/source/dmapper/ConversionHelper.cxx
@@ -275,6 +275,10 @@ void MakeBorderLine( sal_Int32 nLineThickness, sal_Int32 nLineType,
case 21:
eCodeIdx = double1;// 60 Twips for us
break;
+ case 0:
+ case 255:
+ eCodeIdx = none;
+ break;
default:
eCodeIdx = single0;
break;
@@ -305,7 +309,8 @@ void MakeBorderLine( sal_Int32 nLineThickness, sal_Int32 nLineType,
/*13*/ { DOUBLE_LINE7_OUT, DOUBLE_LINE7_IN, DOUBLE_LINE7_DIST },
/*14*/ { DOUBLE_LINE8_OUT, DOUBLE_LINE8_IN, DOUBLE_LINE8_DIST },
/*15*/ { DOUBLE_LINE9_OUT, DOUBLE_LINE9_IN, DOUBLE_LINE9_DIST },
- /*16*/ { DOUBLE_LINE10_OUT,DOUBLE_LINE10_IN,DOUBLE_LINE10_DIST}
+ /*16*/ { DOUBLE_LINE10_OUT,DOUBLE_LINE10_IN,DOUBLE_LINE10_DIST},
+ /*17*/ { 0, 0, 0 }
};
rToFill.Color = nLineColor;
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index d61cf5024b99..dbf9a33f067b 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -28,6 +28,8 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
+#include "PageBordersHandler.hxx"
+
#include <dmapper/DomainMapper.hxx>
#include <DomainMapper_Impl.hxx>
#include <ConversionHelper.hxx>
@@ -177,6 +179,10 @@ DomainMapper::~DomainMapper()
uno::Reference< document::XEventBroadcaster > xBroadcaster(xIndexesSupplier, uno::UNO_QUERY);
xBroadcaster->addEventListener(uno::Reference< document::XEventListener >(new ModelEventListener));
}
+
+
+ // Apply the document settings after everything else
+ m_pImpl->GetSettingsTable()->ApplyProperties( m_pImpl->GetTextDocument( ) );
}
catch( const uno::Exception& rEx )
{
@@ -552,8 +558,8 @@ void DomainMapper::attribute(Id nName, Value & val)
//if the style is a user defined style then it must have an ISTD - built-in styles might not have it
StyleSheetTablePtr pStyleSheets = m_pImpl->GetStyleSheetTable();
::rtl::OUString sValue = ::rtl::OUString::valueOf(nIntValue, 16);
- const StyleSheetEntry* pEntry = pStyleSheets->FindStyleSheetByISTD(sValue);
- if(pEntry)
+ const StyleSheetEntryPtr pEntry = pStyleSheets->FindStyleSheetByISTD(sValue);
+ if( pEntry.get( ) )
{
bool bParaStyle = (pEntry->nStyleTypeCode == STYLE_TYPE_PARA);
if(bParaStyle)
@@ -1882,12 +1888,12 @@ void DomainMapper::attribute(Id nName, Value & val)
/* WRITERFILTERSTATUS: done: 80, planned: 0.5, spent: 0.2 */
//TODO: autospacing depends on some document property (called fDontUseHTMLAutoSpacing in old ww8 filter) 100 or 280 twip
//and should be set to 0 on start of page
- m_pImpl->GetTopContext()->Insert( PROP_TOP_MARGIN, false, uno::makeAny( AUTO_PARA_SPACING ) );
+ m_pImpl->GetTopContext()->Insert( PROP_PARA_TOP_MARGIN, false, uno::makeAny( AUTO_PARA_SPACING ) );
break;
case NS_ooxml::LN_CT_Spacing_afterAutospacing:
/* WRITERFILTERSTATUS: done: 80, planned: 0.5, spent: 0.2 */
//TODO: autospacing depends on some document property (called fDontUseHTMLAutoSpacing in old ww8 filter) 100 or 280 twip
- m_pImpl->GetTopContext()->Insert( PROP_BOTTOM_MARGIN, false, uno::makeAny( AUTO_PARA_SPACING ) );
+ m_pImpl->GetTopContext()->Insert( PROP_PARA_BOTTOM_MARGIN, false, uno::makeAny( AUTO_PARA_SPACING ) );
break;
case NS_ooxml::LN_CT_SmartTagRun_uri:
case NS_ooxml::LN_CT_SmartTagRun_element:
@@ -1926,13 +1932,6 @@ void DomainMapper::attribute(Id nName, Value & val)
//afterwards the adding of the binary data.
m_pImpl->GetGraphicImport( IMPORT_AS_DETECTED_INLINE )->attribute(nName, val);
m_pImpl->ImportGraphic( val.getProperties(), IMPORT_AS_DETECTED_INLINE );
- if( m_pImpl->IsInShapeContext() )
- {
- //imported text from temporary shape needs to be copied to the real shape
- uno::Reference< drawing::XShape > xShape;
- val.getAny() >>= xShape;
- m_pImpl->CopyTemporaryShapeText( xShape );
- }
}
break;
case NS_ooxml::LN_CT_FramePr_dropCap:
@@ -2090,19 +2089,12 @@ void DomainMapper::attribute(Id nName, Value & val)
break;
case NS_ooxml::LN_CT_Markup_id:
/* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
- m_pImpl->SetCurrentRedlineId( sStringValue );
+ m_pImpl->SetCurrentRedlineId( nIntValue );
break;
case NS_ooxml::LN_token:
/* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
m_pImpl->SetCurrentRedlineToken( nIntValue );
break;
- case NS_ooxml::LN_mark_shape:
- /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
- if( nIntValue )
- m_pImpl->PopShapeContext();
- else
- m_pImpl->PushShapeContext();
- break;
case NS_ooxml::LN_CT_LineNumber_countBy:
/* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
case NS_ooxml::LN_CT_LineNumber_restart:
@@ -2144,6 +2136,9 @@ void DomainMapper::attribute(Id nName, Value & val)
case NS_ooxml::LN_CT_Color_themeShade:
//unsupported
break;
+ case NS_ooxml::LN_endtrackchange:
+ m_pImpl->RemoveCurrentRedline( );
+ break;
default:
{
#if OSL_DEBUG_LEVEL > 0
@@ -2625,6 +2620,15 @@ void DomainMapper::sprm( Sprm& rSprm, PropertyMapPtr rContext, SprmType eSprmTyp
break; // sprmPPropRMark
case NS_sprm::LN_POutLvl:
/* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
+ {
+ if( m_pImpl->IsStyleSheetImport() )
+ {
+ sal_Int16 nLvl = static_cast< sal_Int16 >( nIntValue );
+
+ StyleSheetPropertyMap* pStyleSheetPropertyMap = dynamic_cast< StyleSheetPropertyMap* >( rContext.get() );
+ pStyleSheetPropertyMap->SetOutlineLevel( nLvl );
+ }
+ }
break; // sprmPOutLvl
case NS_sprm::LN_PFBiDi:
/* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
@@ -3877,6 +3881,20 @@ void DomainMapper::sprm( Sprm& rSprm, PropertyMapPtr rContext, SprmType eSprmTyp
}
}
break;
+ case NS_ooxml::LN_EG_SectPrContents_pgBorders:
+ {
+ writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
+ if( pProperties.get( ) && pSectionContext )
+ {
+ PageBordersHandlerPtr pHandler( new PageBordersHandler );
+ pProperties->resolve( *pHandler );
+
+ // Set the borders to the context and apply them to the styles
+ pHandler->SetBorders( pSectionContext );
+ pSectionContext->SetBorderParams( pHandler->GetDisplayOffset( ) );
+ }
+ }
+ break;
case NS_ooxml::LN_CT_PPrBase_pStyle:
{
@@ -3886,20 +3904,31 @@ void DomainMapper::sprm( Sprm& rSprm, PropertyMapPtr rContext, SprmType eSprmTyp
const ::rtl::OUString sConvertedStyleName = pStyleTable->ConvertStyleName( sStringValue, true );
if (m_pImpl->GetTopContext() && m_pImpl->GetTopContextType() != CONTEXT_SECTION)
m_pImpl->GetTopContext()->Insert( PROP_PARA_STYLE_NAME, true, uno::makeAny( sConvertedStyleName ));
- const StyleSheetEntry* pEntry = pStyleTable->FindStyleSheetByISTD(sStringValue);
+ const StyleSheetEntryPtr pEntry = pStyleTable->FindStyleSheetByISTD(sStringValue);
//apply numbering to paragraph if it was set at the style
- OSL_ENSURE( pEntry, "no style sheet found" );
+ OSL_ENSURE( pEntry.get(), "no style sheet found" );
const StyleSheetPropertyMap* pStyleSheetProperties = dynamic_cast<const StyleSheetPropertyMap*>(pEntry ? pEntry->pProperties.get() : 0);
+
if( pStyleSheetProperties && pStyleSheetProperties->GetListId() >= 0 )
- rContext->Insert( PROP_NUMBERING_RULES, true, uno::makeAny(m_pImpl->GetListTable()->GetNumberingRules(pStyleSheetProperties->GetListId())), false);
+ rContext->Insert( PROP_NUMBERING_STYLE_NAME, true, uno::makeAny(
+ m_pImpl->GetListTable( )->GetStyleName( pStyleSheetProperties->GetListId( ) ) ), false);
+
if( pStyleSheetProperties && pStyleSheetProperties->GetListLevel() >= 0 )
rContext->Insert( PROP_NUMBERING_LEVEL, true, uno::makeAny(pStyleSheetProperties->GetListLevel()), false);
}
break;
case NS_ooxml::LN_EG_RPrBase_rStyle:
/* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
- if (m_pImpl->GetTopContext())
- m_pImpl->GetTopContext()->Insert( PROP_CHAR_STYLE_NAME, true, uno::makeAny( m_pImpl->GetStyleSheetTable()->ConvertStyleName( sStringValue, true )));
+ {
+ rtl::OUString sConvertedName( m_pImpl->GetStyleSheetTable()->ConvertStyleName( sStringValue, true ) );
+ // First check if the style exists in the document.
+ StyleSheetEntryPtr pEntry = m_pImpl->GetStyleSheetTable( )->FindStyleSheetByStyleName( sConvertedName );
+ bool bExists = pEntry.get( ) && ( pEntry->nStyleTypeCode == STYLE_TYPE_CHAR );
+
+ // Add the property if the style exists
+ if ( bExists && m_pImpl->GetTopContext() )
+ m_pImpl->GetTopContext()->Insert( PROP_CHAR_STYLE_NAME, true, uno::makeAny( sConvertedName ) );
+ }
break;
case NS_ooxml::LN_CT_TblPrBase_tblCellMar: //cell margins
/* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
@@ -4036,16 +4065,16 @@ void DomainMapper::sprm( Sprm& rSprm, PropertyMapPtr rContext, SprmType eSprmTyp
}
}
break;
+ case NS_ooxml::LN_paratrackchange:
+ m_pImpl->StartParaChange( );
case NS_ooxml::LN_trackchange:
/* WRITERFILTERSTATUS: done: 100, planned: 5, spent: 0 */
case NS_ooxml::LN_EG_RPrContent_rPrChange:
/* WRITERFILTERSTATUS: done: 100, planned: 5, spent: 0 */
{
+ m_pImpl->AddNewRedline( );
resolveSprmProps( rSprm );
// now the properties author, date and id should be available
- ::rtl::OUString sAuthor = m_pImpl->GetCurrentRedlineAuthor();
- ::rtl::OUString sDate = m_pImpl->GetCurrentRedlineDate();
- ::rtl::OUString sId = m_pImpl->GetCurrentRedlineId();
sal_Int32 nToken = m_pImpl->GetCurrentRedlineToken();
switch( nToken & 0xffff )
{
@@ -4054,6 +4083,7 @@ void DomainMapper::sprm( Sprm& rSprm, PropertyMapPtr rContext, SprmType eSprmTyp
case ooxml::OOXML_del : break;
default: OSL_ENSURE( false, "redline token other than mod, ins or del" );
}
+ m_pImpl->EndParaChange( );
}
break;
case NS_ooxml::LN_CT_RPrChange_rPr:
@@ -4062,15 +4092,21 @@ void DomainMapper::sprm( Sprm& rSprm, PropertyMapPtr rContext, SprmType eSprmTyp
/* WRITERFILTERSTATUS: done: 0, planned: 4, spent: 0 */
case NS_ooxml::LN_object:
{
+#if DEBUG
+ clog << "DomainMapper: LN_object" << endl;
+#endif
writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
- if( pProperties.get())
+ if( pProperties.get( ) )
{
OLEHandlerPtr pOLEHandler( new OLEHandler );
pProperties->resolve(*pOLEHandler);
- ::rtl::OUString sStreamName = pOLEHandler->copyOLEOStream( m_pImpl->GetTextDocument() );
- if(sStreamName.getLength())
+ if ( pOLEHandler->isOLEObject( ) )
{
- m_pImpl->appendOLE( sStreamName, pOLEHandler );
+ ::rtl::OUString sStreamName = pOLEHandler->copyOLEOStream( m_pImpl->GetTextDocument() );
+ if( sStreamName.getLength() )
+ {
+ m_pImpl->appendOLE( sStreamName, pOLEHandler );
+ }
}
}
}
@@ -4099,7 +4135,6 @@ void DomainMapper::sprm( Sprm& rSprm, PropertyMapPtr rContext, SprmType eSprmTyp
case NS_ooxml::LN_CT_Lvl_pStyle:
//TODO: numbering style should apply current numbering level - not yet supported
break;
-
default:
{
#if OSL_DEBUG_LEVEL > 0
@@ -4225,19 +4260,36 @@ void DomainMapper::endParagraphGroup()
#endif
}
+void DomainMapper::startShape( uno::Reference< drawing::XShape > xShape )
+{
+ m_pImpl->PushShapeContext( xShape );
+}
+
+void DomainMapper::endShape( )
+{
+ m_pImpl->PopShapeContext( );
+}
+
/*-- 13.06.2007 16:15:55---------------------------------------------------
-----------------------------------------------------------------------*/
-void DomainMapper::PushStyleSheetProperties( PropertyMapPtr pStyleProperties )
+void DomainMapper::PushStyleSheetProperties( PropertyMapPtr pStyleProperties, bool bAffectTableMngr )
{
m_pImpl->PushStyleProperties( pStyleProperties );
+ if ( bAffectTableMngr )
+ m_pImpl->getTableManager( ).SetStyleProperties( pStyleProperties );
}
/*-- 13.06.2007 16:15:55---------------------------------------------------
-----------------------------------------------------------------------*/
-void DomainMapper::PopStyleSheetProperties()
+void DomainMapper::PopStyleSheetProperties( bool bAffectTableMngr )
{
m_pImpl->PopProperties( CONTEXT_STYLESHEET );
+ if ( bAffectTableMngr )
+ {
+ PropertyMapPtr emptyPtr;
+ m_pImpl->getTableManager( ).SetStyleProperties( emptyPtr );
+ }
}
/*-- 28.01.2008 14:52:33---------------------------------------------------
@@ -4484,10 +4536,13 @@ void DomainMapper::table(Id name, writerfilter::Reference<Table>::Pointer_t ref)
break;
case NS_ooxml::LN_NUMBERING:
case NS_rtf::LN_LISTTABLE:
- /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
+ {
+ /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
- //the same for list tables
- ref->resolve( *m_pImpl->GetListTable() );
+ //the same for list tables
+ ref->resolve( *m_pImpl->GetListTable() );
+ m_pImpl->GetListTable( )->CreateNumberingRules( );
+ }
break;
case NS_rtf::LN_LFOTABLE:
/* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
@@ -4497,6 +4552,9 @@ void DomainMapper::table(Id name, writerfilter::Reference<Table>::Pointer_t ref)
case NS_ooxml::LN_THEMETABLE:
ref->resolve ( *m_pImpl->GetThemeTable() );
break;
+ case NS_ooxml::LN_SETTINGS:
+ ref->resolve( *m_pImpl->GetSettingsTable( ) );
+ break;
default:
OSL_ENSURE( false, "which table is to be filled here?");
}
diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
index 4ae6af8c4e67..20fc7755358b 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
@@ -68,7 +68,22 @@ static void lcl_printProperties( PropertyMapPtr pProps )
{
rtl::OUString aOUStr = rPropSupplier.GetName( aMapIter->first.eId );
rtl::OString aOStr(aOUStr.getStr(), aOUStr.getLength(), RTL_TEXTENCODING_ASCII_US );
- clog << aOStr.getStr() << '-';
+ clog << aOStr.getStr();
+
+ table::BorderLine aLine;
+ sal_Int32 nColor;
+ if ( aMapIter->second >>= aLine )
+ {
+ clog << ": BorderLine ( Color: " << aLine.Color;
+ clog << ", Inner: " << aLine.InnerLineWidth;
+ clog << ", Outer: " << aLine.OuterLineWidth << ") ";
+ }
+ else if ( aMapIter->second >>= nColor )
+ {
+ clog << ": Color ( " << nColor << " ) ";
+ }
+
+ clog << " - ";
}
clog << endl;
}
@@ -106,21 +121,121 @@ void DomainMapperTableHandler::startTable(unsigned int nRows,
/*-- 22.02.2008 10:18:37---------------------------------------------------
-----------------------------------------------------------------------*/
-PropertyMapPtr lcl_SearchParentStyleSheetAndMergeProperties(const StyleSheetEntry* pStyleSheet, StyleSheetTablePtr pStyleSheetTable)
+PropertyMapPtr lcl_SearchParentStyleSheetAndMergeProperties(const StyleSheetEntryPtr pStyleSheet, StyleSheetTablePtr pStyleSheetTable)
{
PropertyMapPtr pRet;
if( pStyleSheet->sBaseStyleIdentifier.getLength())
{
- const StyleSheetEntry* pParentStyleSheet = pStyleSheetTable->FindStyleSheetByISTD( pStyleSheet->sBaseStyleIdentifier );
+ const StyleSheetEntryPtr pParentStyleSheet = pStyleSheetTable->FindStyleSheetByISTD( pStyleSheet->sBaseStyleIdentifier );
pRet = lcl_SearchParentStyleSheetAndMergeProperties( pParentStyleSheet, pStyleSheetTable );
}
else
{
pRet.reset( new PropertyMap );
}
+
pRet->insert( pStyleSheet->pProperties, true );
return pRet;
}
+
+void lcl_mergeBorder( PropertyIds nId, PropertyMapPtr pOrig, PropertyMapPtr pDest )
+{
+ PropertyDefinition aDef( nId, false );
+ PropertyMap::iterator pOrigIt = pOrig->find( aDef );
+
+ if ( pOrigIt != pOrig->end( ) )
+ {
+ pDest->Insert( nId, false, pOrigIt->second, false );
+ }
+}
+
+void lcl_computeCellBorders( PropertyMapPtr pTableBorders, PropertyMapPtr pCellProps,
+ sal_Int32 nCell, sal_Int32 nRow, bool bIsEndCol, bool bIsEndRow )
+{
+ PropertyDefinition aVertPDef( META_PROP_VERTICAL_BORDER, false );
+ PropertyDefinition aHorizPDef( META_PROP_HORIZONTAL_BORDER, false );
+
+ PropertyMap::iterator aVerticalIter = pCellProps->find( aVertPDef );
+ PropertyMap::iterator aHorizontalIter = pCellProps->find( aHorizPDef );
+
+ // Handle the vertical and horizontal borders
+ bool bHasVert = ( aVerticalIter != pCellProps->end( ) );
+ uno::Any aVertProp;
+ if ( !bHasVert )
+ {
+ aVerticalIter = pTableBorders->find( aVertPDef );
+ bHasVert = ( aVerticalIter != pTableBorders->end( ) );
+ if ( bHasVert )
+ aVertProp = aVerticalIter->second;
+ }
+ else
+ {
+ aVertProp = aVerticalIter->second;
+ pCellProps->erase( aVerticalIter );
+ }
+
+ bool bHasHoriz = ( aHorizontalIter != pCellProps->end( ) );
+ uno::Any aHorizProp;
+ if ( !bHasHoriz )
+ {
+ aHorizontalIter = pTableBorders->find( aHorizPDef );
+ bHasHoriz = ( aHorizontalIter != pTableBorders->end( ) );
+ if ( bHasHoriz )
+ aHorizProp = aHorizontalIter->second;
+ }
+ else
+ {
+ aHorizProp = aHorizontalIter->second;
+ pCellProps->erase( aHorizontalIter );
+ }
+
+ if ( nCell == 0 )
+ {
+ lcl_mergeBorder( PROP_LEFT_BORDER, pTableBorders, pCellProps );
+ if ( bHasVert )
+ pCellProps->Insert( PROP_RIGHT_BORDER, false, aVertProp, false );
+ }
+
+ if ( bIsEndCol )
+ {
+ lcl_mergeBorder( PROP_RIGHT_BORDER, pTableBorders, pCellProps );
+ if ( bHasVert )
+ pCellProps->Insert( PROP_LEFT_BORDER, false, aVertProp, false );
+ }
+
+ if ( nCell > 0 && !bIsEndCol )
+ {
+ if ( bHasVert )
+ {
+ pCellProps->Insert( PROP_RIGHT_BORDER, false, aVertProp, false );
+ pCellProps->Insert( PROP_LEFT_BORDER, false, aVertProp, false );
+ }
+ }
+
+ if ( nRow == 0 )
+ {
+ lcl_mergeBorder( PROP_TOP_BORDER, pTableBorders, pCellProps );
+ if ( bHasHoriz )
+ pCellProps->Insert( PROP_BOTTOM_BORDER, false, aHorizProp, false );
+ }
+
+ if ( bIsEndRow )
+ {
+ lcl_mergeBorder( PROP_BOTTOM_BORDER, pTableBorders, pCellProps );
+ if ( bHasHoriz )
+ pCellProps->Insert( PROP_TOP_BORDER, false, aHorizProp, false );
+ }
+
+ if ( nRow > 0 && !bIsEndRow )
+ {
+ if ( bHasHoriz )
+ {
+ pCellProps->Insert( PROP_TOP_BORDER, false, aHorizProp, false );
+ pCellProps->Insert( PROP_BOTTOM_BORDER, false, aHorizProp, false );
+ }
+ }
+}
+
void DomainMapperTableHandler::endTable()
{
#if OSL_DEBUG_LEVEL > 1
@@ -140,7 +255,7 @@ void DomainMapperTableHandler::endTable()
if( nTblPropSize )
{
const beans::PropertyValues aDebugTbl = m_aTableProperties->GetPropertyValues();
- for( sal_Int32 nDebug = 0; nDebug < nTblPropSize; ++nDebug)
+ for( sal_uInt32 nDebug = 0; nDebug < nTblPropSize; ++nDebug)
{
const ::rtl::OUString sName = aDebugTbl[nDebug].Name;
sNames += sName;
@@ -148,6 +263,7 @@ void DomainMapperTableHandler::endTable()
}
m_aTableProperties->Invalidate();
sNames += ::rtl::OUString(' ');
+ clog << "Props: " << rtl::OUStringToOString( sNames, RTL_TEXTENCODING_UTF8 ).getStr( ) << endl;
}
}
#endif
@@ -156,6 +272,13 @@ void DomainMapperTableHandler::endTable()
sal_Int32 nLeftBorderDistance, nRightBorderDistance, nTopBorderDistance, nBottomBorderDistance;
nLeftBorderDistance = nRightBorderDistance = DEF_BORDER_DIST;
nTopBorderDistance = nBottomBorderDistance = 0;
+
+ PropertyMapPtr pTableDefaults( new PropertyMap );
+ PropertyMapPtr pTableBorders( new PropertyMap );
+
+ // will receive the table style if any
+ TableStyleSheetEntry* pTableStyle = NULL;
+
if( m_aTableProperties.get() )
{
//create properties from the table attributes
@@ -169,36 +292,32 @@ void DomainMapperTableHandler::endTable()
m_aTableProperties->find( PropertyDefinition( META_PROP_TABLE_STYLE_NAME, false ) );
if(aTableStyleIter != m_aTableProperties->end())
{
- //TODO: apply table style properties recursively
+ // Apply table style properties recursively
::rtl::OUString sTableStyleName;
aTableStyleIter->second >>= sTableStyleName;
StyleSheetTablePtr pStyleSheetTable = m_rDMapper_Impl.GetStyleSheetTable();
- const StyleSheetEntry* pStyleSheet = pStyleSheetTable->FindStyleSheetByISTD( sTableStyleName );
+ const StyleSheetEntryPtr pStyleSheet = pStyleSheetTable->FindStyleSheetByISTD( sTableStyleName );
+ pTableStyle = static_cast<TableStyleSheetEntry*>( pStyleSheet.get( ) );
+ m_aTableProperties->erase( aTableStyleIter );
+
if( pStyleSheet )
{
- PropertyMapPtr pMergedProperties = lcl_SearchParentStyleSheetAndMergeProperties(pStyleSheet, pStyleSheetTable);
-
- PropertyMap::const_iterator aStylePropIter =
- pMergedProperties->find(PropertyDefinition( META_PROP_CELL_MAR_TOP, false ) );
- if( aStylePropIter != pMergedProperties->end() )
- aStylePropIter->second >>= nTopBorderDistance;
+ // First get the style properties, then the table ones
+ PropertyMapPtr pTableProps( m_aTableProperties );
+ TablePropertyMapPtr pEmptyProps( new TablePropertyMap );
- aStylePropIter = pMergedProperties->find(PropertyDefinition( META_PROP_CELL_MAR_BOTTOM, false ) );
- if( aStylePropIter != pMergedProperties->end() )
- aStylePropIter->second >>= nBottomBorderDistance;
+ m_aTableProperties = pEmptyProps;
- aStylePropIter = pMergedProperties->find(PropertyDefinition( META_PROP_CELL_MAR_LEFT, false ) );
- if( aStylePropIter != pMergedProperties->end() )
- aStylePropIter->second >>= nLeftBorderDistance;
-
- aStylePropIter = pMergedProperties->find(PropertyDefinition( META_PROP_CELL_MAR_RIGHT, false ) );
- if( aStylePropIter != pMergedProperties->end() )
- aStylePropIter->second >>= nRightBorderDistance;
+ PropertyMapPtr pMergedProperties = lcl_SearchParentStyleSheetAndMergeProperties(pStyleSheet, pStyleSheetTable);
+ m_aTableProperties->insert( pMergedProperties );
+ m_aTableProperties->insert( pTableProps );
}
- m_aTableProperties->erase( aTableStyleIter );
}
+ // Set the table default attributes for the cells
+ pTableDefaults->insert( m_aTableProperties );
+
m_aTableProperties->getValue( TablePropertyMap::GAP_HALF, nGapHalf );
m_aTableProperties->getValue( TablePropertyMap::LEFT_MARGIN, nLeftMargin );
@@ -228,6 +347,11 @@ void DomainMapperTableHandler::endTable()
aTblBorderIter->second >>= aTableBorder.TopLine;
aTableBorder.IsTopLineValid = true;
m_aTableProperties->erase( aTblBorderIter );
+
+ pTableBorders->Insert( PROP_TOP_BORDER, false, uno::makeAny( aTableBorder.TopLine ) );
+ PropertyMap::iterator pIt = pTableDefaults->find( PropertyDefinition( PROP_TOP_BORDER, false ) );
+ if ( pIt != pTableDefaults->end( ) )
+ pTableDefaults->erase( pIt );
}
aTblBorderIter = m_aTableProperties->find( PropertyDefinition(PROP_BOTTOM_BORDER, false) );
if( aTblBorderIter != m_aTableProperties->end() )
@@ -235,6 +359,11 @@ void DomainMapperTableHandler::endTable()
aTblBorderIter->second >>= aTableBorder.BottomLine;
aTableBorder.IsBottomLineValid = true;
m_aTableProperties->erase( aTblBorderIter );
+
+ pTableBorders->Insert( PROP_BOTTOM_BORDER, false, uno::makeAny( aTableBorder.BottomLine ) );
+ PropertyMap::iterator pIt = pTableDefaults->find( PropertyDefinition( PROP_BOTTOM_BORDER, false ) );
+ if ( pIt != pTableDefaults->end( ) )
+ pTableDefaults->erase( pIt );
}
aTblBorderIter = m_aTableProperties->find( PropertyDefinition(PROP_LEFT_BORDER, false) );
if( aTblBorderIter != m_aTableProperties->end() )
@@ -242,6 +371,11 @@ void DomainMapperTableHandler::endTable()
aTblBorderIter->second >>= aTableBorder.LeftLine;
aTableBorder.IsLeftLineValid = true;
m_aTableProperties->erase( aTblBorderIter );
+
+ pTableBorders->Insert( PROP_LEFT_BORDER, false, uno::makeAny( aTableBorder.LeftLine ) );
+ PropertyMap::iterator pIt = pTableDefaults->find( PropertyDefinition( PROP_LEFT_BORDER, false ) );
+ if ( pIt != pTableDefaults->end( ) )
+ pTableDefaults->erase( pIt );
}
aTblBorderIter = m_aTableProperties->find( PropertyDefinition(PROP_RIGHT_BORDER, false) );
if( aTblBorderIter != m_aTableProperties->end() )
@@ -249,6 +383,11 @@ void DomainMapperTableHandler::endTable()
aTblBorderIter->second >>= aTableBorder.RightLine;
aTableBorder.IsRightLineValid = true;
m_aTableProperties->erase( aTblBorderIter );
+
+ pTableBorders->Insert( PROP_RIGHT_BORDER, false, uno::makeAny( aTableBorder.RightLine ) );
+ PropertyMap::iterator pIt = pTableDefaults->find( PropertyDefinition( PROP_RIGHT_BORDER, false ) );
+ if ( pIt != pTableDefaults->end( ) )
+ pTableDefaults->erase( pIt );
}
aTblBorderIter = m_aTableProperties->find( PropertyDefinition(META_PROP_HORIZONTAL_BORDER, false) );
if( aTblBorderIter != m_aTableProperties->end() )
@@ -256,6 +395,11 @@ void DomainMapperTableHandler::endTable()
aTblBorderIter->second >>= aTableBorder.HorizontalLine;
aTableBorder.IsHorizontalLineValid = true;
m_aTableProperties->erase( aTblBorderIter );
+
+ pTableBorders->Insert( META_PROP_HORIZONTAL_BORDER, false, uno::makeAny( aTableBorder.HorizontalLine ) );
+ PropertyMap::iterator pIt = pTableDefaults->find( PropertyDefinition( META_PROP_HORIZONTAL_BORDER, false ) );
+ if ( pIt != pTableDefaults->end( ) )
+ pTableDefaults->erase( pIt );
}
aTblBorderIter = m_aTableProperties->find( PropertyDefinition(META_PROP_VERTICAL_BORDER, false) );
if( aTblBorderIter != m_aTableProperties->end() )
@@ -263,6 +407,11 @@ void DomainMapperTableHandler::endTable()
aTblBorderIter->second >>= aTableBorder.VerticalLine;
aTableBorder.IsVerticalLineValid = true;
m_aTableProperties->erase( aTblBorderIter );
+
+ pTableBorders->Insert( META_PROP_VERTICAL_BORDER, false, uno::makeAny( aTableBorder.VerticalLine ) );
+ PropertyMap::iterator pIt = pTableDefaults->find( PropertyDefinition( META_PROP_VERTICAL_BORDER, false ) );
+ if ( pIt != pTableDefaults->end( ) )
+ pTableDefaults->erase( pIt );
}
aTableBorder.Distance = 0;
aTableBorder.IsDistanceValid = false;
@@ -285,6 +434,13 @@ void DomainMapperTableHandler::endTable()
if( aRepeatIter == m_aTableProperties->end() )
m_aTableProperties->Insert( PROP_HEADER_ROW_COUNT, false, uno::makeAny( (sal_Int32)0 ));
+ // Remove the PROP_HEADER_ROW_COUNT from the table default to avoid
+ // propagating it to the cells
+ PropertyMap::iterator aDefaultRepeatIt =
+ pTableDefaults->find( PropertyDefinition( PROP_HEADER_ROW_COUNT, false ) );
+ if ( aDefaultRepeatIt != pTableDefaults->end( ) )
+ pTableDefaults->erase( aDefaultRepeatIt );
+
aTableProperties = m_aTableProperties->GetPropertyValues();
}
@@ -294,6 +450,7 @@ void DomainMapperTableHandler::endTable()
// std::vector< std::vector<PropertyMapPtr> > m_aCellProperties
PropertyMapVector2::const_iterator aRowOfCellsIterator = m_aCellProperties.begin();
PropertyMapVector2::const_iterator aRowOfCellsIteratorEnd = m_aCellProperties.end();
+ PropertyMapVector2::const_iterator aLastRowIterator = m_aCellProperties.end() - 1;
sal_Int32 nRow = 0;
//it's a uno::Sequence< beans::PropertyValues >*
@@ -303,67 +460,72 @@ void DomainMapperTableHandler::endTable()
//aRowOfCellsIterator points to a vector of PropertyMapPtr
PropertyMapVector1::const_iterator aCellIterator = aRowOfCellsIterator->begin();
PropertyMapVector1::const_iterator aCellIteratorEnd = aRowOfCellsIterator->end();
+ PropertyMapVector1::const_iterator aLastCellIterator = aRowOfCellsIterator->end() - 1;
- //contains the default border of the line
- PropertyMapPtr aCellBorders( new PropertyMap );
+ // Get the row style properties
+ sal_Int32 nRowStyleMask = sal_Int32( 0 );
+ PropertyMapPtr pRowProps = m_aRowProperties[nRow];
+ if ( pRowProps.get( ) )
+ {
+ PropertyMap::iterator pTcCnfStyleIt = pRowProps->find( PropertyDefinition( PROP_CNF_STYLE, true ) );
+ if ( pTcCnfStyleIt != pRowProps->end( ) )
+ {
+ if ( pTableStyle )
+ {
+ rtl::OUString sMask;
+ pTcCnfStyleIt->second >>= sMask;
+ nRowStyleMask = sMask.toInt32( 2 );
+ }
+ pRowProps->erase( pTcCnfStyleIt );
+ }
+ }
sal_Int32 nCell = 0;
pCellProperties[nRow].realloc( aRowOfCellsIterator->size() );
beans::PropertyValues* pSingleCellProperties = pCellProperties[nRow].getArray();
while( aCellIterator != aCellIteratorEnd )
{
- //TODO: aCellIterator contains HorizontalBorder and VerticalBorder
- // they have to be removed, depending on the position of the cell they
- // have to be moved to BottomBorder/RightBorder respectively
+ PropertyMapPtr pAllCellProps( new PropertyMap );
+
+ bool bIsEndCol = aCellIterator == aLastCellIterator;
+ bool bIsEndRow = aRowOfCellsIterator == aLastRowIterator;
+
//aCellIterator points to a PropertyMapPtr;
if( aCellIterator->get() )
{
- if( nCell && aCellBorders->size() )
+ if ( pTableDefaults->size( ) )
+ pAllCellProps->insert( pTableDefaults );
+
+ // Fill the cell properties with the ones of the style
+ sal_Int32 nCellStyleMask = 0;
+ const PropertyMap::iterator aCnfStyleIter =
+ aCellIterator->get()->find( PropertyDefinition( PROP_CNF_STYLE, false ) );
+ if ( aCnfStyleIter != aCellIterator->get( )->end( ) )
{
- //now apply the default border
- //TODO: This overwrites the existing values!
- aCellIterator->get()->insert( aCellBorders, false );
+ if ( pTableStyle ) {
+ rtl::OUString sMask;
+ aCnfStyleIter->second >>= sMask;
+ nCellStyleMask = sMask.toInt32( 2 );
+ }
+ aCellIterator->get( )->erase( aCnfStyleIter );
}
-
- const PropertyMap::iterator aVerticalIter =
- aCellIterator->get()->find( PropertyDefinition(META_PROP_VERTICAL_BORDER, false) );
- const PropertyMap::iterator aHorizontalIter =
- aCellIterator->get()->find( PropertyDefinition(META_PROP_HORIZONTAL_BORDER, false) );
- const PropertyMap::const_iterator aRightIter =
- aCellIterator->get()->find( PropertyDefinition(PROP_RIGHT_BORDER, false) );
- const PropertyMap::const_iterator aBottomIter =
- aCellIterator->get()->find( PropertyDefinition(PROP_BOTTOM_BORDER, false) );
-
- if( aVerticalIter != aCellIterator->get()->end())
+ if ( pTableStyle )
{
- if( !nCell )
- aCellBorders->insert(*aVerticalIter);
- aCellIterator->get()->erase( aVerticalIter );
- }
- if( aHorizontalIter != aCellIterator->get()->end())
- {
- if( !nCell )
- aCellBorders->insert(*aHorizontalIter);
- aCellIterator->get()->erase( aHorizontalIter );
- }
- //fill the additional borders into the line default border
- if( !nCell )
- {
- const PropertyMap::const_iterator aLeftIter =
- aCellIterator->get()->find( PropertyDefinition(PROP_RIGHT_BORDER, false) );
- if(aLeftIter != aCellIterator->get()->end())
- aCellBorders->insert(*aLeftIter);
- if(aRightIter != aCellIterator->get()->end())
- aCellBorders->insert(*aRightIter);
- const PropertyMap::const_iterator aTopIter =
- aCellIterator->get()->find( PropertyDefinition(PROP_TOP_BORDER, false) );
- if(aTopIter != aCellIterator->get()->end())
- aCellBorders->insert(*aTopIter);
- if(aBottomIter != aCellIterator->get()->end())
- aCellBorders->insert(*aBottomIter);
+ PropertyMapPtr pStyleProps = pTableStyle->GetProperties( nCellStyleMask + nRowStyleMask );
+ pAllCellProps->insert( pStyleProps );
}
+ // Then add the cell properties
+ pAllCellProps->insert( *aCellIterator );
+ aCellIterator->get( )->swap( *pAllCellProps.get( ) );
+
+#if DEBUG
+ clog << "Cell #" << nCell << ", Row #" << nRow << endl;
+#endif
+
+ lcl_computeCellBorders( pTableBorders, *aCellIterator, nCell, nRow, bIsEndCol, bIsEndRow );
+
//now set the default left+right border distance TODO: there's an sprm containing the default distance!
const PropertyMap::const_iterator aLeftDistanceIter =
aCellIterator->get()->find( PropertyDefinition(PROP_LEFT_BORDER_DISTANCE, false) );
@@ -410,7 +572,7 @@ void DomainMapperTableHandler::endTable()
sNames += sName;
sNames += ::rtl::OUString('-');
}
- sNames += ::rtl::OUString(' ');
+ sNames += ::rtl::OUString('\n');
}
(void)sNames;
}
@@ -479,11 +641,15 @@ void DomainMapperTableHandler::endTable()
(void) nCellPropertiesProperties;
++nCellPropertiesProperties;
}
+ clog << "Converting table" << endl;
#endif
- m_xText->convertToTable(*m_pTableSeq,
+
+ uno::Reference<text::XTextTable> xTable = m_xText->convertToTable(*m_pTableSeq,
aCellProperties,
aRowProperties,
aTableProperties);
+
+ m_xTableRange = xTable->getAnchor( );
}
catch (lang::IllegalArgumentException e)
{
@@ -491,7 +657,14 @@ void DomainMapperTableHandler::endTable()
clog << "failed to import table!" << endl;
#endif
}
+#if OSL_DEBUG_LEVEL > 1
+ catch ( uno::Exception e )
+ {
+ clog << "Caught an other exception: " << rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_UTF8 ).getStr( ) << endl;
+ }
+#endif
}
+
m_aTableProperties.reset();
m_aCellProperties.clear();
m_aRowProperties.clear();
@@ -529,7 +702,15 @@ void DomainMapperTableHandler::startCell(const Handle_t & start,
TablePropertyMapPtr pProps )
{
sal_uInt32 nRow = m_aRowProperties.size();
- m_aCellProperties[nRow - 1].push_back( pProps );
+ if ( pProps.get( ) )
+ m_aCellProperties[nRow - 1].push_back( pProps );
+ else
+ {
+ // Adding an empty cell properties map to be able to get
+ // the table defaults properties
+ TablePropertyMapPtr pEmptyProps( new TablePropertyMap( ) );
+ m_aCellProperties[nRow - 1].push_back( pEmptyProps );
+ }
#if OSL_DEBUG_LEVEL > 1
clog << "<table.cell>";
diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.hxx b/writerfilter/source/dmapper/DomainMapperTableHandler.hxx
index 8847d628f506..971d75b32884 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.hxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.hxx
@@ -66,6 +66,8 @@ class DomainMapperTableHandler : public TableDataHandler<Handle_t , TablePropert
RowSequencePointer_t m_pRowSeq;
TableSequencePointer_t m_pTableSeq;
+ Handle_t m_xTableRange;
+
// properties
PropertyMapVector2 m_aCellProperties;
PropertyMapVector1 m_aRowProperties;
@@ -87,6 +89,11 @@ public:
virtual void endRow();
virtual void startCell(const Handle_t & start, TablePropertyMapPtr pProps);
virtual void endCell(const Handle_t & end);
+
+ virtual Handle_t* getTable( )
+ {
+ return &m_xTableRange;
+ };
};
}}
diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.cxx b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
index 36af6fac0809..34c8092eb2e5 100644
--- a/writerfilter/source/dmapper/DomainMapperTableManager.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
@@ -56,14 +56,18 @@ DomainMapperTableManager::DomainMapperTableManager(bool bOOXML) :
m_nCellBorderIndex(0),
m_nHeaderRepeat(0),
m_nTableWidth(0),
- m_bOOXML( bOOXML )
+ m_bOOXML( bOOXML ),
+ m_pTablePropsHandler( new TablePropertiesHandler( bOOXML ) )
{
+ m_pTablePropsHandler->SetTableManager( this );
}
/*-- 23.04.2007 14:57:49---------------------------------------------------
-----------------------------------------------------------------------*/
DomainMapperTableManager::~DomainMapperTableManager()
{
+ if ( m_pTablePropsHandler )
+ delete m_pTablePropsHandler, m_pTablePropsHandler = NULL;
}
/*-- 23.04.2007 15:25:37---------------------------------------------------
@@ -73,39 +77,17 @@ bool DomainMapperTableManager::sprm(Sprm & rSprm)
bool bRet = DomainMapperTableManager_Base_t::sprm(rSprm);
if( !bRet )
{
+ bRet = m_pTablePropsHandler->sprm( rSprm );
+ }
+
+ if ( !bRet )
+ {
bRet = true;
sal_uInt32 nSprmId = rSprm.getId();
Value::Pointer_t pValue = rSprm.getValue();
sal_Int32 nIntValue = ((pValue.get() != NULL) ? pValue->getInt() : 0);
- /* WRITERFILTERSTATUS: table: table_sprmdata */
- switch( nSprmId )
+ switch ( nSprmId )
{
- /* WRITERFILTERSTATUS: done: 1, planned: 2, spent: 2 */
- case NS_ooxml::LN_CT_TrPrBase_jc: //90706
- /* WRITERFILTERSTATUS: done: 1, planned: 0.5, spent: 0.5 */
- case NS_ooxml::LN_CT_TblPrBase_jc:
- /* WRITERFILTERSTATUS: done: 1, planned: 2, spent: 2 */
- case 0x5400: // sprmTJc
- {
- //table justification 0: left, 1: center, 2: right
- sal_Int16 nOrient = ConversionHelper::convertTableJustification( nIntValue );
- TablePropertyMapPtr pTableMap( new TablePropertyMap );
- pTableMap->setValue( TablePropertyMap::HORI_ORIENT, nOrient );
- insertTableProps( pTableMap );
- }
- break;
- /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
- case 0x9601: // sprmTDxaLeft
- break;
- /* WRITERFILTERSTATUS: done: 1, planned: 2, spent: 0 */
- case 0x9602: // sprmTDxaGapHalf
- {
- //m_nGapHalf = ConversionHelper::convertTwipToMM100( nIntValue );
- TablePropertyMapPtr pPropMap( new TablePropertyMap );
- pPropMap->setValue( TablePropertyMap::GAP_HALF, ConversionHelper::convertTwipToMM100( nIntValue ) );
- insertTableProps(pPropMap);
- }
- break;
/* WRITERFILTERSTATUS: done: 1, planned: 2, spent: 0 */
case 0xf661: //sprmTTRLeft left table indent
/* WRITERFILTERSTATUS: done: 1, planned: 2, spent: 0 */
@@ -136,32 +118,6 @@ bool DomainMapperTableManager::sprm(Sprm & rSprm)
}
}
break;
- /* WRITERFILTERSTATUS: done: 1, planned: 2, spent: 2 */
- case NS_ooxml::LN_CT_TrPrBase_trHeight: //90703
- {
- //contains unit and value
- writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
- if( pProperties.get())
- { //contains attributes x2902 (LN_unit) and x17e2 (LN_trleft)
- MeasureHandlerPtr pMeasureHandler( new MeasureHandler );
- pProperties->resolve(*pMeasureHandler);
- TablePropertyMapPtr pPropMap( new TablePropertyMap );
- pPropMap->Insert( PROP_SIZE_TYPE, false, uno::makeAny( pMeasureHandler->GetRowHeightSizeType() ));
- pPropMap->Insert( PROP_HEIGHT, false, uno::makeAny(pMeasureHandler->getMeasureValue() ));
- insertRowProps(pPropMap);
- }
- }
- break;
- /* WRITERFILTERSTATUS: done: 1, planned: 2, spent: 0 */
- case 0x3403: // sprmTFCantSplit
- case NS_sprm::LN_TCantSplit: // 0x3644
- {
- //row can't break across pages if nIntValue == 1
- TablePropertyMapPtr pPropMap( new TablePropertyMap );
- pPropMap->Insert( PROP_IS_SPLIT_ALLOWED, false, uno::makeAny(sal_Bool( nIntValue == 1 ? sal_False : sal_True ) ));
- insertRowProps(pPropMap);
- }
- break;
/* WRITERFILTERSTATUS: done: 1, planned: 2, spent: 0 */
case 0x3404:// sprmTTableHeader
case NS_ooxml::LN_CT_TrPrBase_tblHeader: //90704
@@ -178,23 +134,6 @@ bool DomainMapperTableManager::sprm(Sprm & rSprm)
m_nHeaderRepeat = -1;
break;
/* WRITERFILTERSTATUS: done: 1, planned: 2, spent: 0 */
- case 0x9407: // sprmTDyaRowHeight
- {
- // table row height - negative values indicate 'exact height' - positive 'at least'
- TablePropertyMapPtr pPropMap( new TablePropertyMap );
- bool bMinHeight = true;
- sal_Int16 nHeight = static_cast<sal_Int16>( nIntValue );
- if( nHeight < 0 )
- {
- bMinHeight = false;
- nHeight *= -1;
- }
- pPropMap->Insert( PROP_SIZE_TYPE, false, uno::makeAny(bMinHeight ? text::SizeType::MIN : text::SizeType::FIX ));
- pPropMap->Insert( PROP_HEIGHT, false, uno::makeAny(ConversionHelper::convertTwipToMM100( nHeight )));
- insertRowProps(pPropMap);
- }
- break;
- /* WRITERFILTERSTATUS: done: 1, planned: 2, spent: 0 */
case 0xd608: // TDefTable
{
writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
@@ -226,22 +165,6 @@ bool DomainMapperTableManager::sprm(Sprm & rSprm)
}
break;
/* WRITERFILTERSTATUS: done: 1, planned: 2, spent: 0 */
- case NS_ooxml::LN_CT_TcPrBase_vAlign://90694
- {
- sal_Int16 nVertOrient = text::VertOrientation::NONE;
- switch( nIntValue ) //0 - top 1 - center 3 - bottom
- {
- case 1: nVertOrient = text::VertOrientation::CENTER; break;
- case 3: nVertOrient = text::VertOrientation::BOTTOM; break;
- default:;
- };
- TablePropertyMapPtr pCellPropMap( new TablePropertyMap() );
- pCellPropMap->Insert( PROP_VERT_ORIENT, false, uno::makeAny( nVertOrient ) );
- //todo: in ooxml import the value of m_ncell is wrong
- cellProps( pCellPropMap );
- }
- break;
- /* WRITERFILTERSTATUS: done: 1, planned: 2, spent: 0 */
case 0xD605: // sprmTTableBorders
{
writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
@@ -256,70 +179,6 @@ bool DomainMapperTableManager::sprm(Sprm & rSprm)
}
}
break;
- /* WRITERFILTERSTATUS: done: 1, planned: 2, spent: 0 */
- case NS_ooxml::LN_CT_TblPrBase_tblBorders: //table borders, might be defined in table style
- {
- writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
- if( pProperties.get())
- {
- BorderHandlerPtr pBorderHandler( new BorderHandler(m_bOOXML) );
- pProperties->resolve(*pBorderHandler);
- TablePropertyMapPtr pTablePropMap( new TablePropertyMap );
- pTablePropMap->insert( pBorderHandler->getProperties() );
- insertTableProps( pTablePropMap );
- }
- }
- break;
- /* WRITERFILTERSTATUS: done: 1, planned: 2, spent: 0 */
- case NS_ooxml::LN_CT_TcPrBase_tcBorders ://cell borders
- //contains CT_TcBorders_left, right, top, bottom
- {
- writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
- if( pProperties.get())
- {
- //in OOXML there's one set of borders at each cell (if there is any)
- TDefTableHandlerPtr pTDefTableHandler( new TDefTableHandler( m_bOOXML ));
- pProperties->resolve( *pTDefTableHandler );
- TablePropertyMapPtr pCellPropMap( new TablePropertyMap );
- pTDefTableHandler->fillCellProperties( 0, pCellPropMap );
- cellProps( pCellPropMap );
- }
- }
- break;
- case NS_ooxml::LN_CT_TblPrBase_shd:
- {
- writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
- if( pProperties.get())
- {
- CellColorHandlerPtr pCellColorHandler( new CellColorHandler);
- pProperties->resolve( *pCellColorHandler );
- TablePropertyMapPtr pTablePropMap( new TablePropertyMap );
- insertTableProps( pCellColorHandler->getProperties() );
- }
- }
- break;
- /* WRITERFILTERSTATUS: done: 1, planned: 2, spent: 0 */
- case 0xd61a : // sprmTCellTopColor
- /* WRITERFILTERSTATUS: done: 1, planned: 2, spent: 0 */
- case 0xd61b : // sprmTCellLeftColor
- /* WRITERFILTERSTATUS: done: 1, planned: 2, spent: 0 */
- case 0xd61c : // sprmTCellBottomColor
- /* WRITERFILTERSTATUS: done: 1, planned: 2, spent: 0 */
- case 0xd61d : // sprmTCellRightColor
- /* WRITERFILTERSTATUS: done: 1, planned: 2, spent: 0 */
- case NS_ooxml::LN_CT_TcPrBase_shd:
- {
- // each color sprm contains as much colors as cells are in a row
- //LN_CT_TcPrBase_shd: cell shading contains: LN_CT_Shd_val, LN_CT_Shd_fill, LN_CT_Shd_color
- writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
- if( pProperties.get())
- {
- CellColorHandlerPtr pCellColorHandler( new CellColorHandler );
- pProperties->resolve( *pCellColorHandler );
- cellProps( pCellColorHandler->getProperties());
- }
- }
- break;
/* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
case 0xd632 : //sprmTNewSpacing
/* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
@@ -356,7 +215,6 @@ bool DomainMapperTableManager::sprm(Sprm & rSprm)
case 0xf618 : //unknown
bRet = false;
break;
-//OOXML table properties
/* WRITERFILTERSTATUS: done: 1, planned: 2, spent: 0 */
case NS_ooxml::LN_CT_TblPrBase_tblStyle: //table style name
{
@@ -368,32 +226,8 @@ bool DomainMapperTableManager::sprm(Sprm & rSprm)
break;
/* WRITERFILTERSTATUS: done: 1, planned: 2, spent: 0 */
case NS_ooxml::LN_CT_TblGridBase_gridCol:
-
- if(!m_nRow)
- {
- m_aTableGrid.push_back( ConversionHelper::convertTwipToMM100( nIntValue ) );
- }
- break;
- /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
- case NS_ooxml::LN_CT_TblPrBase_tblCellMar: //cell margins
{
- //contains LN_CT_TblCellMar_top, LN_CT_TblCellMar_left, LN_CT_TblCellMar_bottom, LN_CT_TblCellMar_right
- writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
- if( pProperties.get())
- {
- CellMarginHandlerPtr pCellMarginHandler( new CellMarginHandler );
- pProperties->resolve( *pCellMarginHandler );
- TablePropertyMapPtr pMarginProps( new TablePropertyMap );
- if( pCellMarginHandler->m_bTopMarginValid )
- pMarginProps->setValue( TablePropertyMap::CELL_MAR_TOP, pCellMarginHandler->m_nTopMargin );
- if( pCellMarginHandler->m_bBottomMarginValid )
- pMarginProps->setValue( TablePropertyMap::CELL_MAR_BOTTOM, pCellMarginHandler->m_nBottomMargin );
- if( pCellMarginHandler->m_bLeftMarginValid )
- pMarginProps->setValue( TablePropertyMap::CELL_MAR_LEFT, pCellMarginHandler->m_nLeftMargin );
- if( pCellMarginHandler->m_bRightMarginValid )
- pMarginProps->setValue( TablePropertyMap::CELL_MAR_RIGHT, pCellMarginHandler->m_nRightMargin );
- insertTableProps(pMarginProps);
- }
+ getCurrentGrid()->push_back( ConversionHelper::convertTwipToMM100( nIntValue ) );
}
break;
/* WRITERFILTERSTATUS: done: 1, planned: 2, spent: 0 */
@@ -408,25 +242,84 @@ bool DomainMapperTableManager::sprm(Sprm & rSprm)
/* WRITERFILTERSTATUS: done: 1, planned: 2, spent: 0 */
case NS_ooxml::LN_CT_TcPrBase_gridSpan: //number of grid positions spanned by this cell
{
+#if DEBUG
+ clog << "GridSpan: " << nIntValue << endl;
+#endif
//the cell width is determined by its position in the table grid
//it takes 'gridSpan' grid elements
- if( m_aGridSpans.size() < m_nCell)
+ IntVectorPtr pCurrentSpans = getCurrentSpans( );
+ if( pCurrentSpans->size() < m_nCell)
{
//fill missing elements with '1'
- m_aGridSpans.insert( m_aGridSpans.end(), m_nCell - m_aGridSpans.size(), 1 );
+ pCurrentSpans->insert( pCurrentSpans->end(), m_nCell - pCurrentSpans->size(), 1 );
}
- m_aGridSpans.push_back( nIntValue );
+ pCurrentSpans->push_back( nIntValue );
}
break;
/* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
- case NS_ooxml::LN_CT_TblPrBase_tblLook: break; //todo: table look specifier
+ case NS_ooxml::LN_CT_TblPrBase_tblLook:
+ break; //todo: table look specifier
/* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
- case NS_ooxml::LN_CT_TcPrBase_tcW: break; //fixed column width is not supported
- default: bRet = false;
+ case NS_ooxml::LN_CT_TcPrBase_tcW:
+ break; //fixed column width is not supported
+ case NS_ooxml::LN_CT_TrPrBase_cnfStyle:
+ {
+ TablePropertyMapPtr pProps( new TablePropertyMap );
+ pProps->Insert( PROP_CNF_STYLE, true, uno::makeAny( pValue->getString( ) ) );
+ insertRowProps( pProps );
+ }
+ break;
+ case NS_ooxml::LN_CT_PPrBase_cnfStyle:
+ // TODO cnfStyle on a paragraph
+ break;
+ case NS_ooxml::LN_CT_TcPrBase_cnfStyle:
+ {
+ TablePropertyMapPtr pProps( new TablePropertyMap );
+ pProps->Insert( PROP_CNF_STYLE, true, uno::makeAny( pValue->getString( ) ) );
+ cellProps( pProps );
+ }
+ break;
+ case NS_ooxml::LN_tblStart:
+ {
+ startLevel( );
+ }
+ break;
+ default:
+ bRet = false;
}
}
return bRet;
}
+
+boost::shared_ptr< vector<sal_Int32> > DomainMapperTableManager::getCurrentGrid( )
+{
+ return m_aTableGrid.back( );
+}
+
+boost::shared_ptr< vector< sal_Int32 > > DomainMapperTableManager::getCurrentSpans( )
+{
+ return m_aGridSpans.back( );
+}
+
+void DomainMapperTableManager::startLevel( )
+{
+ DomainMapperTableManager_Base_t::startLevel( );
+
+ IntVectorPtr pNewGrid( new vector<sal_Int32> );
+ IntVectorPtr pNewSpans( new vector<sal_Int32> );
+ m_aTableGrid.push_back( pNewGrid );
+ m_aGridSpans.push_back( pNewSpans );
+ m_nTableWidth = 0;
+}
+
+void DomainMapperTableManager::endLevel( )
+{
+ m_aTableGrid.pop_back( );
+ m_aGridSpans.pop_back( );
+
+ DomainMapperTableManager_Base_t::endLevel( );
+}
+
/*-- 02.05.2007 14:36:26---------------------------------------------------
-----------------------------------------------------------------------*/
@@ -439,10 +332,11 @@ void DomainMapperTableManager::endOfCellAction()
-----------------------------------------------------------------------*/
void DomainMapperTableManager::endOfRowAction()
{
- if(!m_nRow && !m_nTableWidth && m_aTableGrid.size())
+ IntVectorPtr pTableGrid = getCurrentGrid( );
+ if(!m_nTableWidth && pTableGrid->size())
{
- ::std::vector<sal_Int32>::const_iterator aCellIter = m_aTableGrid.begin();
- while( aCellIter != m_aTableGrid.end() )
+ ::std::vector<sal_Int32>::const_iterator aCellIter = pTableGrid->begin();
+ while( aCellIter != pTableGrid->end() )
m_nTableWidth += *aCellIter++;
if( m_nTableWidth > 0)
{
@@ -452,18 +346,20 @@ void DomainMapperTableManager::endOfRowAction()
insertTableProps(pPropMap);
}
}
- if( m_aGridSpans.size() < m_nCell)
+
+ IntVectorPtr pCurrentSpans = getCurrentSpans( );
+ if( pCurrentSpans->size() < m_nCell)
{
//fill missing elements with '1'
- m_aGridSpans.insert( m_aGridSpans.end(), m_nCell - m_aGridSpans.size(), 1 );
+ pCurrentSpans->insert( pCurrentSpans->end( ), m_nCell - pCurrentSpans->size(), 1 );
}
//calculate number of used grids - it has to match the size of m_aTableGrid
size_t nGrids = 0;
- ::std::vector<sal_Int32>::const_iterator aGridSpanIter = m_aGridSpans.begin();
- for( ; aGridSpanIter != m_aGridSpans.end(); ++aGridSpanIter)
+ ::std::vector<sal_Int32>::const_iterator aGridSpanIter = pCurrentSpans->begin();
+ for( ; aGridSpanIter != pCurrentSpans->end(); ++aGridSpanIter)
nGrids += *aGridSpanIter;
- if( m_aTableGrid.size() == nGrids )
+ if( pTableGrid->size() == nGrids )
{
//determine table width
double nFullWidth = m_nTableWidth;
@@ -473,13 +369,15 @@ void DomainMapperTableManager::endOfRowAction()
text::TableColumnSeparator* pSeparators = aSeparators.getArray();
sal_Int16 nLastRelPos = 0;
sal_uInt32 nBorderGridIndex = 0;
+
+ ::std::vector< sal_Int32 >::const_iterator aSpansIter = pCurrentSpans->begin( );
for( sal_uInt32 nBorder = 0; nBorder < m_nCell - 1; ++nBorder )
{
- sal_Int32 nGridCount = m_aGridSpans[nBorder];
+ sal_Int32 nGridCount = *aSpansIter;
double fGridWidth = 0.;
do
{
- fGridWidth += m_aTableGrid[nBorderGridIndex++];
+ fGridWidth += (*pTableGrid.get())[nBorderGridIndex++];
}while( --nGridCount );
sal_Int16 nRelPos =
@@ -488,6 +386,7 @@ void DomainMapperTableManager::endOfRowAction()
pSeparators[nBorder].Position = nRelPos + nLastRelPos;
pSeparators[nBorder].IsVisible = sal_True;
nLastRelPos = nLastRelPos + nRelPos;
+ aSpansIter++;
}
TablePropertyMapPtr pPropMap( new TablePropertyMap );
pPropMap->Insert( PROP_TABLE_COLUMN_SEPARATORS, false, uno::makeAny( aSeparators ) );
@@ -497,7 +396,7 @@ void DomainMapperTableManager::endOfRowAction()
++m_nRow;
m_nCell = 0;
m_nCellBorderIndex = 0;
- m_aGridSpans.clear();
+ pCurrentSpans->clear();
}
/*-- 18.06.2007 10:34:37---------------------------------------------------
@@ -505,8 +404,6 @@ void DomainMapperTableManager::endOfRowAction()
void DomainMapperTableManager::clearData()
{
m_nRow = m_nCell = m_nCellBorderIndex = m_nHeaderRepeat = m_nTableWidth = 0;
- m_aTableGrid.clear();
- m_aGridSpans.clear();
m_sTableStyleName = ::rtl::OUString();
m_pTableStyleTextProperies.reset();
}
@@ -521,10 +418,10 @@ void lcl_CopyTextProperties(PropertyMapPtr pToFill,
//fill base style properties first, recursively
if( pStyleSheetEntry->sBaseStyleIdentifier.getLength())
{
- const StyleSheetEntry* pParentStyleSheet =
+ const StyleSheetEntryPtr pParentStyleSheet =
pStyleSheetTable->FindStyleSheetByISTD(pStyleSheetEntry->sBaseStyleIdentifier);
OSL_ENSURE( pParentStyleSheet, "table style not found" );
- lcl_CopyTextProperties( pToFill, pParentStyleSheet, pStyleSheetTable);
+ lcl_CopyTextProperties( pToFill, pParentStyleSheet.get( ), pStyleSheetTable);
}
PropertyMap::const_iterator aPropIter = pStyleSheetEntry->pProperties->begin();
@@ -541,10 +438,10 @@ void DomainMapperTableManager::CopyTextProperties(PropertyMapPtr pContext, Style
if( !m_pTableStyleTextProperies.get())
{
m_pTableStyleTextProperies.reset( new PropertyMap );
- const StyleSheetEntry* pStyleSheetEntry = pStyleSheetTable->FindStyleSheetByISTD(
+ const StyleSheetEntryPtr pStyleSheetEntry = pStyleSheetTable->FindStyleSheetByISTD(
m_sTableStyleName);
OSL_ENSURE( pStyleSheetEntry, "table style not found" );
- lcl_CopyTextProperties(m_pTableStyleTextProperies, pStyleSheetEntry, pStyleSheetTable);
+ lcl_CopyTextProperties(m_pTableStyleTextProperies, pStyleSheetEntry.get( ), pStyleSheetTable);
}
pContext->insert( m_pTableStyleTextProperies );
}
diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.hxx b/writerfilter/source/dmapper/DomainMapperTableManager.hxx
index 2703b155e11f..7a8b07c8d174 100644
--- a/writerfilter/source/dmapper/DomainMapperTableManager.hxx
+++ b/writerfilter/source/dmapper/DomainMapperTableManager.hxx
@@ -30,6 +30,8 @@
#ifndef INCLUDED_DOMAIN_MAPPER_TABLE_MANAGER_HXX
#define INCLUDED_DOMAIN_MAPPER_TABLE_MANAGER_HXX
+#include "TablePropertiesHandler.hxx"
+
#include <resourcemodel/TableManager.hxx>
#include <PropertyMap.hxx>
#include <StyleSheetTable.hxx>
@@ -38,10 +40,11 @@
namespace writerfilter {
namespace dmapper {
-typedef ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > Handle_t;
-typedef TableManager<Handle_t , TablePropertyMapPtr > DomainMapperTableManager_Base_t;
+
class DomainMapperTableManager : public DomainMapperTableManager_Base_t
{
+ typedef boost::shared_ptr< std::vector<sal_Int32> > IntVectorPtr;
+
sal_uInt32 m_nRow;
sal_uInt32 m_nCell;
sal_uInt32 m_nCellBorderIndex; //borders are provided for all cells and need counting
@@ -51,8 +54,11 @@ class DomainMapperTableManager : public DomainMapperTableManager_Base_t
::rtl::OUString m_sTableStyleName;
PropertyMapPtr m_pTableStyleTextProperies;
- ::std::vector<sal_Int32> m_aTableGrid;
- ::std::vector<sal_Int32> m_aGridSpans;
+ ::std::vector< IntVectorPtr > m_aTableGrid;
+ ::std::vector< IntVectorPtr > m_aGridSpans;
+
+ TablePropertiesHandler *m_pTablePropsHandler;
+ PropertyMapPtr m_pStyleProps;
virtual void clearData();
@@ -61,15 +67,56 @@ public:
DomainMapperTableManager(bool bOOXML);
virtual ~DomainMapperTableManager();
+ // use this method to avoid adding the properties for the table
+ // but in the provided properties map.
+ inline void SetStyleProperties( PropertyMapPtr pProperties ) { m_pStyleProps = pProperties; };
+
virtual bool sprm(Sprm & rSprm);
+ virtual void startLevel( );
+ virtual void endLevel( );
+
virtual void endOfCellAction();
virtual void endOfRowAction();
+ IntVectorPtr getCurrentGrid( );
+ IntVectorPtr getCurrentSpans( );
+
const ::rtl::OUString& getTableStyleName() const { return m_sTableStyleName; }
/// copy the text properties of the table style and its parent into pContext
void CopyTextProperties(PropertyMapPtr pContext, StyleSheetTablePtr pStyleSheetTable);
+ inline virtual void cellProps(TablePropertyMapPtr pProps)
+ {
+ if ( m_pStyleProps.get( ) )
+ m_pStyleProps->insert( pProps, true );
+ else
+ DomainMapperTableManager_Base_t::cellProps( pProps );
+ };
+
+ inline virtual void cellPropsByCell(unsigned int i, TablePropertyMapPtr pProps)
+ {
+ if ( m_pStyleProps.get( ) )
+ m_pStyleProps->insert( pProps, true );
+ else
+ DomainMapperTableManager_Base_t::cellPropsByCell( i, pProps );
+ };
+
+ inline virtual void insertRowProps(TablePropertyMapPtr pProps)
+ {
+ if ( m_pStyleProps.get( ) )
+ m_pStyleProps->insert( pProps, true );
+ else
+ DomainMapperTableManager_Base_t::insertRowProps( pProps );
+ };
+
+ inline virtual void insertTableProps(TablePropertyMapPtr pProps)
+ {
+ if ( m_pStyleProps.get( ) )
+ m_pStyleProps->insert( pProps, true );
+ else
+ DomainMapperTableManager_Base_t::insertTableProps( pProps );
+ };
};
}}
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 2d8acbcdb56e..e6b52805a5da 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -36,6 +36,8 @@
#include <com/sun/star/beans/XPropertyState.hpp>
#include <com/sun/star/container/XIndexReplace.hpp>
#include <com/sun/star/container/XNamed.hpp>
+#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
+#include <com/sun/star/drawing/XShapes.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
#include <com/sun/star/style/LineNumberPosition.hpp>
@@ -55,6 +57,7 @@
#include <com/sun/star/text/ReferenceFieldPart.hpp>
#include <com/sun/star/text/ReferenceFieldSource.hpp>
#include <com/sun/star/text/SizeType.hpp>
+#include <com/sun/star/text/TextContentAnchorType.hpp>
#include <com/sun/star/text/WrapTextMode.hpp>
#include <com/sun/star/text/XDependentTextField.hpp>
#include <com/sun/star/text/XParagraphCursor.hpp>
@@ -69,12 +72,17 @@
#include <com/sun/star/util/XNumberFormats.hpp>
#include <rtl/ustrbuf.hxx>
#include <rtl/string.h>
+
+#include <tools/string.hxx>
#ifdef DEBUG_DOMAINMAPPER
#include <resourcemodel/QNameToString.hxx>
#include <resourcemodel/util.hxx>
#endif
#include <ooxml/OOXMLFastTokens.hxx>
+#if DEBUG
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#endif
#include <map>
@@ -393,6 +401,8 @@ DomainMapper_Impl::DomainMapper_Impl(
m_bIsFirstSection( true ),
m_bIsColumnBreakDeferred( false ),
m_bIsPageBreakDeferred( false ),
+ m_bIsInShape( false ),
+ m_bShapeContextAdded( false ),
m_TableManager( eDocumentType == DOCUMENT_OOXML ),
m_nCurrentTabStopIndex( 0 ),
m_sCurrentParaStyleId(),
@@ -401,7 +411,7 @@ DomainMapper_Impl::DomainMapper_Impl(
m_bLineNumberingSet( false ),
m_bIsInFootnoteProperties( true ),
m_bIsCustomFtnMark( false ),
- n_CurrentRedlineToken( ooxml::OOXML_mod )
+ m_bIsParaChange( false )
{
GetBodyText();
uno::Reference< text::XTextAppend > xBodyTextAppend = uno::Reference< text::XTextAppend >( m_xBodyText, uno::UNO_QUERY );
@@ -685,13 +695,13 @@ uno::Sequence< style::TabStop > DomainMapper_Impl::GetCurrentTabStopAndClear()
-----------------------------------------------------------------------*/
uno::Any DomainMapper_Impl::GetPropertyFromStyleSheet(PropertyIds eId)
{
- const StyleSheetEntry* pEntry = 0;
+ StyleSheetEntryPtr pEntry;
if( m_bInStyleSheetImport )
pEntry = GetStyleSheetTable()->FindParentStyleSheet(::rtl::OUString());
else
pEntry =
GetStyleSheetTable()->FindStyleSheetByISTD(GetCurrentParaStyleId());
- while(pEntry)
+ while(pEntry.get( ) )
{
//is there a tab stop set?
if(pEntry->pProperties)
@@ -725,10 +735,10 @@ void DomainMapper_Impl::deferBreak( BreakType deferredBreakType)
switch (deferredBreakType)
{
case COLUMN_BREAK:
- m_bIsColumnBreakDeferred = true;
+ m_bIsColumnBreakDeferred = true;
break;
case PAGE_BREAK:
- m_bIsPageBreakDeferred = true;
+ m_bIsPageBreakDeferred = true;
break;
default:
return;
@@ -831,11 +841,15 @@ void lcl_AddRangeAndStyle(
/*-------------------------------------------------------------------------
-----------------------------------------------------------------------*/
-//define some default frame width - 10cm ATM
-#define DEFAULT_FRAME_MIN_WIDTH 10000
+//define some default frame width - 0cm ATM: this allow the frame to be wrapped around the text
+#define DEFAULT_FRAME_MIN_WIDTH 0
void DomainMapper_Impl::finishParagraph( PropertyMapPtr pPropertyMap )
{
+#if DEBUG
+ clog << "finishParagraph" << endl;
+#endif
+
ParagraphPropertyMap* pParaContext = dynamic_cast< ParagraphPropertyMap* >( pPropertyMap.get() );
TextAppendContext& rAppendContext = m_aTextAppendStack.top();
uno::Reference< text::XTextAppend > xTextAppend = rAppendContext.xTextAppend;
@@ -903,11 +917,11 @@ void DomainMapper_Impl::finishParagraph( PropertyMapPtr pPropertyMap )
try
{
//
- const StyleSheetEntry* pParaStyle =
+ StyleSheetEntryPtr pParaStyle =
m_pStyleSheetTable->FindStyleSheetByConvertedStyleName(rAppendContext.pLastParagraphProperties->GetParaStyleName());
uno::Sequence< beans::PropertyValue > aFrameProperties(pParaStyle ? 15: 0);
- if(pParaStyle)
+ if ( pParaStyle.get( ) )
{
const ParagraphProperties* pStyleProperties = dynamic_cast<const ParagraphProperties*>( pParaStyle->pProperties.get() );
beans::PropertyValue* pFrameProperties = aFrameProperties.getArray();
@@ -1045,14 +1059,34 @@ void DomainMapper_Impl::finishParagraph( PropertyMapPtr pPropertyMap )
uno::Reference< text::XTextRange > xTextRange =
xTextAppend->finishParagraph( aProperties );
m_TableManager.handle(xTextRange);
- }
- else
- {
+ // Set the anchor of the objects to the created paragraph
+ while ( m_aAnchoredStack.size( ) > 0 && !m_bIsInShape )
+ {
+ uno::Reference< text::XTextContent > xObj = m_aAnchoredStack.top( );
+ try
+ {
+#if DEBUG
+ rtl::OUString sText( xTextRange->getString( ) );
+#endif
+ xObj->attach( xTextRange );
+ }
+ catch ( uno::RuntimeException& )
+ {
+ // this is normal: the shape is already attached
+ }
+ m_aAnchoredStack.pop( );
+ }
+
+ // Get the end of paragraph character inserted
+ uno::Reference< text::XTextCursor > xCur = xTextRange->getText( )->createTextCursor( );
+ xCur->gotoEnd( false );
+ xCur->goLeft( 1 , true );
+ uno::Reference< text::XTextRange > xParaEnd( xCur, uno::UNO_QUERY );
+ CheckParaRedline( xParaEnd );
}
if( !bKeepLastParagraphProperties )
rAppendContext.pLastParagraphProperties = pToBeSavedProperties;
-
}
catch(const lang::IllegalArgumentException& rIllegal)
{
@@ -1062,7 +1096,7 @@ void DomainMapper_Impl::finishParagraph( PropertyMapPtr pPropertyMap )
catch(const uno::Exception& rEx)
{
(void)rEx;
- OSL_ENSURE( false, "ArgumentException in DomainMapper_Impl::finishParagraph" );
+ //OSL_ENSURE( false, "ArgumentException in DomainMapper_Impl::finishParagraph" );
}
}
}
@@ -1099,35 +1133,7 @@ void DomainMapper_Impl::appendTextPortion( const ::rtl::OUString& rString, Prope
uno::Reference< text::XTextRange > xTextRange =
xTextAppend->appendTextPortion
(rString, pPropertyMap->GetPropertyValues());
- if( m_CurrentRedlineDate.getLength() )
- {
- try
- {
- ::rtl::OUString sType;
- PropertyNameSupplier& rPropNameSupplier = PropertyNameSupplier::GetPropertyNameSupplier();
- switch(n_CurrentRedlineToken & 0xffff)
- {
- case ooxml::OOXML_mod : sType = rPropNameSupplier.GetName( PROP_FORMAT ); break;
- case ooxml::OOXML_ins : sType = rPropNameSupplier.GetName( PROP_INSERT ); break;
- case ooxml::OOXML_del : sType = rPropNameSupplier.GetName( PROP_DELETE ); break;
- }
- uno::Reference< text::XRedline > xRedline( xTextRange, uno::UNO_QUERY_THROW );
- beans::PropertyValues aRedlineProperties( 2 );
- beans::PropertyValue* pRedlineProperties = aRedlineProperties.getArray();
- pRedlineProperties[0].Name = rPropNameSupplier.GetName( PROP_REDLINE_AUTHOR );
- pRedlineProperties[0].Value <<= m_CurrentRedlineAuthor;
- pRedlineProperties[1].Name = rPropNameSupplier.GetName( PROP_REDLINE_DATE_TIME );
- pRedlineProperties[1].Value <<= lcl_DateStringToDateTime( m_CurrentRedlineDate );
- xRedline->makeRedline( sType, aRedlineProperties);
-
- }
- catch( const uno::Exception& rEx )
- {
- (void)rEx;
- OSL_ENSURE( false, "Exception in makeRedline" );
- }
- ResetRedlineProperties();
- }
+ CheckRedline( xTextRange );
//m_TableManager.handle(xTextRange);
}
@@ -1167,6 +1173,7 @@ void DomainMapper_Impl::appendTextContent(
}
}
}
+
/*-- 24.04.2008 08:38:07---------------------------------------------------
-----------------------------------------------------------------------*/
@@ -1368,9 +1375,11 @@ void DomainMapper_Impl::PushFootOrEndnote( bool bIsFootnote )
aFontProps->Insert(PROP_CHAR_FONT_NAME, true, uno::makeAny( pTopContext->GetFootnoteFontName() ));
aFontProperties = aFontProps->GetPropertyValues();
}
-
appendTextContent( uno::Reference< text::XTextContent >( xFootnoteText, uno::UNO_QUERY_THROW ), aFontProperties );
m_aTextAppendStack.push(uno::Reference< text::XTextAppend >( xFootnoteText, uno::UNO_QUERY_THROW ));
+
+ // Redlines for the footnote anchor
+ CheckRedline( xFootnote->getAnchor( ) );
}
catch( uno::Exception& )
{
@@ -1378,6 +1387,87 @@ void DomainMapper_Impl::PushFootOrEndnote( bool bIsFootnote )
}
}
+void DomainMapper_Impl::CreateRedline( uno::Reference< text::XTextRange > xRange, RedlineParamsPtr& pRedline )
+{
+ if ( pRedline.get( ) )
+ {
+#if DEBUG
+ clog << "REDLINE: Writing redline: " << pRedline->m_nId << endl;
+#endif
+ try
+ {
+ ::rtl::OUString sType;
+ PropertyNameSupplier & rPropNameSupplier = PropertyNameSupplier::GetPropertyNameSupplier( );
+ switch ( pRedline->m_nToken & 0xffff )
+ {
+ case ooxml::OOXML_mod:
+ sType = rPropNameSupplier.GetName( PROP_FORMAT );
+ break;
+ case ooxml::OOXML_ins:
+ sType = rPropNameSupplier.GetName( PROP_INSERT );
+ break;
+ case ooxml::OOXML_del:
+ sType = rPropNameSupplier.GetName( PROP_DELETE );
+ break;
+ }
+ uno::Reference < text::XRedline > xRedline( xRange, uno::UNO_QUERY_THROW );
+ beans::PropertyValues aRedlineProperties( 2 );
+ beans::PropertyValue * pRedlineProperties = aRedlineProperties.getArray( );
+ pRedlineProperties[0].Name = rPropNameSupplier.GetName( PROP_REDLINE_AUTHOR );
+ pRedlineProperties[0].Value <<= pRedline->m_sAuthor;
+ pRedlineProperties[1].Name = rPropNameSupplier.GetName( PROP_REDLINE_DATE_TIME );
+ pRedlineProperties[1].Value <<= lcl_DateStringToDateTime( pRedline->m_sDate );
+
+ xRedline->makeRedline( sType, aRedlineProperties );
+ }
+ catch( const uno::Exception & rEx )
+ {
+#if DEBUG
+ clog << "REDLINE: error - " << rtl::OUStringToOString( rEx.Message, RTL_TEXTENCODING_UTF8 ).getStr( ) << endl;
+#endif
+ ( void ) rEx;
+ OSL_ENSURE( false, "Exception in makeRedline" );
+ }
+ }
+}
+
+void DomainMapper_Impl::CheckParaRedline( uno::Reference< text::XTextRange > xRange )
+{
+ if ( m_pParaRedline.get( ) )
+ {
+ CreateRedline( xRange, m_pParaRedline );
+ ResetParaRedline( );
+ }
+}
+
+void DomainMapper_Impl::CheckRedline( uno::Reference< text::XTextRange > xRange )
+{
+ vector<RedlineParamsPtr>::iterator pIt = m_aRedlines.begin( );
+ vector< RedlineParamsPtr > aCleaned;
+ for (; pIt != m_aRedlines.end( ); pIt++ )
+ {
+ CreateRedline( xRange, *pIt );
+
+ // Adding the non-mod redlines to the temporary vector
+ if ( pIt->get( ) && ( ( *pIt )->m_nToken & 0xffff ) != ooxml::OOXML_mod )
+ {
+ aCleaned.push_back( *pIt );
+ }
+ }
+
+ m_aRedlines.swap( aCleaned );
+}
+
+void DomainMapper_Impl::StartParaChange( )
+{
+ m_bIsParaChange = true;
+}
+
+void DomainMapper_Impl::EndParaChange( )
+{
+ m_bIsParaChange = false;
+}
+
/*-- 22.12.2008 13:45:15---------------------------------------------------
-----------------------------------------------------------------------*/
@@ -1416,57 +1506,58 @@ void DomainMapper_Impl::PopAnnotation()
m_xAnnotationField.clear();
}
-/*-- 20.03.2008 09:01:58---------------------------------------------------
- -----------------------------------------------------------------------*/
-void DomainMapper_Impl::PushShapeContext()
+void DomainMapper_Impl::PushShapeContext( const uno::Reference< drawing::XShape > xShape )
{
+#if DEBUG
+ clog << "PushShapeContext" << endl;
+#endif
+ m_bIsInShape = true;
try
{
- uno::Reference< text::XText > xTemporaryShape( GetTextFactory()->createInstance(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.RectangleShape") )),
- uno::UNO_QUERY_THROW );
- uno::Reference< text::XTextAppend > xShapeAppend( xTemporaryShape, uno::UNO_QUERY );
- //insert into the document
- uno::Reference< text::XTextContent > xShapeContent( xTemporaryShape, uno::UNO_QUERY_THROW );
- xShapeContent->attach( GetBodyText()->getStart() );
- m_aTextAppendStack.push(uno::Reference< text::XTextAppend >( xShapeAppend, uno::UNO_QUERY_THROW ));
+ // Add the shape to the text append stack
+ m_aTextAppendStack.push( uno::Reference< text::XTextAppend >( xShape, uno::UNO_QUERY_THROW ) );
+ m_bShapeContextAdded = true;
+
+ // Add the shape to the anchored objects stack
+ uno::Reference< text::XTextContent > xTxtContent( xShape, uno::UNO_QUERY_THROW );
+ m_aAnchoredStack.push( xTxtContent );
+
+ PropertyNameSupplier& rPropNameSupplier = PropertyNameSupplier::GetPropertyNameSupplier();
+
+ uno::Reference< beans::XPropertySet > xProps( xShape, uno::UNO_QUERY_THROW );
+ xProps->setPropertyValue(
+ rPropNameSupplier.GetName( PROP_ANCHOR_TYPE ),
+ uno::makeAny( text::TextContentAnchorType_AT_PARAGRAPH ) );
+ xProps->setPropertyValue(
+ rPropNameSupplier.GetName( PROP_OPAQUE ),
+ uno::makeAny( true ) );
}
- catch( uno::Exception& )
+ catch ( const uno::Exception& e )
{
- OSL_ENSURE( false, "exception in DomainMapper_Impl::PushShapeContext" );
+#if DEBUG
+ clog << "Exception when adding shape: ";
+ clog << rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_UTF8 ).getStr( );
+ clog << endl;
+#endif
}
}
+
/*-- 20.03.2008 09:01:59---------------------------------------------------
-----------------------------------------------------------------------*/
void DomainMapper_Impl::PopShapeContext()
{
- m_xTemporaryShape = uno::Reference< drawing::XShape >( m_aTextAppendStack.top().xTextAppend, uno::UNO_QUERY );
- m_aTextAppendStack.pop();
-}
-/*-- 20.03.2008 12:31:58---------------------------------------------------
+#if DEBUG
+ clog << "PopShapeContext" << endl;
+#endif
- -----------------------------------------------------------------------*/
-void DomainMapper_Impl::CopyTemporaryShapeText( uno::Reference< drawing::XShape > xShape )
-{
- uno::Reference< text::XTextCopy >xShapeText( xShape, uno::UNO_QUERY );
- uno::Reference< text::XTextCopy >xTempShapeText( m_xTemporaryShape, uno::UNO_QUERY );
- if( xShapeText.is() && xTempShapeText.is() )
- {
- xShapeText->copyText( xTempShapeText );
- }
- try
- {
- uno::Reference< lang::XComponent >xTemp( m_xTemporaryShape, uno::UNO_QUERY );
- if( xTemp.is() )
- xTemp->dispose();
- }
- catch( const uno::Exception& )
+ if ( m_bShapeContextAdded )
{
+ m_aTextAppendStack.pop();
+ m_bShapeContextAdded = false;
}
- m_xTemporaryShape = uno::Reference< drawing::XShape >();
-
+ m_bIsInShape = false;
}
/*-- 12.09.2006 08:07:55---------------------------------------------------
@@ -2952,6 +3043,7 @@ void DomainMapper_Impl::CloseFieldCommand()
bool bHyperlinks = false;
bool bFromOutline = false;
bool bFromEntries = false;
+ sal_Int16 nMaxLevel = 10;
::rtl::OUString sTemplate;
::rtl::OUString sChapterNoSeparator;
// \a Builds a table of figures but does not include the captions's label and number
@@ -3001,6 +3093,10 @@ void DomainMapper_Impl::CloseFieldCommand()
if( lcl_FindInCommand( pContext->GetCommand(), 'o', sValue ))
{
bFromOutline = true;
+ UniString sParam( sValue );
+ xub_StrLen nIndex = 0;
+ sParam.GetToken( 0, '-', nIndex );
+ nMaxLevel = sal_Int16( sParam.Copy( nIndex ).ToInt32( ) );
}
// \p Defines the separator between the table entry and its page number
if( lcl_FindInCommand( pContext->GetCommand(), 'p', sValue ))
@@ -3048,6 +3144,7 @@ void DomainMapper_Impl::CloseFieldCommand()
xTOC->setPropertyValue(rPropNameSupplier.GetName( PROP_TITLE ), uno::makeAny(::rtl::OUString()));
if( !bTableOfFigures )
{
+ xTOC->setPropertyValue( rPropNameSupplier.GetName( PROP_LEVEL ), uno::makeAny( nMaxLevel ) );
xTOC->setPropertyValue( rPropNameSupplier.GetName( PROP_CREATE_FROM_OUTLINE ), uno::makeAny( bFromOutline ));
xTOC->setPropertyValue( rPropNameSupplier.GetName( PROP_CREATE_FROM_MARKS ), uno::makeAny( bFromEntries ));
if( sTemplate.getLength() )
@@ -3531,14 +3628,98 @@ bool DomainMapper_Impl::ExecuteFrameConversion()
}
return bRet;
}
+
+void DomainMapper_Impl::AddNewRedline( )
+{
+ RedlineParamsPtr pNew( new RedlineParams );
+ pNew->m_nToken = ooxml::OOXML_mod;
+ if ( !m_bIsParaChange )
+ {
+#if DEBUG
+ clog << "REDLINE: Adding a new redline to stack" << endl;
+#endif
+ m_aRedlines.push_back( pNew );
+ }
+ else
+ {
+#if DEBUG
+ clog << "REDLINE: Setting a new paragraph redline" << endl;
+#endif
+ m_pParaRedline.swap( pNew );
+ }
+}
+
+RedlineParamsPtr DomainMapper_Impl::GetTopRedline( )
+{
+ RedlineParamsPtr pResult;
+ if ( !m_bIsParaChange && m_aRedlines.size( ) > 0 )
+ pResult = m_aRedlines.back( );
+ else if ( m_bIsParaChange )
+ pResult = m_pParaRedline;
+ return pResult;
+}
+
+sal_Int32 DomainMapper_Impl::GetCurrentRedlineToken( )
+{
+ sal_Int32 nToken = 0;
+ RedlineParamsPtr pCurrent( GetTopRedline( ) );
+ if ( pCurrent.get( ) )
+ nToken = pCurrent->m_nToken;
+ return nToken;
+}
+
+void DomainMapper_Impl::SetCurrentRedlineAuthor( rtl::OUString sAuthor )
+{
+ RedlineParamsPtr pCurrent( GetTopRedline( ) );
+ if ( pCurrent.get( ) )
+ pCurrent->m_sAuthor = sAuthor;
+}
+
+void DomainMapper_Impl::SetCurrentRedlineDate( rtl::OUString sDate )
+{
+ RedlineParamsPtr pCurrent( GetTopRedline( ) );
+ if ( pCurrent.get( ) )
+ pCurrent->m_sDate = sDate;
+}
+
+void DomainMapper_Impl::SetCurrentRedlineId( sal_Int32 sId )
+{
+ RedlineParamsPtr pCurrent( GetTopRedline( ) );
+ if ( pCurrent.get( ) )
+ pCurrent->m_nId = sId;
+}
+
+void DomainMapper_Impl::SetCurrentRedlineToken( sal_Int32 nToken )
+{
+ RedlineParamsPtr pCurrent( GetTopRedline( ) );
+ if ( pCurrent.get( ) )
+ pCurrent->m_nToken = nToken;
+}
+
/*-- 19.03.2008 11:35:38---------------------------------------------------
-----------------------------------------------------------------------*/
-void DomainMapper_Impl::ResetRedlineProperties()
+void DomainMapper_Impl::RemoveCurrentRedline( )
{
- m_CurrentRedlineAuthor = m_CurrentRedlineDate = m_CurrentRedlineId = ::rtl::OUString();
- n_CurrentRedlineToken = ooxml::OOXML_mod;
+ if ( m_aRedlines.size( ) > 0 )
+ {
+#if DEBUG
+ clog << "REDLINE: Removing back redline" << endl;
+#endif
+ m_aRedlines.pop_back( );
+ }
}
+void DomainMapper_Impl::ResetParaRedline( )
+{
+ if ( m_pParaRedline.get( ) )
+ {
+#if DEBUG
+ clog << "REDLINE: Cleaning the para redline" << endl;
+#endif
+ RedlineParamsPtr pEmpty;
+ m_pParaRedline.swap( pEmpty );
+ }
+}
}}
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
index f4dfaf0041e7..989d09e9d351 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
@@ -34,6 +34,7 @@
#include <com/sun/star/text/XTextCursor.hpp>
#include <com/sun/star/text/XTextAppend.hpp>
#include <com/sun/star/text/XTextAppendAndConvert.hpp>
+#include <com/sun/star/text/XTextFrame.hpp>
#include <com/sun/star/style/TabStop.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
#include <vector>
@@ -51,6 +52,7 @@
#include <LFOTable.hxx>
#include <StyleSheetTable.hxx>
#include <ThemeTable.hxx>
+#include <SettingsTable.hxx>
#include <GraphicImport.hxx>
#include <OLEHandler.hxx>
#include <map>
@@ -177,6 +179,7 @@ typedef std::stack<ContextType> ContextStack;
typedef std::stack<PropertyMapPtr> PropertyStack;
typedef std::stack< TextAppendContext > TextAppendStack;
typedef std::stack<FieldContextPtr> FieldStack;
+typedef std::stack< com::sun::star::uno::Reference< com::sun::star::text::XTextContent > > TextContentStack;
/*-- 18.07.2006 08:49:08---------------------------------------------------
@@ -225,6 +228,15 @@ struct BookmarkInsertPosition
{}
};
+struct RedlineParams
+{
+ ::rtl::OUString m_sAuthor;
+ ::rtl::OUString m_sDate;
+ sal_Int32 m_nId;
+ sal_Int32 m_nToken;
+};
+typedef boost::shared_ptr< RedlineParams > RedlineParamsPtr;
+
/*-- 03.03.2008 11:01:38---------------------------------------------------
-----------------------------------------------------------------------*/
@@ -267,12 +279,17 @@ private:
TextAppendStack m_aTextAppendStack;
+ TextContentStack
+ m_aAnchoredStack;
+
FieldStack m_aFieldStack;
bool m_bFieldMode;
bool m_bSetUserFieldContent;
bool m_bIsFirstSection;
bool m_bIsColumnBreakDeferred;
bool m_bIsPageBreakDeferred;
+ bool m_bIsInShape;
+ bool m_bShapeContextAdded;
LineNumberSettings m_aLineNumberSettings;
@@ -293,6 +310,7 @@ private:
StyleSheetTablePtr m_pStyleSheetTable;
ThemeTablePtr m_pThemeTable;
GraphicImportPtr m_pGraphicImport;
+ SettingsTablePtr m_pSettingsTable;
PropertyMapPtr m_pTopContext;
@@ -311,14 +329,11 @@ private:
::com::sun::star::uno::Reference< text::XTextRange > m_xFrameStartRange;
::com::sun::star::uno::Reference< text::XTextRange > m_xFrameEndRange;
- //current redline
- ::rtl::OUString m_CurrentRedlineAuthor;
- ::rtl::OUString m_CurrentRedlineDate;
- ::rtl::OUString m_CurrentRedlineId;
- sal_Int32 n_CurrentRedlineToken;
+ // Redline stack
+ std::vector< RedlineParamsPtr > m_aRedlines;
+ RedlineParamsPtr m_pParaRedline;
+ bool m_bIsParaChange;
- //shape import
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > m_xTemporaryShape;
//annotation import
uno::Reference< beans::XPropertySet > m_xAnnotationField;
@@ -357,6 +372,15 @@ public:
}
void SetDocumentSettingsProperty( const ::rtl::OUString& rPropName, const uno::Any& rValue );
+ void CreateRedline( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > xRange, RedlineParamsPtr& pRedline );
+
+ void CheckParaRedline( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > xRange );
+
+ void CheckRedline( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > xRange );
+
+ void StartParaChange( );
+ void EndParaChange( );
+
void deferBreak( BreakType deferredBreakType );
bool isBreakDeferred( BreakType deferredBreakType );
void clearDeferredBreaks();
@@ -412,6 +436,13 @@ public:
return m_pThemeTable;
}
+ SettingsTablePtr GetSettingsTable( )
+ {
+ if ( !m_pSettingsTable )
+ m_pSettingsTable.reset( new SettingsTable );
+ return m_pSettingsTable;
+ }
+
GraphicImportPtr GetGraphicImport( GraphicImportType eGraphicImportType );
void ResetGraphicImport();
// this method deletes the current m_pGraphicImport after import
@@ -432,10 +463,8 @@ public:
void SetAnyTableImport( bool bSet ) { m_bInAnyTableImport = bSet;}
bool IsAnyTableImport()const { return m_bInAnyTableImport;}
- void PushShapeContext();
+ void PushShapeContext( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape );
void PopShapeContext();
- bool IsInShapeContext() const { return m_xTemporaryShape.is(); }
- void CopyTemporaryShapeText( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape );
void PushPageHeader(SectionPropertyMap::PageType eType);
void PushPageFooter(SectionPropertyMap::PageType eType);
@@ -495,19 +524,17 @@ public:
);
bool ExecuteFrameConversion();
- ::rtl::OUString GetCurrentRedlineAuthor() const { return m_CurrentRedlineAuthor; }
- void SetCurrentRedlineAuthor( const ::rtl::OUString& rSet ) { m_CurrentRedlineAuthor = rSet; }
-
- ::rtl::OUString GetCurrentRedlineDate() const { return m_CurrentRedlineDate; }
- void SetCurrentRedlineDate( const ::rtl::OUString& rSet ) { m_CurrentRedlineDate = rSet; }
-
- ::rtl::OUString GetCurrentRedlineId() const { return m_CurrentRedlineId; }
- void SetCurrentRedlineId( const ::rtl::OUString& rSet ) { m_CurrentRedlineId = rSet; }
+ void AddNewRedline( );
- sal_Int32 GetCurrentRedlineToken() const { return n_CurrentRedlineToken; }
- void SetCurrentRedlineToken(sal_Int32 nSet) { n_CurrentRedlineToken = nSet; }
+ RedlineParamsPtr GetTopRedline( );
- void ResetRedlineProperties();
+ sal_Int32 GetCurrentRedlineToken( );
+ void SetCurrentRedlineAuthor( rtl::OUString sAuthor );
+ void SetCurrentRedlineDate( rtl::OUString sDate );
+ void SetCurrentRedlineId( sal_Int32 nId );
+ void SetCurrentRedlineToken( sal_Int32 nToken );
+ void RemoveCurrentRedline( );
+ void ResetParaRedline( );
};
} //namespace dmapper
diff --git a/writerfilter/source/dmapper/FontTable.cxx b/writerfilter/source/dmapper/FontTable.cxx
index 7d5af93a2da4..70baeeddd380 100644
--- a/writerfilter/source/dmapper/FontTable.cxx
+++ b/writerfilter/source/dmapper/FontTable.cxx
@@ -647,6 +647,15 @@ void FontTable::substream(Id, ::writerfilter::Reference<Stream>::Pointer_t)
void FontTable::info(const string& )
{
}
+
+void FontTable::startShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > )
+{
+}
+
+void FontTable::endShape( )
+{
+}
+
/*-- 21.06.2006 11:21:38---------------------------------------------------
-----------------------------------------------------------------------*/
diff --git a/writerfilter/source/dmapper/FontTable.hxx b/writerfilter/source/dmapper/FontTable.hxx
index b41414e204d4..b47374d2b0f9 100644
--- a/writerfilter/source/dmapper/FontTable.hxx
+++ b/writerfilter/source/dmapper/FontTable.hxx
@@ -38,7 +38,6 @@
namespace writerfilter {
namespace dmapper
{
-using namespace std;
struct FontTable_Impl;
struct FontEntry
@@ -98,6 +97,8 @@ public:
virtual void substream(Id name,
::writerfilter::Reference<Stream>::Pointer_t ref);
virtual void info(const string & info);
+ virtual void startShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape );
+ virtual void endShape( );
const FontEntry* getFontEntry(sal_uInt32 nIndex);
sal_uInt32 size();
diff --git a/writerfilter/source/dmapper/GraphicHelpers.cxx b/writerfilter/source/dmapper/GraphicHelpers.cxx
new file mode 100644
index 000000000000..c77f2dd55d3e
--- /dev/null
+++ b/writerfilter/source/dmapper/GraphicHelpers.cxx
@@ -0,0 +1,223 @@
+#include "ConversionHelper.hxx"
+#include "GraphicHelpers.hxx"
+
+#include <ooxml/resourceids.hxx>
+
+#include <com/sun/star/text/HoriOrientation.hpp>
+#include <com/sun/star/text/VertOrientation.hpp>
+#include <com/sun/star/text/RelOrientation.hpp>
+#include <com/sun/star/text/WrapTextMode.hpp>
+
+#include <iostream>
+using namespace std;
+
+namespace writerfilter {
+namespace dmapper {
+
+using namespace com::sun::star;
+
+PositionHandler::PositionHandler( ) :
+ Properties( )
+{
+ m_nOrient = text::VertOrientation::NONE;
+ m_nRelation = text::RelOrientation::FRAME;
+ m_nPosition = 0;
+}
+
+PositionHandler::~PositionHandler( )
+{
+}
+
+void PositionHandler::attribute( Id aName, Value& rVal )
+{
+ sal_Int32 nIntValue = rVal.getInt( );
+ switch ( aName )
+ {
+ case NS_ooxml::LN_CT_PosV_relativeFrom:
+ {
+ // TODO There are some other unhandled values
+ static Id pVertRelValues[] =
+ {
+ NS_ooxml::LN_Value_wordprocessingDrawing_ST_RelFromV_margin,
+ NS_ooxml::LN_Value_wordprocessingDrawing_ST_RelFromV_page,
+ NS_ooxml::LN_Value_wordprocessingDrawing_ST_RelFromV_paragraph,
+ NS_ooxml::LN_Value_wordprocessingDrawing_ST_RelFromV_line
+ };
+
+ static sal_Int16 pVertRelations[] =
+ {
+ text::RelOrientation::PAGE_PRINT_AREA,
+ text::RelOrientation::PAGE_FRAME,
+ text::RelOrientation::FRAME,
+ text::RelOrientation::TEXT_LINE
+ };
+
+ for ( int i = 0; i < 4; i++ )
+ {
+ if ( pVertRelValues[i] == sal_uInt32( nIntValue ) )
+ m_nRelation = pVertRelations[i];
+ }
+ }
+ break;
+ case NS_ooxml::LN_CT_PosH_relativeFrom:
+ {
+ // TODO There are some other unhandled values
+ static Id pHoriRelValues[] =
+ {
+ NS_ooxml::LN_Value_wordprocessingDrawing_ST_RelFromH_margin,
+ NS_ooxml::LN_Value_wordprocessingDrawing_ST_RelFromH_page,
+ NS_ooxml::LN_Value_wordprocessingDrawing_ST_RelFromH_column,
+ NS_ooxml::LN_Value_wordprocessingDrawing_ST_RelFromH_character
+ };
+
+ static sal_Int16 pHoriRelations[] =
+ {
+ text::RelOrientation::PAGE_PRINT_AREA,
+ text::RelOrientation::PAGE_FRAME,
+ text::RelOrientation::FRAME,
+ text::RelOrientation::CHAR,
+ };
+
+ for ( int i = 0; i < 4; i++ )
+ {
+ if ( pHoriRelValues[i] == sal_uInt32( nIntValue ) )
+ m_nRelation = pHoriRelations[i];
+ }
+ }
+ break;
+ default:;
+ }
+}
+
+void PositionHandler::sprm( Sprm& rSprm )
+{
+ Value::Pointer_t pValue = rSprm.getValue();
+ sal_Int32 nIntValue = pValue->getInt();
+
+ switch ( rSprm.getId( ) )
+ {
+ case NS_ooxml::LN_CT_PosV_align:
+ {
+ static Id pVertValues[] =
+ {
+ NS_ooxml::LN_Value_wordprocessingDrawing_ST_AlignV_top,
+ NS_ooxml::LN_Value_wordprocessingDrawing_ST_AlignV_bottom,
+ NS_ooxml::LN_Value_wordprocessingDrawing_ST_AlignV_center,
+ NS_ooxml::LN_Value_wordprocessingDrawing_ST_AlignV_inside,
+ NS_ooxml::LN_Value_wordprocessingDrawing_ST_AlignV_outside
+ };
+
+ static sal_Int16 pVertOrients[] =
+ {
+ text::VertOrientation::TOP,
+ text::VertOrientation::BOTTOM,
+ text::VertOrientation::CENTER,
+ text::VertOrientation::NONE,
+ text::VertOrientation::NONE
+ };
+
+ for ( int i = 0; i < 5; i++ )
+ {
+ if ( pVertValues[i] == sal_uInt32( nIntValue ) )
+ m_nOrient = pVertOrients[i];
+ }
+ }
+ break;
+ case NS_ooxml::LN_CT_PosH_align:
+ {
+ static Id pHoriValues[] =
+ {
+ NS_ooxml::LN_Value_wordprocessingDrawing_ST_AlignH_left,
+ NS_ooxml::LN_Value_wordprocessingDrawing_ST_AlignH_right,
+ NS_ooxml::LN_Value_wordprocessingDrawing_ST_AlignH_center,
+ NS_ooxml::LN_Value_wordprocessingDrawing_ST_AlignH_inside,
+ NS_ooxml::LN_Value_wordprocessingDrawing_ST_AlignH_outside
+ };
+
+ static sal_Int16 pHoriOrients[] =
+ {
+ text::HoriOrientation::LEFT,
+ text::HoriOrientation::RIGHT,
+ text::HoriOrientation::CENTER,
+ text::HoriOrientation::INSIDE,
+ text::HoriOrientation::OUTSIDE
+ };
+
+ for ( int i = 0; i < 5; i++ )
+ {
+ if ( pHoriValues[i] == sal_uInt32( nIntValue ) )
+ m_nOrient = pHoriOrients[i];
+ }
+ }
+ break;
+ case NS_ooxml::LN_CT_PosH_posOffset:
+ case NS_ooxml::LN_CT_PosV_posOffset:
+ m_nPosition = ConversionHelper::convertEMUToMM100( nIntValue );
+ default:;
+ }
+}
+
+WrapHandler::WrapHandler( ) :
+ Properties( ),
+ m_nType( 0 ),
+ m_nSide( 0 )
+{
+}
+
+WrapHandler::~WrapHandler( )
+{
+}
+
+void WrapHandler::attribute( Id aName, Value& rVal )
+{
+ switch ( aName )
+ {
+ case NS_ooxml::LN_CT_Wrap_type:
+ m_nType = sal_Int32( rVal.getInt( ) );
+ break;
+ case NS_ooxml::LN_CT_Wrap_side:
+ m_nSide = sal_Int32( rVal.getInt( ) );
+ break;
+ default:;
+ }
+}
+
+void WrapHandler::sprm( Sprm& )
+{
+}
+
+sal_Int32 WrapHandler::getWrapMode( )
+{
+ sal_Int32 nMode = com::sun::star::text::WrapTextMode_NONE;
+
+ switch ( m_nType )
+ {
+ case NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_WrapType_square:
+ case NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_WrapType_tight:
+ {
+ switch ( m_nSide )
+ {
+ case NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_WrapSide_left:
+ nMode = com::sun::star::text::WrapTextMode_LEFT;
+ break;
+ case NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_WrapSide_right:
+ nMode = com::sun::star::text::WrapTextMode_RIGHT;
+ break;
+ default:
+ nMode = com::sun::star::text::WrapTextMode_PARALLEL;
+ }
+ }
+ break;
+ case NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_WrapType_through:
+ nMode = com::sun::star::text::WrapTextMode_THROUGHT;
+ break;
+ case NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_WrapType_topAndBottom:
+ case NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_WrapType_none:
+ default:
+ nMode = com::sun::star::text::WrapTextMode_NONE;
+ }
+
+ return nMode;
+}
+
+} }
diff --git a/writerfilter/source/dmapper/GraphicHelpers.hxx b/writerfilter/source/dmapper/GraphicHelpers.hxx
new file mode 100644
index 000000000000..fb8f8b2455ee
--- /dev/null
+++ b/writerfilter/source/dmapper/GraphicHelpers.hxx
@@ -0,0 +1,48 @@
+#ifndef INCLUDED_GRAPHICHELPERS_HXX
+#define INCLUDED_GRAPHICHELPERS_HXX
+
+#include "PropertyMap.hxx"
+
+#include <WriterFilterDllApi.hxx>
+#include <resourcemodel/WW8ResourceModel.hxx>
+
+#include <boost/shared_ptr.hpp>
+
+namespace writerfilter {
+namespace dmapper
+{
+
+class WRITERFILTER_DLLPRIVATE PositionHandler: public Properties
+{
+public:
+ PositionHandler( );
+ ~PositionHandler( );
+
+ sal_Int16 m_nOrient;
+ sal_Int16 m_nRelation;
+ sal_Int32 m_nPosition;
+
+ virtual void attribute( Id aName, Value& rVal );
+ virtual void sprm( Sprm& rSprm );
+};
+typedef boost::shared_ptr<PositionHandler> PositionHandlerPtr;
+
+class WRITERFILTER_DLLPRIVATE WrapHandler: public Properties
+{
+public:
+ WrapHandler( );
+ ~WrapHandler( );
+
+ sal_Int32 m_nType;
+ sal_Int32 m_nSide;
+
+ sal_Int32 getWrapMode( );
+
+ virtual void attribute( Id aName, Value& rVal );
+ virtual void sprm( Sprm& rSprm );
+};
+typedef boost::shared_ptr<WrapHandler> WrapHandlerPtr;
+
+} }
+
+#endif
diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx
index 5a8bfabb0e59..33a064b09d83 100644
--- a/writerfilter/source/dmapper/GraphicImport.cxx
+++ b/writerfilter/source/dmapper/GraphicImport.cxx
@@ -29,7 +29,9 @@
*
************************************************************************/
-#include <GraphicImport.hxx>
+#include "GraphicImport.hxx"
+#include "GraphicHelpers.hxx"
+
#include <dmapper/DomainMapper.hxx>
#include <PropertyMap.hxx>
#include <doctok/resourceids.hxx>
@@ -995,35 +997,79 @@ void GraphicImport::attribute(Id nName, Value & val)
case NS_ooxml::LN_shape:
/* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
{
- val.getAny() >>= m_xShape;
+ uno::Reference< drawing::XShape> xShape;
+ val.getAny( ) >>= xShape;
- if (m_xShape.is())
+ if ( xShape.is( ) )
{
- uno::Reference< beans::XPropertySet > xShapeProps
- (m_xShape, uno::UNO_QUERY_THROW);
-
- PropertyNameSupplier& rPropNameSupplier =
- PropertyNameSupplier::GetPropertyNameSupplier();
- xShapeProps->setPropertyValue
- (rPropNameSupplier.GetName(PROP_ANCHOR_TYPE),
- uno::makeAny
- (text::TextContentAnchorType_AS_CHARACTER));
- xShapeProps->setPropertyValue
- (rPropNameSupplier.GetName(PROP_TEXT_RANGE),
- uno::makeAny
- (m_pImpl->rDomainMapper.GetCurrentTextRange()));
-
- awt::Point aPoint(m_xShape->getPosition());
- awt::Size aSize(m_xShape->getSize());
-
- if (m_pImpl->isXSizeValid())
- aSize.Width = m_pImpl->getXSize();
- if (m_pImpl->isYSizeValis())
- aSize.Height = m_pImpl->getYSize();
-
- m_xShape->setSize(aSize);
-
- m_pImpl->bIsGraphic = true;
+ // Is it a graphic image
+ bool bUseShape = true;
+ try
+ {
+ uno::Reference< beans::XPropertySet > xShapeProps
+ ( xShape, uno::UNO_QUERY_THROW );
+
+ rtl::OUString sUrl;
+ xShapeProps->getPropertyValue( rtl::OUString::createFromAscii( "GraphicURL" ) ) >>= sUrl;
+
+ ::com::sun::star::beans::PropertyValues aMediaProperties( 1 );
+ aMediaProperties[0].Name = rtl::OUString::createFromAscii( "URL" );
+ aMediaProperties[0].Value <<= sUrl;
+
+ m_xGraphicObject = createGraphicObject( aMediaProperties );
+
+ bUseShape = !m_xGraphicObject.is( );
+
+ if ( !bUseShape )
+ {
+ // Define the object size
+ uno::Reference< beans::XPropertySet > xGraphProps( m_xGraphicObject,
+ uno::UNO_QUERY );
+ awt::Size aSize = xShape->getSize( );
+ xGraphProps->setPropertyValue( rtl::OUString::createFromAscii( "Height" ),
+ uno::makeAny( aSize.Height ) );
+ xGraphProps->setPropertyValue( rtl::OUString::createFromAscii( "Width" ),
+ uno::makeAny( aSize.Width ) );
+ }
+ }
+ catch( const beans::UnknownPropertyException e )
+ {
+ // It isn't a graphic image
+ }
+
+ if ( bUseShape )
+ m_xShape = xShape;
+
+
+ if ( m_xShape.is( ) )
+ {
+ uno::Reference< beans::XPropertySet > xShapeProps
+ (m_xShape, uno::UNO_QUERY_THROW);
+
+
+ PropertyNameSupplier& rPropNameSupplier =
+ PropertyNameSupplier::GetPropertyNameSupplier();
+ xShapeProps->setPropertyValue
+ (rPropNameSupplier.GetName(PROP_ANCHOR_TYPE),
+ uno::makeAny
+ (text::TextContentAnchorType_AS_CHARACTER));
+ xShapeProps->setPropertyValue
+ (rPropNameSupplier.GetName(PROP_TEXT_RANGE),
+ uno::makeAny
+ (m_pImpl->rDomainMapper.GetCurrentTextRange()));
+
+ awt::Point aPoint(m_xShape->getPosition());
+ awt::Size aSize(m_xShape->getSize());
+
+ if (m_pImpl->isXSizeValid())
+ aSize.Width = m_pImpl->getXSize();
+ if (m_pImpl->isYSizeValis())
+ aSize.Height = m_pImpl->getYSize();
+
+ m_xShape->setSize(aSize);
+
+ m_pImpl->bIsGraphic = true;
+ }
}
}
break;
@@ -1769,8 +1815,6 @@ void GraphicImport::sprm(Sprm & rSprm)
case NS_ooxml::LN_CT_NonVisualGraphicFrameProperties_graphicFrameLocks:// 90657
case NS_ooxml::LN_CT_Inline_a_graphic:// 90915
case NS_ooxml::LN_CT_Anchor_simplePos_elem: // 90975;
- case NS_ooxml::LN_CT_Anchor_positionH: // 90976;
- case NS_ooxml::LN_CT_Anchor_positionV: // 90977;
case NS_ooxml::LN_CT_Anchor_extent: // 90978;
case NS_ooxml::LN_CT_Anchor_effectExtent: // 90979;
case NS_ooxml::LN_EG_WrapType_wrapSquare: // 90945;
@@ -1791,6 +1835,36 @@ void GraphicImport::sprm(Sprm & rSprm)
}
}
break;
+ case NS_ooxml::LN_CT_Anchor_positionH: // 90976;
+ {
+ // Use a special handler for the positionning
+ PositionHandlerPtr pHandler( new PositionHandler );
+ writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
+ if( pProperties.get( ) )
+ {
+ pProperties->resolve( *pHandler );
+
+ m_pImpl->nHoriRelation = pHandler->m_nRelation;
+ m_pImpl->nHoriOrient = pHandler->m_nOrient;
+ m_pImpl->nLeftPosition = pHandler->m_nPosition;
+ }
+ }
+ break;
+ case NS_ooxml::LN_CT_Anchor_positionV: // 90977;
+ {
+ // Use a special handler for the positionning
+ PositionHandlerPtr pHandler( new PositionHandler );
+ writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
+ if( pProperties.get( ) )
+ {
+ pProperties->resolve( *pHandler );
+
+ m_pImpl->nVertRelation = pHandler->m_nRelation;
+ m_pImpl->nVertOrient = pHandler->m_nOrient;
+ m_pImpl->nTopPosition = pHandler->m_nPosition;
+ }
+ }
+ break;
case 0x271b:
case 0x271c:
{
@@ -1858,11 +1932,9 @@ void lcl_CalcCrop( sal_Int32& nCrop, sal_Int32 nRef )
+ (((nCrop & 0xffff) * nRef ) >> 16);
}
-/*-- 01.11.2006 09:45:02---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-void GraphicImport::data(const sal_uInt8* buf, size_t len, writerfilter::Reference<Properties>::Pointer_t /*ref*/)
+uno::Reference< text::XTextContent > GraphicImport::createGraphicObject( const beans::PropertyValues& aMediaProperties )
{
+ uno::Reference< text::XTextContent > xGraphicObject;
try
{
uno::Reference< graphic::XGraphicProvider > xGraphicProvider(
@@ -1870,28 +1942,22 @@ void GraphicImport::data(const sal_uInt8* buf, size_t len, writerfilter::Referen
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.graphic.GraphicProvider")),
m_xComponentContext),
uno::UNO_QUERY_THROW );
- uno::Reference< io::XInputStream > xIStream = new XInputStreamHelper( buf, len, m_pImpl->bIsBitmap );
-
- PropertyNameSupplier& rPropNameSupplier = PropertyNameSupplier::GetPropertyNameSupplier();
- ::com::sun::star::beans::PropertyValues aMediaProperties( 1 );
- aMediaProperties[0].Name = rPropNameSupplier.GetName(PROP_INPUT_STREAM);
- aMediaProperties[0].Value <<= xIStream;
uno::Reference< graphic::XGraphic > xGraphic = xGraphicProvider->queryGraphic( aMediaProperties );
- //
+
if(xGraphic.is())
{
- clog << "Graphic loaded" << endl;
+ PropertyNameSupplier& rPropNameSupplier = PropertyNameSupplier::GetPropertyNameSupplier();
uno::Reference< beans::XPropertySet > xGraphicObjectProperties(
m_xTextFactory->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextGraphicObject"))),
- uno::UNO_QUERY_THROW);
+ uno::UNO_QUERY_THROW);
xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName(PROP_GRAPHIC), uno::makeAny( xGraphic ));
xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName(PROP_ANCHOR_TYPE),
uno::makeAny( m_pImpl->eGraphicImportType == IMPORT_AS_SHAPE || m_pImpl->eGraphicImportType == IMPORT_AS_DETECTED_ANCHOR ?
text::TextContentAnchorType_AT_CHARACTER :
text::TextContentAnchorType_AS_CHARACTER ));
- m_xGraphicObject = uno::Reference< text::XTextContent >( xGraphicObjectProperties, uno::UNO_QUERY_THROW );
+ xGraphicObject = uno::Reference< text::XTextContent >( xGraphicObjectProperties, uno::UNO_QUERY_THROW );
//shapes have only one border, PICF might have four
table::BorderLine aBorderLine;
@@ -2083,11 +2149,28 @@ void GraphicImport::data(const sal_uInt8* buf, size_t len, writerfilter::Referen
}
}
}
- catch( const uno::Exception& )
+ catch( const uno::Exception& e )
{
- clog << __FILE__ << __LINE__ << " failed!" << endl;
+ clog << __FILE__ << ":" << __LINE__ << " failed. Message :" ;
+ clog << rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_UTF8 ).getStr( ) << endl;
}
+ return xGraphicObject;
+}
+/*-- 01.11.2006 09:45:02---------------------------------------------------
+
+ -----------------------------------------------------------------------*/
+void GraphicImport::data(const sal_uInt8* buf, size_t len, writerfilter::Reference<Properties>::Pointer_t /*ref*/)
+{
+ PropertyNameSupplier& rPropNameSupplier = PropertyNameSupplier::GetPropertyNameSupplier();
+
+ ::com::sun::star::beans::PropertyValues aMediaProperties( 1 );
+ aMediaProperties[0].Name = rPropNameSupplier.GetName(PROP_INPUT_STREAM);
+
+ uno::Reference< io::XInputStream > xIStream = new XInputStreamHelper( buf, len, m_pImpl->bIsBitmap );
+ aMediaProperties[0].Value <<= xIStream;
+
+ m_xGraphicObject = createGraphicObject( aMediaProperties );
}
/*-- 01.11.2006 09:45:03---------------------------------------------------
@@ -2161,6 +2244,15 @@ void GraphicImport::substream(Id /*name*/, ::writerfilter::Reference<Stream>::Po
void GraphicImport::info(const string & /*info*/)
{
}
+
+void GraphicImport::startShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > /*xShape*/ )
+{
+}
+
+void GraphicImport::endShape( )
+{
+}
+
/*-- 09.08.2007 10:17:00---------------------------------------------------
-----------------------------------------------------------------------*/
diff --git a/writerfilter/source/dmapper/GraphicImport.hxx b/writerfilter/source/dmapper/GraphicImport.hxx
index 8318335b45f8..8e1558656507 100644
--- a/writerfilter/source/dmapper/GraphicImport.hxx
+++ b/writerfilter/source/dmapper/GraphicImport.hxx
@@ -51,12 +51,16 @@ namespace com{ namespace sun { namespace star {
{
class XShape;
}
+ namespace beans
+ {
+ class PropertyValue;
+ typedef ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > PropertyValues;
+ }
}}}
namespace writerfilter {
namespace dmapper
{
-using namespace std;
class GraphicImport_Impl;
class DomainMapper;
@@ -80,6 +84,9 @@ class WRITERFILTER_DLLPRIVATE GraphicImport : public Properties, public Table
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape> m_xShape;
void ProcessShapeOptions(Value & val);
+ ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > createGraphicObject(
+ const ::com::sun::star::beans::PropertyValues& aMediaProperties );
+
public:
explicit GraphicImport(::com::sun::star::uno::Reference < ::com::sun::star::uno::XComponentContext > xComponentContext,
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xTextFactory,
@@ -112,6 +119,8 @@ public:
virtual void substream(Id name,
::writerfilter::Reference<Stream>::Pointer_t ref);
virtual void info(const string & info);
+ virtual void startShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape );
+ virtual void endShape( );
::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > GetGraphicObject();
bool IsGraphic() const;
diff --git a/writerfilter/source/dmapper/ListTable.cxx b/writerfilter/source/dmapper/ListTable.cxx
index 3d229486e7fd..9a4e19939df7 100644
--- a/writerfilter/source/dmapper/ListTable.cxx
+++ b/writerfilter/source/dmapper/ListTable.cxx
@@ -38,9 +38,12 @@
#include <resourcemodel/WW8ResourceModel.hxx>
#endif
#include <com/sun/star/container/XIndexReplace.hpp>
+#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/style/NumberingType.hpp>
+#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
#include <com/sun/star/text/HoriOrientation.hpp>
+#include <com/sun/star/text/PositionAndSpaceMode.hpp>
#include <vector>
#define NUMBERING_MAX_LEVELS 10
@@ -139,6 +142,7 @@ class ListPropertyMap : public PropertyMap
::rtl::OUString sRGBXchNums; //LN_RGBXCHNUMS
sal_Int32 nXChFollow; //LN_IXCHFOLLOW
::rtl::OUString sBulletChar;
+ sal_Int32 nTabstop;
public:
ListPropertyMap() :
nIStartAt(-1)
@@ -150,6 +154,7 @@ public:
,nFPrevSpace(-1)
,nFWord6(-1)
,nXChFollow(-1)
+ ,nTabstop( 0 )
{}
~ListPropertyMap(){}
@@ -187,6 +192,8 @@ uno::Sequence< beans::PropertyValue > ListPropertyMap::GetPropertyValuesList( P
if( nNumberFormat == style::NumberingType::CHAR_SPECIAL && sBulletChar.getLength() )
aNumberingProperties.push_back( MAKE_PROPVAL(PROP_BULLET_CHAR, sBulletChar.copy(0,1)));
+ aNumberingProperties.push_back( MAKE_PROPVAL( PROP_LISTTAB_STOP_POSITION, nTabstop ) );
+
//TODO: handling of nFLegal?
//TODO: nFNoRestart lower levels do not restart when higher levels are incremented, like:
//1.
@@ -215,6 +222,9 @@ uno::Sequence< beans::PropertyValue > ListPropertyMap::GetPropertyValuesList( P
{
switch( aMapIter->first.eId )
{
+ case PROP_ADJUST:
+ case PROP_INDENT_AT:
+ case PROP_FIRST_LINE_INDENT:
case PROP_FIRST_LINE_OFFSET:
case PROP_LEFT_MARGIN:
aNumberingProperties.push_back(
@@ -818,22 +828,27 @@ void ListTable::attribute(Id nName, Value & rVal)
case NS_ooxml::LN_CT_Ind_left:
/* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
m_pImpl->m_pCurrentEntry->pCurrentProperties->Insert(
- PROP_LEFT_MARGIN, true, uno::makeAny( ConversionHelper::convertTwipToMM100(nIntValue ) ));
+ PROP_INDENT_AT, true, uno::makeAny( ConversionHelper::convertTwipToMM100( nIntValue ) ));
break;
case NS_ooxml::LN_CT_Ind_hanging:
/* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
m_pImpl->m_pCurrentEntry->pCurrentProperties->Insert(
- PROP_FIRST_LINE_OFFSET, true, uno::makeAny( - ConversionHelper::convertTwipToMM100(nIntValue ) ));
+ PROP_FIRST_LINE_INDENT, true, uno::makeAny( - ConversionHelper::convertTwipToMM100( nIntValue ) ));
+ break;
+ case NS_ooxml::LN_CT_Ind_firstLine:
+ /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
+ m_pImpl->m_pCurrentEntry->pCurrentProperties->Insert(
+ PROP_FIRST_LINE_INDENT, true, uno::makeAny( ConversionHelper::convertTwipToMM100( nIntValue ) ));
break;
-// case NS_ooxml::LN_CT_Ind_firstLine:
-// /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
-// m_pImpl->m_pCurrentEntry->pCurrentProperties->Insert(
-// PROP_FIRST_LINE_OFFSET, true, uno::makeAny( ConversionHelper::convertTwipToMM100(nIntValue ) ));
-// break;
case NS_ooxml::LN_CT_Lvl_ilvl: //overrides previous level - unsupported
case NS_ooxml::LN_CT_Lvl_tplc: //template code - unsupported
case NS_ooxml::LN_CT_Lvl_tentative: //marks level as unused in the document - unsupported
- case NS_ooxml::LN_CT_Ind_firstLine: //todo: first line indent in numbering not yet supported
+ break;
+ case NS_ooxml::LN_CT_TabStop_pos:
+ {
+ //no paragraph attributes in ListTable char style sheets
+ m_pImpl->m_pCurrentEntry->pCurrentProperties->nTabstop = ConversionHelper::convertTwipToMM100( nIntValue );
+ }
break;
default:
{
@@ -955,7 +970,17 @@ void ListTable::sprm(Sprm & rSprm)
}
break;
case NS_ooxml::LN_CT_Lvl_lvlJc:
- //todo: ????
+ {
+ static sal_Int16 aWWAlignments[ ] =
+ {
+ text::HoriOrientation::LEFT,
+ text::HoriOrientation::CENTER,
+ text::HoriOrientation::RIGHT
+ };
+ m_pImpl->m_pCurrentEntry->pCurrentProperties->Insert(
+ PROP_ADJUST, true, uno::makeAny( aWWAlignments[ nIntValue ] ) );
+ writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
+ }
break;
case NS_ooxml::LN_CT_Lvl_pPr:
case NS_ooxml::LN_CT_PPrBase_ind:
@@ -967,7 +992,12 @@ void ListTable::sprm(Sprm & rSprm)
}
break;
case NS_ooxml::LN_CT_PPrBase_tabs:
- //no paragraph attributes in ListTable char style sheets
+ case NS_ooxml::LN_CT_Tabs_tab:
+ {
+ writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
+ if(pProperties.get())
+ pProperties->resolve(*this);
+ }
break;
case NS_ooxml::LN_CT_Lvl_suff:
//todo: currently unsupported suffix
@@ -1057,105 +1087,181 @@ sal_uInt32 ListTable::size() const
{
return m_pImpl->m_aListEntries.size();
}
-/*-- 26.06.2006 10:33:56---------------------------------------------------
- -----------------------------------------------------------------------*/
-uno::Reference< container::XIndexReplace > ListTable::GetNumberingRules(sal_Int32 nListId)
+rtl::OUString ListTable::GetStyleName( sal_Int32 nListId )
+{
+ rtl::OUString sStyleName( rtl::OUString::createFromAscii( "WWNum" ) );
+ sStyleName += rtl::OUString::valueOf( nListId + 1 );
+
+ return sStyleName;
+}
+
+void ListTable::CreateNumberingRules( )
{
uno::Reference< container::XIndexReplace > xRet;
std::vector< ListEntryPtr >::const_iterator aIt = m_pImpl->m_aListEntries.begin();
std::vector< ListEntryPtr >::const_iterator aEndIt = m_pImpl->m_aListEntries.end();
+
+ uno::Reference< container::XNameContainer > xStyles;
+
+ try
+ {
+ uno::Reference< style::XStyleFamiliesSupplier > xFamilies( m_pImpl->m_xFactory, uno::UNO_QUERY_THROW );
+ uno::Any oFamily = xFamilies->getStyleFamilies( )->getByName( rtl::OUString::createFromAscii( "NumberingStyles" ) );
+
+ oFamily >>= xStyles;
+ }
+ catch ( const uno::Exception )
+ {
+ }
+
for(; aIt != aEndIt; ++aIt)
{
- if((*aIt)->nListId == nListId)
+ if( !(*aIt)->m_xNumRules.is() && m_pImpl->m_xFactory.is() && xStyles.is( ) )
{
- if( !(*aIt)->m_xNumRules.is() && m_pImpl->m_xFactory.is())
+ try
{
- try
+ // Create the numbering style
+ uno::Reference< beans::XPropertySet > xStyle (
+ m_pImpl->m_xFactory->createInstance(
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.style.NumberingStyle"))),
+ uno::UNO_QUERY_THROW );
+
+ rtl::OUString sStyleName = GetStyleName( ( *aIt )->nListId );
+#if DEBUG
+ clog << "Creating numbering style: ";
+ clog << rtl::OUStringToOString( sStyleName, RTL_TEXTENCODING_UTF8 ).getStr( );
+ clog << endl;
+#endif
+
+ xStyles->insertByName( sStyleName, makeAny( xStyle ) );
+
+ uno::Any oStyle = xStyles->getByName( sStyleName );
+ xStyle.set( oStyle, uno::UNO_QUERY_THROW );
+
+ PropertyNameSupplier& aPropNameSupplier = PropertyNameSupplier::GetPropertyNameSupplier();
+ uno::Any aRules = xStyle->getPropertyValue( aPropNameSupplier.GetName( PROP_NUMBERING_RULES ) );
+ aRules >>= ( *aIt )->m_xNumRules;
+
+ //now fill the numbering levels appropriately
+ ::std::vector< ListPropertyMapPtr >::const_iterator aIter = (*aIt)->aLevelProperties.begin();
+ ::std::vector< ListPropertyMapPtr >::const_iterator aEnd = (*aIt)->aLevelProperties.end();
+ sal_Int32 nLevel = 0;
+ while(aIter != aEnd)
{
- (*aIt)->m_xNumRules = uno::Reference< container::XIndexReplace >(
- m_pImpl->m_xFactory->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.NumberingRules"))),
- uno::UNO_QUERY_THROW);
-
- //now fill the numbering levels appropriately
- ::std::vector< ListPropertyMapPtr >::const_iterator aIter = (*aIt)->aLevelProperties.begin();
- ::std::vector< ListPropertyMapPtr >::const_iterator aEnd = (*aIt)->aLevelProperties.end();
- sal_Int32 nLevel = 0;
- PropertyNameSupplier& aPropNameSupplier = PropertyNameSupplier::GetPropertyNameSupplier();
- while(aIter != aEnd)
+ PropertyValueVector_t aCharStyleProperties;
+ uno::Sequence< beans::PropertyValue> aValues = (*aIter)->GetPropertyValuesList(aCharStyleProperties);
+ if( aCharStyleProperties.size() )
{
- PropertyValueVector_t aCharStyleProperties;
- uno::Sequence< beans::PropertyValue> aValues = (*aIter)->GetPropertyValuesList(aCharStyleProperties);
- if( aCharStyleProperties.size() )
- {
- //create (or find) a character style containing the character attributes of the symbol
- //and apply it to the numbering level
- ::rtl::OUString sStyle = m_pImpl->m_rDMapper.getOrCreateCharStyle( aCharStyleProperties );
- aValues.realloc( aValues.getLength() + 1);
- aValues[aValues.getLength() - 1].Name = aPropNameSupplier.GetName( PROP_CHAR_STYLE_NAME );
- aValues[aValues.getLength() - 1].Value <<= sStyle;
- }
- //now parse the text to find %n from %1 to %nLevel+1
- //everything before the first % and the last %x is prefix and suffix
- ::rtl::OUString sLevelText( (*aIter)->sBulletChar );
- sal_Int32 nCurrentIndex = 0;
- sal_Int32 nFound = sLevelText.indexOf( '%', nCurrentIndex );
- if( nFound > 0 )
- {
- ::rtl::OUString sPrefix = sLevelText.copy( 0, nFound );
- aValues.realloc( aValues.getLength() + 1 );
- aValues[ aValues.getLength() - 1 ] = MAKE_PROPVAL(PROP_PREFIX, sPrefix);
- sLevelText = sLevelText.copy( nFound );
- }
- sal_Int32 nMinLevel = nLevel;
- //now the text should either be empty or start with %
- nFound = 0;
- while( nFound >= 0 )
+ //create (or find) a character style containing the character attributes of the symbol
+ //and apply it to the numbering level
+ ::rtl::OUString sStyle = m_pImpl->m_rDMapper.getOrCreateCharStyle( aCharStyleProperties );
+ aValues.realloc( aValues.getLength() + 1);
+ aValues[aValues.getLength() - 1].Name = aPropNameSupplier.GetName( PROP_CHAR_STYLE_NAME );
+ aValues[aValues.getLength() - 1].Value <<= sStyle;
+ }
+ //now parse the text to find %n from %1 to %nLevel+1
+ //everything before the first % and the last %x is prefix and suffix
+ ::rtl::OUString sLevelText( (*aIter)->sBulletChar );
+ sal_Int32 nCurrentIndex = 0;
+ sal_Int32 nFound = sLevelText.indexOf( '%', nCurrentIndex );
+ if( nFound > 0 )
+ {
+ ::rtl::OUString sPrefix = sLevelText.copy( 0, nFound );
+ aValues.realloc( aValues.getLength() + 1 );
+ aValues[ aValues.getLength() - 1 ] = MAKE_PROPVAL(PROP_PREFIX, sPrefix);
+ sLevelText = sLevelText.copy( nFound );
+ }
+ sal_Int32 nMinLevel = nLevel;
+ //now the text should either be empty or start with %
+ nFound = 0;
+ while( nFound >= 0 )
+ {
+ if( sLevelText.getLength() > 1 )
{
- if( sLevelText.getLength() > 1 )
+ sal_Unicode cLevel = sLevelText.getStr()[1];
+ if( cLevel >= '1' && cLevel <= '9' )
{
- sal_Unicode cLevel = sLevelText.getStr()[1];
- if( cLevel >= '1' && cLevel <= '9' )
- {
- if( cLevel - '1' < nMinLevel )
- nMinLevel = cLevel - '1';
- //remove first char - next char is removed later
- sLevelText = sLevelText.copy( 1 );
- }
+ if( cLevel - '1' < nMinLevel )
+ nMinLevel = cLevel - '1';
+ //remove first char - next char is removed later
+ sLevelText = sLevelText.copy( 1 );
}
- //remove old '%' or number
- sLevelText = sLevelText.copy( 1 );
- nCurrentIndex = 0;
- nFound = sLevelText.indexOf( '%', nCurrentIndex );
- //remove the text before the next %
- if(nFound > 0)
- sLevelText = sLevelText.copy( nFound -1 );
- }
- if( nMinLevel < nLevel )
- {
- aValues.realloc( aValues.getLength() + 1);
- aValues[ aValues.getLength() - 1 ] =
- MAKE_PROPVAL(PROP_PARENT_NUMBERING, sal_Int16( nLevel - nMinLevel ));
- }
- if( sLevelText.getLength() )
- {
- aValues.realloc( aValues.getLength() + 1);
- aValues[ aValues.getLength() - 1 ] = MAKE_PROPVAL(PROP_SUFFIX, sLevelText);
}
+ //remove old '%' or number
+ sLevelText = sLevelText.copy( 1 );
+ nCurrentIndex = 0;
+ nFound = sLevelText.indexOf( '%', nCurrentIndex );
+ //remove the text before the next %
+ if(nFound > 0)
+ sLevelText = sLevelText.copy( nFound -1 );
+ }
+ if( nMinLevel < nLevel )
+ {
+ aValues.realloc( aValues.getLength() + 1);
+ aValues[ aValues.getLength() - 1 ] =
+ MAKE_PROPVAL(PROP_PARENT_NUMBERING, sal_Int16( nLevel - nMinLevel + 1));
+ }
+ aValues.realloc( aValues.getLength() + 1);
+ aValues[ aValues.getLength() - 1 ] = MAKE_PROPVAL(PROP_SUFFIX, sLevelText);
- (*aIt)->m_xNumRules->replaceByIndex(nLevel, uno::makeAny(aValues));
+ aValues.realloc( aValues.getLength() + 1);
+ aValues[ aValues.getLength() - 1 ] = MAKE_PROPVAL( PROP_POSITION_AND_SPACE_MODE,
+ sal_Int16( text::PositionAndSpaceMode::LABEL_ALIGNMENT ) );
- ++aIter;
- ++nLevel;
+#if DEBUG
+ clog << endl << "Numbering rule properties - " << nLevel << endl;
+ for ( sal_Int32 i = 0, len = aValues.getLength( ); i < len; i++ )
+ {
+ beans::PropertyValue aVal = aValues[i];
+ clog << " " << rtl::OUStringToOString( aVal.Name, RTL_TEXTENCODING_UTF8 ).getStr( );
+ clog << ": ";
+ rtl::OUString sVal;
+ sal_Int32 nVal;
+ if ( aVal.Value >>= sVal )
+ {
+ clog << rtl::OUStringToOString( sVal, RTL_TEXTENCODING_UTF8 ).getStr( );
}
-
+ else if ( aVal.Value >>= nVal )
+ {
+ clog << nVal;
+ }
+ clog << endl;
}
- catch( const uno::Exception& rEx)
- {
- (void)rEx;
- OSL_ENSURE( false, "ListTable::GetNumberingRules");
+#endif
+
+ (*aIt)->m_xNumRules->replaceByIndex(nLevel, uno::makeAny(aValues));
+ ++aIter;
+ ++nLevel;
}
+
+ // Create the numbering style for these rules
+ rtl::OUString sNumRulesName = aPropNameSupplier.GetName( PROP_NUMBERING_RULES );
+ xStyle->setPropertyValue(
+ sNumRulesName,
+ uno::makeAny( ( *aIt )->m_xNumRules ) );
+ }
+ catch( const uno::Exception& rEx)
+ {
+ (void)rEx;
+ OSL_ENSURE( false, "ListTable::CreateNumberingRules");
}
+ }
+ }
+}
+
+/*-- 26.06.2006 10:33:56---------------------------------------------------
+
+ -----------------------------------------------------------------------*/
+uno::Reference< container::XIndexReplace > ListTable::GetNumberingRules(sal_Int32 nListId)
+{
+ uno::Reference< container::XIndexReplace > xRet;
+ std::vector< ListEntryPtr >::const_iterator aIt = m_pImpl->m_aListEntries.begin();
+ std::vector< ListEntryPtr >::const_iterator aEndIt = m_pImpl->m_aListEntries.end();
+ for(; aIt != aEndIt; ++aIt)
+ {
+ if((*aIt)->nListId == nListId)
+ {
xRet = (*aIt)->m_xNumRules;
break;
}
diff --git a/writerfilter/source/dmapper/ListTable.hxx b/writerfilter/source/dmapper/ListTable.hxx
index 97e5d1619953..2d0cf2e6bdce 100644
--- a/writerfilter/source/dmapper/ListTable.hxx
+++ b/writerfilter/source/dmapper/ListTable.hxx
@@ -78,6 +78,8 @@ public:
// writerfilter::Reference<Properties>::Pointer_t ref);
sal_uInt32 size() const;
+ rtl::OUString GetStyleName( sal_Int32 nListId );
+ void CreateNumberingRules( );
::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexReplace >
GetNumberingRules(sal_Int32 nListId);
diff --git a/writerfilter/source/dmapper/OLEHandler.cxx b/writerfilter/source/dmapper/OLEHandler.cxx
index 67b692c3ade3..8f1501046418 100644
--- a/writerfilter/source/dmapper/OLEHandler.cxx
+++ b/writerfilter/source/dmapper/OLEHandler.cxx
@@ -29,6 +29,8 @@
************************************************************************/
#include <OLEHandler.hxx>
#include <PropertyMap.hxx>
+#include "GraphicHelpers.hxx"
+
#include <doctok/resourceids.hxx>
#include <ooxml/resourceids.hxx>
#include <com/sun/star/beans/PropertyValue.hpp>
@@ -54,7 +56,8 @@ using namespace ::com::sun::star;
-----------------------------------------------------------------------*/
OLEHandler::OLEHandler() :
m_nDxaOrig(0),
- m_nDyaOrig(0)
+ m_nDyaOrig(0),
+ m_nWrapMode(0)
{
}
/*-- 23.04.2008 10:46:14---------------------------------------------------
@@ -108,15 +111,28 @@ void OLEHandler::attribute(Id rName, Value & rVal)
rVal.getAny() >>= xTempShape;
if( xTempShape.is() )
{
- m_aShapeSize = xTempShape->getSize();
- m_aShapePosition = xTempShape->getPosition();
+ m_xShape.set( xTempShape );
+
try
{
+ m_aShapeSize = xTempShape->getSize();
+ m_aShapePosition = xTempShape->getPosition();
+
uno::Reference< beans::XPropertySet > xShapeProps( xTempShape, uno::UNO_QUERY_THROW );
- xShapeProps->getPropertyValue( PropertyNameSupplier::GetPropertyNameSupplier().GetName( PROP_BITMAP ) ) >>= m_xReplacement;
+ PropertyNameSupplier& rNameSupplier = PropertyNameSupplier::GetPropertyNameSupplier();
+
+ xShapeProps->getPropertyValue( rNameSupplier.GetName( PROP_BITMAP ) ) >>= m_xReplacement;
+
+ xShapeProps->setPropertyValue(
+ rNameSupplier.GetName( PROP_SURROUND ),
+ uno::makeAny( m_nWrapMode ) );
}
- catch( const uno::Exception& )
+ catch( const uno::Exception& e )
{
+#if DEBUG
+ clog << "Exception in OLE Handler: ";
+ clog << rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_UTF8 ).getStr( ) << endl;
+#endif
}
}
}
@@ -142,8 +158,39 @@ void OLEHandler::sprm(Sprm & rSprm)
}
}
break;
+ case NS_ooxml::LN_wrap_wrap:
+ {
+ writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
+ if ( pProperties.get( ) )
+ {
+ WrapHandlerPtr pHandler( new WrapHandler );
+ pProperties->resolve( *pHandler );
+
+ m_nWrapMode = pHandler->getWrapMode( );
+
+ try
+ {
+ uno::Reference< beans::XPropertySet > xShapeProps( m_xShape, uno::UNO_QUERY_THROW );
+ PropertyNameSupplier& rNameSupplier = PropertyNameSupplier::GetPropertyNameSupplier();
+
+ xShapeProps->setPropertyValue(
+ rNameSupplier.GetName( PROP_SURROUND ),
+ uno::makeAny( m_nWrapMode ) );
+ }
+ catch( const uno::Exception& e )
+ {
+#if DEBUG
+ clog << "Exception in OLE Handler: ";
+ clog << rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_UTF8 ).getStr( ) << endl;
+#endif
+ }
+ }
+ }
+ break;
default:
+ {
OSL_ENSURE( false, "unknown attribute");
+ }
}
}
/*-- 23.04.2008 11:15:19---------------------------------------------------
@@ -152,9 +199,10 @@ void OLEHandler::sprm(Sprm & rSprm)
::rtl::OUString OLEHandler::copyOLEOStream( uno::Reference< text::XTextDocument > xTextDocument )
{
::rtl::OUString sRet;
- if( !m_xInputStream.is() )
+ if( !m_xInputStream.is( ) )
return sRet;
- try{
+ try
+ {
uno::Reference < lang::XMultiServiceFactory > xFactory(xTextDocument, uno::UNO_QUERY_THROW);
uno::Reference< document::XEmbeddedObjectResolver > xEmbeddedResolver(
xFactory->createInstance(
diff --git a/writerfilter/source/dmapper/OLEHandler.hxx b/writerfilter/source/dmapper/OLEHandler.hxx
index 34b4a0316819..bdd94a802b7b 100644
--- a/writerfilter/source/dmapper/OLEHandler.hxx
+++ b/writerfilter/source/dmapper/OLEHandler.hxx
@@ -38,6 +38,8 @@
#include <com/sun/star/awt/Size.hpp>
#include <com/sun/star/awt/Point.hpp>
+#include <com/sun/star/drawing/XShape.hpp>
+
namespace com{ namespace sun{ namespace star{
namespace embed{
class XEmbeddedObject;
@@ -72,6 +74,9 @@ class WRITERFILTER_DLLPRIVATE OLEHandler : public Properties
sal_Int32 m_nDxaOrig;
sal_Int32 m_nDyaOrig;
+ sal_Int32 m_nWrapMode;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > m_xShape;
::com::sun::star::awt::Size m_aShapeSize;
::com::sun::star::awt::Point m_aShapePosition;
@@ -87,6 +92,10 @@ public:
virtual void attribute(Id Name, Value & val);
virtual void sprm(Sprm & sprm);
+ inline ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > getShape( ) { return m_xShape; };
+
+ inline bool isOLEObject( ) { return m_xInputStream.is( ); };
+
::rtl::OUString copyOLEOStream( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextDocument > xTextDocument );
::com::sun::star::awt::Size getSize() const { return m_aShapeSize;}
diff --git a/writerfilter/source/dmapper/PageBordersHandler.cxx b/writerfilter/source/dmapper/PageBordersHandler.cxx
new file mode 100644
index 000000000000..725502843982
--- /dev/null
+++ b/writerfilter/source/dmapper/PageBordersHandler.cxx
@@ -0,0 +1,121 @@
+#include "PageBordersHandler.hxx"
+
+#include <ooxml/resourceids.hxx>
+
+namespace writerfilter {
+namespace dmapper {
+
+_PgBorder::_PgBorder( ) :
+ m_nDistance( 0 ),
+ m_ePos( BORDER_RIGHT )
+{
+}
+
+_PgBorder::~_PgBorder( )
+{
+}
+
+PageBordersHandler::PageBordersHandler( ) :
+ m_nDisplay( 0 ),
+ m_nOffset( 0 )
+{
+}
+
+PageBordersHandler::~PageBordersHandler( )
+{
+}
+
+void PageBordersHandler::attribute( Id eName, Value& rVal )
+{
+ int nIntValue = rVal.getInt( );
+ switch ( eName )
+ {
+ case NS_ooxml::LN_CT_PageBorders_display:
+ {
+ switch ( nIntValue )
+ {
+ default:
+ case NS_ooxml::LN_Value_wordprocessingml_ST_PageBorderDisplay_allPages:
+ m_nDisplay = 0;
+ break;
+ case NS_ooxml::LN_Value_wordprocessingml_ST_PageBorderDisplay_firstPage:
+ m_nDisplay = 1;
+ break;
+ case NS_ooxml::LN_Value_wordprocessingml_ST_PageBorderDisplay_notFirstPage:
+ m_nDisplay = 2;
+ break;
+ }
+ }
+ break;
+ case NS_ooxml::LN_CT_PageBorders_offsetFrom:
+ {
+ switch ( nIntValue )
+ {
+ default:
+ case NS_ooxml::LN_Value_wordprocessingml_ST_PageBorderOffset_page:
+ m_nOffset = 1;
+ break;
+ case NS_ooxml::LN_Value_wordprocessingml_ST_PageBorderOffset_text:
+ m_nOffset = 0;
+ break;
+ }
+ }
+ break;
+ default:;
+ }
+}
+
+void PageBordersHandler::sprm( Sprm& rSprm )
+{
+ switch ( rSprm.getId( ) )
+ {
+ case NS_ooxml::LN_CT_PageBorders_top:
+ case NS_ooxml::LN_CT_PageBorders_left:
+ case NS_ooxml::LN_CT_PageBorders_bottom:
+ case NS_ooxml::LN_CT_PageBorders_right:
+ {
+ writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
+ if( pProperties.get())
+ {
+ BorderHandlerPtr pBorderHandler( new BorderHandler( true ) );
+ pProperties->resolve(*pBorderHandler);
+ BorderPosition ePos = BorderPosition( 0 );
+ switch( rSprm.getId( ) )
+ {
+ case NS_ooxml::LN_CT_PageBorders_top:
+ ePos = BORDER_TOP;
+ break;
+ case NS_ooxml::LN_CT_PageBorders_left:
+ ePos = BORDER_LEFT;
+ break;
+ case NS_ooxml::LN_CT_PageBorders_bottom:
+ ePos = BORDER_BOTTOM;
+ break;
+ case NS_ooxml::LN_CT_PageBorders_right:
+ ePos = BORDER_RIGHT;
+ break;
+ default:;
+ }
+
+ _PgBorder aPgBorder;
+ aPgBorder.m_rLine = pBorderHandler->getBorderLine( );
+ aPgBorder.m_nDistance = pBorderHandler->getLineDistance( );
+ aPgBorder.m_ePos = ePos;
+ m_aBorders.push_back( aPgBorder );
+ }
+ }
+ break;
+ default:;
+ }
+}
+
+void PageBordersHandler::SetBorders( SectionPropertyMap* pSectContext )
+{
+ for ( int i = 0, length = m_aBorders.size( ); i < length; i++ )
+ {
+ _PgBorder aBorder = m_aBorders[i];
+ pSectContext->SetBorder( aBorder.m_ePos, aBorder.m_nDistance, aBorder.m_rLine );
+ }
+}
+
+} }
diff --git a/writerfilter/source/dmapper/PageBordersHandler.hxx b/writerfilter/source/dmapper/PageBordersHandler.hxx
new file mode 100644
index 000000000000..327ccfc4f8d6
--- /dev/null
+++ b/writerfilter/source/dmapper/PageBordersHandler.hxx
@@ -0,0 +1,57 @@
+#ifndef INCLUDED_PAGEBORDERSHANDLER_HXX
+#define INCLUDED_PAGEBORDERSHANDLER_HXX
+
+#include "BorderHandler.hxx"
+#include "PropertyMap.hxx"
+
+#include <WriterFilterDllApi.hxx>
+#include <resourcemodel/WW8ResourceModel.hxx>
+#include <boost/shared_ptr.hpp>
+
+#include <com/sun/star/table/BorderLine.hpp>
+
+#include <vector>
+
+
+namespace writerfilter {
+namespace dmapper {
+
+class _PgBorder
+{
+public:
+ com::sun::star::table::BorderLine m_rLine;
+ sal_Int32 m_nDistance;
+ BorderPosition m_ePos;
+
+ _PgBorder( );
+ ~_PgBorder( );
+};
+
+class WRITERFILTER_DLLPRIVATE PageBordersHandler : public Properties
+{
+private:
+
+ // See implementation of SectionPropertyMap::ApplyBorderToPageStyles
+ sal_Int32 m_nDisplay;
+ sal_Int32 m_nOffset;
+ vector<_PgBorder> m_aBorders;
+
+public:
+ PageBordersHandler( );
+ ~PageBordersHandler( );
+
+ // Properties
+ virtual void attribute( Id eName, Value& rVal );
+ virtual void sprm( Sprm& rSprm );
+
+ inline sal_Int32 GetDisplayOffset( )
+ {
+ return ( m_nOffset << 5 ) + m_nDisplay;
+ };
+ void SetBorders( SectionPropertyMap* pSectContext );
+};
+typedef boost::shared_ptr< PageBordersHandler > PageBordersHandlerPtr;
+
+} }
+
+#endif
diff --git a/writerfilter/source/dmapper/PropertyIds.cxx b/writerfilter/source/dmapper/PropertyIds.cxx
index f74cb574ff97..bc76be7d8ecf 100644
--- a/writerfilter/source/dmapper/PropertyIds.cxx
+++ b/writerfilter/source/dmapper/PropertyIds.cxx
@@ -315,9 +315,12 @@ const rtl::OUString& PropertyNameSupplier::GetName( PropertyIds eId ) const
case PROP_STREAM_NAME: sName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("StreamName")); break;
case PROP_BITMAP : sName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Bitmap")); break;
case PROP_IS_DATE : sName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IsDate")); break;
-// case : sName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("")); break;
-// case : sName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("")); break;
-// case : sName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("")); break;
+ case PROP_CNF_STYLE : sName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CnfStyle")); break;
+ case PROP_INDENT_AT : sName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IndentAt")); break;
+ case PROP_FIRST_LINE_INDENT : sName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FirstLineIndent")); break;
+ case PROP_NUMBERING_STYLE_NAME : sName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("NumberingStyleName")); break;
+ case PROP_LISTTAB_STOP_POSITION : sName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ListtabStopPosition")); break;
+ case PROP_POSITION_AND_SPACE_MODE : sName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PositionAndSpaceMode")); break;
// case : sName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("")); break;
// case : sName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("")); break;
// case : sName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("")); break;
diff --git a/writerfilter/source/dmapper/PropertyIds.hxx b/writerfilter/source/dmapper/PropertyIds.hxx
index c9acac71e280..cdbcf758b579 100644
--- a/writerfilter/source/dmapper/PropertyIds.hxx
+++ b/writerfilter/source/dmapper/PropertyIds.hxx
@@ -278,6 +278,12 @@ enum PropertyIds
/*239*/ ,PROP_STREAM_NAME
/*240*/ ,PROP_BITMAP
/*241*/ ,PROP_IS_DATE
+/*242*/ ,PROP_CNF_STYLE
+/*243*/ ,PROP_INDENT_AT
+/*244*/ ,PROP_FIRST_LINE_INDENT
+/*245*/ ,PROP_NUMBERING_STYLE_NAME
+/*246*/ ,PROP_LISTTAB_STOP_POSITION
+/*247*/ ,PROP_POSITION_AND_SPACE_MODE
};
struct PropertyNameSupplier_Impl;
class PropertyNameSupplier
diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx
index f39338eca908..3e2f0752fc52 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -176,6 +176,7 @@ void PropertyMap::insertTableProperties( const PropertyMap* )
-----------------------------------------------------------------------*/
SectionPropertyMap::SectionPropertyMap(bool bIsFirstSection) :
m_bIsFirstSection( bIsFirstSection )
+ ,m_nBorderParams( 0 )
,m_bTitlePage( false )
,m_nColumnCount( 0 )
,m_nColumnDistance( 1249 )
@@ -377,21 +378,6 @@ void SectionPropertyMap::ApplyBorderToPageStyles(
sal_Int32 nOffsetFrom = (nValue & 0x00E0) >> 5;
//sal_Int32 bPageDepth = (nValue & 0x0018) >> 3; //unused infromation: 0 - in front 1 - in back
//todo: negative spacing (from ww8par6.cxx)
- if( nOffsetFrom == 1 )
- {
-// USHORT nDist;
-// if (aBox.GetLeft())
-// {
-// nDist = aBox.GetDistance(BOX_LINE_LEFT);
-// lcl_MakeSafeNegativeSpacing( ) sets the distance to 0 if > SHRT_MAX
-//
-// aBox.SetDistance(lcl_MakeSafeNegativeSpacing(static_cast<USHORT>(aLR.GetLeft() - nDist)), BOX_LINE_LEFT);
-// aSizeArray[WW8_LEFT] =
-// aSizeArray[WW8_LEFT] - nDist + aBox.GetDistance(BOX_LINE_LEFT);
-// }
- //the same for right, top, bottom
-
- }
switch( nValue & 0x07)
{
case 0: /*all styles*/
@@ -422,8 +408,16 @@ void SectionPropertyMap::ApplyBorderToPageStyles(
PROP_LEFT_BORDER_DISTANCE,
PROP_RIGHT_BORDER_DISTANCE,
PROP_TOP_BORDER_DISTANCE,
- PROP_BOTTOM_BORDER_DISTANCE,
+ PROP_BOTTOM_BORDER_DISTANCE
};
+ static const PropertyIds aMarginIds[4] =
+ {
+ PROP_LEFT_MARGIN,
+ PROP_RIGHT_MARGIN,
+ PROP_TOP_MARGIN,
+ PROP_BOTTOM_MARGIN
+ };
+
PropertyNameSupplier& rPropNameSupplier = PropertyNameSupplier::GetPropertyNameSupplier();
for( sal_Int32 nBorder = 0; nBorder < 4; ++nBorder)
{
@@ -436,19 +430,38 @@ void SectionPropertyMap::ApplyBorderToPageStyles(
}
if( m_nBorderDistances[nBorder] >= 0 )
{
- const ::rtl::OUString sBorderDistanceName = rPropNameSupplier.GetName( aBorderDistanceIds[nBorder] );
- xFirst->setPropertyValue( sBorderDistanceName, uno::makeAny( m_nBorderDistances[nBorder] ));
+ SetBorderDistance( xFirst, aMarginIds[nBorder], aBorderDistanceIds[nBorder],
+ m_nBorderDistances[nBorder], nOffsetFrom );
if(xSecond.is())
- xSecond->setPropertyValue( sBorderDistanceName, uno::makeAny( m_nBorderDistances[nBorder] ));
+ SetBorderDistance( xSecond, aMarginIds[nBorder], aBorderDistanceIds[nBorder],
+ m_nBorderDistances[nBorder], nOffsetFrom );
}
}
+}
+
+void SectionPropertyMap::SetBorderDistance( uno::Reference< beans::XPropertySet > xStyle,
+ PropertyIds eMarginId, PropertyIds eDistId, sal_Int32 nDistance, sal_Int32 nOffsetFrom )
+{
+ PropertyNameSupplier& rPropNameSupplier = PropertyNameSupplier::GetPropertyNameSupplier();
-// rContext->Insert( aBorderIds[nId - 0x702B], uno::makeAny( aBorderLine ));
-// rContext->Insert( aBorderDistanceIds[nId - 0x702B], uno::makeAny( nLineDistance) );
+ sal_Int32 nDist = nDistance;
+ if( nOffsetFrom == 1 )
+ {
+ const ::rtl::OUString sMarginName = rPropNameSupplier.GetName( eMarginId );
+ uno::Any aMargin = xStyle->getPropertyValue( sMarginName );
+ sal_Int32 nMargin = 0;
+ aMargin >>= nMargin;
-// uno::Reference< beans::XPropertySet > xStyle = GetPageStyle( ePageType );
+ // Change the margins with the border distance
+ xStyle->setPropertyValue( sMarginName, uno::makeAny( nDistance ) );
+ // Set the distance to ( Margin - distance )
+ nDist = nMargin - nDistance;
+ }
+ const ::rtl::OUString sBorderDistanceName = rPropNameSupplier.GetName( eDistId );
+ xStyle->setPropertyValue( sBorderDistanceName, uno::makeAny( nDist ));
}
+
/*-- 14.12.2006 12:50:06---------------------------------------------------
-----------------------------------------------------------------------*/
@@ -726,8 +739,8 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl )
sal_Int32 nCharWidth = 423; //240 twip/ 12 pt
//todo: is '0' the right index here?
- const StyleSheetEntry* pEntry = rDM_Impl.GetStyleSheetTable()->FindStyleSheetByISTD(::rtl::OUString::valueOf(static_cast<sal_Int32>(0), 16));
- if( pEntry )
+ const StyleSheetEntryPtr pEntry = rDM_Impl.GetStyleSheetTable()->FindStyleSheetByISTD(::rtl::OUString::valueOf(static_cast<sal_Int32>(0), 16));
+ if( pEntry.get( ) )
{
PropertyMap::iterator aElement_ = pEntry->pProperties->find(PropertyDefinition( PROP_CHAR_HEIGHT_ASIAN, false ));
if( aElement_ != pEntry->pProperties->end())
@@ -766,6 +779,7 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl )
uno::Reference< beans::XPropertySet > xFirstPageStyle = GetPageStyle(
rDM_Impl.GetPageStyles(), rDM_Impl.GetTextFactory(), true );
_ApplyProperties( xFirstPageStyle );
+
sal_Int32 nPaperBin = m_nFirstPaperBin >= 0 ? m_nFirstPaperBin : m_nPaperBin >= 0 ? m_nPaperBin : 0;
if( nPaperBin )
xFollowPageStyle->setPropertyValue( sTrayIndex, uno::makeAny( nPaperBin ) );
@@ -773,6 +787,9 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl )
xFollowPageStyle->setPropertyValue(
rPropNameSupplier.GetName( PROP_TEXT_COLUMNS ), uno::makeAny( xColumns ));
}
+
+ ApplyBorderToPageStyles( rDM_Impl.GetPageStyles( ), rDM_Impl.GetTextFactory( ), m_nBorderParams );
+
try
{
// if( m_xStartingRange.is() )
@@ -877,7 +894,8 @@ StyleSheetPropertyMap::StyleSheetPropertyMap() :
mbCT_TblWidth_wSet( false ),
mbCT_TblWidth_typeSet( false ),
mnListId( -1 ),
- mnListLevel( -1 )
+ mnListLevel( -1 ),
+ mnOutlineLevel( -1 )
{
}
/*-- 14.06.2007 13:57:43---------------------------------------------------
diff --git a/writerfilter/source/dmapper/PropertyMap.hxx b/writerfilter/source/dmapper/PropertyMap.hxx
index 2b46d5ddef5b..1e30a018b721 100644
--- a/writerfilter/source/dmapper/PropertyMap.hxx
+++ b/writerfilter/source/dmapper/PropertyMap.hxx
@@ -158,6 +158,7 @@ class SectionPropertyMap : public PropertyMap
::com::sun::star::table::BorderLine* m_pBorderLines[4];
sal_Int32 m_nBorderDistances[4];
+ sal_Int32 m_nBorderParams;
bool m_bTitlePage;
sal_Int16 m_nColumnCount;
@@ -202,6 +203,9 @@ class SectionPropertyMap : public PropertyMap
bool HasHeader( bool bFirstPage ) const;
bool HasFooter( bool bFirstPage ) const;
+ void SetBorderDistance( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > xStyle,
+ PropertyIds eMarginId, PropertyIds eDistId, sal_Int32 nDistance, sal_Int32 nOffsetFrom );
+
public:
explicit SectionPropertyMap(bool bIsFirstSection);
~SectionPropertyMap();
@@ -227,6 +231,7 @@ public:
bool bFirst );
void SetBorder( BorderPosition ePos, sal_Int32 nLineDistance, const ::com::sun::star::table::BorderLine& rBorderLine );
+ void SetBorderParams( sal_Int32 nSet ) { m_nBorderParams = nSet; }
void SetColumnCount( sal_Int16 nCount ) { m_nColumnCount = nCount; }
void SetColumnDistance( sal_Int32 nDist ) { m_nColumnDistance = nDist; }
@@ -376,6 +381,9 @@ typedef boost::shared_ptr<ParagraphProperties> ParagraphPropertiesPtr;
/*-- 14.06.2007 12:12:34---------------------------------------------------
property map of a stylesheet
-----------------------------------------------------------------------*/
+
+#define WW_OUTLINE_MAX sal_Int16( 9 )
+
class StyleSheetPropertyMap : public PropertyMap, public ParagraphProperties
{
@@ -405,6 +413,8 @@ class StyleSheetPropertyMap : public PropertyMap, public ParagraphProperties
sal_Int32 mnListId;
sal_Int16 mnListLevel;
+
+ sal_Int16 mnOutlineLevel;
public:
explicit StyleSheetPropertyMap();
~StyleSheetPropertyMap();
@@ -479,6 +489,12 @@ public:
sal_Int16 GetListLevel() const { return mnListLevel; }
void SetListLevel(sal_Int16 nLevel) { mnListLevel = nLevel; }
+ sal_Int16 GetOutlineLevel() const { return mnOutlineLevel; }
+ void SetOutlineLevel(sal_Int16 nLevel)
+ {
+ if ( nLevel < WW_OUTLINE_MAX )
+ mnOutlineLevel = nLevel;
+ }
};
/*-- 27.12.2007 12:38:06---------------------------------------------------
diff --git a/writerfilter/source/dmapper/SettingsTable.cxx b/writerfilter/source/dmapper/SettingsTable.cxx
new file mode 100644
index 000000000000..dd5796a22ceb
--- /dev/null
+++ b/writerfilter/source/dmapper/SettingsTable.cxx
@@ -0,0 +1,87 @@
+#include "SettingsTable.hxx"
+
+#include <ooxml/resourceids.hxx>
+
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/text/XTextDocument.hpp>
+
+#if DEBUG
+#include <iostream>
+#endif
+
+using namespace com::sun::star;
+using namespace rtl;
+
+namespace writerfilter {
+namespace dmapper {
+
+SettingsTable_Impl::SettingsTable_Impl( ) :
+ m_bRecordChanges( false )
+{
+}
+
+SettingsTable_Impl::~SettingsTable_Impl( )
+{
+}
+
+SettingsTable::SettingsTable( ) :
+ m_pImpl( new SettingsTable_Impl )
+{
+}
+
+SettingsTable::~SettingsTable( )
+{
+ delete m_pImpl, m_pImpl = NULL;
+}
+
+void SettingsTable::attribute( Id /*nName*/, Value& /*rVal*/ )
+{
+#if DEBUG
+ clog << "SettingsTable::attribute( )" << endl;
+#endif
+}
+
+void SettingsTable::sprm( Sprm& rSprm )
+{
+ switch ( rSprm.getId( ) )
+ {
+ case NS_ooxml::LN_CT_Settings_trackRevisions:
+ {
+ m_pImpl->m_bRecordChanges = bool(rSprm.getValue( )->getInt( ) );
+ }
+ break;
+ default:
+ {
+#if DEBUG
+ clog << __FILE__ << ":" << __LINE__;
+ clog << ": unknown SPRM: " << rSprm.getName( ) << endl;
+#endif
+ }
+ }
+}
+
+void SettingsTable::entry( int nPos, writerfilter::Reference<Properties>::Pointer_t pRef )
+{
+ (void)nPos;
+#if DEBUG
+ fprintf( stderr, "SettingsTable::entry( ), pos: %d\n", nPos );
+#endif
+ pRef->resolve( *this );
+}
+
+void SettingsTable::resolveSprmProps( Sprm& rSprm )
+{
+ writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
+ if( pProperties.get())
+ pProperties->resolve(*this);
+}
+
+void SettingsTable::ApplyProperties( uno::Reference< text::XTextDocument > xDoc )
+{
+ uno::Reference< beans::XPropertySet> xDocProps( xDoc, uno::UNO_QUERY );
+
+ // Record changes value
+ xDocProps->setPropertyValue( OUString::createFromAscii( "RecordChanges" ), uno::makeAny( m_pImpl->m_bRecordChanges ) );
+}
+
+} }
diff --git a/writerfilter/source/dmapper/SettingsTable.hxx b/writerfilter/source/dmapper/SettingsTable.hxx
new file mode 100644
index 000000000000..fb5ba5a8b010
--- /dev/null
+++ b/writerfilter/source/dmapper/SettingsTable.hxx
@@ -0,0 +1,46 @@
+#ifndef INCLUDED_SETTINGSTABLE_HXX
+#define INCLUDED_SETTINGSTABLE_HXX
+
+#include <WriterFilterDllApi.hxx>
+#include <resourcemodel/WW8ResourceModel.hxx>
+
+#include <com/sun/star/text/XTextDocument.hpp>
+
+namespace writerfilter {
+namespace dmapper
+{
+
+struct SettingsTable_Impl
+{
+public:
+ bool m_bRecordChanges;
+
+ SettingsTable_Impl( );
+ ~SettingsTable_Impl( );
+};
+
+class WRITERFILTER_DLLPRIVATE SettingsTable: public Properties, public Table
+{
+public:
+ SettingsTable_Impl* m_pImpl;
+
+ SettingsTable( );
+ ~SettingsTable( );
+
+ // Properties
+ virtual void attribute(Id Name, Value & val);
+ virtual void sprm(Sprm & sprm);
+
+ // Table
+ virtual void entry(int pos, writerfilter::Reference<Properties>::Pointer_t ref);
+
+ void resolveSprmProps( Sprm& rSprm );
+
+ void ApplyProperties( com::sun::star::uno::Reference< com::sun::star::text::XTextDocument > xDoc );
+};
+typedef boost::shared_ptr< SettingsTable > SettingsTablePtr;
+
+
+} }
+
+#endif
diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx
index ae290c00698d..c42651b21881 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.cxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.cxx
@@ -30,6 +30,7 @@
#include <StyleSheetTable.hxx>
#include <dmapper/DomainMapper.hxx>
#include <ConversionHelper.hxx>
+#include <TblStylePrHandler.hxx>
#include <BorderHandler.hxx>
#include <doctok/resourceids.hxx>
#include <ooxml/resourceids.hxx>
@@ -38,6 +39,7 @@
#include <com/sun/star/beans/XPropertyState.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
+#include <com/sun/star/text/XChapterNumberingSupplier.hpp>
#include <com/sun/star/text/XTextDocument.hpp>
#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
#include <com/sun/star/style/XStyle.hpp>
@@ -70,6 +72,175 @@ StyleSheetEntry::StyleSheetEntry() :
{
}
+TableStyleSheetEntry::TableStyleSheetEntry( StyleSheetEntry& rEntry, StyleSheetTable* pStyles ):
+ StyleSheetEntry( ),
+ m_pStyleSheet( pStyles )
+{
+ bIsDefaultStyle = rEntry.bIsDefaultStyle;
+ bInvalidHeight = rEntry.bInvalidHeight;
+ bHasUPE = rEntry.bHasUPE;
+ nStyleTypeCode = STYLE_TYPE_TABLE;
+ sBaseStyleIdentifier = rEntry.sBaseStyleIdentifier;
+ sNextStyleIdentifier = rEntry.sNextStyleIdentifier;
+ sStyleName = rEntry.sStyleName;
+ sStyleName1 = rEntry.sStyleName1;
+
+ m_nColBandSize = 1;
+ m_nRowBandSize = 1;
+}
+
+TableStyleSheetEntry::~TableStyleSheetEntry( )
+{
+ m_pStyleSheet = NULL;
+}
+
+void TableStyleSheetEntry::AddTblStylePr( TblStyleType nType, PropertyMapPtr pProps )
+{
+ static TblStyleType pTypesToFix[] =
+ {
+ TBL_STYLE_FIRSTROW,
+ TBL_STYLE_LASTROW,
+ TBL_STYLE_FIRSTCOL,
+ TBL_STYLE_LASTCOL
+ };
+
+ static PropertyIds pPropsToCheck[] =
+ {
+ PROP_BOTTOM_BORDER,
+ PROP_TOP_BORDER,
+ PROP_RIGHT_BORDER,
+ PROP_LEFT_BORDER
+ };
+
+ int i = 0;
+ while ( i < 4 )
+ {
+ if ( nType == pTypesToFix[i] )
+ {
+ PropertyIds nChecked = pPropsToCheck[i];
+ PropertyMap::iterator pCheckedIt = pProps->find( PropertyDefinition( nChecked, false ) );
+
+ PropertyIds nInsideProp = ( i < 2 ) ? META_PROP_HORIZONTAL_BORDER : META_PROP_VERTICAL_BORDER;
+ PropertyMap::iterator pInsideIt = pProps->find( PropertyDefinition( nInsideProp, false ) );
+
+ bool bHasChecked = pCheckedIt != pProps->end( );
+ bool bHasInside = pInsideIt != pProps->end( );
+
+ if ( bHasChecked && bHasInside )
+ {
+ // In this case, remove the inside border
+ pProps->erase( pInsideIt );
+ }
+
+ i = 4; // Stop looping stupidly
+ }
+ i++;
+ }
+
+ // Append the tblStylePr
+ m_aStyles[nType] = pProps;
+}
+
+PropertyMapPtr TableStyleSheetEntry::GetProperties( sal_Int32 nMask )
+{
+ PropertyMapPtr pProps( new PropertyMap );
+
+ // First get the parent properties
+ StyleSheetEntryPtr pEntry = m_pStyleSheet->FindParentStyleSheet( sBaseStyleIdentifier );
+
+ if ( pEntry.get( ) )
+ {
+ TableStyleSheetEntry* pParent = static_cast<TableStyleSheetEntry *>( pEntry.get( ) );
+ pProps->insert( pParent->GetProperties( nMask ) );
+ }
+
+ // And finally get the mask ones
+ pProps->insert( GetLocalPropertiesFromMask( nMask ) );
+
+ return pProps;
+}
+
+void lcl_mergeProps( PropertyMapPtr pToFill, PropertyMapPtr pToAdd, TblStyleType nStyleId )
+{
+ static PropertyIds pPropsToCheck[] =
+ {
+ PROP_BOTTOM_BORDER,
+ PROP_TOP_BORDER,
+ PROP_RIGHT_BORDER,
+ PROP_LEFT_BORDER,
+ };
+
+ bool pRemoveInside[] =
+ {
+ ( nStyleId == TBL_STYLE_FIRSTROW ),
+ ( nStyleId == TBL_STYLE_LASTROW ),
+ ( nStyleId == TBL_STYLE_LASTCOL ),
+ ( nStyleId == TBL_STYLE_FIRSTCOL )
+ };
+
+ for ( int i = 0 ; i < 7; i++ )
+ {
+ PropertyIds nId = pPropsToCheck[i];
+ PropertyDefinition aProp( nId, false );
+ PropertyMap::iterator pIt = pToAdd->find( aProp );
+
+ if ( pIt != pToAdd->end( ) )
+ {
+ PropertyMap::iterator pDestIt = pToFill->find( aProp );
+
+ if ( pRemoveInside[i] )
+ {
+ // Remove the insideH and insideV depending on the cell pos
+ PropertyIds nInsideProp = ( i < 2 ) ? META_PROP_HORIZONTAL_BORDER : META_PROP_VERTICAL_BORDER;
+ pDestIt = pToFill->find( PropertyDefinition( nInsideProp, false ) );
+ if ( pDestIt != pToFill->end( ) )
+ pToFill->erase( pDestIt );
+ }
+ }
+ }
+
+ pToFill->insert( pToAdd );
+}
+
+PropertyMapPtr TableStyleSheetEntry::GetLocalPropertiesFromMask( sal_Int32 nMask )
+{
+ // Order from right to left
+ static TblStyleType aBitsOrder[] =
+ {
+ TBL_STYLE_SWCELL,
+ TBL_STYLE_SECELL,
+ TBL_STYLE_NWCELL,
+ TBL_STYLE_NECELL,
+ TBL_STYLE_BAND2HORZ,
+ TBL_STYLE_BAND1HORZ,
+ TBL_STYLE_BAND2VERT,
+ TBL_STYLE_BAND1VERT,
+ TBL_STYLE_LASTCOL,
+ TBL_STYLE_FIRSTCOL,
+ TBL_STYLE_LASTROW,
+ TBL_STYLE_FIRSTROW
+ };
+
+ // Get the properties applying according to the mask
+ PropertyMapPtr pProps( new PropertyMap( ) );
+ short nBit = 0;
+ do
+ {
+ TblStyleType nStyleId = aBitsOrder[nBit];
+ TblStylePrs::iterator pIt = m_aStyles.find( nStyleId );
+
+ short nTestBit = 1 << nBit;
+ sal_Int32 nBitMask = sal_Int32( nTestBit );
+ if ( ( nMask & nBitMask ) && ( pIt != m_aStyles.end( ) ) )
+ lcl_mergeProps( pProps, pIt->second, nStyleId );
+
+ nBit++;
+ }
+ while ( nBit < 12 );
+
+ return pProps;
+}
+
/*-- 06.02.2008 11:30:46---------------------------------------------------
-----------------------------------------------------------------------*/
@@ -92,8 +263,8 @@ struct StyleSheetTable_Impl
DomainMapper& m_rDMapper;
uno::Reference< text::XTextDocument> m_xTextDocument;
uno::Reference< beans::XPropertySet> m_xTextDefaults;
- std::vector< StyleSheetEntry > m_aStyleSheetEntries;
- StyleSheetEntry *m_pCurrentEntry;
+ std::vector< StyleSheetEntryPtr > m_aStyleSheetEntries;
+ StyleSheetEntryPtr m_pCurrentEntry;
PropertyMapPtr m_pDefaultParaProps, m_pDefaultCharProps;
PropertyMapPtr m_pCurrentProps;
StringPairMap_t m_aStyleNameMap;
@@ -110,7 +281,7 @@ struct StyleSheetTable_Impl
StyleSheetTable_Impl::StyleSheetTable_Impl(DomainMapper& rDMapper, uno::Reference< text::XTextDocument> xTextDocument ) :
m_rDMapper( rDMapper ),
m_xTextDocument( xTextDocument ),
- m_pCurrentEntry(0),
+ m_pCurrentEntry(),
m_pDefaultParaProps(new PropertyMap),
m_pDefaultCharProps(new PropertyMap)
{
@@ -659,13 +830,23 @@ void StyleSheetTable::attribute(Id Name, Value & val)
// case NS_rtf::LN_STYLESHEET: break;
/* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
case NS_ooxml::LN_CT_Style_type:
+ {
/* defaults should be set at the service "com.sun.star.text.Defaults"
if (nIntValue == 1)
*(m_pImpl->m_pCurrentEntry->pProperties) = *(m_pImpl->m_pDefaultParaProps);
else if (nIntValue == 2)
*(m_pImpl->m_pCurrentEntry->pProperties) = *(m_pImpl->m_pDefaultCharProps);*/
- m_pImpl->m_pCurrentEntry->nStyleTypeCode = (StyleType)nIntValue;
+ StyleType nType = ( StyleType ) nIntValue;
+ if ( nType == STYLE_TYPE_TABLE )
+ {
+ StyleSheetEntryPtr pEntry = m_pImpl->m_pCurrentEntry;
+ TableStyleSheetEntryPtr pTableEntry( new TableStyleSheetEntry( *pEntry.get( ), this ) );
+ m_pImpl->m_pCurrentEntry = pTableEntry;
+ }
+ else
+ m_pImpl->m_pCurrentEntry->nStyleTypeCode = (StyleType)nIntValue;
break;
+ }
/* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
case NS_ooxml::LN_CT_Style_default:
m_pImpl->m_pCurrentEntry->bIsDefaultStyle = (nIntValue != 0);
@@ -753,13 +934,28 @@ void StyleSheetTable::sprm(Sprm & rSprm)
case NS_ooxml::LN_CT_Style_rsid:
/* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
case NS_ooxml::LN_CT_Style_trPr:
- /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
- case NS_ooxml::LN_CT_Style_tcPr:
break;
/* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
- case NS_ooxml::LN_CT_Style_tblPr: //contains table properties
- /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
case NS_ooxml::LN_CT_Style_tblStylePr: //contains to table properties
+ {
+ writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
+ if( pProperties.get())
+ {
+ TblStylePrHandlerPtr pTblStylePrHandler( new TblStylePrHandler( m_pImpl->m_rDMapper ) );
+ pProperties->resolve( *pTblStylePrHandler );
+
+ // Add the properties to the table style
+ TblStyleType nType = pTblStylePrHandler->getType( );
+ PropertyMapPtr pProps = pTblStylePrHandler->getProperties( );
+ StyleSheetEntryPtr pEntry = m_pImpl->m_pCurrentEntry;
+ TableStyleSheetEntry* pTableEntry = static_cast<TableStyleSheetEntry*>( pEntry.get( ) );
+ pTableEntry->AddTblStylePr( nType, pProps );
+ }
+ break;
+ }
+ case NS_ooxml::LN_CT_Style_tcPr:
+ /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
+ case NS_ooxml::LN_CT_Style_tblPr: //contains table properties
/* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
case NS_ooxml::LN_CT_DocDefaults_pPrDefault:
/* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
@@ -805,14 +1001,35 @@ void StyleSheetTable::sprm(Sprm & rSprm)
}
}
break;
- /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
+ case NS_ooxml::LN_CT_TblPrBase_tblStyleRowBandSize:
+ case NS_ooxml::LN_CT_TblPrBase_tblStyleColBandSize:
+ {
+ StyleSheetEntry* pEntry = m_pImpl->m_pCurrentEntry.get( );
+ TableStyleSheetEntry *pTEntry = static_cast<TableStyleSheetEntry*>( pEntry );
+ if ( pTEntry )
+ {
+ if ( nSprmId == NS_ooxml::LN_CT_TblPrBase_tblStyleRowBandSize )
+ pTEntry->m_nRowBandSize = nIntValue;
+ else
+ pTEntry->m_nColBandSize = nIntValue;
+ }
+ }
+ break;
+ /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
case NS_ooxml::LN_CT_Style_pPr:
/* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
case NS_ooxml::LN_CT_Style_rPr:
default:
if (!m_pImpl->m_pCurrentEntry)
break;
- m_pImpl->m_rDMapper.sprm( rSprm, m_pImpl->m_pCurrentEntry->pProperties );
+ TablePropertiesHandlerPtr pTblHandler( new TablePropertiesHandler( true ) );
+ pTblHandler->SetProperties( m_pImpl->m_pCurrentEntry->pProperties );
+ if ( !pTblHandler->sprm( rSprm ) )
+ {
+ m_pImpl->m_rDMapper.PushStyleSheetProperties( m_pImpl->m_pCurrentEntry->pProperties );
+ m_pImpl->m_rDMapper.sprm( rSprm );
+ m_pImpl->m_rDMapper.PopStyleSheetProperties( );
+ }
}
}
/*-- 19.06.2006 12:04:33---------------------------------------------------
@@ -823,7 +1040,8 @@ void StyleSheetTable::entry(int /*pos*/, writerfilter::Reference<Properties>::Po
//create a new style entry
// printf("StyleSheetTable::entry(...)\n");
OSL_ENSURE( !m_pImpl->m_pCurrentEntry, "current entry has to be NULL here");
- m_pImpl->m_pCurrentEntry = new StyleSheetEntry;
+ StyleSheetEntryPtr pNewEntry( new StyleSheetEntry );
+ m_pImpl->m_pCurrentEntry = pNewEntry;
m_pImpl->m_rDMapper.PushStyleSheetProperties( m_pImpl->m_pCurrentEntry->pProperties );
ref->resolve(*this);
//append it to the table
@@ -831,13 +1049,14 @@ void StyleSheetTable::entry(int /*pos*/, writerfilter::Reference<Properties>::Po
if( !m_pImpl->m_rDMapper.IsOOXMLImport() || m_pImpl->m_pCurrentEntry->sStyleName.getLength() >0)
{
m_pImpl->m_pCurrentEntry->sConvertedStyleName = ConvertStyleName( m_pImpl->m_pCurrentEntry->sStyleName );
- m_pImpl->m_aStyleSheetEntries.push_back( *m_pImpl->m_pCurrentEntry );
+ m_pImpl->m_aStyleSheetEntries.push_back( m_pImpl->m_pCurrentEntry );
}
else
{
//TODO: this entry contains the default settings - they have to be added to the settings
}
- m_pImpl->m_pCurrentEntry = 0;
+ StyleSheetEntryPtr pEmptyEntry;
+ m_pImpl->m_pCurrentEntry = pEmptyEntry;
}
/*-- 21.06.2006 15:34:49---------------------------------------------------
sorting helper
@@ -910,16 +1129,17 @@ void StyleSheetTable::ApplyStyleSheets( FontTablePtr rFontTable )
xStyleFamilies->getByName(rPropNameSupplier.GetName( PROP_PARAGRAPH_STYLES )) >>= xParaStyles;
if(xCharStyles.is() && xParaStyles.is())
{
- std::vector< StyleSheetEntry >::iterator aIt = m_pImpl->m_aStyleSheetEntries.begin();
+ std::vector< StyleSheetEntryPtr >::iterator aIt = m_pImpl->m_aStyleSheetEntries.begin();
while( aIt != m_pImpl->m_aStyleSheetEntries.end() )
{
- if( aIt->nStyleTypeCode == STYLE_TYPE_CHAR || aIt->nStyleTypeCode == STYLE_TYPE_PARA )
+ StyleSheetEntryPtr pEntry = *aIt;
+ if( pEntry->nStyleTypeCode == STYLE_TYPE_CHAR || pEntry->nStyleTypeCode == STYLE_TYPE_PARA )
{
- bool bParaStyle = aIt->nStyleTypeCode == STYLE_TYPE_PARA;
+ bool bParaStyle = pEntry->nStyleTypeCode == STYLE_TYPE_PARA;
bool bInsert = false;
uno::Reference< container::XNameContainer > xStyles = bParaStyle ? xParaStyles : xCharStyles;
uno::Reference< style::XStyle > xStyle;
- ::rtl::OUString sConvertedStyleName = ConvertStyleName( aIt->sStyleName );
+ ::rtl::OUString sConvertedStyleName = ConvertStyleName( pEntry->sStyleName );
if(xStyles->hasByName( sConvertedStyleName ))
xStyles->getByName( sConvertedStyleName ) >>= xStyle;
else
@@ -931,12 +1151,13 @@ void StyleSheetTable::ApplyStyleSheets( FontTablePtr rFontTable )
rPropNameSupplier.GetName( PROP_SERVICE_CHAR_STYLE )),
uno::UNO_QUERY_THROW);
}
- if( aIt->sBaseStyleIdentifier.getLength() )
+ if( pEntry->sBaseStyleIdentifier.getLength() )
{
try
{
//TODO: Handle cases where a paragraph <> character style relation is needed
- xStyle->setParentStyle(ConvertStyleName( aIt->sBaseStyleIdentifier ));
+ StyleSheetEntryPtr pParent = FindStyleSheetByISTD( pEntry->sBaseStyleIdentifier );
+ xStyle->setParentStyle(ConvertStyleName( pParent->sStyleName ));
}
catch( const uno::RuntimeException& )
{
@@ -955,43 +1176,71 @@ void StyleSheetTable::ApplyStyleSheets( FontTablePtr rFontTable )
{
uno::Any aTwoHundredFortyTwip = uno::makeAny(12.);
// font size to 240 twip (12 pts) for all if not set
- aIt->pProperties->Insert(PROP_CHAR_HEIGHT, true, aTwoHundredFortyTwip, false);
+ pEntry->pProperties->Insert(PROP_CHAR_HEIGHT, true, aTwoHundredFortyTwip, false);
// western font not already set -> apply first font
const FontEntry* pWesternFontEntry = rFontTable->getFontEntry( 0 );
rtl::OUString sWesternFontName = pWesternFontEntry->sFontName;
- aIt->pProperties->Insert(PROP_CHAR_FONT_NAME, true, uno::makeAny( sWesternFontName ), false);
+ pEntry->pProperties->Insert(PROP_CHAR_FONT_NAME, true, uno::makeAny( sWesternFontName ), false);
// CJK ... apply second font
const FontEntry* pCJKFontEntry = rFontTable->getFontEntry( 2 );
- aIt->pProperties->Insert(PROP_CHAR_FONT_NAME_ASIAN, true, uno::makeAny( pCJKFontEntry->sFontName ), false);
- aIt->pProperties->Insert(PROP_CHAR_HEIGHT_ASIAN, true, aTwoHundredFortyTwip, false);
+ pEntry->pProperties->Insert(PROP_CHAR_FONT_NAME_ASIAN, true, uno::makeAny( pCJKFontEntry->sFontName ), false);
+ pEntry->pProperties->Insert(PROP_CHAR_HEIGHT_ASIAN, true, aTwoHundredFortyTwip, false);
// CTL ... apply third font, if available
if( nFontCount > 3 )
{
const FontEntry* pCTLFontEntry = rFontTable->getFontEntry( 3 );
- aIt->pProperties->Insert(PROP_CHAR_FONT_NAME_COMPLEX, true, uno::makeAny( pCTLFontEntry->sFontName ), false);
- aIt->pProperties->Insert(PROP_CHAR_HEIGHT_COMPLEX, true, aTwoHundredFortyTwip, false);
+ pEntry->pProperties->Insert(PROP_CHAR_FONT_NAME_COMPLEX, true, uno::makeAny( pCTLFontEntry->sFontName ), false);
+ pEntry->pProperties->Insert(PROP_CHAR_HEIGHT_COMPLEX, true, aTwoHundredFortyTwip, false);
}
}
// Widow/Orphan -> set both to two if not already set
uno::Any aTwo = uno::makeAny(sal_Int8(2));
- aIt->pProperties->Insert(PROP_PARA_WIDOWS, true, aTwo, false);
- aIt->pProperties->Insert(PROP_PARA_ORPHANS, true, aTwo, false);
+ pEntry->pProperties->Insert(PROP_PARA_WIDOWS, true, aTwo, false);
+ pEntry->pProperties->Insert(PROP_PARA_ORPHANS, true, aTwo, false);
// Left-to-right direction if not already set
- aIt->pProperties->Insert(PROP_WRITING_MODE, true, uno::makeAny( sal_Int16(text::WritingMode_LR_TB) ), false);
+ pEntry->pProperties->Insert(PROP_WRITING_MODE, true, uno::makeAny( sal_Int16(text::WritingMode_LR_TB) ), false);
// font color COL_AUTO if not already set
- aIt->pProperties->Insert(PROP_CHAR_COLOR, true, uno::makeAny( sal_Int32(0xffffffff) ), false);
+ pEntry->pProperties->Insert(PROP_CHAR_COLOR, true, uno::makeAny( sal_Int32(0xffffffff) ), false);
}
- uno::Sequence< beans::PropertyValue > aPropValues = aIt->pProperties->GetPropertyValues();
+ uno::Sequence< beans::PropertyValue > aPropValues = pEntry->pProperties->GetPropertyValues();
bool bAddFollowStyle = false;
- if(bParaStyle && !aIt->sNextStyleIdentifier.getLength() )
+ if(bParaStyle && !pEntry->sNextStyleIdentifier.getLength() )
{
bAddFollowStyle = true;
}
//remove Left/RightMargin values from TOX heading styles
if( bParaStyle )
{
+ // Set the outline levels
+ const StyleSheetPropertyMap* pStyleSheetProperties = dynamic_cast<const StyleSheetPropertyMap*>(pEntry ? pEntry->pProperties.get() : 0);
+ if ( pStyleSheetProperties && pStyleSheetProperties->GetOutlineLevel( ) >= 0 )
+ {
+ sal_Int16 nLvl = pStyleSheetProperties->GetOutlineLevel( );
+ uno::Reference< text::XChapterNumberingSupplier > xOutlines ( m_pImpl->m_xTextDocument,
+ uno::UNO_QUERY_THROW );
+ uno::Reference< container::XIndexReplace > xRules = xOutlines->getChapterNumberingRules( );
+ uno::Any aLevel = xRules->getByIndex( nLvl );
+ uno::Sequence< beans::PropertyValue > aLevelProps;
+ aLevel >>= aLevelProps;
+
+ sal_Int32 nLen = aLevelProps.getLength( );
+ sal_Int32 i = 0;
+ bool bPropFound = false;
+ rtl::OUString sPropName( rtl::OUString::createFromAscii( "HeadingStyleName" ) );
+ while ( i < nLen && !bPropFound )
+ {
+ if ( aLevelProps[i].Name.equals( sPropName ) )
+ {
+ aLevelProps[i].Value = uno::makeAny( ConvertStyleName( pEntry->sStyleName ) );
+ bPropFound = true;
+ }
+ i++;
+ }
+ xRules->replaceByIndex( nLvl, uno::makeAny( aLevelProps ) );
+ }
+
uno::Reference< beans::XPropertyState >xState( xStyle, uno::UNO_QUERY_THROW );
if( sConvertedStyleName.equalsAscii( "Contents Heading" ) ||
sConvertedStyleName.equalsAscii( "User Index Heading" ) ||
@@ -1028,24 +1277,27 @@ void StyleSheetTable::ApplyStyleSheets( FontTablePtr rFontTable )
if(bAddFollowStyle || aPropValues.getLength())
{
- const beans::PropertyValue* pPropValues = aPropValues.getConstArray();
PropValVector aSortedPropVals;
for( sal_Int32 nProp = 0; nProp < aPropValues.getLength(); ++nProp)
{
- aSortedPropVals.Insert( pPropValues[nProp] );
+ // Don't add the style name properties
+ bool bIsParaStyleName = aPropValues[nProp].Name.equalsAscii( "ParaStyleName" );
+ bool bIsCharStyleName = aPropValues[nProp].Name.equalsAscii( "CharStyleName" );
+ if ( !bInsert && !bIsParaStyleName && !bIsCharStyleName )
+ aSortedPropVals.Insert( aPropValues[nProp] );
}
if(bAddFollowStyle)
{
//find the name of the Next style
- std::vector< StyleSheetEntry >::iterator aNextStyleIt = m_pImpl->m_aStyleSheetEntries.begin();
+ std::vector< StyleSheetEntryPtr >::iterator aNextStyleIt = m_pImpl->m_aStyleSheetEntries.begin();
for( ; aNextStyleIt != m_pImpl->m_aStyleSheetEntries.end(); ++aNextStyleIt )
{
- if( aNextStyleIt->sStyleName.getLength() &&
- aNextStyleIt->sStyleName == aIt->sNextStyleIdentifier)
+ if( ( *aNextStyleIt )->sStyleName.getLength() &&
+ ( *aNextStyleIt )->sStyleName == pEntry->sNextStyleIdentifier)
{
beans::PropertyValue aNew;
aNew.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FollowStyle"));
- aNew.Value = uno::makeAny(ConvertStyleName( aNextStyleIt->sStyleIdentifierD ));
+ aNew.Value = uno::makeAny(ConvertStyleName( ( *aNextStyleIt )->sStyleIdentifierD ));
aSortedPropVals.Insert( aNew );
break;
}
@@ -1084,14 +1336,14 @@ void StyleSheetTable::ApplyStyleSheets( FontTablePtr rFontTable )
/*-- 22.06.2006 15:56:56---------------------------------------------------
-----------------------------------------------------------------------*/
-const StyleSheetEntry* StyleSheetTable::FindStyleSheetByISTD(const ::rtl::OUString& sIndex)
+const StyleSheetEntryPtr StyleSheetTable::FindStyleSheetByISTD(const ::rtl::OUString& sIndex)
{
- const StyleSheetEntry* pRet = 0;
+ StyleSheetEntryPtr pRet;
for( sal_uInt32 nPos = 0; nPos < m_pImpl->m_aStyleSheetEntries.size(); ++nPos )
{
- if( m_pImpl->m_aStyleSheetEntries[nPos].sStyleIdentifierD == sIndex)
+ if( m_pImpl->m_aStyleSheetEntries[nPos]->sStyleIdentifierD == sIndex)
{
- pRet = &m_pImpl->m_aStyleSheetEntries[nPos];
+ pRet = m_pImpl->m_aStyleSheetEntries[nPos];
break;
}
}
@@ -1100,14 +1352,14 @@ const StyleSheetEntry* StyleSheetTable::FindStyleSheetByISTD(const ::rtl::OUStri
/*-- 28.12.2007 14:45:45---------------------------------------------------
-----------------------------------------------------------------------*/
-const StyleSheetEntry* StyleSheetTable::FindStyleSheetByStyleName(const ::rtl::OUString& sIndex)
+const StyleSheetEntryPtr StyleSheetTable::FindStyleSheetByStyleName(const ::rtl::OUString& sIndex)
{
- const StyleSheetEntry* pRet = 0;
+ StyleSheetEntryPtr pRet;
for( sal_uInt32 nPos = 0; nPos < m_pImpl->m_aStyleSheetEntries.size(); ++nPos )
{
- if( m_pImpl->m_aStyleSheetEntries[nPos].sStyleName == sIndex)
+ if( m_pImpl->m_aStyleSheetEntries[nPos]->sStyleName == sIndex)
{
- pRet = &m_pImpl->m_aStyleSheetEntries[nPos];
+ pRet = m_pImpl->m_aStyleSheetEntries[nPos];
break;
}
}
@@ -1116,14 +1368,14 @@ const StyleSheetEntry* StyleSheetTable::FindStyleSheetByStyleName(const ::rtl::O
/*-- 28.12.2007 14:45:45---------------------------------------------------
-----------------------------------------------------------------------*/
-const StyleSheetEntry* StyleSheetTable::FindStyleSheetByConvertedStyleName(const ::rtl::OUString& sIndex)
+const StyleSheetEntryPtr StyleSheetTable::FindStyleSheetByConvertedStyleName(const ::rtl::OUString& sIndex)
{
- const StyleSheetEntry* pRet = 0;
+ StyleSheetEntryPtr pRet;
for( sal_uInt32 nPos = 0; nPos < m_pImpl->m_aStyleSheetEntries.size(); ++nPos )
{
- if( m_pImpl->m_aStyleSheetEntries[nPos].sConvertedStyleName == sIndex)
+ if( m_pImpl->m_aStyleSheetEntries[nPos]->sConvertedStyleName == sIndex)
{
- pRet = &m_pImpl->m_aStyleSheetEntries[nPos];
+ pRet = m_pImpl->m_aStyleSheetEntries[nPos];
break;
}
}
@@ -1133,23 +1385,17 @@ const StyleSheetEntry* StyleSheetTable::FindStyleSheetByConvertedStyleName(const
/*-- 17.07.2006 11:47:00---------------------------------------------------
-----------------------------------------------------------------------*/
-const StyleSheetEntry* StyleSheetTable::FindParentStyleSheet(::rtl::OUString sBaseStyle)
+const StyleSheetEntryPtr StyleSheetTable::FindParentStyleSheet(::rtl::OUString sBaseStyle)
{
if( !sBaseStyle.getLength() )
- return 0;
+ {
+ StyleSheetEntryPtr pEmptyPtr;
+ return pEmptyPtr;
+ }
if( m_pImpl->m_pCurrentEntry)
sBaseStyle = m_pImpl->m_pCurrentEntry->sBaseStyleIdentifier;
- const StyleSheetEntry* pRet = 0;
- for( sal_uInt32 nPos = 0; nPos < m_pImpl->m_aStyleSheetEntries.size(); ++nPos )
- {
- if( m_pImpl->m_aStyleSheetEntries[nPos].sStyleIdentifierD == sBaseStyle )
- {
- pRet = &m_pImpl->m_aStyleSheetEntries[nPos];
- break;
- }
- }
- return pRet;
+ return FindStyleSheetByISTD( sBaseStyle );
}
/*-- 21.12.2006 15:58:23---------------------------------------------------
@@ -1187,12 +1433,12 @@ static const sal_Char *aStyleNamePairs[] =
"Index 1", "Index 1",
"Index 2", "Index 2",
"Index 3", "Index 3",
- "Index 4", 0,
- "Index 5", 0,
- "Index 6", 0,
- "Index 7", 0,
- "Index 8", 0,
- "Index 9", 0,
+ "Index 4", "",
+ "Index 5", "",
+ "Index 6", "",
+ "Index 7", "",
+ "Index 8", "",
+ "Index 9", "",
"TOC 1", "Contents 1",
"TOC 2", "Contents 2",
"TOC 3", "Contents 3",
@@ -1222,46 +1468,46 @@ static const sal_Char *aStyleNamePairs[] =
"TOC7", "Contents 7",
"TOC8", "Contents 8",
"TOC9", "Contents 9",
- "Normal Indent", 0,
+ "Normal Indent", "",
"Footnote Text", "Footnote",
- "Annotation Text", 0,
+ "Annotation Text", "",
"Header", "Header",
"header", "Header",
"Footer", "Footer",
"footer", "Footer",
"Index Heading", "Index Heading",
- "Caption", 0,
- "Table of Figures", 0,
+ "Caption", "",
+ "Table of Figures", "",
"Envelope Address", "Addressee",
"Envelope Return", "Sender",
"Footnote Reference", "Footnote anchor",
- "Annotation Reference", 0,
+ "Annotation Reference", "",
"Line Number", "Line numbering",
"Page Number", "Page Number",
"Endnote Reference", "Endnote anchor",
"Endnote Text", "Endnote Symbol",
- "Table of Authorities", 0,
- "Macro Text", 0,
- "TOA Heading", 0,
+ "Table of Authorities", "",
+ "Macro Text", "",
+ "TOA Heading", "",
"List", "List",
- "List 2", 0,
- "List 3", 0,
- "List 4", 0,
- "List 5", 0,
- "List Bullet", 0,
- "List Bullet 2", 0,
- "List Bullet 3", 0,
- "List Bullet 4", 0,
- "List Bullet 5", 0,
- "List Number", 0,
- "List Number 2", 0,
- "List Number 3", 0,
- "List Number 4", 0,
- "List Number 5", 0,
+ "List 2", "",
+ "List 3", "",
+ "List 4", "",
+ "List 5", "",
+ "List Bullet", "",
+ "List Bullet 2", "",
+ "List Bullet 3", "",
+ "List Bullet 4", "",
+ "List Bullet 5", "",
+ "List Number", "",
+ "List Number 2", "",
+ "List Number 3", "",
+ "List Number 4", "",
+ "List Number 5", "",
"Title", "Title",
- "Closing", 0,
+ "Closing", "",
"Signature", "Signature",
- "Default Paragraph Font", 0,
+ "Default Paragraph Font", "",
"DefaultParagraphFont", "Default Paragraph Font",
"Body Text", "Text body",
"BodyText", "Text body",
@@ -1269,29 +1515,29 @@ static const sal_Char *aStyleNamePairs[] =
"Body Text Indent", "Text body indent",
"BodyTextIndent", "Text body indent",
"BodyTextIndent2", "Text body indent2",
- "List Continue", 0,
- "List Continue 2", 0,
- "List Continue 3", 0,
- "List Continue 4", 0,
- "List Continue 5", 0,
- "Message Header", 0,
+ "List Continue", "",
+ "List Continue 2", "",
+ "List Continue 3", "",
+ "List Continue 4", "",
+ "List Continue 5", "",
+ "Message Header", "",
"Subtitle", "Subtitle",
- "Salutation", 0,
- "Date", 0,
+ "Salutation", "",
+ "Date", "",
"Body Text First Indent", "Body Text Indent",
- "Body Text First Indent 2", 0,
- "Note Heading", 0,
- "Body Text 2", 0,
- "Body Text 3", 0,
- "Body Text Indent 2", 0,
- "Body Text Indent 3", 0,
- "Block Text", 0,
+ "Body Text First Indent 2", "",
+ "Note Heading", "",
+ "Body Text 2", "",
+ "Body Text 3", "",
+ "Body Text Indent 2", "",
+ "Body Text Indent 3", "",
+ "Block Text", "",
"Hyperlink", "Internet link",
"Followed Hyperlink", "Visited Internet Link",
"Strong", "Strong Emphasis",
"Emphasis", "Emphasis",
- "Document Map", 0,
- "Plain Text", 0,
+ "Document Map", "",
+ "Plain Text", "",
"NoList", "No List",
"AbstractHeading", "Abstract Heading",
"AbstractBody", "Abstract Body",
@@ -1307,12 +1553,12 @@ static const sal_Char *aStyleNamePairs[] =
if( bExtendedSearch )
{
//search for the rWWName in the IdentifierD of the existing styles and convert the sStyleName member
- std::vector< StyleSheetEntry >::iterator aIt = m_pImpl->m_aStyleSheetEntries.begin();
+ std::vector< StyleSheetEntryPtr >::iterator aIt = m_pImpl->m_aStyleSheetEntries.begin();
//TODO: performance issue - put styles list into a map sorted by it's sStyleIdentifierD members
while( aIt != m_pImpl->m_aStyleSheetEntries.end() )
{
- if( rWWName == aIt->sStyleIdentifierD )
- sRet = aIt->sStyleName;
+ if( rWWName == ( *aIt )->sStyleIdentifierD )
+ sRet = ( *aIt )->sStyleName;
++aIt;
}
}
diff --git a/writerfilter/source/dmapper/StyleSheetTable.hxx b/writerfilter/source/dmapper/StyleSheetTable.hxx
index 99e6fd0b9705..73f5a2defebf 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.hxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.hxx
@@ -30,6 +30,8 @@
#ifndef INCLUDED_STYLESHEETTABLE_HXX
#define INCLUDED_STYLESHEETTABLE_HXX
+#include "TblStylePrHandler.hxx"
+
#include <WriterFilterDllApi.hxx>
#include <dmapper/DomainMapper.hxx>
#include <com/sun/star/lang/XComponent.hpp>
@@ -41,6 +43,7 @@ namespace com{ namespace sun { namespace star { namespace text{
class XTextDocument;
}}}}
+
namespace writerfilter {
namespace dmapper
{
@@ -72,6 +75,9 @@ struct StyleSheetEntry
::rtl::OUString sConvertedStyleName;
StyleSheetEntry();
};
+
+typedef boost::shared_ptr<StyleSheetEntry> StyleSheetEntryPtr;
+
class DomainMapper;
class WRITERFILTER_DLLPRIVATE StyleSheetTable :
public Properties,
@@ -92,11 +98,11 @@ public:
virtual void entry(int pos, writerfilter::Reference<Properties>::Pointer_t ref);
void ApplyStyleSheets( FontTablePtr rFontTable );
- const StyleSheetEntry* FindStyleSheetByISTD(const ::rtl::OUString& sIndex);
- const StyleSheetEntry* FindStyleSheetByStyleName(const ::rtl::OUString& rIndex);
- const StyleSheetEntry* FindStyleSheetByConvertedStyleName(const ::rtl::OUString& rIndex);
+ const StyleSheetEntryPtr FindStyleSheetByISTD(const ::rtl::OUString& sIndex);
+ const StyleSheetEntryPtr FindStyleSheetByStyleName(const ::rtl::OUString& rIndex);
+ const StyleSheetEntryPtr FindStyleSheetByConvertedStyleName(const ::rtl::OUString& rIndex);
// returns the parent of the one with the given name - if empty the parent of the current style sheet is returned
- const StyleSheetEntry* FindParentStyleSheet(::rtl::OUString sBaseStyle);
+ const StyleSheetEntryPtr FindParentStyleSheet(::rtl::OUString sBaseStyle);
::rtl::OUString ConvertStyleName( const ::rtl::OUString& rWWName, bool bExtendedSearch = false );
::rtl::OUString GetStyleIdFromIndex(const sal_uInt32 sti);
@@ -110,6 +116,38 @@ private:
};
typedef boost::shared_ptr< StyleSheetTable > StyleSheetTablePtr;
+
+class WRITERFILTER_DLLPRIVATE TableStyleSheetEntry :
+ public StyleSheetEntry
+{
+private:
+ typedef std::map<TblStyleType, PropertyMapPtr> TblStylePrs;
+
+ StyleSheetTable* m_pStyleSheet;
+ TblStylePrs m_aStyles;
+
+public:
+
+ short m_nColBandSize;
+ short m_nRowBandSize;
+
+ // Adds a new tblStylePr to the table style entry. This method
+ // fixes some possible properties conflicts, like borders ones.
+ void AddTblStylePr( TblStyleType nType, PropertyMapPtr pProps );
+
+ // Gets all the properties
+ // + corresponding to the mask,
+ // + from the parent styles
+ PropertyMapPtr GetProperties( sal_Int32 nMask );
+
+ TableStyleSheetEntry( StyleSheetEntry& aEntry, StyleSheetTable* pStyles );
+ ~TableStyleSheetEntry( );
+
+protected:
+ PropertyMapPtr GetLocalPropertiesFromMask( sal_Int32 nMask );
+};
+typedef boost::shared_ptr<TableStyleSheetEntry> TableStyleSheetEntryPtr;
+
}}
#endif //
diff --git a/writerfilter/source/dmapper/TDefTableHandler.cxx b/writerfilter/source/dmapper/TDefTableHandler.cxx
index c5ce8d02a40d..dc2583249da2 100644
--- a/writerfilter/source/dmapper/TDefTableHandler.cxx
+++ b/writerfilter/source/dmapper/TDefTableHandler.cxx
@@ -155,6 +155,11 @@ void TDefTableHandler::attribute(Id rName, Value & rVal)
case NS_rtf::LN_UNUSED2_15: // 0x2877
// ignored
break;
+ case NS_ooxml::LN_CT_Border_themeColor:
+ case NS_ooxml::LN_CT_Border_themeTint:
+ case NS_ooxml::LN_CT_Border_themeShade:
+ // ignored
+ break;
default:
OSL_ENSURE(false, "unknown attribute");
}
@@ -199,6 +204,12 @@ void TDefTableHandler::localResolve(Id rName, writerfilter::Reference<Properties
case NS_rtf::LN_BRCRIGHT:
m_aRightBorderLines.push_back(aBorderLine);
break;
+ case NS_ooxml::LN_CT_TcBorders_insideH:
+ m_aInsideHBorderLines.push_back(aBorderLine);
+ break;
+ case NS_ooxml::LN_CT_TcBorders_insideV:
+ m_aInsideVBorderLines.push_back(aBorderLine);
+ break;
default:;
}
}
@@ -219,6 +230,10 @@ void TDefTableHandler::sprm(Sprm & rSprm)
case NS_ooxml::LN_CT_TcBorders_bottom:
/* WRITERFILTERSTATUS: done: 1, planned: 0, spent: 0 */
case NS_ooxml::LN_CT_TcBorders_right:
+ case NS_ooxml::LN_CT_TcBorders_insideH:
+ case NS_ooxml::LN_CT_TcBorders_insideV:
+ case NS_ooxml::LN_CT_TcBorders_tl2br:
+ case NS_ooxml::LN_CT_TcBorders_tr2bl:
{
writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
localResolve( rSprm.getId(), pProperties );
@@ -281,6 +296,10 @@ void TDefTableHandler::fillCellProperties(
pCellProperties->Insert( PROP_BOTTOM_BORDER, false, uno::makeAny( m_aBottomBorderLines[nCell] ) );
if( m_aRightBorderLines.size() > nCell )
pCellProperties->Insert( PROP_RIGHT_BORDER, false, uno::makeAny( m_aRightBorderLines[nCell] ) );
+ if( m_aInsideHBorderLines.size() > nCell )
+ pCellProperties->Insert( META_PROP_HORIZONTAL_BORDER, false, uno::makeAny( m_aInsideHBorderLines[nCell] ) );
+ if( m_aInsideVBorderLines.size() > nCell )
+ pCellProperties->Insert( META_PROP_VERTICAL_BORDER, false, uno::makeAny( m_aInsideVBorderLines[nCell] ) );
}
/*-- 09.05.2007 13:14:17---------------------------------------------------
diff --git a/writerfilter/source/dmapper/TDefTableHandler.hxx b/writerfilter/source/dmapper/TDefTableHandler.hxx
index 42ca98494ec4..352cb936cc97 100644
--- a/writerfilter/source/dmapper/TDefTableHandler.hxx
+++ b/writerfilter/source/dmapper/TDefTableHandler.hxx
@@ -56,6 +56,10 @@ private:
::std::vector< ::com::sun::star::table::BorderLine > m_aRightBorderLines;
::std::vector< ::com::sun::star::table::BorderLine > m_aTopBorderLines;
::std::vector< ::com::sun::star::table::BorderLine > m_aBottomBorderLines;
+ ::std::vector< ::com::sun::star::table::BorderLine > m_aInsideHBorderLines;
+ ::std::vector< ::com::sun::star::table::BorderLine > m_aInsideVBorderLines;
+ ::std::vector< ::com::sun::star::table::BorderLine > m_aTl2brBorderLines;
+ ::std::vector< ::com::sun::star::table::BorderLine > m_aTr2blBorderLines;
//values of the current border
sal_Int32 m_nLineWidth;
diff --git a/writerfilter/source/dmapper/TablePropertiesHandler.cxx b/writerfilter/source/dmapper/TablePropertiesHandler.cxx
new file mode 100644
index 000000000000..e3739b56e636
--- /dev/null
+++ b/writerfilter/source/dmapper/TablePropertiesHandler.cxx
@@ -0,0 +1,217 @@
+#include "BorderHandler.hxx"
+#include "CellColorHandler.hxx"
+#include "CellMarginHandler.hxx"
+#include "ConversionHelper.hxx"
+#include "MeasureHandler.hxx"
+#include "TablePropertiesHandler.hxx"
+#include "TDefTableHandler.hxx"
+
+#include <ooxml/resourceids.hxx>
+#include <doctok/sprmids.hxx>
+
+#include <com/sun/star/text/SizeType.hpp>
+#include <com/sun/star/text/VertOrientation.hpp>
+
+
+namespace writerfilter {
+namespace dmapper {
+
+ TablePropertiesHandler::TablePropertiesHandler( bool bOOXML ) :
+ m_pTableManager( NULL ),
+ m_bOOXML( bOOXML )
+ {
+ }
+
+
+ TablePropertiesHandler::~TablePropertiesHandler( )
+ {
+ // Do not delete the table manager... this will be done somewhere else
+ m_pTableManager = NULL;
+ }
+
+ bool TablePropertiesHandler::sprm(Sprm & rSprm)
+ {
+ bool bRet = true;
+ sal_uInt32 nSprmId = rSprm.getId();
+ Value::Pointer_t pValue = rSprm.getValue();
+ sal_Int32 nIntValue = ((pValue.get() != NULL) ? pValue->getInt() : 0);
+ /* WRITERFILTERSTATUS: table: table_sprmdata */
+ switch( nSprmId )
+ {
+ /* WRITERFILTERSTATUS: done: 1, planned: 2, spent: 2 */
+ case NS_ooxml::LN_CT_TrPrBase_jc: //90706
+ /* WRITERFILTERSTATUS: done: 1, planned: 0.5, spent: 0.5 */
+ case NS_ooxml::LN_CT_TblPrBase_jc:
+ /* WRITERFILTERSTATUS: done: 1, planned: 2, spent: 2 */
+ case 0x5400: // sprmTJc
+ {
+ //table justification 0: left, 1: center, 2: right
+ sal_Int16 nOrient = ConversionHelper::convertTableJustification( nIntValue );
+ TablePropertyMapPtr pTableMap( new TablePropertyMap );
+ pTableMap->setValue( TablePropertyMap::HORI_ORIENT, nOrient );
+ insertTableProps( pTableMap );
+ }
+ break;
+ /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
+ case 0x9601: // sprmTDxaLeft
+ break;
+ /* WRITERFILTERSTATUS: done: 1, planned: 2, spent: 0 */
+ case 0x9602: // sprmTDxaGapHalf
+ {
+ //m_nGapHalf = ConversionHelper::convertTwipToMM100( nIntValue );
+ TablePropertyMapPtr pPropMap( new TablePropertyMap );
+ pPropMap->setValue( TablePropertyMap::GAP_HALF, ConversionHelper::convertTwipToMM100( nIntValue ) );
+ insertTableProps(pPropMap);
+ }
+ break;
+ /* WRITERFILTERSTATUS: done: 1, planned: 2, spent: 2 */
+ case NS_ooxml::LN_CT_TrPrBase_trHeight: //90703
+ {
+ //contains unit and value
+ writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
+ if( pProperties.get())
+ { //contains attributes x2902 (LN_unit) and x17e2 (LN_trleft)
+ MeasureHandlerPtr pMeasureHandler( new MeasureHandler );
+ pProperties->resolve(*pMeasureHandler);
+ TablePropertyMapPtr pPropMap( new TablePropertyMap );
+ pPropMap->Insert( PROP_SIZE_TYPE, false, uno::makeAny( pMeasureHandler->GetRowHeightSizeType() ));
+ pPropMap->Insert( PROP_HEIGHT, false, uno::makeAny(pMeasureHandler->getMeasureValue() ));
+ insertRowProps(pPropMap);
+ }
+ }
+ break;
+ /* WRITERFILTERSTATUS: done: 1, planned: 2, spent: 0 */
+ case 0x3403: // sprmTFCantSplit
+ case NS_sprm::LN_TCantSplit: // 0x3644
+ {
+ //row can't break across pages if nIntValue == 1
+ TablePropertyMapPtr pPropMap( new TablePropertyMap );
+ pPropMap->Insert( PROP_IS_SPLIT_ALLOWED, false, uno::makeAny(sal_Bool( nIntValue == 1 ? sal_False : sal_True ) ));
+ insertRowProps(pPropMap);
+ }
+ break;
+ /* WRITERFILTERSTATUS: done: 1, planned: 2, spent: 0 */
+ case 0x9407: // sprmTDyaRowHeight
+ {
+ // table row height - negative values indicate 'exact height' - positive 'at least'
+ TablePropertyMapPtr pPropMap( new TablePropertyMap );
+ bool bMinHeight = true;
+ sal_Int16 nHeight = static_cast<sal_Int16>( nIntValue );
+ if( nHeight < 0 )
+ {
+ bMinHeight = false;
+ nHeight *= -1;
+ }
+ pPropMap->Insert( PROP_SIZE_TYPE, false, uno::makeAny(bMinHeight ? text::SizeType::MIN : text::SizeType::FIX ));
+ pPropMap->Insert( PROP_HEIGHT, false, uno::makeAny(ConversionHelper::convertTwipToMM100( nHeight )));
+ insertRowProps(pPropMap);
+ }
+ break;
+ /* WRITERFILTERSTATUS: done: 1, planned: 2, spent: 0 */
+ case NS_ooxml::LN_CT_TcPrBase_vAlign://90694
+ {
+ sal_Int16 nVertOrient = text::VertOrientation::NONE;
+ switch( nIntValue ) //0 - top 1 - center 3 - bottom
+ {
+ case 1: nVertOrient = text::VertOrientation::CENTER; break;
+ case 3: nVertOrient = text::VertOrientation::BOTTOM; break;
+ default:;
+ };
+ TablePropertyMapPtr pCellPropMap( new TablePropertyMap() );
+ pCellPropMap->Insert( PROP_VERT_ORIENT, false, uno::makeAny( nVertOrient ) );
+ //todo: in ooxml import the value of m_ncell is wrong
+ cellProps( pCellPropMap );
+ }
+ break;
+ /* WRITERFILTERSTATUS: done: 1, planned: 2, spent: 0 */
+ case NS_ooxml::LN_CT_TblPrBase_tblBorders: //table borders, might be defined in table style
+ {
+ writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
+ if( pProperties.get())
+ {
+ BorderHandlerPtr pBorderHandler( new BorderHandler(m_bOOXML) );
+ pProperties->resolve(*pBorderHandler);
+ TablePropertyMapPtr pTablePropMap( new TablePropertyMap );
+ pTablePropMap->insert( pBorderHandler->getProperties() );
+ insertTableProps( pTablePropMap );
+ }
+ }
+ break;
+ /* WRITERFILTERSTATUS: done: 1, planned: 2, spent: 0 */
+ case NS_ooxml::LN_CT_TcPrBase_tcBorders ://cell borders
+ //contains CT_TcBorders_left, right, top, bottom
+ {
+ writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
+ if( pProperties.get())
+ {
+ //in OOXML there's one set of borders at each cell (if there is any)
+ TDefTableHandlerPtr pTDefTableHandler( new TDefTableHandler( m_bOOXML ));
+ pProperties->resolve( *pTDefTableHandler );
+ TablePropertyMapPtr pCellPropMap( new TablePropertyMap );
+ pTDefTableHandler->fillCellProperties( 0, pCellPropMap );
+ cellProps( pCellPropMap );
+ }
+ }
+ break;
+ case NS_ooxml::LN_CT_TblPrBase_shd:
+ {
+ writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
+ if( pProperties.get())
+ {
+ CellColorHandlerPtr pCellColorHandler( new CellColorHandler);
+ pProperties->resolve( *pCellColorHandler );
+ TablePropertyMapPtr pTablePropMap( new TablePropertyMap );
+ insertTableProps( pCellColorHandler->getProperties() );
+ }
+ }
+ break;
+ /* WRITERFILTERSTATUS: done: 1, planned: 2, spent: 0 */
+ case 0xd61a : // sprmTCellTopColor
+ /* WRITERFILTERSTATUS: done: 1, planned: 2, spent: 0 */
+ case 0xd61b : // sprmTCellLeftColor
+ /* WRITERFILTERSTATUS: done: 1, planned: 2, spent: 0 */
+ case 0xd61c : // sprmTCellBottomColor
+ /* WRITERFILTERSTATUS: done: 1, planned: 2, spent: 0 */
+ case 0xd61d : // sprmTCellRightColor
+ /* WRITERFILTERSTATUS: done: 1, planned: 2, spent: 0 */
+ case NS_ooxml::LN_CT_TcPrBase_shd:
+ {
+ // each color sprm contains as much colors as cells are in a row
+ //LN_CT_TcPrBase_shd: cell shading contains: LN_CT_Shd_val, LN_CT_Shd_fill, LN_CT_Shd_color
+ writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
+ if( pProperties.get())
+ {
+ CellColorHandlerPtr pCellColorHandler( new CellColorHandler );
+ pProperties->resolve( *pCellColorHandler );
+ cellProps( pCellColorHandler->getProperties());
+ }
+ }
+ break;
+//OOXML table properties
+ /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
+ case NS_ooxml::LN_CT_TblPrBase_tblCellMar: //cell margins
+ {
+ //contains LN_CT_TblCellMar_top, LN_CT_TblCellMar_left, LN_CT_TblCellMar_bottom, LN_CT_TblCellMar_right
+ writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
+ if( pProperties.get())
+ {
+ CellMarginHandlerPtr pCellMarginHandler( new CellMarginHandler );
+ pProperties->resolve( *pCellMarginHandler );
+ TablePropertyMapPtr pMarginProps( new TablePropertyMap );
+ if( pCellMarginHandler->m_bTopMarginValid )
+ pMarginProps->setValue( TablePropertyMap::CELL_MAR_TOP, pCellMarginHandler->m_nTopMargin );
+ if( pCellMarginHandler->m_bBottomMarginValid )
+ pMarginProps->setValue( TablePropertyMap::CELL_MAR_BOTTOM, pCellMarginHandler->m_nBottomMargin );
+ if( pCellMarginHandler->m_bLeftMarginValid )
+ pMarginProps->setValue( TablePropertyMap::CELL_MAR_LEFT, pCellMarginHandler->m_nLeftMargin );
+ if( pCellMarginHandler->m_bRightMarginValid )
+ pMarginProps->setValue( TablePropertyMap::CELL_MAR_RIGHT, pCellMarginHandler->m_nRightMargin );
+ insertTableProps(pMarginProps);
+ }
+ }
+ break;
+ default: bRet = false;
+ }
+ return bRet;
+ }
+}}
diff --git a/writerfilter/source/dmapper/TablePropertiesHandler.hxx b/writerfilter/source/dmapper/TablePropertiesHandler.hxx
new file mode 100644
index 000000000000..68fe40689702
--- /dev/null
+++ b/writerfilter/source/dmapper/TablePropertiesHandler.hxx
@@ -0,0 +1,83 @@
+#ifndef INCLUDED_TABLEPROPERTIESHANDLER_HXX
+#define INCLUDED_TABLEPROPERTIESHANDLER_HXX
+
+#include <PropertyMap.hxx>
+
+#include <resourcemodel/TableManager.hxx>
+#include <WriterFilterDllApi.hxx>
+#include <resourcemodel/WW8ResourceModel.hxx>
+
+#include <boost/shared_ptr.hpp>
+
+#include <vector>
+
+namespace writerfilter {
+namespace dmapper {
+
+
+typedef ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > Handle_t;
+typedef TableManager<Handle_t , TablePropertyMapPtr > DomainMapperTableManager_Base_t;
+
+class TablePropertiesHandler
+{
+private:
+ vector< PropertyMapPtr > m_rPropertiesStack;
+ PropertyMapPtr m_pCurrentProperties;
+ DomainMapperTableManager_Base_t *m_pTableManager;
+ bool m_bOOXML;
+
+public:
+ TablePropertiesHandler( bool bOOXML );
+ virtual ~TablePropertiesHandler( );
+
+ bool sprm(Sprm & sprm);
+
+ inline void SetTableManager( DomainMapperTableManager_Base_t *pTableManager )
+ {
+ m_pTableManager = pTableManager;
+ };
+
+ inline void SetProperties( PropertyMapPtr pProperties )
+ {
+ m_pCurrentProperties = pProperties;
+ };
+
+private:
+
+ inline void cellProps( TablePropertyMapPtr pProps )
+ {
+ if ( m_pTableManager )
+ m_pTableManager->cellProps( pProps );
+ else
+ m_pCurrentProperties->insert( pProps, true );
+ };
+
+ inline void cellPropsByCell( unsigned int i, TablePropertyMapPtr pProps )
+ {
+ if ( m_pTableManager )
+ m_pTableManager->cellPropsByCell( i, pProps );
+ else
+ m_pCurrentProperties->insert( pProps, true );
+ };
+
+ inline void insertRowProps( TablePropertyMapPtr pProps )
+ {
+ if ( m_pTableManager )
+ m_pTableManager->insertRowProps( pProps );
+ else
+ m_pCurrentProperties->insert( pProps, true );
+ };
+
+ inline void insertTableProps( TablePropertyMapPtr pProps )
+ {
+ if ( m_pTableManager )
+ m_pTableManager->insertTableProps( pProps );
+ else
+ m_pCurrentProperties->insert( pProps, true );
+ };
+};
+typedef boost::shared_ptr<TablePropertiesHandler> TablePropertiesHandlerPtr;
+
+} }
+
+#endif
diff --git a/writerfilter/source/dmapper/TblStylePrHandler.cxx b/writerfilter/source/dmapper/TblStylePrHandler.cxx
new file mode 100644
index 000000000000..d6f790990e22
--- /dev/null
+++ b/writerfilter/source/dmapper/TblStylePrHandler.cxx
@@ -0,0 +1,69 @@
+#include <TblStylePrHandler.hxx>
+#include <PropertyMap.hxx>
+#include <ooxml/resourceids.hxx>
+
+namespace writerfilter {
+namespace dmapper {
+
+TblStylePrHandler::TblStylePrHandler( DomainMapper & rDMapper ) :
+ m_rDMapper( rDMapper ),
+ m_pTablePropsHandler( new TablePropertiesHandler( true ) ),
+ m_nType( TBL_STYLE_UNKNOWN ),
+ m_pProperties( new PropertyMap )
+{
+}
+
+TblStylePrHandler::~TblStylePrHandler( )
+{
+ delete m_pTablePropsHandler, m_pTablePropsHandler = NULL;
+}
+
+void TblStylePrHandler::attribute(Id rName, Value & rVal)
+{
+ switch ( rName )
+ {
+ case NS_ooxml::LN_CT_TblStyleOverrideType:
+ {
+ // The tokenid should be the same in the model.xml than
+ // in the TblStyleType enum
+ m_nType = TblStyleType( rVal.getInt( ) );
+ }
+ break;
+ }
+}
+
+void TblStylePrHandler::sprm(Sprm & rSprm)
+{
+ Value::Pointer_t pValue = rSprm.getValue();
+ switch ( rSprm.getId( ) )
+ {
+ case NS_ooxml::LN_CT_PPrBase:
+ case NS_ooxml::LN_EG_RPrBase:
+ case NS_ooxml::LN_CT_TblPrBase:
+ case NS_ooxml::LN_CT_TrPrBase:
+ case NS_ooxml::LN_CT_TcPrBase:
+ resolveSprmProps( rSprm );
+ break;
+ default:
+ // Tables specific properties have to handled here
+ m_pTablePropsHandler->SetProperties( m_pProperties );
+ bool bRet = m_pTablePropsHandler->sprm( rSprm );
+
+ if ( !bRet )
+ {
+ // The DomainMapper can handle some of the properties
+ m_rDMapper.PushStyleSheetProperties( m_pProperties, true );
+ m_rDMapper.sprm( rSprm );
+ m_rDMapper.PopStyleSheetProperties( true );
+ }
+ }
+}
+
+void TblStylePrHandler::resolveSprmProps(Sprm & rSprm)
+{
+ writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
+ if( pProperties.get())
+ pProperties->resolve(*this);
+}
+
+}}
diff --git a/writerfilter/source/dmapper/TblStylePrHandler.hxx b/writerfilter/source/dmapper/TblStylePrHandler.hxx
new file mode 100644
index 000000000000..dd8d2da97690
--- /dev/null
+++ b/writerfilter/source/dmapper/TblStylePrHandler.hxx
@@ -0,0 +1,64 @@
+#ifndef INCLUDED_TBLSTYLEPRHANDLER_HXX
+#define INCLUDED_TBLSTYLEPRHANDLER_HXX
+
+#include "TablePropertiesHandler.hxx"
+
+#include <dmapper/DomainMapper.hxx>
+#include <WriterFilterDllApi.hxx>
+#include <resourcemodel/WW8ResourceModel.hxx>
+#include <boost/shared_ptr.hpp>
+
+namespace writerfilter {
+namespace dmapper {
+
+class DomainMapper;
+class PropertyMap;
+
+enum TblStyleType
+{
+ TBL_STYLE_UNKNOWN,
+ TBL_STYLE_WHOLETABLE,
+ TBL_STYLE_FIRSTROW,
+ TBL_STYLE_LASTROW,
+ TBL_STYLE_FIRSTCOL,
+ TBL_STYLE_LASTCOL,
+ TBL_STYLE_BAND1VERT,
+ TBL_STYLE_BAND2VERT,
+ TBL_STYLE_BAND1HORZ,
+ TBL_STYLE_BAND2HORZ,
+ TBL_STYLE_NECELL,
+ TBL_STYLE_NWCELL,
+ TBL_STYLE_SECELL,
+ TBL_STYLE_SWCELL
+};
+
+class WRITERFILTER_DLLPRIVATE TblStylePrHandler : public Properties
+{
+private:
+ DomainMapper & m_rDMapper;
+ TablePropertiesHandler * m_pTablePropsHandler;
+
+ TblStyleType m_nType;
+ PropertyMapPtr m_pProperties;
+
+public:
+ TblStylePrHandler( DomainMapper & rDMapper );
+ virtual ~TblStylePrHandler( );
+
+ // Properties
+ virtual void attribute(Id Name, Value & val);
+ virtual void sprm(Sprm & sprm);
+
+ inline PropertyMapPtr getProperties() { return m_pProperties; };
+ inline TblStyleType getType() { return m_nType; };
+
+private:
+
+ void resolveSprmProps(Sprm & rSprm);
+};
+
+typedef boost::shared_ptr< TblStylePrHandler > TblStylePrHandlerPtr;
+
+}}
+
+#endif
diff --git a/writerfilter/source/dmapper/ThemeTable.hxx b/writerfilter/source/dmapper/ThemeTable.hxx
index 45bf42f03fae..85b698b966c3 100644
--- a/writerfilter/source/dmapper/ThemeTable.hxx
+++ b/writerfilter/source/dmapper/ThemeTable.hxx
@@ -39,7 +39,6 @@
namespace writerfilter {
namespace dmapper
{
-using namespace std;
struct ThemeTable_Impl;
diff --git a/writerfilter/source/dmapper/makefile.mk b/writerfilter/source/dmapper/makefile.mk
index e7998925a768..5f421643150d 100644
--- a/writerfilter/source/dmapper/makefile.mk
+++ b/writerfilter/source/dmapper/makefile.mk
@@ -43,6 +43,9 @@ ENABLE_EXCEPTIONS=TRUE
# --- Files -------------------------------------
SLOFILES= $(SLO)$/BorderHandler.obj \
+ $(SLO)$/TblStylePrHandler.obj \
+ $(SLO)$/GraphicHelpers.obj \
+ $(SLO)$/TablePropertiesHandler.obj \
$(SLO)$/CellColorHandler.obj \
$(SLO)$/CellMarginHandler.obj \
$(SLO)$/SectionColumnHandler.obj \
@@ -60,9 +63,11 @@ SLOFILES= $(SLO)$/BorderHandler.obj \
$(SLO)$/PropertyIds.obj \
$(SLO)$/StyleSheetTable.obj \
$(SLO)$/TDefTableHandler.obj \
- $(SLO)$/ThemeTable.obj \
+ $(SLO)$/ThemeTable.obj \
+ $(SLO)$/SettingsTable.obj \
$(SLO)$/ModelEventListener.obj\
- $(SLO)$/OLEHandler.obj
+ $(SLO)$/OLEHandler.obj \
+ $(SLO)$/PageBordersHandler.obj
# --- Targets ----------------------------------
diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
index 27a1221ed36c..53f0c423bc9c 100644
--- a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
+++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
@@ -252,6 +252,9 @@ void SAL_CALL OOXMLFastContextHandler::startFastElement
logger("MEMORY", buffer);
#endif
+#if DEBUG
+ clog << "Token: " << fastTokenToId(Element) << endl;
+#endif
attributes(Attribs);
lcl_startFastElement(Element, Attribs);
}
@@ -1870,6 +1873,16 @@ void OOXMLFastContextHandlerTextTable::lcl_startFastElement
{
mnTableDepth++;
+ boost::shared_ptr<OOXMLPropertySet> pProps( new OOXMLPropertySetImpl );
+ {
+ OOXMLValue::Pointer_t pVal
+ (new OOXMLIntegerValue(mnTableDepth));
+ OOXMLProperty::Pointer_t pProp
+ (new OOXMLPropertyImpl(NS_ooxml::LN_tblStart, pVal, OOXMLPropertyImpl::SPRM));
+ pProps->add(pProp);
+ }
+ mpParserState->setCharacterProperties(pProps);
+
startAction(Element);
}
@@ -1954,10 +1967,9 @@ void SAL_CALL ShapesNoAdd::remove(const uno::Reference< drawing::XShape > & xSha
OOXMLFastContextHandlerShape::OOXMLFastContextHandlerShape
(OOXMLFastContextHandler * pContext)
-: OOXMLFastContextHandlerProperties(pContext)
+: OOXMLFastContextHandlerProperties(pContext), m_bShapeSent( false )
{
uno::Reference<uno::XComponentContext> xContext(getComponentContext());
-
if (xContext.is())
{
uno::Reference<XMultiComponentFactory> rServiceManager
@@ -2008,7 +2020,9 @@ void OOXMLFastContextHandlerShape::lcl_startFastElement
startAction(Element);
if (mrShapeContext.is())
+ {
mrShapeContext->startFastElement(Element, Attribs);
+ }
}
void SAL_CALL OOXMLFastContextHandlerShape::startUnknownElement
@@ -2029,28 +2043,43 @@ void OOXMLFastContextHandlerShape::setToken(Token_t nToken)
mrShapeContext->setStartToken(nToken);
}
-void OOXMLFastContextHandlerShape::lcl_endFastElement
-(Token_t Element)
- throw (uno::RuntimeException, xml::sax::SAXException)
+void OOXMLFastContextHandlerShape::sendShape( Token_t Element )
{
- if (mrShapeContext.is())
+ if ( mrShapeContext.is() && !m_bShapeSent )
{
- mrShapeContext->endFastElement(Element);
-
uno::Reference<drawing::XShape> xShape(mrShapeContext->getShape());
-
if (xShape.is())
{
- awt::Point aPoint(xShape->getPosition());
- awt::Size aSize(xShape->getSize());
-
OOXMLValue::Pointer_t
pValue(new OOXMLShapeValue(xShape));
newProperty(NS_ooxml::LN_shape, pValue);
+ m_bShapeSent = true;
+
+ bool bIsPicture = Element == ( NS_picture | OOXML_pic );
+
+ // Notify the dmapper that the shape is ready to use
+ if ( !bIsPicture )
+ mpStream->startShape( xShape );
}
}
+}
+
+void OOXMLFastContextHandlerShape::lcl_endFastElement
+(Token_t Element)
+ throw (uno::RuntimeException, xml::sax::SAXException)
+{
+ if (mrShapeContext.is())
+ {
+ mrShapeContext->endFastElement(Element);
+ sendShape( Element );
+ }
OOXMLFastContextHandlerProperties::lcl_endFastElement(Element);
+
+ // Ending the shape should be the last thing to do
+ bool bIsPicture = Element == ( NS_picture | OOXML_pic );
+ if ( !bIsPicture )
+ mpStream->endShape( );
}
void SAL_CALL OOXMLFastContextHandlerShape::endUnknownElement
@@ -2091,6 +2120,7 @@ OOXMLFastContextHandlerShape::lcl_createFastChildContext
pWrapper->addNamespace(NS_wordprocessingml);
pWrapper->addNamespace(NS_vml_wordprocessingDrawing);
pWrapper->addNamespace(NS_office);
+ pWrapper->addToken( NS_vml|OOXML_textbox );
xContextHandler.set(pWrapper);
}
@@ -2099,6 +2129,7 @@ OOXMLFastContextHandlerShape::lcl_createFastChildContext
break;
}
+
return xContextHandler;
}
@@ -2207,6 +2238,11 @@ void OOXMLFastContextHandlerWrapper::addNamespace(const Id & nId)
mMyNamespaces.insert(nId);
}
+void OOXMLFastContextHandlerWrapper::addToken( Token_t Token )
+{
+ mMyTokens.insert( Token );
+}
+
void OOXMLFastContextHandlerWrapper::lcl_startFastElement
(Token_t Element,
const uno::Reference< xml::sax::XFastAttributeList > & Attribs)
@@ -2251,7 +2287,9 @@ OOXMLFastContextHandlerWrapper::lcl_createFastChildContext
debug_logger->endElement("Wrapper-createChildContext");
#endif
- if (mMyNamespaces.find(nNameSpace) != mMyNamespaces.end())
+ bool bInNamespaces = mMyNamespaces.find(nNameSpace) != mMyNamespaces.end();
+ bool bInTokens = mMyTokens.find( Element ) != mMyTokens.end( );
+ if ( bInNamespaces )
xResult.set(createFromStart(Element, Attribs));
else if (mxContext.is())
{
@@ -2265,6 +2303,12 @@ OOXMLFastContextHandlerWrapper::lcl_createFastChildContext
else
xResult.set(this);
+ if ( bInTokens )
+ {
+ OOXMLFastContextHandlerShape* pShapeCtx = (OOXMLFastContextHandlerShape*)mpParent;
+ pShapeCtx->sendShape( Element );
+ }
+
return xResult;
}
diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx b/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx
index 479cf0e4e78f..e8fb0efc0f7b 100644
--- a/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx
+++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx
@@ -558,6 +558,9 @@ protected:
class OOXMLFastContextHandlerShape: public OOXMLFastContextHandlerProperties
{
+private:
+ bool m_bShapeSent;
+
public:
explicit OOXMLFastContextHandlerShape
(OOXMLFastContextHandler * pContext);
@@ -585,6 +588,9 @@ public:
virtual void setToken(Token_t nToken);
virtual ResourceEnum_t getResource() const { return SHAPE; }
+
+ void sendShape( Token_t Element );
+
protected:
typedef uno::Reference<XFastShapeContextHandler> ShapeContextRef;
ShapeContextRef mrShapeContext;
@@ -649,6 +655,7 @@ public:
virtual ResourceEnum_t getResource() const;
void addNamespace(const Id & nId);
+ void addToken( Token_t Element );
virtual void newProperty(const Id & rId, OOXMLValue::Pointer_t pVal);
virtual void setPropertySet(OOXMLPropertySet::Pointer_t pPropertySet);
@@ -683,6 +690,7 @@ protected:
private:
uno::Reference<XFastContextHandler> mxContext;
set<Id> mMyNamespaces;
+ set<Token_t> mMyTokens;
OOXMLPropertySet::Pointer_t mpPropertySet;
OOXMLFastContextHandler * getFastContextHandler() const;
diff --git a/writerfilter/source/ooxml/makefile.mk b/writerfilter/source/ooxml/makefile.mk
index 2daad7a6c27f..e154a29b01c0 100644
--- a/writerfilter/source/ooxml/makefile.mk
+++ b/writerfilter/source/ooxml/makefile.mk
@@ -151,6 +151,8 @@ OOXMLGPERFFASTTOKENXSL=gperffasttokenhandler.xsl
OOXMLRESOURCEIDSHXX=$(OOXMLHXXOUTDIR)$/resourceids.hxx
+NSPROCESS=namespace_preprocess.pl
+
TOKENXML=$(OOXMLCXXOUTDIR)$/token.xml
TOKENXMLTMP=$(OOXMLCXXOUTDIR)$/token.tmp
@@ -162,6 +164,7 @@ OOXMLVALUESHXX=$(OOXMLCXXOUTDIR)$/OOXMLvalues.hxx
OOXMLVALUESCXX=$(OOXMLCXXOUTDIR)$/OOXMLvalues.cxx
GPERFFASTTOKENHXX=$(OOXMLHXXOUTDIR)$/gperffasttoken.hxx
MODELPROCESSED=$(MISC)$/model_preprocessed.xml
+NSXSL=$(MISC)$/namespacesmap.xsl
OOXMLGENHEADERS= \
$(OOXMLFASTRESOURCESHXX) \
@@ -186,9 +189,15 @@ $(TOKENXMLTMP): $(SOLARVER)$/$(INPATH)$/inc$(UPDMINOREXT)$/oox$/token.txt
$(TOKENXML): tokenxmlheader $(TOKENXMLTMP) tokenxmlfooter
@$(TYPE) tokenxmlheader $(TOKENXMLTMP) tokenxmlfooter > $@
-$(MODELPROCESSED): $(OOXMLPREPROCESSXSL) $(OOXMLMODEL)
+$(MISC)$/$(OOXMLPREPROCESSXSL): $(OOXMLPREPROCESSXSL)
+ @$(COPY) $(PWD)$/$(OOXMLPREPROCESSXSL) $(MISC)
+
+$(NSXSL) : $(OOXMLMODEL) $(SOLARVER)$/$(INPATH)$/inc$(UPDMINOREXT)$/oox$/namespaces.txt $(NSPROCESS)
+ @$(PERL) $(NSPROCESS) $(SOLARVER)$/$(INPATH)$/inc$(UPDMINOREXT)$/oox$/namespaces.txt > $@
+
+$(MODELPROCESSED): $(NSXSL) $(MISC)$/$(OOXMLPREPROCESSXSL) $(OOXMLMODEL)
@echo "Making: " $(@:f)
- $(COMMAND_ECHO)$(XSLTPROC) $(OOXMLPREPROCESSXSL) $(OOXMLMODEL) > $@
+ $(COMMAND_ECHO)$(XSLTPROC) $(NSXSL) $(OOXMLMODEL) > $@
$(OOXMLHXXOUTDIRCREATED):
@$(MKDIRHIER) $(OOXMLHXXOUTDIR)
diff --git a/writerfilter/source/ooxml/model.xml b/writerfilter/source/ooxml/model.xml
index d6c194921e68..add4a80b551e 100644
--- a/writerfilter/source/ooxml/model.xml
+++ b/writerfilter/source/ooxml/model.xml
@@ -1,23 +1,24 @@
<?xml version="1.0"?>
<model xmlns:rng="http://relaxng.org/ns/structure/1.0">
- <namespace-alias name="http://www.w3.org/XML/1998/namespace" alias="xml" id="1"/>
- <namespace-alias name="http://schemas.openxmlformats.org/officeDocument/2006/relationships" alias="relationships" id="3"/>
- <namespace-alias name="urn:schemas-microsoft-com:office:office" alias="office" id="32"/>
- <namespace-alias name="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme" alias="theme" id="14"/>
- <namespace-alias name="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" alias="wordprocessingDrawing" id="24"/>
- <namespace-alias name="http://schemas.openxmlformats.org/drawingml/2006/main" alias="drawingml" id="21"/>
- <namespace-alias name="urn:schemas-microsoft-com:vml" alias="vml" id="31"/>
- <namespace-alias name="http://schemas.openxmlformats.org/drawingml/2006/picture" alias="picture" id="25"/>
- <namespace-alias name="urn:schemas-microsoft-com:office:word" alias="vml_wordprocessingDrawing" id="33"/>
- <namespace-alias name="http://schemas.openxmlformats.org/wordprocessingml/2006/main" alias="wordprocessingml" id="60"/>
- <namespace-alias name="http://schemas.openxmlformats.org/officeDocument/2006/math" alias="math" id="61"/>
- <namespace-alias name="http://schemas.openxmlformats.org/schemaLibrary/2006/main" alias="schemaLibrary" id="62"/>
- <namespace-alias name="http://sprm" alias="sprm" id="99"/>
+ <namespace-alias name="http://www.w3.org/XML/1998/namespace" alias="xml" id="XML"/>
+ <namespace-alias name="http://schemas.openxmlformats.org/officeDocument/2006/relationships" alias="relationships" id="RELATIONSHIPS"/>
+ <namespace-alias name="urn:schemas-microsoft-com:office:office" alias="office" id="OFFICE"/>
+ <namespace-alias name="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme" alias="theme" id="THEME"/>
+ <namespace-alias name="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" alias="wordprocessingDrawing" id="DOC_DRAWINGML"/>
+ <namespace-alias name="http://schemas.openxmlformats.org/drawingml/2006/main" alias="drawingml" id="DRAWINGML"/>
+ <namespace-alias name="urn:schemas-microsoft-com:vml" alias="vml" id="VML"/>
+ <namespace-alias name="http://schemas.openxmlformats.org/drawingml/2006/picture" alias="picture" id="PICTURE"/>
+ <namespace-alias name="urn:schemas-microsoft-com:office:word" alias="vml_wordprocessingDrawing" id="VML_DOC"/>
+ <namespace-alias name="http://schemas.openxmlformats.org/wordprocessingml/2006/main" alias="wordprocessingml" id="DOC"/>
+ <namespace-alias name="http://schemas.openxmlformats.org/officeDocument/2006/math" alias="math" id="MATH"/>
+ <namespace-alias name="http://schemas.openxmlformats.org/schemaLibrary/2006/main" alias="schemaLibrary" id="SML"/>
+ <namespace-alias name="http://sprm" alias="sprm" id="SPRM"/>
<token tokenid="ooxml:shape"/>
<token tokenid="ooxml:token"/>
<token tokenid="ooxml:inputstream"/>
<token tokenid="ooxml:trackchange"/>
<token tokenid="ooxml:object"/>
+ <token tokenid="ooxml:tblStart"/>
<namespace name="dml-stylesheet" url="http://schemas.openxmlformats.org/drawingml/2006/main" file="dml-stylesheet.rng">
<start name="theme"/>
<start name="themeOverride"/>
@@ -6505,11 +6506,17 @@
</element>
</choice>
</define>
+ <define name="CT_PositionOffset">
+ <ref name="ST_PositionOffset"/>
+ </define>
<define name="ST_PositionOffset">
<data type="int">
<xs:documentation>Absolute Position Offset Value</xs:documentation>
</data>
</define>
+ <define name="CT_AlignH">
+ <ref name="ST_AlignH"/>
+ </define>
<define name="ST_AlignH">
<list>
<xs:documentation>Relative Horizontal Alignment Positions</xs:documentation>
@@ -6553,10 +6560,10 @@
<define name="CT_PosH">
<choice>
<element name="align">
- <ref name="ST_AlignH"/>
+ <ref name="CT_AlignH"/>
</element>
<element name="posOffset">
- <ref name="ST_PositionOffset"/>
+ <ref name="CT_PositionOffset"/>
</element>
</choice>
<attribute name="relativeFrom">
@@ -6564,6 +6571,9 @@
<xs:documentation>Horizontal Position Relative Base</xs:documentation>
</attribute>
</define>
+ <define name="CT_AlignV">
+ <ref name="ST_AlignV"/>
+ </define>
<define name="ST_AlignV">
<list>
<xs:documentation>Vertical Alignment Definition</xs:documentation>
@@ -6607,10 +6617,10 @@
<define name="CT_PosV">
<choice>
<element name="align">
- <ref name="ST_AlignV"/>
+ <ref name="CT_AlignV"/>
</element>
<element name="posOffset">
- <ref name="ST_PositionOffset"/>
+ <ref name="CT_PositionOffset"/>
</element>
</choice>
<attribute name="relativeFrom">
@@ -6793,6 +6803,7 @@
<element name="wrapTopAndBottom" tokenid="ooxml:EG_WrapType_wrapTopAndBottom"/>
</resource>
<resource name="ST_PositionOffset" resource="Integer" generated="yes"/>
+ <resource name="CT_PositionOffset" resource="IntegerValue"/>
<resource name="ST_AlignH" resource="List" generated="yes">
<value name="left" tokenid="ooxml:Value_wordprocessingDrawing_ST_AlignH_left">left</value>
<value name="right" tokenid="ooxml:Value_wordprocessingDrawing_ST_AlignH_right">right</value>
@@ -6800,6 +6811,7 @@
<value name="inside" tokenid="ooxml:Value_wordprocessingDrawing_ST_AlignH_inside">inside</value>
<value name="outside" tokenid="ooxml:Value_wordprocessingDrawing_ST_AlignH_outside">outside</value>
</resource>
+ <resource name="CT_AlignH" resource="ListValue"/>
<resource name="ST_RelFromH" resource="List" generated="yes">
<value name="margin" tokenid="ooxml:Value_wordprocessingDrawing_ST_RelFromH_margin">margin</value>
<value name="page" tokenid="ooxml:Value_wordprocessingDrawing_ST_RelFromH_page">page</value>
@@ -6815,6 +6827,7 @@
<element name="posOffset" tokenid="ooxml:CT_PosH_posOffset"/>
<attribute name="relativeFrom" tokenid="ooxml:CT_PosH_relativeFrom"/>
</resource>
+ <resource name="CT_AlignV" resource="ListValue"/>
<resource name="ST_AlignV" resource="List" generated="yes">
<value name="top" tokenid="ooxml:Value_wordprocessingDrawing_ST_AlignV_top">top</value>
<value name="bottom" tokenid="ooxml:Value_wordprocessingDrawing_ST_AlignV_bottom">bottom</value>
@@ -8326,8 +8339,6 @@
<element name="nvPicPr" tokenid="ooxml:CT_Picture_nvPicPr"/>
<element name="blipFill" tokenid="ooxml:CT_Picture_blipFill"/>
<element name="spPr" tokenid="ooxml:CT_Picture_spPr"/>
- <action name="start" action="mark" sendtokenid="ooxml:mark_shape" value="0"/>
- <action name="end" action="mark" sendtokenid="ooxml:mark_shape" value="1"/>
</resource>
<resource name="pic" resource="Properties">
<element name="pic" tokenid="ooxml:pic_pic"/>
@@ -15471,19 +15482,19 @@
</group>
<optional>
<attribute name="zOrder">
- <text/>
+ <ref name="ST_PageBorderZOrder"/>
<xs:documentation>Z-Ordering of Page Border</xs:documentation>
</attribute>
</optional>
<optional>
<attribute name="display">
- <text/>
+ <ref name="ST_PageBorderDisplay"/>
<xs:documentation>Pages to Display Page Borders</xs:documentation>
</attribute>
</optional>
<optional>
<attribute name="offsetFrom">
- <text/>
+ <ref name="ST_PageBorderOffset"/>
<xs:documentation>Page Border Positioning</xs:documentation>
</attribute>
</optional>
@@ -16563,15 +16574,18 @@
</element>
</optional>
</define>
+ <define name="CT_ParaTrackChange">
+ <ref name="CT_TrackChange"/>
+ </define>
<define name="EG_ParaRPrTrackChanges">
<optional>
<element name="ins">
- <ref name="CT_TrackChange"/>
+ <ref name="CT_ParaTrackChange"/>
</element>
</optional>
<optional>
<element name="del">
- <ref name="CT_TrackChange"/>
+ <ref name="CT_ParaTrackChange"/>
</element>
</optional>
<optional>
@@ -17550,7 +17564,7 @@
</define>
<define name="CT_Cnf">
<attribute name="val">
- <text/>
+ <ref name="ST_Cnf"/>
<xs:documentation>Conditional Formatting Bit Mask</xs:documentation>
</attribute>
</define>
@@ -19867,16 +19881,16 @@
</choice>
</list>
</define>
- <define name="CT_TblStylePr">
+ <define name="CT_Style_tblStylePr">
<group>
<optional>
<element name="pPr">
- <ref name="CT_PPr"/>
+ <ref name="CT_PPrBase"/>
</element>
</optional>
<optional>
<element name="rPr">
- <ref name="CT_RPr"/>
+ <ref name="EG_RPrBase"/>
</element>
</optional>
<optional>
@@ -19886,20 +19900,29 @@
</optional>
<optional>
<element name="trPr">
- <ref name="CT_TrPr"/>
+ <ref name="CT_TrPrBase"/>
</element>
</optional>
<optional>
<element name="tcPr">
- <ref name="CT_TcPr"/>
+ <ref name="CT_TcPrBase"/>
</element>
</optional>
</group>
<attribute name="type">
- <text/>
+ <ref name="ST_TblStyleOverrideType"/>
<xs:documentation>Table Style Conditional Formatting Type</xs:documentation>
</attribute>
</define>
+ <define name="CT_Style_TblPr">
+ <ref name="CT_TblPrBase"/>
+ </define>
+ <define name="CT_Style_TrPr">
+ <ref name="CT_TrPrBase"/>
+ </define>
+ <define name="CT_Style_TcPr">
+ <ref name="CT_TcPrBase"/>
+ </define>
<define name="ST_StyleType">
<list>
<xs:documentation>Style Types</xs:documentation>
@@ -19999,12 +20022,12 @@
</optional>
<optional>
<element name="pPr">
- <ref name="CT_PPr"/>
+ <ref name="CT_PPrBase"/>
</element>
</optional>
<optional>
<element name="rPr">
- <ref name="CT_RPr"/>
+ <ref name="EG_RPrBase"/>
</element>
</optional>
<optional>
@@ -20014,17 +20037,17 @@
</optional>
<optional>
<element name="trPr">
- <ref name="CT_TrPr"/>
+ <ref name="CT_TrPrBase"/>
</element>
</optional>
<optional>
<element name="tcPr">
- <ref name="CT_TcPr"/>
+ <ref name="CT_TcPrBase"/>
</element>
</optional>
<zeroOrMore>
<element name="tblStylePr">
- <ref name="CT_TblStylePr"/>
+ <ref name="CT_Style_tblStylePr"/>
</element>
</zeroOrMore>
</group>
@@ -21617,6 +21640,11 @@
<attribute name="author" tokenid="ooxml:CT_TrackChange_author"/>
<attribute name="date" tokenid="ooxml:CT_TrackChange_date"/>
</resource>
+ <resource name="CT_ParaTrackChange" resource="Properties">
+ <action name="start" action="tokenproperty"/>
+ <action name="start" action="propagateCharacterPropertiesAsSet" sendtokenid="ooxml:paratrackchange"/>
+ <action name="start" action="clearProps"/>
+ </resource>
<resource name="CT_CellMergeTrackChange" resource="Properties">
<attribute name="vMerge" tokenid="ooxml:CT_CellMergeTrackChange_vMerge"/>
<attribute name="vMergeOrig" tokenid="ooxml:CT_CellMergeTrackChange_vMergeOrig"/>
@@ -21681,6 +21709,7 @@
<action name="start" action="tokenproperty"/>
<action name="start" action="propagateCharacterPropertiesAsSet" sendtokenid="ooxml:trackchange"/>
<action name="start" action="clearProps"/>
+ <action name="end" action="mark" sendtokenid="ooxml:endtrackchange"/>
</resource>
<resource name="CT_NumPr" resource="Properties">
<kind name="paragraph"/>
@@ -21775,8 +21804,6 @@
<resource name="CT_Picture" resource="Shape">
<element name="movie" tokenid="ooxml:CT_Picture_movie"/>
<element name="control" tokenid="ooxml:CT_Picture_control"/>
- <action name="start" action="mark" sendtokenid="ooxml:mark_shape" value="0"/>
- <action name="end" action="mark" sendtokenid="ooxml:mark_shape" value="1"/>
<action name="end" action="sendPropertiesWithId" sendtokenid="ooxml:object"/>
<action name="end" action="clearProps"/>
</resource>
@@ -22251,6 +22278,8 @@
<resource name="CT_RPrOriginal" resource="Properties"/>
<resource name="CT_ParaRPrOriginal" resource="Properties"/>
<resource name="CT_ParaRPr" resource="Properties">
+ <element name="ins" tokenid="ooxml:CT_ParaRPr_ins"/>
+ <element name="del" tokenid="ooxml:CT_ParaRPr_del"/>
<element name="rPrChange" tokenid="ooxml:CT_ParaRPr_rPrChange"/>
</resource>
<resource name="ST_RubyAlign" resource="List" generated="yes">
@@ -22863,20 +22892,20 @@
<element name="num" tokenid="ooxml:CT_Numbering_num"/>
<element name="numIdMacAtCleanup" tokenid="ooxml:CT_Numbering_numIdMacAtCleanup"/>
</resource>
- <resource name="ST_TblStyleOverrideType" resource="List" generated="yes">
- <value name="wholeTable" tokenid="ooxml:Value_wordprocessingml_ST_TblStyleOverrideType_wholeTable">wholeTable</value>
- <value name="firstRow" tokenid="ooxml:Value_wordprocessingml_ST_TblStyleOverrideType_firstRow">firstRow</value>
- <value name="lastRow" tokenid="ooxml:Value_wordprocessingml_ST_TblStyleOverrideType_lastRow">lastRow</value>
- <value name="firstCol" tokenid="ooxml:Value_wordprocessingml_ST_TblStyleOverrideType_firstCol">firstCol</value>
- <value name="lastCol" tokenid="ooxml:Value_wordprocessingml_ST_TblStyleOverrideType_lastCol">lastCol</value>
- <value name="band1Vert" tokenid="ooxml:Value_wordprocessingml_ST_TblStyleOverrideType_band1Vert">band1Vert</value>
- <value name="band2Vert" tokenid="ooxml:Value_wordprocessingml_ST_TblStyleOverrideType_band2Vert">band2Vert</value>
- <value name="band1Horz" tokenid="ooxml:Value_wordprocessingml_ST_TblStyleOverrideType_band1Horz">band1Horz</value>
- <value name="band2Horz" tokenid="ooxml:Value_wordprocessingml_ST_TblStyleOverrideType_band2Horz">band2Horz</value>
- <value name="neCell" tokenid="ooxml:Value_wordprocessingml_ST_TblStyleOverrideType_neCell">neCell</value>
- <value name="nwCell" tokenid="ooxml:Value_wordprocessingml_ST_TblStyleOverrideType_nwCell">nwCell</value>
- <value name="seCell" tokenid="ooxml:Value_wordprocessingml_ST_TblStyleOverrideType_seCell">seCell</value>
- <value name="swCell" tokenid="ooxml:Value_wordprocessingml_ST_TblStyleOverrideType_swCell">swCell</value>
+ <resource name="ST_TblStyleOverrideType" resource="List">
+ <value tokenid="1">wholeTable</value>
+ <value tokenid="2">firstRow</value>
+ <value tokenid="3">lastRow</value>
+ <value tokenid="4">firstCol</value>
+ <value tokenid="5">lastCol</value>
+ <value tokenid="6">band1Vert</value>
+ <value tokenid="7">band2Vert</value>
+ <value tokenid="8">band1Horz</value>
+ <value tokenid="9">band2Horz</value>
+ <value tokenid="10">neCell</value>
+ <value tokenid="11">nwCell</value>
+ <value tokenid="12">seCell</value>
+ <value tokenid="13">swCell</value>
</resource>
<resource name="ST_StyleType" resource="List">
<value tokenid="1">paragraph</value>
@@ -22884,6 +22913,14 @@
<value tokenid="3">table</value>
<value tokenid="4">numbering</value>
</resource>
+ <resource name="CT_Style_tblStylePr" resource="Properties">
+ <element name="pPr" tokenid="ooxml:CT_PPrBase"/>
+ <element name="rPr" tokenid="ooxml:EG_RPrBase"/>
+ <element name="tblPr" tokenid="ooxml:CT_TblPrBase"/>
+ <element name="trPr" tokenid="ooxml:CT_TrPrBase"/>
+ <element name="tcPr" tokenid="ooxml:CT_TcPrBase"/>
+ <attribute name="type" tokenid="ooxml:CT_TblStyleOverrideType"/>
+ </resource>
<resource name="CT_Style" resource="Properties">
<element name="name" tokenid="ooxml:CT_Style_name"/>
<element name="aliases" tokenid="ooxml:CT_Style_aliases"/>
diff --git a/writerfilter/source/ooxml/modelpreprocess.xsl b/writerfilter/source/ooxml/modelpreprocess.xsl
index 51efa93f33f1..90376fc08903 100644
--- a/writerfilter/source/ooxml/modelpreprocess.xsl
+++ b/writerfilter/source/ooxml/modelpreprocess.xsl
@@ -225,4 +225,4 @@
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
-</xsl:stylesheet> \ No newline at end of file
+</xsl:stylesheet>
diff --git a/writerfilter/source/ooxml/namespace_preprocess.pl b/writerfilter/source/ooxml/namespace_preprocess.pl
new file mode 100644
index 000000000000..22c172329f61
--- /dev/null
+++ b/writerfilter/source/ooxml/namespace_preprocess.pl
@@ -0,0 +1,65 @@
+$ARGV0 = shift @ARGV;
+
+print <<EOF;
+<?xml version="1.0"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:output method="xml"/>
+
+ <xsl:include href="./modelpreprocess.xsl"/>
+
+ <xsl:template match="namespace-alias[\@id]">
+ <xsl:variable name="value">
+ <xsl:call-template name="getnamespaceid">
+ <xsl:with-param name="id" select="\@id" />
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:copy>
+ <xsl:apply-templates select="@*"/>
+ <xsl:attribute name="id">
+ <xsl:value-of select="\$value"/>
+ </xsl:attribute>
+ </xsl:copy>
+ </xsl:template>
+
+ <xsl:template name="getnamespaceid">
+ <xsl:param name='id'/>
+ <xsl:choose>
+EOF
+
+
+# print the mapping
+open ( NAMESPACES, $ARGV0 ) || die "can't open namespace file: $!";
+$group = 0;
+$i = 1;
+while ( <NAMESPACES> )
+{
+ chomp( $_ );
+ $_ =~ s/\s*//g;
+ if ( $_ =~ m/^$/ )
+ {
+ # Start a new group
+ $i = 0;
+ $group++;
+ }
+ elsif ( $_ =~ m/^[^#]/ )
+ {
+ # Neither an empty line nor a comment
+ $_ =~ /^[a-zA-Z0-9-_]+$/ or die "Invalid namespace token $_";
+ $_ =~ s/-/_/g;
+ $no = $group*10 + $i;
+ print <<EOF;
+ <xsl:when test="\$id = '$_'">
+ <xsl:text>$no</xsl:text>
+ </xsl:when>
+EOF
+ ++$i;
+ }
+}
+
+print <<EOF;
+ </xsl:choose>
+ </xsl:template>
+
+</xsl:stylesheet>
+EOF
diff --git a/writerfilter/source/ooxml/resourcestools.xsl b/writerfilter/source/ooxml/resourcestools.xsl
index 9b17e4d3126f..7296cbd34154 100644
--- a/writerfilter/source/ooxml/resourcestools.xsl
+++ b/writerfilter/source/ooxml/resourcestools.xsl
@@ -92,6 +92,20 @@
match="rng:define" use="ancestor::rng:grammar/@application"/>
<xsl:key name="namespace-aliases" match="//namespace-alias" use="@name"/>
+
+ <!-- Tiny template helping devs to debug -->
+ <xsl:template name="dbg_path">
+ <xsl:text>/*</xsl:text>
+ <xsl:for-each select="ancestor::*">
+ <xsl:value-of select="name(.)"/>
+ <xsl:text>/</xsl:text>
+ </xsl:for-each>
+ <xsl:value-of select="name(.)"/>
+ <xsl:text>[@name=</xsl:text>
+ <xsl:value-of select="@name"/>
+ <xsl:text>]</xsl:text>
+ <xsl:text>*/</xsl:text>
+ </xsl:template>
<xsl:template name="licenseheader">
<xsl:text>
@@ -398,7 +412,7 @@ public:
Generate switch body for createFastChildContext
-->
<xsl:template name="switchbodycreatechildcontext">
- <xsl:for-each select=".//rng:element[@name]">
+ <xsl:for-each select=".//rng:element[@name]">
<xsl:call-template name="caselabelfasttoken"/>
<xsl:variable name="createstatement">
<xsl:call-template name="fastelementcreatestatement"/>
@@ -1543,6 +1557,12 @@ uno::Reference &lt; xml::sax::XFastParser &gt; OOXMLStreamImpl::getFastParser()
</xsl:if>
</xsl:for-each>
</xsl:template>
+
+ <xsl:template name="fastcharactersstringvalue">
+ <xsl:text>
+
+ msValue = sText;</xsl:text>
+ </xsl:template>
<xsl:template name="fastattributesstringvalue">
<xsl:for-each select=".//rng:attribute">
@@ -1555,6 +1575,12 @@ uno::Reference &lt; xml::sax::XFastParser &gt; OOXMLStreamImpl::getFastParser()
<xsl:text>);</xsl:text>
</xsl:for-each>
</xsl:template>
+
+ <xsl:template name="fastcharactersintvalue">
+ <xsl:text>
+
+ mnValue = sText.toInt32();</xsl:text>
+ </xsl:template>
<xsl:template name="fastattributesintvalue">
<xsl:for-each select=".//rng:attribute">
@@ -1568,6 +1594,12 @@ uno::Reference &lt; xml::sax::XFastParser &gt; OOXMLStreamImpl::getFastParser()
</xsl:for-each>
</xsl:template>
+ <xsl:template name="fastcharactershexvalue">
+ <xsl:text>
+
+ mnValue = sText.toInt32(16);</xsl:text>
+ </xsl:template>
+
<xsl:template name="fastattributeshexvalue">
<xsl:for-each select=".//rng:attribute">
<xsl:text>
@@ -1580,6 +1612,12 @@ uno::Reference &lt; xml::sax::XFastParser &gt; OOXMLStreamImpl::getFastParser()
</xsl:for-each>
</xsl:template>
+ <xsl:template name="fastcharactersboolvalue">
+ <xsl:text>
+
+ setValue( sText );</xsl:text>
+ </xsl:template>
+
<xsl:template name="fastattributesboolvalue">
<xsl:for-each select=".//rng:attribute">
<xsl:text>
@@ -1592,6 +1630,35 @@ uno::Reference &lt; xml::sax::XFastParser &gt; OOXMLStreamImpl::getFastParser()
</xsl:for-each>
</xsl:template>
+ <xsl:template name="fastcharacterslistvalue">
+ <xsl:variable name="bodywithns">
+ <xsl:for-each select="rng:ref">
+ <xsl:variable name="refname" select="@name"/>
+ <xsl:variable name="refns">
+ <xsl:call-template name="searchdefinenamespace">
+ <xsl:with-param name="name" select="@name"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="valname">
+ <xsl:for-each select="/model/namespace[@name=substring-before($refns, ':')]">
+ <xsl:for-each select="./rng:grammar/rng:define[@name=substring-after($refns, ':')]">
+ <xsl:call-template name="valuenamefordefine"/>
+ </xsl:for-each>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:text>
+ mpValue = OOXMLValue::Pointer_t (new </xsl:text>
+ <xsl:value-of select="$valname"/>
+ <xsl:text>( sText ) );</xsl:text>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:if test="string-length($bodywithns) > 0">
+ <xsl:text>
+ </xsl:text>
+ <xsl:value-of select="$bodywithns"/>
+ </xsl:if>
+ </xsl:template>
+
<xsl:template name="fastattributeslistvalue">
<xsl:for-each select=".//rng:attribute">
<xsl:variable name="myfasttoken">
@@ -1739,9 +1806,9 @@ void </xsl:text>
</xsl:if>
<!-- </xsl:if> -->
</xsl:template>
-
+
<xsl:template name="fastelementcreatestatement">
- <xsl:for-each select=".//rng:ref">
+ <xsl:for-each select=".//rng:ref">
<xsl:choose>
<xsl:when test="@name='BUILT_IN_ANY_TYPE'">
<xsl:text>createFromStart(Element, Attribs)</xsl:text>
@@ -1999,6 +2066,29 @@ void </xsl:text>
<xsl:template name="fastcharactersbody">
<xsl:variable name="name" select="@name"/>
+ <!-- ST values as text -->
+ <xsl:variable name="resource">
+ <xsl:call-template name="contextresource"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$resource = 'StringValue'">
+ <xsl:call-template name="fastcharactersstringvalue"/>
+ </xsl:when>
+ <xsl:when test="$resource = 'IntegerValue'">
+ <xsl:call-template name="fastcharactersintvalue"/>
+ </xsl:when>
+ <xsl:when test="$resource = 'HexValue'">
+ <xsl:call-template name="fastcharactershexvalue"/>
+ </xsl:when>
+ <xsl:when test="$resource = 'BooleanValue'">
+ <xsl:call-template name="fastcharactersboolvalue"/>
+ </xsl:when>
+ <xsl:when test="$resource = 'ListValue'">
+ <xsl:call-template name="fastcharacterslistvalue"/>
+ </xsl:when>
+ </xsl:choose>
+
+ <!-- characters action -->
<xsl:for-each select="ancestor::namespace/resource[@name = $name]//action[@name='characters']">
<xsl:call-template name="chooseaction"/>
</xsl:for-each>
diff --git a/writerfilter/source/resourcemodel/WW8Analyzer.cxx b/writerfilter/source/resourcemodel/WW8Analyzer.cxx
index 729d5bf54cb4..15a8470bac8b 100644
--- a/writerfilter/source/resourcemodel/WW8Analyzer.cxx
+++ b/writerfilter/source/resourcemodel/WW8Analyzer.cxx
@@ -168,6 +168,14 @@ void WW8Analyzer::info(const string & /*info*/)
{
}
+void WW8Analyzer::startShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > /*xShape*/ )
+{
+}
+
+void WW8Analyzer::endShape( )
+{
+}
+
void WW8Analyzer::dumpStats(ostream & o) const
{
{
diff --git a/writerfilter/source/resourcemodel/WW8Analyzer.hxx b/writerfilter/source/resourcemodel/WW8Analyzer.hxx
index dbedd3195439..339b7adeab61 100644
--- a/writerfilter/source/resourcemodel/WW8Analyzer.hxx
+++ b/writerfilter/source/resourcemodel/WW8Analyzer.hxx
@@ -92,6 +92,8 @@ public:
virtual void substream(Id name,
writerfilter::Reference<Stream>::Pointer_t ref);
virtual void info(const string & info);
+ virtual void startShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape );
+ virtual void endShape( );
void dumpStats(ostream & o) const;
};
diff --git a/writerfilter/source/resourcemodel/resourcemodel.cxx b/writerfilter/source/resourcemodel/resourcemodel.cxx
index c96a04716bfa..0bfa9845ffe8 100644
--- a/writerfilter/source/resourcemodel/resourcemodel.cxx
+++ b/writerfilter/source/resourcemodel/resourcemodel.cxx
@@ -267,6 +267,16 @@ void WW8StreamHandler::endCharacterGroup()
output.addItem("</character-group>");
}
+void WW8StreamHandler::startShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > /*xShape*/ )
+{
+ output.addItem("<shape>");
+}
+
+void WW8StreamHandler::endShape( )
+{
+ output.addItem( "</shape>" );
+}
+
void WW8StreamHandler::text(const sal_uInt8 * data, size_t len)
{
string tmpStr = "<text>";
diff --git a/writerfilter/source/resourcemodel/resourcemodel.hxx b/writerfilter/source/resourcemodel/resourcemodel.hxx
index 681a83c23320..314cc4a83c8f 100644
--- a/writerfilter/source/resourcemodel/resourcemodel.hxx
+++ b/writerfilter/source/resourcemodel/resourcemodel.hxx
@@ -51,6 +51,9 @@ public:
virtual void table(Id name,
writerfilter::Reference<Table>::Pointer_t ref);
+ virtual void startShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape );
+ virtual void endShape( );
+
virtual void substream(Id name, writerfilter::Reference<Stream>::Pointer_t ref);
virtual void info(const string & info);
diff --git a/writerperfect/prj/d.lst b/writerperfect/prj/d.lst
index 7cd3b89ad092..5b5852c6a86f 100644
--- a/writerperfect/prj/d.lst
+++ b/writerperfect/prj/d.lst
@@ -1,4 +1,4 @@
..\%__SRC%\lib\libwpft*.so %_DEST%\lib%_EXT%
-..\%__SRC%\bin\wpft*.dll %_DEST%\lib%_EXT%
+..\%__SRC%\bin\wpft*.dll %_DEST%\bin%_EXT%
..\%__SRC%\bin\wpftgo.dll %_DEST%\bin%_EXT%\wpftgo.dll
..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\*.dylib
diff --git a/xmloff/source/script/XMLEventExport.cxx b/xmloff/source/script/XMLEventExport.cxx
index cf8156ae21e8..c39dda6d4e18 100644
--- a/xmloff/source/script/XMLEventExport.cxx
+++ b/xmloff/source/script/XMLEventExport.cxx
@@ -341,6 +341,11 @@ const XMLEventNameTranslation aStandardEventTable[] =
{ "OnSaveToFailed", XML_NAMESPACE_OFFICE, "save-to-failed" },
{ "OnSubComponentOpened", XML_NAMESPACE_OFFICE, "subcomponent-opened" },
{ "OnSubComponentClosed", XML_NAMESPACE_OFFICE, "subcomponent-closed" },
+ { "OnStorageChanged", XML_NAMESPACE_OFFICE, "storage-changed" },
+ { "OnMailMergeFinished", XML_NAMESPACE_OFFICE, "mail-merge-finished" },
+ { "OnFieldMerge", XML_NAMESPACE_OFFICE, "field-merge" },
+ { "OnFieldMergeFinished", XML_NAMESPACE_OFFICE, "field-merge-finished" },
+ { "OnLayoutFinished", XML_NAMESPACE_OFFICE, "layout-finished" },
{ NULL, 0, 0 }
};